libtool-patches
[Top][All Lists]
Advanced

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

Re: msvs support


From: D. Walsh
Subject: Re: msvs support
Date: Sun, 12 Feb 2006 07:13:39 -0500


On Feb 12, 2006, at 05:17 , Ralf Wildenhues wrote:

[ moving from the libtool list ]

As a test, I tried this patch on Mac OSX, sorry to say it wasn't a happy camper.

I have to agree, some of the proposed manipulations are done too late in the game and should be done in the deplib search.

One concern (with Apple switching to Intel processors) is dual architecture binaries and cross-compilations problems are going to occur if proper care isn't taken to take into account which CPU is used/available and if the environment is set to generate universal binaries.


* /me wrote on Sun, Feb 12, 2006 at 10:21:45AM CET:

Sure, I can try.  The patch needs some cleanup.  I'll reply on
libtool-patches with inline comments about the patch.

I forgot one system that needs testing:
- host=mingw cross-compiled from something else (e.g., GNU/Linux;
  Debian has a pre-packaged cross toolchain, for example).

I didn't get all the way through the patch with my comments,
but about half of the patch should be able to go in without too much
hassle.  The other half needs more work, unfortunately.  I doubt that
that it would be good to put it in before 2.0, but it really should
be possible to get it in soon after.

Cheers,
Ralf

| Index: Makefile.am
| ===================================================================
| RCS file: /cvsroot/libtool/libtool/Makefile.am,v
| retrieving revision 1.174
| diff -u -r1.174 Makefile.am
| --- Makefile.am       26 Oct 2005 14:26:35 -0000      1.174
| +++ Makefile.am       18 Nov 2005 10:57:07 -0000
| @@ -378,6 +378,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)" \
| +     AR="$(AR)" STRIP="$(STRIP)" \
|       OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
|       SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
|       CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \

You can just apply this part as a separate patch.

| Index: libltdl/config/ltmain.m4sh
| ===================================================================
| RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
| retrieving revision 1.18
| diff -u -r1.18 ltmain.m4sh
| --- libltdl/config/ltmain.m4sh        10 Nov 2005 18:32:44 -0000      1.18
| +++ libltdl/config/ltmain.m4sh        18 Nov 2005 10:57:10 -0000
| @@ -703,6 +703,35 @@
|  }
|
|
| +# func_dashL_to_envvar deplibs_variable deplibs...
| +func_dashL_to_envvar ()
| +{
| +  deplibs_variable=$1
| +  shift
| +  tmp_libs=
| +  for deplib; do
| +    case $deplib in
| +    -L*)
| +      env_path=`$ECHO "X${deplib}" | $Xsed -e 's/^-L//'`

You should use func_stripname here.

| +      case $host_os in
| +      mingw*)
| + env_path=`cmd \\\\/C echo "$env_path " | $SED -e 's/"\(.*\) " * $/\1/'`
| +     ;;
| +      cygwin*)
| +     env_path=`cygpath -w "$env_path"`
| +     ;;
| +      esac
| + eval $dashL_envvar="\"\$$dashL_envvar $dashL_envvar_spec $env_path\""
| +      ;;
| +    *)
| +      tmp_libs="$tmp_libs $deplib"
| +      ;;
| +    esac
| +  done
| +  eval $deplibs_variable="\"$tmp_libs\""
| +}
| +
| +
|
|  # func_infer_tag arg
|  # Infer tagged configuration to use if any are available and
| @@ -1014,8 +1043,15 @@
|      $opt_debug
|      f_ex_an_ar_dir="$1"; shift
|      f_ex_an_ar_oldlib="$1"
| - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \ $f_ex_an_ar_oldlib)" || exit $? | - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
| +    if test "X$ar_extract_one_by_one" != "Xyes"; then
| + func_show_eval "(cd \$f_ex_an_ar_dir && $AR ${AR_XFLAGS} $ {AR_EFLAGS}\$f_ex_an_ar_oldlib)" || exit $?
| +    else
| +      $AR ${AR_TFLAGS} "$f_ex_an_ar_oldlib" | while read name
| +      do
| + func_show_eval "(cd \$f_ex_an_ar_dir && $AR ${AR_XFLAGS} $ {AR_EFLAGS}\$name \$f_ex_an_ar_oldlib)" || exit $?
| +      done
| +    fi
| + if ($AR ${AR_TFLAGS} "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
|       :
|      else
| func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
| @@ -1284,6 +1320,14 @@
|      case $host_os in
|      cygwin* | mingw* | pw32* | os2*)
|        pic_mode=default
| +      if test "$with_gcc" != yes; then
| +     # Assume MSVC
| +     if test "$tagname" = CC; then
| +       base_compile="$base_compile -TC"
| +     elif test "$tagname" = CXX; then
| +       base_compile="$base_compile -TP"
| +     fi
| +      fi
|        ;;
|      esac
| if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then

