]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
resync with HEAD
authorBruce Korb <bkorb@gnu.org>
Tue, 12 Mar 2002 02:06:26 +0000 (02:06 +0000)
committerBruce Korb <bkorb@gnu.org>
Tue, 12 Mar 2002 02:06:26 +0000 (02:06 +0000)
29 files changed:
AUTHORS
ChangeLog
NEWS
THANKS
configure.ac
demo/Makefile.am
demo/configure.ac
demo/foo.c
demo/foo.h
demo/hello.c
depdemo/Makefile.am
depdemo/configure.ac
depdemo/l3/Makefile.am
depdemo/main.c
exe/install-txt.tpl
exe/link-txt.tpl
libltdl/ltdl.c
libtool.m4
ltmain.in
mdemo/Makefile.am
tests/build-relink.test
tests/demo-exec.test
tests/demo-inst.test
tests/depdemo-exec.test
tests/depdemo-inst.test
tests/dryrun.test
tests/mdemo-exec.test
tests/mdemo-inst.test
tests/noinst-link.test

diff --git a/AUTHORS b/AUTHORS
index d29d2ba44f61daca3434654187f8e53565eca02f..3978a6d94ee87b5856b3430a71c68b437670760f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,4 +8,3 @@ Thomas Tanner <tanner@ffii.org>.  Co-maintainer.
 Gary V. Vaughan <gvv@techie.com>.  Co-maintainer.
 Ossama Othman <ossama@debian.org>.  Co-maintainer.
 Robert Boehne <rboehne@ricardo-us.com>.  Co-maintainer.
-Bruce Korb <bkorb@gnu.org>.  Binary-Branch maintainer.
index 556b6c4245e754f4a16cbbd3c95b20deee5b9ca6..e417907b16205f08a2d2fd8cc6be6dd5255adb00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2002-02-09  Gary V. Vaughan  <gary@gnu.org>
+
+       * NEWS: Updated.
+       * THANKS: Added Rob Collins and Chuck Wilson for their cygwin
+       work.
+
+       From Robert Collins  <robert.collins@itdomain.com.au>:
+       * configure.ac (AC_EXEEXT): Needed for DOSish systems.
+       * libtool.m4 (shlibpath_overrides_runpath) [cygwin]: Set to yes
+       when compiling with gcc.
+       (lt_prog_compiler_pic) [cygwin]: No longer needs the -DDLL_EXPORT
+       hack, so we just say the pic is the default.
+       (AC_LIBTOOL_PROG_LD_SHLIBS) [cygwin]: Extract symbols from a
+       library normally.
+       [cygwin]: Declare C++ compiler characterisics for g++, taking into
+       account the new auto-import support in cygwin ld.
+       * ltmain.in (specialdeplibs) [cygwin]: Be careful about
+       eliminating duplicate -lgcc's from the link line.
+       [cygwin]: Be smarter about .exe suffixes.
+       * demo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL):  Support
+       DOSish systems properly.
+       * depdemo/configure.ac (AC_EXEEXT, AC_LIBTOOL_WIN32_DLL):  Ditto.
+       * demo/Makefile.am (deplibs-check): Allow for .exe suffix.  Use
+       hell_static instead of hell.static for multi-`.' inhibited OSes.
+       * tests/demo-exec.test: Ditto.
+       * tests/demo-inst.test: Ditto.
+       * demo/foo.h [cygwin]: Sanitize cygwin dll support.
+       * demo/foo.c (_LIBFOO_COMPILATION_): No longer required.
+       * demo/hello.c (_LIBFOO_COMPILATION_): Ditto.
+       * depdemo/Makefile.am (bin_PROGRAMS): Use depdemo_static instead
+       of depdemo.static for multi-`.' inhibited OSes.
+       * tests/depdemo-exec.test: Ditto.
+       * tests/depdemo-inst.test: Ditto.
+       * mdemo/Makefile.am (bin_PROGRAMS):  Ditto for mdemo.static.
+       * tests/dryrun.test: Ditto.
+       * tests/mdemo-exec.test: Ditto.
+       * tests/mdemo-inst.test: Ditto.
+       * tests/build-relink.test:  Be careful about possible .exe
+       suffixes.
+       * tests/noinst-link.test: Allow for .exe suffix.
+
 2002-02-07  Alexandre Oliva  <aoliva@redhat.com>
 
        Reverted incorrect patch:
