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