Since there are bound to be other non-gcc compilers on w32, would it not suffice to test (in libtool.m4) for $cc_basename as either `cl' or `cccl'?

You could just add a tagged flag compile_tag or so, make it empty by
default, and ` -TC' or ` -TP' for cl in CC or CXX modes (think about
cccl?).

| @@ -2604,6 +2648,7 @@
|         *-*-os2*)
|           # These systems don't actually have a C library (as such)
|           test "X$arg" = "X-lc" && continue
| + test "X$with_gcc" != "Xyes" && test "X$arg" = "X-lm" && continue
|           ;;
|         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
|           # Do not include libc due to us having libc/libc_r.

This looks wrong: it applies to OS2 only.  I believe you can drop this
as we fixed the corresponding mingw issue meanwhile.

| @@ -4082,6 +4127,17 @@
|             *) tmp_libs="$tmp_libs $deplib" ;;
|             esac
|             ;;
| +         -l*)
| +           if test "X$with_gcc" != Xyes; then
| +             case $host_os/$linkmode in
| +             mingw*/prog | cygwin*/prog)
| +               # assume MSVC
| +               deplib=`$ECHO "X${deplib}.lib" | $Xsed -e 's/^-l//'`

See above (func_stripname).  I still don't like this `lib' special
casing at all.  It should equally apply to GCC.  Also with_gcc != yes
should not imply MSVC.

I also believe this is not the right place to fix this at all.  It
should be done at the start of the deplib search algorithm.  I am
very reluctant to change that part before 2.0.

