* libtool.m4: Generate dll/import libraries for cygwin according

to the following: libFOO.a (static lib), libFOO.dll.a (import
lib), cygFOO-version.dll (dll).  Update postinstall_cmds and
postuninstall_cmds to reflect this.
* ltmain.in: Generate installed .la files with dlnames set to
../bin/cygFOO-version.dll for normal dlls. dlls for modules
remain with the .la file.
This commit is contained in:
Edward M. Lee 2001-03-31 00:08:03 +00:00 committed by Gary V. Vaughan
parent ebda76d2bd
commit 8087272484
3 changed files with 72 additions and 11 deletions

View File

@ -6,6 +6,14 @@
* libtoolize.in: change recommendation from AM_PROG_LIBTOOL to
AC_PROG_LIBTOOL.
* libtool.m4: Generate dll/import libraries for cygwin according
to the following: libFOO.a (static lib), libFOO.dll.a (import
lib), cygFOO-version.dll (dll). Update postinstall_cmds and
postuninstall_cmds to reflect this.
* ltmain.in: Generate installed .la files with dlnames set to
../bin/cygFOO-version.dll for normal dlls. dlls for modules
remain with the .la file.
2001-03-16 Albert Chin <china@thewrittenword.com>
* libtool.m4 (save_CPPFLAGS): Fix typo.

22
libtool.m4 vendored
View File

@ -1238,7 +1238,7 @@ EOF
test -f $output_objdir/impgen.exe || (cd $output_objdir && \
if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
else $CC -o impgen impgen.c ; fi)~
$output_objdir/impgen $dir/$soname > $output_objdir/$soname-def'
$output_objdir/impgen $dir/$soroot1 > $output_objdir/$soname-def'
old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
@ -1296,11 +1296,11 @@ EOF
done;
fi~
'"$ltdll_cmds"'
$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
$CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags'
$CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
;;
netbsd*)
@ -1832,7 +1832,15 @@ cygwin* | mingw* | pw32*)
need_lib_prefix=no
case $GCC,$host_os in
yes,cygwin*)
library_names_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
library_names_spec='$libname.dll.a'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog .libs/$dlname \$dldir/$dlname'
postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$rm \$dlpath'
;;
yes,mingw*)
library_names_spec='${libname}`echo ${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
@ -2648,7 +2656,7 @@ EOF
# filename = argv[1];
#
# dll = open(filename, O_RDONLY|O_BINARY);
# if (!dll)
# if (dll < 1)
# return 1;
#
# dll_name = filename;

View File

@ -1778,14 +1778,26 @@ compiler."
set dummy $library_names
realname="$2"
shift; shift
libname=`eval \\$echo \"$libname_spec\"`
if test -n "$soname_spec"; then
libname=`eval \\$echo \"$libname_spec\"`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname="$dlname"
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin*)
major=`expr $current - $age`
versuffix="-$major"
;;
esac
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
soname=`echo $soroot | sed -e 's/^.*\///'`
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
@ -2706,6 +2718,9 @@ EOF
else
soname="$realname"
fi
if test x$dlname = x; then
dlname=$soname
fi
lib="$output_objdir/$realname"
for link
@ -3012,6 +3027,9 @@ EOF
;;
prog)
case $host in
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
esac
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
fi
@ -3461,6 +3479,11 @@ static const void *lt_preloaded_setup() {
case $output in
*.exe) output=`echo $output|sed 's,.exe$,,'` ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*) exeext=.exe ;;
*) exeext= ;;
esac
$rm $output
trap "$rm $output; exit 1" 1 2 15
@ -3539,7 +3562,7 @@ else
if test "$fast_install" = yes; then
echo >> $output "\
program=lt-'$outputname'
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\
@ -3815,6 +3838,11 @@ fi\
dlprefiles="$newdlprefiles"
fi
$rm $output
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@ -3823,7 +3851,7 @@ fi\
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$dlname'
dlname='$tdlname'
# Names of this library.
library_names='$library_names'
@ -4247,6 +4275,23 @@ relink_command=\"$relink_command\""
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyways
case $install_prog,$host in
/usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
;;
*.exe:*)
destfile=$destfile.exe
;;
*:*.exe)
destfile=`echo $destfile | sed -e 's,.exe$,,'`
;;
esac
;;
esac
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
test -n "$outputname" && ${rm}r "$tmpdir"