From 68a7dcd93fbff209963850072f55e0936b23da60 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Wed, 28 Apr 1999 15:26:14 +0000 Subject: [PATCH] * libtool.m4 (ltconfig_enable_win32_dll): pass --enable-win32-dll to ltconfig if this is set. (AC_LIBTOOL_WIN32_DLL): New macro required for libtool to attempt a dll build on win32 hosts. * ltconfig.in (--enable-win32-dll): new flag for the cli. (cygwin*|mingw*|os2*, ltconfig_enable_win32_dll): if this is not set to yes, then do not attempt to build shared libraries. * doc/libtool.texi: document AC_LIBTOOL_WIN32_DLL. * NEWS: noted new macro. --- ChangeLog | 12 ++++++++++++ NEWS | 2 ++ doc/libtool.texi | 17 ++++++++++++++++- libtool.m4 | 6 ++++++ ltconfig.in | 15 +++++++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8aefba7ad..b80a8eb6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +1999-04-28 Gary V. Vaughan + + * libtool.m4 (ltconfig_enable_win32_dll): pass --enable-win32-dll to + ltconfig if this is set. + (AC_LIBTOOL_WIN32_DLL): New macro required for libtool to attempt + a dll build on win32 hosts. + * ltconfig.in (--enable-win32-dll): new flag for the cli. + (cygwin*|mingw*|os2*, ltconfig_enable_win32_dll): if this is not set + to yes, then do not attempt to build shared libraries. + * doc/libtool.texi: document AC_LIBTOOL_WIN32_DLL. + * NEWS: noted new macro. + 1999-04-27 Alexandre Oliva * libtool.m4 (AC_LIBTOOL_DLOPEN, AC_ENABLE_SHARED, diff --git a/NEWS b/NEWS index 5dae163eb..4bdfea115 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ New in 1.3b: 1999-??-??; CVS version 1.3a, Libtool team: New in 1.3: 1999-04-??; CVS version 1.2g, Libtool team: * AM_PROG_LIBTOOL is smaller and faster +* AC_LIBTOOL_WIN32_DLL is required in configure.in for libtool to + attempt to build dlls on win32 hosts * Shared libraries on AmigaOS up to version 4 are now disabled since they don't meet libtool's requirements for shared libraries * -L supports now relative directories diff --git a/doc/libtool.texi b/doc/libtool.texi index 9c44f428f..2df5299a7 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1800,7 +1800,22 @@ on @file{libtool}. Enable checking for dlopen support. This macro should be used if the package makes use of the @samp{-dlopen} and @samp{-dlpreopen} flags, otherwise libtool will assume that the system does not support dlopening. -The macro must be called *before* @code{AM_PROG_LIBTOOL}. +The macro must be called @strong{before} @code{AM_PROG_LIBTOOL}. +@end defmac + +@defmac 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 @code{__declspec(dllexport)} and imported with +@code{__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. + +@code{AM_PROG_LIBTOOL} must be called @strong{after} this macro, and +provision must be made to pass @samp{-no-undefined} to @code{libtool} +in link mode from the package @code{Makefile}. Naturally, passing +@samp{-no-undefined} means that all the library symbols @strong{really are} +defined at link time! @end defmac @defmac AC_DISABLE_FAST_INSTALL diff --git a/libtool.m4 b/libtool.m4 index 80a07aecb..d45e11431 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -75,6 +75,8 @@ test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], [libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[libtool_flags="$libtool_flags --enable-win32-dll"]) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" @@ -126,6 +128,10 @@ esac # AC_LIBTOOL_DLOPEN - enable checks for dlopen support AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([AC_LIBTOOL_SETUP])]) +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, +[AC_BEFORE([AC_LIBTOOL_WIN32_DLL], [AC_LIBTOOL_SETUP])]) + # AC_ENABLE_SHARED - implement the --enable-shared flag # Usage: AC_ENABLE_SHARED[(DEFAULT)] # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to diff --git a/ltconfig.in b/ltconfig.in index d986aee6f..79312b767 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -185,6 +185,7 @@ enable_shared=yes enable_static=yes enable_fast_install=yes enable_dlopen=unknown +enable_win32_dll=no ltmain= silent= srcdir= @@ -244,6 +245,7 @@ Generate a system-specific libtool script. --disable-static do not build static libraries --disable-fast-install do not optimize for fast installation --enable-dlopen enable dlopen support + --enable-win32-dll enable building dlls on win32 hosts --help display this help and exit --no-verify do not verify that HOST is a valid host type -o, --output=FILE specify the output file [default=$default_ofile] @@ -277,6 +279,8 @@ EOM --enable-dlopen) enable_dlopen=yes ;; + --enable-win32-dll) enable_win32_dll=yes ;; + --quiet | --silent) silent=yes ;; --srcdir) prev=srcdir ;; @@ -1975,6 +1979,17 @@ test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in +# configure.in, otherwise build static only libraries. +case "$host_os" in +cygwin* | mingw* | os2*) + if test x$can_build_shared = xyes; then + test x$enable_win32_dll = xno && can_build_shared=no + echo "checking if package supports dlls... $can_build_shared" 1>&6 + fi +;; +esac + if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then case "$deplibs_check_method" in "file_magic "*) -- 2.47.3