libtool-patches
[Top][All Lists]
Advanced

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

Re: MSYS+MSVC for libtool branch-2-0, take 2


From: Ralf Wildenhues
Subject: Re: MSYS+MSVC for libtool branch-2-0, take 2
Date: Mon, 27 Jun 2005 11:58:04 +0200
User-agent: Mutt/1.4.1i

Hi Peter,

I'm very sorry it took me so long to write this email.
Nice to see you are making progress.  :)

* Peter Ekberg wrote on Fri, Jun 17, 2005 at 03:15:33PM CEST:
> Ralf Wildenhues wrote:
> > * Peter Ekberg wrote on Fri, Jun 10, 2005 at 10:57:33PM CEST:
> > > Ralf Wildenhues wrote:
> > > > 
> > > > `link -LIB' can be a problem if the cygwin `link' (to create 
> > > > hard links)
> > > > comes before the win32 paths.  `LIB' works here.
> > > 
> > > I have a fix for that in the attached patch, where you can
> > > override by setting MSLINK to the appropriate executable.
> > 
> > Hmm.  Can't we just move all this stuff to the section in libtool.m4
> > where $AR is set?  It already allows user override (by setting AR
> > appropriately during configure).  We could test whether `ar' 
> > works, and
> > if not, whether either one of `link -lib' or `lib' work.
> > (This is where we then should also test whether `ar' 
> > understands the `S'
> > option, and adjust archive_cmds/postinstall_cmds accordingly, 
> > but that's
> > totally unrelated to this patch.)
> 
> Of course, reuse the AR variable. *smacks forehead*

  :)

> Looking closer reveals a couple of problems though...
> $AR is used in three ways if I read it correctly:
> 1. "$AR $AR_FLAGS archive files..." to create archives.
> 2. "$AR x archive" to extract archives.
> 3. "$AR t archive" to list archive content.
> 
> I see no way to set AR and AR_FLAGS so that 1. is expanded
> to "lib -OUT:archive files..." as is needed here (-OUT:
> has to be prepended to the archive name without space).

Hmm.  See below.

> "$AR x archive" has to be hidden in some construct, as there is
> the problem that there is no way to extract all members from
> a MSVC .lib in one go, you have to loop over the archived
> files and extract them one by one.

We have more than one variable which allows a set of commands.
extract_old_archive_cmds comes to mind as a new name; and in fact, I
have suggested this before in another mail in this thread.
Seeded with '$AR x $oldlib'.  Would you like me to show this in a patch?

(Don't worry too much about global variable names in shell functions.
This is orthogonal, and I have an idea to hide the resulting ugliness in
ltmain.m4sh.)

Alternatively, if you don't like the extract_old_archive_cmds idea, I'd
still prefer something like
  $AR $AR_FLAGS$AR_SEP$oldlib ..
over your solution.  Have AR_SEP=' ' by default.
Rationale: Less variables to keep track of.

> 3 is easy to solve, just introduce $AR_LFLAGS and set it to
> "t" by default and to "-NOLOGO -LIST" for MSVC.
> 
> I have made an attempt to solve these issues in
> msys_msvc-4.patch.

By looking at `lib -link' I believe issue 1. is actually the most
problematic, since `lib' encodes the path into the archive by default.
I have not found a switch to turn this off (which does not imply there
is none).  But that means we have to symlink/copy objects before
archiving them.  (Could be done in the same loop as the renaming, but
will be expensive anyway.)

Otherwise, all use of convenience archives breaks (and running the
Libtool test suite really shows that).

> (It turns out that both ar and lib works as the archiver
>  since MSVC does not actually see the generated archives.
>  ar is selected by default, so you have to specify AR=lib
>  or AR="link -lib" to get the Microsoft tool.)

The "encodes paths" is one reason to prefer `ar' over `lib' any time.

> There are some more instances where the space after $AR_FLAGS
> should be removed, but those are system specific and I think
> it's safe to assume the archiver to be ar on those systems.
> So, in order to keep the patch size down I left them as is.

Ouch.  I don't like this special-casing because it seems to work at the
moment very much.  Let's just replace all of them by $AR_SEP.

