From b344da76403a0bc01fd310bc2726842a89add146 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 10 Nov 2022 17:47:06 +0100 Subject: [PATCH] autoconf: use STAGING_DIR_HOST in relocatable patch Instead of using STAGING_DIR and then go up one dir with '../' use directly STAGING_DIR_HOST env variable. This should produce cleaner symbolic links. Signed-off-by: Christian Marangi --- tools/autoconf/patches/000-relocatable.patch | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/autoconf/patches/000-relocatable.patch b/tools/autoconf/patches/000-relocatable.patch index 12e94ae9a1..a935671ce8 100644 --- a/tools/autoconf/patches/000-relocatable.patch +++ b/tools/autoconf/patches/000-relocatable.patch @@ -6,7 +6,7 @@ { - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; + my $pkgdatadir = $ENV{'autom4te_perllibdir'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($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 @@ -15,7 +15,7 @@ # Lib files. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; -+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@bindir@/@autom4te-name@'); ++my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/@autom4te-name@' : '@bindir@/@autom4te-name@'); local $config_h; my $config_h_in; my @prepend_include; @@ -41,7 +41,7 @@ { - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; + my $pkgdatadir = $ENV{'autom4te_perllibdir'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($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 @@ -51,7 +51,7 @@ # Data directory. -my $pkgdatadir = $ENV{'AC_MACRODIR'} || '@pkgdatadir@'; +my $pkgdatadir = $ENV{'AC_MACRODIR'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@'); # $LANGUAGE{LANGUAGE} -- Automatic options for LANGUAGE. my %language; @@ -60,7 +60,7 @@ # $M4. -my $m4 = $ENV{"M4"} || '@M4@'; -+my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/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 &1 | grep reload-state >/dev/null"; @@ -69,9 +69,9 @@ my @words = shellwords ($_); my $type = shift @words; + -+ if ($ENV{'STAGING_DIR'}) ++ if ($ENV{'STAGING_DIR_HOST'}) + { -+ @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR'}/../host/share/autoconf!; $_ } @words; ++ @words = map { s!^@pkgdatadir@!$ENV{'STAGING_DIR_HOST'}/share/autoconf!; $_ } @words; + } + if ($type eq 'begin-language:') @@ -99,7 +99,7 @@ { - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; + my $pkgdatadir = $ENV{'autom4te_perllibdir'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($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 @@ -110,9 +110,9 @@ -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'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoconf-name@' : '@bindir@/@autoconf-name@'); -+my $autoheader = $ENV{'AUTOHEADER'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autoheader-name@' : '@bindir@/@autoheader-name@'); -+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@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'; @@ -134,7 +134,7 @@ { - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; + my $pkgdatadir = $ENV{'autom4te_perllibdir'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($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 @@ -143,11 +143,11 @@ # Autoconf and lib files. -my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@'; -+my $autom4te = $ENV{'AUTOM4TE'} || ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/bin/@autom4te-name@' : '@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'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++my @include = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/autoconf' : '@pkgdatadir@'); # $help # ----- @@ -169,7 +169,7 @@ { - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; + my $pkgdatadir = $ENV{'autom4te_perllibdir'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($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 @@ -178,11 +178,11 @@ # We need to find m4sugar. my @prepend_include; -my @include = ('@pkgdatadir@'); -+my @include = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@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'} ? $ENV{'STAGING_DIR'} . '/../host/bin/m4' : '@M4@'); ++my $m4 = $ENV{"M4"} || ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/bin/m4' : '@M4@'); # $HELP @@ -208,7 +208,7 @@ { - my $pkgdatadir = $ENV{'autom4te_perllibdir'} || '@pkgdatadir@'; + my $pkgdatadir = $ENV{'autom4te_perllibdir'} || -+ ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/autoconf' : '@pkgdatadir@'); ++ ($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 @@ -219,8 +219,8 @@ # Variables. -: ${AUTOM4TE='@bindir@/@autom4te-name@'} -+if test -n "$STAGING_DIR"; then -+ : ${AUTOM4TE="$STAGING_DIR/../host/bin/@autom4te-name@"} ++if test -n "$STAGING_DIR_HOST"; then ++ : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"} +else + : ${AUTOM4TE='@bindir@/@autom4te-name@'} +fi