blob: 479e1ba76f98956d176834afee3b4359a517ec45 [file] [log] [blame]
Andrew Geisslerc5535c92023-01-27 16:10:19 -06001From 5ba3d140842268cbbdd983266efecb1fba5bdd59 Mon Sep 17 00:00:00 2001
Brad Bishopc1d34332019-09-09 14:56:00 -04002From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 22 Aug 2019 10:45:46 +0800
Andrew Geisslerc5535c92023-01-27 16:10:19 -06004Subject: [PATCH] Fix libtool detection
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
6Use LT_INIT instead of the deprecated AC_PROG_LIBTOOL to detect libtool, so it
7can work with our libtoolize and libtool.
8
9Simplify the detection of ltdl. It will find the ltdl from the sysroot; the
10switch --with-system-libltdl is no longer needed. The code is copied from
11pulseaudio configure.ac, together with the comment paragraph.
12
Andrew Geisslerc5535c92023-01-27 16:10:19 -060013Upstream-Status: Inappropriate [embedded specific]
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014
15Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
16Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Brad Bishopc1d34332019-09-09 14:56:00 -040017Signed-off-by: Changqing Li <changqing.li@windriver.com>
Brad Bishopd7bf8c12018-02-25 22:55:05 -050018---
Brad Bishopd7bf8c12018-02-25 22:55:05 -050019 configure.ac | 36 ++++++++++++++++++++++++++++++++++++
Andrew Geisslerc5535c92023-01-27 16:10:19 -060020 1 file changed, 36 insertions(+)
Brad Bishopd7bf8c12018-02-25 22:55:05 -050021
Brad Bishopd7bf8c12018-02-25 22:55:05 -050022diff --git a/configure.ac b/configure.ac
Andrew Geisslerc5535c92023-01-27 16:10:19 -060023index ad8bc8cdda..ef8fced680 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024--- a/configure.ac
25+++ b/configure.ac
Andrew Geisslerc5535c92023-01-27 16:10:19 -060026@@ -321,6 +321,42 @@ dnl # See if we have Git.
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027 dnl #
28 AC_CHECK_PROG(GIT, git, yes, no)
29
30+#### libtool stuff ####
31+
32+dnl set this shit so it doesn't force CFLAGS...
33+LTCFLAGS=" "
34+
35+LT_PREREQ(2.2)
36+LT_INIT([dlopen disable-static])
37+
38+dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
39+dnl exactly which version of libltdl is present in the system, so we
40+dnl just assume that it's a working version as long as we have the
41+dnl library and the header files.
42+dnl
43+dnl As an extra safety device, check for lt_dladvise_init() which is
44+dnl only implemented in libtool 2.x, and refine as we go if we have
45+dnl refined requirements.
46+dnl
47+dnl Check the header files first since the system may have a
48+dnl libltdl.so for runtime, but no headers, and we want to bail out as
49+dnl soon as possible.
50+dnl
51+dnl We don't need any special variable for this though, since the user
52+dnl can give the proper place to find libltdl through the standard
53+dnl variables like LDFLAGS and CPPFLAGS.
54+
55+AC_CHECK_HEADER([ltdl.h],
56+ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
57+ [LIBLTDL=])
58+
59+AS_IF([test "x$LIBLTDL" = "x"],
60+ [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
61+AC_SUBST([LIBLTDL])
62+LTDL_SUBDIRS=
63+INCLTDL=-DWITH_SYSTEM_LTDL
64+AC_SUBST(LTDL_SUBDIRS)
65+
66 dnl Put this in later, when all distributed modules use autoconf.
67 dnl AC_ARG_WITH(disablemodulefoo,
68 dnl [ --without-rlm_foo Disables module compilation. Module list:]
69--
Andrew Geisslerc5535c92023-01-27 16:10:19 -0600702.25.1
Brad Bishopd7bf8c12018-02-25 22:55:05 -050071