> > > I have the feeling that some of this work should perhaps
> > > be in autoconf or automake, but I also have the feeling
> > > that it is not as easy to warp the arguments as needed
> > > to suit MSVC?
> > 
> > Are we heading back towards `cccl'?  :)
> 
> Right, better not go there... :-)
> 
> > To be honest: if the environment variables can be used to circumvent
> > problems with, e.g., configure (such as backslashes, spaces in path),
> > then we should be happy that they exist and not bother any more.  What
> > do you think?
> 
> It will probably be very messy to make MSVC work with autoconf
> without cccl (or some other wrapper script). Libtool should be
> doable.

OK.

> > > > After working around these, the next failure is when 
> > linking libltdl:
> > > > 
> > > > | libltdl_la-ltdl.obj : error LNK2019: unresolved external 
> > > > symbol _lt_libltdl_LTX_preloaded_symbols referenced in 
> > > > function _lt_dlinit.
> > > > | .libs/ltdl-6.dll : fatal error LNK1120: 1 unresolved externals
> > > 
> > > Haven't tried libltdl, I do not depend on it for the project
> > > I'm targeting and I have a hard time bootstrapping libtool
> > > so I haven't tried the testsuite myself.
> > 
> > Is that only because you'd need recent Autoconf/Automake (from CVS)?
> 
> Yes. That, and I'm unsure of if there are any patches needed for
> Cygwin (which I guess I would be using to bootstrap) and since
> Cygwin has a strange side-by-side installation of autotools.

I vaguely remember that you need to have only one of the packages
installed (e.g., only Autoconf-2.59, but not 2.13).

> > If not: show the specific problems, we can try to fix them then.
> > Did you try to bootstrap on mingw?
> 
> No, I tried bootstrapping with Cygwin and ac 2.59 and it of
> course didn't work...

Copy and paste output?

> > > > The `mv' command in this line
> > > > | +      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs 
> > > > $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ 
> > > > -lc$//'\''` -link -dll~linknames=~mv .libs/${libname}`$ECHO 
> > > > "X${release}" | $Xsed -e +s/[.]/-/g`${versuffix}.lib 
> > > > .libs/${libname}.lib'
> > > > 
> > > > is also broken w.r.t lib name.
> > > 
> > > I don't see what you mean here. It does what I intend it to do,
> > > it renames the import lib to not have a version number. Why
> > > is that a problem? It matches the content of the .la file.
> > 
> > I didn't keep a note on this due to time constraints, sorry.  Was a
> > problem with the paths again, I think (i.e., correct quoting).
> 
> Well, I didn't even try to solve problems caused by spaces in paths,
> I used my little -L/msvc/lib workaround instead.

OK.

> > > Things that should probably be worked on:
> > > 
> > > - Install dlls in ../bin/foo.dll, just like they are for MinGW
> > >   and Cygwin. The generated .la are wrong as is.

> Fixed in msys_msvc-4.patch.

OK.

> > > - Add paths given with -L to the LIB variable so that the linker
> > >   actually sees them. This should be done after converting them
> > >   to win32 paths, which is easy on Cygwin and harder on MSYS.

> Maybe not so hard on MSYS after all, how about:
> win32=$(cmd \\/C echo "$unix " | sed -e "s/\"\(.*\) \" /\1/")
> 
> (cmd is not directly CMD.EXE, but a shell script provided by MSYS
> that invokes $COMSPEC. One question is how portable /C is as an
> option to $COMSPEC? I would guess that /C works for all command
> interpreters from Microsoft, but I'm unsure about others...)

This /might/ be a question for the msys/mingw mailing lists.
What is COMSPEC, by the way?

The `echo' might be problematic, if any of the shells' builtin and/or
external echo commands interpret backslashes.  The MinGW shell should be
fine with `printf %s ".."', I believe.

Also I don't like the fact that we do not reuse fix_srcfile_path.  This
should set the right thing for cygwin/mingw and we should use it in the
appropriate places.  Anything more than a
  test -z "$fix_srcfile_path" \
      && $cmd

should IMHO be separated out into a function, in order to keep clutter
out of the main (and IMVHO already too large) functions.

> Also, how portable is it to assume that the sed matcher is greedy,
> like GNU sed is documented to be?

Erm, that is very much specified in POSIX.  BREs/EREs are all greedy,
this specification is necessary for non-ambiguous operation.  (The only
exception to greediness of regular expressions is, AFAIR, perl/pcre
which has options to match non-greedily.)

> But assuming GNU sed on MSYS should be fairly safe. Or?

Yes, very safe.

> Anyway I made -L options visible to the linker using a variant
> of the above in msys_msvc-4.patch.

OK.

> > > - libtool at some point thinks /mingw/bin/ld is the linker and
> > >   uses that to deduce stuff, perhaps other configure checks are
> > >   also a problematic, I haven't looked closely since it works
> > >   for me.
> > 
> > Show `./libtool --config'.  In order to use only the msvc tools, it
> > might be necessary to configure somehow like
> >   CC=cl CXX=cl LD=link AR=link\ -lib
> > iff the respective mingw/cygwin tools are available as well. 
> > I regard this as a feature, BTW, not a bug.
> > 
> > It'll likely be some time before I can look at your patch again.
> > It's good to see that it's getting smaller, though.  :)
> > 
> > Another couple of hints: if you intend to work on the path conversion
> > thing, please separate that out into a shell function if at all
> > possible.  (And have a reasonably fast default path so that 
> > not everyone
> > has to suffer from it.)
> 
> One more thing that perhaps should be handled is that the content
> of the LIB variable should be added to sys_lib_search_path (or
> some other variable?) This would require converting paths from
> win32 style to unix style, which again is easy on Cygwin, but
> much harder on MinGW (the workaround above does not work).
> But I would not consider this a showstopper. The user can always
> add the needed paths with -L as I have done.
> 
> PS. With msys_msvc-4.patch I configure with
> ./configure CC="cl -MD" AR=lib LDFLAGS=-L/msvc/lib
> 
> I also have this line in my msys /etc/fstab
> C:/PROGRA~1/MICROS~4/VC98 /msvc

