1
0

000-relocatable.patch 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. --- a/bin/autoheader.in
  2. +++ b/bin/autoheader.in
  3. @@ -28,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  4. BEGIN
  5. {
  6. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  7. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  8. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  9. unshift @INC, "$pkgdatadir";
  10. # Override SHELL. On DJGPP SHELL may not be set to a shell
  11. @@ -50,7 +51,7 @@ use strict;
  12. use vars qw ($config_h %verbatim %symbol);
  13. # Lib files.
  14. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  15. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  16. local $config_h;
  17. my $config_h_in;
  18. my @prepend_include;
  19. --- a/bin/autom4te.in
  20. +++ b/bin/autom4te.in
  21. @@ -1,10 +1,12 @@
  22. -#! @PERL@ -w
  23. +#! @PERL@
  24. # -*- perl -*-
  25. # @configure_input@
  26. eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
  27. if 0;
  28. +$^W = 1;
  29. +
  30. # autom4te - Wrapper around M4 libraries.
  31. # Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
  32. @@ -24,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  33. BEGIN
  34. {
  35. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  36. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  37. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  38. unshift @INC, $pkgdatadir;
  39. # Override SHELL. On DJGPP SHELL may not be set to a shell
  40. @@ -44,7 +47,8 @@ use File::Basename;
  41. use strict;
  42. # Data directory.
  43. -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
  44. +my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
  45. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  46. # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
  47. my %language;
  48. @@ -87,7 +91,7 @@ my @include;
  49. my $freeze = 0;
  50. # $M4.
  51. -my $m4 = $ENV{"M4"} || '@M4@';
  52. +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
  53. # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
  54. fatal "need GNU m4 1.4 or later: $m4"
  55. if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
  56. @@ -269,6 +273,12 @@ sub load_configuration ($)
  57. my @words = shellwords ($_);
  58. my $type = shift @words;
  59. +
  60. + if ($ENV{'STAGING_DIR'})
  61. + {
  62. + @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR'}/../host/share/autoconf!; $_ } @words;
  63. + }
  64. +
  65. if ($type eq 'begin-language:')
  66. {
  67. fatal "$file:$.: end-language missing for: $lang"
  68. --- a/bin/autoreconf.in
  69. +++ b/bin/autoreconf.in
  70. @@ -1,10 +1,12 @@
  71. -#! @PERL@ -w
  72. +#! @PERL@
  73. # -*- perl -*-
  74. # @configure_input@
  75. eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
  76. if 0;
  77. +$^W = 1;
  78. +
  79. # autoreconf - install the GNU Build System in a directory tree
  80. # Copyright (C) 1994, 1999-2012 Free Software Foundation, Inc.
  81. @@ -26,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  82. BEGIN
  83. {
  84. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  85. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  86. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  87. unshift @INC, $pkgdatadir;
  88. # Override SHELL. On DJGPP SHELL may not be set to a shell
  89. @@ -106,9 +109,9 @@ Written by David J. MacKenzie and Akim D
  90. ";
  91. # Lib files.
  92. -my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
  93. -my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
  94. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  95. +my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
  96. +my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
  97. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  98. my $automake = $ENV{'AUTOMAKE'} || 'automake';
  99. my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
  100. my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
  101. --- a/bin/autoscan.in
  102. +++ b/bin/autoscan.in
  103. @@ -1,4 +1,4 @@
  104. -#! @PERL@ -w
  105. +#! @PERL@
  106. # -*- perl -*-
  107. # @configure_input@
  108. @@ -23,9 +23,12 @@
  109. eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
  110. if 0;
  111. +$^W = 1;
  112. +
  113. BEGIN
  114. {
  115. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  116. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  117. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  118. unshift @INC, $pkgdatadir;
  119. # Override SHELL. On DJGPP SHELL may not be set to a shell
  120. @@ -91,10 +94,10 @@ my $configure_scan = 'configure.scan';
  121. my $log;
  122. # Autoconf and lib files.
  123. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  124. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  125. my $autoconf = "$autom4te --language=autoconf";
  126. my @prepend_include;
  127. -my @include = ('@pkgdatadir@');
  128. +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  129. # $help
  130. # -----
  131. --- a/bin/autoupdate.in
  132. +++ b/bin/autoupdate.in
  133. @@ -1,4 +1,4 @@
  134. -#! @PERL@ -w
  135. +#! @PERL@
  136. # -*- perl -*-
  137. # @configure_input@
  138. @@ -24,9 +24,12 @@
  139. eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
  140. if 0;
  141. +$^W = 1;
  142. +
  143. BEGIN
  144. {
  145. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  146. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  147. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  148. unshift @INC, $pkgdatadir;
  149. # Override SHELL. On DJGPP SHELL may not be set to a shell
  150. @@ -50,10 +53,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
  151. my $autoconf = "$autom4te --language=autoconf";
  152. # We need to find m4sugar.
  153. my @prepend_include;
  154. -my @include = ('@pkgdatadir@');
  155. +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  156. my $force = 0;
  157. # m4.
  158. -my $m4 = $ENV{"M4"} || '@M4@';
  159. +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
  160. # $HELP
  161. --- a/bin/ifnames.in
  162. +++ b/bin/ifnames.in
  163. @@ -1,10 +1,12 @@
  164. -#! @PERL@ -w
  165. +#! @PERL@
  166. # -*- perl -*-
  167. # @configure_input@
  168. eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
  169. if 0;
  170. +$^W = 1;
  171. +
  172. # ifnames - print the identifiers used in C preprocessor conditionals
  173. # Copyright (C) 1994-1995, 1999-2003, 2005-2012 Free Software
  174. @@ -31,7 +33,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  175. BEGIN
  176. {
  177. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  178. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  179. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  180. unshift @INC, $pkgdatadir;
  181. # Override SHELL. On DJGPP SHELL may not be set to a shell
  182. --- a/bin/autoconf.as
  183. +++ b/bin/autoconf.as
  184. @@ -84,7 +84,11 @@ exit_missing_arg='
  185. # restore font-lock: '
  186. # Variables.
  187. -: ${AUTOM4TE='@bindir@/@autom4te-name@'}
  188. +if test -n "$STAGING_DIR"; then
  189. + : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"}
  190. +else
  191. + : ${AUTOM4TE='@bindir@/@autom4te-name@'}
  192. +fi
  193. autom4te_options=
  194. outfile=
  195. verbose=false