000-relocatable.patch 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. --- a/bin/autoheader.in
  2. +++ b/bin/autoheader.in
  3. @@ -30,9 +30,12 @@ use 5.006;
  4. use strict;
  5. use warnings FATAL => 'all';
  6. +$^W = 1;
  7. +
  8. BEGIN
  9. {
  10. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  11. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  12. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  13. unshift @INC, "$pkgdatadir";
  14. # Override SHELL. On DJGPP SHELL may not be set to a shell
  15. @@ -54,7 +57,7 @@ use Autom4te::XFile;
  16. our ($config_h, %symbol, %verbatim);
  17. # Lib files.
  18. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  19. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  20. my $config_h_in;
  21. my @prepend_include;
  22. my @include;
  23. --- a/bin/autom4te.in
  24. +++ b/bin/autom4te.in
  25. @@ -26,9 +26,12 @@ use 5.006;
  26. use strict;
  27. use warnings FATAL => 'all';
  28. +$^W = 1;
  29. +
  30. BEGIN
  31. {
  32. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  33. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  34. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  35. unshift @INC, $pkgdatadir;
  36. # Override SHELL. On DJGPP SHELL may not be set to a shell
  37. @@ -48,7 +51,8 @@ use Autom4te::General;
  38. use Autom4te::XFile;
  39. # Data directory.
  40. -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
  41. +my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
  42. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  43. # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
  44. my %language;
  45. @@ -91,7 +95,7 @@ my @include;
  46. my $freeze = 0;
  47. # $M4.
  48. -my $m4 = $ENV{"M4"} || '@M4@';
  49. +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
  50. # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
  51. fatal "need GNU m4 1.4 or later: $m4"
  52. if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
  53. @@ -272,6 +276,12 @@ sub load_configuration ($)
  54. my @words = shellwords ($_);
  55. my $type = shift @words;
  56. +
  57. + if ($ENV{'STAGING_DIR_HOST'})
  58. + {
  59. + @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR_HOST'}/share/autoconf!; $_ } @words;
  60. + }
  61. +
  62. if ($type eq 'begin-language:')
  63. {
  64. fatal "$file:$.: end-language missing for: $lang"
  65. --- a/bin/autoreconf.in
  66. +++ b/bin/autoreconf.in
  67. @@ -29,10 +29,13 @@ use 5.006;
  68. use strict;
  69. use warnings FATAL => 'all';
  70. +$^W = 1;
  71. +
  72. my $buildauxdir;
  73. BEGIN
  74. {
  75. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  76. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  77. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  78. unshift @INC, $pkgdatadir;
  79. $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux';
  80. @@ -117,9 +120,9 @@ Written by David J. MacKenzie and Akim D
  81. ";
  82. # Lib files.
  83. -my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
  84. -my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
  85. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  86. +my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
  87. +my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
  88. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  89. my $automake = $ENV{'AUTOMAKE'} || 'automake';
  90. my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
  91. my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
  92. --- a/bin/autoscan.in
  93. +++ b/bin/autoscan.in
  94. @@ -28,9 +28,12 @@ use 5.006;
  95. use strict;
  96. use warnings FATAL => 'all';
  97. +$^W = 1;
  98. +
  99. BEGIN
  100. {
  101. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  102. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  103. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  104. unshift @INC, $pkgdatadir;
  105. # Override SHELL. On DJGPP SHELL may not be set to a shell
  106. @@ -95,10 +98,10 @@ my %needed_macros =
  107. my $log;
  108. # Autoconf and lib files.
  109. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  110. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  111. my $autoconf = "$autom4te --language=autoconf";
  112. my @prepend_include;
  113. -my @include = ('@pkgdatadir@');
  114. +my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  115. # $help
  116. # -----
  117. --- a/bin/autoupdate.in
  118. +++ b/bin/autoupdate.in
  119. @@ -29,9 +29,12 @@ use 5.006;
  120. use strict;
  121. use warnings FATAL => 'all';
  122. +$^W = 1;
  123. +
  124. BEGIN
  125. {
  126. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  127. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  128. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  129. unshift @INC, $pkgdatadir;
  130. # Override SHELL. On DJGPP SHELL may not be set to a shell
  131. @@ -55,10 +58,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
  132. my $autoconf = "$autom4te --language=autoconf";
  133. # We need to find m4sugar.
  134. my @prepend_include;
  135. -my @include = ('@pkgdatadir@');
  136. +my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  137. my $force = 0;
  138. # m4.
  139. -my $m4 = $ENV{"M4"} || '@M4@';
  140. +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
  141. # $HELP
  142. --- a/bin/ifnames.in
  143. +++ b/bin/ifnames.in
  144. @@ -33,9 +33,12 @@ use 5.006;
  145. use strict;
  146. use warnings FATAL => 'all';
  147. +$^W = 1;
  148. +
  149. BEGIN
  150. {
  151. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  152. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  153. + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
  154. unshift @INC, $pkgdatadir;
  155. # Override SHELL. On DJGPP SHELL may not be set to a shell
  156. --- a/bin/autoconf.as
  157. +++ b/bin/autoconf.as
  158. @@ -89,8 +89,13 @@ exit_missing_arg='
  159. # restore font-lock: '
  160. # Variables.
  161. -: ${AUTOM4TE='@bindir@/@autom4te-name@'}
  162. -: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
  163. +if test -n "$STAGING_DIR_HOST"; then
  164. + : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"}
  165. + : ${trailer_m4="$STAGING_DIR_HOST/share/autoconf/autoconf/trailer.m4"}
  166. +else
  167. + : ${AUTOM4TE='@bindir@/@autom4te-name@'}
  168. + : ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}
  169. +fi
  170. autom4te_options=
  171. outfile=
  172. verbose=false