Ahh.  Guess that might be a good idea to put in corresponding
documentation.

> PPS. The patch does not solve as many issus on Cygwin as it
> does on MSYS. Therefore, please don't judge it by its
> performance on Cygwin. You have to walk before you can run...

Sure.

> PPPS. _LT_COMPILER_OPTION is very nice in that it is good at
> detecting options that are not supported, even though the dang
> MSVC compiler only prints a warning and ignores the unknown
> option. Any chance of seeing that in autoconf, so that -g is
> not falsely being detected as being usable for MSVC?

The autoconf guys have already asked for a _LT_COMPILER_OPTION version
to put in Autoconf.  When I have time, I'll try to work on it.
However, it might not be as useful as you think it will be.

> Is there any particular risk involved with using the above macro
> in the project configure.ac? I mean, how likely is it that it
> will go away or change interface? (the leading underscore looks
> like a warning)

Yep.  General rule is: if it's documented as public in doc/libtool.texi,
it's safe to use (Autoconf works the same way).  The underscore is to
support documentation.  There is an open issue with it which likely
necessitates an interface change for solving _right_.
(Actually, the situation is a little more problematic: in branch-1-5,
the corresponding macro had no leading underscore and was named
differently.  It was not documented, but I know about real-world use of
the branch-2-0 version of the macro.  A recent suggestion would lead to
an interface change when implemented.  Not sure what to do best).

More comments below inline.

Peter, I'm sorry to sound so picky at times.  If you'd like me to, I can
eventually do some work on this as well, but it will be a little more
while at least.  Thanks again for your work.

Regards,
Ralf

| Index: config/ltmain.m4sh
| ===================================================================
| RCS file: /cvsroot/libtool/libtool/config/ltmain.m4sh,v
| retrieving revision 1.1.2.54
| diff -u -u -5 -r1.1.2.54 ltmain.m4sh
| --- config/ltmain.m4sh        5 Jun 2005 17:35:11 -0000       1.1.2.54
| +++ config/ltmain.m4sh        17 Jun 2005 13:11:37 -0000
| @@ -626,10 +626,40 @@
|    esac
|    $ECHO "$win32_libid_type"
|  }
|  
|  
| +# func_msvc_dashL_to_LINK deplibs_variable deplibs...
| +func_msvc_dashL_to_LINK ()
| +{
| +  $opt_debug
| +  # weed out -L options
| +  deplibs_variable="$1"

No need for quotes here.

| +  shift
| +  tmp_libs=
| +  for deplib in $@; do

No need for `in $@' here.  It's also a bug, should be "$@".

| +    case $deplib in
| +    -L*)
| +      deplib="$($ECHO "X${deplib}" | $Xsed -e 's/^-L//')"

$( ) is not portable.  I don't want to special-case only because this is
system-dependent code.  Also, the shell /could/ barf while parsing this!

No need for the outer quotes here, either, and in fact they reduce
portability, as noted in Autoconf docs.

| +      case $host_os in
| +      mingw*)
| +     LINK="$LINK -LIBPATH:$(cmd \\/C echo "$deplib " | sed -e "s/\"\(.*\) \" 
/\1/")"

We _need_ to factor out the `cmd \\/...' stuff into a separate function
or variable.

| +     ;;
| +      *)
| +     LINK="$LINK -LIBPATH:`cygpath -w "$deplib"`"

