Changeset 106 for trunk/autoconf


Ignore:
Timestamp:
Jun 29, 2010 1:19:50 PM (11 years ago)
Author:
kulshres
Message:

Squashed merge of branch 'master' of 'gitclone' into svn
and regenerated files to comply with coin-or repository guidelines.

  • 'master' of 'gitclone': (37 commits) fix a bug in the windows packaging script and add an examples packager add new files to dist remove old windows compile scripts and makefiles from dist allow nosparse compilation to do sparsity patterns too improve compilation and installation of windows Remove old windows Makefiles and scripts Add the examples readme file for vc++ also to dist. Add 64bit windows additions to the project files. add all the visual studio files to dist too regenerate documentation. add something about Visual Studio in the documentation. correct the documentation about include paths and the --enable- options add some more instructions for users in Readme files. ignore generated files from VC++ add project files for documented examples add ADOLC_DLL_EXPORT to taping functions add some readme instructions for users. ignore generated files from the windows build Add visual studio source files compile sparse sources only if SPARSE is defined ...

Details of the commit messages:

commit acd92df2e0402c5e2fb9853ae2185030e0e171c2
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 29 11:28:18 2010 +0200

fix a bug in the windows packaging script and add an examples packager

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 79c88a7f8bc6ceff687a7104accbb8a10661e5d0
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 28 17:27:58 2010 +0200

add new files to dist

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 549de45ff5f748a2e532818ed505816cee0c6388
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 28 17:24:04 2010 +0200

remove old windows compile scripts and makefiles from dist

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit b016c67ae894e746b33df30169449066f60fba8e
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 28 17:08:22 2010 +0200

allow nosparse compilation to do sparsity patterns too

the only thing missing is colpack and we've already done a separation.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit b3bf0950428c5608319054282faf1984b0498b24
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 28 17:07:28 2010 +0200

improve compilation and installation of windows

  • add NDEBUG everywhere so no debug libraries are required
  • add the redistributable vc++ packages
  • add a script to install the compiled files in a good directory structure and create a zipfile, also including the vc++ packages and a setup.bat

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit e3e3045db66ab4efd2d56c4cce1e47117bfd981b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 28 15:25:23 2010 +0200

Remove old windows Makefiles and scripts

these are useless now and have not been maintained in ages

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit df7e7f651dd96ad54b8a0e179f3513f4157ad4cb
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 22 11:11:40 2010 +0200

Add the examples readme file for vc++ also to dist.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 5b1503a589485296773cb867e0140ecd0c4ff2bb
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 22 10:57:11 2010 +0200

Add 64bit windows additions to the project files.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit fcb189798ea3f160ea8a2715c0a9b62bb0219c24
Merge: cf9681b e2de127
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 16:09:11 2010 +0200

Merge branch 'visualstudio'

  • visualstudio: add all the visual studio files to dist too

commit e2de127ad54537b0ae0a83a6ce4b2e19e8539c2a
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 16:08:05 2010 +0200

add all the visual studio files to dist too

in case we make a tarball using make dist these files should be
included too.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit cf9681bbad4db565e2b4eb0657b34005048c656c
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 15:38:35 2010 +0200

regenerate documentation.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit a1292b4d3374089ea675b65188a921a4a90235ae
Merge: f4b19a1 23f4d82
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 15:37:09 2010 +0200

Merge branch 'visualstudio'

  • visualstudio: add something about Visual Studio in the documentation. add some more instructions for users in Readme files. ignore generated files from VC++ add project files for documented examples add ADOLC_DLL_EXPORT to taping functions add some readme instructions for users. ignore generated files from the windows build Add visual studio source files compile sparse sources only if SPARSE is defined visual c++ doesn't like non-void functions without return

commit 23f4d8280b10b57651353ba1b00c56126d769d95
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 15:34:59 2010 +0200

add something about Visual Studio in the documentation.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit f4b19a13d0bf95fc677fc4713dbb7f1de4803710
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 15:34:07 2010 +0200

correct the documentation about include paths and the --enable- options

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 1797588337947960a9f605f54accd77864320bd6
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 14:51:46 2010 +0200

add some more instructions for users in Readme files.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit e289fe2d47fa7488021faf8e06d4331a599f1535
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 14:36:50 2010 +0200

ignore generated files from VC++

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit ba4d6262d1344af8a27ef4c4d4633f076b4a9440
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 14:35:24 2010 +0200

add project files for documented examples

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 6b2ba4c6245b0cf0d9cc1655bbcd9bdd2187bc07
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 14:30:22 2010 +0200

add ADOLC_DLL_EXPORT to taping functions

otherwise the applications don't link with adolc.dll in VC++

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit b93770a0d8625740014bca29200f47c5ed891045
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 13:08:26 2010 +0200

add some readme instructions for users.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 9cd5a33abc32592b6f2348f651a1990520ebf731
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 12:45:09 2010 +0200

ignore generated files from the windows build

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 23c23e08c207effe526c973992b9aab5c6b9dff9
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 12:02:19 2010 +0200

Add visual studio source files

the windows/adolc.sln file is the solution file which can be
used to compile both sparse and nosparse versions.
windows/adolc.vcxproj is the adolc project file containing the
configuration for both sparse and nosparse builds, the sparse build
requires the ThirdParty/ColPack/ColPack?.vcxproj project to be
compiled first.

In order to compile ColPack?, just unpack the ColPack? sources into
ThirdParty/ColPack? and apply the patch
Thirparty/ColPack?/colpack_vcxcompile.patch
which is needed for colpack to be compiled in VC++.
After this Visual Studio will be able to build the sparse version
of adolc which contains ColPack? as a static library within.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 5f7244ce2e64515020aa8ab619eea91bafb5159f
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 11:55:00 2010 +0200

compile sparse sources only if SPARSE is defined

in the autotools version -DSPARSE gets added to the command line
whenever sparse is enabled. Autotools also have a conditional
source files list. VC++ doesn't have any conditional sources
so we define SPARSE=1 in the additional defines and let the whole
source be only compiled if SPARSE was defined.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 17ad3477450ea40264f3055ec10965c5e9a3a635
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Thu Jun 17 11:50:57 2010 +0200

visual c++ doesn't like non-void functions without return

gcc usually only warns about it. visual c++ calls it an error.
in this case we really don't need an int to be returned so we
just make the function void.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit fc5b44bd420bcd4dd6606ed5da853bcd2f959c93
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Jun 16 11:29:51 2010 +0200

correct the logic for the warning delay in configure

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit c8efb4d5811a8045bfbbfaebc96d356f87d07045
Merge: ec60772 6203077
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 15 16:59:32 2010 +0200

Merge branch 'svn'

commit ec60772e229fb09c8d8f5a71c5b55602b8245601
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 14 18:06:14 2010 +0200

distcheck seems to behave differently on each computer

make it work for a third time

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit f7ba0328297712c575e25d88f3496b2503c7949d
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 14 17:59:29 2010 +0200

let make distcheck be even more happy

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 5002f07123a276c45e0484e819c85f6e0e9c352f
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 14 16:13:39 2010 +0200

some more optimisations in configure

  • allow for simultaneous 32 and 64 bit installations whenever needed
  • writability test for the prefix directory or its parents
  • print the last comments about linking paths for all paths in ${HOME}
  • put in a pause between messages so that the user will notice the (red printed) warnings before they scroll away.
  • rename options that only enable or disable a feature appropriately

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 9f86f1d391871f26f1a61c357764e63558ad078a
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Jun 9 10:18:40 2010 +0200

let make distcheck be happy.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit fe27dfbae0a6ded19cec3e0205a60a5ee3db3ce5
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 8 14:52:24 2010 +0200

ignore more generated files

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 27ac799deb4cd5a162478d489212cc4eff821797
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Tue Jun 8 14:45:14 2010 +0200

hack in a --tag=XXX for old libtool

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 3f8bac48008b559219f965b23209be5c9761605e
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 7 17:56:17 2010 +0200

use shave and dolt to clean up the build

makes it easier to see errors and warnings

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 5e05c52bc2ebb60a15b62753a25d8e7a930b3c9e
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 7 17:38:15 2010 +0200

Separate out ColPack? dependency from sparsity patterns

In order to compute sparsity patterns we don't need ColPack?. It is
only needed to compute the compressed structures or their seeds.
This way user also has the opportunity to specify where his ColPack?
installation is located and standard library paths are also searched.

In case someone switches sparse on and doesn't have ColPack?, ADOL-C
will still compile but configure will spit out a warning in the end
as well as the functions that use ColPack?, if called, will cause an
exit(-1) with an error message.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 5713dfa2a060859061890f60adc92353d9efd4f9
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Jun 7 15:31:50 2010 +0200

ignore more executables

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit ac57ebab0d23ee210129b9217661dc1598ef01f9
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Fri May 7 01:45:02 2010 +0200

one more generated file to be removed and ignored

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 612016c5052146fea2a719d4235dfa14e9eab7c6
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Mon Apr 12 14:35:38 2010 +0200

correct the inclusion directories

since all public headers are pkginclude_HEADERS they must be prefixed
for inclusion always.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 5c11cac64c647fd0d129dfe53c9a2f0324ce3002
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 23 11:58:24 2009 +0200

more generated files to be ignored.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit c9a7a67b11aacf1db291a8d931b3ddfe7cfb223b
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 23 11:55:59 2009 +0200

some more stuff to gitignore

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 85c1a35c43aad249ec888d4fee184b0ac132d60f
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 23 11:52:56 2009 +0200

Allow examples to be compile later

Even if the configure does not get the compile examples by default
flag, someone might want to compile one or two examples later by
calling make examplename in the examples subdirectory. This will
make that possible.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

commit 16f920cfca7c013aecbf3a7fb7070882555a32e8
Author: Kshitij Kulshreshtha <kshitij@…>
Date: Wed Sep 23 11:43:27 2009 +0200

Remove files from git that are anyway generated

I don't know why svn people like to keep them anyway.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