diff --git a/NEWS b/NEWS
index 38125a6d3714809ae5f27ccd43c1d9a882ad0b76..739a4fa9fa06436ac0b6649b53301aa234f70008 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
 NEWS - list of user-visible changes between releases of GNU Libtool
 
+New in 1.4f: 2002-??-??; CVS version 1.4e, Libtool team:
+* Support auto-import patch to binutils on cygwin for much improved dll
+  support.
+* Bug fixes.
+\f
 New in 1.4d: 2002-01-07; CVS version 1.4c, Libtool team:
 * Help strings display correctly again.
 * Better error messages when library linking fails.
@@ -148,7 +153,7 @@ New in 1.3: 1999-04-29, Libtool team:
 \f
 New in 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
+* AC_LIBTL_L_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
@@ -255,7 +260,7 @@ New in 1.2a - 1998-04-19, Gordon Matzigkeit:
 \f
 New in 1.2 - 1998-03-20, Gordon Matzigkeit:
 * Minor bug fixes to provide a stable public release.
-* Libtool no longer causes Solaris printf to barf due to silly
+* Libtool no longer cseses Solaris printf to barf due to silly
   2110-byte static buffers.
 \f
 New in 1.1 - 1998-03-08, Gordon Matzigkeit:
diff --git a/THANKS b/THANKS
index f16b81725f0a043e57b02a79aca57d214d8d33ce..8bc18307ba3d08b92ff8026659a696e7cf06315d 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -16,6 +16,7 @@ Andrey Slepuhin <pooh@msu.ru>
 Art Pope <apope@sarnoff.com>
 Bruno Haible <haible@ilog.fr>
 Carl D. Roth <roth@cse.ucsc.edu>
+Charles S. Wilson <cwilson@ece.gatech.edu>
 Chris P. Ross <cross@eng.us.uu.net>
 DJ Delorie <dj@delorie.com>
 Edouard G. Parmelan <Edouard.Parmelan@France.NCR.COM>
@@ -33,10 +34,11 @@ Mark Kettenis <kettenis@phys.uva.nl>
 Ossama Othman <othman@cs.wustl.edu>
 Olly Betts <olly@muscat.co.uk>
 Pavel Roskin <pavel_roskin@geocities.com>
+Robert Collins <robert.collins@itdomain.com.au>
 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
 Stephan Kulow <coolo@kde.org>
 Steven M. Schultz <sms@wlv.iipo.gtegsc.com>
 Todd Vierling <tv@pobox.com>
-Tom Tromey <tromey@cygnus.com>
+Tom Tmemey <tromey@cygnus.com>
 Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>
 Xavier Pianet <xavier@xingo.com>
index 0292f5e7ebcc19a25210afbaab8d0b7e75ab002e..607a750859b2698d913d7d31c07652f5c7d360d1 100644 (file)
@@ -95,6 +95,7 @@ AC_SUBST([DIST_MAKEFILE_LIST])
 
 # Use the specified CC and LD
 AC_PROG_CC
+AC_EXEEXT
 AM_PROG_LD
 AC_SUBST(LD)
 AM_PROG_NM
index 9c58735d4247c43466708cb8f91ba849210fa79b..08eb0895cbd8a6499d640b07b6f853aa05e51adb 100644 (file)
@@ -18,7 +18,7 @@ else
 BUILD_helldl = 
 endif
 
-bin_PROGRAMS = hell hell.static $(BUILD_helldl)
+bin_PROGRAMS = hell hell_static $(BUILD_helldl)
 
 # Build hell from main.c and libhello.la
 hell_SOURCES = main.c
@@ -137,4 +137,4 @@ hell0_LDADD = libhell1.la libhell2.la $(LIBM)
 
 CLEANFILES += $(EXTRA_LIBRARIES) $(EXTRA_LTLIBRARIES) $(EXTRA_PROGRAMS)
 
-deplibs-check: hell0
+deplibs-check: hell0$(EXEEXT)
index d420d409c693b0b006021a06fc7de4f28fd3389f..89c98a0744cd3696185686b44f40a3f02778c00d 100644 (file)
@@ -37,12 +37,14 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
 ## ---------------- ##
 AC_PROG_CC
 AC_C_CONST
