From eb974575227fe2792293d2024127715876753056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Tue, 28 May 2013 21:57:36 +0200 Subject: [PATCH 1/2] use system ltdl library --- Makefile.am | 11 ++-- bootstrap.c | 2 +- configure.ac | 147 +------------------------------------------------- decNumber/Makefile.am | 2 - hdl.h | 2 +- herclin.c | 2 +- 6 files changed, 8 insertions(+), 158 deletions(-) diff --git a/Makefile.am b/Makefile.am index f5ef0f4..917783b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -10,7 +10,7 @@ lns=@LN_S@ SUBDIRS = decNumber softfloat m4 util html man . crypto -LDADD = @LIBS@ +LDADD = @LIBS@ -lltdl AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/decNumber -I$(top_srcdir)/softfloat @@ -98,7 +98,6 @@ endif if OPTION_DYNAMIC_LOAD DYNSRC = - LTDL = ltdl.c DYNMOD_LD_FLAGS = -module \ -no-undefined \ @@ -117,7 +116,6 @@ if OPTION_DYNAMIC_LOAD -avoid-version else DYNSRC = $(dyndev_SRC) - LTDL = DYNMOD_LD_FLAGS = DYNMOD_LD_ADD = LIB_LD_FLAGS = $(XSTATIC) \ @@ -295,8 +293,7 @@ endif memrchr.c \ parser.c \ pttrace.c \ - $(FTHREADS) \ - $(LTDL) + $(FTHREADS) libhercu_la_LDFLAGS = $(LIB_LD_FLAGS) @@ -372,8 +369,7 @@ endif memrchr.c \ $(dynamic_SRC) \ $(extra_SRC) \ - $(dyndev_SRC) \ - ltdl.c + $(dyndev_SRC) libherc_la_LDFLAGS = $(LIB_LD_FLAGS) @@ -656,7 +652,6 @@ noinst_HEADERS = hostinfo.h \ hdl.h \ crypto.h \ sockdev.h \ - ltdl.h \ herc_getopt.h \ service.h \ chsc.h \ diff --git a/bootstrap.c b/bootstrap.c index 476fb07..edbc68c 100644 --- a/bootstrap.c +++ b/bootstrap.c @@ -11,7 +11,7 @@ #include "hstdinc.h" #include "hercules.h" #if defined(HDL_USE_LIBTOOL) -#include "ltdl.h" +#include #endif #if !defined( _MSVC_ ) diff --git a/configure.ac b/configure.ac index 80a38e1..3cb8ef7 100644 --- a/configure.ac +++ b/configure.ac @@ -44,151 +44,8 @@ modexecdir='$(libdir)/$(PACKAGE)' AC_SUBST(modexecdir) -# ----------------------------------------------------------------------------- -# -# AC_LIBTOOL_DLOPEN -# -# Enable checking for dlopen support. This macro should be used if the -# package makes use of the '-dlopen' and '-dlpreopen' flags, otherwise -# libtool will assume that the system does not support dlopening. The -# macro must be called before AC_PROG_LIBTOOL. -# -# ----------------------------------------------------------------------------- - -AC_LIBTOOL_DLOPEN() # (we need libtool's dlopen support) - - -# ----------------------------------------------------------------------------- -# -# AC_LIBTOOL_WIN32_DLL -# -# This macro should be used if the package has been ported to build -# clean dlls on win32 platforms. Usually this means that any library -# data items are exported with __declspec(dllexport) and imported with -# __declspec(dllimport). If this macro is not used, libtool will assume -# that the package libraries are not dll clean and will build only static -# libraries on win32 hosts. -# -# This macro must be called before AC_PROG_LIBTOOL, and provision must -# be made to pass '-no-undefined' to libtool in link mode from the package -# Makefile. Naturally, if you pass '-no-undefined', you must ensure that -# all the library symbols really are defined at link time! -# -# ----------------------------------------------------------------------------- - -AC_LIBTOOL_WIN32_DLL() # (we need Win32 support in libtool) - - -# ----------------------------------------------------------------------------- -# See: 'AC_PROG_LIBTOOL' below. -# ----------------------------------------------------------------------------- - -AC_DISABLE_STATIC() # (forces libtool to build shared - - # libraries instead of static ones) -# ----------------------------------------------------------------------------- -# AC_PROG_LIBTOOL -# -# Add support for the '--enable-shared' and '--disable-shared' -# configure flags. By default, this macro turns on shared libraries -# if they are available, and also enables static libraries if they -# don't conflict with the shared libraries. You can modify these -# defaults by calling either the AC_DISABLE_SHARED or AC_DISABLE_STATIC -# macros. -# -# Hercules REQUIRES shared libraries (i.e. DLLs), so we do indeed use -# the AC_DISABLE_STATIC macro above. -# -# ----------------------------------------------------------------------------- - -AC_PROG_LIBTOOL() # (we build libtool for ourselves) - - -# ----------------------------------------------------------------------------- -# -# AC_LIB_LTDL -# -# Even though libltdl is installed together with libtool, you may wish -# to include libltdl in the distribution of your package, for the convenience -# of users of your package that don't have libtool or libltdl installed. -# -# The most simplistic way to add libltdl to your package is to copy the -# source files, 'ltdl.c' and 'ltdl.h', to a source directory withing your -# package and to build and link them along with the rest of your sources. -# -# To do this, you must add a call to the 'AC_LIB_LTDL' macro to your package's -# 'configure.in' to perform the required configure time checks in order that -# 'ltdl.o' is built correctly. -# -# This method does have its problems though: if you try to link the package -# binaries with an installed libltdl, or a library which depends on libltdl, -# you may have problems with duplicate symbol definitions. -# -# In order to enable this flavor of libltdl, you should add the line -# 'AC_LIBLTDL_CONVENIENCE' to your `configure.in', before 'AC_PROG_LIBTOOL'. -# -# In order to select the installable version of libltdl, you should add a -# call of the macro 'AC_LIBLTDL_INSTALLABLE' to your 'configure.in' before -# 'AC_PROG_LIBTOOL'. This macro will check whether libltdl is already -# installed and, if not, request the libltdl embedded in your package to be -# built and installed. -# -# Whatever macro you use, it is up to you to ensure that your 'configure.in' -# will configure libltdl, using 'AC_CONFIG_SUBDIRS', and that your 'Makefile's -# will start sub-makes within libltdl's directory, using automake's SUBDIRS, -# for example. Both macros define the shell variables LIBLTDL, to the link flag -# that you should use to link with libltdl, and LTDLINCL, to the preprocessor -# flag that you should use to compile with programs that include 'ltdl.h'. It -# is up to you to use 'AC_SUBST' to ensure that this variable will be available -# in 'Makefile's, or add them to variables that are 'AC_SUBST'ed by default, -# such as LIBS and CPPFLAGS. -# -# So, when you want to link a program with libltdl, be it a convenience, -# installed or installable library, just compile with '$(LTDLINCL)' and link -# it with '$(LIBLTDL)', using libtool. -# -# You should probably also add 'AC_LIBTOOL_DLOPEN' to your 'configure.in' before -# 'AC_PROG_LIBTOOL', otherwise libtool will assume no dlopening mechanism is -# supported, and revert to dlpreopening, which is probably not what you want. -# -# The following example shows you how to embed the convenience libltdl -# in your package. In order to use the installable variant just replace -# 'AC_LIBLTDL_CONVENIENCE' with 'AC_LIBLTDL_INSTALLABLE'. We assume that libltdl -# was embedded using 'libtoolize --ltdl': -# -# configure.in: -# -# ... -# dnl Enable building of the convenience library -# dnl and set LIBLTDL accordingly -# AC_LIBLTDL_CONVENIENCE -# dnl Substitute LTDLINCL and LIBLTDL in the Makefiles -# AC_SUBST(LTDLINCL) -# AC_SUBST(LIBLTDL) -# dnl Check for dlopen support -# AC_LIBTOOL_DLOPEN -# dnl Configure libtool -# AC_PROG_LIBTOOL -# dnl Configure libltdl -# AC_CONFIG_SUBDIRS(libltdl) -# ... -# -# Makefile.am: -# -# ... -# SUBDIRS = libltdl -# -# INCLUDES = $(LTDLINCL) -# -# myprog_LDFLAGS = -export-dynamic -# # The quotes around -dlopen below fool automake <= 1.4 into accepting it -# myprog_LDADD = $(LIBLTDL) "-dlopen" self "-dlopen" foo1.la -# myprog_DEPENDENCIES = $(LIBLTDL) foo1.la -# ... -# -# ----------------------------------------------------------------------------- - -AC_LIB_LTDL() # (we need the ltdl libtool library) +LT_INIT([dlopen win32-dll disable-static]) +LTDL_INIT([]) AC_SUBST([LIBTOOL_DEPS]) # (see PROGRAMMING NOTE above) diff --git a/decNumber/Makefile.am b/decNumber/Makefile.am index 3c20bdd..fd3149f 100644 --- a/decNumber/Makefile.am +++ b/decNumber/Makefile.am @@ -37,13 +37,11 @@ else endif if OPTION_DYNAMIC_LOAD - LTDL = ../ltdl.c LIB_LD_FLAGS = -export-dynamic \ $(XSTATIC) \ -no-undefined \ -avoid-version else - LTDL = LIB_LD_FLAGS = $(XSTATIC) \ -no-undefined \ -avoid-version diff --git a/hdl.h b/hdl.h index 656e831..08b005a 100644 --- a/hdl.h +++ b/hdl.h @@ -157,7 +157,7 @@ typedef struct _DLLENT { /* DLL entry */ #elif defined(_MSVC_) #define HDL_MODULE_SUFFIX ".dll" #else - #define HDL_MODULE_SUFFIX ".la" + #define HDL_MODULE_SUFFIX ".so" #endif #endif diff --git a/herclin.c b/herclin.c index a4b0494..1f935aa 100644 --- a/herclin.c +++ b/herclin.c @@ -26,7 +26,7 @@ /* This must be included if HDL uses the */ /* libtool ltdl convenience library */ -#include "ltdl.h" +#include #endif -- 1.8.5.3 From 02bf55850a2889f46debbfc75ef6734ae0e0fe36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Sun, 2 Feb 2014 18:21:46 +0100 Subject: [PATCH 2/2] don't run Makefile in the util directory --- Makefile.am | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 917783b..65062a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ ACLOCAL_AMFLAGS = -I m4 -I autoconf lns=@LN_S@ -SUBDIRS = decNumber softfloat m4 util html man . crypto +SUBDIRS = decNumber softfloat m4 html man . crypto LDADD = @LIBS@ -lltdl diff --git a/configure.ac b/configure.ac index 3cb8ef7..61f6537 100644 --- a/configure.ac +++ b/configure.ac @@ -1785,7 +1785,7 @@ AM_CONDITIONAL( USE_DLLTOOL, [ test "$hc_cv_is_windows" = "yes" ] AC_CACHE_SAVE() -AC_OUTPUT( [ Makefile util/Makefile html/Makefile crypto/Makefile man/Makefile m4/Makefile decNumber/Makefile softfloat/Makefile] ) +AC_OUTPUT( [ Makefile html/Makefile crypto/Makefile man/Makefile m4/Makefile decNumber/Makefile softfloat/Makefile] ) ############################################################################### # (end-of-file) -- 1.8.5.3