Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. From 38dbeb4a3cf9c7c08b6b54bbf1956018ef55a394 Mon Sep 17 00:00:00 2001
  2. From: Steve Bennett <steveb@workware.net.au>
  3. Date: Sun, 1 Mar 2015 09:50:20 +1000
  4. Subject: [PATCH] @top_srcdir@ should be a relative directory
  5.  
  6. When substituted in make-template, @top_srcdir@ should be
  7. adjusted like @srcdir@ according to the current output directory.
  8.  
  9. Reported-by: Baptiste Daroussin <bapt@freebsd.org>
  10. Signed-off-by: Steve Bennett <steveb@workware.net.au>
  11. ---
  12. examples/testbed/subdir/Makefile.in | 3 +++
  13. lib/system.tcl | 8 +++++---
  14. 2 files changed, 8 insertions(+), 3 deletions(-)
  15.  
  16. diff --git a/examples/testbed/subdir/Makefile.in b/examples/testbed/subdir/Makefile.in
  17. index 3f4831b..556c715 100644
  18. --- a/examples/testbed/subdir/Makefile.in
  19. +++ b/examples/testbed/subdir/Makefile.in
  20. @@ -4,3 +4,6 @@ CC = @CC@
  21. # This one is special in that it will be relative
  22. # to where this file is created
  23. srcdir = @srcdir@
  24. +
  25. +# And this will be relative to the top level source directory
  26. +top_srcdir = @top_srcdir@
  27. diff --git a/lib/system.tcl b/lib/system.tcl
  28. index 2712e39..0166616 100644
  29. --- a/lib/system.tcl
  30. +++ b/lib/system.tcl
  31. @@ -109,9 +109,10 @@ proc write-if-changed {file buf {script {}}} {
  32. # Each pattern of the form @define@ is replaced the the corresponding
  33. # define, if it exists, or left unchanged if not.
  34. #
  35. -# The special value @srcdir@ is subsituted with the relative
  36. +# The special value @srcdir@ is substituted with the relative
  37. # path to the source directory from the directory where the output
  38. -# file is created. Use @top_srcdir@ for the absolute path.
  39. +# file is created, while the special value @top_srcdir@ is substituted
  40. +# with the relative path to the top level source directory.
  41. #
  42. # Conditional sections may be specified as follows:
  43. ## @if name == value
  44. @@ -153,8 +154,9 @@ proc make-template {template {out {}}} {
  45. # Make sure the directory exists
  46. file mkdir $outdir
  47.  
  48. - # Set up srcdir to be relative to the target dir
  49. + # Set up srcdir and top_srcdir to be relative to the target dir
  50. define srcdir [relative-path [file join $::autosetup(srcdir) $outdir] $outdir]
  51. + define top_srcdir [relative-path $::autosetup(srcdir) $outdir]
  52.  
  53. set mapping {}
  54. foreach {n v} [array get ::define] {
  55. --
  56. 1.9.3 (Apple Git-50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement