000-relocatable.patch 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. --- a/bin/autoheader.in
  2. +++ b/bin/autoheader.in
  3. @@ -29,7 +29,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. @@ -51,7 +52,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. @@ -25,7 +25,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  22. BEGIN
  23. {
  24. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  25. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  26. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  27. unshift @INC, $pkgdatadir;
  28. # Override SHELL. On DJGPP SHELL may not be set to a shell
  29. @@ -45,7 +46,8 @@ use File::Basename;
  30. use strict;
  31. # Data directory.
  32. -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
  33. +my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
  34. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  35. # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
  36. my %language;
  37. @@ -88,7 +90,7 @@ my @include;
  38. my $freeze = 0;
  39. # $M4.
  40. -my $m4 = $ENV{"M4"} || '@M4@';
  41. +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
  42. # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
  43. fatal "need GNU m4 1.4 or later: $m4"
  44. if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
  45. @@ -270,6 +272,12 @@ sub load_configuration ($)
  46. my @words = shellwords ($_);
  47. my $type = shift @words;
  48. +
  49. + if ($ENV{'STAGING_DIR'})
  50. + {
  51. + @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR'}/../host/share/autoconf!; $_ } @words;
  52. + }
  53. +
  54. if ($type eq 'begin-language:')
  55. {
  56. fatal "$file:$.: end-language missing for: $lang"
  57. --- a/bin/autoreconf.in
  58. +++ b/bin/autoreconf.in
  59. @@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  60. BEGIN
  61. {
  62. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  63. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  64. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  65. unshift @INC, $pkgdatadir;
  66. # Override SHELL. On DJGPP SHELL may not be set to a shell
  67. @@ -107,9 +108,9 @@ Written by David J. MacKenzie and Akim D
  68. ";
  69. # Lib files.
  70. -my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
  71. -my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
  72. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  73. +my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
  74. +my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
  75. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  76. my $automake = $ENV{'AUTOMAKE'} || 'automake';
  77. my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
  78. my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
  79. --- a/bin/autoscan.in
  80. +++ b/bin/autoscan.in
  81. @@ -26,7 +26,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. @@ -92,10 +93,10 @@ my $configure_scan = 'configure.scan';
  90. my $log;
  91. # Autoconf and lib files.
  92. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
  93. +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
  94. my $autoconf = "$autom4te --language=autoconf";
  95. my @prepend_include;
  96. -my @include = ('@pkgdatadir@');
  97. +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  98. # $help
  99. # -----
  100. --- a/bin/autoupdate.in
  101. +++ b/bin/autoupdate.in
  102. @@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  103. BEGIN
  104. {
  105. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  106. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  107. + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  108. unshift @INC, $pkgdatadir;
  109. # Override SHELL. On DJGPP SHELL may not be set to a shell
  110. @@ -51,10 +52,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
  111. my $autoconf = "$autom4te --language=autoconf";
  112. # We need to find m4sugar.
  113. my @prepend_include;
  114. -my @include = ('@pkgdatadir@');
  115. +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
  116. my $force = 0;
  117. # m4.
  118. -my $m4 = $ENV{"M4"} || '@M4@';
  119. +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
  120. # $HELP
  121. --- a/bin/ifnames.in
  122. +++ b/bin/ifnames.in
  123. @@ -31,7 +31,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
  124. BEGIN
  125. {
  126. - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
  127. + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
  128. + ($ENV{'STAGING_DIR'} ? $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. --- a/bin/autoconf.as
  132. +++ b/bin/autoconf.as
  133. @@ -85,7 +85,11 @@ exit_missing_arg='
  134. # restore font-lock: '
  135. # Variables.
  136. -: ${AUTOM4TE='@bindir@/@autom4te-name@'}
  137. +if test -n "$STAGING_DIR"; then
  138. + : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"}
  139. +else
  140. + : ${AUTOM4TE='@bindir@/@autom4te-name@'}
  141. +fi
  142. autom4te_options=
  143. outfile=
  144. verbose=false