+AC_EXEEXT
 
 
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
 AC_LIBTOOL_DLOPEN
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 AC_SUBST([LIBTOOL_DEPS])
 
index 4b67739970b8bbbe44e3d5277aaea1c254d7cf77..55fa9d973cbb3d21d583153d0e51839634c476e2 100644 (file)
@@ -18,9 +18,7 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 USA. */
 
-#define _LIBFOO_COMPILATION_
 #include "foo.h"
-#undef _LIBFOO_COMPILATION_
 
 #include <stdio.h>
 
index 6d4fee709d542486c2ff1f61179254ba05287a5f..d1c084f29fa7b7074e793a0f0f9320de1fc8da50 100644 (file)
@@ -24,11 +24,12 @@ USA. */
 
 /* At some point, cygwin will stop defining __CYGWIN32__, but b19 and
  * earlier do not define __CYGWIN__.  This snippit allows us to check
- * for __CYGWIN32__ reliably for both old and (probable) future releases.
+ * for __CYGWIN__ reliably for both current, old, and (probable) future 
+ * releases.
  */
-#ifdef __CYGWIN__
-#  ifndef __CYGWIN32__
-#    define __CYGWIN32__
+#ifdef __CYGWIN32__
+#  ifndef __CYGWIN__
+#    define __CYGWIN__
 #  endif
 #endif
 
@@ -49,7 +50,7 @@ USA. */
    that don't understand ANSI C prototypes still work, and ANSI C
    compilers can issue warnings about type mismatches. */
 #undef LTDL_PARAMS
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__CYGWIN32__) || defined(__cplusplus)
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(__CYGWIN__) || defined(__cplusplus)
 # define LT_PARAMS(protos) protos
 # define lt_ptr_t     void*
 #else
@@ -57,24 +58,6 @@ USA. */
 # define lt_ptr_t     char*
 #endif
 
-#ifdef __CYGWIN32__
-#  ifdef LIBFOO_DLL
-     /* need some (as yet non-existant) automake magic to tell
-      * the object whether the libfoo it will be linked with is
-      * a dll or not, ie whether LIBFOO_DLL is defined or not.
-      */
-#    ifdef _LIBFOO_COMPILATION_
-#      define EXTERN __declspec(dllexport)
-#    else
-#      define EXTERN extern __declspec(dllimport)
-#    endif
-#  else
-#    define EXTERN extern
-#  endif
-#else
-#  define EXTERN extern
-#endif
-
 /* Silly constants that the functions return. */
 #define HELLO_RET 0xe110
 #define FOO_RET 0xf00
@@ -84,7 +67,7 @@ USA. */
 __BEGIN_DECLS
 int foo LT_PARAMS((void));
 int hello LT_PARAMS((void));
-EXTERN int nothing;
+extern int nothing;
 __END_DECLS
 
 #endif /* !_FOO_H_ */
index ec9a639b95709da85aa05fdb8ef02a253c27eeb7..3858528dc20a6b28a4ffd6656df39e3a65da4be0 100644 (file)
@@ -18,9 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 USA. */
 
 /* Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu> */
-#define _LIBFOO_COMPILATION
 #include "foo.h"
-#undef _LIBFOO_COMPILATION
 
 #include <stdio.h>
 
index 64dd5871283d893aad7b8f304df62b9c99276854..2108b7faf2fdddf8e33d1b032ef62e4c27e3a008 100644 (file)
@@ -6,7 +6,7 @@ SUBDIRS = l1 l2 l3 l4
 
 EXTRA_DIST = sysdep.h
 
-bin_PROGRAMS = depdemo depdemo.static
+bin_PROGRAMS = depdemo depdemo_static
 
 depdemo_SOURCES = main.c
 depdemo_LDADD = $(top_builddir)/l1/libl1.la $(top_builddir)/l2/libl2.la \
index f49c31355fd60fb13e6a33054b93c6d030b67333..b9c11e0b37f0c88981e2799beab10133debdc931 100644 (file)
@@ -47,11 +47,12 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)
 ## compiler checks. ##
 ## ---------------- ##
 AC_PROG_CC
