blob: 4eb61ff2ec0f31f9754c31d974e597b7d8b11d90 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 56ef434e454bcc82c162a83d9bcb076d4fc72b7f Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Thu, 9 Jan 2014 14:30:26 +0800
4Subject: [PATCH] Fix libtool detection
5
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>
19---
20 autogen.sh | 5 +----
21 configure.ac | 36 ++++++++++++++++++++++++++++++++++++
22 2 files changed, 37 insertions(+), 4 deletions(-)
23
24diff --git a/autogen.sh b/autogen.sh
25index 3418673..e42c3d5 100755
26--- a/autogen.sh
27+++ b/autogen.sh
28@@ -5,10 +5,7 @@ parentdir=`dirname $0`
29 cd $parentdir
30 parentdir=`pwd`
31
32-libtoolize -f -c
33-#aclocal
34-autoheader
35-autoconf
36+autoreconf -Wcross --verbose --install --force
37
38 mysubdirs="$mysubdirs `find src/modules/ -name configure -print | sed 's%/configure%%'`"
39 mysubdirs=`echo $mysubdirs`
40diff --git a/configure.ac b/configure.ac
41index e73e4ad..066d3d7 100644
42--- a/configure.ac
43+++ b/configure.ac
44@@ -205,6 +205,42 @@ dnl # See if we have Git.
45 dnl #
46 AC_CHECK_PROG(GIT, git, yes, no)
47
48+#### libtool stuff ####
49+
50+dnl set this shit so it doesn't force CFLAGS...
51+LTCFLAGS=" "
52+
53+LT_PREREQ(2.2)
54+LT_INIT([dlopen disable-static])
55+
56+dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
57+dnl exactly which version of libltdl is present in the system, so we
58+dnl just assume that it's a working version as long as we have the
59+dnl library and the header files.
60+dnl
61+dnl As an extra safety device, check for lt_dladvise_init() which is
62+dnl only implemented in libtool 2.x, and refine as we go if we have
63+dnl refined requirements.
64+dnl
65+dnl Check the header files first since the system may have a
66+dnl libltdl.so for runtime, but no headers, and we want to bail out as
67+dnl soon as possible.
68+dnl
69+dnl We don't need any special variable for this though, since the user
70+dnl can give the proper place to find libltdl through the standard
71+dnl variables like LDFLAGS and CPPFLAGS.
72+
73+AC_CHECK_HEADER([ltdl.h],
74+ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
75+ [LIBLTDL=])
76+
77+AS_IF([test "x$LIBLTDL" = "x"],
78+ [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
79+AC_SUBST([LIBLTDL])
80+LTDL_SUBDIRS=
81+INCLTDL=-DWITH_SYSTEM_LTDL
82+AC_SUBST(LTDL_SUBDIRS)
83+
84 dnl Put this in later, when all distributed modules use autoconf.
85 dnl AC_ARG_WITH(disablemodulefoo,
86 dnl [ --without-rlm_foo Disables module compilation. Module list:]
87--
881.8.3
89