Location:
trunk/autoconf
Files:
4 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoconf/config.guess

    r1 r106  
    22# Attempt to guess a canonical system name.
    33#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    5 
    6 timestamp='2003-06-17'
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     5#   Free Software Foundation, Inc.
     6
     7timestamp='2009-04-27'
    78
    89# This file is free software; you can redistribute it and/or modify it
     
    1819# You should have received a copy of the GNU General Public License
    1920# along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     21# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     22# 02110-1301, USA.
    2123#
    2224# As a special exception to the GNU General Public License, if you
     
    2426# configuration script generated by Autoconf, you may include it under
    2527# the same distribution terms that you use for the rest of that program.
     28
    2629
    2730# Originally written by Per Bothner <per@bothner.com>.
     
    5457
    5558Originally written by Per Bothner.
    56 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    57 Free Software Foundation, Inc.
     59Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     602002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    5861
    5962This is free software; see the source for copying conditions.  There is NO
     
    6770  case $1 in
    6871    --time-stamp | --time* | -t )
    69        echo "$timestamp" ; exit 0 ;;
     72       echo "$timestamp" ; exit ;;
    7073    --version | -v )
    71        echo "$version" ; exit 0 ;;
     74       echo "$version" ; exit ;;
    7275    --help | --h* | -h )
    73        echo "$usage"; exit 0 ;;
     76       echo "$usage"; exit ;;
    7477    -- )     # Stop option processing
    7578       shift; break ;;
     
    105108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
    106109: ${TMPDIR=/tmp} ;
    107  { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
     110 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
    108111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
    109112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
     
    124127 ,,*)   CC_FOR_BUILD=$CC ;;
    125128 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    126 esac ;'
     129esac ; set_cc_for_build= ;'
    127130
    128131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
     
    137140UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    138141
    139 ## for Red Hat Linux
    140 if test -f /etc/redhat-release ; then
    141     VENDOR=redhat ;
    142 else
    143     VENDOR= ;
    144 fi
     142case "${UNAME_MACHINE}" in
     143    i?86)
     144        test -z "$VENDOR" && VENDOR=pc
     145        ;;
     146    *)
     147        test -z "$VENDOR" && VENDOR=unknown
     148        ;;
     149esac
     150test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
    145151
    146152# Note: order is significant - the case branches are not exclusive.
     
    166172            sh3el) machine=shl-unknown ;;
    167173            sh3eb) machine=sh-unknown ;;
     174            sh5el) machine=sh5le-unknown ;;
    168175            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
    169176        esac
     
    204211        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    205212        echo "${machine}-${os}${release}"
    206         exit 0 ;;
    207     amiga:OpenBSD:*:*)
    208         echo m68k-unknown-openbsd${UNAME_RELEASE}
    209         exit 0 ;;
    210     arc:OpenBSD:*:*)
    211         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    212         exit 0 ;;
    213     hp300:OpenBSD:*:*)
    214         echo m68k-unknown-openbsd${UNAME_RELEASE}
    215         exit 0 ;;
    216     mac68k:OpenBSD:*:*)
    217         echo m68k-unknown-openbsd${UNAME_RELEASE}
    218         exit 0 ;;
    219     macppc:OpenBSD:*:*)
    220         echo powerpc-unknown-openbsd${UNAME_RELEASE}
    221         exit 0 ;;
    222     mvme68k:OpenBSD:*:*)
    223         echo m68k-unknown-openbsd${UNAME_RELEASE}
    224         exit 0 ;;
    225     mvme88k:OpenBSD:*:*)
    226         echo m88k-unknown-openbsd${UNAME_RELEASE}
    227         exit 0 ;;
    228     mvmeppc:OpenBSD:*:*)
    229         echo powerpc-unknown-openbsd${UNAME_RELEASE}
    230         exit 0 ;;
    231     pmax:OpenBSD:*:*)
    232         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    233         exit 0 ;;
    234     sgi:OpenBSD:*:*)
    235         echo mipseb-unknown-openbsd${UNAME_RELEASE}
    236         exit 0 ;;
    237     sun3:OpenBSD:*:*)
    238         echo m68k-unknown-openbsd${UNAME_RELEASE}
    239         exit 0 ;;
    240     wgrisc:OpenBSD:*:*)
    241         echo mipsel-unknown-openbsd${UNAME_RELEASE}
    242         exit 0 ;;
     213        exit ;;
    243214    *:OpenBSD:*:*)
    244         echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
    245         exit 0 ;;
     215        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
     216        echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
     217        exit ;;
     218    *:ekkoBSD:*:*)
     219        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
     220        exit ;;
     221    *:SolidBSD:*:*)
     222        echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
     223        exit ;;
     224    macppc:MirBSD:*:*)
     225        echo powerpc-unknown-mirbsd${UNAME_RELEASE}
     226        exit ;;
     227    *:MirBSD:*:*)
     228        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
     229        exit ;;
    246230    alpha:OSF1:*:*)
    247         if test $UNAME_RELEASE = "V4.0"; then
     231        case $UNAME_RELEASE in
     232        *4.0)
    248233                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    249         fi
     234                ;;
     235        *5.*)
     236                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
     237                ;;
     238        esac
    250239        # According to Compaq, /usr/sbin/psrinfo has been available on
    251240        # OSF/1 and Tru64 systems produced since 1995.  I hope that
     
    285274                UNAME_MACHINE="alphaev79" ;;
    286275        esac
     276        # A Pn.n version is a patched version.
    287277        # A Vn.n version is a released version.
    288278        # A Tn.n version is a released field test version.
    289279        # A Xn.n version is an unreleased experimental baselevel.
    290280        # 1.2 uses "1.2" for uname -r.
    291         echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    292         exit 0 ;;
    293     Alpha*:OpenVMS:*:*)
    294         echo alpha-hp-vms
    295         exit 0 ;;
     281        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     282        exit ;;
    296283    Alpha\ *:Windows_NT*:*)
    297284        # How do we know it's Interix rather than the generic POSIX subsystem?
     
    299286        # of the specific Alpha model?
    300287        echo alpha-pc-interix
    301         exit 0 ;;
     288        exit ;;
    302289    21064:Windows_NT:50:3)
    303290        echo alpha-dec-winnt3.5
    304         exit 0 ;;
     291        exit ;;
    305292    Amiga*:UNIX_System_V:4.0:*)
    306293        echo m68k-unknown-sysv4
    307         exit 0;;
     294        exit ;;
    308295    *:[Aa]miga[Oo][Ss]:*:*)
    309296        echo ${UNAME_MACHINE}-unknown-amigaos
    310         exit 0 ;;
     297        exit ;;
    311298    *:[Mm]orph[Oo][Ss]:*:*)
    312299        echo ${UNAME_MACHINE}-unknown-morphos
    313         exit 0 ;;
     300        exit ;;
    314301    *:OS/390:*:*)
    315302        echo i370-ibm-openedition
    316         exit 0 ;;
     303        exit ;;
     304    *:z/VM:*:*)
     305        echo s390-ibm-zvmoe
     306        exit ;;
     307    *:OS400:*:*)
     308        echo powerpc-ibm-os400
     309        exit ;;
    317310    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    318311        echo arm-acorn-riscix${UNAME_RELEASE}
    319         exit 0;;
     312        exit ;;
     313    arm:riscos:*:*|arm:RISCOS:*:*)
     314        echo arm-unknown-riscos
     315        exit ;;
    320316    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    321317        echo hppa1.1-hitachi-hiuxmpp
    322         exit 0;;
     318        exit ;;
    323319    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    324320        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
     
    328324                echo pyramid-pyramid-bsd
    329325        fi
    330         exit 0 ;;
     326        exit ;;
    331327    NILE*:*:*:dcosx)
    332328        echo pyramid-pyramid-svr4
    333         exit 0 ;;
     329        exit ;;
    334330    DRS?6000:unix:4.0:6*)
    335331        echo sparc-icl-nx6
    336         exit 0 ;;
    337     DRS?6000:UNIX_SV:4.2*:7*)
     332        exit ;;
     333    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
    338334        case `/usr/bin/uname -p` in
    339             sparc) echo sparc-icl-nx7 && exit 0 ;;
     335            sparc) echo sparc-icl-nx7; exit ;;
    340336        esac ;;
     337    s390x:SunOS:*:*)
     338        echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     339        exit ;;
    341340    sun4H:SunOS:5.*:*)
    342341        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    343         exit 0 ;;
     342        exit ;;
    344343    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    345344        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    346         exit 0 ;;
    347     i86pc:SunOS:5.*:*)
    348         echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    349         exit 0 ;;
     345        exit ;;
     346    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
     347        eval $set_cc_for_build
     348        SUN_ARCH="i386"
     349        # If there is a compiler, see if it is configured for 64-bit objects.
     350        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
     351        # This test works for both compilers.
     352        if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
     353            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
     354                (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
     355                grep IS_64BIT_ARCH >/dev/null
     356            then
     357                SUN_ARCH="x86_64"
     358            fi
     359        fi
     360        echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
     361        exit ;;
    350362    sun4*:SunOS:6*:*)
    351363        # According to config.sub, this is the proper way to canonicalize
     
    353365        # it's likely to be more like Solaris than SunOS4.
    354366        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    355         exit 0 ;;
     367        exit ;;
    356368    sun4*:SunOS:*:*)
    357369        case "`/usr/bin/arch -k`" in
     
    362374        # Japanese Language versions have a version number like `4.1.3-JL'.
    363375        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
    364         exit 0 ;;
     376        exit ;;
    365377    sun3*:SunOS:*:*)
    366378        echo m68k-sun-sunos${UNAME_RELEASE}
    367         exit 0 ;;
     379        exit ;;
    368380    sun*:*:4.2BSD:*)
    369381        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
     
    377389                ;;
    378390        esac
    379         exit 0 ;;
     391        exit ;;
    380392    aushp:SunOS:*:*)
    381393        echo sparc-auspex-sunos${UNAME_RELEASE}
    382         exit 0 ;;
     394        exit ;;
    383395    # The situation for MiNT is a little confusing.  The machine name
    384396    # can be virtually everything (everything which is not
     
    391403    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    392404        echo m68k-atari-mint${UNAME_RELEASE}
    393         exit 0 ;;
     405        exit ;;
    394406    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    395407        echo m68k-atari-mint${UNAME_RELEASE}
    396         exit 0 ;;
     408        exit ;;
    397409    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    398410        echo m68k-atari-mint${UNAME_RELEASE}
    399         exit 0 ;;
     411        exit ;;
    400412    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    401413        echo m68k-milan-mint${UNAME_RELEASE}
    402         exit 0 ;;
     414        exit ;;
    403415    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    404416        echo m68k-hades-mint${UNAME_RELEASE}
    405         exit 0 ;;
     417        exit ;;
    406418    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    407419        echo m68k-unknown-mint${UNAME_RELEASE}
    408         exit 0 ;;
     420        exit ;;
     421    m68k:machten:*:*)
     422        echo m68k-apple-machten${UNAME_RELEASE}
     423        exit ;;
    409424    powerpc:machten:*:*)
    410425        echo powerpc-apple-machten${UNAME_RELEASE}
    411         exit 0 ;;
     426        exit ;;
    412427    RISC*:Mach:*:*)
    413428        echo mips-dec-mach_bsd4.3
    414         exit 0 ;;
     429        exit ;;
    415430    RISC*:ULTRIX:*:*)
    416431        echo mips-dec-ultrix${UNAME_RELEASE}
    417         exit 0 ;;
     432        exit ;;
    418433    VAX*:ULTRIX*:*:*)
    419434        echo vax-dec-ultrix${UNAME_RELEASE}
    420         exit 0 ;;
     435        exit ;;
    421436    2020:CLIX:*:* | 2430:CLIX:*:*)
    422437        echo clipper-intergraph-clix${UNAME_RELEASE}
    423         exit 0 ;;
     438        exit ;;
    424439    mips:*:*:UMIPS | mips:*:*:RISCos)
    425440        eval $set_cc_for_build
     
    445460        }
    446461EOF
    447         $CC_FOR_BUILD -o $dummy $dummy.c \
    448           && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
    449           && exit 0
     462        $CC_FOR_BUILD -o $dummy $dummy.c &&
     463          dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
     464          SYSTEM_NAME=`$dummy $dummyarg` &&
     465            { echo "$SYSTEM_NAME"; exit; }
    450466        echo mips-mips-riscos${UNAME_RELEASE}
    451         exit 0 ;;
     467        exit ;;
    452468    Motorola:PowerMAX_OS:*:*)
    453469        echo powerpc-motorola-powermax
    454         exit 0 ;;
     470        exit ;;
    455471    Motorola:*:4.3:PL8-*)
    456472        echo powerpc-harris-powermax
    457         exit 0 ;;
     473        exit ;;
    458474    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
    459475        echo powerpc-harris-powermax
    460         exit 0 ;;
     476        exit ;;
    461477    Night_Hawk:Power_UNIX:*:*)
    462478        echo powerpc-harris-powerunix
    463         exit 0 ;;
     479        exit ;;
    464480    m88k:CX/UX:7*:*)
    465481        echo m88k-harris-cxux7
    466         exit 0 ;;
     482        exit ;;
    467483    m88k:*:4*:R4*)
    468484        echo m88k-motorola-sysv4
    469         exit 0 ;;
     485        exit ;;
    470486    m88k:*:3*:R3*)
    471487        echo m88k-motorola-sysv3
    472         exit 0 ;;
     488        exit ;;
    473489    AViiON:dgux:*:*)
    474490        # DG/UX returns AViiON for all architectures
     
    486502            echo i586-dg-dgux${UNAME_RELEASE}
    487503        fi
    488         exit 0 ;;
     504        exit ;;
    489505    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    490506        echo m88k-dolphin-sysv3
    491         exit 0 ;;
     507        exit ;;
    492508    M88*:*:R3*:*)
    493509        # Delta 88k system running SVR3
    494510        echo m88k-motorola-sysv3
    495         exit 0 ;;
     511        exit ;;
    496512    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    497513        echo m88k-tektronix-sysv3
    498         exit 0 ;;
     514        exit ;;
    499515    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    500516        echo m68k-tektronix-bsd
    501         exit 0 ;;
     517        exit ;;
    502518    *:IRIX*:*:*)
    503519        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
    504         exit 0 ;;
     520        exit ;;
    505521    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    506         echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
    507         exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
     522        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
     523        exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
    508524    i*86:AIX:*:*)
    509525        echo i386-ibm-aix
    510         exit 0 ;;
     526        exit ;;
    511527    ia64:AIX:*:*)
    512528        if [ -x /usr/bin/oslevel ] ; then
     
    516532        fi
    517533        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
    518         exit 0 ;;
     534        exit ;;
    519535    *:AIX:2:3)
    520536        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
     
    531547                        }
    532548EOF
    533                 $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
    534                 echo rs6000-ibm-aix3.2.5
     549                if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
     550                then
     551                        echo "$SYSTEM_NAME"
     552                else
     553                        echo rs6000-ibm-aix3.2.5
     554                fi
    535555        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    536556                echo rs6000-ibm-aix3.2.4
     
    538558                echo rs6000-ibm-aix3.2
    539559        fi
    540         exit 0 ;;
    541     *:AIX:*:[45])
     560        exit ;;
     561    *:AIX:*:[456])
    542562        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    543563        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
     
    552572        fi
    553573        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
    554         exit 0 ;;
     574        exit ;;
    555575    *:AIX:*:*)
    556576        echo rs6000-ibm-aix
    557         exit 0 ;;
     577        exit ;;
    558578    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
    559579        echo romp-ibm-bsd4.4
    560         exit 0 ;;
     580        exit ;;
    561581    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    562582        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
    563         exit 0 ;;                           # report: romp-ibm BSD 4.3
     583        exit ;;                             # report: romp-ibm BSD 4.3
    564584    *:BOSX:*:*)
    565585        echo rs6000-bull-bosx
    566         exit 0 ;;
     586        exit ;;
    567587    DPX/2?00:B.O.S.:*:*)
    568588        echo m68k-bull-sysv3
    569         exit 0 ;;
     589        exit ;;
    570590    9000/[34]??:4.3bsd:1.*:*)
    571591        echo m68k-hp-bsd
    572         exit 0 ;;
     592        exit ;;
    573593    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    574594        echo m68k-hp-bsd4.4
    575         exit 0 ;;
     595        exit ;;
    576596    9000/[34678]??:HP-UX:*:*)
    577597        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
     
    635655        if [ ${HP_ARCH} = "hppa2.0w" ]
    636656        then
    637             # avoid double evaluation of $set_cc_for_build
    638             test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
    639             if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
     657            eval $set_cc_for_build
     658
     659            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
     660            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
     661            # generating 64-bit code.  GNU and HP use different nomenclature:
     662            #
     663            # $ CC_FOR_BUILD=cc ./config.guess
     664            # => hppa2.0w-hp-hpux11.23
     665            # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
     666            # => hppa64-hp-hpux11.23
     667
     668            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
     669                grep __LP64__ >/dev/null
    640670            then
    641671                HP_ARCH="hppa2.0w"
     
    645675        fi
    646676        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
    647         exit 0 ;;
     677        exit ;;
    648678    ia64:HP-UX:*:*)
    649679        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    650680        echo ia64-hp-hpux${HPUX_REV}
    651         exit 0 ;;
     681        exit ;;
    652682    3050*:HI-UX:*:*)
    653683        eval $set_cc_for_build
     
    677707        }
    678708EOF
    679         $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
     709        $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
     710                { echo "$SYSTEM_NAME"; exit; }
    680711        echo unknown-hitachi-hiuxwe2
    681         exit 0 ;;
     712        exit ;;
    682713    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    683714        echo hppa1.1-hp-bsd
    684         exit 0 ;;
     715        exit ;;
    685716    9000/8??:4.3bsd:*:*)
    686717        echo hppa1.0-hp-bsd
    687         exit 0 ;;
     718        exit ;;
    688719    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
    689720        echo hppa1.0-hp-mpeix
    690         exit 0 ;;
     721        exit ;;
    691722    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
    692723        echo hppa1.1-hp-osf
    693         exit 0 ;;
     724        exit ;;
    694725    hp8??:OSF1:*:*)
    695726        echo hppa1.0-hp-osf
    696         exit 0 ;;
     727        exit ;;
    697728    i*86:OSF1:*:*)
    698729        if [ -x /usr/sbin/sysversion ] ; then
     
    701732            echo ${UNAME_MACHINE}-unknown-osf1
    702733        fi
    703         exit 0 ;;
     734        exit ;;
    704735    parisc*:Lites*:*:*)
    705736        echo hppa1.1-hp-lites
    706         exit 0 ;;
     737        exit ;;
    707738    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    708739        echo c1-convex-bsd
    709         exit 0 ;;
     740        exit ;;
    710741    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    711742        if getsysinfo -f scalar_acc
     
    713744        else echo c2-convex-bsd
    714745        fi
    715         exit 0 ;;
     746        exit ;;
    716747    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    717748        echo c34-convex-bsd
    718         exit 0 ;;
     749        exit ;;
    719750    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    720751        echo c38-convex-bsd
    721         exit 0 ;;
     752        exit ;;
    722753    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    723754        echo c4-convex-bsd
    724         exit 0 ;;
     755        exit ;;
    725756    CRAY*Y-MP:*:*:*)
    726757        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    727         exit 0 ;;
     758        exit ;;
    728759    CRAY*[A-Z]90:*:*:*)
    729760        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
     
    731762              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
    732763              -e 's/\.[^.]*$/.X/'
    733         exit 0 ;;
     764        exit ;;
    734765    CRAY*TS:*:*:*)
    735766        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    736         exit 0 ;;
     767        exit ;;
    737768    CRAY*T3E:*:*:*)
    738769        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    739         exit 0 ;;
     770        exit ;;
    740771    CRAY*SV1:*:*:*)
    741772        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    742         exit 0 ;;
     773        exit ;;
    743774    *:UNICOS/mp:*:*)
    744         echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    745         exit 0 ;;
     775        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
     776        exit ;;
    746777    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    747778        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     
    749780        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    750781        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    751         exit 0 ;;
     782        exit ;;
     783    5000:UNIX_System_V:4.*:*)
     784        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
     785        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
     786        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
     787        exit ;;
    752788    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    753789        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
    754         exit 0 ;;
     790        exit ;;
    755791    sparc*:BSD/OS:*:*)
    756792        echo sparc-unknown-bsdi${UNAME_RELEASE}
    757         exit 0 ;;
     793        exit ;;
    758794    *:BSD/OS:*:*)
    759795        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
    760         exit 0 ;;
    761     *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
    762         # Determine whether the default compiler uses glibc.
    763         eval $set_cc_for_build
    764         sed 's/^        //' << EOF >$dummy.c
    765         #include <features.h>
    766         #if __GLIBC__ >= 2
    767         LIBC=gnu
    768         #else
    769         LIBC=
    770         #endif
    771 EOF
    772         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    773         echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
    774         exit 0 ;;
     796        exit ;;
     797    *:FreeBSD:*:*)
     798        case ${UNAME_MACHINE} in
     799            pc98)
     800                echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     801            amd64)
     802                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     803            *)
     804                echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
     805        esac
     806        exit ;;
    775807    i*:CYGWIN*:*)
    776808        echo ${UNAME_MACHINE}-pc-cygwin
    777         exit 0 ;;
    778     i*:MINGW*:*)
     809        exit ;;
     810    *:MINGW*:*)
    779811        echo ${UNAME_MACHINE}-pc-mingw32
    780         exit 0 ;;
     812        exit ;;
     813    i*:windows32*:*)
     814        # uname -m includes "-pc" on this system.
     815        echo ${UNAME_MACHINE}-mingw32
     816        exit ;;
    781817    i*:PW*:*)
    782818        echo ${UNAME_MACHINE}-pc-pw32
    783         exit 0 ;;
    784     x86:Interix*:[34]*)
    785         echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
    786         exit 0 ;;
     819        exit ;;
     820    *:Interix*:[3456]*)
     821        case ${UNAME_MACHINE} in
     822            x86)
     823                echo i586-pc-interix${UNAME_RELEASE}
     824                exit ;;
     825            EM64T | authenticamd | genuineintel)
     826                echo x86_64-unknown-interix${UNAME_RELEASE}
     827                exit ;;
     828            IA64)
     829                echo ia64-unknown-interix${UNAME_RELEASE}
     830                exit ;;
     831        esac ;;
    787832    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    788833        echo i${UNAME_MACHINE}-pc-mks
    789         exit 0 ;;
     834        exit ;;
    790835    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    791836        # How do we know it's Interix rather than the generic POSIX subsystem?
     
    793838        # UNAME_MACHINE based on the output of uname instead of i386?
    794839        echo i586-pc-interix
    795         exit 0 ;;
     840        exit ;;
    796841    i*:UWIN*:*)
    797842        echo ${UNAME_MACHINE}-pc-uwin
    798         exit 0 ;;
     843        exit ;;
     844    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
     845        echo x86_64-unknown-cygwin
     846        exit ;;
    799847    p*:CYGWIN*:*)
    800848        echo powerpcle-unknown-cygwin
    801         exit 0 ;;
     849        exit ;;
    802850    prep*:SunOS:5.*:*)
    803851        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    804         exit 0 ;;
     852        exit ;;
    805853    *:GNU:*:*)
     854        # the GNU system
    806855        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    807         exit 0 ;;
     856        exit ;;
     857    *:GNU/*:*:*)
     858        # other systems with GNU libc and userland
     859        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
     860        exit ;;
    808861    i*86:Minix:*:*)
    809862        echo ${UNAME_MACHINE}-pc-minix
    810         exit 0 ;;
     863        exit ;;
    811864    arm*:Linux:*:*)
    812         echo ${UNAME_MACHINE}-unknown-linux-gnu
    813         exit 0 ;;
     865        eval $set_cc_for_build
     866        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
     867            | grep -q __ARM_EABI__
     868        then
     869            echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     870        else
     871            echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
     872        fi
     873        exit ;;
     874    avr32*:Linux:*:*)
     875        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     876        exit ;;
    814877    cris:Linux:*:*)
    815878        echo cris-axis-linux-gnu
    816         exit 0 ;;
     879        exit ;;
     880    crisv32:Linux:*:*)
     881        echo crisv32-axis-linux-gnu
     882        exit ;;
     883    frv:Linux:*:*)
     884        echo frv-${VENDOR}-linux-gnu
     885        exit ;;
    817886    ia64:Linux:*:*)
    818         echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
    819         exit 0 ;;
     887        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     888        exit ;;
     889    m32r*:Linux:*:*)
     890        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     891        exit ;;
    820892    m68*:Linux:*:*)
    821         echo ${UNAME_MACHINE}-unknown-linux-gnu
    822         exit 0 ;;
     893        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     894        exit ;;
    823895    mips:Linux:*:*)
    824896        eval $set_cc_for_build
     
    837909        #endif
    838910EOF
    839         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    840         test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
     911        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     912            /^CPU/{
     913                s: ::g
     914                p
     915            }'`"
     916        test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
    841917        ;;
    842918    mips64:Linux:*:*)
     
    856932        #endif
    857933EOF
    858         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    859         test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
     934        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     935            /^CPU/{
     936                s: ::g
     937                p
     938            }'`"
     939        test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
    860940        ;;
     941    or32:Linux:*:*)
     942        echo or32-${VENDOR}-linux-gnu
     943        exit ;;
    861944    ppc:Linux:*:*)
    862         echo powerpc-${VENDOR:-unknown}-linux-gnu
    863         exit 0 ;;
     945        echo powerpc-${VENDOR}-linux-gnu
     946        exit ;;
    864947    ppc64:Linux:*:*)
    865         echo powerpc64-${VENDOR:-unknown}-linux-gnu
    866         exit 0 ;;
     948        echo powerpc64-${VENDOR}-linux-gnu
     949        exit ;;
    867950    alpha:Linux:*:*)
    868951        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
     
    877960        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
    878961        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    879         echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
    880         exit 0 ;;
     962        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
     963        exit ;;
     964    padre:Linux:*:*)
     965        echo sparc-unknown-linux-gnu
     966        exit ;;
    881967    parisc:Linux:*:* | hppa:Linux:*:*)
    882968        # Look for CPU level
    883969        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    884           PA7*) echo hppa1.1-unknown-linux-gnu ;;
    885           PA8*) echo hppa2.0-unknown-linux-gnu ;;
    886           *)    echo hppa-unknown-linux-gnu ;;
     970          PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
     971          PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
     972          *)    echo hppa-${VENDOR}-linux-gnu ;;
    887973        esac
    888         exit 0 ;;
     974        exit ;;
    889975    parisc64:Linux:*:* | hppa64:Linux:*:*)
    890         echo hppa64-unknown-linux-gnu
    891         exit 0 ;;
     976        echo hppa64-${VENDOR}-linux-gnu
     977        exit ;;
    892978    s390:Linux:*:* | s390x:Linux:*:*)
    893         echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
    894         exit 0 ;;
     979        echo ${UNAME_MACHINE}-ibm-linux
     980        exit ;;
    895981    sh64*:Linux:*:*)
    896         echo ${UNAME_MACHINE}-unknown-linux-gnu
    897         exit 0 ;;
     982        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     983        exit ;;
    898984    sh*:Linux:*:*)
    899         echo ${UNAME_MACHINE}-unknown-linux-gnu
    900         exit 0 ;;
     985        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     986        exit ;;
    901987    sparc:Linux:*:* | sparc64:Linux:*:*)
    902         echo ${UNAME_MACHINE}-unknown-linux-gnu
    903         exit 0 ;;
     988        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     989        exit ;;
     990    vax:Linux:*:*)
     991        echo ${UNAME_MACHINE}-dec-linux-gnu
     992        exit ;;
    904993    x86_64:Linux:*:*)
    905         echo x86_64-${VENDOR:-unknown}-linux-gnu
    906         exit 0 ;;
     994        echo x86_64-${VENDOR}-linux-gnu
     995        exit ;;
     996    xtensa*:Linux:*:*)
     997        echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
     998        exit ;;
    907999    i*86:Linux:*:*)
    9081000        # The BFD linker knows what the default object file format is, so
     
    9181010        case "$ld_supported_targets" in
    9191011          elf32-i386)
    920                 TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
     1012                TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
    9211013                ;;
    9221014          a.out-i386-linux)
    923                 echo "${UNAME_MACHINE}-pc-linux-gnuaout"
    924                 exit 0 ;;
    925           coff-i386)
    926                 echo "${UNAME_MACHINE}-pc-linux-gnucoff"
    927                 exit 0 ;;
     1015                echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
     1016                exit ;;
    9281017          "")
    9291018                # Either a pre-BFD a.out linker (linux-gnuoldld) or
    9301019                # one that does not give us useful --help.
    931                 echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
    932                 exit 0 ;;
     1020                echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
     1021                exit ;;
    9331022        esac
    9341023        # Determine whether the default compiler is a.out or elf
     
    9471036        # endif
    9481037        #else
    949         #ifdef __INTEL_COMPILER
     1038        #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
    9501039        LIBC=gnu
    9511040        #else
     
    9531042        #endif
    9541043        #endif
     1044        #ifdef __dietlibc__
     1045        LIBC=dietlibc
     1046        #endif
    9551047EOF
    956         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    957         test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
    958         test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
     1048        eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
     1049            /^LIBC/{
     1050                s: ::g
     1051                p
     1052            }'`"
     1053        test x"${LIBC}" != x && {
     1054                echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
     1055                exit
     1056        }
     1057        test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
    9591058        ;;
    9601059    i*86:DYNIX/ptx:4*:*)
     
    9631062        # sysname and nodename.
    9641063        echo i386-sequent-sysv4
    965         exit 0 ;;
     1064        exit ;;
    9661065    i*86:UNIX_SV:4.2MP:2.*)
    9671066        # Unixware is an offshoot of SVR4, but it has its own version
     
    9711070        # Use sysv4.2uw... so that sysv4* matches it.
    9721071        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    973         exit 0 ;;
     1072        exit ;;
    9741073    i*86:OS/2:*:*)
    9751074        # If we were able to find `uname', then EMX Unix compatibility
    9761075        # is probably installed.
    9771076        echo ${UNAME_MACHINE}-pc-os2-emx
    978         exit 0 ;;
     1077        exit ;;
    9791078    i*86:XTS-300:*:STOP)
    980         echo ${UNAME_MACHINE}-unknown-stop
    981         exit 0 ;;
     1079        echo ${UNAME_MACHINE}-${VENDOR}-stop
     1080        exit ;;
    9821081    i*86:atheos:*:*)
    983         echo ${UNAME_MACHINE}-unknown-atheos
    984         exit 0 ;;
     1082        echo ${UNAME_MACHINE}-${VENDOR}-atheos
     1083        exit ;;
     1084    i*86:syllable:*:*)
     1085        echo ${UNAME_MACHINE}-pc-syllable
     1086        exit ;;
    9851087    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
    986         echo i386-unknown-lynxos${UNAME_RELEASE}
    987         exit 0 ;;
     1088        echo i386-${VENDOR}-lynxos${UNAME_RELEASE}
     1089        exit ;;
    9881090    i*86:*DOS:*:*)
    9891091        echo ${UNAME_MACHINE}-pc-msdosdjgpp
    990         exit 0 ;;
     1092        exit ;;
    9911093    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
    9921094        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
     
    9961098                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
    9971099        fi
    998         exit 0 ;;
    999     i*86:*:5:[78]*)
     1100        exit ;;
     1101    i*86:*:5:[678]*)
     1102        # UnixWare 7.x, OpenUNIX and OpenServer 6.
    10001103        case `/bin/uname -X | grep "^Machine"` in
    10011104            *486*)           UNAME_MACHINE=i486 ;;
     
    10031106            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
    10041107        esac
    1005         echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
    1006         exit 0 ;;
     1108        echo ${UNAME_MACHINE}-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
     1109        exit ;;
    10071110    i*86:*:3.2:*)
    10081111        if test -f /usr/options/cb.name; then
     
    10221125                echo ${UNAME_MACHINE}-pc-sysv32
    10231126        fi
    1024         exit 0 ;;
     1127        exit ;;
    10251128    pc:*:*:*)
    10261129        # Left here for compatibility:
    10271130        # uname -m prints for DJGPP always 'pc', but it prints nothing about
    1028         # the processor, so we play safe by assuming i386.
    1029         echo i386-pc-msdosdjgpp
    1030         exit 0 ;;
     1131        # the processor, so we play safe by assuming i586.
     1132        # Note: whatever this is, it MUST be the same as what config.sub
     1133        # prints for the "djgpp" host, or else GDB configury will decide that
     1134        # this is a cross-build.
     1135        echo i586-pc-msdosdjgpp
     1136        exit ;;
    10311137    Intel:Mach:3*:*)
    10321138        echo i386-pc-mach3
    1033         exit 0 ;;
     1139        exit ;;
    10341140    paragon:*:*:*)
    10351141        echo i860-intel-osf1
    1036         exit 0 ;;
     1142        exit ;;
    10371143    i860:*:4.*:*) # i860-SVR4
    10381144        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
    10391145          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
    10401146        else # Add other i860-SVR4 vendors below as they are discovered.
    1041           echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
    1042         fi
    1043         exit 0 ;;
     1147          echo i860-${VENDOR}-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
     1148        fi
     1149        exit ;;
    10441150    mini*:CTIX:SYS*5:*)
    10451151        # "miniframe"
    10461152        echo m68010-convergent-sysv
    1047         exit 0 ;;
     1153        exit ;;
    10481154    mc68k:UNIX:SYSTEM5:3.51m)
    10491155        echo m68k-convergent-sysv
    1050         exit 0 ;;
     1156        exit ;;
    10511157    M680?0:D-NIX:5.3:*)
    10521158        echo m68k-diab-dnix
    1053         exit 0 ;;
    1054     M68*:*:R3V[567]*:*)
    1055         test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    1056     3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
     1159        exit ;;
     1160    M68*:*:R3V[5678]*:*)
     1161        test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     1162    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
    10571163        OS_REL=''
    10581164        test -r /etc/.relid \
    10591165        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    10601166        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1061           && echo i486-ncr-sysv4.3${OS_REL} && exit 0
     1167          && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
    10621168        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1063           && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
     1169          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    10641170    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    10651171        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1066           && echo i486-ncr-sysv4 && exit 0 ;;
     1172          && { echo i486-ncr-sysv4; exit; } ;;
     1173    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
     1174        OS_REL='.3'
     1175        test -r /etc/.relid \
     1176            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
     1177        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
     1178            && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1179        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
     1180            && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
     1181        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
     1182            && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    10671183    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    1068         echo m68k-unknown-lynxos${UNAME_RELEASE}
    1069         exit 0 ;;
     1184        echo m68k-${VENDOR}-lynxos${UNAME_RELEASE}
     1185        exit ;;
    10701186    mc68030:UNIX_System_V:4.*:*)
    10711187        echo m68k-atari-sysv4
    1072         exit 0 ;;
     1188        exit ;;
    10731189    TSUNAMI:LynxOS:2.*:*)
    1074         echo sparc-unknown-lynxos${UNAME_RELEASE}
    1075         exit 0 ;;
     1190        echo sparc-${VENDOR}-lynxos${UNAME_RELEASE}
     1191        exit ;;
    10761192    rs6000:LynxOS:2.*:*)
    1077         echo rs6000-unknown-lynxos${UNAME_RELEASE}
    1078         exit 0 ;;
     1193        echo rs6000-${VENDOR}-lynxos${UNAME_RELEASE}
     1194        exit ;;
    10791195    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
    1080         echo powerpc-unknown-lynxos${UNAME_RELEASE}
    1081         exit 0 ;;
     1196        echo powerpc-${VENDOR}-lynxos${UNAME_RELEASE}
     1197        exit ;;
    10821198    SM[BE]S:UNIX_SV:*:*)
    10831199        echo mips-dde-sysv${UNAME_RELEASE}
    1084         exit 0 ;;
     1200        exit ;;
    10851201    RM*:ReliantUNIX-*:*:*)
    10861202        echo mips-sni-sysv4
    1087         exit 0 ;;
     1203        exit ;;
    10881204    RM*:SINIX-*:*:*)
    10891205        echo mips-sni-sysv4
    1090         exit 0 ;;
     1206        exit ;;
    10911207    *:SINIX-*:*:*)
    10921208        if uname -p 2>/dev/null >/dev/null ; then
     
    10961212                echo ns32k-sni-sysv
    10971213        fi
    1098         exit 0 ;;
     1214        exit ;;
    10991215    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    11001216                      # says <Richard.M.Bartel@ccMail.Census.GOV>
    11011217        echo i586-unisys-sysv4
    1102         exit 0 ;;
     1218        exit ;;
    11031219    *:UNIX_System_V:4*:FTX*)
    11041220        # From Gerald Hewes <hewes@openmarket.com>.
    11051221        # How about differentiating between stratus architectures? -djm
    11061222        echo hppa1.1-stratus-sysv4
    1107         exit 0 ;;
     1223        exit ;;
    11081224    *:*:*:FTX*)
    11091225        # From seanf@swdc.stratus.com.
    11101226        echo i860-stratus-sysv4
    1111         exit 0 ;;
     1227        exit ;;
     1228    i*86:VOS:*:*)
     1229        # From Paul.Green@stratus.com.
     1230        echo ${UNAME_MACHINE}-stratus-vos
     1231        exit ;;
    11121232    *:VOS:*:*)
    11131233        # From Paul.Green@stratus.com.
    11141234        echo hppa1.1-stratus-vos
    1115         exit 0 ;;
     1235        exit ;;
    11161236    mc68*:A/UX:*:*)
    11171237        echo m68k-apple-aux${UNAME_RELEASE}
    1118         exit 0 ;;
     1238        exit ;;
    11191239    news*:NEWS-OS:6*:*)
    11201240        echo mips-sony-newsos6
    1121         exit 0 ;;
     1241        exit ;;
    11221242    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    11231243        if [ -d /usr/nec ]; then
    11241244                echo mips-nec-sysv${UNAME_RELEASE}
    11251245        else
    1126                 echo mips-unknown-sysv${UNAME_RELEASE}
    1127         fi
    1128         exit 0 ;;
     1246                echo mips-${VENDOR}-sysv${UNAME_RELEASE}
     1247        fi
     1248        exit ;;
    11291249    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
    11301250        echo powerpc-be-beos
    1131         exit 0 ;;
     1251        exit ;;
    11321252    BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
    11331253        echo powerpc-apple-beos
    1134         exit 0 ;;
     1254        exit ;;
    11351255    BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
    11361256        echo i586-pc-beos
    1137         exit 0 ;;
     1257        exit ;;
     1258    BePC:Haiku:*:*)     # Haiku running on Intel PC compatible.
     1259        echo i586-pc-haiku
     1260        exit ;;
    11381261    SX-4:SUPER-UX:*:*)
    11391262        echo sx4-nec-superux${UNAME_RELEASE}
    1140         exit 0 ;;
     1263        exit ;;
    11411264    SX-5:SUPER-UX:*:*)
    11421265        echo sx5-nec-superux${UNAME_RELEASE}
    1143         exit 0 ;;
     1266        exit ;;
    11441267    SX-6:SUPER-UX:*:*)
    11451268        echo sx6-nec-superux${UNAME_RELEASE}
    1146         exit 0 ;;
     1269        exit ;;
     1270    SX-7:SUPER-UX:*:*)
     1271        echo sx7-nec-superux${UNAME_RELEASE}
     1272        exit ;;
     1273    SX-8:SUPER-UX:*:*)
     1274        echo sx8-nec-superux${UNAME_RELEASE}
     1275        exit ;;
     1276    SX-8R:SUPER-UX:*:*)
     1277        echo sx8r-nec-superux${UNAME_RELEASE}
     1278        exit ;;
    11471279    Power*:Rhapsody:*:*)
    11481280        echo powerpc-apple-rhapsody${UNAME_RELEASE}
    1149         exit 0 ;;
     1281        exit ;;
    11501282    *:Rhapsody:*:*)
    11511283        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
    1152         exit 0 ;;
     1284        exit ;;
    11531285    *:Darwin:*:*)
    1154         case `uname -p` in
    1155             *86) UNAME_PROCESSOR=i686 ;;
    1156             powerpc) UNAME_PROCESSOR=powerpc ;;
     1286        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
     1287        case $UNAME_PROCESSOR in
     1288            unknown) UNAME_PROCESSOR=powerpc ;;
    11571289        esac
    11581290        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
    1159         exit 0 ;;
     1291        exit ;;
    11601292    *:procnto*:*:* | *:QNX:[0123456789]*:*)
    11611293        UNAME_PROCESSOR=`uname -p`
     
    11651297        fi
    11661298        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
    1167         exit 0 ;;
     1299        exit ;;
    11681300    *:QNX:*:4*)
    11691301        echo i386-pc-qnx
    1170         exit 0 ;;
    1171     NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
     1302        exit ;;
     1303    NSE-?:NONSTOP_KERNEL:*:*)
     1304        echo nse-tandem-nsk${UNAME_RELEASE}
     1305        exit ;;
     1306    NSR-?:NONSTOP_KERNEL:*:*)
    11721307        echo nsr-tandem-nsk${UNAME_RELEASE}
    1173         exit 0 ;;
     1308        exit ;;
    11741309    *:NonStop-UX:*:*)
    11751310        echo mips-compaq-nonstopux
    1176         exit 0 ;;
     1311        exit ;;
    11771312    BS2000:POSIX*:*:*)
    11781313        echo bs2000-siemens-sysv
    1179         exit 0 ;;
     1314        exit ;;
    11801315    DS/*:UNIX_System_V:*:*)
    11811316        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
    1182         exit 0 ;;
     1317        exit ;;
    11831318    *:Plan9:*:*)
    11841319        # "uname -m" is not consistent, so use $cputype instead. 386
     
    11901325            UNAME_MACHINE="$cputype"
    11911326        fi
    1192         echo ${UNAME_MACHINE}-unknown-plan9
    1193         exit 0 ;;
     1327        echo ${UNAME_MACHINE}-${VENDOR}-plan9
     1328        exit ;;
    11941329    *:TOPS-10:*:*)
    1195         echo pdp10-unknown-tops10
    1196         exit 0 ;;
     1330        echo pdp10-${VENDOR}-tops10
     1331        exit ;;
    11971332    *:TENEX:*:*)
    1198         echo pdp10-unknown-tenex
    1199         exit 0 ;;
     1333        echo pdp10-${VENDOR}-tenex
     1334        exit ;;
    12001335    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
    12011336        echo pdp10-dec-tops20
    1202         exit 0 ;;
     1337        exit ;;
    12031338    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
    12041339        echo pdp10-xkl-tops20
    1205         exit 0 ;;
     1340        exit ;;
    12061341    *:TOPS-20:*:*)
    1207         echo pdp10-unknown-tops20
    1208         exit 0 ;;
     1342        echo pdp10-${VENDOR}-tops20
     1343        exit ;;
    12091344    *:ITS:*:*)
    1210         echo pdp10-unknown-its
    1211         exit 0 ;;
     1345        echo pdp10-${VENDOR}-its
     1346        exit ;;
    12121347    SEI:*:*:SEIUX)
    12131348        echo mips-sei-seiux${UNAME_RELEASE}
    1214         exit 0 ;;
     1349        exit ;;
     1350    *:DragonFly:*:*)
     1351        echo ${UNAME_MACHINE}-${VENDOR}-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
     1352        exit ;;
     1353    *:*VMS:*:*)
     1354        UNAME_MACHINE=`(uname -p) 2>/dev/null`
     1355        case "${UNAME_MACHINE}" in
     1356            A*) echo alpha-dec-vms ; exit ;;
     1357            I*) echo ia64-dec-vms ; exit ;;
     1358            V*) echo vax-dec-vms ; exit ;;
     1359        esac ;;
     1360    *:XENIX:*:SysV)
     1361        echo i386-pc-xenix
     1362        exit ;;
     1363    i*86:skyos:*:*)
     1364        echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
     1365        exit ;;
     1366    i*86:rdos:*:*)
     1367        echo ${UNAME_MACHINE}-pc-rdos
     1368        exit ;;
     1369    i*86:AROS:*:*)
     1370        echo ${UNAME_MACHINE}-pc-aros
     1371        exit ;;
    12151372esac
    12161373
     
    12441401
    12451402#if defined (__arm) && defined (__acorn) && defined (__unix)
    1246   printf ("arm-acorn-riscix"); exit (0);
     1403  printf ("arm-acorn-riscix\n"); exit (0);
    12471404#endif
    12481405
     
    13331490EOF
    13341491
    1335 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
     1492$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
     1493        { echo "$SYSTEM_NAME"; exit; }
    13361494
    13371495# Apollos put the system type in the environment.
    13381496
    1339 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
     1497test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
    13401498
    13411499# Convex versions that predate uname can use getsysinfo(1)
     
    13461504    c1*)
    13471505        echo c1-convex-bsd
    1348         exit 0 ;;
     1506        exit ;;
    13491507    c2*)
    13501508        if getsysinfo -f scalar_acc
     
    13521510        else echo c2-convex-bsd
    13531511        fi
    1354         exit 0 ;;
     1512        exit ;;
    13551513    c34*)
    13561514        echo c34-convex-bsd
    1357         exit 0 ;;
     1515        exit ;;
    13581516    c38*)
    13591517        echo c38-convex-bsd
    1360         exit 0 ;;
     1518        exit ;;
    13611519    c4*)
    13621520        echo c4-convex-bsd
    1363         exit 0 ;;
     1521        exit ;;
    13641522    esac
    13651523fi
     
    13721530download the most up to date version of the config scripts from
    13731531
    1374     ftp://ftp.gnu.org/pub/gnu/config/
     1532  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
     1533and
     1534  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
    13751535
    13761536If the version you run ($0) is already up to date, please
  • trunk/autoconf/config.sub

    r1 r106  
    22# Configuration validation subroutine script.
    33#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    5 
    6 timestamp='2003-06-18'
     4#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     5#   Free Software Foundation, Inc.
     6
     7timestamp='2009-04-17'
    78
    89# This file is (in principle) common to ALL GNU software.
     
    2223# You should have received a copy of the GNU General Public License
    2324# along with this program; if not, write to the Free Software
    24 # Foundation, Inc., 59 Temple Place - Suite 330,
    25 # Boston, MA 02111-1307, USA.
    26 
     25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
     26# 02110-1301, USA.
     27#
    2728# As a special exception to the GNU General Public License, if you
    2829# distribute this file as part of a program that contains a
    2930# configuration script generated by Autoconf, you may include it under
    3031# the same distribution terms that you use for the rest of that program.
     32
    3133
    3234# Please send patches to <config-patches@gnu.org>.  Submit a context
     
    7173GNU config.sub ($timestamp)
    7274
    73 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    74 Free Software Foundation, Inc.
     75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
     762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    7577
    7678This is free software; see the source for copying conditions.  There is NO
     
    8486  case $1 in
    8587    --time-stamp | --time* | -t )
    86        echo "$timestamp" ; exit 0 ;;
     88       echo "$timestamp" ; exit ;;
    8789    --version | -v )
    88        echo "$version" ; exit 0 ;;
     90       echo "$version" ; exit ;;
    8991    --help | --h* | -h )
    90        echo "$usage"; exit 0 ;;
     92       echo "$usage"; exit ;;
    9193    -- )     # Stop option processing
    9294       shift; break ;;
     
    100102       # First pass through any local machine types.
    101103       echo $1
    102        exit 0;;
     104       exit ;;
    103105
    104106    * )
     
    119121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    120122case $maybe_os in
    121   nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
     123  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
     124  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
     125  kopensolaris*-gnu* | \
     126  storm-chaos* | os2-emx* | rtmk-nova*)
    122127    os=-$maybe_os
    123128    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     
    145150        -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
    146151        -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
    147         -apple | -axis)
     152        -apple | -axis | -knuth | -cray)
    148153                os=
    149154                basic_machine=$1
     
    170175                os=-hiuxwe2
    171176                ;;
     177        -sco6)
     178                os=-sco5v6
     179                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     180                ;;
    172181        -sco5)
    173182                os=-sco3.2v5
     
    183192                ;;
    184193        -sco3.2v[4-9]*)
     194                # Don't forget version if it is 3.2v4 or newer.
     195                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     196                ;;
     197        -sco5v6*)
    185198                # Don't forget version if it is 3.2v4 or newer.
    186199                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
     
    229242        | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
    230243        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    231         | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
     244        | am33_2.0 \
     245        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
     246        | bfin \
    232247        | c4x | clipper \
    233248        | d10v | d30v | dlx | dsp16xx \
    234         | fr30 | frv \
     249        | fido | fr30 | frv \
    235250        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
    236251        | i370 | i860 | i960 | ia64 \
    237         | ip2k \
    238         | m32r | m68000 | m68k | m88k | mcore \
     252        | ip2k | iq2000 \
     253        | lm32 \
     254        | m32c | m32r | m32rle | m68000 | m68k | m88k \
     255        | maxq | mb | microblaze | mcore | mep | metag \
    239256        | mips | mipsbe | mipseb | mipsel | mipsle \
    240257        | mips16 \
    241258        | mips64 | mips64el \
     259        | mips64octeon | mips64octeonel \
     260        | mips64orion | mips64orionel \
     261        | mips64r5900 | mips64r5900el \
    242262        | mips64vr | mips64vrel \
    243         | mips64orion | mips64orionel \
    244263        | mips64vr4100 | mips64vr4100el \
    245264        | mips64vr4300 | mips64vr4300el \
    246265        | mips64vr5000 | mips64vr5000el \
     266        | mips64vr5900 | mips64vr5900el \
    247267        | mipsisa32 | mipsisa32el \
    248268        | mipsisa32r2 | mipsisa32r2el \
    249269        | mipsisa64 | mipsisa64el \
     270        | mipsisa64r2 | mipsisa64r2el \
    250271        | mipsisa64sb1 | mipsisa64sb1el \
    251272        | mipsisa64sr71k | mipsisa64sr71kel \
    252273        | mipstx39 | mipstx39el \
    253274        | mn10200 | mn10300 \
     275        | moxie \
     276        | mt \
    254277        | msp430 \
     278        | nios | nios2 \
    255279        | ns16k | ns32k \
    256         | openrisc | or32 \
     280        | or32 \
    257281        | pdp10 | pdp11 | pj | pjl \
    258282        | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
    259283        | pyramid \
    260         | s390 | s390x \
    261         | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
     284        | score \
     285        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
    262286        | sh64 | sh64le \
    263         | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
    264         | strongarm \
     287        | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
     288        | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
     289        | spu | strongarm \
    265290        | tahoe | thumb | tic4x | tic80 | tron \
    266291        | v850 | v850e \
    267292        | we32k \
    268         | x86 | xscale | xstormy16 | xtensa \
    269         | z8k)
     293        | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
     294        | z8k | z80)
    270295                basic_machine=$basic_machine-unknown
    271296                ;;
     
    276301                ;;
    277302        m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
     303                ;;
     304        ms1)
     305                basic_machine=mt-unknown
    278306                ;;
    279307
     
    296324        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
    297325        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    298         | avr-* \
    299         | bs2000-* \
     326        | avr-* | avr32-* \
     327        | bfin-* | bs2000-* \
    300328        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
    301         | clipper-* | cydra-* \
     329        | clipper-* | craynv-* | cydra-* \
    302330        | d10v-* | d30v-* | dlx-* \
    303331        | elxsi-* \
    304         | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
     332        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
    305333        | h8300-* | h8500-* \
    306334        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
    307335        | i*86-* | i860-* | i960-* | ia64-* \
    308         | ip2k-* \
    309         | m32r-* \
     336        | ip2k-* | iq2000-* \
     337        | lm32-* \
     338        | m32c-* | m32r-* | m32rle-* \
    310339        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
    311         | m88110-* | m88k-* | mcore-* \
     340        | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
    312341        | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
    313342        | mips16-* \
    314343        | mips64-* | mips64el-* \
     344        | mips64octeon-* | mips64octeonel-* \
     345        | mips64orion-* | mips64orionel-* \
     346        | mips64r5900-* | mips64r5900el-* \
    315347        | mips64vr-* | mips64vrel-* \
    316         | mips64orion-* | mips64orionel-* \
    317348        | mips64vr4100-* | mips64vr4100el-* \
    318349        | mips64vr4300-* | mips64vr4300el-* \
    319350        | mips64vr5000-* | mips64vr5000el-* \
     351        | mips64vr5900-* | mips64vr5900el-* \
    320352        | mipsisa32-* | mipsisa32el-* \
    321353        | mipsisa32r2-* | mipsisa32r2el-* \
    322354        | mipsisa64-* | mipsisa64el-* \
     355        | mipsisa64r2-* | mipsisa64r2el-* \
    323356        | mipsisa64sb1-* | mipsisa64sb1el-* \
    324357        | mipsisa64sr71k-* | mipsisa64sr71kel-* \
    325358        | mipstx39-* | mipstx39el-* \
     359        | mmix-* \
     360        | mt-* \
    326361        | msp430-* \
    327         | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
     362        | nios-* | nios2-* \
     363        | none-* | np1-* | ns16k-* | ns32k-* \
    328364        | orion-* \
    329365        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
     
    331367        | pyramid-* \
    332368        | romp-* | rs6000-* \
    333         | s390-* | s390x-* \
    334         | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
     369        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
    335370        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    336         | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
    337         | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
     371        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
     372        | sparclite-* \
     373        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
    338374        | tahoe-* | thumb-* \
    339         | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
     375        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
    340376        | tron-* \
    341377        | v850-* | v850e-* | vax-* \
    342378        | we32k-* \
    343         | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
    344         | xtensa-* \
     379        | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
     380        | xstormy16-* | xtensa*-* \
    345381        | ymp-* \
    346         | z8k-*)
     382        | z8k-* | z80-*)
     383                ;;
     384        # Recognize the basic CPU types without company name, with glob match.
     385        xtensa*)
     386                basic_machine=$basic_machine-unknown
    347387                ;;
    348388        # Recognize the various machine names and aliases which stand
     
    362402                os=-udi
    363403                ;;
     404        abacus)
     405                basic_machine=abacus-unknown
     406                ;;
    364407        adobe68k)
    365408                basic_machine=m68010-adobe
     
    379422                basic_machine=x86_64-pc
    380423                ;;
     424        amd64-*)
     425                basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
     426                ;;
    381427        amdahl)
    382428                basic_machine=580-amdahl
     
    402448                os=-bsd
    403449                ;;
     450        aros)
     451                basic_machine=i386-pc
     452                os=-aros
     453                ;;
    404454        aux)
    405455                basic_machine=m68k-apple
     
    410460                os=-dynix
    411461                ;;
     462        blackfin)
     463                basic_machine=bfin-unknown
     464                os=-linux
     465                ;;
     466        blackfin-*)
     467                basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
     468                os=-linux
     469                ;;
    412470        c90)
    413471                basic_machine=c90-cray
    414472                os=-unicos
    415473                ;;
     474        cegcc)
     475                basic_machine=arm-unknown
     476                os=-cegcc
     477                ;;
    416478        convex-c1)
    417479                basic_machine=c1-convex
     
    438500                os=-unicos
    439501                ;;
     502        craynv)
     503                basic_machine=craynv-cray
     504                os=-unicosmp
     505                ;;
     506        cr16)
     507                basic_machine=cr16-unknown
     508                os=-elf
     509                ;;
    440510        crds | unos)
    441511                basic_machine=m68k-crds
    442512                ;;
     513        crisv32 | crisv32-* | etraxfs*)
     514                basic_machine=crisv32-axis
     515                ;;
    443516        cris | cris-* | etrax*)
    444517                basic_machine=cris-axis
     518                ;;
     519        crx)
     520                basic_machine=crx-unknown
     521                os=-elf
    445522                ;;
    446523        da30 | da30-*)
     
    465542                basic_machine=m88k-motorola
    466543                os=-sysv3
     544                ;;
     545        dicos)
     546                basic_machine=i686-pc
     547                os=-dicos
     548                ;;
     549        djgpp)
     550                basic_machine=i586-pc
     551                os=-msdosdjgpp
    467552                ;;
    468553        dpx20 | dpx20-*)
     
    616701                os=-sysv
    617702                ;;
     703        m68knommu)
     704                basic_machine=m68k-unknown
     705                os=-linux
     706                ;;
     707        m68knommu-*)
     708                basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
     709                os=-linux
     710                ;;
    618711        m88k-omron*)
    619712                basic_machine=m88k-omron
     
    631724                os=-mingw32
    632725                ;;
     726        mingw32ce)
     727                basic_machine=arm-unknown
     728                os=-mingw32ce
     729                ;;
    633730        miniframe)
    634731                basic_machine=m68000-convergent
     
    644741                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
    645742                ;;
    646         mmix*)
    647                 basic_machine=mmix-knuth
    648                 os=-mmixware
    649                 ;;
    650743        monitor)
    651744                basic_machine=m68k-rom68k
     
    659752                basic_machine=i386-pc
    660753                os=-msdos
     754                ;;
     755        ms1-*)
     756                basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
    661757                ;;
    662758        mvs)
     
    728824                basic_machine=np1-gould
    729825                ;;
    730         nv1)
    731                 basic_machine=nv1-cray
    732                 os=-unicosmp
    733                 ;;
    734826        nsr-tandem)
    735827                basic_machine=nsr-tandem
     
    739831                os=-proelf
    740832                ;;
    741         or32 | or32-*)
     833        openrisc | openrisc-*)
    742834                basic_machine=or32-unknown
    743                 os=-coff
     835                ;;
     836        os400)
     837                basic_machine=powerpc-ibm
     838                os=-os400
    744839                ;;
    745840        OSE68000 | ose68000)
     
    759854                os=-osf
    760855                ;;
     856        parisc)
     857                basic_machine=hppa-unknown
     858                os=-linux
     859                ;;
     860        parisc-*)
     861                basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
     862                os=-linux
     863                ;;
    761864        pbd)
    762865                basic_machine=sparc-tti
     
    767870        pc532 | pc532-*)
    768871                basic_machine=ns32k-pc532
     872                ;;
     873        pc98)
     874                basic_machine=i386-pc
     875                ;;
     876        pc98-*)
     877                basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
    769878                ;;
    770879        pentium | p5 | k5 | k6 | nexgen | viac3)
     
    824933                os=-pw32
    825934                ;;
     935        rdos)
     936                basic_machine=i386-pc
     937                os=-rdos
     938                ;;
    826939        rom68k)
    827940                basic_machine=m68k-rom68k
     
    834947                basic_machine=romp-ibm
    835948                ;;
     949        s390 | s390-*)
     950                basic_machine=s390-ibm
     951                ;;
     952        s390x | s390x-*)
     953                basic_machine=s390x-ibm
     954                ;;
    836955        sa29200)
    837956                basic_machine=a29k-amd
     
    844963                basic_machine=mipsisa64sb1el-unknown
    845964                ;;
     965        sde)
     966                basic_machine=mipsisa32-sde
     967                os=-elf
     968                ;;
    846969        sei)
    847970                basic_machine=mips-sei
     
    855978                os=-hms
    856979                ;;
     980        sh5el)
     981                basic_machine=sh5le-unknown
     982                ;;
    857983        sh64)
    858984                basic_machine=sh64-unknown
     
    9441070                os=-coff
    9451071                ;;
     1072        tile*)
     1073                basic_machine=tile-unknown
     1074                os=-linux-gnu
     1075                ;;
    9461076        tx39)
    9471077                basic_machine=mipstx39-unknown
     
    9571087                basic_machine=m68k-ncr
    9581088                ;;
     1089        tpf)
     1090                basic_machine=s390x-ibm
     1091                os=-tpf
     1092                ;;
    9591093        udi29k)
    9601094                basic_machine=a29k-amd
     
    10001134                os=-proelf
    10011135                ;;
     1136        xbox)
     1137                basic_machine=i686-pc
     1138                os=-mingw32
     1139                ;;
    10021140        xps | xps100)
    10031141                basic_machine=xps100-honeywell
     
    10091147        z8k-*-coff)
    10101148                basic_machine=z8k-unknown
     1149                os=-sim
     1150                ;;
     1151        z80-*-coff)
     1152                basic_machine=z80-unknown
    10111153                os=-sim
    10121154                ;;
     
    10301172                basic_machine=romp-ibm
    10311173                ;;
     1174        mmix)
     1175                basic_machine=mmix-knuth
     1176                ;;
    10321177        rs6000)
    10331178                basic_machine=rs6000-ibm
     
    10461191                basic_machine=we32k-att
    10471192                ;;
    1048         sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
     1193        sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
    10491194                basic_machine=sh-unknown
    10501195                ;;
    1051         sh64)
    1052                 basic_machine=sh64-unknown
    1053                 ;;
    1054         sparc | sparcv8 | sparcv9 | sparcv9b)
     1196        sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
    10551197                basic_machine=sparc-sun
    10561198                ;;
     
    11211263              | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
    11221264              | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
     1265              | -kopensolaris* \
    11231266              | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
    1124               | -aos* \
     1267              | -aos* | -aros* \
    11251268              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
    11261269              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
    1127               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
    1128               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
     1270              | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
     1271              | -openbsd* | -solidbsd* \
     1272              | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
     1273              | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
    11291274              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
    11301275              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
    1131               | -chorusos* | -chorusrdb* \
     1276              | -chorusos* | -chorusrdb* | -cegcc* \
    11321277              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    1133               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
     1278              | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
     1279              | -uxpv* | -beos* | -mpeix* | -udk* \
    11341280              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    11351281              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
     
    11371283              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    11381284              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    1139               | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
     1285              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
     1286              | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
    11401287        # Remember, each alternative MUST END IN *, to match a version number.
    11411288                ;;
     
    11551302                ;;
    11561303        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
    1157               | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
     1304              | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
    11581305              | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
    11591306                ;;
     
    11611308                os=`echo $os | sed -e 's|mac|macos|'`
    11621309                ;;
     1310        -linux-dietlibc)
     1311                os=-linux-dietlibc
     1312                ;;
    11631313        -linux*)
    11641314                os=`echo $os | sed -e 's|linux|linux-gnu|'`
     
    11731323                os=-openedition
    11741324                ;;
     1325        -os400*)
     1326                os=-os400
     1327                ;;
    11751328        -wince*)
    11761329                os=-wince
     
    11931346        -atheos*)
    11941347                os=-atheos
     1348                ;;
     1349        -syllable*)
     1350                os=-syllable
    11951351                ;;
    11961352        -386bsd)
     
    12161372                os=-sysv4
    12171373                ;;
     1374        -tpf*)
     1375                os=-tpf
     1376                ;;
    12181377        -triton*)
    12191378                os=-sysv3
     
    12511410        -kaos*)
    12521411                os=-kaos
     1412                ;;
     1413        -zvmoe)
     1414                os=-zvmoe
     1415                ;;
     1416        -dicos*)
     1417                os=-dicos
    12531418                ;;
    12541419        -none)
     
    12741439
    12751440case $basic_machine in
     1441        score-*)
     1442                os=-elf
     1443                ;;
     1444        spu-*)
     1445                os=-elf
     1446                ;;
    12761447        *-acorn)
    12771448                os=-riscix1.2
     
    12831454                os=-aout
    12841455                ;;
    1285         c4x-* | tic4x-*)
    1286                 os=-coff
     1456        c4x-* | tic4x-*)
     1457                os=-coff
    12871458                ;;
    12881459        # This must come before the *-dec entry.
     
    13111482                os=-aout
    13121483                ;;
     1484        mep-*)
     1485                os=-elf
     1486                ;;
    13131487        mips*-cisco)
    13141488                os=-elf
     
    13291503                os=-beos
    13301504                ;;
     1505        *-haiku)
     1506                os=-haiku
     1507                ;;
    13311508        *-ibm)
    13321509                os=-aix
     1510                ;;
     1511        *-knuth)
     1512                os=-mmixware
    13331513                ;;
    13341514        *-wec)
     
    14641644                                vendor=ibm
    14651645                                ;;
     1646                        -os400*)
     1647                                vendor=ibm
     1648                                ;;
    14661649                        -ptx*)
    14671650                                vendor=sequent
    14681651                                ;;
     1652                        -tpf*)
     1653                                vendor=ibm
     1654                                ;;
    14691655                        -vxsim* | -vxworks* | -windiss*)
    14701656                                vendor=wrs
     
    14911677
    14921678echo $basic_machine$os
    1493 exit 0
     1679exit
    14941680
    14951681# Local variables:
  • trunk/autoconf/depcomp

    r1 r106  
    22# depcomp - compile a program generating dependencies as side-effects
    33
    4 scriptversion=2005-07-09.11
    5 
    6 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
     4scriptversion=2009-04-28.21; # UTC
     5
     6# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
     7# Software Foundation, Inc.
    78
    89# This program is free software; you can redistribute it and/or modify
     
    1718
    1819# You should have received a copy of the GNU General Public License
    19 # along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    21 # 02110-1301, USA.
     20# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2221
    2322# As a special exception to the GNU General Public License, if you
     
    8786fi
    8887
     88cygpath_u="cygpath -u -f -"
     89if test "$depmode" = msvcmsys; then
     90   # This is just like msvisualcpp but w/o cygpath translation.
     91   # Just convert the backslash-escaped backslashes to single forward
     92   # slashes to satisfy depend.m4
     93   cygpath_u="sed s,\\\\\\\\,/,g"
     94   depmode=msvisualcpp
     95fi
     96
    8997case "$depmode" in
    9098gcc3)
     
    92100## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
    93101## it if -MD -MP comes after the -MF stuff.  Hmm.
    94   "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
     102## Unfortunately, FreeBSD c89 acceptance of flags depends upon
     103## the command line argument order; so add the flags where they
     104## appear in depend2.am.  Note that the slowdown incurred here
     105## affects only configure: in makefiles, %FASTDEP% shortcuts this.
     106  for arg
     107  do
     108    case $arg in
     109    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
     110    *)  set fnord "$@" "$arg" ;;
     111    esac
     112    shift # fnord
     113    shift # $arg
     114  done
     115  "$@"
    95116  stat=$?
    96117  if test $stat -eq 0; then :
     
    179200    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
    180201    tr '
    181 ' ' ' >> $depfile
    182     echo >> $depfile
     202' ' ' >> "$depfile"
     203    echo >> "$depfile"
    183204
    184205    # The second pass generates a dummy entry for each header file.
     
    186207' < "$tmpdepfile" \
    187208   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
    188    >> $depfile
     209   >> "$depfile"
    189210  else
    190211    # The sourcefile does not contain any dependencies, so just
     
    202223  # start of each line; $object doesn't have directory information.
    203224  # Version 6 uses the directory in both cases.
    204   stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
    205   tmpdepfile="$stripped.u"
     225  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
     226  test "x$dir" = "x$object" && dir=
     227  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
    206228  if test "$libtool" = yes; then
     229    tmpdepfile1=$dir$base.u
     230    tmpdepfile2=$base.u
     231    tmpdepfile3=$dir.libs/$base.u
    207232    "$@" -Wc,-M
    208233  else
     234    tmpdepfile1=$dir$base.u
     235    tmpdepfile2=$dir$base.u
     236    tmpdepfile3=$dir$base.u
    209237    "$@" -M
    210238  fi
    211239  stat=$?
    212240
    213   if test -f "$tmpdepfile"; then :
    214   else
    215     stripped=`echo "$stripped" | sed 's,^.*/,,'`
    216     tmpdepfile="$stripped.u"
    217   fi
    218 
    219241  if test $stat -eq 0; then :
    220242  else
    221     rm -f "$tmpdepfile"
     243    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
    222244    exit $stat
    223245  fi
    224246
     247  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     248  do
     249    test -f "$tmpdepfile" && break
     250  done
    225251  if test -f "$tmpdepfile"; then
    226     outname="$stripped.o"
    227252    # Each line is of the form `foo.o: dependent.h'.
    228253    # Do two passes, one to just change these to
    229254    # `$object: dependent.h' and one to simply `dependent.h:'.
    230     sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
    231     sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
     255    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
     256    # That's a tab and a space in the [].
     257    sed -e 's,^.*\.[a-z]*:[      ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
    232258  else
    233259    # The sourcefile does not contain any dependencies, so just
     
    277303  ;;
    278304
     305hp2)
     306  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
     307  # compilers, which have integrated preprocessors.  The correct option
     308  # to use with these is +Maked; it writes dependencies to a file named
     309  # 'foo.d', which lands next to the object file, wherever that
     310  # happens to be.
     311  # Much of this is similar to the tru64 case; see comments there.
     312  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
     313  test "x$dir" = "x$object" && dir=
     314  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
     315  if test "$libtool" = yes; then
     316    tmpdepfile1=$dir$base.d
     317    tmpdepfile2=$dir.libs/$base.d
     318    "$@" -Wc,+Maked
     319  else
     320    tmpdepfile1=$dir$base.d
     321    tmpdepfile2=$dir$base.d
     322    "$@" +Maked
     323  fi
     324  stat=$?
     325  if test $stat -eq 0; then :
     326  else
     327     rm -f "$tmpdepfile1" "$tmpdepfile2"
     328     exit $stat
     329  fi
     330
     331  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
     332  do
     333    test -f "$tmpdepfile" && break
     334  done
     335  if test -f "$tmpdepfile"; then
     336    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
     337    # Add `dependent.h:' lines.
     338    sed -ne '2,${
     339               s/^ *//
     340               s/ \\*$//
     341               s/$/:/
     342               p
     343             }' "$tmpdepfile" >> "$depfile"
     344  else
     345    echo "#dummy" > "$depfile"
     346  fi
     347  rm -f "$tmpdepfile" "$tmpdepfile2"
     348  ;;
     349
    279350tru64)
    280351   # The Tru64 compiler uses -MD to generate dependencies as a side
     
    289360   if test "$libtool" = yes; then
    290361      # With Tru64 cc, shared objects can also be used to make a
    291       # static library.  This mecanism is used in libtool 1.4 series to
     362      # static library.  This mechanism is used in libtool 1.4 series to
    292363      # handle both shared and static libraries in a single compilation.
    293364      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
     
    295366      # With libtool 1.5 this exception was removed, and libtool now
    296367      # generates 2 separate objects for the 2 libraries.  These two
    297       # compilations output dependencies in in $dir.libs/$base.o.d and
     368      # compilations output dependencies in $dir.libs/$base.o.d and
    298369      # in $dir$base.o.d.  We have to check for both files, because
    299370      # one of the two compilations can be disabled.  We should prefer
     
    346417  # Remove the call to Libtool.
    347418  if test "$libtool" = yes; then
    348     while test $1 != '--mode=compile'; do
     419    while test "X$1" != 'X--mode=compile'; do
    349420      shift
    350421    done
     
    397468  # Remove any Libtool call
    398469  if test "$libtool" = yes; then
    399     while test $1 != '--mode=compile'; do
     470    while test "X$1" != 'X--mode=compile'; do
    400471      shift
    401472    done
     
    404475  # X makedepend
    405476  shift
    406   cleared=no
    407   for arg in "$@"; do
     477  cleared=no eat=no
     478  for arg
     479  do
    408480    case $cleared in
    409481    no)
     
    411483      cleared=yes ;;
    412484    esac
     485    if test $eat = yes; then
     486      eat=no
     487      continue
     488    fi
    413489    case "$arg" in
    414490    -D*|-I*)
     
    416492    # Strip any option that makedepend may not understand.  Remove
    417493    # the object too, otherwise makedepend will parse it as a source file.
     494    -arch)
     495      eat=yes ;;
    418496    -*|$object)
    419497      ;;
     
    422500    esac
    423501  done
    424   obj_suffix="`echo $object | sed 's/^.*\././'`"
     502  obj_suffix=`echo "$object" | sed 's/^.*\././'`
    425503  touch "$tmpdepfile"
    426504  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
     
    442520  # Remove the call to Libtool.
    443521  if test "$libtool" = yes; then
    444     while test $1 != '--mode=compile'; do
     522    while test "X$1" != 'X--mode=compile'; do
    445523      shift
    446524    done
     
    480558msvisualcpp)
    481559  # Important note: in order to support this mode, a compiler *must*
    482   # always write the preprocessed file to stdout, regardless of -o,
    483   # because we must use -o when running libtool.
     560  # always write the preprocessed file to stdout.
    484561  "$@" || exit $?
     562
     563  # Remove the call to Libtool.
     564  if test "$libtool" = yes; then
     565    while test "X$1" != 'X--mode=compile'; do
     566      shift
     567    done
     568    shift
     569  fi
     570
    485571  IFS=" "
    486572  for arg
    487573  do
    488574    case "$arg" in
     575    -o)
     576      shift
     577      ;;
     578    $object)
     579      shift
     580      ;;
    489581    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
    490582        set fnord "$@"
     
    499591    esac
    500592  done
    501   "$@" -E |
    502   sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
     593  "$@" -E 2>/dev/null |
     594  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
    503595  rm -f "$depfile"
    504596  echo "$object : \\" > "$depfile"
    505   . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::    \1 \\:p' >> "$depfile"
     597  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::      \1 \\:p' >> "$depfile"
    506598  echo "        " >> "$depfile"
    507   . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
     599  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
    508600  rm -f "$tmpdepfile"
     601  ;;
     602
     603msvcmsys)
     604  # This case exists only to let depend.m4 do its work.  It works by
     605  # looking at the text of this script.  This case will never be run,
     606  # since it is checked for above.
     607  exit 1
    509608  ;;
    510609
     
    527626# time-stamp-start: "scriptversion="
    528627# time-stamp-format: "%:y-%02m-%02d.%02H"
    529 # time-stamp-end: "$"
     628# time-stamp-time-zone: "UTC"
     629# time-stamp-end: "; # UTC"
    530630# End:
  • trunk/autoconf/install-sh

    r1 r106  
    22# install - install a program, script, or datafile
    33
    4 scriptversion=2005-05-14.22
     4scriptversion=2009-04-28.21; # UTC
    55
    66# This originates from X11R5 (mit/util/scripts/install.sh), which was
     
    4040#
    4141# This script is compatible with the BSD install script, but was written
    42 # from scratch.  It can only install one file at a time, a restriction
    43 # shared with many OS's install programs.
     42# from scratch.
     43
     44nl='
     45'
     46IFS=" ""        $nl"
    4447
    4548# set DOITPROG to echo to test this script
    4649
    4750# Don't use :- since 4.3BSD and earlier shells don't like it.
    48 doit="${DOITPROG-}"
    49 
    50 # put in absolute paths if you don't have them in your path; or use env. vars.
    51 
    52 mvprog="${MVPROG-mv}"
    53 cpprog="${CPPROG-cp}"
    54 chmodprog="${CHMODPROG-chmod}"
    55 chownprog="${CHOWNPROG-chown}"
    56 chgrpprog="${CHGRPPROG-chgrp}"
    57 stripprog="${STRIPPROG-strip}"
    58 rmprog="${RMPROG-rm}"
    59 mkdirprog="${MKDIRPROG-mkdir}"
    60 
    61 chmodcmd="$chmodprog 0755"
     51doit=${DOITPROG-}
     52if test -z "$doit"; then
     53  doit_exec=exec
     54else
     55  doit_exec=$doit
     56fi
     57
     58# Put in absolute file names if you don't have them in your path;
     59# or use environment vars.
     60
     61chgrpprog=${CHGRPPROG-chgrp}
     62chmodprog=${CHMODPROG-chmod}
     63chownprog=${CHOWNPROG-chown}
     64cmpprog=${CMPPROG-cmp}
     65cpprog=${CPPROG-cp}
     66mkdirprog=${MKDIRPROG-mkdir}
     67mvprog=${MVPROG-mv}
     68rmprog=${RMPROG-rm}
     69stripprog=${STRIPPROG-strip}
     70
     71posix_glob='?'
     72initialize_posix_glob='
     73  test "$posix_glob" != "?" || {
     74    if (set -f) 2>/dev/null; then
     75      posix_glob=
     76    else
     77      posix_glob=:
     78    fi
     79  }
     80'
     81
     82posix_mkdir=
     83
     84# Desired mode of installed file.
     85mode=0755
     86
     87chgrpcmd=
     88chmodcmd=$chmodprog
    6289chowncmd=
    63 chgrpcmd=
     90mvcmd=$mvprog
     91rmcmd="$rmprog -f"
    6492stripcmd=
    65 rmcmd="$rmprog -f"
    66 mvcmd="$mvprog"
     93
    6794src=
    6895dst=
    6996dir_arg=
    70 dstarg=
     97dst_arg=
     98
     99copy_on_change=false
    71100no_target_directory=
    72101
    73 usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
     102usage="\
     103Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    74104   or: $0 [OPTION]... SRCFILES... DIRECTORY
    75105   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
     
    81111
    82112Options:
    83 -c         (ignored)
    84 -d         create directories instead of installing files.
    85 -g GROUP   $chgrpprog installed files to GROUP.
    86 -m MODE    $chmodprog installed files to MODE.
    87 -o USER    $chownprog installed files to USER.
    88 -s         $stripprog installed files.
    89 -t DIRECTORY  install into DIRECTORY.
    90 -T         report an error if DSTFILE is a directory.
    91 --help     display this help and exit.
    92 --version  display version info and exit.
     113     --help     display this help and exit.
     114     --version  display version info and exit.
     115
     116  -c            (ignored)
     117  -C            install only if different (preserve the last data modification time)
     118  -d            create directories instead of installing files.
     119  -g GROUP      $chgrpprog installed files to GROUP.
     120  -m MODE       $chmodprog installed files to MODE.
     121  -o USER       $chownprog installed files to USER.
     122  -s            $stripprog installed files.
     123  -t DIRECTORY  install into DIRECTORY.
     124  -T            report an error if DSTFILE is a directory.
    93125
    94126Environment variables override the default commands:
    95   CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
     127  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
     128  RMPROG STRIPPROG
    96129"
    97130
    98 while test -n "$1"; do
     131while test $# -ne 0; do
    99132  case $1 in
    100     -c) shift
    101         continue;;
    102 
    103     -d) dir_arg=true
    104         shift
    105         continue;;
     133    -c) ;;
     134
     135    -C) copy_on_change=true;;
     136
     137    -d) dir_arg=true;;
    106138
    107139    -g) chgrpcmd="$chgrpprog $2"
    108         shift
    109         shift
    110         continue;;
     140        shift;;
    111141
    112142    --help) echo "$usage"; exit $?;;
    113143
    114     -m) chmodcmd="$chmodprog $2"
    115         shift
    116         shift
    117         continue;;
     144    -m) mode=$2
     145        case $mode in
     146          *' '* | *'    '* | *'
     147'*        | *'*'* | *'?'* | *'['*)
     148            echo "$0: invalid mode: $mode" >&2
     149            exit 1;;
     150        esac
     151        shift;;
    118152
    119153    -o) chowncmd="$chownprog $2"
    120         shift
    121         shift
    122         continue;;
    123 
    124     -s) stripcmd=$stripprog
    125         shift
    126         continue;;
    127 
    128     -t) dstarg=$2
    129         shift
    130         shift
    131         continue;;
    132 
    133     -T) no_target_directory=true
    134         shift
    135         continue;;
     154        shift;;
     155
     156    -s) stripcmd=$stripprog;;
     157
     158    -t) dst_arg=$2
     159        shift;;
     160
     161    -T) no_target_directory=true;;
    136162
    137163    --version) echo "$0 $scriptversion"; exit $?;;
    138164
    139     *)  # When -d is used, all remaining arguments are directories to create.
    140         # When -t is used, the destination is already specified.
    141         test -n "$dir_arg$dstarg" && break
    142         # Otherwise, the last argument is the destination.  Remove it from $@.
    143         for arg
    144         do
    145           if test -n "$dstarg"; then
    146             # $@ is not empty: it contains at least $arg.
    147             set fnord "$@" "$dstarg"
    148             shift # fnord
    149           fi
    150           shift # arg
    151           dstarg=$arg
    152         done
     165    --) shift
    153166        break;;
     167
     168    -*) echo "$0: invalid option: $1" >&2
     169        exit 1;;
     170
     171    *)  break;;
    154172  esac
     173  shift
    155174done
    156175
    157 if test -z "$1"; then
     176if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     177  # When -d is used, all remaining arguments are directories to create.
     178  # When -t is used, the destination is already specified.
     179  # Otherwise, the last argument is the destination.  Remove it from $@.
     180  for arg
     181  do
     182    if test -n "$dst_arg"; then
     183      # $@ is not empty: it contains at least $arg.
     184      set fnord "$@" "$dst_arg"
     185      shift # fnord
     186    fi
     187    shift # arg
     188    dst_arg=$arg
     189  done
     190fi
     191
     192if test $# -eq 0; then
    158193  if test -z "$dir_arg"; then
    159194    echo "$0: no input file specified." >&2
     
    165200fi
    166201
     202if test -z "$dir_arg"; then
     203  trap '(exit $?); exit' 1 2 13 15
     204
     205  # Set umask so as not to create temps with too-generous modes.
     206  # However, 'strip' requires both read and write access to temps.
     207  case $mode in
     208    # Optimize common cases.
     209    *644) cp_umask=133;;
     210    *755) cp_umask=22;;
     211
     212    *[0-7])
     213      if test -z "$stripcmd"; then
     214        u_plus_rw=
     215      else
     216        u_plus_rw='% 200'
     217      fi
     218      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
     219    *)
     220      if test -z "$stripcmd"; then
     221        u_plus_rw=
     222      else
     223        u_plus_rw=,u+rw
     224      fi
     225      cp_umask=$mode$u_plus_rw;;
     226  esac
     227fi
     228
    167229for src
    168230do
    169231  # Protect names starting with `-'.
    170232  case $src in
    171     -*) src=./$src ;;
     233    -*) src=./$src;;
    172234  esac
    173235
    174236  if test -n "$dir_arg"; then
    175237    dst=$src
    176     src=
    177 
    178     if test -d "$dst"; then
    179       mkdircmd=:
    180       chmodcmd=
    181     else
    182       mkdircmd=$mkdirprog
    183     fi
     238    dstdir=$dst
     239    test -d "$dstdir"
     240    dstdir_status=$?
    184241  else
     242
    185243    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
    186244    # might cause directories to be created, which would be especially bad
     
    191249    fi
    192250
    193     if test -z "$dstarg"; then
     251    if test -z "$dst_arg"; then
    194252      echo "$0: no destination specified." >&2
    195253      exit 1
    196254    fi
    197255
    198     dst=$dstarg
     256    dst=$dst_arg
    199257    # Protect names starting with `-'.
    200258    case $dst in
    201       -*) dst=./$dst ;;
     259      -*) dst=./$dst;;
    202260    esac
    203261
     
    206264    if test -d "$dst"; then
    207265      if test -n "$no_target_directory"; then
    208         echo "$0: $dstarg: Is a directory" >&2
     266        echo "$0: $dst_arg: Is a directory" >&2
    209267        exit 1
    210268      fi
    211       dst=$dst/`basename "$src"`
     269      dstdir=$dst
     270      dst=$dstdir/`basename "$src"`
     271      dstdir_status=0
     272    else
     273      # Prefer dirname, but fall back on a substitute if dirname fails.
     274      dstdir=`
     275        (dirname "$dst") 2>/dev/null ||
     276        expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
     277             X"$dst" : 'X\(//\)[^/]' \| \
     278             X"$dst" : 'X\(//\)$' \| \
     279             X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
     280        echo X"$dst" |
     281            sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
     282                   s//\1/
     283                   q
     284                 }
     285                 /^X\(\/\/\)[^/].*/{
     286                   s//\1/
     287                   q
     288                 }
     289                 /^X\(\/\/\)$/{
     290                   s//\1/
     291                   q
     292                 }
     293                 /^X\(\/\).*/{
     294                   s//\1/
     295                   q
     296                 }
     297                 s/.*/./; q'
     298      `
     299
     300      test -d "$dstdir"
     301      dstdir_status=$?
    212302    fi
    213303  fi
    214304
    215   # This sed command emulates the dirname command.
    216   dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
    217 
    218   # Make sure that the destination directory exists.
    219 
    220   # Skip lots of stat calls in the usual case.
    221   if test ! -d "$dstdir"; then
    222     defaultIFS='
    223          '
    224     IFS="${IFS-$defaultIFS}"
    225 
    226     oIFS=$IFS
    227     # Some sh's can't handle IFS=/ for some reason.
    228     IFS='%'
    229     set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
    230     shift
    231     IFS=$oIFS
    232 
    233     pathcomp=
    234 
    235     while test $# -ne 0 ; do
    236       pathcomp=$pathcomp$1
     305  obsolete_mkdir_used=false
     306
     307  if test $dstdir_status != 0; then
     308    case $posix_mkdir in
     309      '')
     310        # Create intermediate dirs using mode 755 as modified by the umask.
     311        # This is like FreeBSD 'install' as of 1997-10-28.
     312        umask=`umask`
     313        case $stripcmd.$umask in
     314          # Optimize common cases.
     315          *[2367][2367]) mkdir_umask=$umask;;
     316          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
     317
     318          *[0-7])
     319            mkdir_umask=`expr $umask + 22 \
     320              - $umask % 100 % 40 + $umask % 20 \
     321              - $umask % 10 % 4 + $umask % 2
     322            `;;
     323          *) mkdir_umask=$umask,go-w;;
     324        esac
     325
     326        # With -d, create the new directory with the user-specified mode.
     327        # Otherwise, rely on $mkdir_umask.
     328        if test -n "$dir_arg"; then
     329          mkdir_mode=-m$mode
     330        else
     331          mkdir_mode=
     332        fi
     333
     334        posix_mkdir=false
     335        case $umask in
     336          *[123567][0-7][0-7])
     337            # POSIX mkdir -p sets u+wx bits regardless of umask, which
     338            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
     339            ;;
     340          *)
     341            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
     342            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
     343
     344            if (umask $mkdir_umask &&
     345                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
     346            then
     347              if test -z "$dir_arg" || {
     348                   # Check for POSIX incompatibilities with -m.
     349                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
     350                   # other-writeable bit of parent directory when it shouldn't.
     351                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
     352                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
     353                   case $ls_ld_tmpdir in
     354                     d????-?r-*) different_mode=700;;
     355                     d????-?--*) different_mode=755;;
     356                     *) false;;
     357                   esac &&
     358                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
     359                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
     360                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
     361                   }
     362                 }
     363              then posix_mkdir=:
     364              fi
     365              rmdir "$tmpdir/d" "$tmpdir"
     366            else
     367              # Remove any dirs left behind by ancient mkdir implementations.
     368              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
     369            fi
     370            trap '' 0;;
     371        esac;;
     372    esac
     373
     374    if
     375      $posix_mkdir && (
     376        umask $mkdir_umask &&
     377        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
     378      )
     379    then :
     380    else
     381
     382      # The umask is ridiculous, or mkdir does not conform to POSIX,
     383      # or it failed possibly due to a race condition.  Create the
     384      # directory the slow way, step by step, checking for races as we go.
     385
     386      case $dstdir in
     387        /*) prefix='/';;
     388        -*) prefix='./';;
     389        *)  prefix='';;
     390      esac
     391
     392      eval "$initialize_posix_glob"
     393
     394      oIFS=$IFS
     395      IFS=/
     396      $posix_glob set -f
     397      set fnord $dstdir
    237398      shift
    238       if test ! -d "$pathcomp"; then
    239         $mkdirprog "$pathcomp"
    240         # mkdir can fail with a `File exist' error in case several
    241         # install-sh are creating the directory concurrently.  This
    242         # is OK.
    243         test -d "$pathcomp" || exit
     399      $posix_glob set +f
     400      IFS=$oIFS
     401
     402      prefixes=
     403
     404      for d
     405      do
     406        test -z "$d" && continue
     407
     408        prefix=$prefix$d
     409        if test -d "$prefix"; then
     410          prefixes=
     411        else
     412          if $posix_mkdir; then
     413            (umask=$mkdir_umask &&
     414             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
     415            # Don't fail if two instances are running concurrently.
     416            test -d "$prefix" || exit 1
     417          else
     418            case $prefix in
     419              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
     420              *) qprefix=$prefix;;
     421            esac
     422            prefixes="$prefixes '$qprefix'"
     423          fi
     424        fi
     425        prefix=$prefix/
     426      done
     427
     428      if test -n "$prefixes"; then
     429        # Don't fail if two instances are running concurrently.
     430        (umask $mkdir_umask &&
     431         eval "\$doit_exec \$mkdirprog $prefixes") ||
     432          test -d "$dstdir" || exit 1
     433        obsolete_mkdir_used=true
    244434      fi
    245       pathcomp=$pathcomp/
    246     done
     435    fi
    247436  fi
    248437
    249438  if test -n "$dir_arg"; then
    250     $doit $mkdircmd "$dst" \
    251       && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
    252       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
    253       && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
    254       && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
    255 
     439    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
     440    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
     441    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
     442      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
    256443  else
    257     dstfile=`basename "$dst"`
    258444
    259445    # Make a couple of temp file names in the proper directory.
     
    263449    # Trap to clean up those temp files at exit.
    264450    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
    265     trap '(exit $?); exit' 1 2 13 15
    266451
    267452    # Copy the file name to the temp name.
    268     $doit $cpprog "$src" "$dsttmp" &&
     453    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
    269454
    270455    # and set any options; do chmod last to preserve setuid bits.
     
    274459    # errors from the above "$doit $cpprog $src $dsttmp" command.
    275460    #
    276     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
    277       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
    278       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
    279       && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
    280 
    281     # Now rename the file to the real destination.
    282     { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
    283       || {
    284            # The rename failed, perhaps because mv can't rename something else
    285            # to itself, or perhaps because mv is so ancient that it does not
    286            # support -f.
    287 
    288            # Now remove or move aside any old file at destination location.
    289            # We try this two ways since rm can't unlink itself on some
    290            # systems and the destination file might be busy for other
    291            # reasons.  In this case, the final cleanup might fail but the new
    292            # file should still install successfully.
    293            {
    294              if test -f "$dstdir/$dstfile"; then
    295                $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
    296                || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
    297                || {
    298                  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
    299                  (exit 1); exit 1
    300                }
    301              else
    302                :
    303              fi
    304            } &&
    305 
    306            # Now rename the file to the real destination.
    307            $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
    308          }
    309     }
    310   fi || { (exit 1); exit 1; }
     461    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
     462    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
     463    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
     464    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
     465
     466    # If -C, don't bother to copy if it wouldn't change the file.
     467    if $copy_on_change &&
     468       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
     469       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
     470
     471       eval "$initialize_posix_glob" &&
     472       $posix_glob set -f &&
     473       set X $old && old=:$2:$4:$5:$6 &&
     474       set X $new && new=:$2:$4:$5:$6 &&
     475       $posix_glob set +f &&
     476
     477       test "$old" = "$new" &&
     478       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
     479    then
     480      rm -f "$dsttmp"
     481    else
     482      # Rename the file to the real destination.
     483      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
     484
     485      # The rename failed, perhaps because mv can't rename something else
     486      # to itself, or perhaps because mv is so ancient that it does not
     487      # support -f.
     488      {
     489        # Now remove or move aside any old file at destination location.
     490        # We try this two ways since rm can't unlink itself on some
     491        # systems and the destination file might be busy for other
     492        # reasons.  In this case, the final cleanup might fail but the new
     493        # file should still install successfully.
     494        {
     495          test ! -f "$dst" ||
     496          $doit $rmcmd -f "$dst" 2>/dev/null ||
     497          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
     498            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
     499          } ||
     500          { echo "$0: cannot unlink or rename $dst" >&2
     501            (exit 1); exit 1
     502          }
     503        } &&
     504
     505        # Now rename the file to the real destination.
     506        $doit $mvcmd "$dsttmp" "$dst"
     507      }
     508    fi || exit 1
     509
     510    trap '' 0
     511  fi
    311512done
    312 
    313 # The final little trick to "correctly" pass the exit status to the exit trap.
    314 {
    315   (exit 0); exit 0
    316 }
    317513
    318514# Local variables:
     
    320516# time-stamp-start: "scriptversion="
    321517# time-stamp-format: "%:y-%02m-%02d.%02H"
    322 # time-stamp-end: "$"
     518# time-stamp-time-zone: "UTC"
     519# time-stamp-end: "; # UTC"
    323520# End:
  • trunk/autoconf/ltmain.sh

    • Property svn:executable set to *
    </
    r1 r106  
    1 # ltmain.sh - Provide generalized library-building support services.
    2 # NOTE: Changing this file will not affect anything until you rerun configure.
    3 #
    4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
    5 # Free Software Foundation, Inc.
    6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
    7 #
    8 # This program is free software; you can redistribute it and/or modify
     1# Generated from ltmain.m4sh.
     2
     3# ltmain.sh (GNU libtool) 2.2.6
     4# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
     5
     6# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
     7# This is free software; see the source for copying conditions.  There is NO
     8# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     9
     10# GNU Libtool is free software; you can redistribute it and/or modify
    911# it under the terms of the GNU General Public License as published by
    1012# the Free Software Foundation; either version 2 of the License, or
    1113# (at your option) any later version.
    1214#
    13 # This program is distributed in the hope that it will be useful, but
     15# As a special exception to the GNU General Public License,
     16# if you distribute this file as part of a program or library that
     17# is built using GNU Libtool, you may include this file under the
     18# same distribution terms that you use for the rest of that program.
     19#
     20# GNU Libtool is distributed in the hope that it will be useful, but
    1421# WITHOUT ANY WARRANTY; without even the implied warranty of
    1522# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     
    1724#
    1825# You should have received a copy of the GNU General Public License
    19 # along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     26# along with GNU Libtool; see the file COPYING.  If not, a copy
     27# can be downloaded from http://www.gnu.org/licenses/gpl.html,
     28# or obtained by writing to the Free Software Foundation, Inc.,
     29# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
     30
     31# Usage: $progname [OPTION]... [MODE-ARG]...
    2132#
    22 # As a special exception to the GNU General Public License, if you
    23 # distribute this file as part of a program that contains a
    24 # configuration script generated by Autoconf, you may include it under
    25 # the same distribution terms that you use for the rest of that program.
    26 
    27 basename="s,^.*/,,g"
    28 
    29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
    30 # is ksh but when the shell is invoked as "sh" and the current value of
    31 # the _XPG environment variable is not equal to 1 (one), the special
    32 # positional parameter $0, within a function call, is the name of the
    33 # function.
    34 progpath="$0"
    35 
    36 # The name of this program:
    37 progname=`echo "$progpath" | $SED $basename`
    38 modename="$progname"
    39 
    40 # Global variables:
    41 EXIT_SUCCESS=0
    42 EXIT_FAILURE=1
     33# Provide generalized library-building support services.
     34#
     35#     --config             show all configuration variables
     36#     --debug              enable verbose shell tracing
     37# -n, --dry-run            display commands without modifying any files
     38#     --features           display basic configuration information and exit
     39#     --mode=MODE          use operation mode MODE
     40#     --preserve-dup-deps  don't remove duplicate dependency libraries
     41#     --quiet, --silent    don't print informational messages
     42#     --tag=TAG            use configuration variables from tag TAG
     43# -v, --verbose            print informational messages (default)
     44#     --version            print version information
     45# -h, --help               print short or long help message
     46#
     47# MODE must be one of the following:
     48#
     49#       clean              remove files from the build directory
     50#       compile            compile a source file into a libtool object
     51#       execute            automatically set library path, then run a program
     52#       finish             complete the installation of libtool libraries
     53#       install            install libraries or executables
     54#       link               create a library or an executable
     55#       uninstall          remove libraries from an installed directory
     56#
     57# MODE-ARGS vary depending on the MODE.
     58# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
     59#
     60# When reporting a bug, please describe a test case to reproduce it and
     61# include the following information:
     62#
     63#       host-triplet:   $host
     64#       shell:          $SHELL
     65#       compiler:               $LTCC
     66#       compiler flags:         $LTCFLAGS
     67#       linker:         $LD (gnu? $with_gnu_ld)
     68#       $progname:              (GNU libtool) 2.2.6
     69#       automake:               $automake_version
     70#       autoconf:               $autoconf_version
     71#
     72# Report bugs to <bug-libtool@gnu.org>.
    4373
    4474PROGRAM=ltmain.sh
    4575PACKAGE=libtool
    46 VERSION=1.5.22
    47 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
    48 
    49 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
     76VERSION=2.2.6
     77TIMESTAMP=""
     78package_revision=1.3012
     79
     80# Be Bourne compatible
    5081if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
    5182  emulate sh
     
    5889  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
    5990fi
    60 
    61 # Check that we have a working $echo.
     91BIN_SH=xpg4; export BIN_SH # for Tru64
     92DUALCASE=1; export DUALCASE # for MKS sh
     93
     94# NLS nuisances: We save the old values to restore during execute mode.
     95# Only set LANG and LC_ALL to C if already set.
     96# These must not be set unconditionally because not all systems understand
     97# e.g. LANG=C (notably SCO).
     98lt_user_locale=
     99lt_safe_locale=
     100for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
     101do
     102  eval "if test \"\${$lt_var+set}\" = set; then
     103          save_$lt_var=\$$lt_var
     104          $lt_var=C
     105          export $lt_var
     106          lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
     107          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
     108        fi"
     109done
     110
     111$lt_unset CDPATH
     112
     113
     114
     115
     116
     117: ${CP="cp -f"}
     118: ${ECHO="echo"}
     119: ${EGREP="/usr/bin/grep -E"}
     120: ${FGREP="/usr/bin/grep -F"}
     121: ${GREP="/usr/bin/grep"}
     122: ${LN_S="ln -s"}
     123: ${MAKE="make"}
     124: ${MKDIR="mkdir"}
     125: ${MV="mv -f"}
     126: ${RM="rm -f"}
     127: ${SED="/opt/local/bin/gsed"}
     128: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
     129: ${Xsed="$SED -e 1s/^X//"}
     130
     131# Global variables:
     132EXIT_SUCCESS=0
     133EXIT_FAILURE=1
     134EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
     135EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
     136
     137exit_status=$EXIT_SUCCESS
     138
     139# Make sure IFS has a sensible default
     140lt_nl='
     141'
     142IFS="   $lt_nl"
     143
     144dirname="s,/[^/]*$,,"
     145basename="s,^.*/,,"
     146
     147# func_dirname_and_basename file append nondir_replacement
     148# perform func_basename and func_dirname in a single function
     149# call:
     150#   dirname:  Compute the dirname of FILE.  If nonempty,
     151#             add APPEND to the result, otherwise set result
     152#             to NONDIR_REPLACEMENT.
     153#             value returned in "$func_dirname_result"
     154#   basename: Compute filename of FILE.
     155#             value retuned in "$func_basename_result"
     156# Implementation must be kept synchronized with func_dirname
     157# and func_basename. For efficiency, we do not delegate to
     158# those functions but instead duplicate the functionality here.
     159func_dirname_and_basename ()
     160{
     161  # Extract subdirectory from the argument.
     162  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
     163  if test "X$func_dirname_result" = "X${1}"; then
     164    func_dirname_result="${3}"
     165  else
     166    func_dirname_result="$func_dirname_result${2}"
     167  fi
     168  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
     169}
     170
     171# Generated shell functions inserted here.
     172
     173# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
     174# is ksh but when the shell is invoked as "sh" and the current value of
     175# the _XPG environment variable is not equal to 1 (one), the special
     176# positional parameter $0, within a function call, is the name of the
     177# function.
     178progpath="$0"
     179
     180# The name of this program:
     181# In the unlikely event $progname began with a '-', it would play havoc with
     182# func_echo (imagine progname=-n), so we prepend ./ in that case:
     183func_dirname_and_basename "$progpath"
     184progname=$func_basename_result
     185case $progname in
     186  -*) progname=./$progname ;;
     187esac
     188
     189# Make sure we have an absolute path for reexecution:
     190case $progpath in
     191  [\\/]*|[A-Za-z]:\\*) ;;
     192  *[\\/]*)
     193     progdir=$func_dirname_result
     194     progdir=`cd "$progdir" && pwd`
     195     progpath="$progdir/$progname"
     196     ;;
     197  *)
     198     save_IFS="$IFS"
     199     IFS=:
     200     for progdir in $PATH; do
     201       IFS="$save_IFS"
     202       test -x "$progdir/$progname" && break
     203     done
     204     IFS="$save_IFS"
     205     test -n "$progdir" || progdir=`pwd`
     206     progpath="$progdir/$progname"
     207     ;;
     208esac
     209
     210# Sed substitution that helps us do robust quoting.  It backslashifies
     211# metacharacters that are still active within double-quoted strings.
     212Xsed="${SED}"' -e 1s/^X//'
     213sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
     214
     215# Same as above, but do not quote variable references.
     216double_quote_subst='s/\(["`\\]\)/\\\1/g'
     217
     218# Re-`\' parameter expansions in output of double_quote_subst that were
     219# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
     220# in input to double_quote_subst, that '$' was protected from expansion.
     221# Since each input `\' is now two `\'s, look for any number of runs of
     222# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
     223bs='\\'
     224bs2='\\\\'
     225bs4='\\\\\\\\'
     226dollar='\$'
     227sed_double_backslash="\
     228  s/$bs4/&\\
     229/g
     230  s/^$bs2$dollar/$bs&/
     231  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
     232  s/\n//g"
     233
     234# Standard options:
     235opt_dry_run=false
     236opt_help=false
     237opt_quiet=false
     238opt_verbose=false
     239opt_warning=:
     240
     241# func_echo arg...
     242# Echo program name prefixed message, along with the current mode
     243# name if it has been set yet.
     244func_echo ()
     245{
     246    $ECHO "$progname${mode+: }$mode: $*"
     247}
     248
     249# func_verbose arg...
     250# Echo program name prefixed message in verbose mode only.
     251func_verbose ()
     252{
     253    $opt_verbose && func_echo ${1+"$@"}
     254
     255    # A bug in bash halts the script if the last line of a function
     256    # fails when set -e is in force, so we need another command to
     257    # work around that:
     258    :
     259}
     260
     261# func_error arg...
     262# Echo program name prefixed message to standard error.
     263func_error ()
     264{
     265    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
     266}
     267
     268# func_warning arg...
     269# Echo program name prefixed warning message to standard error.
     270func_warning ()
     271{
     272    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
     273
     274    # bash bug again:
     275    :
     276}
     277
     278# func_fatal_error arg...
     279# Echo program name prefixed message to standard error, and exit.
     280func_fatal_error ()
     281{
     282    func_error ${1+"$@"}
     283    exit $EXIT_FAILURE
     284}
     285
     286# func_fatal_help arg...
     287# Echo program name prefixed message to standard error, followed by
     288# a help hint, and exit.
     289func_fatal_help ()
     290{
     291    func_error ${1+"$@"}
     292    func_fatal_error "$help"
     293}
     294help="Try \`$progname --help' for more information."  ## default
     295
     296
     297# func_grep expression filename
     298# Check whether EXPRESSION matches any line of FILENAME, without output.
     299func_grep ()
     300{
     301    $GREP "$1" "$2" >/dev/null 2>&1
     302}
     303
     304
     305# func_mkdir_p directory-path
     306# Make sure the entire path to DIRECTORY-PATH is available.
     307func_mkdir_p ()
     308{
     309    my_directory_path="$1"
     310    my_dir_list=
     311
     312    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
     313
     314      # Protect directory names starting with `-'
     315      case $my_directory_path in
     316        -*) my_directory_path="./$my_directory_path" ;;
     317      esac
     318
     319      # While some portion of DIR does not yet exist...
     320      while test ! -d "$my_directory_path"; do
     321        # ...make a list in topmost first order.  Use a colon delimited
     322        # list incase some portion of path contains whitespace.
     323        my_dir_list="$my_directory_path:$my_dir_list"
     324
     325        # If the last portion added has no slash in it, the list is done
     326        case $my_directory_path in */*) ;; *) break ;; esac
     327
     328        # ...otherwise throw away the child directory and loop
     329        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
     330      done
     331      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
     332
     333      save_mkdir_p_IFS="$IFS"; IFS=':'
     334      for my_dir in $my_dir_list; do
     335        IFS="$save_mkdir_p_IFS"
     336        # mkdir can fail with a `File exist' error if two processes
     337        # try to create one of the directories concurrently.  Don't
     338        # stop in that case!
     339        $MKDIR "$my_dir" 2>/dev/null || :
     340      done
     341      IFS="$save_mkdir_p_IFS"
     342
     343      # Bail out if we (or some other process) failed to create a directory.
     344      test -d "$my_directory_path" || \
     345        func_fatal_error "Failed to create \`$1'"
     346    fi
     347}
     348
     349
     350# func_mktempdir [string]
     351# Make a temporary directory that won't clash with other running
     352# libtool processes, and avoids race conditions if possible.  If
     353# given, STRING is the basename for that directory.
     354func_mktempdir ()
     355{
     356    my_template="${TMPDIR-/tmp}/${1-$progname}"
     357
     358    if test "$opt_dry_run" = ":"; then
     359      # Return a directory name, but don't create it in dry-run mode
     360      my_tmpdir="${my_template}-$$"
     361    else
     362
     363      # If mktemp works, use that first and foremost
     364      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
     365
     366      if test ! -d "$my_tmpdir"; then
     367        # Failing that, at least try and use $RANDOM to avoid a race
     368        my_tmpdir="${my_template}-${RANDOM-0}$$"
     369
     370        save_mktempdir_umask=`umask`
     371        umask 0077
     372        $MKDIR "$my_tmpdir"
     373        umask $save_mktempdir_umask
     374      fi
     375
     376      # If we're not in dry-run mode, bomb out on failure
     377      test -d "$my_tmpdir" || \
     378        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
     379    fi
     380
     381    $ECHO "X$my_tmpdir" | $Xsed
     382}
     383
     384
     385# func_quote_for_eval arg
     386# Aesthetically quote ARG to be evaled later.
     387# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
     388# is double-quoted, suitable for a subsequent eval, whereas
     389# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
     390# which are still active within double quotes backslashified.
     391func_quote_for_eval ()
     392{
     393    case $1 in
     394      *[\\\`\"\$]*)
     395        func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
     396      *)
     397        func_quote_for_eval_unquoted_result="$1" ;;
     398    esac
     399
     400    case $func_quote_for_eval_unquoted_result in
     401      # Double-quote args containing shell metacharacters to delay
     402      # word splitting, command substitution and and variable
     403      # expansion for a subsequent eval.
     404      # Many Bourne shells cannot handle close brackets correctly
     405      # in scan sets, so we specify it separately.
     406      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
     407        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
     408        ;;
     409      *)
     410        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     411    esac
     412}
     413
     414
     415# func_quote_for_expand arg
     416# Aesthetically quote ARG to be evaled later; same as above,
     417# but do not quote variable references.
     418func_quote_for_expand ()
     419{
     420    case $1 in
     421      *[\\\`\"]*)
     422        my_arg=`$ECHO "X$1" | $Xsed \
     423            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
     424      *)
     425        my_arg="$1" ;;
     426    esac
     427
     428    case $my_arg in
     429      # Double-quote args containing shell metacharacters to delay
     430      # word splitting and command substitution for a subsequent eval.
     431      # Many Bourne shells cannot handle close brackets correctly
     432      # in scan sets, so we specify it separately.
     433      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
     434        my_arg="\"$my_arg\""
     435        ;;
     436    esac
     437
     438    func_quote_for_expand_result="$my_arg"
     439}
     440
     441
     442# func_show_eval cmd [fail_exp]
     443# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
     444# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
     445# is given, then evaluate it.
     446func_show_eval ()
     447{
     448    my_cmd="$1"
     449    my_fail_exp="${2-:}"
     450
     451    ${opt_silent-false} || {
     452      func_quote_for_expand "$my_cmd"
     453      eval "func_echo $func_quote_for_expand_result"
     454    }
     455
     456    if ${opt_dry_run-false}; then :; else
     457      eval "$my_cmd"
     458      my_status=$?
     459      if test "$my_status" -eq 0; then :; else
     460        eval "(exit $my_status); $my_fail_exp"
     461      fi
     462    fi
     463}
     464
     465
     466# func_show_eval_locale cmd [fail_exp]
     467# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
     468# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
     469# is given, then evaluate it.  Use the saved locale for evaluation.
     470func_show_eval_locale ()
     471{
     472    my_cmd="$1"
     473    my_fail_exp="${2-:}"
     474
     475    ${opt_silent-false} || {
     476      func_quote_for_expand "$my_cmd"
     477      eval "func_echo $func_quote_for_expand_result"
     478    }
     479
     480    if ${opt_dry_run-false}; then :; else
     481      eval "$lt_user_locale
     482            $my_cmd"
     483      my_status=$?
     484      eval "$lt_safe_locale"
     485      if test "$my_status" -eq 0; then :; else
     486        eval "(exit $my_status); $my_fail_exp"
     487      fi
     488    fi
     489}
     490
     491
     492
     493
     494
     495# func_version
     496# Echo version message to standard output and exit.
     497func_version ()
     498{
     499    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
     500        s/^# //
     501        s/^# *$//
     502        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
     503        p
     504     }' < "$progpath"
     505     exit $?
     506}
     507
     508# func_usage
     509# Echo short help message to standard output and exit.
     510func_usage ()
     511{
     512    $SED -n '/^# Usage:/,/# -h/ {
     513        s/^# //
     514        s/^# *$//
     515        s/\$progname/'$progname'/
     516        p
     517    }' < "$progpath"
     518    $ECHO
     519    $ECHO "run \`$progname --help | more' for full usage"
     520    exit $?
     521}
     522
     523# func_help
     524# Echo long help message to standard output and exit.
     525func_help ()
     526{
     527    $SED -n '/^# Usage:/,/# Report bugs to/ {
     528        s/^# //
     529        s/^# *$//
     530        s*\$progname*'$progname'*
     531        s*\$host*'"$host"'*
     532        s*\$SHELL*'"$SHELL"'*
     533        s*\$LTCC*'"$LTCC"'*
     534        s*\$LTCFLAGS*'"$LTCFLAGS"'*
     535        s*\$LD*'"$LD"'*
     536        s/\$with_gnu_ld/'"$with_gnu_ld"'/
     537        s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
     538        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
     539        p
     540     }' < "$progpath"
     541    exit $?
     542}
     543
     544# func_missing_arg argname
     545# Echo program name prefixed message to standard error and set global
     546# exit_cmd.
     547func_missing_arg ()
     548{
     549    func_error "missing argument for $1"
     550    exit_cmd=exit
     551}
     552
     553exit_cmd=:
     554
     555
     556
     557
     558
     559# Check that we have a working $ECHO.
    62560if test "X$1" = X--no-reexec; then
    63561  # Discard the --no-reexec flag, and continue.
     
    66564  # Avoid inline document here, it may be left over
    67565  :
    68 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
    69   # Yippee, $echo works!
     566elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
     567  # Yippee, $ECHO works!
    70568  :
    71569else
    72   # Restart under the correct shell, and then maybe $echo will work.
     570  # Restart under the correct shell, and then maybe $ECHO will work.
    73571  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
    74572fi
     
    83581fi
    84582
    85 default_mode=
    86 help="Try \`$progname --help' for more information."
    87583magic="%%%MAGIC variable%%%"
    88 mkdir="mkdir"
    89 mv="mv -f"
    90 rm="rm -f"
    91 
    92 # Sed substitution that helps us do robust quoting.  It backslashifies
    93 # metacharacters that are still active within double-quoted strings.
    94 Xsed="${SED}"' -e 1s/^X//'
    95 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    96 # test EBCDIC or ASCII
    97 case `echo X|tr X '\101'` in
    98  A) # ASCII based system
    99     # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
    100   SP2NL='tr \040 \012'
    101   NL2SP='tr \015\012 \040\040'
    102   ;;
    103  *) # EBCDIC based system
    104   SP2NL='tr \100 \n'
    105   NL2SP='tr \r\n \100\100'
    106   ;;
    107 esac
    108 
    109 # NLS nuisances.
    110 # Only set LANG and LC_ALL to C if already set.
    111 # These must not be set unconditionally because not all systems understand
    112 # e.g. LANG=C (notably SCO).
    113 # We save the old values to restore during execute mode.
    114 for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
    115 do
    116   eval "if test \"\${$lt_var+set}\" = set; then
    117          save_$lt_var=\$$lt_var
    118          $lt_var=C
    119          export $lt_var
    120        fi"
    121 done
    122 
    123 # Make sure IFS has a sensible default
    124 lt_nl='
    125 '
    126 IFS="   $lt_nl"
    127 
    128 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
    129   $echo "$modename: not configured to build any kind of library" 1>&2
    130   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    131   exit $EXIT_FAILURE
    132 fi
     584magic_exe="%%%MAGIC EXE variable%%%"
    133585
    134586# Global variables.
    135 mode=$default_mode
     587# $mode is unset
    136588nonopt=
    137 prev=
    138 prevopt=
    139 run=
    140 show="$echo"
    141 show_help=
    142589execute_dlfiles=
    143 duplicate_deps=no
    144590preserve_args=
    145591lo2o="s/\\.lo\$/.${objext}/"
     
    148594extracted_serial=0
    149595
    150 #####################################
    151 # Shell function definitions:
    152 # This seems to be the best place for them
    153 
    154 # func_mktempdir [string]
    155 # Make a temporary directory that won't clash with other running
    156 # libtool processes, and avoids race conditions if possible.  If
    157 # given, STRING is the basename for that directory.
    158 func_mktempdir ()
     596opt_dry_run=false
     597opt_duplicate_deps=false
     598opt_silent=false
     599opt_debug=:
     600
     601# If this variable is set in any of the actions, the command in it
     602# will be execed at the end.  This prevents here-documents from being
     603# left over by shells.
     604exec_cmd=
     605
     606# func_fatal_configuration arg...
     607# Echo program name prefixed message to standard error, followed by
     608# a configuration failure hint, and exit.
     609func_fatal_configuration ()
    159610{
    160     my_template="${TMPDIR-/tmp}/${1-$progname}"
    161 
    162     if test "$run" = ":"; then
    163       # Return a directory name, but don't create it in dry-run mode
    164       my_tmpdir="${my_template}-$$"
     611    func_error ${1+"$@"}
     612    func_error "See the $PACKAGE documentation for more information."
     613    func_fatal_error "Fatal configuration error."
     614}
     615
     616
     617# func_config
     618# Display the configuration for all the tags in this script.
     619func_config ()
     620{
     621    re_begincf='^# ### BEGIN LIBTOOL'
     622    re_endcf='^# ### END LIBTOOL'
     623
     624    # Default configuration.
     625    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
     626
     627    # Now print the configurations for the tags.
     628    for tagname in $taglist; do
     629      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
     630    done
     631
     632    exit $?
     633}
     634
     635# func_features
     636# Display the features supported by this script.
     637func_features ()
     638{
     639    $ECHO "host: $host"
     640    if test "$build_libtool_libs" = yes; then
     641      $ECHO "enable shared libraries"
    165642    else
    166 
    167       # If mktemp works, use that first and foremost
    168       my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
    169 
    170       if test ! -d "$my_tmpdir"; then
    171         # Failing that, at least try and use $RANDOM to avoid a race
    172         my_tmpdir="${my_template}-${RANDOM-0}$$"
    173 
    174         save_mktempdir_umask=`umask`
    175         umask 0077
    176         $mkdir "$my_tmpdir"
    177         umask $save_mktempdir_umask
     643      $ECHO "disable shared libraries"
     644    fi
     645    if test "$build_old_libs" = yes; then
     646      $ECHO "enable static libraries"
     647    else
     648      $ECHO "disable static libraries"
     649    fi
     650
     651    exit $?
     652}
     653
     654# func_enable_tag tagname
     655# Verify that TAGNAME is valid, and either flag an error and exit, or
     656# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
     657# variable here.
     658func_enable_tag ()
     659{
     660  # Global variable:
     661  tagname="$1"
     662
     663  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
     664  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
     665  sed_extractcf="/$re_begincf/,/$re_endcf/p"
     666
     667  # Validate tagname.
     668  case $tagname in
     669    *[!-_A-Za-z0-9,/]*)
     670      func_fatal_error "invalid tag name: $tagname"
     671      ;;
     672  esac
     673
     674  # Don't test for the "default" C tag, as we know it's
     675  # there but not specially marked.
     676  case $tagname in
     677    CC) ;;
     678    *)
     679      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
     680        taglist="$taglist $tagname"
     681
     682        # Evaluate the configuration.  Be careful to quote the path
     683        # and the sed script, to avoid splitting on whitespace, but
     684        # also don't use non-portable quotes within backquotes within
     685        # quotes we have to do it in 2 steps:
     686        extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
     687        eval "$extractedcf"
     688      else
     689        func_error "ignoring unknown tag $tagname"
    178690      fi
    179 
    180       # If we're not in dry-run mode, bomb out on failure
    181       test -d "$my_tmpdir" || {
    182         $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
     691      ;;
     692  esac
     693}
     694
     695# Parse options once, thoroughly.  This comes as soon as possible in
     696# the script to make things like `libtool --version' happen quickly.
     697{
     698
     699  # Shorthand for --mode=foo, only valid as the first argument
     700  case $1 in
     701  clean|clea|cle|cl)
     702    shift; set dummy --mode clean ${1+"$@"}; shift
     703    ;;
     704  compile|compil|compi|comp|com|co|c)
     705    shift; set dummy --mode compile ${1+"$@"}; shift
     706    ;;
     707  execute|execut|execu|exec|exe|ex|e)
     708    shift; set dummy --mode execute ${1+"$@"}; shift
     709    ;;
     710  finish|finis|fini|fin|fi|f)
     711    shift; set dummy --mode finish ${1+"$@"}; shift
     712    ;;
     713  install|instal|insta|inst|ins|in|i)
     714    shift; set dummy --mode install ${1+"$@"}; shift
     715    ;;
     716  link|lin|li|l)
     717    shift; set dummy --mode link ${1+"$@"}; shift
     718    ;;
     719  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
     720    shift; set dummy --mode uninstall ${1+"$@"}; shift
     721    ;;
     722  esac
     723
     724  # Parse non-mode specific arguments:
     725  while test "$#" -gt 0; do
     726    opt="$1"
     727    shift
     728
     729    case $opt in
     730      --config)         func_config                                     ;;
     731
     732      --debug)          preserve_args="$preserve_args $opt"
     733                        func_echo "enabling shell trace mode"
     734                        opt_debug='set -x'
     735                        $opt_debug
     736                        ;;
     737
     738      -dlopen)          test "$#" -eq 0 && func_missing_arg "$opt" && break
     739                        execute_dlfiles="$execute_dlfiles $1"
     740                        shift
     741                        ;;
     742
     743      --dry-run | -n)   opt_dry_run=:                                   ;;
     744      --features)       func_features                                   ;;
     745      --finish)         mode="finish"                                   ;;
     746
     747      --mode)           test "$#" -eq 0 && func_missing_arg "$opt" && break
     748                        case $1 in
     749                          # Valid mode arguments:
     750                          clean)        ;;
     751                          compile)      ;;
     752                          execute)      ;;
     753                          finish)       ;;
     754                          install)      ;;
     755                          link)         ;;
     756                          relink)       ;;
     757                          uninstall)    ;;
     758
     759                          # Catch anything else as an error
     760                          *) func_error "invalid argument for $opt"
     761                             exit_cmd=exit
     762                             break
     763                             ;;
     764                        esac
     765
     766                        mode="$1"
     767                        shift
     768                        ;;
     769
     770      --preserve-dup-deps)
     771                        opt_duplicate_deps=:                            ;;
     772
     773      --quiet|--silent) preserve_args="$preserve_args $opt"
     774                        opt_silent=:
     775                        ;;
     776
     777      --verbose| -v)    preserve_args="$preserve_args $opt"
     778                        opt_silent=false
     779                        ;;
     780
     781      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
     782                        preserve_args="$preserve_args $opt $1"
     783                        func_enable_tag "$1"    # tagname is set here
     784                        shift
     785                        ;;
     786
     787      # Separate optargs to long options:
     788      -dlopen=*|--mode=*|--tag=*)
     789                        func_opt_split "$opt"
     790                        set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
     791                        shift
     792                        ;;
     793
     794      -\?|-h)           func_usage                                      ;;
     795      --help)           opt_help=:                                      ;;
     796      --version)        func_version                                    ;;
     797
     798      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
     799
     800      *)                nonopt="$opt"
     801                        break
     802                        ;;
     803    esac
     804  done
     805
     806
     807  case $host in
     808    *cygwin* | *mingw* | *pw32* | *cegcc*)
     809      # don't eliminate duplications in $postdeps and $predeps
     810      opt_duplicate_compiler_generated_deps=:
     811      ;;
     812    *)
     813      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
     814      ;;
     815  esac
     816
     817  # Having warned about all mis-specified options, bail out if
     818  # anything was wrong.
     819  $exit_cmd $EXIT_FAILURE
     820}
     821
     822# func_check_version_match
     823# Ensure that we are using m4 macros, and libtool script from the same
     824# release of libtool.
     825func_check_version_match ()
     826{
     827  if test "$package_revision" != "$macro_revision"; then
     828    if test "$VERSION" != "$macro_version"; then
     829      if test -z "$macro_version"; then
     830        cat >&2 <<_LT_EOF
     831$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
     832$progname: definition of this LT_INIT comes from an older release.
     833$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
     834$progname: and run autoconf again.
     835_LT_EOF
     836      else
     837        cat >&2 <<_LT_EOF
     838$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
     839$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
     840$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
     841$progname: and run autoconf again.
     842_LT_EOF
     843      fi
     844    else
     845      cat >&2 <<_LT_EOF
     846$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
     847$progname: but the definition of this LT_INIT comes from revision $macro_revision.
     848$progname: You should recreate aclocal.m4 with macros from revision $package_revision
     849$progname: of $PACKAGE $VERSION and run autoconf again.
     850_LT_EOF
     851    fi
     852
     853    exit $EXIT_MISMATCH
     854  fi
     855}
     856
     857
     858## ----------- ##
     859##    Main.    ##
     860## ----------- ##
     861
     862$opt_help || {
     863  # Sanity checks first:
     864  func_check_version_match
     865
     866  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
     867    func_fatal_configuration "not configured to build any kind of library"
     868  fi
     869
     870  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
     871
     872
     873  # Darwin sucks
     874  eval std_shrext=\"$shrext_cmds\"
     875
     876
     877  # Only execute mode is allowed to have -dlopen flags.
     878  if test -n "$execute_dlfiles" && test "$mode" != execute; then
     879    func_error "unrecognized option \`-dlopen'"
     880    $ECHO "$help" 1>&2
     881    exit $EXIT_FAILURE
     882  fi
     883
     884  # Change the help message to a mode-specific one.
     885  generic_help="$help"
     886  help="Try \`$progname --help --mode=$mode' for more information."
     887}
     888
     889
     890# func_lalib_p file
     891# True iff FILE is a libtool `.la' library or `.lo' object file.
     892# This function is only a basic sanity check; it will hardly flush out
     893# determined imposters.
     894func_lalib_p ()
     895{
     896    test -f "$1" &&
     897      $SED -e 4q "$1" 2>/dev/null \
     898        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
     899}
     900
     901# func_lalib_unsafe_p file
     902# True iff FILE is a libtool `.la' library or `.lo' object file.
     903# This function implements the same check as func_lalib_p without
     904# resorting to external programs.  To this end, it redirects stdin and
     905# closes it afterwards, without saving the original file descriptor.
     906# As a safety measure, use it only where a negative result would be
     907# fatal anyway.  Works if `file' does not exist.
     908func_lalib_unsafe_p ()
     909{
     910    lalib_p=no
     911    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
     912        for lalib_p_l in 1 2 3 4
     913        do
     914            read lalib_p_line
     915            case "$lalib_p_line" in
     916                \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
     917            esac
     918        done
     919        exec 0<&5 5<&-
     920    fi
     921    test "$lalib_p" = yes
     922}
     923
     924# func_ltwrapper_script_p file
     925# True iff FILE is a libtool wrapper script
     926# This function is only a basic sanity check; it will hardly flush out
     927# determined imposters.
     928func_ltwrapper_script_p ()
     929{
     930    func_lalib_p "$1"
     931}
     932
     933# func_ltwrapper_executable_p file
     934# True iff FILE is a libtool wrapper executable
     935# This function is only a basic sanity check; it will hardly flush out
     936# determined imposters.
     937func_ltwrapper_executable_p ()
     938{
     939    func_ltwrapper_exec_suffix=
     940    case $1 in
     941    *.exe) ;;
     942    *) func_ltwrapper_exec_suffix=.exe ;;
     943    esac
     944    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
     945}
     946
     947# func_ltwrapper_scriptname file
     948# Assumes file is an ltwrapper_executable
     949# uses $file to determine the appropriate filename for a
     950# temporary ltwrapper_script.
     951func_ltwrapper_scriptname ()
     952{
     953    func_ltwrapper_scriptname_result=""
     954    if func_ltwrapper_executable_p "$1"; then
     955        func_dirname_and_basename "$1" "" "."
     956        func_stripname '' '.exe' "$func_basename_result"
     957        func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
     958    fi
     959}
     960
     961# func_ltwrapper_p file
     962# True iff FILE is a libtool wrapper script or wrapper executable
     963# This function is only a basic sanity check; it will hardly flush out
     964# determined imposters.
     965func_ltwrapper_p ()
     966{
     967    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
     968}
     969
     970
     971# func_execute_cmds commands fail_cmd
     972# Execute tilde-delimited COMMANDS.
     973# If FAIL_CMD is given, eval that upon failure.
     974# FAIL_CMD may read-access the current command in variable CMD!
     975func_execute_cmds ()
     976{
     977    $opt_debug
     978    save_ifs=$IFS; IFS='~'
     979    for cmd in $1; do
     980      IFS=$save_ifs
     981      eval cmd=\"$cmd\"
     982      func_show_eval "$cmd" "${2-:}"
     983    done
     984    IFS=$save_ifs
     985}
     986
     987
     988# func_source file
     989# Source FILE, adding directory component if necessary.
     990# Note that it is not necessary on cygwin/mingw to append a dot to
     991# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
     992# behavior happens only for exec(3), not for open(2)!  Also, sourcing
     993# `FILE.' does not work on cygwin managed mounts.
     994func_source ()
     995{
     996    $opt_debug
     997    case $1 in
     998    */* | *\\*) . "$1" ;;
     999    *)          . "./$1" ;;
     1000    esac
     1001}
     1002
     1003
     1004# func_infer_tag arg
     1005# Infer tagged configuration to use if any are available and
     1006# if one wasn't chosen via the "--tag" command line option.
     1007# Only attempt this if the compiler in the base compile
     1008# command doesn't match the default compiler.
     1009# arg is usually of the form 'gcc ...'
     1010func_infer_tag ()
     1011{
     1012    $opt_debug
     1013    if test -n "$available_tags" && test -z "$tagname"; then
     1014      CC_quoted=
     1015      for arg in $CC; do
     1016        func_quote_for_eval "$arg"
     1017        CC_quoted="$CC_quoted $func_quote_for_eval_result"
     1018      done
     1019      case $@ in
     1020      # Blanks in the command may have been stripped by the calling shell,
     1021      # but not from the CC environment variable when configure was run.
     1022      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
     1023      # Blanks at the start of $base_compile will cause this to fail
     1024      # if we don't check for them as well.
     1025      *)
     1026        for z in $available_tags; do
     1027          if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
     1028            # Evaluate the configuration.
     1029            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
     1030            CC_quoted=
     1031            for arg in $CC; do
     1032              # Double-quote args containing other shell metacharacters.
     1033              func_quote_for_eval "$arg"
     1034              CC_quoted="$CC_quoted $func_quote_for_eval_result"
     1035            done
     1036            case "$@ " in
     1037              " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
     1038              # The compiler in the base compile command matches
     1039              # the one in the tagged configuration.
     1040              # Assume this is the tagged configuration we want.
     1041              tagname=$z
     1042              break
     1043              ;;
     1044            esac
     1045          fi
     1046        done
     1047        # If $tagname still isn't set, then no tagged configuration
     1048        # was found and let the user know that the "--tag" command
     1049        # line option must be used.
     1050        if test -z "$tagname"; then
     1051          func_echo "unable to infer tagged configuration"
     1052          func_fatal_error "specify a tag with \`--tag'"
     1053#       else
     1054#         func_verbose "using $tagname tagged configuration"
     1055        fi
     1056        ;;
     1057      esac
     1058    fi
     1059}
     1060
     1061
     1062
     1063# func_write_libtool_object output_name pic_name nonpic_name
     1064# Create a libtool object file (analogous to a ".la" file),
     1065# but don't create it if we're doing a dry run.
     1066func_write_libtool_object ()
     1067{
     1068    write_libobj=${1}
     1069    if test "$build_libtool_libs" = yes; then
     1070      write_lobj=\'${2}\'
     1071    else
     1072      write_lobj=none
     1073    fi
     1074
     1075    if test "$build_old_libs" = yes; then
     1076      write_oldobj=\'${3}\'
     1077    else
     1078      write_oldobj=none
     1079    fi
     1080
     1081    $opt_dry_run || {
     1082      cat >${write_libobj}T <<EOF
     1083# $write_libobj - a libtool object file
     1084# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
     1085#
     1086# Please DO NOT delete this file!
     1087# It is necessary for linking the library.
     1088
     1089# Name of the PIC object.
     1090pic_object=$write_lobj
     1091
     1092# Name of the non-PIC object
     1093non_pic_object=$write_oldobj
     1094
     1095EOF
     1096      $MV "${write_libobj}T" "${write_libobj}"
     1097    }
     1098}
     1099
     1100# func_mode_compile arg...
     1101func_mode_compile ()
     1102{
     1103    $opt_debug
     1104    # Get the compilation command and the source file.
     1105    base_compile=
     1106    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
     1107    suppress_opt=yes
     1108    suppress_output=
     1109    arg_mode=normal
     1110    libobj=
     1111    later=
     1112    pie_flag=
     1113
     1114    for arg
     1115    do
     1116      case $arg_mode in
     1117      arg  )
     1118        # do not "continue".  Instead, add this to base_compile
     1119        lastarg="$arg"
     1120        arg_mode=normal
     1121        ;;
     1122
     1123      target )
     1124        libobj="$arg"
     1125        arg_mode=normal
     1126        continue
     1127        ;;
     1128
     1129      normal )
     1130        # Accept any command-line options.
     1131        case $arg in
     1132        -o)
     1133          test -n "$libobj" && \
     1134            func_fatal_error "you cannot specify \`-o' more than once"
     1135          arg_mode=target
     1136          continue
     1137          ;;
     1138
     1139        -pie | -fpie | -fPIE)
     1140          pie_flag="$pie_flag $arg"
     1141          continue
     1142          ;;
     1143
     1144        -shared | -static | -prefer-pic | -prefer-non-pic)
     1145          later="$later $arg"
     1146          continue
     1147          ;;
     1148
     1149        -no-suppress)
     1150          suppress_opt=no
     1151          continue
     1152          ;;
     1153
     1154        -Xcompiler)
     1155          arg_mode=arg  #  the next one goes into the "base_compile" arg list
     1156          continue      #  The current "srcfile" will either be retained or
     1157          ;;            #  replaced later.  I would guess that would be a bug.
     1158
     1159        -Wc,*)
     1160          func_stripname '-Wc,' '' "$arg"
     1161          args=$func_stripname_result
     1162          lastarg=
     1163          save_ifs="$IFS"; IFS=','
     1164          for arg in $args; do
     1165            IFS="$save_ifs"
     1166            func_quote_for_eval "$arg"
     1167            lastarg="$lastarg $func_quote_for_eval_result"
     1168          done
     1169          IFS="$save_ifs"
     1170          func_stripname ' ' '' "$lastarg"
     1171          lastarg=$func_stripname_result
     1172
     1173          # Add the arguments to base_compile.
     1174          base_compile="$base_compile $lastarg"
     1175          continue
     1176          ;;
     1177
     1178        *)
     1179          # Accept the current argument as the source file.
     1180          # The previous "srcfile" becomes the current argument.
     1181          #
     1182          lastarg="$srcfile"
     1183          srcfile="$arg"
     1184          ;;
     1185        esac  #  case $arg
     1186        ;;
     1187      esac    #  case $arg_mode
     1188
     1189      # Aesthetically quote the previous argument.
     1190      func_quote_for_eval "$lastarg"
     1191      base_compile="$base_compile $func_quote_for_eval_result"
     1192    done # for arg
     1193
     1194    case $arg_mode in
     1195    arg)
     1196      func_fatal_error "you must specify an argument for -Xcompile"
     1197      ;;
     1198    target)
     1199      func_fatal_error "you must specify a target with \`-o'"
     1200      ;;
     1201    *)
     1202      # Get the name of the library object.
     1203      test -z "$libobj" && {
     1204        func_basename "$srcfile"
     1205        libobj="$func_basename_result"
     1206      }
     1207      ;;
     1208    esac
     1209
     1210    # Recognize several different file suffixes.
     1211    # If the user specifies -o file.o, it is replaced with file.lo
     1212    case $libobj in
     1213    *.[cCFSifmso] | \
     1214    *.ada | *.adb | *.ads | *.asm | \
     1215    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
     1216    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
     1217      func_xform "$libobj"
     1218      libobj=$func_xform_result
     1219      ;;
     1220    esac
     1221
     1222    case $libobj in
     1223    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     1224    *)
     1225      func_fatal_error "cannot determine name of library object from \`$libobj'"
     1226      ;;
     1227    esac
     1228
     1229    func_infer_tag $base_compile
     1230
     1231    for arg in $later; do
     1232      case $arg in
     1233      -shared)
     1234        test "$build_libtool_libs" != yes && \
     1235          func_fatal_configuration "can not build a shared library"
     1236        build_old_libs=no
     1237        continue
     1238        ;;
     1239
     1240      -static)
     1241        build_libtool_libs=no
     1242        build_old_libs=yes
     1243        continue
     1244        ;;
     1245
     1246      -prefer-pic)
     1247        pic_mode=yes
     1248        continue
     1249        ;;
     1250
     1251      -prefer-non-pic)
     1252        pic_mode=no
     1253        continue
     1254        ;;
     1255      esac
     1256    done
     1257
     1258    func_quote_for_eval "$libobj"
     1259    test "X$libobj" != "X$func_quote_for_eval_result" \
     1260      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'    &()|`$[]' \
     1261      && func_warning "libobj name \`$libobj' may not contain shell special characters."
     1262    func_dirname_and_basename "$obj" "/" ""
     1263    objname="$func_basename_result"
     1264    xdir="$func_dirname_result"
     1265    lobj=${xdir}$objdir/$objname
     1266
     1267    test -z "$base_compile" && \
     1268      func_fatal_help "you must specify a compilation command"
     1269
     1270    # Delete any leftover library objects.
     1271    if test "$build_old_libs" = yes; then
     1272      removelist="$obj $lobj $libobj ${libobj}T"
     1273    else
     1274      removelist="$lobj $libobj ${libobj}T"
     1275    fi
     1276
     1277    # On Cygwin there's no "real" PIC flag so we must build both object types
     1278    case $host_os in
     1279    cygwin* | mingw* | pw32* | os2* | cegcc*)
     1280      pic_mode=default
     1281      ;;
     1282    esac
     1283    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
     1284      # non-PIC code in shared libraries is not supported
     1285      pic_mode=default
     1286    fi
     1287
     1288    # Calculate the filename of the output object if compiler does
     1289    # not support -o with -c
     1290    if test "$compiler_c_o" = no; then
     1291      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
     1292      lockfile="$output_obj.lock"
     1293    else
     1294      output_obj=
     1295      need_locks=no
     1296      lockfile=
     1297    fi
     1298
     1299    # Lock this critical section if it is needed
     1300    # We use this script file to make the link, it avoids creating a new file
     1301    if test "$need_locks" = yes; then
     1302      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
     1303        func_echo "Waiting for $lockfile to be removed"
     1304        sleep 2
     1305      done
     1306    elif test "$need_locks" = warn; then
     1307      if test -f "$lockfile"; then
     1308        $ECHO "\
     1309*** ERROR, $lockfile exists and contains:
     1310`cat $lockfile 2>/dev/null`
     1311
     1312This indicates that another process is trying to use the same
     1313temporary object file, and libtool could not work around it because
     1314your compiler does not support \`-c' and \`-o' together.  If you
     1315repeat this compilation, it may succeed, by chance, but you had better
     1316avoid parallel builds (make -j) in this platform, or get a better
     1317compiler."
     1318
     1319        $opt_dry_run || $RM $removelist
    1831320        exit $EXIT_FAILURE
    184       }
     1321      fi
     1322      removelist="$removelist $output_obj"
     1323      $ECHO "$srcfile" > "$lockfile"
    1851324    fi
    1861325
    187     $echo "X$my_tmpdir" | $Xsed
     1326    $opt_dry_run || $RM $removelist
     1327    removelist="$removelist $lockfile"
     1328    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
     1329
     1330    if test -n "$fix_srcfile_path"; then
     1331      eval srcfile=\"$fix_srcfile_path\"
     1332    fi
     1333    func_quote_for_eval "$srcfile"
     1334    qsrcfile=$func_quote_for_eval_result
     1335
     1336    # Only build a PIC object if we are building libtool libraries.
     1337    if test "$build_libtool_libs" = yes; then
     1338      # Without this assignment, base_compile gets emptied.
     1339      fbsd_hideous_sh_bug=$base_compile
     1340
     1341      if test "$pic_mode" != no; then
     1342        command="$base_compile $qsrcfile $pic_flag"
     1343      else
     1344        # Don't build PIC code
     1345        command="$base_compile $qsrcfile"
     1346      fi
     1347
     1348      func_mkdir_p "$xdir$objdir"
     1349
     1350      if test -z "$output_obj"; then
     1351        # Place PIC objects in $objdir
     1352        command="$command -o $lobj"
     1353      fi
     1354
     1355      func_show_eval_locale "$command"  \
     1356          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
     1357
     1358      if test "$need_locks" = warn &&
     1359         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
     1360        $ECHO "\
     1361*** ERROR, $lockfile contains:
     1362`cat $lockfile 2>/dev/null`
     1363
     1364but it should contain:
     1365$srcfile
     1366
     1367This indicates that another process is trying to use the same
     1368temporary object file, and libtool could not work around it because
     1369your compiler does not support \`-c' and \`-o' together.  If you
     1370repeat this compilation, it may succeed, by chance, but you had better
     1371avoid parallel builds (make -j) in this platform, or get a better
     1372compiler."
     1373
     1374        $opt_dry_run || $RM $removelist
     1375        exit $EXIT_FAILURE
     1376      fi
     1377
     1378      # Just move the object if needed, then go on to compile the next one
     1379      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
     1380        func_show_eval '$MV "$output_obj" "$lobj"' \
     1381          'error=$?; $opt_dry_run || $RM $removelist; exit $error'
     1382      fi
     1383
     1384      # Allow error messages only from the first compilation.
     1385      if test "$suppress_opt" = yes; then
     1386        suppress_output=' >/dev/null 2>&1'
     1387      fi
     1388    fi
     1389
     1390    # Only build a position-dependent object if we build old libraries.
     1391    if test "$build_old_libs" = yes; then
     1392      if test "$pic_mode" != yes; then
     1393        # Don't build PIC code
     1394        command="$base_compile $qsrcfile$pie_flag"
     1395      else
     1396        command="$base_compile $qsrcfile $pic_flag"
     1397      fi
     1398      if test "$compiler_c_o" = yes; then
     1399        command="$command -o $obj"
     1400      fi
     1401
     1402      # Suppress compiler output if we already did a PIC compilation.
     1403      command="$command$suppress_output"
     1404      func_show_eval_locale "$command" \
     1405        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
     1406
     1407      if test "$need_locks" = warn &&
     1408         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
     1409        $ECHO "\
     1410*** ERROR, $lockfile contains:
     1411`cat $lockfile 2>/dev/null`
     1412
     1413but it should contain:
     1414$srcfile
     1415
     1416This indicates that another process is trying to use the same
     1417temporary object file, and libtool could not work around it because
     1418your compiler does not support \`-c' and \`-o' together.  If you
     1419repeat this compilation, it may succeed, by chance, but you had better
     1420avoid parallel builds (make -j) in this platform, or get a better
     1421compiler."
     1422
     1423        $opt_dry_run || $RM $removelist
     1424        exit $EXIT_FAILURE
     1425      fi
     1426
     1427      # Just move the object if needed
     1428      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
     1429        func_show_eval '$MV "$output_obj" "$obj"' \
     1430          'error=$?; $opt_dry_run || $RM $removelist; exit $error'
     1431      fi
     1432    fi
     1433
     1434    $opt_dry_run || {
     1435      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
     1436
     1437      # Unlock the critical section if it was locked
     1438      if test "$need_locks" != no; then
     1439        removelist=$lockfile
     1440        $RM "$lockfile"
     1441      fi
     1442    }
     1443
     1444    exit $EXIT_SUCCESS
    1881445}
    1891446
     1447$opt_help || {
     1448test "$mode" = compile && func_mode_compile ${1+"$@"}
     1449}
     1450
     1451func_mode_help ()
     1452{
     1453    # We need to display help for each of the modes.
     1454    case $mode in
     1455      "")
     1456        # Generic help is extracted from the usage comments
     1457        # at the start of this file.
     1458        func_help
     1459        ;;
     1460
     1461      clean)
     1462        $ECHO \
     1463"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
     1464
     1465Remove files from the build directory.
     1466
     1467RM is the name of the program to use to delete files associated with each FILE
     1468(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
     1469to RM.
     1470
     1471If FILE is a libtool library, object or program, all the files associated
     1472with it are deleted. Otherwise, only FILE itself is deleted using RM."
     1473        ;;
     1474
     1475      compile)
     1476      $ECHO \
     1477"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
     1478
     1479Compile a source file into a libtool library object.
     1480
     1481This mode accepts the following additional options:
     1482
     1483  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
     1484  -no-suppress      do not suppress compiler output for multiple passes
     1485  -prefer-pic       try to building PIC objects only
     1486  -prefer-non-pic   try to building non-PIC objects only
     1487  -shared           do not build a \`.o' file suitable for static linking
     1488  -static           only build a \`.o' file suitable for static linking
     1489
     1490COMPILE-COMMAND is a command to be used in creating a \`standard' object file
     1491from the given SOURCEFILE.
     1492
     1493The output file name is determined by removing the directory component from
     1494SOURCEFILE, then substituting the C source code suffix \`.c' with the
     1495library object suffix, \`.lo'."
     1496        ;;
     1497
     1498      execute)
     1499        $ECHO \
     1500"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
     1501
     1502Automatically set library path, then run a program.
     1503
     1504This mode accepts the following additional options:
     1505
     1506  -dlopen FILE      add the directory containing FILE to the library path
     1507
     1508This mode sets the library path environment variable according to \`-dlopen'
     1509flags.
     1510
     1511If any of the ARGS are libtool executable wrappers, then they are translated
     1512into their corresponding uninstalled binary, and any of their required library
     1513directories are added to the library path.
     1514
     1515Then, COMMAND is executed, with ARGS as arguments."
     1516        ;;
     1517
     1518      finish)
     1519        $ECHO \
     1520"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
     1521
     1522Complete the installation of libtool libraries.
     1523
     1524Each LIBDIR is a directory that contains libtool libraries.
     1525
     1526The commands that this mode executes may require superuser privileges.  Use
     1527the \`--dry-run' option if you just want to see what would be executed."
     1528        ;;
     1529
     1530      install)
     1531        $ECHO \
     1532"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
     1533
     1534Install executables or libraries.
     1535
     1536INSTALL-COMMAND is the installation command.  The first component should be
     1537either the \`install' or \`cp' program.
     1538
     1539The following components of INSTALL-COMMAND are treated specially:
     1540
     1541  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
     1542
     1543The rest of the components are interpreted as arguments to that command (only
     1544BSD-compatible install options are recognized)."
     1545        ;;
     1546
     1547      link)
     1548        $ECHO \
     1549"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
     1550
     1551Link object files or libraries together to form another library, or to
     1552create an executable program.
     1553
     1554LINK-COMMAND is a command using the C compiler that you would use to create
     1555a program from several object files.
     1556
     1557The following components of LINK-COMMAND are treated specially:
     1558
     1559  -all-static       do not do any dynamic linking at all
     1560  -avoid-version    do not add a version suffix if possible
     1561  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
     1562  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
     1563  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
     1564  -export-symbols SYMFILE
     1565                    try to export only the symbols listed in SYMFILE
     1566  -export-symbols-regex REGEX
     1567                    try to export only the symbols matching REGEX
     1568  -LLIBDIR          search LIBDIR for required installed libraries
     1569  -lNAME            OUTPUT-FILE requires the installed library libNAME
     1570  -module           build a library that can dlopened
     1571  -no-fast-install  disable the fast-install mode
     1572  -no-install       link a not-installable executable
     1573  -no-undefined     declare that a library does not refer to external symbols
     1574  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
     1575  -objectlist FILE  Use a list of object files found in FILE to specify objects
     1576  -precious-files-regex REGEX
     1577                    don't remove output files matching REGEX
     1578  -release RELEASE  specify package release information
     1579  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
     1580  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
     1581  -shared           only do dynamic linking of libtool libraries
     1582  -shrext SUFFIX    override the standard shared library file extension
     1583  -static           do not do any dynamic linking of uninstalled libtool libraries
     1584  -static-libtool-libs
     1585                    do not do any dynamic linking of libtool libraries
     1586  -version-info CURRENT[:REVISION[:AGE]]
     1587                    specify library version info [each variable defaults to 0]
     1588  -weak LIBNAME     declare that the target provides the LIBNAME interface
     1589
     1590All other options (arguments beginning with \`-') are ignored.
     1591
     1592Every other argument is treated as a filename.  Files ending in \`.la' are
     1593treated as uninstalled libtool libraries, other files are standard or library
     1594object files.
     1595
     1596If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
     1597only library objects (\`.lo' files) may be specified, and \`-rpath' is
     1598required, except when creating a convenience library.
     1599
     1600If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
     1601using \`ar' and \`ranlib', or on Windows using \`lib'.
     1602
     1603If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
     1604is created, otherwise an executable program is created."
     1605        ;;
     1606
     1607      uninstall)
     1608        $ECHO \
     1609"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
     1610
     1611Remove libraries from an installation directory.
     1612
     1613RM is the name of the program to use to delete files associated with each FILE
     1614(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
     1615to RM.
     1616
     1617If FILE is a libtool library, all the files associated with it are deleted.
     1618Otherwise, only FILE itself is deleted using RM."
     1619        ;;
     1620
     1621      *)
     1622        func_fatal_help "invalid operation mode \`$mode'"
     1623        ;;
     1624    esac
     1625
     1626    $ECHO
     1627    $ECHO "Try \`$progname --help' for more information about other modes."
     1628
     1629    exit $?
     1630}
     1631
     1632  # Now that we've collected a possible --mode arg, show help if necessary
     1633  $opt_help && func_mode_help
     1634
     1635
     1636# func_mode_execute arg...
     1637func_mode_execute ()
     1638{
     1639    $opt_debug
     1640    # The first argument is the command name.
     1641    cmd="$nonopt"
     1642    test -z "$cmd" && \
     1643      func_fatal_help "you must specify a COMMAND"
     1644
     1645    # Handle -dlopen flags immediately.
     1646    for file in $execute_dlfiles; do
     1647      test -f "$file" \
     1648        || func_fatal_help "\`$file' is not a file"
     1649
     1650      dir=
     1651      case $file in
     1652      *.la)
     1653        # Check to see that this really is a libtool archive.
     1654        func_lalib_unsafe_p "$file" \
     1655          || func_fatal_help "\`$lib' is not a valid libtool archive"
     1656
     1657        # Read the libtool library.
     1658        dlname=
     1659        library_names=
     1660        func_source "$file"
     1661
     1662        # Skip this library if it cannot be dlopened.
     1663        if test -z "$dlname"; then
     1664          # Warn if it was a shared library.
     1665          test -n "$library_names" && \
     1666            func_warning "\`$file' was not linked with \`-export-dynamic'"
     1667          continue
     1668        fi
     1669
     1670        func_dirname "$file" "" "."
     1671        dir="$func_dirname_result"
     1672
     1673        if test -f "$dir/$objdir/$dlname"; then
     1674          dir="$dir/$objdir"
     1675        else
     1676          if test ! -f "$dir/$dlname"; then
     1677            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
     1678          fi
     1679        fi
     1680        ;;
     1681
     1682      *.lo)
     1683        # Just add the directory containing the .lo file.
     1684        func_dirname "$file" "" "."
     1685        dir="$func_dirname_result"
     1686        ;;
     1687
     1688      *)
     1689        func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
     1690        continue
     1691        ;;
     1692      esac
     1693
     1694      # Get the absolute pathname.
     1695      absdir=`cd "$dir" && pwd`
     1696      test -n "$absdir" && dir="$absdir"
     1697
     1698      # Now add the directory to shlibpath_var.
     1699      if eval "test -z \"\$$shlibpath_var\""; then
     1700        eval "$shlibpath_var=\"\$dir\""
     1701      else
     1702        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
     1703      fi
     1704    done
     1705
     1706    # This variable tells wrapper scripts just to set shlibpath_var
     1707    # rather than running their programs.
     1708    libtool_execute_magic="$magic"
     1709
     1710    # Check if any of the arguments is a wrapper script.
     1711    args=
     1712    for file
     1713    do
     1714      case $file in
     1715      -*) ;;
     1716      *)
     1717        # Do a test to see if this is really a libtool program.
     1718        if func_ltwrapper_script_p "$file"; then
     1719          func_source "$file"
     1720          # Transform arg to wrapped name.
     1721          file="$progdir/$program"
     1722        elif func_ltwrapper_executable_p "$file"; then
     1723          func_ltwrapper_scriptname "$file"
     1724          func_source "$func_ltwrapper_scriptname_result"
     1725          # Transform arg to wrapped name.
     1726          file="$progdir/$program"
     1727        fi
     1728        ;;
     1729      esac
     1730      # Quote arguments (to preserve shell metacharacters).
     1731      func_quote_for_eval "$file"
     1732      args="$args $func_quote_for_eval_result"
     1733    done
     1734
     1735    if test "X$opt_dry_run" = Xfalse; then
     1736      if test -n "$shlibpath_var"; then
     1737        # Export the shlibpath_var.
     1738        eval "export $shlibpath_var"
     1739      fi
     1740
     1741      # Restore saved environment variables
     1742      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
     1743      do
     1744        eval "if test \"\${save_$lt_var+set}\" = set; then
     1745                $lt_var=\$save_$lt_var; export $lt_var
     1746              else
     1747                $lt_unset $lt_var
     1748              fi"
     1749      done
     1750
     1751      # Now prepare to actually exec the command.
     1752      exec_cmd="\$cmd$args"
     1753    else
     1754      # Display what would be done.
     1755      if test -n "$shlibpath_var"; then
     1756        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
     1757        $ECHO "export $shlibpath_var"
     1758      fi
     1759      $ECHO "$cmd$args"
     1760      exit $EXIT_SUCCESS
     1761    fi
     1762}
     1763
     1764test "$mode" = execute && func_mode_execute ${1+"$@"}
     1765
     1766
     1767# func_mode_finish arg...
     1768func_mode_finish ()
     1769{
     1770    $opt_debug
     1771    libdirs="$nonopt"
     1772    admincmds=
     1773
     1774    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
     1775      for dir
     1776      do
     1777        libdirs="$libdirs $dir"
     1778      done
     1779
     1780      for libdir in $libdirs; do
     1781        if test -n "$finish_cmds"; then
     1782          # Do each command in the finish commands.
     1783          func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
     1784'"$cmd"'"'
     1785        fi
     1786        if test -n "$finish_eval"; then
     1787          # Do the single finish_eval.
     1788          eval cmds=\"$finish_eval\"
     1789          $opt_dry_run || eval "$cmds" || admincmds="$admincmds
     1790       $cmds"
     1791        fi
     1792      done
     1793    fi
     1794
     1795    # Exit here if they wanted silent mode.
     1796    $opt_silent && exit $EXIT_SUCCESS
     1797
     1798    $ECHO "X----------------------------------------------------------------------" | $Xsed
     1799    $ECHO "Libraries have been installed in:"
     1800    for libdir in $libdirs; do
     1801      $ECHO "   $libdir"
     1802    done
     1803    $ECHO
     1804    $ECHO "If you ever happen to want to link against installed libraries"
     1805    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
     1806    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
     1807    $ECHO "flag during linking and do at least one of the following:"
     1808    if test -n "$shlibpath_var"; then
     1809      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
     1810      $ECHO "     during execution"
     1811    fi
     1812    if test -n "$runpath_var"; then
     1813      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
     1814      $ECHO "     during linking"
     1815    fi
     1816    if test -n "$hardcode_libdir_flag_spec"; then
     1817      libdir=LIBDIR
     1818      eval flag=\"$hardcode_libdir_flag_spec\"
     1819
     1820      $ECHO "   - use the \`$flag' linker flag"
     1821    fi
     1822    if test -n "$admincmds"; then
     1823      $ECHO "   - have your system administrator run these commands:$admincmds"
     1824    fi
     1825    if test -f /etc/ld.so.conf; then
     1826      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
     1827    fi
     1828    $ECHO
     1829
     1830    $ECHO "See any operating system documentation about shared libraries for"
     1831    case $host in
     1832      solaris2.[6789]|solaris2.1[0-9])
     1833        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
     1834        $ECHO "pages."
     1835        ;;
     1836      *)
     1837        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
     1838        ;;
     1839    esac
     1840    $ECHO "X----------------------------------------------------------------------" | $Xsed
     1841    exit $EXIT_SUCCESS
     1842}
     1843
     1844test "$mode" = finish && func_mode_finish ${1+"$@"}
     1845
     1846
     1847# func_mode_install arg...
     1848func_mode_install ()
     1849{
     1850    $opt_debug
     1851    # There may be an optional sh(1) argument at the beginning of
     1852    # install_prog (especially on Windows NT).
     1853    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
     1854       # Allow the use of GNU shtool's install command.
     1855       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
     1856      # Aesthetically quote it.
     1857      func_quote_for_eval "$nonopt"
     1858      install_prog="$func_quote_for_eval_result "
     1859      arg=$1
     1860      shift
     1861    else
     1862      install_prog=
     1863      arg=$nonopt
     1864    fi
     1865
     1866    # The real first argument should be the name of the installation program.
     1867    # Aesthetically quote it.
     1868    func_quote_for_eval "$arg"
     1869    install_prog="$install_prog$func_quote_for_eval_result"
     1870
     1871    # We need to accept at least all the BSD install flags.
     1872    dest=
     1873    files=
     1874    opts=
     1875    prev=
     1876    install_type=
     1877    isdir=no
     1878    stripme=
     1879    for arg
     1880    do
     1881      if test -n "$dest"; then
     1882        files="$files $dest"
     1883        dest=$arg
     1884        continue
     1885      fi
     1886
     1887      case $arg in
     1888      -d) isdir=yes ;;
     1889      -f)
     1890        case " $install_prog " in
     1891        *[\\\ /]cp\ *) ;;
     1892        *) prev=$arg ;;
     1893        esac
     1894        ;;
     1895      -g | -m | -o)
     1896        prev=$arg
     1897        ;;
     1898      -s)
     1899        stripme=" -s"
     1900        continue
     1901        ;;
     1902      -*)
     1903        ;;
     1904      *)
     1905        # If the previous option needed an argument, then skip it.
     1906        if test -n "$prev"; then
     1907          prev=
     1908        else
     1909          dest=$arg
     1910          continue
     1911        fi
     1912        ;;
     1913      esac
     1914
     1915      # Aesthetically quote the argument.
     1916      func_quote_for_eval "$arg"
     1917      install_prog="$install_prog $func_quote_for_eval_result"
     1918    done
     1919
     1920    test -z "$install_prog" && \
     1921      func_fatal_help "you must specify an install program"
     1922
     1923    test -n "$prev" && \
     1924      func_fatal_help "the \`$prev' option requires an argument"
     1925
     1926    if test -z "$files"; then
     1927      if test -z "$dest"; then
     1928        func_fatal_help "no file or destination specified"
     1929      else
     1930        func_fatal_help "you must specify a destination"
     1931      fi
     1932    fi
     1933
     1934    # Strip any trailing slash from the destination.
     1935    func_stripname '' '/' "$dest"
     1936    dest=$func_stripname_result
     1937
     1938    # Check to see that the destination is a directory.
     1939    test -d "$dest" && isdir=yes
     1940    if test "$isdir" = yes; then
     1941      destdir="$dest"
     1942      destname=
     1943    else
     1944      func_dirname_and_basename "$dest" "" "."
     1945      destdir="$func_dirname_result"
     1946      destname="$func_basename_result"
     1947
     1948      # Not a directory, so check to see that there is only one file specified.
     1949      set dummy $files; shift
     1950      test "$#" -gt 1 && \
     1951        func_fatal_help "\`$dest' is not a directory"
     1952    fi
     1953    case $destdir in
     1954    [\\/]* | [A-Za-z]:[\\/]*) ;;
     1955    *)
     1956      for file in $files; do
     1957        case $file in
     1958        *.lo) ;;
     1959        *)
     1960          func_fatal_help "\`$destdir' must be an absolute directory name"
     1961          ;;
     1962        esac
     1963      done
     1964      ;;
     1965    esac
     1966
     1967    # This variable tells wrapper scripts just to set variables rather
     1968    # than running their programs.
     1969    libtool_install_magic="$magic"
     1970
     1971    staticlibs=
     1972    future_libdirs=
     1973    current_libdirs=
     1974    for file in $files; do
     1975
     1976      # Do each installation.
     1977      case $file in
     1978      *.$libext)
     1979        # Do the static libraries later.
     1980        staticlibs="$staticlibs $file"
     1981        ;;
     1982
     1983      *.la)
     1984        # Check to see that this really is a libtool archive.
     1985        func_lalib_unsafe_p "$file" \
     1986          || func_fatal_help "\`$file' is not a valid libtool archive"
     1987
     1988        library_names=
     1989        old_library=
     1990        relink_command=
     1991        func_source "$file"
     1992
     1993        # Add the libdir to current_libdirs if it is the destination.
     1994        if test "X$destdir" = "X$libdir"; then
     1995          case "$current_libdirs " in
     1996          *" $libdir "*) ;;
     1997          *) current_libdirs="$current_libdirs $libdir" ;;
     1998          esac
     1999        else
     2000          # Note the libdir as a future libdir.
     2001          case "$future_libdirs " in
     2002          *" $libdir "*) ;;
     2003          *) future_libdirs="$future_libdirs $libdir" ;;
     2004          esac
     2005        fi
     2006
     2007        func_dirname "$file" "/" ""
     2008        dir="$func_dirname_result"
     2009        dir="$dir$objdir"
     2010
     2011        if test -n "$relink_command"; then
     2012          # Determine the prefix the user has applied to our future dir.
     2013          inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
     2014
     2015          # Don't allow the user to place us outside of our expected
     2016          # location b/c this prevents finding dependent libraries that
     2017          # are installed to the same prefix.
     2018          # At present, this check doesn't affect windows .dll's that
     2019          # are installed into $libdir/../bin (currently, that works fine)
     2020          # but it's something to keep an eye on.
     2021          test "$inst_prefix_dir" = "$destdir" && \
     2022            func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
     2023
     2024          if test -n "$inst_prefix_dir"; then
     2025            # Stick the inst_prefix_dir data into the link command.
     2026            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
     2027          else
     2028            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
     2029          fi
     2030
     2031          func_warning "relinking \`$file'"
     2032          func_show_eval "$relink_command" \
     2033            'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
     2034        fi
     2035
     2036        # See the names of the shared library.
     2037        set dummy $library_names; shift
     2038        if test -n "$1"; then
     2039          realname="$1"
     2040          shift
     2041
     2042          srcname="$realname"
     2043          test -n "$relink_command" && srcname="$realname"T
     2044
     2045          # Install the shared library and build the symlinks.
     2046          func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
     2047              'exit $?'
     2048          tstripme="$stripme"
     2049          case $host_os in
     2050          cygwin* | mingw* | pw32* | cegcc*)
     2051            case $realname in
     2052            *.dll.a)
     2053              tstripme=""
     2054              ;;
     2055            esac
     2056            ;;
     2057          esac
     2058          if test -n "$tstripme" && test -n "$striplib"; then
     2059            func_show_eval "$striplib $destdir/$realname" 'exit $?'
     2060          fi
     2061
     2062          if test "$#" -gt 0; then
     2063            # Delete the old symlinks, and create new ones.
     2064            # Try `ln -sf' first, because the `ln' binary might depend on
     2065            # the symlink we replace!  Solaris /bin/ln does not understand -f,
     2066            # so we also need to try rm && ln -s.
     2067            for linkname
     2068            do
     2069              test "$linkname" != "$realname" \
     2070                && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
     2071            done
     2072          fi
     2073
     2074          # Do each command in the postinstall commands.
     2075          lib="$destdir/$realname"
     2076          func_execute_cmds "$postinstall_cmds" 'exit $?'
     2077        fi
     2078
     2079        # Install the pseudo-library for information purposes.
     2080        func_basename "$file"
     2081        name="$func_basename_result"
     2082        instname="$dir/$name"i
     2083        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
     2084
     2085        # Maybe install the static library, too.
     2086        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
     2087        ;;
     2088
     2089      *.lo)
     2090        # Install (i.e. copy) a libtool object.
     2091
     2092        # Figure out destination file name, if it wasn't already specified.
     2093        if test -n "$destname"; then
     2094          destfile="$destdir/$destname"
     2095        else
     2096          func_basename "$file"
     2097          destfile="$func_basename_result"
     2098          destfile="$destdir/$destfile"
     2099        fi
     2100
     2101        # Deduce the name of the destination old-style object file.
     2102        case $destfile in
     2103        *.lo)
     2104          func_lo2o "$destfile"
     2105          staticdest=$func_lo2o_result
     2106          ;;
     2107        *.$objext)
     2108          staticdest="$destfile"
     2109          destfile=
     2110          ;;
     2111        *)
     2112          func_fatal_help "cannot copy a libtool object to \`$destfile'"
     2113          ;;
     2114        esac
     2115
     2116        # Install the libtool object if requested.
     2117        test -n "$destfile" && \
     2118          func_show_eval "$install_prog $file $destfile" 'exit $?'
     2119
     2120        # Install the old object if enabled.
     2121        if test "$build_old_libs" = yes; then
     2122          # Deduce the name of the old-style object file.
     2123          func_lo2o "$file"
     2124          staticobj=$func_lo2o_result
     2125          func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
     2126        fi
     2127        exit $EXIT_SUCCESS
     2128        ;;
     2129
     2130      *)
     2131        # Figure out destination file name, if it wasn't already specified.
     2132        if test -n "$destname"; then
     2133          destfile="$destdir/$destname"
     2134        else
     2135          func_basename "$file"
     2136          destfile="$func_basename_result"
     2137          destfile="$destdir/$destfile"
     2138        fi
     2139
     2140        # If the file is missing, and there is a .exe on the end, strip it
     2141        # because it is most likely a libtool script we actually want to
     2142        # install
     2143        stripped_ext=""
     2144        case $file in
     2145          *.exe)
     2146            if test ! -f "$file"; then
     2147              func_stripname '' '.exe' "$file"
     2148              file=$func_stripname_result
     2149              stripped_ext=".exe"
     2150            fi
     2151            ;;
     2152        esac
     2153
     2154        # Do a test to see if this is really a libtool program.
     2155        case $host in
     2156        *cygwin* | *mingw*)
     2157            if func_ltwrapper_executable_p "$file"; then
     2158              func_ltwrapper_scriptname "$file"
     2159              wrapper=$func_ltwrapper_scriptname_result
     2160            else
     2161              func_stripname '' '.exe' "$file"
     2162              wrapper=$func_stripname_result
     2163            fi
     2164            ;;
     2165        *)
     2166            wrapper=$file
     2167            ;;
     2168        esac
     2169        if func_ltwrapper_script_p "$wrapper"; then
     2170          notinst_deplibs=
     2171          relink_command=
     2172
     2173          func_source "$wrapper"
     2174
     2175          # Check the variables that should have been set.
     2176          test -z "$generated_by_libtool_version" && \
     2177            func_fatal_error "invalid libtool wrapper script \`$wrapper'"
     2178
     2179          finalize=yes
     2180          for lib in $notinst_deplibs; do
     2181            # Check to see that each library is installed.
     2182            libdir=
     2183            if test -f "$lib"; then
     2184              func_source "$lib"
     2185            fi
     2186            libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
     2187            if test -n "$libdir" && test ! -f "$libfile"; then
     2188              func_warning "\`$lib' has not been installed in \`$libdir'"
     2189              finalize=no
     2190            fi
     2191          done
     2192
     2193          relink_command=
     2194          func_source "$wrapper"
     2195
     2196          outputname=
     2197          if test "$fast_install" = no && test -n "$relink_command"; then
     2198            $opt_dry_run || {
     2199              if test "$finalize" = yes; then
     2200                tmpdir=`func_mktempdir`
     2201                func_basename "$file$stripped_ext"
     2202                file="$func_basename_result"
     2203                outputname="$tmpdir/$file"
     2204                # Replace the output file specification.
     2205                relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
     2206
     2207                $opt_silent || {
     2208                  func_quote_for_expand "$relink_command"
     2209                  eval "func_echo $func_quote_for_expand_result"
     2210                }
     2211                if eval "$relink_command"; then :
     2212                  else
     2213                  func_error "error: relink \`$file' with the above command before installing it"
     2214                  $opt_dry_run || ${RM}r "$tmpdir"
     2215                  continue
     2216                fi
     2217                file="$outputname"
     2218              else
     2219                func_warning "cannot relink \`$file'"
     2220              fi
     2221            }
     2222          else
     2223            # Install the binary that we compiled earlier.
     2224            file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
     2225          fi
     2226        fi
     2227
     2228        # remove .exe since cygwin /usr/bin/install will append another
     2229        # one anyway
     2230        case $install_prog,$host in
     2231        */usr/bin/install*,*cygwin*)
     2232          case $file:$destfile in
     2233          *.exe:*.exe)
     2234            # this is ok
     2235            ;;
     2236          *.exe:*)
     2237            destfile=$destfile.exe
     2238            ;;
     2239          *:*.exe)
     2240            func_stripname '' '.exe' "$destfile"
     2241            destfile=$func_stripname_result
     2242            ;;
     2243          esac
     2244          ;;
     2245        esac
     2246        func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
     2247        $opt_dry_run || if test -n "$outputname"; then
     2248          ${RM}r "$tmpdir"
     2249        fi
     2250        ;;
     2251      esac
     2252    done
     2253
     2254    for file in $staticlibs; do
     2255      func_basename "$file"
     2256      name="$func_basename_result"
     2257
     2258      # Set up the ranlib parameters.
     2259      oldlib="$destdir/$name"
     2260
     2261      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
     2262
     2263      if test -n "$stripme" && test -n "$old_striplib"; then
     2264        func_show_eval "$old_striplib $oldlib" 'exit $?'
     2265      fi
     2266
     2267      # Do each command in the postinstall commands.
     2268      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
     2269    done
     2270
     2271    test -n "$future_libdirs" && \
     2272      func_warning "remember to run \`$progname --finish$future_libdirs'"
     2273
     2274    if test -n "$current_libdirs"; then
     2275      # Maybe just do a dry run.
     2276      $opt_dry_run && current_libdirs=" -n$current_libdirs"
     2277      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
     2278    else
     2279      exit $EXIT_SUCCESS
     2280    fi
     2281}
     2282
     2283test "$mode" = install && func_mode_install ${1+"$@"}
     2284
     2285
     2286# func_generate_dlsyms outputname originator pic_p
     2287# Extract symbols from dlprefiles and create ${outputname}S.o with
     2288# a dlpreopen symbol table.
     2289func_generate_dlsyms ()
     2290{
     2291    $opt_debug
     2292    my_outputname="$1"
     2293    my_originator="$2"
     2294    my_pic_p="${3-no}"
     2295    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
     2296    my_dlsyms=
     2297
     2298    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
     2299      if test -n "$NM" && test -n "$global_symbol_pipe"; then
     2300        my_dlsyms="${my_outputname}S.c"
     2301      else
     2302        func_error "not configured to extract global symbols from dlpreopened files"
     2303      fi
     2304    fi
     2305
     2306    if test -n "$my_dlsyms"; then
     2307      case $my_dlsyms in
     2308      "") ;;
     2309      *.c)
     2310        # Discover the nlist of each of the dlfiles.
     2311        nlist="$output_objdir/${my_outputname}.nm"
     2312
     2313        func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
     2314
     2315        # Parse the name list into a source file.
     2316        func_verbose "creating $output_objdir/$my_dlsyms"
     2317
     2318        $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
     2319/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
     2320/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
     2321
     2322#ifdef __cplusplus
     2323extern \"C\" {
     2324#endif
     2325
     2326/* External symbol declarations for the compiler. */\
     2327"
     2328
     2329        if test "$dlself" = yes; then
     2330          func_verbose "generating symbol list for \`$output'"
     2331
     2332          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
     2333
     2334          # Add our own program objects to the symbol list.
     2335          progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
     2336          for progfile in $progfiles; do
     2337            func_verbose "extracting global C symbols from \`$progfile'"
     2338            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
     2339          done
     2340
     2341          if test -n "$exclude_expsyms"; then
     2342            $opt_dry_run || {
     2343              eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
     2344              eval '$MV "$nlist"T "$nlist"'
     2345            }
     2346          fi
     2347
     2348          if test -n "$export_symbols_regex"; then
     2349            $opt_dry_run || {
     2350              eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
     2351              eval '$MV "$nlist"T "$nlist"'
     2352            }
     2353          fi
     2354
     2355          # Prepare the list of exported symbols
     2356          if test -z "$export_symbols"; then
     2357            export_symbols="$output_objdir/$outputname.exp"
     2358            $opt_dry_run || {
     2359              $RM $export_symbols
     2360              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
     2361              case $host in
     2362              *cygwin* | *mingw* | *cegcc* )
     2363                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
     2364                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
     2365                ;;
     2366              esac
     2367            }
     2368          else
     2369            $opt_dry_run || {
     2370              eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
     2371              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
     2372              eval '$MV "$nlist"T "$nlist"'
     2373              case $host in
     2374                *cygwin | *mingw* | *cegcc* )
     2375                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
     2376                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
     2377                  ;;
     2378              esac
     2379            }
     2380          fi
     2381        fi
     2382
     2383        for dlprefile in $dlprefiles; do
     2384          func_verbose "extracting global C symbols from \`$dlprefile'"
     2385          func_basename "$dlprefile"
     2386          name="$func_basename_result"
     2387          $opt_dry_run || {
     2388            eval '$ECHO ": $name " >> "$nlist"'
     2389            eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
     2390          }
     2391        done
     2392
     2393        $opt_dry_run || {
     2394          # Make sure we have at least an empty file.
     2395          test -f "$nlist" || : > "$nlist"
     2396
     2397          if test -n "$exclude_expsyms"; then
     2398            $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
     2399            $MV "$nlist"T "$nlist"
     2400          fi
     2401
     2402          # Try sorting and uniquifying the output.
     2403          if $GREP -v "^: " < "$nlist" |
     2404              if sort -k 3 </dev/null >/dev/null 2>&1; then
     2405                sort -k 3
     2406              else
     2407                sort +2
     2408              fi |
     2409              uniq > "$nlist"S; then
     2410            :
     2411          else
     2412            $GREP -v "^: " < "$nlist" > "$nlist"S
     2413          fi
     2414
     2415          if test -f "$nlist"S; then
     2416            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
     2417          else
     2418            $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
     2419          fi
     2420
     2421          $ECHO >> "$output_objdir/$my_dlsyms" "\
     2422
     2423/* The mapping between symbol names and symbols.  */
     2424typedef struct {
     2425  const char *name;
     2426  void *address;
     2427} lt_dlsymlist;
     2428"
     2429          case $host in
     2430          *cygwin* | *mingw* | *cegcc* )
     2431            $ECHO >> "$output_objdir/$my_dlsyms" "\
     2432/* DATA imports from DLLs on WIN32 con't be const, because
     2433   runtime relocations are performed -- see ld's documentation
     2434   on pseudo-relocs.  */"
     2435            lt_dlsym_const= ;;
     2436          *osf5*)
     2437            echo >> "$output_objdir/$my_dlsyms" "\
     2438/* This system does not cope well with relocations in const data */"
     2439            lt_dlsym_const= ;;
     2440          *)
     2441            lt_dlsym_const=const ;;
     2442          esac
     2443
     2444          $ECHO >> "$output_objdir/$my_dlsyms" "\
     2445extern $lt_dlsym_const lt_dlsymlist
     2446lt_${my_prefix}_LTX_preloaded_symbols[];
     2447$lt_dlsym_const lt_dlsymlist
     2448lt_${my_prefix}_LTX_preloaded_symbols[] =
     2449{\
     2450  { \"$my_originator\", (void *) 0 },"
     2451
     2452          case $need_lib_prefix in
     2453          no)
     2454            eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
     2455            ;;
     2456          *)
     2457            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
     2458            ;;
     2459          esac
     2460          $ECHO >> "$output_objdir/$my_dlsyms" "\
     2461  {0, (void *) 0}
     2462};
     2463
     2464/* This works around a problem in FreeBSD linker */
     2465#ifdef FREEBSD_WORKAROUND
     2466static const void *lt_preloaded_setup() {
     2467  return lt_${my_prefix}_LTX_preloaded_symbols;
     2468}
     2469#endif
     2470
     2471#ifdef __cplusplus
     2472}
     2473#endif\
     2474"
     2475        } # !$opt_dry_run
     2476
     2477        pic_flag_for_symtable=
     2478        case "$compile_command " in
     2479        *" -static "*) ;;
     2480        *)
     2481          case $host in
     2482          # compiling the symbol table file with pic_flag works around
     2483          # a FreeBSD bug that causes programs to crash when -lm is
     2484          # linked before any other PIC object.  But we must not use
     2485          # pic_flag when linking with -static.  The problem exists in
     2486          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
     2487          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
     2488            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
     2489          *-*-hpux*)
     2490            pic_flag_for_symtable=" $pic_flag"  ;;
     2491          *)
     2492            if test "X$my_pic_p" != Xno; then
     2493              pic_flag_for_symtable=" $pic_flag"
     2494            fi
     2495            ;;
     2496          esac
     2497          ;;
     2498        esac
     2499        symtab_cflags=
     2500        for arg in $LTCFLAGS; do
     2501          case $arg in
     2502          -pie | -fpie | -fPIE) ;;
     2503          *) symtab_cflags="$symtab_cflags $arg" ;;
     2504          esac
     2505        done
     2506
     2507        # Now compile the dynamic symbol file.
     2508        func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
     2509
     2510        # Clean up the generated files.
     2511        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
     2512
     2513        # Transform the symbol file into the correct name.
     2514        symfileobj="$output_objdir/${my_outputname}S.$objext"
     2515        case $host in
     2516        *cygwin* | *mingw* | *cegcc* )
     2517          if test -f "$output_objdir/$my_outputname.def"; then
     2518            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
     2519            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
     2520          else
     2521            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
     2522            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
     2523          fi
     2524          ;;
     2525        *)
     2526          compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
     2527          finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
     2528          ;;
     2529        esac
     2530        ;;
     2531      *)
     2532        func_fatal_error "unknown suffix for \`$my_dlsyms'"
     2533        ;;
     2534      esac
     2535    else
     2536      # We keep going just in case the user didn't refer to
     2537      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
     2538      # really was required.
     2539
     2540      # Nullify the symbol file.
     2541      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
     2542      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
     2543    fi
     2544}
    1902545
    1912546# func_win32_libid arg
     
    1972552func_win32_libid ()
    1982553{
     2554  $opt_debug
    1992555  win32_libid_type="unknown"
    2002556  win32_fileres=`file -L $1 2>/dev/null`
     
    2042560    ;;
    2052561  *ar\ archive*) # could be an import, or static
    206     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
    207       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
    208       win32_nmres=`eval $NM -f posix -A $1 | \
    209         $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
     2562    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
     2563       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
     2564      win32_nmres=`eval $NM -f posix -A $1 |
     2565        $SED -n -e '
     2566            1,100{
     2567                / I /{
     2568                    s,.*,import,
     2569                    p
     2570                    q
     2571                }
     2572            }'`
    2102573      case $win32_nmres in
    2112574      import*)  win32_libid_type="x86 archive import";;
     
    2252588    ;;
    2262589  esac
    227   $echo $win32_libid_type
     2590  $ECHO "$win32_libid_type"
    2282591}
    2292592
    230 
    231 # func_infer_tag arg
    232 # Infer tagged configuration to use if any are available and
    233 # if one wasn't chosen via the "--tag" command line option.
    234 # Only attempt this if the compiler in the base compile
    235 # command doesn't match the default compiler.
    236 # arg is usually of the form 'gcc ...'
    237 func_infer_tag ()
    238 {
    239     if test -n "$available_tags" && test -z "$tagname"; then
    240       CC_quoted=
    241       for arg in $CC; do
    242         case $arg in
    243           *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
    244           arg="\"$arg\""
    245           ;;
    246         esac
    247         CC_quoted="$CC_quoted $arg"
    248       done
    249       case $@ in
    250       # Blanks in the command may have been stripped by the calling shell,
    251       # but not from the CC environment variable when configure was run.
    252       " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
    253       # Blanks at the start of $base_compile will cause this to fail
    254       # if we don't check for them as well.
    255       *)
    256         for z in $available_tags; do
    257           if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
    258             # Evaluate the configuration.
    259             eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
    260             CC_quoted=
    261             for arg in $CC; do
    262             # Double-quote args containing other shell metacharacters.
    263             case $arg in
    264               *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
    265               arg="\"$arg\""
    266               ;;
    267             esac
    268             CC_quoted="$CC_quoted $arg"
    269           done
    270             case "$@ " in
    271               " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
    272               # The compiler in the base compile command matches
    273               # the one in the tagged configuration.
    274               # Assume this is the tagged configuration we want.
    275               tagname=$z
    276               break
    277               ;;
    278             esac
    279           fi
    280         done
    281         # If $tagname still isn't set, then no tagged configuration
    282         # was found and let the user know that the "--tag" command