-
+AC_EXEEXT
 
 ## ----------------------- ##
 ## Libtool initialisation. ##
 ## ----------------------- ##
+AC_LIBTOOL_WIN32_DLL
 AM_PROG_LIBTOOL
 AC_SUBST([LIBTOOL_DEPS])
 
index 48d88ba58e3d803d5a0e422f65e8d599fc2b8a5f..873fca7e702b9f4a5995d487bdfc8df589d61e1f 100644 (file)
@@ -6,6 +6,6 @@ INCLUDES = -I$(top_srcdir)
 
 extradir = $(libdir)/extra
 
-extra_LTLIBRARIES = libl3.la
+lib_LTLIBRARIES = libl3.la
 libl3_la_SOURCES = l3.c l3.h
 libl3_la_LIBADD = $(top_builddir)/l1/libl1.la $(top_builddir)/l2/libl2.la
index 79a9296789f479a70e9af724727b519157cab3b6..ef2458d3a8c1d76e95ef19ba5f1216596de54b4b 100644 (file)
@@ -36,7 +36,11 @@ main (argc,argv)
   if (argc == 2 && strcmp (argv[1], "-alt") == 0
       && var_l1 + var_l2 + var_l4 == 8)
        return 0;
+  printf("var_l1(%d) + var_l2(%d) + var_l4(%d) == %d\n",var_l1,var_l2,var_l4, var_l1 + var_l2 + var_l4);
   if (var_l1 + var_l2 + var_l4 != 20)
+       {
+       printf("var_l1(%d) + var_l2(%d) + var_l4(%d) != 20\n",var_l1,var_l2,var_l4);
        return 1;
+       }
   return 0;
 }
index c77b74f4469b18940f20ed5c7d6fe6581bea05e0..e6eace616b93de72b974279c85f9f06a0637ce39 100644 (file)
          destfile="$destdir/$destfile"
        fi
 
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             file=`echo $file|${SED} 's,.exe$,,'`
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
        # Do a test to see if this is really a libtool program.
        case $host in
        *cygwin*|*mingw*)
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
                continue
              fi
-             file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+             file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
              outputname="$tmpdir/$file"
              # Replace the output file specification.
              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
            fi
          else
            # Install the binary that we compiled earlier.
-           file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+           file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
          fi
        fi
 
index b582c1363f4764e365b39985fa8583d81683d1c2..f74307c9812e8a8abd9d507cc68b59a88acaefa7 100644 (file)
     *) linkmode=prog ;; # Anything else should be a program.
     esac
 
-    specialdeplibs=
+    case $host in
+    *cygwin*)
+      # This is a hack, but we run into problems on cygwin.
+      # libgcc.a depends on libcygwin, but gcc puts -lgcc onto
+      # the link line twice: once before the "normal" libs
+      # (-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32) and
+      # once AFTER those.  However, the "eliminate dup deps"
+      # proceedure keeps only the LAST duplicate -- thus
+      # messing up the order, since after dup elimination
+      # -lgcc comes AFTER -lcygwin.  In normal C operation,
+      # you don't notice the problem, because -lgcc isn't
+      # really used.  However, now that C++ libraries are
+      # libtool-able, you DO see the problem.  So, it must
+      # be fixed.  We could always force "--preserve-dup-deps"
+      # but that could lead to other problems.  So, on cygwin,
+      # always preserve dups of -lgcc...but only -lgcc. That
+      # way, the dependency order won't get corrupted.
+      specialdeplibs="-lgcc"
+      ;;
+    *)
+      specialdeplibs=
+      ;;
+    esac
+
     libs=
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
@@ -3224,7 +3247,9 @@ static const void *lt_preloaded_setup() {
        esac
        # test for cygwin because mv fails w/o .exe extensions
        case $host in
-         *cygwin*) exeext=.exe ;;
+         *cygwin*)
+           exeext=.exe
+           outputname=`echo $outputname|${SED} 's,.exe$,,'` ;;
          *) exeext= ;;
        esac
        $rm $output
index b277fe91147200d0cab4ce7444dbab4529c52917..326e690ec22dbf36e770bd923f7e1ba9c02d8604 100644 (file)
@@ -911,8 +911,8 @@ lt_estrdup (str)
 /* --- DLOPEN() INTERFACE LOADER --- */
 
 
