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