]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
make wrapper scripts work on win32
authorGary V. Vaughan <gary@gnu.org>
Thu, 24 Dec 1998 13:40:47 +0000 (13:40 +0000)
committerGary V. Vaughan <gary@gnu.org>
Thu, 24 Dec 1998 13:40:47 +0000 (13:40 +0000)
ChangeLog
TODO
libltdl/configure.in
ltmain.in

index fb63aa083f69978ef76b0803ffbee9c1c8e80d19..a36059d967de5043188c5abe5f0a070291ec424b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+1998-12-24  Gary V. Vaughan  <gvaughan@oranda.demon.co.uk>
+
+       * libltdl/configure.in: fixup spacing in --enable-ltdl-install
+       help string so that it lines up nicely for configure --help.
+
+       * ltmain.in (dllsearchpath): keep track of what the dll search path
+       will need to be in the wrapper scripts as deplibs are calculated.
+       Make sure the wrapper script doesn't end in `.exr', which makes
+       win32 try to execute it as a binary!
+       Add the contents of dllsearchpath to $PATH in the wrapper script.
+       Use the relative path to the wrapped program so that the dll
+       search path is calculated properly by win32 OSes.
+       * TODO: removed the item for making wrapper scripts work on win32.
+
+       * TODO: removed the reference to making libltdl and demo work on
+       win32.  They *do* work now that wrapper scripts are functioning.
+       
 1998-12-23  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * ltmain.in (SP2NL, NL2SP): use `tr' magic to avoid passing very
diff --git a/TODO b/TODO
index f14371e61716998bc63b634ece6699c1950ddb57..5fe4813fdcff693ce021b9eee0e1da09482effb1 100644 (file)
--- a/TODO
+++ b/TODO
@@ -48,13 +48,9 @@ char'.  Find a workaround.
 In the future:
 **************
 
-* Fix libltdl, demo, mdemo and depdemo (in that order) on win32.
+* Fix mdemo and depdemo on win32.
 This may require resolving some of the items below.
 
-* Make the executable wrapper scripts work on win32.
-They will need to make sure all of the dll (particularly deplibs) paths are in
-$PATH, and probably cd into the .libs subdirectory.
-
 * Figure out how to use data items in dlls with win32.
 The difficult part is compiling each object which will be linked with an
 import lib differently than if it will be linked with a static lib.  This will
index 9409128a08d4c61cd35c0e91feadb392cd1bc138..71444e1a3e5baeb2a517d408a3f8f3009592242b 100644 (file)
@@ -4,7 +4,7 @@ AC_INIT(ltdl.c)
 AM_INIT_AUTOMAKE(libltdl,1.0)
 
 AC_ARG_ENABLE(ltdl-install,
-  [--enable-ltdl-install    install libltdl (breaks check before install)])
+  [  --enable-ltdl-install   install libltdl (breaks check before install)])
 AM_CONDITIONAL(INSTALL_LTDL, test x$enable_ltdl_install = xyes)
 if test x$enable_ltdl_install = xyes; then
   LIBLIBS=libltdl.la
index d0537707edc6dd7d62751eeba91c830027f9872e..685a8ae231a291b617f5c8197bcb83af520de3cc 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -966,6 +966,11 @@ compiler."
              case "$host" in
              *-*-cygwin32* | *-*-mingw32* | *-*-os2*)
                compile_dependencylibs="$compile_dependencylibs -L$dir -l$name"
+               if test -n "$dllsearchpath"; then
+                 dllsearchpath="$dllsearchpath:$dir"
+               else
+                 dllsearchpath="$dir"
+               fi
                ;;
              esac
            elif test "$hardcode_minus_L" = no; then
@@ -2015,6 +2020,11 @@ dld_preloaded_symbols[] =
 
       # Only actually do things if our run command is non-null.
       if test -z "$run"; then
+        # win32 will think the script is a binary if it has
+       # a .exe suffix, so we strip it off here.
+        case $output in
+         *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+       esac
        $rm $output
        trap "$rm $output; exit 1" 1 2 15
 
@@ -2107,16 +2117,37 @@ else
 "
        fi
 
+       # fixup the dll searchpath if we need to.
+       if test -n "$dllsearchpath"; then
+         $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+       fi
+
        $echo >> $output "\
     if test \"\$libtool_execute_magic\" != \"$magic\"; then
       # Run the actual program with our arguments.
-
+"
+       case $host in
+       *-*-cygwin32* | *-*-mingw32 | *-*-os2*)
+         # win32 systems need to use the prog path for dll
+         # lookup to work
+         $echo >> $output "\
+      exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+         ;;
+       *)
+         $echo >> $output "\
       # Export the path to the program.
       PATH=\"\$progdir:\$PATH\"
       export PATH
 
       exec \$program \${1+\"\$@\"}
-
+"
+         ;;
+       esac
+       $echo >> $output "\
       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
       exit 1
     fi