| +               ;;
| +             esac
| +           fi
| +           tmp_libs="$tmp_libs $deplib"
| +           ;;
|           *) tmp_libs="$tmp_libs $deplib" ;;
|           esac
|         done
| @@ -4669,8 +4725,13 @@
|             fi
|             if test -n "$a_deplib" ; then
|               libname=`eval "\\$ECHO \"$libname_spec\""`
| +             if test -n "$file_magic_glob"; then
| +               libnameglob=`$ECHO "X$libname" | $Xsed -e $file_magic_glob`
| +             else
| +               libnameglob=$libname
| +             fi
| for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
| -               potential_libs=`ls $i/$libname[[.-]]* 2>/dev/null`
| +               potential_libs=`ls $i/$libnameglob[[.-]]* 2>/dev/null`
|                 for potent_lib in $potential_libs; do
|                     # Follow soft links.
|                     if ls -lLd "$potent_lib" 2>/dev/null |
| @@ -4693,7 +4754,14 @@
|                     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
|                        $SED -e 10q |
|                        $EGREP "$file_magic_regex" > /dev/null; then
| -                     newdeplibs="$newdeplibs $a_deplib"
| +                     case $with_gcc/$host in
| +                     no/*-*-mingw* | /*-*-mingw* | no/*-*-cygwin* | 
/*-*-cygwin*)
| +                       newdeplibs="$newdeplibs ${name}.lib"
| +                       ;;
| +                     *)
| +                       newdeplibs="$newdeplibs $a_deplib"
| +                       ;;
| +                     esac
|                       a_deplib=""
|                       break 2
|                     fi

Ditto with this hunk: there should not be a need for special casing here
at all, and testing for non-gcc is wrong again.

| @@ -5256,6 +5324,15 @@
|         libobjs="$libobjs $func_extract_archives_result"
|       fi
|
| +     case $pass/$dashL_envvar in
| +     link/) ;;
| +     link/*)
| +       # Move all -L options to the environment variable
| +       # specified by $dashL_envvar.
| +       func_dashL_to_envvar deplibs $deplibs
| +       ;;
| +     esac
| +
|       save_ifs="$IFS"; IFS='~'
|       for cmd in $cmds; do
|         IFS="$save_ifs"
| @@ -5450,6 +5527,25 @@
|       ;;
|        esac
|
| +      case $pass/$dashL_envvar in
| +      link/) ;;
| +      link/*)
| +     # Move all -L options to the environment variable
| +     # specified by $dashL_envvar.
| +     eval save_dashL_envvar="\"\$$dashL_envvar\""
| +
| +     func_dashL_to_envvar compile_deplibs $compile_deplibs
| +     eval prepend_dashL_envvar="$dashL_envvar=\\\"\$$dashL_envvar\\\""
| +     compile_command="$prepend_dashL_envvar $compile_command"
| +     eval $dashL_envvar="\"$save_dashL_envvar\""
| +
| +     func_dashL_to_envvar finalize_deplibs $finalize_deplibs
| +     eval prepend_dashL_envvar="$dashL_envvar=\\\"\$$dashL_envvar\\\""
| +     finalize_command="$prepend_dashL_envvar $finalize_command"
| +     eval $dashL_envvar="\"$save_dashL_envvar\""
| +     ;;
| +      esac
| +
|        compile_command="$compile_command $compile_deplibs"
|        finalize_command="$finalize_command $finalize_deplibs"
|

| @@ -5738,7 +5834,11 @@
|           cat >> $cwrappersource<<"EOF"
|  #include <stdio.h>
|  #include <stdlib.h>
| -#include <unistd.h>
| +#ifdef _MSC_VER
| +# include <direct.h>
| +#else
| +# include <unistd.h>
| +#endif
|  #include <malloc.h>
|  #include <stdarg.h>
|  #include <assert.h>
| @@ -5790,10 +5890,14 @@
|
|  /* -DDEBUG is fairly common in CFLAGS.  */
|  #undef DEBUG
| -#if defined DEBUGWRAPPER
| -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
| +#ifdef _MSC_VER
| +# define DEBUG()
|  #else
| -# define DEBUG(format, ...)
| +# if defined DEBUGWRAPPER
| +#  define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
| +# else
| +#  define DEBUG(format, ...)
| +# endif
|  #endif
|
|  const char *program_name = NULL;
| @@ -5893,6 +5997,11 @@
|    return base;
|  }
|
| +#ifdef _MSC_VER
| +# define S_IXUSR _S_IEXEC
| +# define _stat stat
| +#endif
| +
|  int
|  check_executable(const char * path)
|  {

I think you can just go ahead and apply this binary wrapper part (as a
separate patch) with a suitable ChangeLog entry.

| @@ -6066,7 +6175,10 @@
|         # are only useful if you want to execute the "real" binary.
|         # Since the "real" binary is built for $host, then this
|         # wrapper might as well be built for $host, too.
| -       $opt_dry_run || $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
| +       $opt_dry_run || {
| +          $opt_dry_run || $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
| +          $STRIP $cwrapper
| +       }
|         ;;
|       esac
|       $RM $output

I think this can go in as a separate patch, too.

| @@ -6342,44 +6454,59 @@
| test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
|         cmds=$old_archive_cmds
|       else
| - # the command line is too long to link in one step, link in parts
| -       func_echo "using piecewise archive linking..."
| -       save_RANLIB=$RANLIB
| -       RANLIB=:
| -       objlist=
| -       concat_cmds=
| -       save_oldobjs=$oldobjs
| -       # Is there a better way of finding the last object in the list?
| -       for obj in $save_oldobjs
| -       do
| -         last_oldobj=$obj
| -       done
| -       for obj in $save_oldobjs
| -       do
| -         oldobjs="$objlist $obj"
| -         objlist="$objlist $obj"
| -         eval test_cmds=\"$old_archive_cmds\"
| -         if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
| -            test "$len" -le "$max_cmd_len"; then
| -           :
| -         else
| -           # the above command should be used before it gets too long
| -           oldobjs=$objlist
| -           if test "$obj" = "$last_oldobj" ; then
| -             RANLIB=$save_RANLIB
| +       case $host_os/$with_gcc in
| +       mingw*/no | mingw*/ | cygwin*/no | cygwin*/)
| +         # Assume MSVC _and_ lib archiver interface...
| +         func_echo "using command file archive linking..."
| +         for obj in $oldobjs; do
| +           $ECHO \""$obj"\"
| +         done > $output_objdir/$libname.libcmd
| +         save_oldobjs="$oldobjs"
| +         oldobjs=" @$output_objdir/$libname.libcmd"
| +         eval cmds=\"\$old_archive_cmds\"
| +         oldobjs="$save_oldobjs"
| +         ;;
| +       *)
| + # the command line is too long to link in one step, link in parts
| +         func_echo "using piecewise archive linking..."
| +         save_RANLIB=$RANLIB
| +         RANLIB=:
| +         objlist=
| +         concat_cmds=
| +         save_oldobjs=$oldobjs
| + # Is there a better way of finding the last object in the list?
| +         for obj in $save_oldobjs
| +         do
| +           last_oldobj=$obj
| +         done
| +         for obj in $save_oldobjs
| +         do
| +           oldobjs="$objlist $obj"
| +           objlist="$objlist $obj"
| +           eval test_cmds=\"$old_archive_cmds\"
| +           if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
| +              test "$len" -le "$max_cmd_len"; then
| +             :
| +           else
| +             # the above command should be used before it gets too long
| +             oldobjs=$objlist
| +             if test "$obj" = "$last_oldobj" ; then
| +               RANLIB=$save_RANLIB
| +             fi
| +             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
| +             eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
| +             objlist=
|             fi
| -           test -z "$concat_cmds" || concat_cmds=$concat_cmds~
| -           eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
| -           objlist=
| +         done
| +         RANLIB=$save_RANLIB
| +         oldobjs=$objlist
| +         if test "X$oldobjs" = "X" ; then
| +           eval cmds=\"\$concat_cmds\"
| +         else
| +           eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
|           fi
| -       done
| -       RANLIB=$save_RANLIB
| -       oldobjs=$objlist
| -       if test "X$oldobjs" = "X" ; then
| -         eval cmds=\"\$concat_cmds\"
| -       else
| -         eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
| -       fi
| +         ;;
| +       esac
|       fi
|        fi
|        func_execute_cmds "$cmds" 'exit $?'

