Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 1 | From 5ba3d140842268cbbdd983266efecb1fba5bdd59 Mon Sep 17 00:00:00 2001 |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Thu, 22 Aug 2019 10:45:46 +0800 |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 4 | Subject: [PATCH] Fix libtool detection |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 | |
| 6 | Use LT_INIT instead of the deprecated AC_PROG_LIBTOOL to detect libtool, so it |
| 7 | can work with our libtoolize and libtool. |
| 8 | |
| 9 | Simplify the detection of ltdl. It will find the ltdl from the sysroot; the |
| 10 | switch --with-system-libltdl is no longer needed. The code is copied from |
| 11 | pulseaudio configure.ac, together with the comment paragraph. |
| 12 | |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 13 | Upstream-Status: Inappropriate [embedded specific] |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 14 | |
| 15 | Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> |
| 16 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> |
Brad Bishop | c1d3433 | 2019-09-09 14:56:00 -0400 | [diff] [blame] | 17 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 18 | --- |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 19 | configure.ac | 36 ++++++++++++++++++++++++++++++++++++ |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 20 | 1 file changed, 36 insertions(+) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 22 | diff --git a/configure.ac b/configure.ac |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 23 | index ad8bc8cdda..ef8fced680 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 24 | --- a/configure.ac |
| 25 | +++ b/configure.ac |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 26 | @@ -321,6 +321,42 @@ dnl # See if we have Git. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | 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 Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 70 | 2.25.1 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 71 | |