]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (ltconfig_enable_win32_dll): pass --enable-win32-dll to
authorGary V. Vaughan <gary@gnu.org>
Wed, 28 Apr 1999 15:26:14 +0000 (15:26 +0000)
committerGary V. Vaughan <gary@gnu.org>
Wed, 28 Apr 1999 15:26:14 +0000 (15:26 +0000)
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
NEWS
doc/libtool.texi
libtool.m4
ltconfig.in

index 8aefba7adabc1e223619dd72b88f8f3024961069..b80a8eb6e16ea5183f1dfee36edf7645d5ee8e38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+1999-04-28  Gary V. Vaughan  <gary@oranda.demon.co.uk>
+
+       * 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  <oliva@dcc.unicamp.br>
 
        * libtool.m4 (AC_LIBTOOL_DLOPEN, AC_ENABLE_SHARED,
diff --git a/NEWS b/NEWS
index 5dae163eb2846ab2837f0185cfc479ea1c500139..4bdfea115a2227ef08e3c9e82ecc0c35d1948c50 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ New in 1.3b: 1999-??-??; CVS version 1.3a, Libtool team:
 \f
 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
index 9c44f428f039ec5fc9306dec975c628cf2f1faef..2df5299a78cea545becc7213195c112aafca6eba 100644 (file)
@@ -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
index 80a07aecbb1ffcd959c71364a1934ab9833f93e1..d45e11431208132771f9b908ea0673e9414744c4 100644 (file)
@@ -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
index d986aee6ff5e2273b9d96753b272d69a19d0ba33..79312b76702c6ea5a2bbdf367650fe0b6ec105f6 100755 (executable)
@@ -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 "*)