-/* The Cygwin dlopen implementation prints a spurious error message to
-   stderr if its call to LoadLibrary() fails for any reason.  We can
+/* Older Cygwin dlopen implementations print a spurious error message to
+   stderr if the call to LoadLibrary() fails for any reason.  We can
    mitigate this by not using the Cygwin implementation, and falling
    back to our own LoadLibrary() wrapper. */
 #if HAVE_LIBDL && !defined(__CYGWIN__)
index 497f70889246e4c38ca150ba0562af5d7bf04939..0da7338363e6a66b6f7e57b506d32117392798c0 100644 (file)
@@ -1085,6 +1085,7 @@ cygwin* | mingw* | pw32*)
     postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
        $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
     ;;
   yes,mingw*)
     library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
@@ -2547,6 +2548,27 @@ case $host_os in
        ;;
     esac
     ;;
+
+  cygwin*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+
+    if $LD --help 2>&1 | egrep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}-retain-symbols-file $wl$export_symbols ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+        ;;
+
+  mingw* | pw32*)
+    # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
   dgux*)
     case $cc_basename in
       ec++)
@@ -3921,10 +3943,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       # like `-m68040'.
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
       ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
-    cygwin* | mingw* | os2*)
+    mingw* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
@@ -4156,11 +4178,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
       ;;
 
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    cygwin* | mingw* | pw32* | os2*)
+    mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
@@ -4209,7 +4231,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       fi
       ;;
 
-    cygwin* | mingw* | pw32* | os2*)
+    mingw* | pw32* | os2*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
@@ -4331,7 +4353,7 @@ ifelse([$1],[CXX],[
       _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
-  cygwin* | mingw* | pw32*)
+  mingw* | pw32*)
     _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
   *)
@@ -4435,7 +4457,22 @@ EOF
       fi
       ;;
 
-    cygwin* | mingw* | pw32*)
+    cygwin*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+
+      if $LD --help 2>&1 | egrep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}-retain-symbols-file $wl$export_symbols ${wl}--out-implib,$lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    mingw* | pw32*)
       # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is
       # no search path for DLLs.
       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
@@ -4451,21 +4488,15 @@ EOF
 
       _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
 
-      # cygwin and mingw dlls have different entry points and sets of symbols
-      # to exclude.
       # FIXME: what about values for MSVC?
       dll_entry=__cygwin_dll_entry@12
-      dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
       case $host_os in
       mingw*)
        # mingw values
        dll_entry=_DllMainCRTStartup@12
-       dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
        ;;
       esac
 
-      # mingw and cygwin differ, and it's simplest to just exclude the union
-      # of the two symbol sets.
       dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
 
       # recent cygwin and mingw systems supply a stub DllMain which the user
index 89ee68fe52828dd4832320b09209e634644dd583..4cd78958b2ca0367bc390d01b2bb63c07fbe6d70 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -1635,7 +1635,30 @@ EOF
     *) linkmode=prog ;; # Anything else should be a program.
     esac
 
-    specialdeplibs=
+    case $host in
+    *cygwin*)
+      # This is a hack, but we run into problems on cygwin.
+      # libgcc.a depends on libcygwin, but gcc puts -lgcc onto
+      # the link line twice: once before the "normal" libs
+      # (-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32) and
+      # once AFTER those.  However, the "eliminate dup deps"
+      # proceedure keeps only the LAST duplicate -- thus
+      # messing up the order, since after dup elimination
+      # -lgcc comes AFTER -lcygwin.  In normal C operation,
+      # you don't notice the problem, because -lgcc isn't
+      # really used.  However, now that C++ libraries are
+      # libtool-able, you DO see the problem.  So, it must
+      # be fixed.  We could always force "--preserve-dup-deps"
+      # but that could lead to other problems.  So, on cygwin,
+      # always preserve dups of -lgcc...but only -lgcc. That
+      # way, the dependency order won't get corrupted.
+      specialdeplibs="-lgcc"
+      ;;
+    *)
+      specialdeplibs=
+      ;;
+    esac
+
     libs=
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
@@ -4052,7 +4075,9 @@ static const void *lt_preloaded_setup() {
        esac
        # test for cygwin because mv fails w/o .exe extensions
        case $host in
-         *cygwin*) exeext=.exe ;;
+         *cygwin*)
+           exeext=.exe
+           outputname=`echo $outputname|${SED} 's,.exe$,,'` ;;
          *) exeext= ;;
        esac
        $rm $output
