1 --- a/bin/autoheader.in
2 +++ b/bin/autoheader.in
3 @@ -28,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
7 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
8 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
9 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
10 unshift @INC, "$pkgdatadir";
12 # Override SHELL. On DJGPP SHELL may not be set to a shell
13 @@ -50,7 +51,7 @@ use strict;
14 use vars qw ($config_h %verbatim %symbol);
17 -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
18 +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
30 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
35 # autom4te - Wrapper around M4 libraries.
36 # Copyright (C) 2001-2003, 2005-2012 Free Software Foundation, Inc.
38 @@ -24,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
42 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
43 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
44 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
45 unshift @INC, $pkgdatadir;
47 # Override SHELL. On DJGPP SHELL may not be set to a shell
48 @@ -44,7 +47,8 @@ use File::Basename;
52 -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
53 +my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
54 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
56 # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
58 @@ -87,7 +91,7 @@ my @include;
62 -my $m4 = $ENV{"M4"} || '@M4@';
63 +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
64 # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
65 fatal "need GNU m4 1.4 or later: $m4"
66 if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
67 @@ -269,6 +273,12 @@ sub load_configuration ($)
69 my @words = shellwords ($_);
70 my $type = shift @words;
72 + if ($ENV{'STAGING_DIR_HOST'})
74 + @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR_HOST'}/share/autoconf!; $_ } @words;
77 if ($type eq 'begin-language:')
79 fatal "$file:$.: end-language missing for: $lang"
80 --- a/bin/autoreconf.in
81 +++ b/bin/autoreconf.in
88 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
93 # autoreconf - install the GNU Build System in a directory tree
94 # Copyright (C) 1994, 1999-2012 Free Software Foundation, Inc.
96 @@ -26,7 +28,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
100 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
101 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
102 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
103 unshift @INC, $pkgdatadir;
105 # Override SHELL. On DJGPP SHELL may not be set to a shell
106 @@ -106,9 +109,9 @@ Written by David J. MacKenzie and Akim D
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
128 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
135 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
136 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
137 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
138 unshift @INC, $pkgdatadir;
140 # Override SHELL. On DJGPP SHELL may not be set to a shell
141 @@ -91,10 +94,10 @@ my $configure_scan = 'configure.scan';
144 # Autoconf and lib files.
145 -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
146 +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
147 my $autoconf = "$autom4te --language=autoconf";
149 -my @include = ('@pkgdatadir@');
150 +my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
154 --- a/bin/autoupdate.in
155 +++ b/bin/autoupdate.in
163 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
170 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
171 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
172 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
173 unshift @INC, $pkgdatadir;
175 # Override SHELL. On DJGPP SHELL may not be set to a shell
176 @@ -50,10 +53,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
177 my $autoconf = "$autom4te --language=autoconf";
178 # We need to find m4sugar.
180 -my @include = ('@pkgdatadir@');
181 +my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
184 -my $m4 = $ENV{"M4"} || '@M4@';
185 +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@');
197 eval 'case $# in 0) exec @PERL@ -S "$0";; *) exec @PERL@ -S "$0" "$@";; esac'
202 # ifnames - print the identifiers used in C preprocessor conditionals
204 # Copyright (C) 1994-1995, 1999-2003, 2005-2012 Free Software
205 @@ -31,7 +33,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
209 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
210 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
211 + ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@');
212 unshift @INC, $pkgdatadir;
214 # Override SHELL. On DJGPP SHELL may not be set to a shell
215 --- a/bin/autoconf.as
216 +++ b/bin/autoconf.as
217 @@ -84,7 +84,11 @@ exit_missing_arg='
218 # restore font-lock: '
221 -: ${AUTOM4TE='@bindir@/@autom4te-name@'}
222 +if test -n "$STAGING_DIR_HOST"; then
223 + : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"}
225 + : ${AUTOM4TE='@bindir@/@autom4te-name@'}