Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 1 | From bfe4d7ed72edc9d4ae1a0f0d2dd84367d6214886 Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 22 Aug 2019 10:45:46 +0800 |
| 4 | Subject: [PATCH 1/2] Fix libtool detection |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | Upstream-Status: pending |
| 7 | |
| 8 | Use LT_INIT instead of the deprecated AC_PROG_LIBTOOL to detect libtool, so it |
| 9 | can work with our libtoolize and libtool. |
| 10 | |
| 11 | Simplify the detection of ltdl. It will find the ltdl from the sysroot; the |
| 12 | switch --with-system-libltdl is no longer needed. The code is copied from |
| 13 | pulseaudio configure.ac, together with the comment paragraph. |
| 14 | |
| 15 | Also patch autogen.sh so it uses autoreconf, which handles libtoolize better. |
| 16 | |
| 17 | Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> |
| 18 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 19 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | --- |
| 21 | autogen.sh | 5 +---- |
| 22 | configure.ac | 36 ++++++++++++++++++++++++++++++++++++ |
| 23 | 2 files changed, 37 insertions(+), 4 deletions(-) |
| 24 | |
| 25 | diff --git a/autogen.sh b/autogen.sh |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 26 | index a1d08a6..959182b 100755 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | --- a/autogen.sh |
| 28 | +++ b/autogen.sh |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 29 | @@ -6,10 +6,7 @@ cd $parentdir |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 30 | parentdir=`pwd` |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 31 | m4include="-I$parentdir -I$parentdir/m4 -Im4" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 32 | |
| 33 | -libtoolize -f -c |
| 34 | -#aclocal |
| 35 | -autoheader |
| 36 | -autoconf |
| 37 | +autoreconf -Wcross --verbose --install --force |
| 38 | |
| 39 | mysubdirs="$mysubdirs `find src/modules/ -name configure -print | sed 's%/configure%%'`" |
| 40 | mysubdirs=`echo $mysubdirs` |
| 41 | diff --git a/configure.ac b/configure.ac |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 42 | index a7abf00..65db61e 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 43 | --- a/configure.ac |
| 44 | +++ b/configure.ac |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 45 | @@ -220,6 +220,42 @@ dnl # See if we have Git. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 46 | dnl # |
| 47 | AC_CHECK_PROG(GIT, git, yes, no) |
| 48 | |
| 49 | +#### libtool stuff #### |
| 50 | + |
| 51 | +dnl set this shit so it doesn't force CFLAGS... |
| 52 | +LTCFLAGS=" " |
| 53 | + |
| 54 | +LT_PREREQ(2.2) |
| 55 | +LT_INIT([dlopen disable-static]) |
| 56 | + |
| 57 | +dnl Unfortunately, even up to libtool 2.2.6a there is no way to know |
| 58 | +dnl exactly which version of libltdl is present in the system, so we |
| 59 | +dnl just assume that it's a working version as long as we have the |
| 60 | +dnl library and the header files. |
| 61 | +dnl |
| 62 | +dnl As an extra safety device, check for lt_dladvise_init() which is |
| 63 | +dnl only implemented in libtool 2.x, and refine as we go if we have |
| 64 | +dnl refined requirements. |
| 65 | +dnl |
| 66 | +dnl Check the header files first since the system may have a |
| 67 | +dnl libltdl.so for runtime, but no headers, and we want to bail out as |
| 68 | +dnl soon as possible. |
| 69 | +dnl |
| 70 | +dnl We don't need any special variable for this though, since the user |
| 71 | +dnl can give the proper place to find libltdl through the standard |
| 72 | +dnl variables like LDFLAGS and CPPFLAGS. |
| 73 | + |
| 74 | +AC_CHECK_HEADER([ltdl.h], |
| 75 | + [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])], |
| 76 | + [LIBLTDL=]) |
| 77 | + |
| 78 | +AS_IF([test "x$LIBLTDL" = "x"], |
| 79 | + [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])]) |
| 80 | +AC_SUBST([LIBLTDL]) |
| 81 | +LTDL_SUBDIRS= |
| 82 | +INCLTDL=-DWITH_SYSTEM_LTDL |
| 83 | +AC_SUBST(LTDL_SUBDIRS) |
| 84 | + |
| 85 | dnl Put this in later, when all distributed modules use autoconf. |
| 86 | dnl AC_ARG_WITH(disablemodulefoo, |
| 87 | dnl [ --without-rlm_foo Disables module compilation. Module list:] |
| 88 | -- |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 89 | 2.7.4 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 90 | |