@@ -4786,6 +4811,19 @@ relink_command=\"$relink_command\""
          destfile="$destdir/$destfile"
        fi
 
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             file=`echo $file|${SED} 's,.exe$,,'`
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
        # Do a test to see if this is really a libtool program.
        case $host in
        *cygwin*|*mingw*)
@@ -4847,7 +4885,7 @@ relink_command=\"$relink_command\""
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
                continue
              fi
-             file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+             file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
              outputname="$tmpdir/$file"
              # Replace the output file specification.
              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
@@ -4865,7 +4903,7 @@ relink_command=\"$relink_command\""
            fi
          else
            # Install the binary that we compiled earlier.
-           file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+           file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
          fi
        fi
 
index e89982ba18a5059b0722d69daaf4e66fe683fdb1..fe8866e3eb153f52b11c299a8156f221ed1be8f4 100644 (file)
@@ -21,7 +21,7 @@ libsub_la_LDFLAGS = -no-undefined
 
 noinst_HEADERS = foo.h
 
-bin_PROGRAMS = mdemo mdemo.static
+bin_PROGRAMS = mdemo mdemo_static
 
 ## use @LIBLTDL@ because some broken makes do not accept macros in targets
 ## we can only do this because our LIBLTDL does not contain ${top_builddir}
index 00427703efa17c71be888d56dd9456a4cb7a24e3..ce4872341283198ac241ef08747d2b6bf5a3d4f7 100755 (executable)
@@ -105,8 +105,8 @@ if test "x$hardcode_action" = xrelink; then
 fi
 
 if test "$shlibpath_overrides_runpath" != yes; then
-  rm -f $objdir/lt-hell || exit 1
-  cp $objdir/hell $objdir/lt-hell || exit 1
+  rm -f $objdir/lt-hell$EXEEXT || exit 1
+  cp $objdir/hell$EXEEXT $objdir/lt-hell$EXEEXT || exit 1
   echo "running ../demo/hell with installed libhello.la"
   if ./hell; then
     echo "Worked, as expected"
@@ -114,7 +114,7 @@ if test "$shlibpath_overrides_runpath" != yes; then
     echo "shlibpath_overrides_runpath should be set to yes"
     status=1
   fi
-  rm -f $objdir/lt-hell
+  rm -f $objdir/lt-hell$EXEEXT
 fi
 
 exit $status
index 0980d5a6dd5f5cb04063d6f92f887c567ba786f8..6e43ee502eb4ead8809ae3a86fd60a6158a1cb55 100755 (executable)
@@ -20,9 +20,9 @@ fi
 echo "Executing uninstalled programs in ../demo"
 
 status=0
-if ../demo/hell.static| grep 'Welcome to GNU Hell'; then :
+if ../demo/hell_static| grep 'Welcome to GNU Hell'; then :
 else
-  echo "$0: cannot execute ../demo/hell.static" 1>&2
+  echo "$0: cannot execute ../demo/hell_static" 1>&2
   status=1
 fi
 
index da47fc5d153c6365c4c8952aecf48701230ac663..bd416bc9e653f8b7af5e954612120e0df44c4cd7 100755 (executable)
@@ -25,9 +25,9 @@ $make install || exit 1
 
 echo "= Executing installed programs"
 status=0
-if $prefix/bin/hell.static | grep 'Welcome to GNU Hell'; then :
+if $prefix/bin/hell_static | grep 'Welcome to GNU Hell'; then :
 else
-  echo "$0: cannot execute $prefix/bin/hell.static" 1>&2
+  echo "$0: cannot execute $prefix/bin/hell_static" 1>&2
   status=1
 fi
 
index 16bc4c15232169cc56e474c22b0955819f8314ab..dabc06e511439103259a1445328411e2fdec6fcf 100755 (executable)
@@ -20,9 +20,9 @@ fi
 echo "Executing uninstalled programs in ../depdemo"
 
 status=0
-if ../depdemo/depdemo.static; then :
+if ../depdemo/depdemo_static; then :
 else
