1 --- a/bin/autoheader.in
2 +++ b/bin/autoheader.in
3 @@ -29,7 +29,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'} ? $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 @@ -51,7 +52,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'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
24 @@ -25,7 +25,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
28 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
29 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
30 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
31 unshift @INC, $pkgdatadir;
33 # Override SHELL. On DJGPP SHELL may not be set to a shell
34 @@ -45,7 +46,8 @@ use File::Basename;
38 -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
39 +my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
40 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
42 # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
44 @@ -88,7 +90,7 @@ my @include;
48 -my $m4 = $ENV{"M4"} || '@M4@';
49 +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
50 # Some non-GNU m4's don't reject the --help option, so give them /dev/null.
51 fatal "need GNU m4 1.4 or later: $m4"
52 if system "$m4 --help </dev/null 2>&1 | grep reload-state >/dev/null";
53 @@ -270,6 +272,12 @@ sub load_configuration ($)
55 my @words = shellwords ($_);
56 my $type = shift @words;
58 + if ($ENV{'STAGING_DIR'})
60 + @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR'}/../host/share/autoconf!; $_ } @words;
63 if ($type eq 'begin-language:')
65 fatal "$file:$.: end-language missing for: $lang"
66 --- a/bin/autoreconf.in
67 +++ b/bin/autoreconf.in
68 @@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
72 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
73 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
74 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
75 unshift @INC, $pkgdatadir;
77 # Override SHELL. On DJGPP SHELL may not be set to a shell
78 @@ -107,9 +108,9 @@ Written by David J. MacKenzie and Akim D
82 -my $autoconf = $ENV{'AUTOCONF'} || '@bindir@/@autoconf-name@';
83 -my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
84 -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
85 +my $autoconf = $ENV{'AUTOCONF'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@');
86 +my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@');
87 +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
88 my $automake = $ENV{'AUTOMAKE'} || 'automake';
89 my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
90 my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
93 @@ -26,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
97 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
98 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
99 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
100 unshift @INC, $pkgdatadir;
102 # Override SHELL. On DJGPP SHELL may not be set to a shell
103 @@ -92,10 +93,10 @@ my $configure_scan = 'configure.scan';
106 # Autoconf and lib files.
107 -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
108 +my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@');
109 my $autoconf = "$autom4te --language=autoconf";
111 -my @include = ('@pkgdatadir@');
112 +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
116 --- a/bin/autoupdate.in
117 +++ b/bin/autoupdate.in
118 @@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
122 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
123 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
124 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
125 unshift @INC, $pkgdatadir;
127 # Override SHELL. On DJGPP SHELL may not be set to a shell
128 @@ -51,10 +52,10 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
129 my $autoconf = "$autom4te --language=autoconf";
130 # We need to find m4sugar.
132 -my @include = ('@pkgdatadir@');
133 +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
136 -my $m4 = $ENV{"M4"} || '@M4@';
137 +my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@');
143 @@ -31,7 +31,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
147 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
148 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
149 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
150 unshift @INC, $pkgdatadir;
152 # Override SHELL. On DJGPP SHELL may not be set to a shell
153 --- a/bin/autoconf.as
154 +++ b/bin/autoconf.as
155 @@ -85,7 +85,11 @@ exit_missing_arg='
156 # restore font-lock: '
159 -: ${AUTOM4TE='@bindir@/@autom4te-name@'}
160 +if test -n "$STAGING_DIR"; then
161 + : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"}
163 + : ${AUTOM4TE='@bindir@/@autom4te-name@'}