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