827797c732c4b6e249a612e390515e99f7416b89
[openwrt/openwrt.git] / tools / automake / patches / 000-relocatable.patch
1 --- a/aclocal.in
2 +++ b/aclocal.in
3 @@ -29,7 +29,8 @@ eval 'case $# in 0) exec @PERL@ -S "$0";
4
5 BEGIN
6 {
7 - my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
8 + my $perllibdir = $ENV{'perllibdir'} ||
9 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@');
10 unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
11 }
12
13 @@ -61,8 +62,8 @@ $perl_threads = 0;
14 # ACLOCAL_PATH environment variable, and reset with the `--system-acdir'
15 # option.
16 my @user_includes = ();
17 -my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
18 -my @system_includes = ('@datadir@/aclocal');
19 +my @automake_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . "/../host/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
20 +my @system_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/aclocal' : '@datadir@/aclocal');
21
22 # Whether we should copy M4 file in $user_includes[0].
23 my $install = 0;
24 --- a/automake.in
25 +++ b/automake.in
26 @@ -31,7 +31,8 @@ package Language;
27
28 BEGIN
29 {
30 - my $perllibdir = $ENV{'perllibdir'} || '@datadir@/@PACKAGE@-@APIVERSION@';
31 + my $perllibdir = $ENV{'perllibdir'} ||
32 + ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@');
33 unshift @INC, (split '@PATH_SEPARATOR@', $perllibdir);
34
35 # Override SHELL. This is required on DJGPP so that system() uses
36 --- a/lib/Automake/Config.in
37 +++ b/lib/Automake/Config.in
38 @@ -31,7 +31,7 @@ our $APIVERSION = '@APIVERSION@';
39 our $PACKAGE = '@PACKAGE@';
40 our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
41 our $VERSION = '@VERSION@';
42 -our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
43 +our $libdir = $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@';
44 our $perl_threads = @PERL_THREADS@;
45
46 1;