Ditto.

| +     ;;
| +      esac
| +      ;;
| +    *)  
| +      tmp_libs="$tmp_libs $deplib"
| +      ;;
| +    esac
| +  done
| +  eval $deplibs_variable=\"$tmp_libs\"

I believe that should be 
  eval $deplibs_variable="\"$tmp_libs\""

| +}
| +
| +
|  
|  # func_infer_tag arg
|  # Infer tagged configuration to use if any are available and
|  # if one wasn't chosen via the "--tag" command line option.
|  # Only attempt this if the compiler in the base compile
| @@ -929,13 +959,21 @@
|  func_extract_an_archive ()
|  {
|      $opt_debug
|      f_ex_an_ar_dir="$1"; shift
|      f_ex_an_ar_oldlib="$1"
| -    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
| -    $run 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
| +      $show "(cd $f_ex_an_ar_dir && $AR ${AR_XFLAGS}$f_ex_an_ar_oldlib)"
| +      $run eval "(cd \$f_ex_an_ar_dir && $AR 
${AR_XFLAGS}\$f_ex_an_ar_oldlib)" || exit $?
| +    else
| +      $AR ${AR_LFLAGS}"$f_ex_an_ar_oldlib" | while read name
| +      do
| +        $show "(cd $f_ex_an_ar_dir && $AR ${AR_XFLAGS}$name 
$f_ex_an_ar_oldlib)"
| +        $run eval "(cd \$f_ex_an_ar_dir && $AR ${AR_XFLAGS}\$name 
\$f_ex_an_ar_oldlib)" || exit $?
| +      done
| +    fi
| +    if ($AR ${AR_LFLAGS}"$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"
|      fi
|  }
| @@ -2596,10 +2634,11 @@
|           continue
|           ;;
|         *-*-mingw* | *-*-os2*)
|           # These systems don't actually have a C library (as such)
|           test "X$arg" = "X-lc" && continue
| +         test "X$with_gcc" != "Xyes" -a "X$arg" = "X-lm" && continue
|           ;;
|         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
|           # Do not include libc due to us having libc/libc_r.
|           test "X$arg" = "X-lc" && continue
|           ;;
| @@ -4075,10 +4114,21 @@
|             case " $tmp_libs " in
|             *" $deplib "*) ;;
|             *) tmp_libs="$tmp_libs $deplib" ;;
|             esac
|             ;;
| +         -l*)
| +           if test "$linkmode" = prog -a "X$with_gcc" != Xyes; then
| +             case $host in
| +             *-*-mingw* | *-*-cygwin*)
| +               # assume MSVC
| +               deplib=`$ECHO "X${deplib}.lib" | $Xsed -e 's/^-l//'`
| +               ;;
| +             esac
| +           fi
| +           tmp_libs="$tmp_libs $deplib"
| +           ;;
|           *) tmp_libs="$tmp_libs $deplib" ;;
|           esac
|         done
|         eval $var=\"$tmp_libs\"
|       done # for var
| @@ -4656,12 +4706,17 @@
|                 ;;
|               esac
|             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 |
|                        $GREP " -> " >/dev/null; then
|                       continue
| @@ -4680,11 +4735,18 @@
|                       esac
|                     done
|                     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
|                 done
|               done
| @@ -5184,10 +5246,17 @@
|  
|         func_extract_archives $gentop $dlprefiles
|         libobjs="$libobjs $func_extract_archives_result"
|       fi
|  
| +     case $host_os/$with_gcc/$pass in
| +       mingw*/no/link | mingw*//link | cygwin*/no/link | cygwin*//link)
| +         # assume MSVC
| +         func_msvc_dashL_to_LINK deplibs $deplibs
| +       ;;
| +     esac
| +
|       save_ifs="$IFS"; IFS='~'
|       for cmd in $cmds; do
|         IFS="$save_ifs"
|         eval cmd=\"$cmd\"
|         func_quote_for_expand "$cmd"
| @@ -5394,10 +5463,17 @@
|       compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([[^ 
$]]*\).ltframework% -framework \1%g'`
|       finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([[^ 
$]]*\).ltframework% -framework \1%g'`
|       ;;
|        esac
|  
| +      case $host_os/$with_gcc/$pass in
| +        mingw*/no/link | mingw*//link | cygwin*/no/link | cygwin*//link)
| +       # assume MSVC
| +       func_msvc_dashL_to_LINK compile_deplibs $compile_deplibs
| +     ;;
| +      esac
| +
|        compile_command="$compile_command $compile_deplibs"
|        finalize_command="$finalize_command $finalize_deplibs"
|  
|        if test -n "$rpath$xrpath"; then
|       # If the user specified any rpath flags, then add them.
| @@ -5680,11 +5756,13 @@
|  */
|  EOF
|           cat >> $cwrappersource<<"EOF"
|  #include <stdio.h>
|  #include <stdlib.h>
| +#ifndef _MSC_VER
|  #include <unistd.h>
| +#endif
|  #include <malloc.h>
|  #include <stdarg.h>
|  #include <assert.h>
|  #include <ctype.h>
|  #include <string.h>
| @@ -5732,15 +5810,19 @@
|    if (stale) { free ((void *) stale); stale = 0; } \
|  } while (0)
|  
|  /* -DDEBUG is fairly common in CFLAGS.  */
|  #undef DEBUG
| +#ifdef _MSC_VER
| +# define DEBUG()
| +#else
|  #if defined DEBUGWRAPPER
|  # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
|  #else
|  # define DEBUG(format, ...)
|  #endif
| +#endif
|  
|  const char *program_name = NULL;
|  
|  void * xmalloc (size_t num);
|  char * xstrdup (const char *string);
| @@ -5844,10 +5926,13 @@
|  
|    DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : 
"NULL!");
|    if ((!path) || (!*path))
|      return 0;
|  
| +#ifdef _MSC_VER
| +  return 1;
| +#else
|    if ((stat (path, &st) >= 0) &&
|        (
|       /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
|  #if defined (S_IXOTH)
|         ((st.st_mode & S_IXOTH) == S_IXOTH) ||
| @@ -5858,10 +5943,11 @@
|         ((st.st_mode & S_IXUSR) == S_IXUSR))
|        )
|      return 1;
|    else
|      return 0;
| +#endif
|  }
|  
|  /* Searches for the full path of the wrapper.  Returns
|     newly allocated full path name if found, NULL otherwise */
|  char *
| @@ -6008,11 +6094,15 @@
|         # we should really use a build-platform specific compiler
|         # here, but OTOH, the wrappers (shell script and this C one)
|         # 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.
| -       $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
| +       if test "$with_gcc" = "yes"; then
| +         $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
| +       else
| +         $run $LTCC $LTCFLAGS -o $cwrapper $cwrappersource

