From 74a6e7e6b9b906c7dd2f7819912cc465d7833dd6 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Mon, 22 Apr 2013 17:29:13 -0500 Subject: [PATCH] Build libltdl recursively instead of as a sub-project Building libltdl recursively now eliminates the second 'configure' run inside the libltdl directory and requires the distribution of fewer files and quiets compilation. Also, if the 'configure' option '--with-included-ltdl' is not passed and a system libltdl is found, the included libltdl directory will not even be built. Only when the included libltdl is needed will it be built. --- Makefile.am | 6 +++++- configure.ac | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index e16ac183b..b903e3d41 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,11 @@ pkgconfig_DATA = hamlib.pc EXTRA_DIST = PLAN TODO LICENSE hamlib.m4 hamlib.pc.in README.developer \ README.betatester README.win32 -SUBDIRS = libltdl macros include lib src \ +SUBDIRS = +if BUILD_LIBLTDL +SUBDIRS += libltdl +endif +SUBDIRS += macros include lib src \ @BACKEND_LIST@ \ @ROT_BACKEND_LIST@ \ @BINDINGS@ \ diff --git a/configure.ac b/configure.ac index f23fc0a7f..648ef4c2b 100644 --- a/configure.ac +++ b/configure.ac @@ -241,11 +241,18 @@ dnl the frontend and backend libs are not linked. May need a recipe outside dnl of Libtool if these are needed. LT_INIT([dlopen win32-dll disable-static]) -dnl Enable building of the convenience libltdl library +dnl Enable building of the convenience libltdl library recursively dnl (requires --with-included-ltdl be given to configure for the included dnl libltdl to be used instead of an installed version), useful on systems dnl where libltdl-dev is not installed. -LTDL_INIT([convenience]) +LTDL_INIT([convenience recursive]) + +dnl Ugly hack to work around libtool LT_CONFIG_H bug #12262 +dnl http://lists.gnu.org/archive/html/bug-libtool/2012-08/msg00007.html +AC_CONFIG_COMMANDS_PRE([LT_CONFIG_H=`expr "$LT_CONFIG_H" : '.*/\(.*\)'`]) + +dnl Only build libtldl if it is needed. +AM_CONDITIONAL([BUILD_LIBLTDL], [test x"${with_included_ltdl}" = "xyes"]) ## -------------------------- ## @@ -652,6 +659,7 @@ AC_SUBST([AM_CPPFLAGS]) AC_CONFIG_FILES([Makefile macros/Makefile include/Makefile +libltdl/Makefile lib/Makefile dummy/Makefile yaesu/Makefile