libtool-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Libtool branch, master, updated. v2.2.10-46-gc20dbb8


From: Peter Rosin
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.10-46-gc20dbb8
Date: Thu, 01 Jul 2010 09:07:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  c20dbb8781f88b1ae6e6659359229db64bc052e0 (commit)
       via  1ac3ced59db72099c6049e05b3643042fd5a9ea4 (commit)
      from  57a4a21e9c6b0d83fb947121d0bb55799cb569cd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c20dbb8781f88b1ae6e6659359229db64bc052e0
Author: Peter Rosin <address@hidden>
Date:   Mon Jun 28 09:31:11 2010 +0200

    For MSVC, embed the manifest as a resource in the executable.
    
    Fixes a lot of testsuite failures with MSVC 2003 (v8.0) and
    above (and perhaps also MSVC .Net) related to running programs
    that have been moved (e.g. installed) without their manifests
    also having been moved.
    
    * libltdl/m4/libtool.m4 (_LT_PATH_MANIFEST_TOOL): New macro
    that locates the Manifest Tool (mt) and verifies that it is
    indeed the manifest tool. The result is stored in the new
    variable MANIFEST_TOOL.
    (_LT_LINKER_SHLIBS) <postlink_cmds>: New tag variable.
    [ cygwin, mingw, cegcc ] <cl*>: Embed the manifest file as a
    resource. Make sure the embedding work regardless of if the
    @OUTPUT@ file name includes a trailing $EXEEXT.
    (_LT_LANG_CXX_CONFIG): Likewise.
    (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Require the above
    _LT_PATH_MANIFEST_TOOL.
    * libltdl/config/ltmain.m4sh (func_mode_link): After linking
    a program, replace @OUTPUT@ in $postlink_cmds and then execute
    the commands.
    * doc/libtool.texi (libtool script contents): Document
    new postlink_cmds variable.
    (LT_INIT): Add that the MANIFEST_TOOL environment variable can
    be used to override the manifest tool to use.
    * tests/exeext.at: New. Make sure linking with both -o prog
    and -o prog$EXEEXT works.
    * Makefile.am (TESTSUITE_AT): Update.
    (TESTS_ENVIRONMENT): Propagate $(MANIFEST_TOOL) to the
    testsuite.
    * NEWS: Add note of the new MANIFEST_TOOL environment variable.

commit 1ac3ced59db72099c6049e05b3643042fd5a9ea4
Author: Peter Rosin <address@hidden>
Date:   Thu Jun 24 07:28:16 2010 +0200

    Add MSVC support.
    
    * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
    (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [mingw, cygwin]: Add
    support for the Microsoft C/C++ Compiler (cl) relying on help
    from the compile script in Automake.
    * NEWS: Add note of the above.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                        |   41 +++++++
 Makefile.am                      |    2 +
 NEWS                             |    6 +
 doc/libtool.texi                 |   14 +++
 libltdl/config/ltmain.m4sh       |   16 +++
 libltdl/m4/libtool.m4            |  230 ++++++++++++++++++++++++++++++-------
 tests/{pic_flag.at => exeext.at} |   50 +++++----
 7 files changed, 291 insertions(+), 68 deletions(-)
 copy tests/{pic_flag.at => exeext.at} (51%)

diff --git a/ChangeLog b/ChangeLog
index 0bce799..9dab360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2010-06-28  Peter Rosin  <address@hidden>
+
+       For MSVC, embed the manifest as a resource in the executable.
+       Fixes a lot of testsuite failures with MSVC 2003 (v8.0) and
+       above (and perhaps also MSVC .Net) related to running programs
+       that have been moved (e.g. installed) without their manifests
+       also having been moved.
+       * libltdl/m4/libtool.m4 (_LT_PATH_MANIFEST_TOOL): New macro
+       that locates the Manifest Tool (mt) and verifies that it is
+       indeed the manifest tool. The result is stored in the new
+       variable MANIFEST_TOOL.
+       (_LT_LINKER_SHLIBS) <postlink_cmds>: New tag variable.
+       [ cygwin, mingw, cegcc ] <cl*>: Embed the manifest file as a
+       resource. Make sure the embedding work regardless of if the
+       @OUTPUT@ file name includes a trailing $EXEEXT.
+       (_LT_LANG_CXX_CONFIG): Likewise.
+       (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG): Require the above
+       _LT_PATH_MANIFEST_TOOL.
+       * libltdl/config/ltmain.m4sh (func_mode_link): After linking
+       a program, replace @OUTPUT@ in $postlink_cmds and then execute
+       the commands.
+       * doc/libtool.texi (libtool script contents): Document
+       new postlink_cmds variable.
+       (LT_INIT): Add that the MANIFEST_TOOL environment variable can
+       be used to override the manifest tool to use.
+       * tests/exeext.at: New. Make sure linking with both -o prog
+       and -o prog$EXEEXT works.
+       * Makefile.am (TESTSUITE_AT): Update.
+       (TESTS_ENVIRONMENT): Propagate $(MANIFEST_TOOL) to the
+       testsuite.
+       * NEWS: Add note of the new MANIFEST_TOOL environment variable.
+
+2010-06-24  Peter Rosin  <address@hidden>
+
+       Add MSVC support.
+       * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER)
+       (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG) [mingw, cygwin]: Add
+       support for the Microsoft C/C++ Compiler (cl) relying on help
+       from the compile script in Automake.
+       * NEWS: Add note of the above.
+
 2010-07-01  Gary V. Vaughan  <address@hidden>
 
        Skip `enhanced shell option appending' test when not available.
diff --git a/Makefile.am b/Makefile.am
index 320a2a3..ef3c984 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -472,6 +472,7 @@ TESTSUITE_AT        = tests/testsuite.at \
                  tests/search-path.at \
                  tests/indirect_deps.at \
                  tests/archive-in-archive.at \
+                 tests/exeext.at \
                  tests/execute-mode.at \
                  tests/bindir.at \
                  tests/cwrapper.at \
@@ -521,6 +522,7 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" 
CFLAGS="$(CFLAGS)" \
        CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
        LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
        M4SH="$(M4SH)" SED="$(SED)" STRIP="$(STRIP)" lt_INSTALL="$(INSTALL)" \
+       MANIFEST_TOOL="$(MANIFEST_TOOL)" \
        OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
        SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
        CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
diff --git a/NEWS b/NEWS
index 33531dc..95fa97d 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,12 @@ New in 2.2.12 2010-08-??: git version 2.2.11a, Libtool team:
   - On non-cygwin Windows systems, we now lookup potential library
     file names without regard to file name case.
 
+* Changes in supported systems or compilers:
+  - Initial support for the Microsoft C/C++ Compiler, with help from
+    the compile script in unreleased Automake 1.12. Override the manifest
+    tool used to embed the manifest resource through the environment
+    variable MANIFEST_TOOL.
+
 New in 2.2.10 2010-06-10: git version 2.2.9a, Libtool team:
 
 * New features:
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 7ae2c66..af6e13d 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -2306,6 +2306,11 @@ Program to use rather than checking for @command{as}.  
Only used on
 Cygwin/MS-Windows at the moment.
 @end defvar
 
address@hidden MANIFEST_TOOL
+Program to use rather than checking for @command{mt}, the Manifest Tool.
+Only used on Cygwin/MS-Windows at the moment.
address@hidden defvar
+
 With 1.3 era libtool, if you wanted to know any details of what
 libtool had discovered about your architecture and environment, you
 had to run the script with @option{--config} and grep through the
@@ -6199,6 +6204,15 @@ Commands run after installing a shared or static 
library, respectively.
 Commands run after uninstalling a shared or static library, respectively.
 @end defvar
 
address@hidden postlink_cmds
+Commands necessary for finishing linking programs. @code{postlink_cmds}
+are executed immediately after the program is linked. Any occurance of
+the string @code{@@OUTPUT@@} in @code{postlink_cmds} is replaced by the
+name of the created executable (i.e. not the wrapper, if a wrapper is
+generated) prior to execution. Normally disabled (i.e.
address@hidden empty).
address@hidden defvar
+
 @defvar reload_cmds
 @defvarx reload_flag
 Commands to create a reloadable object.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index fc2358e..760b6aa 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -7423,6 +7423,11 @@ EOF
        exit_status=0
        func_show_eval "$link_command" 'exit_status=$?'
 
+       if test -n "$postlink_cmds"; then
+         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 
'address@hidden@%'"$output"'%g'`
+         func_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
        # Delete the generated files.
        if test -f "$output_objdir/${outputname}S.${objext}"; then
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
@@ -7468,6 +7473,12 @@ EOF
        $opt_dry_run || $RM $output
        # Link the executable and exit
        func_show_eval "$link_command" 'exit $?'
+
+       if test -n "$postlink_cmds"; then
+         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 
'address@hidden@%'"$output"'%g'`
+         func_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
        exit $EXIT_SUCCESS
       fi
 
@@ -7501,6 +7512,11 @@ EOF
 
       func_show_eval "$link_command" 'exit $?'
 
+      if test -n "$postlink_cmds"; then
+       postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 
'address@hidden@%'"$output_objdir/$outputname"'%g'`
+       func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
       # Now create the wrapper script.
       func_verbose "creating $output"
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index f3ebc87..89785c1 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2198,8 +2198,9 @@ cygwin* | mingw* | pw32* | cegcc*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
@@ -2232,13 +2233,42 @@ m4_if([$1], [],[
       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo 
${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 
's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}`echo ${release} | $SED -e 
's/[[.]]/-/g'`${versuffix}.lib'
+    sys_lib_search_path_spec="$LIB"
+    if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; 
then
+      # It is most probably a Windows format PATH.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 
's/;/ /g'`
+    else
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 
"s/$PATH_SEPARATOR/ /g"`
+    fi
+    # FIXME: find the short name or the path components, as spaces are
+    # common. (e.g. "Program Files" -> "PROGRA~1")
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo 
\$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
     ;;
 
   *)
+    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 
's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
     ;;
   esac
-  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -3290,6 +3320,28 @@ dnl AC_DEFUN([AM_PROG_NM], [])
 dnl AC_DEFUN([AC_PROG_NM], [])
 
 
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], 
[lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
 # LT_LIB_M
 # --------
 # check for math library
@@ -4226,6 +4278,7 @@ _LT_TAGDECL([link_static_flag], 
[lt_prog_compiler_static], [1],
 m4_defun([_LT_LINKER_SHLIBS],
 [AC_REQUIRE([LT_PATH_LD])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -4248,13 +4301,18 @@ m4_if([$1], [CXX], [
     ;;
   pw32*)
     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
+    ;;
   cygwin* | mingw* | cegcc*)
-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ 
]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    case $cc_basename in
+    cl*) ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ 
]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      ;;
+    esac
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
+    ;;
   esac
   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
 ], [
@@ -4794,20 +4852,60 @@ _LT_EOF
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags 
`func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=yes
+       _LT_TAGVAR(file_list_spec, $1)='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs 
$compiler_flags $deplibs -Wl,-dll~linknames='
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q 
$export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e 
'1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+         else
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < 
$export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs 
@$output_objdir/$soname.exp -Wl,-DLL~
+         linknames='
+       # The linker will not automatically build a static lib if we build a 
DLL.
+       # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ 
]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq 
> $export_symbols'
+       # Don't use ranlib
+       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+         case $lt_outputfile in
+           *.exe | *.EXE) ;;
+           *) lt_outputfile="$lt_outputfile.exe" ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; 
then
+           $MANIFEST_TOOL -manifest "$lt_outputfile.manifest" 
-outputresource:"$lt_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags 
`func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       # FIXME: Should let the user specify the lib program.
+       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       ;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -5342,6 +5440,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
     [Symbols that must always be exported])
 _LT_TAGDECL([], [prelink_cmds], [2],
     [Commands necessary for linking programs (against libraries) with 
templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
 _LT_TAGDECL([], [file_list_spec], [1],
     [Specify filename containing input files])
 dnl FIXME: Not yet implemented
@@ -5443,6 +5543,7 @@ CC="$lt_save_CC"
 m4_defun([_LT_LANG_CXX_CONFIG],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
     (test "X$CXX" != "Xg++"))) ; then
@@ -5738,29 +5839,70 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       cygwin* | mingw* | pw32* | cegcc*)
-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-        # as there is no search path for DLLs.
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-        _LT_TAGVAR(always_export_symbols, $1)=no
-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects 
$libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname 
${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-          # If the export-symbols file already is a .def file (1st line
-          # is EXPORTS), use it as is; otherwise, prepend...
-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q 
$export_symbols`" = xEXPORTS; then
-           cp $export_symbols $output_objdir/$soname.def;
-          else
-           echo EXPORTS > $output_objdir/$soname.def;
-           cat $export_symbols >> $output_objdir/$soname.def;
-          fi~
-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects 
$libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname 
${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-        else
-          _LT_TAGVAR(ld_shlibs, $1)=no
-        fi
-        ;;
+       case $GXX,$cc_basename in
+       ,cl* | no,cl*)
+         # Native MSVC
+         # hardcode_libdir_flag_spec is actually meaningless, as there is
+         # no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=yes
+         _LT_TAGVAR(file_list_spec, $1)='@'
+         # Tell ltmain to make .lib files, not .a files.
+         libext=lib
+         # Tell ltmain to make .dll files, not .so files.
+         shrext_cmds=".dll"
+         # FIXME: Setting linknames here is a bad hack.
+         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs 
$compiler_flags $deplibs -Wl,-dll~linknames='
+         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q 
$export_symbols`" = xEXPORTS; then
+             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e 
'1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+           else
+             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < 
$export_symbols > $output_objdir/$soname.exp;
+           fi~
+           $CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs 
@$output_objdir/$soname.exp -Wl,-DLL~
+           linknames='
+         # The linker will not automatically build a static lib if we build a 
DLL.
+         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+         # Don't use ranlib
+         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+           case $lt_outputfile in
+             *.exe *.EXE) ;;
+             *) lt_outputfile="$lt_outputfile.exe" ;;
+           esac~
+           if test "$MANIFEST_TOOL" != ":" && test -f 
"$lt_outputfile.manifest"; then
+             $MANIFEST_TOOL -manifest "$lt_outputfile.manifest" 
-outputresource:"$lt_outputfile" || exit 1;
+             $RM "$lt_outputfile.manifest";
+           fi'
+         ;;
+       *)
+         # g++
+         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+         # as there is no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=no
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects 
$libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname 
${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+           # If the export-symbols file already is a .def file (1st line
+           # is EXPORTS), use it as is; otherwise, prepend...
+           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q 
$export_symbols`" = xEXPORTS; then
+             cp $export_symbols $output_objdir/$soname.def;
+           else
+             echo EXPORTS > $output_objdir/$soname.def;
+             cat $export_symbols >> $output_objdir/$soname.def;
+           fi~
+           $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects 
$libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname 
${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+         ;;
+       esac
+       ;;
       darwin* | rhapsody*)
         _LT_DARWIN_LINKER_FEATURES($1)
        ;;
diff --git a/tests/pic_flag.at b/tests/exeext.at
similarity index 51%
copy from tests/pic_flag.at
copy to tests/exeext.at
index a729d16..ee5d755 100644
--- a/tests/pic_flag.at
+++ b/tests/exeext.at
@@ -1,6 +1,7 @@
-# pic_flag.at -- override the pic_flag at configure time   -*- Autotest -*-
-
+# exeext.at -- ensure that exeext handling works  -*- Autotest -*-
+#
 #   Copyright (C) 2010 Free Software Foundation, Inc.
+#   Written by Peter Rosin
 #
 #   This file is part of GNU Libtool.
 #
@@ -21,31 +22,32 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ####
 
-AT_SETUP([override pic_flag at configure time])
 
-# Just try to configure the Libtool package with -fpic if we can compile
-# with it, for C and C++.
+AT_SETUP([both of -o prog and -o prog$EXEEXT work])
+AT_KEYWORDS([libtool])
+
+AT_CHECK([test -n "$EXEEXT" || exit 77])
+
+bin=`pwd`/bin
+binext=`pwd`/binext
+mkdir src $bin srcext $binext
 
-AT_DATA([foo.c],
-[[int data = 42;
-int func(void) { return data; }
+AT_DATA(src/prog.c,
+[[
+int main(void) { return 0; }
 ]])
 
-cp foo.c foo.cpp
-C_pic_flag='-fpic -DPIC'
-AT_CHECK([$CC $CPPFLAGS $CFLAGS $C_pic_flag -c foo.c || exit 77],
-        [], [ignore], [ignore])
-
-CXX_pic_flag='-fpic -DPIC'
-if $CXX $CPPFLAGS $CXXFLAGS $CXX_pic_flag -c foo.cpp; then :; else
-  CXX_pic_flag=
-fi
-
-AT_CHECK(["$abs_top_srcdir"/configure lt_cv_prog_compiler_pic="$C_pic_flag" 
]dnl
-        [lt_cv_prog_compiler_pic_CXX="$CXX_pic_flag"], [], [ignore], [ignore])
-: ${MAKE=make}
-AT_CHECK([$MAKE], [], [stdout], [ignore])
-AT_CHECK([if ./libtool --features | grep 'enable shared libraries'; then ]dnl
-        [  grep -e -fpic stdout; else exit 77; fi], [], [ignore], [ignore])
+$CC $CPPFLAGS $CFLAGS -c src/prog.c -o src/prog.$OBJEXT
+
+AT_CHECK($LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o src/prog 
src/prog.$OBJEXT,
+        [0], [ignore], [ignore])
+AT_CHECK($LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o srcext/prog$EXEEXT 
src/prog.$OBJEXT,
+        [0], [ignore], [ignore])
+
+$LIBTOOL --mode=install cp src/prog $bin/prog
+$LIBTOOL --mode=install cp srcext/prog$EXEEXT $binext/prog$EXEEXT
+
+LT_AT_EXEC_CHECK([$bin/prog])
+LT_AT_EXEC_CHECK([$binext/prog$EXEEXT])
 
 AT_CLEANUP


hooks/post-receive
-- 
GNU Libtool



reply via email to

[Prev in Thread] Current Thread [Next in Thread]