[tools] autoconf: make relocatable by searching resources relative to STAGING_DIR
[openwrt/svn-archive/archive.git] / tools / autoconf / patches / 000-relocatable.patch
1 --- a/bin/autoheader.in
2 +++ b/bin/autoheader.in
3 @@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
4
5 BEGIN
6 {
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";
11
12 # Override SHELL. On DJGPP SHELL may not be set to a shell
13 --- a/bin/autom4te.in
14 +++ b/bin/autom4te.in
15 @@ -25,7 +25,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
16
17 BEGIN
18 {
19 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
20 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
21 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
22 unshift @INC, $pkgdatadir;
23
24 # Override SHELL. On DJGPP SHELL may not be set to a shell
25 @@ -45,7 +46,8 @@ use File::Basename;
26 use strict;
27
28 # Data directory.
29 -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@';
30 +my $pkgdatadir = $ENV{'AC_MACRODIR'} ||
31 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
32
33 # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE.
34 my %language;
35 --- a/bin/autoreconf.in
36 +++ b/bin/autoreconf.in
37 @@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
38
39 BEGIN
40 {
41 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
42 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
43 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
44 unshift @INC, $pkgdatadir;
45
46 # Override SHELL. On DJGPP SHELL may not be set to a shell
47 --- a/bin/autoscan.in
48 +++ b/bin/autoscan.in
49 @@ -26,7 +26,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
50
51 BEGIN
52 {
53 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
54 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
55 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
56 unshift @INC, $pkgdatadir;
57
58 # Override SHELL. On DJGPP SHELL may not be set to a shell
59 @@ -95,7 +96,7 @@ my $log;
60 my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
61 my $autoconf = "$autom4te --language=autoconf";
62 my @prepend_include;
63 -my @include = ('@pkgdatadir@');
64 +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
65
66 # $help
67 # -----
68 --- a/bin/autoupdate.in
69 +++ b/bin/autoupdate.in
70 @@ -27,7 +27,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
71
72 BEGIN
73 {
74 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
75 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
76 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
77 unshift @INC, $pkgdatadir;
78
79 # Override SHELL. On DJGPP SHELL may not be set to a shell
80 @@ -51,7 +52,7 @@ my $autom4te = $ENV{'AUTOM4TE'} || '@bin
81 my $autoconf = "$autom4te --language=autoconf";
82 # We need to find m4sugar.
83 my @prepend_include;
84 -my @include = ('@pkgdatadir@');
85 +my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
86 my $force = 0;
87 # m4.
88 my $m4 = $ENV{"M4"} || '@M4@';
89 --- a/bin/ifnames.in
90 +++ b/bin/ifnames.in
91 @@ -31,7 +31,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
92
93 BEGIN
94 {
95 - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@';
96 + my $pkgdatadir = $ENV{'autom4te_perllibdir'} ||
97 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@');
98 unshift @INC, $pkgdatadir;
99
100 # Override SHELL. On DJGPP SHELL may not be set to a shell