I don't like this big hunk yet.  It's pretty invasive, it assumes
| +         # Assume MSVC _and_ lib archiver interface...

and there is room for other systems to improve, too.
Side note:
| +         if test "X$oldobjs" = "X" ; then

could be `test -z "$oldobjs"'.


| Index: libltdl/m4/libtool.m4
| ===================================================================
| RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
| retrieving revision 1.46
| diff -u -r1.46 libtool.m4
| --- libltdl/m4/libtool.m4     14 Nov 2005 22:49:57 -0000      1.46
| +++ libltdl/m4/libtool.m4     18 Nov 2005 10:57:13 -0000
| @@ -1202,14 +1202,57 @@
|  ])# _LT_ENABLE_LOCK
|
|
| +# _LT_PROG_AR
*big snip*

If you separate out the $AR related changes (and add a ChangeLog entry),
I'd like to look over them once again; I think are ok, though.

| @@ -2052,13 +2095,36 @@
| 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'
|      ;;
|
|    *)
| - library_names_spec='${libname}`echo ${release} | $SED -e 's/ [[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
| +    # Assume 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'
|      ;;
|    esac
| -  dynamic_linker='Win32 ld.exe'
| # FIXME: first we should search . and the directory the executable is in
|    shlibpath_var=PATH
|    ;;

I need to think about this a bit more.