-  echo "$0: cannot execute ../depdemo/depdemo.static" 1>&2
+  echo "$0: cannot execute ../depdemo/depdemo_static" 1>&2
   status=1
 fi
 
index 2c666deeac5c93028e1d054af75f78f1419afeba..7a379cfa8caea4bf6ad3d150066ab776f32b45c1 100755 (executable)
@@ -26,9 +26,9 @@ $make install || exit 1
 echo "= Executing installed programs"
 
 status=0
-if $prefix/bin/depdemo.static; then :
+if $prefix/bin/depdemo_static; then :
 else
-  echo "$0: cannot execute $prefix/bin/depdemo.static" 1>&2
+  echo "$0: cannot execute $prefix/bin/depdemo_static" 1>&2
   status=1
 fi
 
index c1830fd715a46660820fa6a3e187229eb25a9464..26950102020e461ae943e7a9aefe9b94c1d5d79a 100755 (executable)
@@ -66,12 +66,12 @@ $make foo1.la libfoo2.la || exit 1
 
 echo "= Making programs in ../mdemo (dry run)"
 ls -l . $objdir > $before
-force_dry_run=yes $make mdemo$EXEEXT mdemo.static 1>&2 || exit $?
+force_dry_run=yes $make mdemo$EXEEXT mdemo_static$EXEEXT 1>&2 || exit $?
 ls -l . $objdir > $after
 cmp $before $after > /dev/null || exit 1
 # Now really make them
 echo "= Making programs in ../mdemo"
-$make mdemo$EXEEXT mdemo.static || exit 1
+$make mdemo$EXEEXT mdemo_static$EXEEXT || exit 1
 
 echo "= Running $make install in ../mdemo (dry run)"
 # Libtool does not create these directories
@@ -89,7 +89,7 @@ $make install || exit 1
 
 echo "= Running $make uninstall in ../mdemo (dry run)"
 # Libtool does not uninstall the programs, remove them first
-rm -f $prefix/bin/mdemo$EXEEXT $prefix/bin/mdemo.static
+rm -f $prefix/bin/mdemo$EXEEXT $prefix/bin/mdemo_static$EXEEXT
 ls -l . $objdir > $before
 ls -lR $prefix >> $before
 force_dry_run=yes $make uninstall 1>&2 || exit $?
index 25fc7d837d19e2e46b4dce1b3954aa7e8d1cb60b..c0969b549d662ede9b719b464469eabf401521c8 100755 (executable)
@@ -20,9 +20,9 @@ fi
 echo "Executing uninstalled programs in ../mdemo"
 
 status=0
-if ../mdemo/mdemo.static ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
+if ../mdemo/mdemo_static ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
 else
-  echo "$0: execution of ../mdemo/mdemo.static failed" 1>&2
+  echo "$0: execution of ../mdemo/mdemo_static failed" 1>&2
   status=1
 fi
 
index d0a748ab9d0e9889b6121eee5d3a65cfe170665c..d7f944d890bb61c610dc63f779c43a11cfb6fafb 100755 (executable)
@@ -26,9 +26,9 @@ $make install || exit 1
 echo "= Executing installed programs"
 
 status=0
-if $prefix/bin/mdemo.static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
+if $prefix/bin/mdemo_static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
 else
-  echo "$0: cannot execute $prefix/bin/mdemo.static" 1>&2
+  echo "$0: cannot execute $prefix/bin/mdemo_static" 1>&2
   status=1
 fi
 
index bf20848f30fdfb207f67d1de471c4114bde81af6..edf3c3fb935380d0edc511175eed93bf6a1955cb 100755 (executable)
@@ -22,14 +22,14 @@ fi
 cd ../demo || exit 77
 
 echo "removing libhello.la and hell from ../demo"
-rm -f libhello.la hell
+rm -f libhello.la hell$EXEEXT
 
 echo "linking hell with a broken ../demo/libhello.la"
-if $make hell libhello_la_OBJECTS=hello.lo; then
+if $make hell$EXEEXT libhello_la_OBJECTS=hello.lo; then
   echo "= Succeeded: this means the installed library was used, which is wrong"
   status=1
 fi
 
-rm -f libhello.la hell
+rm -f libhello.la hell$EXEEXT
 
 exit $status