From: Gary V. Vaughan Date: Thu, 24 Dec 1998 13:40:47 +0000 (+0000) Subject: make wrapper scripts work on win32 X-Git-Tag: automake_1-4~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa787ea3d333315482c8d2abf46fcb6ad83cd996;p=thirdparty%2Flibtool.git make wrapper scripts work on win32 --- diff --git a/ChangeLog b/ChangeLog index fb63aa083..a36059d96 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +1998-12-24 Gary V. Vaughan + + * 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 * ltmain.in (SP2NL, NL2SP): use `tr' magic to avoid passing very diff --git a/TODO b/TODO index f14371e61..5fe4813fd 100644 --- 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 diff --git a/libltdl/configure.in b/libltdl/configure.in index 9409128a0..71444e1a3 100644 --- a/libltdl/configure.in +++ b/libltdl/configure.in @@ -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 diff --git a/ltmain.in b/ltmain.in index d0537707e..685a8ae23 100644 --- 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