automake-patches
[Top][All Lists]
Advanced

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

New auxiliary archive script (was: Re: pr-msvc-support merge)


From: Peter Rosin
Subject: New auxiliary archive script (was: Re: pr-msvc-support merge)
Date: Sun, 01 Aug 2010 18:54:57 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1

Den 2010-08-01 08:59 skrev Ralf Wildenhues:
Now that assignment has gone through a couple of weeks ago, I went ahead
and committed your version 7 of this patch into a new 'msvc' branch off
of maint and merged that into master.  I intend to merge also into
branch-1.11/maint before the 1.11.2 release, since it is ugly to have
released versions with incompatible auxiliary scripts that are also
distributed elsewhere like in gnulib.

I've squashed in a few really minor changes (bumping scriptversion to
today, using AC_CONFIG_FILES instead of AC_OUTPUT(FILE) and fixing the
mode of the created file rather than its input, to avoid a test failure
on GNU/Linux etc).

Will push as soon as the testsuite has finished.

That's awesome! Can't wait for the release...

Now we need a something similar for the MS archiver (lib.exe)
As it happens, binutils ar does not work as well as lib, MSVC
sometimes has problems with the archives produced by ar. I
know that I have stated otherwise recently, but I was wrong.
The "odd" cases drowned in other failures since I was testing
without most of the MSVC patches applied to libtool and I
expected it to be a all or nothing deal. My bad.

FWIW, I get decent results with the below archive script and
configuring with AR="/path/to/archive lib"

The script still needs @<file>-support, in order to make it
possible for libtool to avoid falling back to "-r -o"
piecewise linking when the command line gets long, so that's
a TODO, and the options handling could be better in order to
better support more than just the very minimal ar features.
It also needs the file conversion stuff from the compile
script in order to support absolute file names. So, far from
perfect...

Would it be possible to include this new auxiliary script and
a macro similar to the one that triggers the use of the compile
script?

Cheers,
Peter

-----------8<------------
#! /bin/sh

case $1 in
  '')
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
     exit 1;
     ;;
  -h | --h*)
    cat <<\EOF
Usage: ar [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
EOF
    exit $?
    ;;
  -v | --v*)
    echo "ar, the lib.exe wrapper v0.1"
    exit $?
    ;;
esac

AR=$1
shift
action=$1
shift
archive=$1
shift
members=$@

test -z "$action" && echo "you must specify an action"
test -z "$archive" && echo "you must specify an archive"

case $action in
cru)
  $AR -NOLOGO -OUT:"$archive" $members
  ;;
x)
  $AR -NOLOGO -LIST "$archive" | while read member
  do
    $AR -NOLOGO -EXTRACT:"$member" "$archive"
  done
  ;;
t)
  $AR -NOLOGO -LIST "$archive"
  ;;
*)
  echo "bad archive action, either cru, x or t"
  ;;
esac
-----------8<------------



reply via email to

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