]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in, ltcf-c.sh, ltcf-gcj.sh: Generate dll/import
authorEdward M. Lee <tailbert@yahoo.com>
Sat, 31 Mar 2001 11:05:10 +0000 (11:05 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sat, 31 Mar 2001 11:05:10 +0000 (11:05 +0000)
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.

ChangeLog
ltcf-c.sh
ltcf-gcj.sh
ltconfig.in
ltmain.in

index 99708362291ea535b9ac7d7df8df40a3a98f769f..91e90c7287ffebea024b3686624b0c5f9dcc7f4e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,14 @@
        * libtoolize.in: change recommendation from AM_PROG_LIBTOOL to
        AC_PROG_LIBTOOL.
 
+       * ltconfig.in, ltcf-c.sh, ltcf-gcj.sh: 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-22  Laurynas Biveinis  <lauras@softhome.net>
 
        * ltcf-c.sh: Clear ac_cv_prog_cc_pic for DJGPP.  Do not add
index fda1d8b60c25be457409124c603824afdf0b9a7e..9e3a65950eaa72ff8c82e0c6be77df6767d3dab8 100644 (file)
--- a/ltcf-c.sh
+++ b/ltcf-c.sh
@@ -108,7 +108,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/$soroot > $output_objdir/$soname-def'
 
     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
 
@@ -166,11 +166,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'
     ;;
 
   darwin*|rhapsody*)
index e771276e276fcaa1816b05513c05e4bae20b3dfd..fb407ad3705f40d6d124047fd74f85511d37b716 100644 (file)
@@ -111,7 +111,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/$soroot > $output_objdir/$soname-def'
 
     old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
 
@@ -169,11 +169,11 @@ EOF
         done;
       fi~
       '"$ltdll_cmds"'
-      $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_gcj_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_gcj_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_gcj_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*)
index 8100e579a801b7b2efaf385e88ea49ae86046a8e..fd68f22b846987ec34ce1429c1e26bb7f3d4060a 100755 (executable)
@@ -1068,7 +1068,14 @@ cygwin* | mingw* | pw32*)
   need_lib_prefix=no
   case $with_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'
@@ -2615,7 +2622,7 @@ EOF
 #      filename = argv[1];
 #
 #      dll = open(filename, O_RDONLY|O_BINARY);
-#      if (!dll)
+#      if (dll < 1)
 #      return 1;
 #
 #      dll_name = filename;
index a8c744151f384d2a41863d818b5a592816a51467..78c55aaedaebaeb0a2f7e60b38959e34b0610637 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2081,13 +2081,25 @@ EOF
            realname="$2"
            shift; shift
            libname=`eval \\$echo \"$libname_spec\"`
-           if test -n "$soname_spec"; then
+           # 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
@@ -3025,6 +3037,9 @@ EOF
        else
          soname="$realname"
        fi
+       if test x$dlname = x; then
+         dlname=$soname
+       fi
 
        lib="$output_objdir/$realname"
        for link
@@ -3434,6 +3449,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
@@ -3877,6 +3895,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
 
@@ -3955,7 +3978,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\" || \\
@@ -4263,6 +4286,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
@@ -4271,7 +4299,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'
@@ -4695,6 +4723,25 @@ 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"