1 --- a/bin/autoheader.in
2 +++ b/bin/autoheader.in
3 @@ -30,9 +30,12 @@ use 5.006;
5 use warnings FATAL => 'all';
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";
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);
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@');
28 @@ -26,9 +26,12 @@ use 5.006;
30 use warnings FATAL => 'all';
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;
41 # Override SHELL. On DJGPP SHELL may not be set to a shell
42 @@ -48,7 +51,8 @@ use Autom4te::General;
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@');
50 # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
52 @@ -91,7 +95,7 @@ my @include;
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 ($)
63 my @words = shellwords ($_);
64 my $type = shift @words;
66 + if ($ENV{'STAGING_DIR_HOST'})
68 + @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR_HOST'}/share/autoconf!; $_ } @words;
71 if ($type eq 'begin-language:')
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;
78 use warnings FATAL => 'all';
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;
90 $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux';
91 @@ -117,9 +120,9 @@ Written by David J. MacKenzie and Akim D
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;
108 use warnings FATAL => 'all';
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;
119 # Override SHELL. On DJGPP SHELL may not be set to a shell
120 @@ -95,10 +98,10 @@ my %needed_macros =
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";
128 -my @include = ('@pkgdatadir@');
129 +my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
133 --- a/bin/autoupdate.in
134 +++ b/bin/autoupdate.in
135 @@ -29,9 +29,12 @@ use 5.006;
137 use warnings FATAL => 'all';
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;
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.
153 -my @include = ('@pkgdatadir@');
154 +my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
157 -my $m4 = $ENV{"M4"} || '@M4@';
158 +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
164 @@ -33,9 +33,12 @@ use 5.006;
166 use warnings FATAL => 'all';
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;
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,7 +89,11 @@ exit_missing_arg='
181 # restore font-lock: '
184 -: ${AUTOM4TE='@bindir@/@autom4te-name@'}
185 +if test -n "$STAGING_DIR_HOST"; then
186 + : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"}
188 + : ${AUTOM4TE='@bindir@/@autom4te-name@'}
190 : ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'}