summaryrefslogtreecommitdiffstats
path: root/tools/autoconf/patches/000-relocatable.patch
blob: 0fe830a7ec14906a31e1b6a33a97e8a6f262df1e (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
--- a/bin/autoheader.in
+++ b/bin/autoheader.in
@@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
 
 BEGIN
 {
-  my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+  my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
   unshift @INC, "$pkgdatadir";
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
--- a/bin/autom4te.in
+++ b/bin/autom4te.in
@@ -25,7 +25,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
 
 BEGIN
 {
-  my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+  my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
   unshift @INC, $pkgdatadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -45,7 +46,8 @@ use File::Basename;
 use strict;
 
 # Data directory.
-my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
+my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
 
 # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
 my %language;
--- a/bin/autoreconf.in
+++ b/bin/autoreconf.in
@@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
 
 BEGIN
 {
-  my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+  my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
   unshift @INC, $pkgdatadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
--- a/bin/autoscan.in
+++ b/bin/autoscan.in
@@ -26,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
 
 BEGIN
 {
-  my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+  my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
   unshift @INC, $pkgdatadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -95,7 +96,7 @@ my $log;
 my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
 my $autoconf = "$autom4te --language=autoconf";
 my @prepend_include;
-my @include = ('@pkgdatadir@');
+my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
 
 # $help
 # -----
--- a/bin/autoupdate.in
+++ b/bin/autoupdate.in
@@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
 
 BEGIN
 {
-  my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+  my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
   unshift @INC, $pkgdatadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell
@@ -51,7 +52,7 @@ 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'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
 my $force = 0;
 # m4.
 my $m4 = $ENV{"M4"} || '@M4@';
--- a/bin/ifnames.in
+++ b/bin/ifnames.in
@@ -31,7 +31,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
 
 BEGIN
 {
-  my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
+  my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
+	($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
   unshift @INC, $pkgdatadir;
 
   # Override SHELL.  On DJGPP SHELL may not be set to a shell