2023-03-09 14:35:13 +00:00
|
|
|
From ca10caa502f971f90d8c041aa2476de54ef0ce2b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Eneas U de Queiroz <cotequeiroz@gmail.com>
|
|
|
|
Date: Tue, 20 Jul 2021 16:41:11 -0300
|
|
|
|
Subject: openwrt: make relocatable, search resources relative to STAGING_DIR
|
|
|
|
|
|
|
|
This was originally commited to openwrt by Jo-Philipp Wich
|
|
|
|
<jow@openwrt.org>.
|
|
|
|
|
|
|
|
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
|
|
|
|
|
2012-01-20 14:51:44 +00:00
|
|
|
--- a/libtoolize.in
|
|
|
|
+++ b/libtoolize.in
|
2021-09-13 21:08:55 +00:00
|
|
|
@@ -38,14 +38,23 @@
|
|
|
|
# with bootstrap, so set those here where they can still be over-
|
|
|
|
# ridden by the user, but otherwise take precedence.
|
2015-01-13 10:23:44 +00:00
|
|
|
|
2021-09-13 21:08:55 +00:00
|
|
|
-: ${AUTOCONF="autoconf"}
|
|
|
|
-: ${AUTOMAKE="automake"}
|
2015-01-13 10:23:44 +00:00
|
|
|
-: ${EGREP="@EGREP@"}
|
|
|
|
-: ${FGREP="@FGREP@"}
|
|
|
|
-: ${GREP="@GREP@"}
|
|
|
|
: ${LN_S="@LN_S@"}
|
2012-01-20 14:51:44 +00:00
|
|
|
-: ${SED="@SED@"}
|
2021-09-13 21:08:55 +00:00
|
|
|
|
2022-11-10 16:48:54 +00:00
|
|
|
+if test -n "$STAGING_DIR_HOST"; then
|
2021-09-13 21:08:55 +00:00
|
|
|
+ : ${AUTOCONF="$STAGING_DIR_HOST/bin/autoconf"}
|
|
|
|
+ : ${AUTOMAKE="$STAGING_DIR_HOST/bin/automake"}
|
2022-11-10 16:48:54 +00:00
|
|
|
+ : ${EGREP="$STAGING_DIR_HOST/bin/grep -E"}
|
|
|
|
+ : ${FGREP="$STAGING_DIR_HOST/bin/grep -F"}
|
|
|
|
+ : ${GREP="$STAGING_DIR_HOST/bin/grep"}
|
|
|
|
+ : ${SED="$STAGING_DIR_HOST/bin/sed"}
|
2012-01-21 09:49:53 +00:00
|
|
|
+else
|
2021-09-13 21:08:55 +00:00
|
|
|
+ : ${AUTOCONF="autoconf"}
|
|
|
|
+ : ${AUTOMAKE="automake"}
|
2015-01-13 10:23:44 +00:00
|
|
|
+ : ${EGREP="@EGREP@"}
|
|
|
|
+ : ${FGREP="@FGREP@"}
|
|
|
|
+ : ${GREP="@GREP@"}
|
2012-01-21 09:49:53 +00:00
|
|
|
+ : ${SED="@SED@"}
|
|
|
|
+fi
|
2021-09-23 11:36:45 +00:00
|
|
|
|
2021-09-13 21:08:55 +00:00
|
|
|
## -------------------------- ##
|
|
|
|
## Source external libraries. ##
|
2022-03-31 23:13:17 +00:00
|
|
|
@@ -1903,11 +1912,21 @@ func_require_seen_libtool ()
|
2021-09-13 21:08:55 +00:00
|
|
|
pkgmacro_files="@pkgmacro_files@"
|
2012-01-20 14:51:44 +00:00
|
|
|
|
2021-09-23 11:36:45 +00:00
|
|
|
# Locations for important files:
|
2021-09-13 21:08:55 +00:00
|
|
|
- prefix="@prefix@"
|
|
|
|
- datadir="@datadir@"
|
|
|
|
- pkgauxdir="@pkgauxdir@"
|
|
|
|
- pkgltdldir="@pkgdatadir@"
|
|
|
|
- aclocaldir="@aclocaldir@"
|
2022-11-10 16:48:54 +00:00
|
|
|
+ if test -n "$STAGING_DIR_HOST"; then
|
2021-09-24 12:28:20 +00:00
|
|
|
+ prefix="$STAGING_DIR_HOST"
|
2022-11-10 16:48:54 +00:00
|
|
|
+ datadir="$STAGING_DIR_HOST/share"
|
2021-09-24 12:28:20 +00:00
|
|
|
+ pkgauxdir="$STAGING_DIR_HOST/share/libtool/build-aux"
|
2022-11-10 16:48:54 +00:00
|
|
|
+ pkgdatadir="$STAGING_DIR_HOST/share/libtool"
|
|
|
|
+ pkgltdldir="$STAGING_DIR_HOST/share/libtool"
|
|
|
|
+ aclocaldir="$STAGING_DIR_HOST/share/aclocal"
|
2021-09-23 11:36:45 +00:00
|
|
|
+ else
|
2021-09-24 12:28:20 +00:00
|
|
|
+ prefix="@prefix@"
|
|
|
|
+ datadir="@datadir@"
|
|
|
|
+ pkgauxdir="@pkgauxdir@"
|
|
|
|
+ pkgdatadir="@pkgdatadir@"
|
|
|
|
+ pkgltdldir="@pkgdatadir@"
|
|
|
|
+ aclocaldir="@aclocaldir@"
|
2021-09-23 11:36:45 +00:00
|
|
|
+ fi
|
2012-01-20 14:51:44 +00:00
|
|
|
|
2021-09-13 21:08:55 +00:00
|
|
|
# Allow the user to override the master libtoolize repository:
|
|
|
|
if test -n "$_lt_pkgdatadir"; then
|
|
|
|
--- a/m4/libtool.m4
|
|
|
|
+++ b/m4/libtool.m4
|
2022-03-31 23:13:17 +00:00
|
|
|
@@ -933,7 +933,7 @@ m4_defun([_LT_TAG_COMPILER],
|
2012-01-20 14:51:44 +00:00
|
|
|
[AC_REQUIRE([AC_PROG_CC])dnl
|
2023-03-09 13:29:38 +00:00
|
|
|
|
2012-01-20 14:51:44 +00:00
|
|
|
_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
|
|
|
|
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
|
2022-11-10 16:48:54 +00:00
|
|
|
+_LT_DECL([LTCFLAGS], [CFLAGS], ["-O2 -I\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/include"], [LTCC compiler flags])dnl
|
2012-01-20 14:51:44 +00:00
|
|
|
_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
|
|
|
|
_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
|
|
|
|
|
2022-03-31 23:13:17 +00:00
|
|
|
@@ -8183,9 +8183,9 @@ m4_defun([_LT_DECL_EGREP],
|
2015-01-13 10:23:44 +00:00
|
|
|
[AC_REQUIRE([AC_PROG_EGREP])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_FGREP])dnl
|
|
|
|
test -z "$GREP" && GREP=grep
|
|
|
|
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
|
|
|
|
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
|
|
|
|
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
|
2022-11-10 16:48:54 +00:00
|
|
|
+_LT_DECL([], [GREP], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/grep"], [A grep program that handles long lines])
|
|
|
|
+_LT_DECL([], [EGREP], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/grep -E"], [An ERE matcher])
|
|
|
|
+_LT_DECL([], [FGREP], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/grep -F"], [A literal string matcher])
|
2015-01-13 10:23:44 +00:00
|
|
|
dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
|
|
|
|
AC_SUBST([GREP])
|
|
|
|
])
|
2022-03-31 23:13:17 +00:00
|
|
|
@@ -8226,9 +8226,8 @@ _LT_DECL([], [FILECMD], [1], [A file(cmd
|
2012-01-20 14:51:44 +00:00
|
|
|
# as few characters as possible. Prefer GNU sed if found.
|
|
|
|
m4_defun([_LT_DECL_SED],
|
|
|
|
[AC_PROG_SED
|
|
|
|
-test -z "$SED" && SED=sed
|
|
|
|
Xsed="$SED -e 1s/^X//"
|
|
|
|
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
|
2022-11-10 16:48:54 +00:00
|
|
|
+_LT_DECL([], [SED], ["\${STAGING_DIR_HOST:-$STAGING_DIR_HOST}/bin/sed"], [A sed program that does not truncate output])
|
2012-01-20 14:51:44 +00:00
|
|
|
_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
|
|
|
|
[Sed that helps us avoid accidentally triggering echo(1) options like -n])
|
|
|
|
])# _LT_DECL_SED
|