From: Gary V. Vaughan Date: Mon, 13 Dec 1999 16:34:18 +0000 (+0000) Subject: * NEWS: updated. X-Git-Tag: release-1-3d~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afe514df6a0849c3e0d1498e54a6dde1cc8dbdb3;p=thirdparty%2Flibtool.git * NEWS: updated. * libltdl/Makefile.am: Use -no-undefined for dll compliance. * libltdl/configure.in: Use AC_LIBTOOL_WIN32_DLL for dll compliance. * libltdl/ltdl.c: Define and use LTDL_GLOBAL_DATA to correctly export global data symbols from libtldl.dll. * libltdl/ltdl.h: Define and use LTDL_SCOPE to declare data symbols as dllexport, dllimport or plain ornary extern depending in the context in which it is used. --- diff --git a/ChangeLog b/ChangeLog index dd3eb127b..02ea5674a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 1999-12-13 Gary V. Vaughan + * NEWS: updated. + * libltdl/Makefile.am: Use -no-undefined for dll compliance. + * libltdl/configure.in: Use AC_LIBTOOL_WIN32_DLL for dll + compliance. + * libltdl/ltdl.c: Define and use LTDL_GLOBAL_DATA to correctly + export global data symbols from libtldl.dll. + * libltdl/ltdl.h: Define and use LTDL_SCOPE to declare data + symbols as dllexport, dllimport or plain ornary extern depending + in the context in which it is used. + * doc/libtool.texi (Distributing libltdl): document use of ltdl.m4. * libltdl/configure.in: Removed header checks, as they are diff --git a/NEWS b/NEWS index c43cbed49..70057d4db 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ NEWS - list of user-visible changes between releases of GNU Libtool New in 1.3d: 1999-??-??; CVS version 1.3c, Libtool team: +* libltdl can now be built as a dll with win32. * m4 macros needed to configure libltdl split out into libltdl/ltdl.m4. * Start of support code for cross-compiling to win32. * Improved support for mingw32. @@ -11,8 +12,9 @@ New in 1.3d: 1999-??-??; CVS version 1.3c, Libtool team: environments is inherited from --build flag passed to configure. * Various bugfixes -New in 1.3.4: 1999-??-??, CVS version 1.3.3a, Libtool team: +New in 1.3.4: 1999-12-08, CVS version 1.3.3a, Libtool team: * Support for Compaq Tru64 V5.0. +* Improved support for Digital Unix V4.*. * Improved support for NetBSD, FreeBSD and Unixware. * Many fine bugfixes. diff --git a/libltdl/Makefile.am b/libltdl/Makefile.am index a1df9fc37..dafd5854d 100644 --- a/libltdl/Makefile.am +++ b/libltdl/Makefile.am @@ -14,7 +14,7 @@ noinst_LTLIBRARIES = libltdlc.la endif libltdl_la_SOURCES = ltdl.c -libltdl_la_LDFLAGS = -version-info 1:2:1 +libltdl_la_LDFLAGS = -no-undefined -version-info 1:2:1 libltdl_la_LIBADD = $(LIBADD_DL) libltdlc_la_SOURCES = ltdl.c diff --git a/libltdl/configure.in b/libltdl/configure.in index d03069427..766a9aa8a 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -21,6 +21,8 @@ AM_MAINTAINER_MODE AC_PROG_CC AC_C_CONST AC_C_INLINE + +AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_SUBST(LIBTOOL_DEPS) diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 4d75e02e5..ee5fcb3ed 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -60,6 +60,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA #include "ltdl.h" +#ifdef DLL_EXPORT +# define LTDL_GLOBAL_DATA __declspec(dllexport) +#else +# define LTDL_GLOBAL_DATA +#endif + /* max. filename length */ #ifndef LTDL_FILENAME_MAX #define LTDL_FILENAME_MAX 1024 @@ -100,13 +106,13 @@ static const char shutdown_error[] = "library already shutdown"; #ifndef HAVE_PRELOADED_SYMBOLS /* If libtool won't define it, we'd better do */ -const lt_dlsymlist lt_preloaded_symbols[1] = { { 0, 0 } }; +LTDL_GLOBAL_DATA const lt_dlsymlist lt_preloaded_symbols[1] = { { 0, 0 } }; #endif static const char *last_error = 0; -lt_ptr_t (*lt_dlmalloc) LTDL_PARAMS((size_t size)) = (lt_ptr_t(*)LTDL_PARAMS((size_t)))malloc; -void (*lt_dlfree) LTDL_PARAMS((lt_ptr_t ptr)) = (void(*)LTDL_PARAMS((lt_ptr_t)))free; +LTDL_GLOBAL_DATA lt_ptr_t (*lt_dlmalloc) LTDL_PARAMS((size_t size)) = (lt_ptr_t(*)LTDL_PARAMS((size_t)))malloc; +LTDL_GLOBAL_DATA void (*lt_dlfree) LTDL_PARAMS((lt_ptr_t ptr)) = (void(*)LTDL_PARAMS((lt_ptr_t)))free; typedef struct lt_dltype_t { struct lt_dltype_t *next; diff --git a/libltdl/ltdl.h b/libltdl/ltdl.h index c0e446b87..b67e0b821 100644 --- a/libltdl/ltdl.h +++ b/libltdl/ltdl.h @@ -54,6 +54,22 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA # define lt_ptr_t char* #endif +/* DLL building support on win32 hosts; mostly to workaround their + ridiculous implementation of data symbol exporting. */ +#ifndef LTDL_SCOPE +# ifdef _WIN32 +# ifdef DLL_EXPORT /* defined by libtool (if required) */ +# define LTDL_SCOPE __declspec(dllexport) +# endif +# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */ +# define LTDL_SCOPE extern __declspec(dllimport) +# endif +# endif +# ifndef LTDL_SCOPE /* static linking or !_WIN32 */ +# define LTDL_SCOPE extern +# endif +#endif + #include #ifdef _LTDL_COMPILE_ @@ -81,11 +97,11 @@ extern int lt_dladdsearchdir LTDL_PARAMS((const char *search_dir)); extern int lt_dlsetsearchpath LTDL_PARAMS((const char *search_path)); extern const char *lt_dlgetsearchpath LTDL_PARAMS((void)); -extern const lt_dlsymlist lt_preloaded_symbols[]; +LTDL_SCOPE const lt_dlsymlist lt_preloaded_symbols[]; #define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols) -extern lt_ptr_t (*lt_dlmalloc)LTDL_PARAMS((size_t size)); -extern void (*lt_dlfree)LTDL_PARAMS((lt_ptr_t ptr)); +LTDL_SCOPE lt_ptr_t (*lt_dlmalloc)LTDL_PARAMS((size_t size)); +LTDL_SCOPE void (*lt_dlfree)LTDL_PARAMS((lt_ptr_t ptr)); __END_DECLS