automake: 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 <ansuelsmth@gmail.com>
This commit is contained in:
Christian Marangi 2022-11-10 17:44:13 +01:00
parent 9988832c46
commit 3606fcce0b
No known key found for this signature in database
GPG Key ID: AC001D09ADBFEAD7
2 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ HOST_CONFIGURE_VARS += \
am_cv_prog_PERL_ithreads=no
define Host/Configure
(cd $(HOST_BUILD_DIR); $(AM_TOOL_PATHS) STAGING_DIR="" ./bootstrap)
(cd $(HOST_BUILD_DIR); $(AM_TOOL_PATHS) STAGING_DIR_HOST="" ./bootstrap)
$(call Host/Configure/Default)
endef

View File

@ -5,7 +5,7 @@
our $VERSION = '@VERSION@';
our $RELEASE_YEAR = '@RELEASE_YEAR@';
-our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
+our $libdir = $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@';
+our $libdir = $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@';
our $perl_threads = 0;
# We need at least this version for CLONE support.
@ -30,7 +30,7 @@
BEGIN
{
- @Aclocal::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+ @Aclocal::perl_libdirs = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')
+ @Aclocal::perl_libdirs = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')
unless @Aclocal::perl_libdirs;
unshift @INC, @Aclocal::perl_libdirs;
}
@ -40,8 +40,8 @@
my @user_includes = ();
-my @automake_includes = ("@datadir@/aclocal-$APIVERSION");
-my @system_includes = ('@datadir@/aclocal');
+my @automake_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . "/../host/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
+my @system_includes = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/aclocal' : '@datadir@/aclocal');
+my @automake_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . "/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION");
+my @system_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/aclocal' : '@datadir@/aclocal');
# Whether we should copy M4 file in $user_includes[0].
my $install = 0;
@ -66,7 +66,7 @@
BEGIN
{
- @Automake::perl_libdirs = ('@datadir@/@PACKAGE@-@APIVERSION@')
+ @Automake::perl_libdirs = ($ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')
+ @Automake::perl_libdirs = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')
unless @Automake::perl_libdirs;
unshift @INC, @Automake::perl_libdirs;