000-relocatable.patch 6.9 KB

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