| @@ -2922,6 +2988,16 @@
|    ;;
|  esac
|  ])
| +
| +case $host_os in
| +cygwin* | mingw* | pw32*)
| + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\ (..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
| +  ;;
| +*)
| +  file_magic_glob=
| +  ;;
| +esac
| +
|  file_magic_cmd=$lt_cv_file_magic_cmd
|  deplibs_check_method=$lt_cv_deplibs_check_method
|  test -z "$deplibs_check_method" && deplibs_check_method=unknown
| @@ -2930,6 +3006,8 @@
| [Method to check whether dependent libraries are shared objects])
|  _LT_DECL([], [file_magic_cmd], [1],
|      [Command to use when deplibs_check_method == "file_magic"])
| +_LT_DECL([], [file_magic_glob], [1],
| + [How to find potential files when deplibs_check_method == "file_magic"])
|  ])# _LT_CHECK_MAGIC_METHOD
|
|

It'd be great if you could separate out the file_magic_glob related
changes and post them with a ChangeLog entry.  They are probably ok.

| @@ -3864,7 +3942,9 @@
|      _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
|    ;;
|    cygwin* | mingw*)
| - _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'
| +    if test X$with_gcc = yes; then
| + _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'
| +    fi
|    ;;
|    *)
| _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
*snip*

| @@ -4301,18 +4381,33 @@
|        # 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)='@'

The file_list_spec interface is bogus.  Oh well.
Let's fix that later.

|        # 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 `$ECHO "X$deplibs" | $Xsed -e '\''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(archive_cmds, $1)='$CC -o $output_objdir/ $soname $libobjs $compiler_flags $deplibs -link -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 -link -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'
| +      case $host_os in
| +     # Not needed on MinGW
| + cygwin*) _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' ;;
| +      esac
| +      _LT_TAGVAR(dashL_envvar, $1)=LINK
| +      _LT_TAGVAR(dashL_envvar_spec, $1)='-LIBPATH:'
|        _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'

This should not be here; it belongs to the other commands that set
export_symbols_cmds.

| +      # Don't use ranlib
| +      _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
|        ;;
|
|      darwin* | rhapsody*)
| @@ -4868,6 +4963,10 @@
| [Commands necessary for linking programs (against libraries) with templates])
|  _LT_TAGDECL([], [file_list_spec], [1],
|      [Specify filename containing input files])
| +_LT_TAGDECL([], [dashL_envvar], [1],
| + [When linking, move all paths specified with -L options to this variable])
| +_LT_TAGDECL([], [dashL_envvar_spec], [1],
| + [When moving paths with dashL_envvar, prepend this to each path])
|  dnl FIXME: Not yet implemented
|  dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
|  dnl    [Compiler flag to generate thread safe objects])
| @@ -5240,7 +5339,7 @@
|           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
|           # This is similar to how AIX traditionally builds its shared
|           # libraries.
| - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' - o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE: $export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' | + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' - o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE: $export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $AR_OFLAGS$output_objdir/$libname$release.a $output_objdir/$soname'
|            fi
|          fi
|          ;;
| @@ -5266,28 +5365,60 @@
|          ;;
|
|        cygwin* | mingw* | pw32*)
| - # _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(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
| -        ;;
| +     if test "$GXX" = yes; then
| + # _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(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
| +     else
| +       # Assume 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 -link -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 -link -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'

Erm, was this commented out for a reason?
(Sorry if we've been through this before and I forgot about it).

| +       case $host_os in
| +       # Not needed on MinGW
| + cygwin*) _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' ;;
| +       esac
| +       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
| +       # Don't use ranlib
| +       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
| +     fi
| +     ;;
|        darwin* | rhapsody*)
|          case $host_os in
|            rhapsody* | darwin1.[[012]])
| @@ -5600,7 +5731,7 @@
|             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
|               rm -rf $tpldir~
| $CC --prelink_objects --instantiation_dir $tpldir $oldobjs $old_deplibs~ | - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ | + $AR $AR_FLAGS $AR_OFLAGS$oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
|               $RANLIB $oldlib'
|             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
|               rm -rf $tpldir~

*snip testsuite part of the patch*
Please leave this for now.

Cheers,
Ralf








reply via email to

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