blob: 4265f9d0de378c5922ab71b96276107fed43d4c9 [file] [log] [blame]
Brad Bishopc1d34332019-09-09 14:56:00 -04001From bfe4d7ed72edc9d4ae1a0f0d2dd84367d6214886 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 22 Aug 2019 10:45:46 +0800
4Subject: [PATCH 1/2] Fix libtool detection
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
6Upstream-Status: pending
7
8Use LT_INIT instead of the deprecated AC_PROG_LIBTOOL to detect libtool, so it
9can work with our libtoolize and libtool.
10
11Simplify the detection of ltdl. It will find the ltdl from the sysroot; the
12switch --with-system-libltdl is no longer needed. The code is copied from
13pulseaudio configure.ac, together with the comment paragraph.
14
15Also patch autogen.sh so it uses autoreconf, which handles libtoolize better.
16
17Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
18Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Brad Bishopc1d34332019-09-09 14:56:00 -040019Signed-off-by: Changqing Li <changqing.li@windriver.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050020---
21 autogen.sh | 5 +----
22 configure.ac | 36 ++++++++++++++++++++++++++++++++++++
23 2 files changed, 37 insertions(+), 4 deletions(-)
24
25diff --git a/autogen.sh b/autogen.sh
Brad Bishopc1d34332019-09-09 14:56:00 -040026index a1d08a6..959182b 100755
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027--- a/autogen.sh
28+++ b/autogen.sh
Brad Bishopc1d34332019-09-09 14:56:00 -040029@@ -6,10 +6,7 @@ cd $parentdir
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030 parentdir=`pwd`
Brad Bishopc1d34332019-09-09 14:56:00 -040031 m4include="-I$parentdir -I$parentdir/m4 -Im4"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032
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`
41diff --git a/configure.ac b/configure.ac
Brad Bishopc1d34332019-09-09 14:56:00 -040042index a7abf00..65db61e 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050043--- a/configure.ac
44+++ b/configure.ac
Brad Bishopc1d34332019-09-09 14:56:00 -040045@@ -220,6 +220,42 @@ dnl # See if we have Git.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050046 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 Bishopc1d34332019-09-09 14:56:00 -0400892.7.4
Brad Bishopd7bf8c12018-02-25 22:55:05 -050090