Why is this necessary?

| +       fi
|         ;;
|       esac
|       $RM $output
|       trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
|  
| Index: m4/libtool.m4
| ===================================================================
| RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
| retrieving revision 1.125.2.60
| diff -u -u -5 -r1.125.2.60 libtool.m4
| --- m4/libtool.m4     11 Jun 2005 11:02:52 -0000      1.125.2.60
| +++ m4/libtool.m4     17 Jun 2005 13:11:37 -0000
| @@ -995,18 +995,62 @@
|  
|  need_locks="$enable_libtool_lock"
|  ])# _LT_ENABLE_LOCK
|  
|  
| +# LT_PROG_AR
| +# ----------
| +m4_defun([LT_PROG_AR],
| +[AC_CHECK_TOOLS(AR, [ar lib "link -lib"], false)
| +test -z "$AR" && AR=ar
| +_LT_DECL([], [AR], [1], [The archiver])
| +
| +AC_CACHE_CHECK([the archiver ($AR) interface],[lt_cv_ar_interface],
| +  [lt_cv_ar_interface="ar"
| +  printf "$lt_simple_compile_test_code" > conftest.$ac_ext
| +  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
| +  (eval "$ac_compile" 2>conftest.err)
| +  cat conftest.err >&AS_MESSAGE_LOG_FD
| +  (eval "$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext" &>conftest.err)
| +  ac_status=$?
| +  cat conftest.err >&AS_MESSAGE_LOG_FD
| +  if test $ac_status = 0 -a -f conftest.lib; then
| +    lt_cv_ar_interface="lib"
| +  fi
| +  rm -f conftest*])
| +
| +case $lt_cv_ar_interface in
| +ar)
| +  test -z "$AR_FLAGS" && AR_FLAGS=cru

This is shorter (and IMHO cleaner) written as
  : ${AR_FLAGS=cru}

| +  test -z "$AR_LFLAGS" && AR_LFLAGS=t
| +  test -z "$AR_XFLAGS" && AR_XFLAGS=x
| +  AR_FLAGS="$AR_FLAGS "
| +  AR_LFLAGS="$AR_LFLAGS "
| +  AR_XFLAGS="$AR_XFLAGS "
| +  _LT_TAGVAR(ar_extract_one_by_one, $1)=no
| +  ;;
| +lib)
| +  test -z "$AR_FLAGS" && AR_FLAGS="-NOLOGO -OUT:"
| +  test -z "$AR_LFLAGS" && AR_LFLAGS="-NOLOGO -LIST "
| +  test -z "$AR_XFLAGS" && AR_XFLAGS="-NOLOGO -EXTRACT:"
| +  _LT_TAGVAR(ar_extract_one_by_one, $1)=yes
| +  ;;
| +esac
| +
| +_LT_DECL([], [ar_extract_one_by_one], [1],
| +  [Extract archive members one by one])
| +
| +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
| +_LT_DECL([], [AR_LFLAGS], [1], [Flags to list archive content])
| +_LT_DECL([], [AR_XFLAGS], [1], [Flags to extract an archive])
| +])# LT_PROG_AR
| +
| +
|  # _LT_CMD_OLD_ARCHIVE
|  # -------------------
|  m4_defun([_LT_CMD_OLD_ARCHIVE],
| -[AC_CHECK_TOOL(AR, ar, false)
| -test -z "$AR" && AR=ar
| -test -z "$AR_FLAGS" && AR_FLAGS=cru
| -_LT_DECL([], [AR], [1], [The archiver])
| -_LT_DECL([], [AR_FLAGS], [1])
| +[LT_PROG_AR
|  
|  AC_CHECK_TOOL(STRIP, strip, :)
|  test -z "$STRIP" && STRIP=:
|  _LT_DECL([], [STRIP], [1], [A symbol stripping program])
|  
| @@ -1014,11 +1058,11 @@
|  test -z "$RANLIB" && RANLIB=:
|  _LT_DECL([], [RANLIB], [1],
|      [Commands used to install an old-style archive])
|  
|  # Determine commands to create old-style static archives.
| -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
| +old_archive_cmds='$AR $AR_FLAGS$oldlib$oldobjs$old_deplibs'
|  old_postinstall_cmds='chmod 644 $oldlib'
|  old_postuninstall_cmds=
|  
|  if test -n "$RANLIB"; then
|    case $host_os in
| @@ -1096,11 +1140,11 @@
|    [$2=no
|     save_LDFLAGS="$LDFLAGS"
|     LDFLAGS="$LDFLAGS $3"
|     printf "$lt_simple_link_test_code" > conftest.$ac_ext
|     if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
| -     # The compiler can only warn and ignore the option if not recognized
| +     # The linker can only warn and ignore the option if not recognized
|       # So say no if there are warnings
|       if test -s conftest.err; then
|         # Append any errors to the config.log.
|         cat conftest.err 1>&AS_MESSAGE_LOG_FD
|       else
| @@ -1818,11 +1862,19 @@
|        ;;
|      esac
|      ;;
|  
|    *)
| +    # Assume MSVC
| +    libname_spec='$name'
|      library_names_spec='${libname}`echo ${release} | $SED -e 
's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
| +    # 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'
|      ;;
|    esac
|    dynamic_linker='Win32 ld.exe'
|    # FIXME: first we should search . and the directory the executable is in
|    shlibpath_var=PATH
| @@ -2650,18 +2702,30 @@
|  tpf*)
|    lt_cv_deplibs_check_method=pass_all
|    ;;
|  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
|  
|  _LT_DECL([], [deplibs_check_method], [1],
|      [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
|  
|  
|  # LT_PATH_NM
|  # ----------
| @@ -3943,17 +4007,21 @@
|        # 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='
| +      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags 
$deplibs -link -dll~linknames=~mv .libs/${libname}`$ECHO "X${release}" | $Xsed 
-e s/[.]/-/g`${versuffix}.lib .libs/${libname}.lib'
| +      _LT_TAGVAR(module_cmds, $1)='$CC -o $lib $libobjs $compiler_flags 
$deplibs -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"`'
| +      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'
|        ;;
|  
|      darwin* | rhapsody*)
|        case $host_os in
|        rhapsody* | darwin1.[[012]])




reply via email to

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