diff options
| -rw-r--r-- | .cvsignore | 1 | ||||
| -rwxr-xr-x | config.guess | 1465 | ||||
| -rwxr-xr-x | config.sub | 1569 | ||||
| -rw-r--r-- | doc/developer-guidelines.sgml | 4 | ||||
| -rw-r--r-- | ltmain.sh | 6871 |
5 files changed, 9908 insertions, 2 deletions
| @@ -15,6 +15,5 @@ missing | |||
| 15 | depcomp | 15 | depcomp |
| 16 | THANKS | 16 | THANKS |
| 17 | libtool | 17 | libtool |
| 18 | ltmain.sh | ||
| 19 | compile | 18 | compile |
| 20 | INSTALL | 19 | INSTALL |
diff --git a/config.guess b/config.guess new file mode 100755 index 00000000..45bee139 --- /dev/null +++ b/config.guess | |||
| @@ -0,0 +1,1465 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | # Attempt to guess a canonical system name. | ||
| 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | ||
| 4 | # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | ||
| 5 | |||
| 6 | timestamp='2005-04-22' | ||
| 7 | |||
| 8 | # This file is free software; you can redistribute it and/or modify it | ||
| 9 | # under the terms of the GNU General Public License as published by | ||
| 10 | # the Free Software Foundation; either version 2 of the License, or | ||
| 11 | # (at your option) any later version. | ||
| 12 | # | ||
| 13 | # This program is distributed in the hope that it will be useful, but | ||
| 14 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | # General Public License for more details. | ||
| 17 | # | ||
| 18 | # 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 21 | # | ||
| 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 | # Originally written by Per Bothner <per@bothner.com>. | ||
| 28 | # Please send patches to <config-patches@gnu.org>. Submit a context | ||
| 29 | # diff and a properly formatted ChangeLog entry. | ||
| 30 | # | ||
| 31 | # This script attempts to guess a canonical system name similar to | ||
| 32 | # config.sub. If it succeeds, it prints the system name on stdout, and | ||
| 33 | # exits with 0. Otherwise, it exits with 1. | ||
| 34 | # | ||
| 35 | # The plan is that this can be called by configure scripts if you | ||
| 36 | # don't specify an explicit build system type. | ||
| 37 | |||
| 38 | me=`echo "$0" | sed -e 's,.*/,,'` | ||
| 39 | |||
| 40 | usage="\ | ||
| 41 | Usage: $0 [OPTION] | ||
| 42 | |||
| 43 | Output the configuration name of the system \`$me' is run on. | ||
| 44 | |||
| 45 | Operation modes: | ||
| 46 | -h, --help print this help, then exit | ||
| 47 | -t, --time-stamp print date of last modification, then exit | ||
| 48 | -v, --version print version number, then exit | ||
| 49 | |||
| 50 | Report bugs and patches to <config-patches@gnu.org>." | ||
| 51 | |||
| 52 | version="\ | ||
| 53 | GNU config.guess ($timestamp) | ||
| 54 | |||
| 55 | Originally written by Per Bothner. | ||
| 56 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 | ||
| 57 | Free Software Foundation, Inc. | ||
| 58 | |||
| 59 | This is free software; see the source for copying conditions. There is NO | ||
| 60 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | ||
| 61 | |||
| 62 | help=" | ||
| 63 | Try \`$me --help' for more information." | ||
| 64 | |||
| 65 | # Parse command line | ||
| 66 | while test $# -gt 0 ; do | ||
| 67 | case $1 in | ||
| 68 | --time-stamp | --time* | -t ) | ||
| 69 | echo "$timestamp" ; exit 0 ;; | ||
| 70 | --version | -v ) | ||
| 71 | echo "$version" ; exit 0 ;; | ||
| 72 | --help | --h* | -h ) | ||
| 73 | echo "$usage"; exit 0 ;; | ||
| 74 | -- ) # Stop option processing | ||
| 75 | shift; break ;; | ||
| 76 | - ) # Use stdin as input. | ||
| 77 | break ;; | ||
| 78 | -* ) | ||
| 79 | echo "$me: invalid option $1$help" >&2 | ||
| 80 | exit 1 ;; | ||
| 81 | * ) | ||
| 82 | break ;; | ||
| 83 | esac | ||
| 84 | done | ||
| 85 | |||
| 86 | if test $# != 0; then | ||
| 87 | echo "$me: too many arguments$help" >&2 | ||
| 88 | exit 1 | ||
| 89 | fi | ||
| 90 | |||
| 91 | trap 'exit 1' 1 2 15 | ||
| 92 | |||
| 93 | # CC_FOR_BUILD -- compiler used by this script. Note that the use of a | ||
| 94 | # compiler to aid in system detection is discouraged as it requires | ||
| 95 | # temporary files to be created and, as you can see below, it is a | ||
| 96 | # headache to deal with in a portable fashion. | ||
| 97 | |||
| 98 | # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still | ||
| 99 | # use `HOST_CC' if defined, but it is deprecated. | ||
| 100 | |||
| 101 | # Portable tmp directory creation inspired by the Autoconf team. | ||
| 102 | |||
| 103 | set_cc_for_build=' | ||
| 104 | trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; | ||
| 105 | trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; | ||
| 106 | : ${TMPDIR=/tmp} ; | ||
| 107 | { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || | ||
| 108 | { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || | ||
| 109 | { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || | ||
| 110 | { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; | ||
| 111 | dummy=$tmp/dummy ; | ||
| 112 | tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; | ||
| 113 | case $CC_FOR_BUILD,$HOST_CC,$CC in | ||
| 114 | ,,) echo "int x;" > $dummy.c ; | ||
| 115 | for c in cc gcc c89 c99 ; do | ||
| 116 | if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then | ||
| 117 | CC_FOR_BUILD="$c"; break ; | ||
| 118 | fi ; | ||
| 119 | done ; | ||
| 120 | if test x"$CC_FOR_BUILD" = x ; then | ||
| 121 | CC_FOR_BUILD=no_compiler_found ; | ||
| 122 | fi | ||
| 123 | ;; | ||
| 124 | ,,*) CC_FOR_BUILD=$CC ;; | ||
| 125 | ,*,*) CC_FOR_BUILD=$HOST_CC ;; | ||
| 126 | esac ;' | ||
| 127 | |||
| 128 | # This is needed to find uname on a Pyramid OSx when run in the BSD universe. | ||
| 129 | # (ghazi@noc.rutgers.edu 1994-08-24) | ||
| 130 | if (test -f /.attbin/uname) >/dev/null 2>&1 ; then | ||
| 131 | PATH=$PATH:/.attbin ; export PATH | ||
| 132 | fi | ||
| 133 | |||
| 134 | UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown | ||
| 135 | UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown | ||
| 136 | UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown | ||
| 137 | UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown | ||
| 138 | |||
| 139 | # Note: order is significant - the case branches are not exclusive. | ||
| 140 | |||
| 141 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | ||
| 142 | *:NetBSD:*:*) | ||
| 143 | # NetBSD (nbsd) targets should (where applicable) match one or | ||
| 144 | # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, | ||
| 145 | # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently | ||
| 146 | # switched to ELF, *-*-netbsd* would select the old | ||
| 147 | # object file format. This provides both forward | ||
| 148 | # compatibility and a consistent mechanism for selecting the | ||
| 149 | # object file format. | ||
| 150 | # | ||
| 151 | # Note: NetBSD doesn't particularly care about the vendor | ||
| 152 | # portion of the name. We always set it to "unknown". | ||
| 153 | sysctl="sysctl -n hw.machine_arch" | ||
| 154 | UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ | ||
| 155 | /usr/sbin/$sysctl 2>/dev/null || echo unknown)` | ||
| 156 | case "${UNAME_MACHINE_ARCH}" in | ||
| 157 | armeb) machine=armeb-unknown ;; | ||
| 158 | arm*) machine=arm-unknown ;; | ||
| 159 | sh3el) machine=shl-unknown ;; | ||
| 160 | sh3eb) machine=sh-unknown ;; | ||
| 161 | *) machine=${UNAME_MACHINE_ARCH}-unknown ;; | ||
| 162 | esac | ||
| 163 | # The Operating System including object format, if it has switched | ||
| 164 | # to ELF recently, or will in the future. | ||
| 165 | case "${UNAME_MACHINE_ARCH}" in | ||
| 166 | arm*|i386|m68k|ns32k|sh3*|sparc|vax) | ||
| 167 | eval $set_cc_for_build | ||
| 168 | if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | ||
| 169 | | grep __ELF__ >/dev/null | ||
| 170 | then | ||
| 171 | # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). | ||
| 172 | # Return netbsd for either. FIX? | ||
| 173 | os=netbsd | ||
| 174 | else | ||
| 175 | os=netbsdelf | ||
| 176 | fi | ||
| 177 | ;; | ||
| 178 | *) | ||
| 179 | os=netbsd | ||
| 180 | ;; | ||
| 181 | esac | ||
| 182 | # The OS release | ||
| 183 | # Debian GNU/NetBSD machines have a different userland, and | ||
| 184 | # thus, need a distinct triplet. However, they do not need | ||
| 185 | # kernel version information, so it can be replaced with a | ||
| 186 | # suitable tag, in the style of linux-gnu. | ||
| 187 | case "${UNAME_VERSION}" in | ||
| 188 | Debian*) | ||
| 189 | release='-gnu' | ||
| 190 | ;; | ||
| 191 | *) | ||
| 192 | release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | ||
| 193 | ;; | ||
| 194 | esac | ||
| 195 | # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: | ||
| 196 | # contains redundant information, the shorter form: | ||
| 197 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. | ||
| 198 | echo "${machine}-${os}${release}" | ||
| 199 | exit 0 ;; | ||
| 200 | amd64:OpenBSD:*:*) | ||
| 201 | echo x86_64-unknown-openbsd${UNAME_RELEASE} | ||
| 202 | exit 0 ;; | ||
| 203 | amiga:OpenBSD:*:*) | ||
| 204 | echo m68k-unknown-openbsd${UNAME_RELEASE} | ||
| 205 | exit 0 ;; | ||
| 206 | cats:OpenBSD:*:*) | ||
| 207 | echo arm-unknown-openbsd${UNAME_RELEASE} | ||
| 208 | exit 0 ;; | ||
| 209 | hp300:OpenBSD:*:*) | ||
| 210 | echo m68k-unknown-openbsd${UNAME_RELEASE} | ||
| 211 | exit 0 ;; | ||
| 212 | luna88k:OpenBSD:*:*) | ||
| 213 | echo m88k-unknown-openbsd${UNAME_RELEASE} | ||
| 214 | exit 0 ;; | ||
| 215 | mac68k:OpenBSD:*:*) | ||
| 216 | echo m68k-unknown-openbsd${UNAME_RELEASE} | ||
| 217 | exit 0 ;; | ||
| 218 | macppc:OpenBSD:*:*) | ||
| 219 | echo powerpc-unknown-openbsd${UNAME_RELEASE} | ||
| 220 | exit 0 ;; | ||
| 221 | mvme68k:OpenBSD:*:*) | ||
| 222 | echo m68k-unknown-openbsd${UNAME_RELEASE} | ||
| 223 | exit 0 ;; | ||
| 224 | mvme88k:OpenBSD:*:*) | ||
| 225 | echo m88k-unknown-openbsd${UNAME_RELEASE} | ||
| 226 | exit 0 ;; | ||
| 227 | mvmeppc:OpenBSD:*:*) | ||
| 228 | echo powerpc-unknown-openbsd${UNAME_RELEASE} | ||
| 229 | exit 0 ;; | ||
| 230 | sgi:OpenBSD:*:*) | ||
| 231 | echo mips64-unknown-openbsd${UNAME_RELEASE} | ||
| 232 | exit 0 ;; | ||
| 233 | sun3:OpenBSD:*:*) | ||
| 234 | echo m68k-unknown-openbsd${UNAME_RELEASE} | ||
| 235 | exit 0 ;; | ||
| 236 | *:OpenBSD:*:*) | ||
| 237 | echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} | ||
| 238 | exit 0 ;; | ||
| 239 | *:ekkoBSD:*:*) | ||
| 240 | echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} | ||
| 241 | exit 0 ;; | ||
| 242 | macppc:MirBSD:*:*) | ||
| 243 | echo powerppc-unknown-mirbsd${UNAME_RELEASE} | ||
| 244 | exit 0 ;; | ||
| 245 | *:MirBSD:*:*) | ||
| 246 | echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} | ||
| 247 | exit 0 ;; | ||
| 248 | alpha:OSF1:*:*) | ||
| 249 | case $UNAME_RELEASE in | ||
| 250 | *4.0) | ||
| 251 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` | ||
| 252 | ;; | ||
| 253 | *5.*) | ||
| 254 | UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` | ||
| 255 | ;; | ||
| 256 | esac | ||
| 257 | # According to Compaq, /usr/sbin/psrinfo has been available on | ||
| 258 | # OSF/1 and Tru64 systems produced since 1995. I hope that | ||
| 259 | # covers most systems running today. This code pipes the CPU | ||
| 260 | # types through head -n 1, so we only detect the type of CPU 0. | ||
| 261 | ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` | ||
| 262 | case "$ALPHA_CPU_TYPE" in | ||
| 263 | "EV4 (21064)") | ||
| 264 | UNAME_MACHINE="alpha" ;; | ||
| 265 | "EV4.5 (21064)") | ||
| 266 | UNAME_MACHINE="alpha" ;; | ||
| 267 | "LCA4 (21066/21068)") | ||
| 268 | UNAME_MACHINE="alpha" ;; | ||
| 269 | "EV5 (21164)") | ||
| 270 | UNAME_MACHINE="alphaev5" ;; | ||
| 271 | "EV5.6 (21164A)") | ||
| 272 | UNAME_MACHINE="alphaev56" ;; | ||
| 273 | "EV5.6 (21164PC)") | ||
| 274 | UNAME_MACHINE="alphapca56" ;; | ||
| 275 | "EV5.7 (21164PC)") | ||
| 276 | UNAME_MACHINE="alphapca57" ;; | ||
| 277 | "EV6 (21264)") | ||
| 278 | UNAME_MACHINE="alphaev6" ;; | ||
| 279 | "EV6.7 (21264A)") | ||
| 280 | UNAME_MACHINE="alphaev67" ;; | ||
| 281 | "EV6.8CB (21264C)") | ||
| 282 | UNAME_MACHINE="alphaev68" ;; | ||
| 283 | "EV6.8AL (21264B)") | ||
| 284 | UNAME_MACHINE="alphaev68" ;; | ||
| 285 | "EV6.8CX (21264D)") | ||
| 286 | UNAME_MACHINE="alphaev68" ;; | ||
| 287 | "EV6.9A (21264/EV69A)") | ||
| 288 | UNAME_MACHINE="alphaev69" ;; | ||
| 289 | "EV7 (21364)") | ||
| 290 | UNAME_MACHINE="alphaev7" ;; | ||
| 291 | "EV7.9 (21364A)") | ||
| 292 | UNAME_MACHINE="alphaev79" ;; | ||
| 293 | esac | ||
| 294 | # A Pn.n version is a patched version. | ||
| 295 | # A Vn.n version is a released version. | ||
| 296 | # A Tn.n version is a released field test version. | ||
| 297 | # A Xn.n version is an unreleased experimental baselevel. | ||
| 298 | # 1.2 uses "1.2" for uname -r. | ||
| 299 | echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | ||
| 300 | exit 0 ;; | ||
| 301 | Alpha\ *:Windows_NT*:*) | ||
| 302 | # How do we know it's Interix rather than the generic POSIX subsystem? | ||
| 303 | # Should we change UNAME_MACHINE based on the output of uname instead | ||
| 304 | # of the specific Alpha model? | ||
| 305 | echo alpha-pc-interix | ||
| 306 | exit 0 ;; | ||
| 307 | 21064:Windows_NT:50:3) | ||
| 308 | echo alpha-dec-winnt3.5 | ||
| 309 | exit 0 ;; | ||
| 310 | Amiga*:UNIX_System_V:4.0:*) | ||
| 311 | echo m68k-unknown-sysv4 | ||
| 312 | exit 0;; | ||
| 313 | *:[Aa]miga[Oo][Ss]:*:*) | ||
| 314 | echo ${UNAME_MACHINE}-unknown-amigaos | ||
| 315 | exit 0 ;; | ||
| 316 | *:[Mm]orph[Oo][Ss]:*:*) | ||
| 317 | echo ${UNAME_MACHINE}-unknown-morphos | ||
| 318 | exit 0 ;; | ||
| 319 | *:OS/390:*:*) | ||
| 320 | echo i370-ibm-openedition | ||
| 321 | exit 0 ;; | ||
| 322 | *:z/VM:*:*) | ||
| 323 | echo s390-ibm-zvmoe | ||
| 324 | exit 0 ;; | ||
| 325 | *:OS400:*:*) | ||
| 326 | echo powerpc-ibm-os400 | ||
| 327 | exit 0 ;; | ||
| 328 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) | ||
| 329 | echo arm-acorn-riscix${UNAME_RELEASE} | ||
| 330 | exit 0;; | ||
| 331 | SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) | ||
| 332 | echo hppa1.1-hitachi-hiuxmpp | ||
| 333 | exit 0;; | ||
| 334 | Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) | ||
| 335 | # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. | ||
| 336 | if test "`(/bin/universe) 2>/dev/null`" = att ; then | ||
| 337 | echo pyramid-pyramid-sysv3 | ||
| 338 | else | ||
| 339 | echo pyramid-pyramid-bsd | ||
| 340 | fi | ||
| 341 | exit 0 ;; | ||
| 342 | NILE*:*:*:dcosx) | ||
| 343 | echo pyramid-pyramid-svr4 | ||
| 344 | exit 0 ;; | ||
| 345 | DRS?6000:unix:4.0:6*) | ||
| 346 | echo sparc-icl-nx6 | ||
| 347 | exit 0 ;; | ||
| 348 | DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) | ||
| 349 | case `/usr/bin/uname -p` in | ||
| 350 | sparc) echo sparc-icl-nx7 && exit 0 ;; | ||
| 351 | esac ;; | ||
| 352 | sun4H:SunOS:5.*:*) | ||
| 353 | echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
| 354 | exit 0 ;; | ||
| 355 | sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) | ||
| 356 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
| 357 | exit 0 ;; | ||
| 358 | i86pc:SunOS:5.*:*) | ||
| 359 | echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
| 360 | exit 0 ;; | ||
| 361 | sun4*:SunOS:6*:*) | ||
| 362 | # According to config.sub, this is the proper way to canonicalize | ||
| 363 | # SunOS6. Hard to guess exactly what SunOS6 will be like, but | ||
| 364 | # it's likely to be more like Solaris than SunOS4. | ||
| 365 | echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
| 366 | exit 0 ;; | ||
| 367 | sun4*:SunOS:*:*) | ||
| 368 | case "`/usr/bin/arch -k`" in | ||
| 369 | Series*|S4*) | ||
| 370 | UNAME_RELEASE=`uname -v` | ||
| 371 | ;; | ||
| 372 | esac | ||
| 373 | # Japanese Language versions have a version number like `4.1.3-JL'. | ||
| 374 | echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` | ||
| 375 | exit 0 ;; | ||
| 376 | sun3*:SunOS:*:*) | ||
| 377 | echo m68k-sun-sunos${UNAME_RELEASE} | ||
| 378 | exit 0 ;; | ||
| 379 | sun*:*:4.2BSD:*) | ||
| 380 | UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` | ||
| 381 | test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | ||
| 382 | case "`/bin/arch`" in | ||
| 383 | sun3) | ||
| 384 | echo m68k-sun-sunos${UNAME_RELEASE} | ||
| 385 | ;; | ||
| 386 | sun4) | ||
| 387 | echo sparc-sun-sunos${UNAME_RELEASE} | ||
| 388 | ;; | ||
| 389 | esac | ||
| 390 | exit 0 ;; | ||
| 391 | aushp:SunOS:*:*) | ||
| 392 | echo sparc-auspex-sunos${UNAME_RELEASE} | ||
| 393 | exit 0 ;; | ||
| 394 | # The situation for MiNT is a little confusing. The machine name | ||
| 395 | # can be virtually everything (everything which is not | ||
| 396 | # "atarist" or "atariste" at least should have a processor | ||
| 397 | # > m68000). The system name ranges from "MiNT" over "FreeMiNT" | ||
| 398 | # to the lowercase version "mint" (or "freemint"). Finally | ||
| 399 | # the system name "TOS" denotes a system which is actually not | ||
| 400 | # MiNT. But MiNT is downward compatible to TOS, so this should | ||
| 401 | # be no problem. | ||
| 402 | atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) | ||
| 403 | echo m68k-atari-mint${UNAME_RELEASE} | ||
| 404 | exit 0 ;; | ||
| 405 | atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) | ||
| 406 | echo m68k-atari-mint${UNAME_RELEASE} | ||
| 407 | exit 0 ;; | ||
| 408 | *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) | ||
| 409 | echo m68k-atari-mint${UNAME_RELEASE} | ||
| 410 | exit 0 ;; | ||
| 411 | milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) | ||
| 412 | echo m68k-milan-mint${UNAME_RELEASE} | ||
| 413 | exit 0 ;; | ||
| 414 | hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) | ||
| 415 | echo m68k-hades-mint${UNAME_RELEASE} | ||
| 416 | exit 0 ;; | ||
| 417 | *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) | ||
| 418 | echo m68k-unknown-mint${UNAME_RELEASE} | ||
| 419 | exit 0 ;; | ||
| 420 | m68k:machten:*:*) | ||
| 421 | echo m68k-apple-machten${UNAME_RELEASE} | ||
| 422 | exit 0 ;; | ||
| 423 | powerpc:machten:*:*) | ||
| 424 | echo powerpc-apple-machten${UNAME_RELEASE} | ||
| 425 | exit 0 ;; | ||
| 426 | RISC*:Mach:*:*) | ||
| 427 | echo mips-dec-mach_bsd4.3 | ||
| 428 | exit 0 ;; | ||
| 429 | RISC*:ULTRIX:*:*) | ||
| 430 | echo mips-dec-ultrix${UNAME_RELEASE} | ||
| 431 | exit 0 ;; | ||
| 432 | VAX*:ULTRIX*:*:*) | ||
| 433 | echo vax-dec-ultrix${UNAME_RELEASE} | ||
| 434 | exit 0 ;; | ||
| 435 | 2020:CLIX:*:* | 2430:CLIX:*:*) | ||
| 436 | echo clipper-intergraph-clix${UNAME_RELEASE} | ||
| 437 | exit 0 ;; | ||
| 438 | mips:*:*:UMIPS | mips:*:*:RISCos) | ||
| 439 | eval $set_cc_for_build | ||
| 440 | sed 's/^ //' << EOF >$dummy.c | ||
| 441 | #ifdef __cplusplus | ||
| 442 | #include <stdio.h> /* for printf() prototype */ | ||
| 443 | int main (int argc, char *argv[]) { | ||
| 444 | #else | ||
| 445 | int main (argc, argv) int argc; char *argv[]; { | ||
| 446 | #endif | ||
| 447 | #if defined (host_mips) && defined (MIPSEB) | ||
| 448 | #if defined (SYSTYPE_SYSV) | ||
| 449 | printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); | ||
| 450 | #endif | ||
| 451 | #if defined (SYSTYPE_SVR4) | ||
| 452 | printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); | ||
| 453 | #endif | ||
| 454 | #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) | ||
| 455 | printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); | ||
| 456 | #endif | ||
| 457 | #endif | ||
| 458 | exit (-1); | ||
| 459 | } | ||
| 460 | EOF | ||
| 461 | $CC_FOR_BUILD -o $dummy $dummy.c \ | ||
| 462 | && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ | ||
| 463 | && exit 0 | ||
| 464 | echo mips-mips-riscos${UNAME_RELEASE} | ||
| 465 | exit 0 ;; | ||
| 466 | Motorola:PowerMAX_OS:*:*) | ||
| 467 | echo powerpc-motorola-powermax | ||
| 468 | exit 0 ;; | ||
| 469 | Motorola:*:4.3:PL8-*) | ||
| 470 | echo powerpc-harris-powermax | ||
| 471 | exit 0 ;; | ||
| 472 | Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) | ||
| 473 | echo powerpc-harris-powermax | ||
| 474 | exit 0 ;; | ||
| 475 | Night_Hawk:Power_UNIX:*:*) | ||
| 476 | echo powerpc-harris-powerunix | ||
| 477 | exit 0 ;; | ||
| 478 | m88k:CX/UX:7*:*) | ||
| 479 | echo m88k-harris-cxux7 | ||
| 480 | exit 0 ;; | ||
| 481 | m88k:*:4*:R4*) | ||
| 482 | echo m88k-motorola-sysv4 | ||
| 483 | exit 0 ;; | ||
| 484 | m88k:*:3*:R3*) | ||
| 485 | echo m88k-motorola-sysv3 | ||
| 486 | exit 0 ;; | ||
| 487 | AViiON:dgux:*:*) | ||
| 488 | # DG/UX returns AViiON for all architectures | ||
| 489 | UNAME_PROCESSOR=`/usr/bin/uname -p` | ||
| 490 | if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] | ||
| 491 | then | ||
| 492 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ | ||
| 493 | [ ${TARGET_BINARY_INTERFACE}x = x ] | ||
| 494 | then | ||
| 495 | echo m88k-dg-dgux${UNAME_RELEASE} | ||
| 496 | else | ||
| 497 | echo m88k-dg-dguxbcs${UNAME_RELEASE} | ||
| 498 | fi | ||
| 499 | else | ||
| 500 | echo i586-dg-dgux${UNAME_RELEASE} | ||
| 501 | fi | ||
| 502 | exit 0 ;; | ||
| 503 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) | ||
| 504 | echo m88k-dolphin-sysv3 | ||
| 505 | exit 0 ;; | ||
| 506 | M88*:*:R3*:*) | ||
| 507 | # Delta 88k system running SVR3 | ||
| 508 | echo m88k-motorola-sysv3 | ||
| 509 | exit 0 ;; | ||
| 510 | XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) | ||
| 511 | echo m88k-tektronix-sysv3 | ||
| 512 | exit 0 ;; | ||
| 513 | Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) | ||
| 514 | echo m68k-tektronix-bsd | ||
| 515 | exit 0 ;; | ||
| 516 | *:IRIX*:*:*) | ||
| 517 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` | ||
| 518 | exit 0 ;; | ||
| 519 | ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. | ||
| 520 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id | ||
| 521 | exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' | ||
| 522 | i*86:AIX:*:*) | ||
| 523 | echo i386-ibm-aix | ||
| 524 | exit 0 ;; | ||
| 525 | ia64:AIX:*:*) | ||
| 526 | if [ -x /usr/bin/oslevel ] ; then | ||
| 527 | IBM_REV=`/usr/bin/oslevel` | ||
| 528 | else | ||
| 529 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | ||
| 530 | fi | ||
| 531 | echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} | ||
| 532 | exit 0 ;; | ||
| 533 | *:AIX:2:3) | ||
| 534 | if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then | ||
| 535 | eval $set_cc_for_build | ||
| 536 | sed 's/^ //' << EOF >$dummy.c | ||
| 537 | #include <sys/systemcfg.h> | ||
| 538 | |||
| 539 | main() | ||
| 540 | { | ||
| 541 | if (!__power_pc()) | ||
| 542 | exit(1); | ||
| 543 | puts("powerpc-ibm-aix3.2.5"); | ||
| 544 | exit(0); | ||
| 545 | } | ||
| 546 | EOF | ||
| 547 | $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 | ||
| 548 | echo rs6000-ibm-aix3.2.5 | ||
| 549 | elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then | ||
| 550 | echo rs6000-ibm-aix3.2.4 | ||
| 551 | else | ||
| 552 | echo rs6000-ibm-aix3.2 | ||
| 553 | fi | ||
| 554 | exit 0 ;; | ||
| 555 | *:AIX:*:[45]) | ||
| 556 | IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` | ||
| 557 | if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then | ||
| 558 | IBM_ARCH=rs6000 | ||
| 559 | else | ||
| 560 | IBM_ARCH=powerpc | ||
| 561 | fi | ||
| 562 | if [ -x /usr/bin/oslevel ] ; then | ||
| 563 | IBM_REV=`/usr/bin/oslevel` | ||
| 564 | else | ||
| 565 | IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} | ||
| 566 | fi | ||
| 567 | echo ${IBM_ARCH}-ibm-aix${IBM_REV} | ||
| 568 | exit 0 ;; | ||
| 569 | *:AIX:*:*) | ||
| 570 | echo rs6000-ibm-aix | ||
| 571 | exit 0 ;; | ||
| 572 | ibmrt:4.4BSD:*|romp-ibm:BSD:*) | ||
| 573 | echo romp-ibm-bsd4.4 | ||
| 574 | exit 0 ;; | ||
| 575 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and | ||
| 576 | echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to | ||
| 577 | exit 0 ;; # report: romp-ibm BSD 4.3 | ||
| 578 | *:BOSX:*:*) | ||
| 579 | echo rs6000-bull-bosx | ||
| 580 | exit 0 ;; | ||
| 581 | DPX/2?00:B.O.S.:*:*) | ||
| 582 | echo m68k-bull-sysv3 | ||
| 583 | exit 0 ;; | ||
| 584 | 9000/[34]??:4.3bsd:1.*:*) | ||
| 585 | echo m68k-hp-bsd | ||
| 586 | exit 0 ;; | ||
| 587 | hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) | ||
| 588 | echo m68k-hp-bsd4.4 | ||
| 589 | exit 0 ;; | ||
| 590 | 9000/[34678]??:HP-UX:*:*) | ||
| 591 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | ||
| 592 | case "${UNAME_MACHINE}" in | ||
| 593 | 9000/31? ) HP_ARCH=m68000 ;; | ||
| 594 | 9000/[34]?? ) HP_ARCH=m68k ;; | ||
| 595 | 9000/[678][0-9][0-9]) | ||
| 596 | if [ -x /usr/bin/getconf ]; then | ||
| 597 | sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` | ||
| 598 | sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` | ||
| 599 | case "${sc_cpu_version}" in | ||
| 600 | 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 | ||
| 601 | 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 | ||
| 602 | 532) # CPU_PA_RISC2_0 | ||
| 603 | case "${sc_kernel_bits}" in | ||
| 604 | 32) HP_ARCH="hppa2.0n" ;; | ||
| 605 | 64) HP_ARCH="hppa2.0w" ;; | ||
| 606 | '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 | ||
| 607 | esac ;; | ||
| 608 | esac | ||
| 609 | fi | ||
| 610 | if [ "${HP_ARCH}" = "" ]; then | ||
| 611 | eval $set_cc_for_build | ||
| 612 | sed 's/^ //' << EOF >$dummy.c | ||
| 613 | |||
| 614 | #define _HPUX_SOURCE | ||
| 615 | #include <stdlib.h> | ||
| 616 | #include <unistd.h> | ||
| 617 | |||
| 618 | int main () | ||
| 619 | { | ||
| 620 | #if defined(_SC_KERNEL_BITS) | ||
| 621 | long bits = sysconf(_SC_KERNEL_BITS); | ||
| 622 | #endif | ||
| 623 | long cpu = sysconf (_SC_CPU_VERSION); | ||
| 624 | |||
| 625 | switch (cpu) | ||
| 626 | { | ||
| 627 | case CPU_PA_RISC1_0: puts ("hppa1.0"); break; | ||
| 628 | case CPU_PA_RISC1_1: puts ("hppa1.1"); break; | ||
| 629 | case CPU_PA_RISC2_0: | ||
| 630 | #if defined(_SC_KERNEL_BITS) | ||
| 631 | switch (bits) | ||
| 632 | { | ||
| 633 | case 64: puts ("hppa2.0w"); break; | ||
| 634 | case 32: puts ("hppa2.0n"); break; | ||
| 635 | default: puts ("hppa2.0"); break; | ||
| 636 | } break; | ||
| 637 | #else /* !defined(_SC_KERNEL_BITS) */ | ||
| 638 | puts ("hppa2.0"); break; | ||
| 639 | #endif | ||
| 640 | default: puts ("hppa1.0"); break; | ||
| 641 | } | ||
| 642 | exit (0); | ||
| 643 | } | ||
| 644 | EOF | ||
| 645 | (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` | ||
| 646 | test -z "$HP_ARCH" && HP_ARCH=hppa | ||
| 647 | fi ;; | ||
| 648 | esac | ||
| 649 | if [ ${HP_ARCH} = "hppa2.0w" ] | ||
| 650 | then | ||
| 651 | # avoid double evaluation of $set_cc_for_build | ||
| 652 | test -n "$CC_FOR_BUILD" || eval $set_cc_for_build | ||
| 653 | if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null | ||
| 654 | then | ||
| 655 | HP_ARCH="hppa2.0w" | ||
| 656 | else | ||
| 657 | HP_ARCH="hppa64" | ||
| 658 | fi | ||
| 659 | fi | ||
| 660 | echo ${HP_ARCH}-hp-hpux${HPUX_REV} | ||
| 661 | exit 0 ;; | ||
| 662 | ia64:HP-UX:*:*) | ||
| 663 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | ||
| 664 | echo ia64-hp-hpux${HPUX_REV} | ||
| 665 | exit 0 ;; | ||
| 666 | 3050*:HI-UX:*:*) | ||
| 667 | eval $set_cc_for_build | ||
| 668 | sed 's/^ //' << EOF >$dummy.c | ||
| 669 | #include <unistd.h> | ||
| 670 | int | ||
| 671 | main () | ||
| 672 | { | ||
| 673 | long cpu = sysconf (_SC_CPU_VERSION); | ||
| 674 | /* The order matters, because CPU_IS_HP_MC68K erroneously returns | ||
| 675 | true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct | ||
| 676 | results, however. */ | ||
| 677 | if (CPU_IS_PA_RISC (cpu)) | ||
| 678 | { | ||
| 679 | switch (cpu) | ||
| 680 | { | ||
| 681 | case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; | ||
| 682 | case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; | ||
| 683 | case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; | ||
| 684 | default: puts ("hppa-hitachi-hiuxwe2"); break; | ||
| 685 | } | ||
| 686 | } | ||
| 687 | else if (CPU_IS_HP_MC68K (cpu)) | ||
| 688 | puts ("m68k-hitachi-hiuxwe2"); | ||
| 689 | else puts ("unknown-hitachi-hiuxwe2"); | ||
| 690 | exit (0); | ||
| 691 | } | ||
| 692 | EOF | ||
| 693 | $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 | ||
| 694 | echo unknown-hitachi-hiuxwe2 | ||
| 695 | exit 0 ;; | ||
| 696 | 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) | ||
| 697 | echo hppa1.1-hp-bsd | ||
| 698 | exit 0 ;; | ||
| 699 | 9000/8??:4.3bsd:*:*) | ||
| 700 | echo hppa1.0-hp-bsd | ||
| 701 | exit 0 ;; | ||
| 702 | *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) | ||
| 703 | echo hppa1.0-hp-mpeix | ||
| 704 | exit 0 ;; | ||
| 705 | hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) | ||
| 706 | echo hppa1.1-hp-osf | ||
| 707 | exit 0 ;; | ||
| 708 | hp8??:OSF1:*:*) | ||
| 709 | echo hppa1.0-hp-osf | ||
| 710 | exit 0 ;; | ||
| 711 | i*86:OSF1:*:*) | ||
| 712 | if [ -x /usr/sbin/sysversion ] ; then | ||
| 713 | echo ${UNAME_MACHINE}-unknown-osf1mk | ||
| 714 | else | ||
| 715 | echo ${UNAME_MACHINE}-unknown-osf1 | ||
| 716 | fi | ||
| 717 | exit 0 ;; | ||
| 718 | parisc*:Lites*:*:*) | ||
| 719 | echo hppa1.1-hp-lites | ||
| 720 | exit 0 ;; | ||
| 721 | C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) | ||
| 722 | echo c1-convex-bsd | ||
| 723 | exit 0 ;; | ||
| 724 | C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) | ||
| 725 | if getsysinfo -f scalar_acc | ||
| 726 | then echo c32-convex-bsd | ||
| 727 | else echo c2-convex-bsd | ||
| 728 | fi | ||
| 729 | exit 0 ;; | ||
| 730 | C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) | ||
| 731 | echo c34-convex-bsd | ||
| 732 | exit 0 ;; | ||
| 733 | C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) | ||
| 734 | echo c38-convex-bsd | ||
| 735 | exit 0 ;; | ||
| 736 | C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) | ||
| 737 | echo c4-convex-bsd | ||
| 738 | exit 0 ;; | ||
| 739 | CRAY*Y-MP:*:*:*) | ||
| 740 | echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
| 741 | exit 0 ;; | ||
| 742 | CRAY*[A-Z]90:*:*:*) | ||
| 743 | echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | ||
| 744 | | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ | ||
| 745 | -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ | ||
| 746 | -e 's/\.[^.]*$/.X/' | ||
| 747 | exit 0 ;; | ||
| 748 | CRAY*TS:*:*:*) | ||
| 749 | echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
| 750 | exit 0 ;; | ||
| 751 | CRAY*T3E:*:*:*) | ||
| 752 | echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
| 753 | exit 0 ;; | ||
| 754 | CRAY*SV1:*:*:*) | ||
| 755 | echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
| 756 | exit 0 ;; | ||
| 757 | *:UNICOS/mp:*:*) | ||
| 758 | echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' | ||
| 759 | exit 0 ;; | ||
| 760 | F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) | ||
| 761 | FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` | ||
| 762 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | ||
| 763 | FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | ||
| 764 | echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | ||
| 765 | exit 0 ;; | ||
| 766 | 5000:UNIX_System_V:4.*:*) | ||
| 767 | FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` | ||
| 768 | FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` | ||
| 769 | echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | ||
| 770 | exit 0 ;; | ||
| 771 | i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) | ||
| 772 | echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} | ||
| 773 | exit 0 ;; | ||
| 774 | sparc*:BSD/OS:*:*) | ||
| 775 | echo sparc-unknown-bsdi${UNAME_RELEASE} | ||
| 776 | exit 0 ;; | ||
| 777 | *:BSD/OS:*:*) | ||
| 778 | echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} | ||
| 779 | exit 0 ;; | ||
| 780 | *:FreeBSD:*:*) | ||
| 781 | echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` | ||
| 782 | exit 0 ;; | ||
| 783 | i*:CYGWIN*:*) | ||
| 784 | echo ${UNAME_MACHINE}-pc-cygwin | ||
| 785 | exit 0 ;; | ||
| 786 | i*:MINGW*:*) | ||
| 787 | echo ${UNAME_MACHINE}-pc-mingw32 | ||
| 788 | exit 0 ;; | ||
| 789 | i*:PW*:*) | ||
| 790 | echo ${UNAME_MACHINE}-pc-pw32 | ||
| 791 | exit 0 ;; | ||
| 792 | x86:Interix*:[34]*) | ||
| 793 | echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' | ||
| 794 | exit 0 ;; | ||
| 795 | [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) | ||
| 796 | echo i${UNAME_MACHINE}-pc-mks | ||
| 797 | exit 0 ;; | ||
| 798 | i*:Windows_NT*:* | Pentium*:Windows_NT*:*) | ||
| 799 | # How do we know it's Interix rather than the generic POSIX subsystem? | ||
| 800 | # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we | ||
| 801 | # UNAME_MACHINE based on the output of uname instead of i386? | ||
| 802 | echo i586-pc-interix | ||
| 803 | exit 0 ;; | ||
| 804 | i*:UWIN*:*) | ||
| 805 | echo ${UNAME_MACHINE}-pc-uwin | ||
| 806 | exit 0 ;; | ||
| 807 | amd64:CYGWIN*:*:*) | ||
| 808 | echo x86_64-unknown-cygwin | ||
| 809 | exit 0 ;; | ||
| 810 | p*:CYGWIN*:*) | ||
| 811 | echo powerpcle-unknown-cygwin | ||
| 812 | exit 0 ;; | ||
| 813 | prep*:SunOS:5.*:*) | ||
| 814 | echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | ||
| 815 | exit 0 ;; | ||
| 816 | *:GNU:*:*) | ||
| 817 | # the GNU system | ||
| 818 | echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | ||
| 819 | exit 0 ;; | ||
| 820 | *:GNU/*:*:*) | ||
| 821 | # other systems with GNU libc and userland | ||
| 822 | echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu | ||
| 823 | exit 0 ;; | ||
| 824 | i*86:Minix:*:*) | ||
| 825 | echo ${UNAME_MACHINE}-pc-minix | ||
| 826 | exit 0 ;; | ||
| 827 | arm*:Linux:*:*) | ||
| 828 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 829 | exit 0 ;; | ||
| 830 | cris:Linux:*:*) | ||
| 831 | echo cris-axis-linux-gnu | ||
| 832 | exit 0 ;; | ||
| 833 | crisv32:Linux:*:*) | ||
| 834 | echo crisv32-axis-linux-gnu | ||
| 835 | exit 0 ;; | ||
| 836 | frv:Linux:*:*) | ||
| 837 | echo frv-unknown-linux-gnu | ||
| 838 | exit 0 ;; | ||
| 839 | ia64:Linux:*:*) | ||
| 840 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 841 | exit 0 ;; | ||
| 842 | m32r*:Linux:*:*) | ||
| 843 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 844 | exit 0 ;; | ||
| 845 | m68*:Linux:*:*) | ||
| 846 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 847 | exit 0 ;; | ||
| 848 | mips:Linux:*:*) | ||
| 849 | eval $set_cc_for_build | ||
| 850 | sed 's/^ //' << EOF >$dummy.c | ||
| 851 | #undef CPU | ||
| 852 | #undef mips | ||
| 853 | #undef mipsel | ||
| 854 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | ||
| 855 | CPU=mipsel | ||
| 856 | #else | ||
| 857 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | ||
| 858 | CPU=mips | ||
| 859 | #else | ||
| 860 | CPU= | ||
| 861 | #endif | ||
| 862 | #endif | ||
| 863 | EOF | ||
| 864 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` | ||
| 865 | test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 | ||
| 866 | ;; | ||
| 867 | mips64:Linux:*:*) | ||
| 868 | eval $set_cc_for_build | ||
| 869 | sed 's/^ //' << EOF >$dummy.c | ||
| 870 | #undef CPU | ||
| 871 | #undef mips64 | ||
| 872 | #undef mips64el | ||
| 873 | #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) | ||
| 874 | CPU=mips64el | ||
| 875 | #else | ||
| 876 | #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) | ||
| 877 | CPU=mips64 | ||
| 878 | #else | ||
| 879 | CPU= | ||
| 880 | #endif | ||
| 881 | #endif | ||
| 882 | EOF | ||
| 883 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` | ||
| 884 | test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 | ||
| 885 | ;; | ||
| 886 | ppc:Linux:*:*) | ||
| 887 | echo powerpc-unknown-linux-gnu | ||
| 888 | exit 0 ;; | ||
| 889 | ppc64:Linux:*:*) | ||
| 890 | echo powerpc64-unknown-linux-gnu | ||
| 891 | exit 0 ;; | ||
| 892 | alpha:Linux:*:*) | ||
| 893 | case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in | ||
| 894 | EV5) UNAME_MACHINE=alphaev5 ;; | ||
| 895 | EV56) UNAME_MACHINE=alphaev56 ;; | ||
| 896 | PCA56) UNAME_MACHINE=alphapca56 ;; | ||
| 897 | PCA57) UNAME_MACHINE=alphapca56 ;; | ||
| 898 | EV6) UNAME_MACHINE=alphaev6 ;; | ||
| 899 | EV67) UNAME_MACHINE=alphaev67 ;; | ||
| 900 | EV68*) UNAME_MACHINE=alphaev68 ;; | ||
| 901 | esac | ||
| 902 | objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null | ||
| 903 | if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi | ||
| 904 | echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} | ||
| 905 | exit 0 ;; | ||
| 906 | parisc:Linux:*:* | hppa:Linux:*:*) | ||
| 907 | # Look for CPU level | ||
| 908 | case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in | ||
| 909 | PA7*) echo hppa1.1-unknown-linux-gnu ;; | ||
| 910 | PA8*) echo hppa2.0-unknown-linux-gnu ;; | ||
| 911 | *) echo hppa-unknown-linux-gnu ;; | ||
| 912 | esac | ||
| 913 | exit 0 ;; | ||
| 914 | parisc64:Linux:*:* | hppa64:Linux:*:*) | ||
| 915 | echo hppa64-unknown-linux-gnu | ||
| 916 | exit 0 ;; | ||
| 917 | s390:Linux:*:* | s390x:Linux:*:*) | ||
| 918 | echo ${UNAME_MACHINE}-ibm-linux | ||
| 919 | exit 0 ;; | ||
| 920 | sh64*:Linux:*:*) | ||
| 921 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 922 | exit 0 ;; | ||
| 923 | sh*:Linux:*:*) | ||
| 924 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 925 | exit 0 ;; | ||
| 926 | sparc:Linux:*:* | sparc64:Linux:*:*) | ||
| 927 | echo ${UNAME_MACHINE}-unknown-linux-gnu | ||
| 928 | exit 0 ;; | ||
| 929 | x86_64:Linux:*:*) | ||
| 930 | echo x86_64-unknown-linux-gnu | ||
| 931 | exit 0 ;; | ||
| 932 | i*86:Linux:*:*) | ||
| 933 | # The BFD linker knows what the default object file format is, so | ||
| 934 | # first see if it will tell us. cd to the root directory to prevent | ||
| 935 | # problems with other programs or directories called `ld' in the path. | ||
| 936 | # Set LC_ALL=C to ensure ld outputs messages in English. | ||
| 937 | ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | ||
| 938 | | sed -ne '/supported targets:/!d | ||
| 939 | s/[ ][ ]*/ /g | ||
| 940 | s/.*supported targets: *// | ||
| 941 | s/ .*// | ||
| 942 | p'` | ||
| 943 | case "$ld_supported_targets" in | ||
| 944 | elf32-i386) | ||
| 945 | TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" | ||
| 946 | ;; | ||
| 947 | a.out-i386-linux) | ||
| 948 | echo "${UNAME_MACHINE}-pc-linux-gnuaout" | ||
| 949 | exit 0 ;; | ||
| 950 | coff-i386) | ||
| 951 | echo "${UNAME_MACHINE}-pc-linux-gnucoff" | ||
| 952 | exit 0 ;; | ||
| 953 | "") | ||
| 954 | # Either a pre-BFD a.out linker (linux-gnuoldld) or | ||
| 955 | # one that does not give us useful --help. | ||
| 956 | echo "${UNAME_MACHINE}-pc-linux-gnuoldld" | ||
| 957 | exit 0 ;; | ||
| 958 | esac | ||
| 959 | # Determine whether the default compiler is a.out or elf | ||
| 960 | eval $set_cc_for_build | ||
| 961 | sed 's/^ //' << EOF >$dummy.c | ||
| 962 | #include <features.h> | ||
| 963 | #ifdef __ELF__ | ||
| 964 | # ifdef __GLIBC__ | ||
| 965 | # if __GLIBC__ >= 2 | ||
| 966 | LIBC=gnu | ||
| 967 | # else | ||
| 968 | LIBC=gnulibc1 | ||
| 969 | # endif | ||
| 970 | # else | ||
| 971 | LIBC=gnulibc1 | ||
| 972 | # endif | ||
| 973 | #else | ||
| 974 | #ifdef __INTEL_COMPILER | ||
| 975 | LIBC=gnu | ||
| 976 | #else | ||
| 977 | LIBC=gnuaout | ||
| 978 | #endif | ||
| 979 | #endif | ||
| 980 | #ifdef __dietlibc__ | ||
| 981 | LIBC=dietlibc | ||
| 982 | #endif | ||
| 983 | EOF | ||
| 984 | eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` | ||
| 985 | test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 | ||
| 986 | test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 | ||
| 987 | ;; | ||
| 988 | i*86:DYNIX/ptx:4*:*) | ||
| 989 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. | ||
| 990 | # earlier versions are messed up and put the nodename in both | ||
| 991 | # sysname and nodename. | ||
| 992 | echo i386-sequent-sysv4 | ||
| 993 | exit 0 ;; | ||
| 994 | i*86:UNIX_SV:4.2MP:2.*) | ||
| 995 | # Unixware is an offshoot of SVR4, but it has its own version | ||
| 996 | # number series starting with 2... | ||
| 997 | # I am not positive that other SVR4 systems won't match this, | ||
| 998 | # I just have to hope. -- rms. | ||
| 999 | # Use sysv4.2uw... so that sysv4* matches it. | ||
| 1000 | echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} | ||
| 1001 | exit 0 ;; | ||
| 1002 | i*86:OS/2:*:*) | ||
| 1003 | # If we were able to find `uname', then EMX Unix compatibility | ||
| 1004 | # is probably installed. | ||
| 1005 | echo ${UNAME_MACHINE}-pc-os2-emx | ||
| 1006 | exit 0 ;; | ||
| 1007 | i*86:XTS-300:*:STOP) | ||
| 1008 | echo ${UNAME_MACHINE}-unknown-stop | ||
| 1009 | exit 0 ;; | ||
| 1010 | i*86:atheos:*:*) | ||
| 1011 | echo ${UNAME_MACHINE}-unknown-atheos | ||
| 1012 | exit 0 ;; | ||
| 1013 | i*86:syllable:*:*) | ||
| 1014 | echo ${UNAME_MACHINE}-pc-syllable | ||
| 1015 | exit 0 ;; | ||
| 1016 | i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) | ||
| 1017 | echo i386-unknown-lynxos${UNAME_RELEASE} | ||
| 1018 | exit 0 ;; | ||
| 1019 | i*86:*DOS:*:*) | ||
| 1020 | echo ${UNAME_MACHINE}-pc-msdosdjgpp | ||
| 1021 | exit 0 ;; | ||
| 1022 | i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) | ||
| 1023 | UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` | ||
| 1024 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then | ||
| 1025 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} | ||
| 1026 | else | ||
| 1027 | echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} | ||
| 1028 | fi | ||
| 1029 | exit 0 ;; | ||
| 1030 | i*86:*:5:[78]*) | ||
| 1031 | case `/bin/uname -X | grep "^Machine"` in | ||
| 1032 | *486*) UNAME_MACHINE=i486 ;; | ||
| 1033 | *Pentium) UNAME_MACHINE=i586 ;; | ||
| 1034 | *Pent*|*Celeron) UNAME_MACHINE=i686 ;; | ||
| 1035 | esac | ||
| 1036 | echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} | ||
| 1037 | exit 0 ;; | ||
| 1038 | i*86:*:3.2:*) | ||
| 1039 | if test -f /usr/options/cb.name; then | ||
| 1040 | UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` | ||
| 1041 | echo ${UNAME_MACHINE}-pc-isc$UNAME_REL | ||
| 1042 | elif /bin/uname -X 2>/dev/null >/dev/null ; then | ||
| 1043 | UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` | ||
| 1044 | (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 | ||
| 1045 | (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ | ||
| 1046 | && UNAME_MACHINE=i586 | ||
| 1047 | (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ | ||
| 1048 | && UNAME_MACHINE=i686 | ||
| 1049 | (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ | ||
| 1050 | && UNAME_MACHINE=i686 | ||
| 1051 | echo ${UNAME_MACHINE}-pc-sco$UNAME_REL | ||
| 1052 | else | ||
| 1053 | echo ${UNAME_MACHINE}-pc-sysv32 | ||
| 1054 | fi | ||
| 1055 | exit 0 ;; | ||
| 1056 | pc:*:*:*) | ||
| 1057 | # Left here for compatibility: | ||
| 1058 | # uname -m prints for DJGPP always 'pc', but it prints nothing about | ||
| 1059 | # the processor, so we play safe by assuming i386. | ||
| 1060 | echo i386-pc-msdosdjgpp | ||
| 1061 | exit 0 ;; | ||
| 1062 | Intel:Mach:3*:*) | ||
| 1063 | echo i386-pc-mach3 | ||
| 1064 | exit 0 ;; | ||
| 1065 | paragon:*:*:*) | ||
| 1066 | echo i860-intel-osf1 | ||
| 1067 | exit 0 ;; | ||
| 1068 | i860:*:4.*:*) # i860-SVR4 | ||
| 1069 | if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then | ||
| 1070 | echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 | ||
| 1071 | else # Add other i860-SVR4 vendors below as they are discovered. | ||
| 1072 | echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 | ||
| 1073 | fi | ||
| 1074 | exit 0 ;; | ||
| 1075 | mini*:CTIX:SYS*5:*) | ||
| 1076 | # "miniframe" | ||
| 1077 | echo m68010-convergent-sysv | ||
| 1078 | exit 0 ;; | ||
| 1079 | mc68k:UNIX:SYSTEM5:3.51m) | ||
| 1080 | echo m68k-convergent-sysv | ||
| 1081 | exit 0 ;; | ||
| 1082 | M680?0:D-NIX:5.3:*) | ||
| 1083 | echo m68k-diab-dnix | ||
| 1084 | exit 0 ;; | ||
| 1085 | M68*:*:R3V[5678]*:*) | ||
| 1086 | test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; | ||
| 1087 | 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) | ||
| 1088 | OS_REL='' | ||
| 1089 | test -r /etc/.relid \ | ||
| 1090 | && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` | ||
| 1091 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | ||
| 1092 | && echo i486-ncr-sysv4.3${OS_REL} && exit 0 | ||
| 1093 | /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ | ||
| 1094 | && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; | ||
| 1095 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) | ||
| 1096 | /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | ||
| 1097 | && echo i486-ncr-sysv4 && exit 0 ;; | ||
| 1098 | m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) | ||
| 1099 | echo m68k-unknown-lynxos${UNAME_RELEASE} | ||
| 1100 | exit 0 ;; | ||
| 1101 | mc68030:UNIX_System_V:4.*:*) | ||
| 1102 | echo m68k-atari-sysv4 | ||
| 1103 | exit 0 ;; | ||
| 1104 | TSUNAMI:LynxOS:2.*:*) | ||
| 1105 | echo sparc-unknown-lynxos${UNAME_RELEASE} | ||
| 1106 | exit 0 ;; | ||
| 1107 | rs6000:LynxOS:2.*:*) | ||
| 1108 | echo rs6000-unknown-lynxos${UNAME_RELEASE} | ||
| 1109 | exit 0 ;; | ||
| 1110 | PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) | ||
| 1111 | echo powerpc-unknown-lynxos${UNAME_RELEASE} | ||
| 1112 | exit 0 ;; | ||
| 1113 | SM[BE]S:UNIX_SV:*:*) | ||
| 1114 | echo mips-dde-sysv${UNAME_RELEASE} | ||
| 1115 | exit 0 ;; | ||
| 1116 | RM*:ReliantUNIX-*:*:*) | ||
| 1117 | echo mips-sni-sysv4 | ||
| 1118 | exit 0 ;; | ||
| 1119 | RM*:SINIX-*:*:*) | ||
| 1120 | echo mips-sni-sysv4 | ||
| 1121 | exit 0 ;; | ||
| 1122 | *:SINIX-*:*:*) | ||
| 1123 | if uname -p 2>/dev/null >/dev/null ; then | ||
| 1124 | UNAME_MACHINE=`(uname -p) 2>/dev/null` | ||
| 1125 | echo ${UNAME_MACHINE}-sni-sysv4 | ||
| 1126 | else | ||
| 1127 | echo ns32k-sni-sysv | ||
| 1128 | fi | ||
| 1129 | exit 0 ;; | ||
| 1130 | PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort | ||
| 1131 | # says <Richard.M.Bartel@ccMail.Census.GOV> | ||
| 1132 | echo i586-unisys-sysv4 | ||
| 1133 | exit 0 ;; | ||
| 1134 | *:UNIX_System_V:4*:FTX*) | ||
| 1135 | # From Gerald Hewes <hewes@openmarket.com>. | ||
| 1136 | # How about differentiating between stratus architectures? -djm | ||
| 1137 | echo hppa1.1-stratus-sysv4 | ||
| 1138 | exit 0 ;; | ||
| 1139 | *:*:*:FTX*) | ||
| 1140 | # From seanf@swdc.stratus.com. | ||
| 1141 | echo i860-stratus-sysv4 | ||
| 1142 | exit 0 ;; | ||
| 1143 | i*86:VOS:*:*) | ||
| 1144 | # From Paul.Green@stratus.com. | ||
| 1145 | echo ${UNAME_MACHINE}-stratus-vos | ||
| 1146 | exit 0 ;; | ||
| 1147 | *:VOS:*:*) | ||
| 1148 | # From Paul.Green@stratus.com. | ||
| 1149 | echo hppa1.1-stratus-vos | ||
| 1150 | exit 0 ;; | ||
| 1151 | mc68*:A/UX:*:*) | ||
| 1152 | echo m68k-apple-aux${UNAME_RELEASE} | ||
| 1153 | exit 0 ;; | ||
| 1154 | news*:NEWS-OS:6*:*) | ||
| 1155 | echo mips-sony-newsos6 | ||
| 1156 | exit 0 ;; | ||
| 1157 | R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) | ||
| 1158 | if [ -d /usr/nec ]; then | ||
| 1159 | echo mips-nec-sysv${UNAME_RELEASE} | ||
| 1160 | else | ||
| 1161 | echo mips-unknown-sysv${UNAME_RELEASE} | ||
| 1162 | fi | ||
| 1163 | exit 0 ;; | ||
| 1164 | BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. | ||
| 1165 | echo powerpc-be-beos | ||
| 1166 | exit 0 ;; | ||
| 1167 | BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. | ||
| 1168 | echo powerpc-apple-beos | ||
| 1169 | exit 0 ;; | ||
| 1170 | BePC:BeOS:*:*) # BeOS running on Intel PC compatible. | ||
| 1171 | echo i586-pc-beos | ||
| 1172 | exit 0 ;; | ||
| 1173 | SX-4:SUPER-UX:*:*) | ||
| 1174 | echo sx4-nec-superux${UNAME_RELEASE} | ||
| 1175 | exit 0 ;; | ||
| 1176 | SX-5:SUPER-UX:*:*) | ||
| 1177 | echo sx5-nec-superux${UNAME_RELEASE} | ||
| 1178 | exit 0 ;; | ||
| 1179 | SX-6:SUPER-UX:*:*) | ||
| 1180 | echo sx6-nec-superux${UNAME_RELEASE} | ||
| 1181 | exit 0 ;; | ||
| 1182 | Power*:Rhapsody:*:*) | ||
| 1183 | echo powerpc-apple-rhapsody${UNAME_RELEASE} | ||
| 1184 | exit 0 ;; | ||
| 1185 | *:Rhapsody:*:*) | ||
| 1186 | echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} | ||
| 1187 | exit 0 ;; | ||
| 1188 | *:Darwin:*:*) | ||
| 1189 | UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown | ||
| 1190 | case $UNAME_PROCESSOR in | ||
| 1191 | *86) UNAME_PROCESSOR=i686 ;; | ||
| 1192 | unknown) UNAME_PROCESSOR=powerpc ;; | ||
| 1193 | esac | ||
| 1194 | echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} | ||
| 1195 | exit 0 ;; | ||
| 1196 | *:procnto*:*:* | *:QNX:[0123456789]*:*) | ||
| 1197 | UNAME_PROCESSOR=`uname -p` | ||
| 1198 | if test "$UNAME_PROCESSOR" = "x86"; then | ||
| 1199 | UNAME_PROCESSOR=i386 | ||
| 1200 | UNAME_MACHINE=pc | ||
| 1201 | fi | ||
| 1202 | echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} | ||
| 1203 | exit 0 ;; | ||
| 1204 | *:QNX:*:4*) | ||
| 1205 | echo i386-pc-qnx | ||
| 1206 | exit 0 ;; | ||
| 1207 | NSE-?:NONSTOP_KERNEL:*:*) | ||
| 1208 | echo nse-tandem-nsk${UNAME_RELEASE} | ||
| 1209 | exit 0 ;; | ||
| 1210 | NSR-?:NONSTOP_KERNEL:*:*) | ||
| 1211 | echo nsr-tandem-nsk${UNAME_RELEASE} | ||
| 1212 | exit 0 ;; | ||
| 1213 | *:NonStop-UX:*:*) | ||
| 1214 | echo mips-compaq-nonstopux | ||
| 1215 | exit 0 ;; | ||
| 1216 | BS2000:POSIX*:*:*) | ||
| 1217 | echo bs2000-siemens-sysv | ||
| 1218 | exit 0 ;; | ||
| 1219 | DS/*:UNIX_System_V:*:*) | ||
| 1220 | echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} | ||
| 1221 | exit 0 ;; | ||
| 1222 | *:Plan9:*:*) | ||
| 1223 | # "uname -m" is not consistent, so use $cputype instead. 386 | ||
| 1224 | # is converted to i386 for consistency with other x86 | ||
| 1225 | # operating systems. | ||
| 1226 | if test "$cputype" = "386"; then | ||
| 1227 | UNAME_MACHINE=i386 | ||
| 1228 | else | ||
| 1229 | UNAME_MACHINE="$cputype" | ||
| 1230 | fi | ||
| 1231 | echo ${UNAME_MACHINE}-unknown-plan9 | ||
| 1232 | exit 0 ;; | ||
| 1233 | *:TOPS-10:*:*) | ||
| 1234 | echo pdp10-unknown-tops10 | ||
| 1235 | exit 0 ;; | ||
| 1236 | *:TENEX:*:*) | ||
| 1237 | echo pdp10-unknown-tenex | ||
| 1238 | exit 0 ;; | ||
| 1239 | KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) | ||
| 1240 | echo pdp10-dec-tops20 | ||
| 1241 | exit 0 ;; | ||
| 1242 | XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) | ||
| 1243 | echo pdp10-xkl-tops20 | ||
| 1244 | exit 0 ;; | ||
| 1245 | *:TOPS-20:*:*) | ||
| 1246 | echo pdp10-unknown-tops20 | ||
| 1247 | exit 0 ;; | ||
| 1248 | *:ITS:*:*) | ||
| 1249 | echo pdp10-unknown-its | ||
| 1250 | exit 0 ;; | ||
| 1251 | SEI:*:*:SEIUX) | ||
| 1252 | echo mips-sei-seiux${UNAME_RELEASE} | ||
| 1253 | exit 0 ;; | ||
| 1254 | *:DragonFly:*:*) | ||
| 1255 | echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` | ||
| 1256 | exit 0 ;; | ||
| 1257 | *:*VMS:*:*) | ||
| 1258 | UNAME_MACHINE=`(uname -p) 2>/dev/null` | ||
| 1259 | case "${UNAME_MACHINE}" in | ||
| 1260 | A*) echo alpha-dec-vms && exit 0 ;; | ||
| 1261 | I*) echo ia64-dec-vms && exit 0 ;; | ||
| 1262 | V*) echo vax-dec-vms && exit 0 ;; | ||
| 1263 | esac ;; | ||
| 1264 | *:XENIX:*:SysV) | ||
| 1265 | echo i386-pc-xenix | ||
| 1266 | exit 0 ;; | ||
| 1267 | esac | ||
| 1268 | |||
| 1269 | #echo '(No uname command or uname output not recognized.)' 1>&2 | ||
| 1270 | #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 | ||
| 1271 | |||
| 1272 | eval $set_cc_for_build | ||
| 1273 | cat >$dummy.c <<EOF | ||
| 1274 | #ifdef _SEQUENT_ | ||
| 1275 | # include <sys/types.h> | ||
| 1276 | # include <sys/utsname.h> | ||
| 1277 | #endif | ||
| 1278 | main () | ||
| 1279 | { | ||
| 1280 | #if defined (sony) | ||
| 1281 | #if defined (MIPSEB) | ||
| 1282 | /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, | ||
| 1283 | I don't know.... */ | ||
| 1284 | printf ("mips-sony-bsd\n"); exit (0); | ||
| 1285 | #else | ||
| 1286 | #include <sys/param.h> | ||
| 1287 | printf ("m68k-sony-newsos%s\n", | ||
| 1288 | #ifdef NEWSOS4 | ||
| 1289 | "4" | ||
| 1290 | #else | ||
| 1291 | "" | ||
| 1292 | #endif | ||
| 1293 | ); exit (0); | ||
| 1294 | #endif | ||
| 1295 | #endif | ||
| 1296 | |||
| 1297 | #if defined (__arm) && defined (__acorn) && defined (__unix) | ||
| 1298 | printf ("arm-acorn-riscix"); exit (0); | ||
| 1299 | #endif | ||
| 1300 | |||
| 1301 | #if defined (hp300) && !defined (hpux) | ||
| 1302 | printf ("m68k-hp-bsd\n"); exit (0); | ||
| 1303 | #endif | ||
| 1304 | |||
| 1305 | #if defined (NeXT) | ||
| 1306 | #if !defined (__ARCHITECTURE__) | ||
| 1307 | #define __ARCHITECTURE__ "m68k" | ||
| 1308 | #endif | ||
| 1309 | int version; | ||
| 1310 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | ||
| 1311 | if (version < 4) | ||
| 1312 | printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | ||
| 1313 | else | ||
| 1314 | printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); | ||
| 1315 | exit (0); | ||
| 1316 | #endif | ||
| 1317 | |||
| 1318 | #if defined (MULTIMAX) || defined (n16) | ||
| 1319 | #if defined (UMAXV) | ||
| 1320 | printf ("ns32k-encore-sysv\n"); exit (0); | ||
| 1321 | #else | ||
| 1322 | #if defined (CMU) | ||
| 1323 | printf ("ns32k-encore-mach\n"); exit (0); | ||
| 1324 | #else | ||
| 1325 | printf ("ns32k-encore-bsd\n"); exit (0); | ||
| 1326 | #endif | ||
| 1327 | #endif | ||
| 1328 | #endif | ||
| 1329 | |||
| 1330 | #if defined (__386BSD__) | ||
| 1331 | printf ("i386-pc-bsd\n"); exit (0); | ||
| 1332 | #endif | ||
| 1333 | |||
| 1334 | #if defined (sequent) | ||
| 1335 | #if defined (i386) | ||
| 1336 | printf ("i386-sequent-dynix\n"); exit (0); | ||
| 1337 | #endif | ||
| 1338 | #if defined (ns32000) | ||
| 1339 | printf ("ns32k-sequent-dynix\n"); exit (0); | ||
| 1340 | #endif | ||
| 1341 | #endif | ||
| 1342 | |||
| 1343 | #if defined (_SEQUENT_) | ||
| 1344 | struct utsname un; | ||
| 1345 | |||
| 1346 | uname(&un); | ||
| 1347 | |||
| 1348 | if (strncmp(un.version, "V2", 2) == 0) { | ||
| 1349 | printf ("i386-sequent-ptx2\n"); exit (0); | ||
| 1350 | } | ||
| 1351 | if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ | ||
| 1352 | printf ("i386-sequent-ptx1\n"); exit (0); | ||
| 1353 | } | ||
| 1354 | printf ("i386-sequent-ptx\n"); exit (0); | ||
| 1355 | |||
| 1356 | #endif | ||
| 1357 | |||
| 1358 | #if defined (vax) | ||
| 1359 | # if !defined (ultrix) | ||
| 1360 | # include <sys/param.h> | ||
| 1361 | # if defined (BSD) | ||
| 1362 | # if BSD == 43 | ||
| 1363 | printf ("vax-dec-bsd4.3\n"); exit (0); | ||
| 1364 | # else | ||
| 1365 | # if BSD == 199006 | ||
| 1366 | printf ("vax-dec-bsd4.3reno\n"); exit (0); | ||
| 1367 | # else | ||
| 1368 | printf ("vax-dec-bsd\n"); exit (0); | ||
| 1369 | # endif | ||
| 1370 | # endif | ||
| 1371 | # else | ||
| 1372 | printf ("vax-dec-bsd\n"); exit (0); | ||
| 1373 | # endif | ||
| 1374 | # else | ||
| 1375 | printf ("vax-dec-ultrix\n"); exit (0); | ||
| 1376 | # endif | ||
| 1377 | #endif | ||
| 1378 | |||
| 1379 | #if defined (alliant) && defined (i860) | ||
| 1380 | printf ("i860-alliant-bsd\n"); exit (0); | ||
| 1381 | #endif | ||
| 1382 | |||
| 1383 | exit (1); | ||
| 1384 | } | ||
| 1385 | EOF | ||
| 1386 | |||
| 1387 | $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 | ||
| 1388 | |||
| 1389 | # Apollos put the system type in the environment. | ||
| 1390 | |||
| 1391 | test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } | ||
| 1392 | |||
| 1393 | # Convex versions that predate uname can use getsysinfo(1) | ||
| 1394 | |||
| 1395 | if [ -x /usr/convex/getsysinfo ] | ||
| 1396 | then | ||
| 1397 | case `getsysinfo -f cpu_type` in | ||
| 1398 | c1*) | ||
| 1399 | echo c1-convex-bsd | ||
| 1400 | exit 0 ;; | ||
| 1401 | c2*) | ||
| 1402 | if getsysinfo -f scalar_acc | ||
| 1403 | then echo c32-convex-bsd | ||
| 1404 | else echo c2-convex-bsd | ||
| 1405 | fi | ||
| 1406 | exit 0 ;; | ||
| 1407 | c34*) | ||
| 1408 | echo c34-convex-bsd | ||
| 1409 | exit 0 ;; | ||
| 1410 | c38*) | ||
| 1411 | echo c38-convex-bsd | ||
| 1412 | exit 0 ;; | ||
| 1413 | c4*) | ||
| 1414 | echo c4-convex-bsd | ||
| 1415 | exit 0 ;; | ||
| 1416 | esac | ||
| 1417 | fi | ||
| 1418 | |||
| 1419 | cat >&2 <<EOF | ||
| 1420 | $0: unable to guess system type | ||
| 1421 | |||
| 1422 | This script, last modified $timestamp, has failed to recognize | ||
| 1423 | the operating system you are using. It is advised that you | ||
| 1424 | download the most up to date version of the config scripts from | ||
| 1425 | |||
| 1426 | http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess | ||
| 1427 | and | ||
| 1428 | http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub | ||
| 1429 | |||
| 1430 | If the version you run ($0) is already up to date, please | ||
| 1431 | send the following data and any information you think might be | ||
| 1432 | pertinent to <config-patches@gnu.org> in order to provide the needed | ||
| 1433 | information to handle your system. | ||
| 1434 | |||
| 1435 | config.guess timestamp = $timestamp | ||
| 1436 | |||
| 1437 | uname -m = `(uname -m) 2>/dev/null || echo unknown` | ||
| 1438 | uname -r = `(uname -r) 2>/dev/null || echo unknown` | ||
| 1439 | uname -s = `(uname -s) 2>/dev/null || echo unknown` | ||
| 1440 | uname -v = `(uname -v) 2>/dev/null || echo unknown` | ||
| 1441 | |||
| 1442 | /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` | ||
| 1443 | /bin/uname -X = `(/bin/uname -X) 2>/dev/null` | ||
| 1444 | |||
| 1445 | hostinfo = `(hostinfo) 2>/dev/null` | ||
| 1446 | /bin/universe = `(/bin/universe) 2>/dev/null` | ||
| 1447 | /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` | ||
| 1448 | /bin/arch = `(/bin/arch) 2>/dev/null` | ||
| 1449 | /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` | ||
| 1450 | /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` | ||
| 1451 | |||
| 1452 | UNAME_MACHINE = ${UNAME_MACHINE} | ||
| 1453 | UNAME_RELEASE = ${UNAME_RELEASE} | ||
| 1454 | UNAME_SYSTEM = ${UNAME_SYSTEM} | ||
| 1455 | UNAME_VERSION = ${UNAME_VERSION} | ||
| 1456 | EOF | ||
| 1457 | |||
| 1458 | exit 1 | ||
| 1459 | |||
| 1460 | # Local variables: | ||
| 1461 | # eval: (add-hook 'write-file-hooks 'time-stamp) | ||
| 1462 | # time-stamp-start: "timestamp='" | ||
| 1463 | # time-stamp-format: "%:y-%02m-%02d" | ||
| 1464 | # time-stamp-end: "'" | ||
| 1465 | # End: | ||
diff --git a/config.sub b/config.sub new file mode 100755 index 00000000..87a1ee49 --- /dev/null +++ b/config.sub | |||
| @@ -0,0 +1,1569 @@ | |||
| 1 | #! /bin/sh | ||
| 2 | # Configuration validation subroutine script. | ||
| 3 | # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, | ||
| 4 | # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. | ||
| 5 | |||
| 6 | timestamp='2005-04-22' | ||
| 7 | |||
| 8 | # This file is (in principle) common to ALL GNU software. | ||
| 9 | # The presence of a machine in this file suggests that SOME GNU software | ||
| 10 | # can handle that machine. It does not imply ALL GNU software can. | ||
| 11 | # | ||
| 12 | # This file is free software; you can redistribute it and/or modify | ||
| 13 | # it under the terms of the GNU General Public License as published by | ||
| 14 | # the Free Software Foundation; either version 2 of the License, or | ||
| 15 | # (at your option) any later version. | ||
| 16 | # | ||
| 17 | # This program is distributed in the hope that it will be useful, | ||
| 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | # GNU General Public License for more details. | ||
| 21 | # | ||
| 22 | # You should have received a copy of the GNU General Public License | ||
| 23 | # 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 | |||
| 27 | # As a special exception to the GNU General Public License, if you | ||
| 28 | # distribute this file as part of a program that contains a | ||
| 29 | # configuration script generated by Autoconf, you may include it under | ||
| 30 | # the same distribution terms that you use for the rest of that program. | ||
| 31 | |||
| 32 | # Please send patches to <config-patches@gnu.org>. Submit a context | ||
| 33 | # diff and a properly formatted ChangeLog entry. | ||
| 34 | # | ||
| 35 | # Configuration subroutine to validate and canonicalize a configuration type. | ||
| 36 | # Supply the specified configuration type as an argument. | ||
| 37 | # If it is invalid, we print an error message on stderr and exit with code 1. | ||
| 38 | # Otherwise, we print the canonical config type on stdout and succeed. | ||
| 39 | |||
| 40 | # This file is supposed to be the same for all GNU packages | ||
| 41 | # and recognize all the CPU types, system types and aliases | ||
| 42 | # that are meaningful with *any* GNU software. | ||
| 43 | # Each package is responsible for reporting which valid configurations | ||
| 44 | # it does not support. The user should be able to distinguish | ||
| 45 | # a failure to support a valid configuration from a meaningless | ||
| 46 | # configuration. | ||
| 47 | |||
| 48 | # The goal of this file is to map all the various variations of a given | ||
| 49 | # machine specification into a single specification in the form: | ||
| 50 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM | ||
| 51 | # or in some cases, the newer four-part form: | ||
| 52 | # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM | ||
| 53 | # It is wrong to echo any other type of specification. | ||
| 54 | |||
| 55 | me=`echo "$0" | sed -e 's,.*/,,'` | ||
| 56 | |||
| 57 | usage="\ | ||
| 58 | Usage: $0 [OPTION] CPU-MFR-OPSYS | ||
| 59 | $0 [OPTION] ALIAS | ||
| 60 | |||
| 61 | Canonicalize a configuration name. | ||
| 62 | |||
| 63 | Operation modes: | ||
| 64 | -h, --help print this help, then exit | ||
| 65 | -t, --time-stamp print date of last modification, then exit | ||
| 66 | -v, --version print version number, then exit | ||
| 67 | |||
| 68 | Report bugs and patches to <config-patches@gnu.org>." | ||
| 69 | |||
| 70 | version="\ | ||
| 71 | GNU config.sub ($timestamp) | ||
| 72 | |||
| 73 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 | ||
| 74 | Free Software Foundation, Inc. | ||
| 75 | |||
| 76 | This is free software; see the source for copying conditions. There is NO | ||
| 77 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | ||
| 78 | |||
| 79 | help=" | ||
| 80 | Try \`$me --help' for more information." | ||
| 81 | |||
| 82 | # Parse command line | ||
| 83 | while test $# -gt 0 ; do | ||
| 84 | case $1 in | ||
| 85 | --time-stamp | --time* | -t ) | ||
| 86 | echo "$timestamp" ; exit 0 ;; | ||
| 87 | --version | -v ) | ||
| 88 | echo "$version" ; exit 0 ;; | ||
| 89 | --help | --h* | -h ) | ||
| 90 | echo "$usage"; exit 0 ;; | ||
| 91 | -- ) # Stop option processing | ||
| 92 | shift; break ;; | ||
| 93 | - ) # Use stdin as input. | ||
| 94 | break ;; | ||
| 95 | -* ) | ||
| 96 | echo "$me: invalid option $1$help" | ||
| 97 | exit 1 ;; | ||
| 98 | |||
| 99 | *local*) | ||
| 100 | # First pass through any local machine types. | ||
| 101 | echo $1 | ||
| 102 | exit 0;; | ||
| 103 | |||
| 104 | * ) | ||
| 105 | break ;; | ||
| 106 | esac | ||
| 107 | done | ||
| 108 | |||
| 109 | case $# in | ||
| 110 | 0) echo "$me: missing argument$help" >&2 | ||
| 111 | exit 1;; | ||
| 112 | 1) ;; | ||
| 113 | *) echo "$me: too many arguments$help" >&2 | ||
| 114 | exit 1;; | ||
| 115 | esac | ||
| 116 | |||
| 117 | # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). | ||
| 118 | # Here we must recognize all the valid KERNEL-OS combinations. | ||
| 119 | maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` | ||
| 120 | case $maybe_os in | ||
| 121 | nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ | ||
| 122 | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) | ||
| 123 | os=-$maybe_os | ||
| 124 | basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` | ||
| 125 | ;; | ||
| 126 | *) | ||
| 127 | basic_machine=`echo $1 | sed 's/-[^-]*$//'` | ||
| 128 | if [ $basic_machine != $1 ] | ||
| 129 | then os=`echo $1 | sed 's/.*-/-/'` | ||
| 130 | else os=; fi | ||
| 131 | ;; | ||
| 132 | esac | ||
| 133 | |||
| 134 | ### Let's recognize common machines as not being operating systems so | ||
| 135 | ### that things like config.sub decstation-3100 work. We also | ||
| 136 | ### recognize some manufacturers as not being operating systems, so we | ||
| 137 | ### can provide default operating systems below. | ||
| 138 | case $os in | ||
| 139 | -sun*os*) | ||
| 140 | # Prevent following clause from handling this invalid input. | ||
| 141 | ;; | ||
| 142 | -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ | ||
| 143 | -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ | ||
| 144 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ | ||
| 145 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ | ||
| 146 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ | ||
| 147 | -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ | ||
| 148 | -apple | -axis | -knuth | -cray) | ||
| 149 | os= | ||
| 150 | basic_machine=$1 | ||
| 151 | ;; | ||
| 152 | -sim | -cisco | -oki | -wec | -winbond) | ||
| 153 | os= | ||
| 154 | basic_machine=$1 | ||
| 155 | ;; | ||
| 156 | -scout) | ||
| 157 | ;; | ||
| 158 | -wrs) | ||
| 159 | os=-vxworks | ||
| 160 | basic_machine=$1 | ||
| 161 | ;; | ||
| 162 | -chorusos*) | ||
| 163 | os=-chorusos | ||
| 164 | basic_machine=$1 | ||
| 165 | ;; | ||
| 166 | -chorusrdb) | ||
| 167 | os=-chorusrdb | ||
| 168 | basic_machine=$1 | ||
| 169 | ;; | ||
| 170 | -hiux*) | ||
| 171 | os=-hiuxwe2 | ||
| 172 | ;; | ||
| 173 | -sco5) | ||
| 174 | os=-sco3.2v5 | ||
| 175 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 176 | ;; | ||
| 177 | -sco4) | ||
| 178 | os=-sco3.2v4 | ||
| 179 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 180 | ;; | ||
| 181 | -sco3.2.[4-9]*) | ||
| 182 | os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` | ||
| 183 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 184 | ;; | ||
| 185 | -sco3.2v[4-9]*) | ||
| 186 | # Don't forget version if it is 3.2v4 or newer. | ||
| 187 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 188 | ;; | ||
| 189 | -sco*) | ||
| 190 | os=-sco3.2v2 | ||
| 191 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 192 | ;; | ||
| 193 | -udk*) | ||
| 194 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 195 | ;; | ||
| 196 | -isc) | ||
| 197 | os=-isc2.2 | ||
| 198 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 199 | ;; | ||
| 200 | -clix*) | ||
| 201 | basic_machine=clipper-intergraph | ||
| 202 | ;; | ||
| 203 | -isc*) | ||
| 204 | basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | ||
| 205 | ;; | ||
| 206 | -lynx*) | ||
| 207 | os=-lynxos | ||
| 208 | ;; | ||
| 209 | -ptx*) | ||
| 210 | basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` | ||
| 211 | ;; | ||
| 212 | -windowsnt*) | ||
| 213 | os=`echo $os | sed -e 's/windowsnt/winnt/'` | ||
| 214 | ;; | ||
| 215 | -psos*) | ||
| 216 | os=-psos | ||
| 217 | ;; | ||
| 218 | -mint | -mint[0-9]*) | ||
| 219 | basic_machine=m68k-atari | ||
| 220 | os=-mint | ||
| 221 | ;; | ||
| 222 | esac | ||
| 223 | |||
| 224 | # Decode aliases for certain CPU-COMPANY combinations. | ||
| 225 | case $basic_machine in | ||
| 226 | # Recognize the basic CPU types without company name. | ||
| 227 | # Some are omitted here because they have special meanings below. | ||
| 228 | 1750a | 580 \ | ||
| 229 | | a29k \ | ||
| 230 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | ||
| 231 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | ||
| 232 | | am33_2.0 \ | ||
| 233 | | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | ||
| 234 | | bfin \ | ||
| 235 | | c4x | clipper \ | ||
| 236 | | d10v | d30v | dlx | dsp16xx \ | ||
| 237 | | fr30 | frv \ | ||
| 238 | | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | ||
| 239 | | i370 | i860 | i960 | ia64 \ | ||
| 240 | | ip2k | iq2000 \ | ||
| 241 | | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | ||
| 242 | | mips | mipsbe | mipseb | mipsel | mipsle \ | ||
| 243 | | mips16 \ | ||
| 244 | | mips64 | mips64el \ | ||
| 245 | | mips64vr | mips64vrel \ | ||
| 246 | | mips64orion | mips64orionel \ | ||
| 247 | | mips64vr4100 | mips64vr4100el \ | ||
| 248 | | mips64vr4300 | mips64vr4300el \ | ||
| 249 | | mips64vr5000 | mips64vr5000el \ | ||
| 250 | | mipsisa32 | mipsisa32el \ | ||
| 251 | | mipsisa32r2 | mipsisa32r2el \ | ||
| 252 | | mipsisa64 | mipsisa64el \ | ||
| 253 | | mipsisa64r2 | mipsisa64r2el \ | ||
| 254 | | mipsisa64sb1 | mipsisa64sb1el \ | ||
| 255 | | mipsisa64sr71k | mipsisa64sr71kel \ | ||
| 256 | | mipstx39 | mipstx39el \ | ||
| 257 | | mn10200 | mn10300 \ | ||
| 258 | | msp430 \ | ||
| 259 | | ns16k | ns32k \ | ||
| 260 | | openrisc | or32 \ | ||
| 261 | | pdp10 | pdp11 | pj | pjl \ | ||
| 262 | | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | ||
| 263 | | pyramid \ | ||
| 264 | | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | ||
| 265 | | sh64 | sh64le \ | ||
| 266 | | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | ||
| 267 | | sparcv8 | sparcv9 | sparcv9b \ | ||
| 268 | | strongarm \ | ||
| 269 | | tahoe | thumb | tic4x | tic80 | tron \ | ||
| 270 | | v850 | v850e \ | ||
| 271 | | we32k \ | ||
| 272 | | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | ||
| 273 | | z8k) | ||
| 274 | basic_machine=$basic_machine-unknown | ||
| 275 | ;; | ||
| 276 | m6811 | m68hc11 | m6812 | m68hc12) | ||
| 277 | # Motorola 68HC11/12. | ||
| 278 | basic_machine=$basic_machine-unknown | ||
| 279 | os=-none | ||
| 280 | ;; | ||
| 281 | m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) | ||
| 282 | ;; | ||
| 283 | |||
| 284 | # We use `pc' rather than `unknown' | ||
| 285 | # because (1) that's what they normally are, and | ||
| 286 | # (2) the word "unknown" tends to confuse beginning users. | ||
| 287 | i*86 | x86_64) | ||
| 288 | basic_machine=$basic_machine-pc | ||
| 289 | ;; | ||
| 290 | # Object if more than one company name word. | ||
| 291 | *-*-*) | ||
| 292 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | ||
| 293 | exit 1 | ||
| 294 | ;; | ||
| 295 | # Recognize the basic CPU types with company name. | ||
| 296 | 580-* \ | ||
| 297 | | a29k-* \ | ||
| 298 | | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | ||
| 299 | | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | ||
| 300 | | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | ||
| 301 | | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | ||
| 302 | | avr-* \ | ||
| 303 | | bfin-* | bs2000-* \ | ||
| 304 | | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | ||
| 305 | | clipper-* | craynv-* | cydra-* \ | ||
| 306 | | d10v-* | d30v-* | dlx-* \ | ||
| 307 | | elxsi-* \ | ||
| 308 | | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | ||
| 309 | | h8300-* | h8500-* \ | ||
| 310 | | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | ||
| 311 | | i*86-* | i860-* | i960-* | ia64-* \ | ||
| 312 | | ip2k-* | iq2000-* \ | ||
| 313 | | m32r-* | m32rle-* \ | ||
| 314 | | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | ||
| 315 | | m88110-* | m88k-* | maxq-* | mcore-* \ | ||
| 316 | | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | ||
| 317 | | mips16-* \ | ||
| 318 | | mips64-* | mips64el-* \ | ||
| 319 | | mips64vr-* | mips64vrel-* \ | ||
| 320 | | mips64orion-* | mips64orionel-* \ | ||
| 321 | | mips64vr4100-* | mips64vr4100el-* \ | ||
| 322 | | mips64vr4300-* | mips64vr4300el-* \ | ||
| 323 | | mips64vr5000-* | mips64vr5000el-* \ | ||
| 324 | | mipsisa32-* | mipsisa32el-* \ | ||
| 325 | | mipsisa32r2-* | mipsisa32r2el-* \ | ||
| 326 | | mipsisa64-* | mipsisa64el-* \ | ||
| 327 | | mipsisa64r2-* | mipsisa64r2el-* \ | ||
| 328 | | mipsisa64sb1-* | mipsisa64sb1el-* \ | ||
| 329 | | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | ||
| 330 | | mipstx39-* | mipstx39el-* \ | ||
| 331 | | mmix-* \ | ||
| 332 | | msp430-* \ | ||
| 333 | | none-* | np1-* | ns16k-* | ns32k-* \ | ||
| 334 | | orion-* \ | ||
| 335 | | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | ||
| 336 | | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | ||
| 337 | | pyramid-* \ | ||
| 338 | | romp-* | rs6000-* \ | ||
| 339 | | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | ||
| 340 | | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | ||
| 341 | | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | ||
| 342 | | sparclite-* \ | ||
| 343 | | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | ||
| 344 | | tahoe-* | thumb-* \ | ||
| 345 | | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | ||
| 346 | | tron-* \ | ||
| 347 | | v850-* | v850e-* | vax-* \ | ||
| 348 | | we32k-* \ | ||
| 349 | | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | ||
| 350 | | xstormy16-* | xtensa-* \ | ||
| 351 | | ymp-* \ | ||
| 352 | | z8k-*) | ||
| 353 | ;; | ||
| 354 | # Recognize the various machine names and aliases which stand | ||
| 355 | # for a CPU type and a company and sometimes even an OS. | ||
| 356 | 386bsd) | ||
| 357 | basic_machine=i386-unknown | ||
| 358 | os=-bsd | ||
| 359 | ;; | ||
| 360 | 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) | ||
| 361 | basic_machine=m68000-att | ||
| 362 | ;; | ||
| 363 | 3b*) | ||
| 364 | basic_machine=we32k-att | ||
| 365 | ;; | ||
| 366 | a29khif) | ||
| 367 | basic_machine=a29k-amd | ||
| 368 | os=-udi | ||
| 369 | ;; | ||
| 370 | abacus) | ||
| 371 | basic_machine=abacus-unknown | ||
| 372 | ;; | ||
| 373 | adobe68k) | ||
| 374 | basic_machine=m68010-adobe | ||
| 375 | os=-scout | ||
| 376 | ;; | ||
| 377 | alliant | fx80) | ||
| 378 | basic_machine=fx80-alliant | ||
| 379 | ;; | ||
| 380 | altos | altos3068) | ||
| 381 | basic_machine=m68k-altos | ||
| 382 | ;; | ||
| 383 | am29k) | ||
| 384 | basic_machine=a29k-none | ||
| 385 | os=-bsd | ||
| 386 | ;; | ||
| 387 | amd64) | ||
| 388 | basic_machine=x86_64-pc | ||
| 389 | ;; | ||
| 390 | amd64-*) | ||
| 391 | basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 392 | ;; | ||
| 393 | amdahl) | ||
| 394 | basic_machine=580-amdahl | ||
| 395 | os=-sysv | ||
| 396 | ;; | ||
| 397 | amiga | amiga-*) | ||
| 398 | basic_machine=m68k-unknown | ||
| 399 | ;; | ||
| 400 | amigaos | amigados) | ||
| 401 | basic_machine=m68k-unknown | ||
| 402 | os=-amigaos | ||
| 403 | ;; | ||
| 404 | amigaunix | amix) | ||
| 405 | basic_machine=m68k-unknown | ||
| 406 | os=-sysv4 | ||
| 407 | ;; | ||
| 408 | apollo68) | ||
| 409 | basic_machine=m68k-apollo | ||
| 410 | os=-sysv | ||
| 411 | ;; | ||
| 412 | apollo68bsd) | ||
| 413 | basic_machine=m68k-apollo | ||
| 414 | os=-bsd | ||
| 415 | ;; | ||
| 416 | aux) | ||
| 417 | basic_machine=m68k-apple | ||
| 418 | os=-aux | ||
| 419 | ;; | ||
| 420 | balance) | ||
| 421 | basic_machine=ns32k-sequent | ||
| 422 | os=-dynix | ||
| 423 | ;; | ||
| 424 | c90) | ||
| 425 | basic_machine=c90-cray | ||
| 426 | os=-unicos | ||
| 427 | ;; | ||
| 428 | convex-c1) | ||
| 429 | basic_machine=c1-convex | ||
| 430 | os=-bsd | ||
| 431 | ;; | ||
| 432 | convex-c2) | ||
| 433 | basic_machine=c2-convex | ||
| 434 | os=-bsd | ||
| 435 | ;; | ||
| 436 | convex-c32) | ||
| 437 | basic_machine=c32-convex | ||
| 438 | os=-bsd | ||
| 439 | ;; | ||
| 440 | convex-c34) | ||
| 441 | basic_machine=c34-convex | ||
| 442 | os=-bsd | ||
| 443 | ;; | ||
| 444 | convex-c38) | ||
| 445 | basic_machine=c38-convex | ||
| 446 | os=-bsd | ||
| 447 | ;; | ||
| 448 | cray | j90) | ||
| 449 | basic_machine=j90-cray | ||
| 450 | os=-unicos | ||
| 451 | ;; | ||
| 452 | craynv) | ||
| 453 | basic_machine=craynv-cray | ||
| 454 | os=-unicosmp | ||
| 455 | ;; | ||
| 456 | cr16c) | ||
| 457 | basic_machine=cr16c-unknown | ||
| 458 | os=-elf | ||
| 459 | ;; | ||
| 460 | crds | unos) | ||
| 461 | basic_machine=m68k-crds | ||
| 462 | ;; | ||
| 463 | crisv32 | crisv32-* | etraxfs*) | ||
| 464 | basic_machine=crisv32-axis | ||
| 465 | ;; | ||
| 466 | cris | cris-* | etrax*) | ||
| 467 | basic_machine=cris-axis | ||
| 468 | ;; | ||
| 469 | crx) | ||
| 470 | basic_machine=crx-unknown | ||
| 471 | os=-elf | ||
| 472 | ;; | ||
| 473 | da30 | da30-*) | ||
| 474 | basic_machine=m68k-da30 | ||
| 475 | ;; | ||
| 476 | decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) | ||
| 477 | basic_machine=mips-dec | ||
| 478 | ;; | ||
| 479 | decsystem10* | dec10*) | ||
| 480 | basic_machine=pdp10-dec | ||
| 481 | os=-tops10 | ||
| 482 | ;; | ||
| 483 | decsystem20* | dec20*) | ||
| 484 | basic_machine=pdp10-dec | ||
| 485 | os=-tops20 | ||
| 486 | ;; | ||
| 487 | delta | 3300 | motorola-3300 | motorola-delta \ | ||
| 488 | | 3300-motorola | delta-motorola) | ||
| 489 | basic_machine=m68k-motorola | ||
| 490 | ;; | ||
| 491 | delta88) | ||
| 492 | basic_machine=m88k-motorola | ||
| 493 | os=-sysv3 | ||
| 494 | ;; | ||
| 495 | djgpp) | ||
| 496 | basic_machine=i586-pc | ||
| 497 | os=-msdosdjgpp | ||
| 498 | ;; | ||
| 499 | dpx20 | dpx20-*) | ||
| 500 | basic_machine=rs6000-bull | ||
| 501 | os=-bosx | ||
| 502 | ;; | ||
| 503 | dpx2* | dpx2*-bull) | ||
| 504 | basic_machine=m68k-bull | ||
| 505 | os=-sysv3 | ||
| 506 | ;; | ||
| 507 | ebmon29k) | ||
| 508 | basic_machine=a29k-amd | ||
| 509 | os=-ebmon | ||
| 510 | ;; | ||
| 511 | elxsi) | ||
| 512 | basic_machine=elxsi-elxsi | ||
| 513 | os=-bsd | ||
| 514 | ;; | ||
| 515 | encore | umax | mmax) | ||
| 516 | basic_machine=ns32k-encore | ||
| 517 | ;; | ||
| 518 | es1800 | OSE68k | ose68k | ose | OSE) | ||
| 519 | basic_machine=m68k-ericsson | ||
| 520 | os=-ose | ||
| 521 | ;; | ||
| 522 | fx2800) | ||
| 523 | basic_machine=i860-alliant | ||
| 524 | ;; | ||
| 525 | genix) | ||
| 526 | basic_machine=ns32k-ns | ||
| 527 | ;; | ||
| 528 | gmicro) | ||
| 529 | basic_machine=tron-gmicro | ||
| 530 | os=-sysv | ||
| 531 | ;; | ||
| 532 | go32) | ||
| 533 | basic_machine=i386-pc | ||
| 534 | os=-go32 | ||
| 535 | ;; | ||
| 536 | h3050r* | hiux*) | ||
| 537 | basic_machine=hppa1.1-hitachi | ||
| 538 | os=-hiuxwe2 | ||
| 539 | ;; | ||
| 540 | h8300hms) | ||
| 541 | basic_machine=h8300-hitachi | ||
| 542 | os=-hms | ||
| 543 | ;; | ||
| 544 | h8300xray) | ||
| 545 | basic_machine=h8300-hitachi | ||
| 546 | os=-xray | ||
| 547 | ;; | ||
| 548 | h8500hms) | ||
| 549 | basic_machine=h8500-hitachi | ||
| 550 | os=-hms | ||
| 551 | ;; | ||
| 552 | harris) | ||
| 553 | basic_machine=m88k-harris | ||
| 554 | os=-sysv3 | ||
| 555 | ;; | ||
| 556 | hp300-*) | ||
| 557 | basic_machine=m68k-hp | ||
| 558 | ;; | ||
| 559 | hp300bsd) | ||
| 560 | basic_machine=m68k-hp | ||
| 561 | os=-bsd | ||
| 562 | ;; | ||
| 563 | hp300hpux) | ||
| 564 | basic_machine=m68k-hp | ||
| 565 | os=-hpux | ||
| 566 | ;; | ||
| 567 | hp3k9[0-9][0-9] | hp9[0-9][0-9]) | ||
| 568 | basic_machine=hppa1.0-hp | ||
| 569 | ;; | ||
| 570 | hp9k2[0-9][0-9] | hp9k31[0-9]) | ||
| 571 | basic_machine=m68000-hp | ||
| 572 | ;; | ||
| 573 | hp9k3[2-9][0-9]) | ||
| 574 | basic_machine=m68k-hp | ||
| 575 | ;; | ||
| 576 | hp9k6[0-9][0-9] | hp6[0-9][0-9]) | ||
| 577 | basic_machine=hppa1.0-hp | ||
| 578 | ;; | ||
| 579 | hp9k7[0-79][0-9] | hp7[0-79][0-9]) | ||
| 580 | basic_machine=hppa1.1-hp | ||
| 581 | ;; | ||
| 582 | hp9k78[0-9] | hp78[0-9]) | ||
| 583 | # FIXME: really hppa2.0-hp | ||
| 584 | basic_machine=hppa1.1-hp | ||
| 585 | ;; | ||
| 586 | hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) | ||
| 587 | # FIXME: really hppa2.0-hp | ||
| 588 | basic_machine=hppa1.1-hp | ||
| 589 | ;; | ||
| 590 | hp9k8[0-9][13679] | hp8[0-9][13679]) | ||
| 591 | basic_machine=hppa1.1-hp | ||
| 592 | ;; | ||
| 593 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) | ||
| 594 | basic_machine=hppa1.0-hp | ||
| 595 | ;; | ||
| 596 | hppa-next) | ||
| 597 | os=-nextstep3 | ||
| 598 | ;; | ||
| 599 | hppaosf) | ||
| 600 | basic_machine=hppa1.1-hp | ||
| 601 | os=-osf | ||
| 602 | ;; | ||
| 603 | hppro) | ||
| 604 | basic_machine=hppa1.1-hp | ||
| 605 | os=-proelf | ||
| 606 | ;; | ||
| 607 | i370-ibm* | ibm*) | ||
| 608 | basic_machine=i370-ibm | ||
| 609 | ;; | ||
| 610 | # I'm not sure what "Sysv32" means. Should this be sysv3.2? | ||
| 611 | i*86v32) | ||
| 612 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | ||
| 613 | os=-sysv32 | ||
| 614 | ;; | ||
| 615 | i*86v4*) | ||
| 616 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | ||
| 617 | os=-sysv4 | ||
| 618 | ;; | ||
| 619 | i*86v) | ||
| 620 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | ||
| 621 | os=-sysv | ||
| 622 | ;; | ||
| 623 | i*86sol2) | ||
| 624 | basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | ||
| 625 | os=-solaris2 | ||
| 626 | ;; | ||
| 627 | i386mach) | ||
| 628 | basic_machine=i386-mach | ||
| 629 | os=-mach | ||
| 630 | ;; | ||
| 631 | i386-vsta | vsta) | ||
| 632 | basic_machine=i386-unknown | ||
| 633 | os=-vsta | ||
| 634 | ;; | ||
| 635 | iris | iris4d) | ||
| 636 | basic_machine=mips-sgi | ||
| 637 | case $os in | ||
| 638 | -irix*) | ||
| 639 | ;; | ||
| 640 | *) | ||
| 641 | os=-irix4 | ||
| 642 | ;; | ||
| 643 | esac | ||
| 644 | ;; | ||
| 645 | isi68 | isi) | ||
| 646 | basic_machine=m68k-isi | ||
| 647 | os=-sysv | ||
| 648 | ;; | ||
| 649 | m88k-omron*) | ||
| 650 | basic_machine=m88k-omron | ||
| 651 | ;; | ||
| 652 | magnum | m3230) | ||
| 653 | basic_machine=mips-mips | ||
| 654 | os=-sysv | ||
| 655 | ;; | ||
| 656 | merlin) | ||
| 657 | basic_machine=ns32k-utek | ||
| 658 | os=-sysv | ||
| 659 | ;; | ||
| 660 | mingw32) | ||
| 661 | basic_machine=i386-pc | ||
| 662 | os=-mingw32 | ||
| 663 | ;; | ||
| 664 | miniframe) | ||
| 665 | basic_machine=m68000-convergent | ||
| 666 | ;; | ||
| 667 | *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) | ||
| 668 | basic_machine=m68k-atari | ||
| 669 | os=-mint | ||
| 670 | ;; | ||
| 671 | mips3*-*) | ||
| 672 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` | ||
| 673 | ;; | ||
| 674 | mips3*) | ||
| 675 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown | ||
| 676 | ;; | ||
| 677 | monitor) | ||
| 678 | basic_machine=m68k-rom68k | ||
| 679 | os=-coff | ||
| 680 | ;; | ||
| 681 | morphos) | ||
| 682 | basic_machine=powerpc-unknown | ||
| 683 | os=-morphos | ||
| 684 | ;; | ||
| 685 | msdos) | ||
| 686 | basic_machine=i386-pc | ||
| 687 | os=-msdos | ||
| 688 | ;; | ||
| 689 | mvs) | ||
| 690 | basic_machine=i370-ibm | ||
| 691 | os=-mvs | ||
| 692 | ;; | ||
| 693 | ncr3000) | ||
| 694 | basic_machine=i486-ncr | ||
| 695 | os=-sysv4 | ||
| 696 | ;; | ||
| 697 | netbsd386) | ||
| 698 | basic_machine=i386-unknown | ||
| 699 | os=-netbsd | ||
| 700 | ;; | ||
| 701 | netwinder) | ||
| 702 | basic_machine=armv4l-rebel | ||
| 703 | os=-linux | ||
| 704 | ;; | ||
| 705 | news | news700 | news800 | news900) | ||
| 706 | basic_machine=m68k-sony | ||
| 707 | os=-newsos | ||
| 708 | ;; | ||
| 709 | news1000) | ||
| 710 | basic_machine=m68030-sony | ||
| 711 | os=-newsos | ||
| 712 | ;; | ||
| 713 | news-3600 | risc-news) | ||
| 714 | basic_machine=mips-sony | ||
| 715 | os=-newsos | ||
| 716 | ;; | ||
| 717 | necv70) | ||
| 718 | basic_machine=v70-nec | ||
| 719 | os=-sysv | ||
| 720 | ;; | ||
| 721 | next | m*-next ) | ||
| 722 | basic_machine=m68k-next | ||
| 723 | case $os in | ||
| 724 | -nextstep* ) | ||
| 725 | ;; | ||
| 726 | -ns2*) | ||
| 727 | os=-nextstep2 | ||
| 728 | ;; | ||
| 729 | *) | ||
| 730 | os=-nextstep3 | ||
| 731 | ;; | ||
| 732 | esac | ||
| 733 | ;; | ||
| 734 | nh3000) | ||
| 735 | basic_machine=m68k-harris | ||
| 736 | os=-cxux | ||
| 737 | ;; | ||
| 738 | nh[45]000) | ||
| 739 | basic_machine=m88k-harris | ||
| 740 | os=-cxux | ||
| 741 | ;; | ||
| 742 | nindy960) | ||
| 743 | basic_machine=i960-intel | ||
| 744 | os=-nindy | ||
| 745 | ;; | ||
| 746 | mon960) | ||
| 747 | basic_machine=i960-intel | ||
| 748 | os=-mon960 | ||
| 749 | ;; | ||
| 750 | nonstopux) | ||
| 751 | basic_machine=mips-compaq | ||
| 752 | os=-nonstopux | ||
| 753 | ;; | ||
| 754 | np1) | ||
| 755 | basic_machine=np1-gould | ||
| 756 | ;; | ||
| 757 | nsr-tandem) | ||
| 758 | basic_machine=nsr-tandem | ||
| 759 | ;; | ||
| 760 | op50n-* | op60c-*) | ||
| 761 | basic_machine=hppa1.1-oki | ||
| 762 | os=-proelf | ||
| 763 | ;; | ||
| 764 | or32 | or32-*) | ||
| 765 | basic_machine=or32-unknown | ||
| 766 | os=-coff | ||
| 767 | ;; | ||
| 768 | os400) | ||
| 769 | basic_machine=powerpc-ibm | ||
| 770 | os=-os400 | ||
| 771 | ;; | ||
| 772 | OSE68000 | ose68000) | ||
| 773 | basic_machine=m68000-ericsson | ||
| 774 | os=-ose | ||
| 775 | ;; | ||
| 776 | os68k) | ||
| 777 | basic_machine=m68k-none | ||
| 778 | os=-os68k | ||
| 779 | ;; | ||
| 780 | pa-hitachi) | ||
| 781 | basic_machine=hppa1.1-hitachi | ||
| 782 | os=-hiuxwe2 | ||
| 783 | ;; | ||
| 784 | paragon) | ||
| 785 | basic_machine=i860-intel | ||
| 786 | os=-osf | ||
| 787 | ;; | ||
| 788 | pbd) | ||
| 789 | basic_machine=sparc-tti | ||
| 790 | ;; | ||
| 791 | pbb) | ||
| 792 | basic_machine=m68k-tti | ||
| 793 | ;; | ||
| 794 | pc532 | pc532-*) | ||
| 795 | basic_machine=ns32k-pc532 | ||
| 796 | ;; | ||
| 797 | pentium | p5 | k5 | k6 | nexgen | viac3) | ||
| 798 | basic_machine=i586-pc | ||
| 799 | ;; | ||
| 800 | pentiumpro | p6 | 6x86 | athlon | athlon_*) | ||
| 801 | basic_machine=i686-pc | ||
| 802 | ;; | ||
| 803 | pentiumii | pentium2 | pentiumiii | pentium3) | ||
| 804 | basic_machine=i686-pc | ||
| 805 | ;; | ||
| 806 | pentium4) | ||
| 807 | basic_machine=i786-pc | ||
| 808 | ;; | ||
| 809 | pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) | ||
| 810 | basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 811 | ;; | ||
| 812 | pentiumpro-* | p6-* | 6x86-* | athlon-*) | ||
| 813 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 814 | ;; | ||
| 815 | pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) | ||
| 816 | basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 817 | ;; | ||
| 818 | pentium4-*) | ||
| 819 | basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 820 | ;; | ||
| 821 | pn) | ||
| 822 | basic_machine=pn-gould | ||
| 823 | ;; | ||
| 824 | power) basic_machine=power-ibm | ||
| 825 | ;; | ||
| 826 | ppc) basic_machine=powerpc-unknown | ||
| 827 | ;; | ||
| 828 | ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 829 | ;; | ||
| 830 | ppcle | powerpclittle | ppc-le | powerpc-little) | ||
| 831 | basic_machine=powerpcle-unknown | ||
| 832 | ;; | ||
| 833 | ppcle-* | powerpclittle-*) | ||
| 834 | basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 835 | ;; | ||
| 836 | ppc64) basic_machine=powerpc64-unknown | ||
| 837 | ;; | ||
| 838 | ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 839 | ;; | ||
| 840 | ppc64le | powerpc64little | ppc64-le | powerpc64-little) | ||
| 841 | basic_machine=powerpc64le-unknown | ||
| 842 | ;; | ||
| 843 | ppc64le-* | powerpc64little-*) | ||
| 844 | basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` | ||
| 845 | ;; | ||
| 846 | ps2) | ||
| 847 | basic_machine=i386-ibm | ||
| 848 | ;; | ||
| 849 | pw32) | ||
| 850 | basic_machine=i586-unknown | ||
| 851 | os=-pw32 | ||
| 852 | ;; | ||
| 853 | rom68k) | ||
| 854 | basic_machine=m68k-rom68k | ||
| 855 | os=-coff | ||
| 856 | ;; | ||
| 857 | rm[46]00) | ||
| 858 | basic_machine=mips-siemens | ||
| 859 | ;; | ||
| 860 | rtpc | rtpc-*) | ||
| 861 | basic_machine=romp-ibm | ||
| 862 | ;; | ||
| 863 | s390 | s390-*) | ||
| 864 | basic_machine=s390-ibm | ||
| 865 | ;; | ||
| 866 | s390x | s390x-*) | ||
| 867 | basic_machine=s390x-ibm | ||
| 868 | ;; | ||
| 869 | sa29200) | ||
| 870 | basic_machine=a29k-amd | ||
| 871 | os=-udi | ||
| 872 | ;; | ||
| 873 | sb1) | ||
| 874 | basic_machine=mipsisa64sb1-unknown | ||
| 875 | ;; | ||
| 876 | sb1el) | ||
| 877 | basic_machine=mipsisa64sb1el-unknown | ||
| 878 | ;; | ||
| 879 | sei) | ||
| 880 | basic_machine=mips-sei | ||
| 881 | os=-seiux | ||
| 882 | ;; | ||
| 883 | sequent) | ||
| 884 | basic_machine=i386-sequent | ||
| 885 | ;; | ||
| 886 | sh) | ||
| 887 | basic_machine=sh-hitachi | ||
| 888 | os=-hms | ||
| 889 | ;; | ||
| 890 | sh64) | ||
| 891 | basic_machine=sh64-unknown | ||
| 892 | ;; | ||
| 893 | sparclite-wrs | simso-wrs) | ||
| 894 | basic_machine=sparclite-wrs | ||
| 895 | os=-vxworks | ||
| 896 | ;; | ||
| 897 | sps7) | ||
| 898 | basic_machine=m68k-bull | ||
| 899 | os=-sysv2 | ||
| 900 | ;; | ||
| 901 | spur) | ||
| 902 | basic_machine=spur-unknown | ||
| 903 | ;; | ||
| 904 | st2000) | ||
| 905 | basic_machine=m68k-tandem | ||
| 906 | ;; | ||
| 907 | stratus) | ||
| 908 | basic_machine=i860-stratus | ||
| 909 | os=-sysv4 | ||
| 910 | ;; | ||
| 911 | sun2) | ||
| 912 | basic_machine=m68000-sun | ||
| 913 | ;; | ||
| 914 | sun2os3) | ||
| 915 | basic_machine=m68000-sun | ||
| 916 | os=-sunos3 | ||
| 917 | ;; | ||
| 918 | sun2os4) | ||
| 919 | basic_machine=m68000-sun | ||
| 920 | os=-sunos4 | ||
| 921 | ;; | ||
| 922 | sun3os3) | ||
| 923 | basic_machine=m68k-sun | ||
| 924 | os=-sunos3 | ||
| 925 | ;; | ||
| 926 | sun3os4) | ||
| 927 | basic_machine=m68k-sun | ||
| 928 | os=-sunos4 | ||
| 929 | ;; | ||
| 930 | sun4os3) | ||
| 931 | basic_machine=sparc-sun | ||
| 932 | os=-sunos3 | ||
| 933 | ;; | ||
| 934 | sun4os4) | ||
| 935 | basic_machine=sparc-sun | ||
| 936 | os=-sunos4 | ||
| 937 | ;; | ||
| 938 | sun4sol2) | ||
| 939 | basic_machine=sparc-sun | ||
| 940 | os=-solaris2 | ||
| 941 | ;; | ||
| 942 | sun3 | sun3-*) | ||
| 943 | basic_machine=m68k-sun | ||
| 944 | ;; | ||
| 945 | sun4) | ||
| 946 | basic_machine=sparc-sun | ||
| 947 | ;; | ||
| 948 | sun386 | sun386i | roadrunner) | ||
| 949 | basic_machine=i386-sun | ||
| 950 | ;; | ||
| 951 | sv1) | ||
| 952 | basic_machine=sv1-cray | ||
| 953 | os=-unicos | ||
| 954 | ;; | ||
| 955 | symmetry) | ||
| 956 | basic_machine=i386-sequent | ||
| 957 | os=-dynix | ||
| 958 | ;; | ||
| 959 | t3e) | ||
| 960 | basic_machine=alphaev5-cray | ||
| 961 | os=-unicos | ||
| 962 | ;; | ||
| 963 | t90) | ||
| 964 | basic_machine=t90-cray | ||
| 965 | os=-unicos | ||
| 966 | ;; | ||
| 967 | tic54x | c54x*) | ||
| 968 | basic_machine=tic54x-unknown | ||
| 969 | os=-coff | ||
| 970 | ;; | ||
| 971 | tic55x | c55x*) | ||
| 972 | basic_machine=tic55x-unknown | ||
| 973 | os=-coff | ||
| 974 | ;; | ||
| 975 | tic6x | c6x*) | ||
| 976 | basic_machine=tic6x-unknown | ||
| 977 | os=-coff | ||
| 978 | ;; | ||
| 979 | tx39) | ||
| 980 | basic_machine=mipstx39-unknown | ||
| 981 | ;; | ||
| 982 | tx39el) | ||
| 983 | basic_machine=mipstx39el-unknown | ||
| 984 | ;; | ||
| 985 | toad1) | ||
| 986 | basic_machine=pdp10-xkl | ||
| 987 | os=-tops20 | ||
| 988 | ;; | ||
| 989 | tower | tower-32) | ||
| 990 | basic_machine=m68k-ncr | ||
| 991 | ;; | ||
| 992 | tpf) | ||
| 993 | basic_machine=s390x-ibm | ||
| 994 | os=-tpf | ||
| 995 | ;; | ||
| 996 | udi29k) | ||
| 997 | basic_machine=a29k-amd | ||
| 998 | os=-udi | ||
| 999 | ;; | ||
| 1000 | ultra3) | ||
| 1001 | basic_machine=a29k-nyu | ||
| 1002 | os=-sym1 | ||
| 1003 | ;; | ||
| 1004 | v810 | necv810) | ||
| 1005 | basic_machine=v810-nec | ||
| 1006 | os=-none | ||
| 1007 | ;; | ||
| 1008 | vaxv) | ||
| 1009 | basic_machine=vax-dec | ||
| 1010 | os=-sysv | ||
| 1011 | ;; | ||
| 1012 | vms) | ||
| 1013 | basic_machine=vax-dec | ||
| 1014 | os=-vms | ||
| 1015 | ;; | ||
| 1016 | vpp*|vx|vx-*) | ||
| 1017 | basic_machine=f301-fujitsu | ||
| 1018 | ;; | ||
| 1019 | vxworks960) | ||
| 1020 | basic_machine=i960-wrs | ||
| 1021 | os=-vxworks | ||
| 1022 | ;; | ||
| 1023 | vxworks68) | ||
| 1024 | basic_machine=m68k-wrs | ||
| 1025 | os=-vxworks | ||
| 1026 | ;; | ||
| 1027 | vxworks29k) | ||
| 1028 | basic_machine=a29k-wrs | ||
| 1029 | os=-vxworks | ||
| 1030 | ;; | ||
| 1031 | w65*) | ||
| 1032 | basic_machine=w65-wdc | ||
| 1033 | os=-none | ||
| 1034 | ;; | ||
| 1035 | w89k-*) | ||
| 1036 | basic_machine=hppa1.1-winbond | ||
| 1037 | os=-proelf | ||
| 1038 | ;; | ||
| 1039 | xbox) | ||
| 1040 | basic_machine=i686-pc | ||
| 1041 | os=-mingw32 | ||
| 1042 | ;; | ||
| 1043 | xps | xps100) | ||
| 1044 | basic_machine=xps100-honeywell | ||
| 1045 | ;; | ||
| 1046 | ymp) | ||
| 1047 | basic_machine=ymp-cray | ||
| 1048 | os=-unicos | ||
| 1049 | ;; | ||
| 1050 | z8k-*-coff) | ||
| 1051 | basic_machine=z8k-unknown | ||
| 1052 | os=-sim | ||
| 1053 | ;; | ||
| 1054 | none) | ||
| 1055 | basic_machine=none-none | ||
| 1056 | os=-none | ||
| 1057 | ;; | ||
| 1058 | |||
| 1059 | # Here we handle the default manufacturer of certain CPU types. It is in | ||
| 1060 | # some cases the only manufacturer, in others, it is the most popular. | ||
| 1061 | w89k) | ||
| 1062 | basic_machine=hppa1.1-winbond | ||
| 1063 | ;; | ||
| 1064 | op50n) | ||
| 1065 | basic_machine=hppa1.1-oki | ||
| 1066 | ;; | ||
| 1067 | op60c) | ||
| 1068 | basic_machine=hppa1.1-oki | ||
| 1069 | ;; | ||
| 1070 | romp) | ||
| 1071 | basic_machine=romp-ibm | ||
| 1072 | ;; | ||
| 1073 | mmix) | ||
| 1074 | basic_machine=mmix-knuth | ||
| 1075 | ;; | ||
| 1076 | rs6000) | ||
| 1077 | basic_machine=rs6000-ibm | ||
| 1078 | ;; | ||
| 1079 | vax) | ||
| 1080 | basic_machine=vax-dec | ||
| 1081 | ;; | ||
| 1082 | pdp10) | ||
| 1083 | # there are many clones, so DEC is not a safe bet | ||
| 1084 | basic_machine=pdp10-unknown | ||
| 1085 | ;; | ||
| 1086 | pdp11) | ||
| 1087 | basic_machine=pdp11-dec | ||
| 1088 | ;; | ||
| 1089 | we32k) | ||
| 1090 | basic_machine=we32k-att | ||
| 1091 | ;; | ||
| 1092 | sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) | ||
| 1093 | basic_machine=sh-unknown | ||
| 1094 | ;; | ||
| 1095 | sh64) | ||
| 1096 | basic_machine=sh64-unknown | ||
| 1097 | ;; | ||
| 1098 | sparc | sparcv8 | sparcv9 | sparcv9b) | ||
| 1099 | basic_machine=sparc-sun | ||
| 1100 | ;; | ||
| 1101 | cydra) | ||
| 1102 | basic_machine=cydra-cydrome | ||
| 1103 | ;; | ||
| 1104 | orion) | ||
| 1105 | basic_machine=orion-highlevel | ||
| 1106 | ;; | ||
| 1107 | orion105) | ||
| 1108 | basic_machine=clipper-highlevel | ||
| 1109 | ;; | ||
| 1110 | mac | mpw | mac-mpw) | ||
| 1111 | basic_machine=m68k-apple | ||
| 1112 | ;; | ||
| 1113 | pmac | pmac-mpw) | ||
| 1114 | basic_machine=powerpc-apple | ||
| 1115 | ;; | ||
| 1116 | *-unknown) | ||
| 1117 | # Make sure to match an already-canonicalized machine name. | ||
| 1118 | ;; | ||
| 1119 | *) | ||
| 1120 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | ||
| 1121 | exit 1 | ||
| 1122 | ;; | ||
| 1123 | esac | ||
| 1124 | |||
| 1125 | # Here we canonicalize certain aliases for manufacturers. | ||
| 1126 | case $basic_machine in | ||
| 1127 | *-digital*) | ||
| 1128 | basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` | ||
| 1129 | ;; | ||
| 1130 | *-commodore*) | ||
| 1131 | basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` | ||
| 1132 | ;; | ||
| 1133 | *) | ||
| 1134 | ;; | ||
| 1135 | esac | ||
| 1136 | |||
| 1137 | # Decode manufacturer-specific aliases for certain operating systems. | ||
| 1138 | |||
| 1139 | if [ x"$os" != x"" ] | ||
| 1140 | then | ||
| 1141 | case $os in | ||
| 1142 | # First match some system type aliases | ||
| 1143 | # that might get confused with valid system types. | ||
| 1144 | # -solaris* is a basic system type, with this one exception. | ||
| 1145 | -solaris1 | -solaris1.*) | ||
| 1146 | os=`echo $os | sed -e 's|solaris1|sunos4|'` | ||
| 1147 | ;; | ||
| 1148 | -solaris) | ||
| 1149 | os=-solaris2 | ||
| 1150 | ;; | ||
| 1151 | -svr4*) | ||
| 1152 | os=-sysv4 | ||
| 1153 | ;; | ||
| 1154 | -unixware*) | ||
| 1155 | os=-sysv4.2uw | ||
| 1156 | ;; | ||
| 1157 | -gnu/linux*) | ||
| 1158 | os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` | ||
| 1159 | ;; | ||
| 1160 | # First accept the basic system types. | ||
| 1161 | # The portable systems comes first. | ||
| 1162 | # Each alternative MUST END IN A *, to match a version number. | ||
| 1163 | # -sysv* is not here because it comes later, after sysvr4. | ||
| 1164 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | ||
| 1165 | | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | ||
| 1166 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | ||
| 1167 | | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | ||
| 1168 | | -aos* \ | ||
| 1169 | | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | ||
| 1170 | | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | ||
| 1171 | | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | ||
| 1172 | | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | ||
| 1173 | | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | ||
| 1174 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | ||
| 1175 | | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | ||
| 1176 | | -chorusos* | -chorusrdb* \ | ||
| 1177 | | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | ||
| 1178 | | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | ||
| 1179 | | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | ||
| 1180 | | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | ||
| 1181 | | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | ||
| 1182 | | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | ||
| 1183 | | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | ||
| 1184 | | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) | ||
| 1185 | # Remember, each alternative MUST END IN *, to match a version number. | ||
| 1186 | ;; | ||
| 1187 | -qnx*) | ||
| 1188 | case $basic_machine in | ||
| 1189 | x86-* | i*86-*) | ||
| 1190 | ;; | ||
| 1191 | *) | ||
| 1192 | os=-nto$os | ||
| 1193 | ;; | ||
| 1194 | esac | ||
| 1195 | ;; | ||
| 1196 | -nto-qnx*) | ||
| 1197 | ;; | ||
| 1198 | -nto*) | ||
| 1199 | os=`echo $os | sed -e 's|nto|nto-qnx|'` | ||
| 1200 | ;; | ||
| 1201 | -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | ||
| 1202 | | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | ||
| 1203 | | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | ||
| 1204 | ;; | ||
| 1205 | -mac*) | ||
| 1206 | os=`echo $os | sed -e 's|mac|macos|'` | ||
| 1207 | ;; | ||
| 1208 | -linux-dietlibc) | ||
| 1209 | os=-linux-dietlibc | ||
| 1210 | ;; | ||
| 1211 | -linux*) | ||
| 1212 | os=`echo $os | sed -e 's|linux|linux-gnu|'` | ||
| 1213 | ;; | ||
| 1214 | -sunos5*) | ||
| 1215 | os=`echo $os | sed -e 's|sunos5|solaris2|'` | ||
| 1216 | ;; | ||
| 1217 | -sunos6*) | ||
| 1218 | os=`echo $os | sed -e 's|sunos6|solaris3|'` | ||
| 1219 | ;; | ||
| 1220 | -opened*) | ||
| 1221 | os=-openedition | ||
| 1222 | ;; | ||
| 1223 | -os400*) | ||
| 1224 | os=-os400 | ||
| 1225 | ;; | ||
| 1226 | -wince*) | ||
| 1227 | os=-wince | ||
| 1228 | ;; | ||
| 1229 | -osfrose*) | ||
| 1230 | os=-osfrose | ||
| 1231 | ;; | ||
| 1232 | -osf*) | ||
| 1233 | os=-osf | ||
| 1234 | ;; | ||
| 1235 | -utek*) | ||
| 1236 | os=-bsd | ||
| 1237 | ;; | ||
| 1238 | -dynix*) | ||
| 1239 | os=-bsd | ||
| 1240 | ;; | ||
| 1241 | -acis*) | ||
| 1242 | os=-aos | ||
| 1243 | ;; | ||
| 1244 | -atheos*) | ||
| 1245 | os=-atheos | ||
| 1246 | ;; | ||
| 1247 | -syllable*) | ||
| 1248 | os=-syllable | ||
| 1249 | ;; | ||
| 1250 | -386bsd) | ||
| 1251 | os=-bsd | ||
| 1252 | ;; | ||
| 1253 | -ctix* | -uts*) | ||
| 1254 | os=-sysv | ||
| 1255 | ;; | ||
| 1256 | -nova*) | ||
| 1257 | os=-rtmk-nova | ||
| 1258 | ;; | ||
| 1259 | -ns2 ) | ||
| 1260 | os=-nextstep2 | ||
| 1261 | ;; | ||
| 1262 | -nsk*) | ||
| 1263 | os=-nsk | ||
| 1264 | ;; | ||
| 1265 | # Preserve the version number of sinix5. | ||
| 1266 | -sinix5.*) | ||
| 1267 | os=`echo $os | sed -e 's|sinix|sysv|'` | ||
| 1268 | ;; | ||
| 1269 | -sinix*) | ||
| 1270 | os=-sysv4 | ||
| 1271 | ;; | ||
| 1272 | -tpf*) | ||
| 1273 | os=-tpf | ||
| 1274 | ;; | ||
| 1275 | -triton*) | ||
| 1276 | os=-sysv3 | ||
| 1277 | ;; | ||
| 1278 | -oss*) | ||
| 1279 | os=-sysv3 | ||
| 1280 | ;; | ||
| 1281 | -svr4) | ||
| 1282 | os=-sysv4 | ||
| 1283 | ;; | ||
| 1284 | -svr3) | ||
| 1285 | os=-sysv3 | ||
| 1286 | ;; | ||
| 1287 | -sysvr4) | ||
| 1288 | os=-sysv4 | ||
| 1289 | ;; | ||
| 1290 | # This must come after -sysvr4. | ||
| 1291 | -sysv*) | ||
| 1292 | ;; | ||
| 1293 | -ose*) | ||
| 1294 | os=-ose | ||
| 1295 | ;; | ||
| 1296 | -es1800*) | ||
| 1297 | os=-ose | ||
| 1298 | ;; | ||
| 1299 | -xenix) | ||
| 1300 | os=-xenix | ||
| 1301 | ;; | ||
| 1302 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) | ||
| 1303 | os=-mint | ||
| 1304 | ;; | ||
| 1305 | -aros*) | ||
| 1306 | os=-aros | ||
| 1307 | ;; | ||
| 1308 | -kaos*) | ||
| 1309 | os=-kaos | ||
| 1310 | ;; | ||
| 1311 | -zvmoe) | ||
| 1312 | os=-zvmoe | ||
| 1313 | ;; | ||
| 1314 | -none) | ||
| 1315 | ;; | ||
| 1316 | *) | ||
| 1317 | # Get rid of the `-' at the beginning of $os. | ||
| 1318 | os=`echo $os | sed 's/[^-]*-//'` | ||
| 1319 | echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 | ||
| 1320 | exit 1 | ||
| 1321 | ;; | ||
| 1322 | esac | ||
| 1323 | else | ||
| 1324 | |||
| 1325 | # Here we handle the default operating systems that come with various machines. | ||
| 1326 | # The value should be what the vendor currently ships out the door with their | ||
| 1327 | # machine or put another way, the most popular os provided with the machine. | ||
| 1328 | |||
| 1329 | # Note that if you're going to try to match "-MANUFACTURER" here (say, | ||
| 1330 | # "-sun"), then you have to tell the case statement up towards the top | ||
| 1331 | # that MANUFACTURER isn't an operating system. Otherwise, code above | ||
| 1332 | # will signal an error saying that MANUFACTURER isn't an operating | ||
| 1333 | # system, and we'll never get to this point. | ||
| 1334 | |||
| 1335 | case $basic_machine in | ||
| 1336 | *-acorn) | ||
| 1337 | os=-riscix1.2 | ||
| 1338 | ;; | ||
| 1339 | arm*-rebel) | ||
| 1340 | os=-linux | ||
| 1341 | ;; | ||
| 1342 | arm*-semi) | ||
| 1343 | os=-aout | ||
| 1344 | ;; | ||
| 1345 | c4x-* | tic4x-*) | ||
| 1346 | os=-coff | ||
| 1347 | ;; | ||
| 1348 | # This must come before the *-dec entry. | ||
| 1349 | pdp10-*) | ||
| 1350 | os=-tops20 | ||
| 1351 | ;; | ||
| 1352 | pdp11-*) | ||
| 1353 | os=-none | ||
| 1354 | ;; | ||
| 1355 | *-dec | vax-*) | ||
| 1356 | os=-ultrix4.2 | ||
| 1357 | ;; | ||
| 1358 | m68*-apollo) | ||
| 1359 | os=-domain | ||
| 1360 | ;; | ||
| 1361 | i386-sun) | ||
| 1362 | os=-sunos4.0.2 | ||
| 1363 | ;; | ||
| 1364 | m68000-sun) | ||
| 1365 | os=-sunos3 | ||
| 1366 | # This also exists in the configure program, but was not the | ||
| 1367 | # default. | ||
| 1368 | # os=-sunos4 | ||
| 1369 | ;; | ||
| 1370 | m68*-cisco) | ||
| 1371 | os=-aout | ||
| 1372 | ;; | ||
| 1373 | mips*-cisco) | ||
| 1374 | os=-elf | ||
| 1375 | ;; | ||
| 1376 | mips*-*) | ||
| 1377 | os=-elf | ||
| 1378 | ;; | ||
| 1379 | or32-*) | ||
| 1380 | os=-coff | ||
| 1381 | ;; | ||
| 1382 | *-tti) # must be before sparc entry or we get the wrong os. | ||
| 1383 | os=-sysv3 | ||
| 1384 | ;; | ||
| 1385 | sparc-* | *-sun) | ||
| 1386 | os=-sunos4.1.1 | ||
| 1387 | ;; | ||
| 1388 | *-be) | ||
| 1389 | os=-beos | ||
| 1390 | ;; | ||
| 1391 | *-ibm) | ||
| 1392 | os=-aix | ||
| 1393 | ;; | ||
| 1394 | *-knuth) | ||
| 1395 | os=-mmixware | ||
| 1396 | ;; | ||
| 1397 | *-wec) | ||
| 1398 | os=-proelf | ||
| 1399 | ;; | ||
| 1400 | *-winbond) | ||
| 1401 | os=-proelf | ||
| 1402 | ;; | ||
| 1403 | *-oki) | ||
| 1404 | os=-proelf | ||
| 1405 | ;; | ||
| 1406 | *-hp) | ||
| 1407 | os=-hpux | ||
| 1408 | ;; | ||
| 1409 | *-hitachi) | ||
| 1410 | os=-hiux | ||
| 1411 | ;; | ||
| 1412 | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) | ||
| 1413 | os=-sysv | ||
| 1414 | ;; | ||
| 1415 | *-cbm) | ||
| 1416 | os=-amigaos | ||
| 1417 | ;; | ||
| 1418 | *-dg) | ||
| 1419 | os=-dgux | ||
| 1420 | ;; | ||
| 1421 | *-dolphin) | ||
| 1422 | os=-sysv3 | ||
| 1423 | ;; | ||
| 1424 | m68k-ccur) | ||
| 1425 | os=-rtu | ||
| 1426 | ;; | ||
| 1427 | m88k-omron*) | ||
| 1428 | os=-luna | ||
| 1429 | ;; | ||
| 1430 | *-next ) | ||
| 1431 | os=-nextstep | ||
| 1432 | ;; | ||
| 1433 | *-sequent) | ||
| 1434 | os=-ptx | ||
| 1435 | ;; | ||
| 1436 | *-crds) | ||
| 1437 | os=-unos | ||
| 1438 | ;; | ||
| 1439 | *-ns) | ||
| 1440 | os=-genix | ||
| 1441 | ;; | ||
| 1442 | i370-*) | ||
| 1443 | os=-mvs | ||
| 1444 | ;; | ||
| 1445 | *-next) | ||
| 1446 | os=-nextstep3 | ||
| 1447 | ;; | ||
| 1448 | *-gould) | ||
| 1449 | os=-sysv | ||
| 1450 | ;; | ||
| 1451 | *-highlevel) | ||
| 1452 | os=-bsd | ||
| 1453 | ;; | ||
| 1454 | *-encore) | ||
| 1455 | os=-bsd | ||
| 1456 | ;; | ||
| 1457 | *-sgi) | ||
| 1458 | os=-irix | ||
| 1459 | ;; | ||
| 1460 | *-siemens) | ||
| 1461 | os=-sysv4 | ||
| 1462 | ;; | ||
| 1463 | *-masscomp) | ||
| 1464 | os=-rtu | ||
| 1465 | ;; | ||
| 1466 | f30[01]-fujitsu | f700-fujitsu) | ||
| 1467 | os=-uxpv | ||
| 1468 | ;; | ||
| 1469 | *-rom68k) | ||
| 1470 | os=-coff | ||
| 1471 | ;; | ||
| 1472 | *-*bug) | ||
| 1473 | os=-coff | ||
| 1474 | ;; | ||
| 1475 | *-apple) | ||
| 1476 | os=-macos | ||
| 1477 | ;; | ||
| 1478 | *-atari*) | ||
| 1479 | os=-mint | ||
| 1480 | ;; | ||
| 1481 | *) | ||
| 1482 | os=-none | ||
| 1483 | ;; | ||
| 1484 | esac | ||
| 1485 | fi | ||
| 1486 | |||
| 1487 | # Here we handle the case where we know the os, and the CPU type, but not the | ||
| 1488 | # manufacturer. We pick the logical manufacturer. | ||
| 1489 | vendor=unknown | ||
| 1490 | case $basic_machine in | ||
| 1491 | *-unknown) | ||
| 1492 | case $os in | ||
| 1493 | -riscix*) | ||
| 1494 | vendor=acorn | ||
| 1495 | ;; | ||
| 1496 | -sunos*) | ||
| 1497 | vendor=sun | ||
| 1498 | ;; | ||
| 1499 | -aix*) | ||
| 1500 | vendor=ibm | ||
| 1501 | ;; | ||
| 1502 | -beos*) | ||
| 1503 | vendor=be | ||
| 1504 | ;; | ||
| 1505 | -hpux*) | ||
| 1506 | vendor=hp | ||
| 1507 | ;; | ||
| 1508 | -mpeix*) | ||
| 1509 | vendor=hp | ||
| 1510 | ;; | ||
| 1511 | -hiux*) | ||
| 1512 | vendor=hitachi | ||
| 1513 | ;; | ||
| 1514 | -unos*) | ||
| 1515 | vendor=crds | ||
| 1516 | ;; | ||
| 1517 | -dgux*) | ||
| 1518 | vendor=dg | ||
| 1519 | ;; | ||
| 1520 | -luna*) | ||
| 1521 | vendor=omron | ||
| 1522 | ;; | ||
| 1523 | -genix*) | ||
| 1524 | vendor=ns | ||
| 1525 | ;; | ||
| 1526 | -mvs* | -opened*) | ||
| 1527 | vendor=ibm | ||
| 1528 | ;; | ||
| 1529 | -os400*) | ||
| 1530 | vendor=ibm | ||
| 1531 | ;; | ||
| 1532 | -ptx*) | ||
| 1533 | vendor=sequent | ||
| 1534 | ;; | ||
| 1535 | -tpf*) | ||
| 1536 | vendor=ibm | ||
| 1537 | ;; | ||
| 1538 | -vxsim* | -vxworks* | -windiss*) | ||
| 1539 | vendor=wrs | ||
| 1540 | ;; | ||
| 1541 | -aux*) | ||
| 1542 | vendor=apple | ||
| 1543 | ;; | ||
| 1544 | -hms*) | ||
| 1545 | vendor=hitachi | ||
| 1546 | ;; | ||
| 1547 | -mpw* | -macos*) | ||
| 1548 | vendor=apple | ||
| 1549 | ;; | ||
| 1550 | -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) | ||
| 1551 | vendor=atari | ||
| 1552 | ;; | ||
| 1553 | -vos*) | ||
| 1554 | vendor=stratus | ||
| 1555 | ;; | ||
| 1556 | esac | ||
| 1557 | basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` | ||
| 1558 | ;; | ||
| 1559 | esac | ||
| 1560 | |||
| 1561 | echo $basic_machine$os | ||
| 1562 | exit 0 | ||
| 1563 | |||
| 1564 | # Local variables: | ||
| 1565 | # eval: (add-hook 'write-file-hooks 'time-stamp) | ||
| 1566 | # time-stamp-start: "timestamp='" | ||
| 1567 | # time-stamp-format: "%:y-%02m-%02d" | ||
| 1568 | # time-stamp-end: "'" | ||
| 1569 | # End: | ||
diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml index 6d5c813c..af70cef6 100644 --- a/doc/developer-guidelines.sgml +++ b/doc/developer-guidelines.sgml | |||
| @@ -57,7 +57,6 @@ | |||
| 57 | gnu make 3.79 | 57 | gnu make 3.79 |
| 58 | automake 1.8.3 | 58 | automake 1.8.3 |
| 59 | autoconf 2.58 | 59 | autoconf 2.58 |
| 60 | gnu libtool 1.5.6 | ||
| 61 | </literallayout> | 60 | </literallayout> |
| 62 | 61 | ||
| 63 | To compile from CVS, after you have checked out the code, run: | 62 | To compile from CVS, after you have checked out the code, run: |
| @@ -73,6 +72,9 @@ | |||
| 73 | are synced with the coreutils project and we use the same levels of gettext that they | 72 | are synced with the coreutils project and we use the same levels of gettext that they |
| 74 | distribute. | 73 | distribute. |
| 75 | </para> | 74 | </para> |
| 75 | <para>Note: gnu libtool, which must be at version 1.5.22 or above, has files installed into CVS, so is not | ||
| 76 | a development platform requirement. | ||
| 77 | </para> | ||
| 76 | </section> | 78 | </section> |
| 77 | 79 | ||
| 78 | <section id="PlugOutput"><title>Plugin Output for Nagios</title> | 80 | <section id="PlugOutput"><title>Plugin Output for Nagios</title> |
diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 00000000..c715b594 --- /dev/null +++ b/ltmain.sh | |||
| @@ -0,0 +1,6871 @@ | |||
| 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 | ||
| 9 | # it under the terms of the GNU General Public License as published by | ||
| 10 | # the Free Software Foundation; either version 2 of the License, or | ||
| 11 | # (at your option) any later version. | ||
| 12 | # | ||
| 13 | # This program is distributed in the hope that it will be useful, but | ||
| 14 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 16 | # General Public License for more details. | ||
| 17 | # | ||
| 18 | # 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. | ||
| 21 | # | ||
| 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 | ||
| 43 | |||
| 44 | PROGRAM=ltmain.sh | ||
| 45 | PACKAGE=libtool | ||
| 46 | VERSION="1.5.22 Debian 1.5.22-4" | ||
| 47 | TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" | ||
| 48 | |||
| 49 | # See if we are running on zsh, and set the options which allow our | ||
| 50 | # commands through without removal of \ escapes. | ||
| 51 | if test -n "${ZSH_VERSION+set}" ; then | ||
| 52 | setopt NO_GLOB_SUBST | ||
| 53 | fi | ||
| 54 | |||
| 55 | # Check that we have a working $echo. | ||
| 56 | if test "X$1" = X--no-reexec; then | ||
| 57 | # Discard the --no-reexec flag, and continue. | ||
| 58 | shift | ||
| 59 | elif test "X$1" = X--fallback-echo; then | ||
| 60 | # Avoid inline document here, it may be left over | ||
| 61 | : | ||
| 62 | elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then | ||
| 63 | # Yippee, $echo works! | ||
| 64 | : | ||
| 65 | else | ||
| 66 | # Restart under the correct shell, and then maybe $echo will work. | ||
| 67 | exec $SHELL "$progpath" --no-reexec ${1+"$@"} | ||
| 68 | fi | ||
| 69 | |||
| 70 | if test "X$1" = X--fallback-echo; then | ||
| 71 | # used as fallback echo | ||
| 72 | shift | ||
| 73 | cat <<EOF | ||
| 74 | $* | ||
| 75 | EOF | ||
| 76 | exit $EXIT_SUCCESS | ||
| 77 | fi | ||
| 78 | |||
| 79 | default_mode= | ||
| 80 | help="Try \`$progname --help' for more information." | ||
| 81 | magic="%%%MAGIC variable%%%" | ||
| 82 | mkdir="mkdir" | ||
| 83 | mv="mv -f" | ||
| 84 | rm="rm -f" | ||
| 85 | |||
| 86 | # Sed substitution that helps us do robust quoting. It backslashifies | ||
| 87 | # metacharacters that are still active within double-quoted strings. | ||
| 88 | Xsed="${SED}"' -e 1s/^X//' | ||
| 89 | sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' | ||
| 90 | # test EBCDIC or ASCII | ||
| 91 | case `echo X|tr X '\101'` in | ||
| 92 | A) # ASCII based system | ||
| 93 | # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr | ||
| 94 | SP2NL='tr \040 \012' | ||
| 95 | NL2SP='tr \015\012 \040\040' | ||
| 96 | ;; | ||
| 97 | *) # EBCDIC based system | ||
| 98 | SP2NL='tr \100 \n' | ||
| 99 | NL2SP='tr \r\n \100\100' | ||
| 100 | ;; | ||
| 101 | esac | ||
| 102 | |||
| 103 | # NLS nuisances. | ||
| 104 | # Only set LANG and LC_ALL to C if already set. | ||
| 105 | # These must not be set unconditionally because not all systems understand | ||
| 106 | # e.g. LANG=C (notably SCO). | ||
| 107 | # We save the old values to restore during execute mode. | ||
| 108 | if test "${LC_ALL+set}" = set; then | ||
| 109 | save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL | ||
| 110 | fi | ||
| 111 | if test "${LANG+set}" = set; then | ||
| 112 | save_LANG="$LANG"; LANG=C; export LANG | ||
| 113 | fi | ||
| 114 | |||
| 115 | # Make sure IFS has a sensible default | ||
| 116 | lt_nl=' | ||
| 117 | ' | ||
| 118 | IFS=" $lt_nl" | ||
| 119 | |||
| 120 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then | ||
| 121 | $echo "$modename: not configured to build any kind of library" 1>&2 | ||
| 122 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | ||
| 123 | exit $EXIT_FAILURE | ||
| 124 | fi | ||
| 125 | |||
| 126 | # Global variables. | ||
| 127 | mode=$default_mode | ||
| 128 | nonopt= | ||
| 129 | prev= | ||
| 130 | prevopt= | ||
| 131 | run= | ||
| 132 | show="$echo" | ||
| 133 | show_help= | ||
| 134 | execute_dlfiles= | ||
| 135 | duplicate_deps=no | ||
| 136 | preserve_args= | ||
| 137 | lo2o="s/\\.lo\$/.${objext}/" | ||
| 138 | o2lo="s/\\.${objext}\$/.lo/" | ||
| 139 | |||
| 140 | ##################################### | ||
| 141 | # Shell function definitions: | ||
| 142 | # This seems to be the best place for them | ||
| 143 | |||
| 144 | # func_mktempdir [string] | ||
| 145 | # Make a temporary directory that won't clash with other running | ||
| 146 | # libtool processes, and avoids race conditions if possible. If | ||
| 147 | # given, STRING is the basename for that directory. | ||
| 148 | func_mktempdir () | ||
| 149 | { | ||
| 150 | my_template="${TMPDIR-/tmp}/${1-$progname}" | ||
| 151 | |||
| 152 | if test "$run" = ":"; then | ||
| 153 | # Return a directory name, but don't create it in dry-run mode | ||
| 154 | my_tmpdir="${my_template}-$$" | ||
| 155 | else | ||
| 156 | |||
| 157 | # If mktemp works, use that first and foremost | ||
| 158 | my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` | ||
| 159 | |||
| 160 | if test ! -d "$my_tmpdir"; then | ||
| 161 | # Failing that, at least try and use $RANDOM to avoid a race | ||
| 162 | my_tmpdir="${my_template}-${RANDOM-0}$$" | ||
| 163 | |||
| 164 | save_mktempdir_umask=`umask` | ||
| 165 | umask 0077 | ||
| 166 | $mkdir "$my_tmpdir" | ||
| 167 | umask $save_mktempdir_umask | ||
| 168 | fi | ||
| 169 | |||
| 170 | # If we're not in dry-run mode, bomb out on failure | ||
| 171 | test -d "$my_tmpdir" || { | ||
| 172 | $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 | ||
| 173 | exit $EXIT_FAILURE | ||
| 174 | } | ||
| 175 | fi | ||
| 176 | |||
| 177 | $echo "X$my_tmpdir" | $Xsed | ||
| 178 | } | ||
| 179 | |||
| 180 | |||
| 181 | # func_win32_libid arg | ||
| 182 | # return the library type of file 'arg' | ||
| 183 | # | ||
| 184 | # Need a lot of goo to handle *both* DLLs and import libs | ||
| 185 | # Has to be a shell function in order to 'eat' the argument | ||
| 186 | # that is supplied when $file_magic_command is called. | ||
| 187 | func_win32_libid () | ||
| 188 | { | ||
| 189 | win32_libid_type="unknown" | ||
| 190 | win32_fileres=`file -L $1 2>/dev/null` | ||
| 191 | case $win32_fileres in | ||
| 192 | *ar\ archive\ import\ library*) # definitely import | ||
| 193 | win32_libid_type="x86 archive import" | ||
| 194 | ;; | ||
| 195 | *ar\ archive*) # could be an import, or static | ||
| 196 | if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ | ||
| 197 | $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then | ||
| 198 | win32_nmres=`eval $NM -f posix -A $1 | \ | ||
| 199 | $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` | ||
| 200 | case $win32_nmres in | ||
| 201 | import*) win32_libid_type="x86 archive import";; | ||
| 202 | *) win32_libid_type="x86 archive static";; | ||
| 203 | esac | ||
| 204 | fi | ||
| 205 | ;; | ||
| 206 | *DLL*) | ||
| 207 | win32_libid_type="x86 DLL" | ||
| 208 | ;; | ||
| 209 | *executable*) # but shell scripts are "executable" too... | ||
| 210 | case $win32_fileres in | ||
| 211 | *MS\ Windows\ PE\ Intel*) | ||
| 212 | win32_libid_type="x86 DLL" | ||
| 213 | ;; | ||
| 214 | esac | ||
| 215 | ;; | ||
| 216 | esac | ||
| 217 | $echo $win32_libid_type | ||
| 218 | } | ||
| 219 | |||
| 220 | |||
| 221 | # func_infer_tag arg | ||
| 222 | # Infer tagged configuration to use if any are available and | ||
| 223 | # if one wasn't chosen via the "--tag" command line option. | ||
| 224 | # Only attempt this if the compiler in the base compile | ||
| 225 | # command doesn't match the default compiler. | ||
| 226 | # arg is usually of the form 'gcc ...' | ||
| 227 | func_infer_tag () | ||
| 228 | { | ||
| 229 | if test -n "$available_tags" && test -z "$tagname"; then | ||
| 230 | CC_quoted= | ||
| 231 | for arg in $CC; do | ||
| 232 | case $arg in | ||
| 233 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 234 | arg="\"$arg\"" | ||
| 235 | ;; | ||
| 236 | esac | ||
| 237 | CC_quoted="$CC_quoted $arg" | ||
| 238 | done | ||
| 239 | case $@ in | ||
| 240 | # Blanks in the command may have been stripped by the calling shell, | ||
| 241 | # but not from the CC environment variable when configure was run. | ||
| 242 | " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; | ||
| 243 | # Blanks at the start of $base_compile will cause this to fail | ||
| 244 | # if we don't check for them as well. | ||
| 245 | *) | ||
| 246 | for z in $available_tags; do | ||
| 247 | if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then | ||
| 248 | # Evaluate the configuration. | ||
| 249 | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" | ||
| 250 | CC_quoted= | ||
| 251 | for arg in $CC; do | ||
| 252 | # Double-quote args containing other shell metacharacters. | ||
| 253 | case $arg in | ||
| 254 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 255 | arg="\"$arg\"" | ||
| 256 | ;; | ||
| 257 | esac | ||
| 258 | CC_quoted="$CC_quoted $arg" | ||
| 259 | done | ||
| 260 | case "$@ " in | ||
| 261 | " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) | ||
| 262 | # The compiler in the base compile command matches | ||
| 263 | # the one in the tagged configuration. | ||
| 264 | # Assume this is the tagged configuration we want. | ||
| 265 | tagname=$z | ||
| 266 | break | ||
| 267 | ;; | ||
| 268 | esac | ||
| 269 | fi | ||
| 270 | done | ||
| 271 | # If $tagname still isn't set, then no tagged configuration | ||
| 272 | # was found and let the user know that the "--tag" command | ||
| 273 | # line option must be used. | ||
| 274 | if test -z "$tagname"; then | ||
| 275 | $echo "$modename: unable to infer tagged configuration" | ||
| 276 | $echo "$modename: specify a tag with \`--tag'" 1>&2 | ||
| 277 | exit $EXIT_FAILURE | ||
| 278 | # else | ||
| 279 | # $echo "$modename: using $tagname tagged configuration" | ||
| 280 | fi | ||
| 281 | ;; | ||
| 282 | esac | ||
| 283 | fi | ||
| 284 | } | ||
| 285 | |||
| 286 | |||
| 287 | # func_extract_an_archive dir oldlib | ||
| 288 | func_extract_an_archive () | ||
| 289 | { | ||
| 290 | f_ex_an_ar_dir="$1"; shift | ||
| 291 | f_ex_an_ar_oldlib="$1" | ||
| 292 | |||
| 293 | $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" | ||
| 294 | $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? | ||
| 295 | if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then | ||
| 296 | : | ||
| 297 | else | ||
| 298 | $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 | ||
| 299 | exit $EXIT_FAILURE | ||
| 300 | fi | ||
| 301 | } | ||
| 302 | |||
| 303 | # func_extract_archives gentop oldlib ... | ||
| 304 | func_extract_archives () | ||
| 305 | { | ||
| 306 | my_gentop="$1"; shift | ||
| 307 | my_oldlibs=${1+"$@"} | ||
| 308 | my_oldobjs="" | ||
| 309 | my_xlib="" | ||
| 310 | my_xabs="" | ||
| 311 | my_xdir="" | ||
| 312 | my_status="" | ||
| 313 | |||
| 314 | $show "${rm}r $my_gentop" | ||
| 315 | $run ${rm}r "$my_gentop" | ||
| 316 | $show "$mkdir $my_gentop" | ||
| 317 | $run $mkdir "$my_gentop" | ||
| 318 | my_status=$? | ||
| 319 | if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then | ||
| 320 | exit $my_status | ||
| 321 | fi | ||
| 322 | |||
| 323 | for my_xlib in $my_oldlibs; do | ||
| 324 | # Extract the objects. | ||
| 325 | case $my_xlib in | ||
| 326 | [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; | ||
| 327 | *) my_xabs=`pwd`"/$my_xlib" ;; | ||
| 328 | esac | ||
| 329 | my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` | ||
| 330 | my_xdir="$my_gentop/$my_xlib" | ||
| 331 | |||
| 332 | $show "${rm}r $my_xdir" | ||
| 333 | $run ${rm}r "$my_xdir" | ||
| 334 | $show "$mkdir $my_xdir" | ||
| 335 | $run $mkdir "$my_xdir" | ||
| 336 | exit_status=$? | ||
| 337 | if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then | ||
| 338 | exit $exit_status | ||
| 339 | fi | ||
| 340 | case $host in | ||
| 341 | *-darwin*) | ||
| 342 | $show "Extracting $my_xabs" | ||
| 343 | # Do not bother doing anything if just a dry run | ||
| 344 | if test -z "$run"; then | ||
| 345 | darwin_orig_dir=`pwd` | ||
| 346 | cd $my_xdir || exit $? | ||
| 347 | darwin_archive=$my_xabs | ||
| 348 | darwin_curdir=`pwd` | ||
| 349 | darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` | ||
| 350 | darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` | ||
| 351 | if test -n "$darwin_arches"; then | ||
| 352 | darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` | ||
| 353 | darwin_arch= | ||
| 354 | $show "$darwin_base_archive has multiple architectures $darwin_arches" | ||
| 355 | for darwin_arch in $darwin_arches ; do | ||
| 356 | mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" | ||
| 357 | lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" | ||
| 358 | cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" | ||
| 359 | func_extract_an_archive "`pwd`" "${darwin_base_archive}" | ||
| 360 | cd "$darwin_curdir" | ||
| 361 | $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" | ||
| 362 | done # $darwin_arches | ||
| 363 | ## Okay now we have a bunch of thin objects, gotta fatten them up :) | ||
| 364 | darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` | ||
| 365 | darwin_file= | ||
| 366 | darwin_files= | ||
| 367 | for darwin_file in $darwin_filelist; do | ||
| 368 | darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` | ||
| 369 | lipo -create -output "$darwin_file" $darwin_files | ||
| 370 | done # $darwin_filelist | ||
| 371 | ${rm}r unfat-$$ | ||
| 372 | cd "$darwin_orig_dir" | ||
| 373 | else | ||
| 374 | cd "$darwin_orig_dir" | ||
| 375 | func_extract_an_archive "$my_xdir" "$my_xabs" | ||
| 376 | fi # $darwin_arches | ||
| 377 | fi # $run | ||
| 378 | ;; | ||
| 379 | *) | ||
| 380 | func_extract_an_archive "$my_xdir" "$my_xabs" | ||
| 381 | ;; | ||
| 382 | esac | ||
| 383 | my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` | ||
| 384 | done | ||
| 385 | func_extract_archives_result="$my_oldobjs" | ||
| 386 | } | ||
| 387 | # End of Shell function definitions | ||
| 388 | ##################################### | ||
| 389 | |||
| 390 | # Darwin sucks | ||
| 391 | eval std_shrext=\"$shrext_cmds\" | ||
| 392 | |||
| 393 | disable_libs=no | ||
| 394 | |||
| 395 | # Parse our command line options once, thoroughly. | ||
| 396 | while test "$#" -gt 0 | ||
| 397 | do | ||
| 398 | arg="$1" | ||
| 399 | shift | ||
| 400 | |||
| 401 | case $arg in | ||
| 402 | -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; | ||
| 403 | *) optarg= ;; | ||
| 404 | esac | ||
| 405 | |||
| 406 | # If the previous option needs an argument, assign it. | ||
| 407 | if test -n "$prev"; then | ||
| 408 | case $prev in | ||
| 409 | execute_dlfiles) | ||
| 410 | execute_dlfiles="$execute_dlfiles $arg" | ||
| 411 | ;; | ||
| 412 | tag) | ||
| 413 | tagname="$arg" | ||
| 414 | preserve_args="${preserve_args}=$arg" | ||
| 415 | |||
| 416 | # Check whether tagname contains only valid characters | ||
| 417 | case $tagname in | ||
| 418 | *[!-_A-Za-z0-9,/]*) | ||
| 419 | $echo "$progname: invalid tag name: $tagname" 1>&2 | ||
| 420 | exit $EXIT_FAILURE | ||
| 421 | ;; | ||
| 422 | esac | ||
| 423 | |||
| 424 | case $tagname in | ||
| 425 | CC) | ||
| 426 | # Don't test for the "default" C tag, as we know, it's there, but | ||
| 427 | # not specially marked. | ||
| 428 | ;; | ||
| 429 | *) | ||
| 430 | if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then | ||
| 431 | taglist="$taglist $tagname" | ||
| 432 | # Evaluate the configuration. | ||
| 433 | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" | ||
| 434 | else | ||
| 435 | $echo "$progname: ignoring unknown tag $tagname" 1>&2 | ||
| 436 | fi | ||
| 437 | ;; | ||
| 438 | esac | ||
| 439 | ;; | ||
| 440 | *) | ||
| 441 | eval "$prev=\$arg" | ||
| 442 | ;; | ||
| 443 | esac | ||
| 444 | |||
| 445 | prev= | ||
| 446 | prevopt= | ||
| 447 | continue | ||
| 448 | fi | ||
| 449 | |||
| 450 | # Have we seen a non-optional argument yet? | ||
| 451 | case $arg in | ||
| 452 | --help) | ||
| 453 | show_help=yes | ||
| 454 | ;; | ||
| 455 | |||
| 456 | --version) | ||
| 457 | $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" | ||
| 458 | $echo | ||
| 459 | $echo "Copyright (C) 2005 Free Software Foundation, Inc." | ||
| 460 | $echo "This is free software; see the source for copying conditions. There is NO" | ||
| 461 | $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | ||
| 462 | exit $? | ||
| 463 | ;; | ||
| 464 | |||
| 465 | --config) | ||
| 466 | ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath | ||
| 467 | # Now print the configurations for the tags. | ||
| 468 | for tagname in $taglist; do | ||
| 469 | ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" | ||
| 470 | done | ||
| 471 | exit $? | ||
| 472 | ;; | ||
| 473 | |||
| 474 | --debug) | ||
| 475 | $echo "$progname: enabling shell trace mode" | ||
| 476 | set -x | ||
| 477 | preserve_args="$preserve_args $arg" | ||
| 478 | ;; | ||
| 479 | |||
| 480 | --dry-run | -n) | ||
| 481 | run=: | ||
| 482 | ;; | ||
| 483 | |||
| 484 | --features) | ||
| 485 | $echo "host: $host" | ||
| 486 | if test "$build_libtool_libs" = yes; then | ||
| 487 | $echo "enable shared libraries" | ||
| 488 | else | ||
| 489 | $echo "disable shared libraries" | ||
| 490 | fi | ||
| 491 | if test "$build_old_libs" = yes; then | ||
| 492 | $echo "enable static libraries" | ||
| 493 | else | ||
| 494 | $echo "disable static libraries" | ||
| 495 | fi | ||
| 496 | exit $? | ||
| 497 | ;; | ||
| 498 | |||
| 499 | --finish) mode="finish" ;; | ||
| 500 | |||
| 501 | --mode) prevopt="--mode" prev=mode ;; | ||
| 502 | --mode=*) mode="$optarg" ;; | ||
| 503 | |||
| 504 | --preserve-dup-deps) duplicate_deps="yes" ;; | ||
| 505 | |||
| 506 | --quiet | --silent) | ||
| 507 | show=: | ||
| 508 | preserve_args="$preserve_args $arg" | ||
| 509 | ;; | ||
| 510 | |||
| 511 | --tag) | ||
| 512 | prevopt="--tag" | ||
| 513 | prev=tag | ||
| 514 | preserve_args="$preserve_args --tag" | ||
| 515 | ;; | ||
| 516 | --tag=*) | ||
| 517 | set tag "$optarg" ${1+"$@"} | ||
| 518 | shift | ||
| 519 | prev=tag | ||
| 520 | preserve_args="$preserve_args --tag" | ||
| 521 | ;; | ||
| 522 | |||
| 523 | -dlopen) | ||
| 524 | prevopt="-dlopen" | ||
| 525 | prev=execute_dlfiles | ||
| 526 | ;; | ||
| 527 | |||
| 528 | -*) | ||
| 529 | $echo "$modename: unrecognized option \`$arg'" 1>&2 | ||
| 530 | $echo "$help" 1>&2 | ||
| 531 | exit $EXIT_FAILURE | ||
| 532 | ;; | ||
| 533 | |||
| 534 | *) | ||
| 535 | nonopt="$arg" | ||
| 536 | break | ||
| 537 | ;; | ||
| 538 | esac | ||
| 539 | done | ||
| 540 | |||
| 541 | if test -n "$prevopt"; then | ||
| 542 | $echo "$modename: option \`$prevopt' requires an argument" 1>&2 | ||
| 543 | $echo "$help" 1>&2 | ||
| 544 | exit $EXIT_FAILURE | ||
| 545 | fi | ||
| 546 | |||
| 547 | case $disable_libs in | ||
| 548 | no) | ||
| 549 | ;; | ||
| 550 | shared) | ||
| 551 | build_libtool_libs=no | ||
| 552 | build_old_libs=yes | ||
| 553 | ;; | ||
| 554 | static) | ||
| 555 | build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` | ||
| 556 | ;; | ||
| 557 | esac | ||
| 558 | |||
| 559 | # If this variable is set in any of the actions, the command in it | ||
| 560 | # will be execed at the end. This prevents here-documents from being | ||
| 561 | # left over by shells. | ||
| 562 | exec_cmd= | ||
| 563 | |||
| 564 | if test -z "$show_help"; then | ||
| 565 | |||
| 566 | # Infer the operation mode. | ||
| 567 | if test -z "$mode"; then | ||
| 568 | $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 | ||
| 569 | $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 | ||
| 570 | case $nonopt in | ||
| 571 | *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) | ||
| 572 | mode=link | ||
| 573 | for arg | ||
| 574 | do | ||
| 575 | case $arg in | ||
| 576 | -c) | ||
| 577 | mode=compile | ||
| 578 | break | ||
| 579 | ;; | ||
| 580 | esac | ||
| 581 | done | ||
| 582 | ;; | ||
| 583 | *db | *dbx | *strace | *truss) | ||
| 584 | mode=execute | ||
| 585 | ;; | ||
| 586 | *install*|cp|mv) | ||
| 587 | mode=install | ||
| 588 | ;; | ||
| 589 | *rm) | ||
| 590 | mode=uninstall | ||
| 591 | ;; | ||
| 592 | *) | ||
| 593 | # If we have no mode, but dlfiles were specified, then do execute mode. | ||
| 594 | test -n "$execute_dlfiles" && mode=execute | ||
| 595 | |||
| 596 | # Just use the default operation mode. | ||
| 597 | if test -z "$mode"; then | ||
| 598 | if test -n "$nonopt"; then | ||
| 599 | $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 | ||
| 600 | else | ||
| 601 | $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 | ||
| 602 | fi | ||
| 603 | fi | ||
| 604 | ;; | ||
| 605 | esac | ||
| 606 | fi | ||
| 607 | |||
| 608 | # Only execute mode is allowed to have -dlopen flags. | ||
| 609 | if test -n "$execute_dlfiles" && test "$mode" != execute; then | ||
| 610 | $echo "$modename: unrecognized option \`-dlopen'" 1>&2 | ||
| 611 | $echo "$help" 1>&2 | ||
| 612 | exit $EXIT_FAILURE | ||
| 613 | fi | ||
| 614 | |||
| 615 | # Change the help message to a mode-specific one. | ||
| 616 | generic_help="$help" | ||
| 617 | help="Try \`$modename --help --mode=$mode' for more information." | ||
| 618 | |||
| 619 | # These modes are in order of execution frequency so that they run quickly. | ||
| 620 | case $mode in | ||
| 621 | # libtool compile mode | ||
| 622 | compile) | ||
| 623 | modename="$modename: compile" | ||
| 624 | # Get the compilation command and the source file. | ||
| 625 | base_compile= | ||
| 626 | srcfile="$nonopt" # always keep a non-empty value in "srcfile" | ||
| 627 | suppress_opt=yes | ||
| 628 | suppress_output= | ||
| 629 | arg_mode=normal | ||
| 630 | libobj= | ||
| 631 | later= | ||
| 632 | |||
| 633 | for arg | ||
| 634 | do | ||
| 635 | case $arg_mode in | ||
| 636 | arg ) | ||
| 637 | # do not "continue". Instead, add this to base_compile | ||
| 638 | lastarg="$arg" | ||
| 639 | arg_mode=normal | ||
| 640 | ;; | ||
| 641 | |||
| 642 | target ) | ||
| 643 | libobj="$arg" | ||
| 644 | arg_mode=normal | ||
| 645 | continue | ||
| 646 | ;; | ||
| 647 | |||
| 648 | normal ) | ||
| 649 | # Accept any command-line options. | ||
| 650 | case $arg in | ||
| 651 | -o) | ||
| 652 | if test -n "$libobj" ; then | ||
| 653 | $echo "$modename: you cannot specify \`-o' more than once" 1>&2 | ||
| 654 | exit $EXIT_FAILURE | ||
| 655 | fi | ||
| 656 | arg_mode=target | ||
| 657 | continue | ||
| 658 | ;; | ||
| 659 | |||
| 660 | -static | -prefer-pic | -prefer-non-pic) | ||
| 661 | later="$later $arg" | ||
| 662 | continue | ||
| 663 | ;; | ||
| 664 | |||
| 665 | -no-suppress) | ||
| 666 | suppress_opt=no | ||
| 667 | continue | ||
| 668 | ;; | ||
| 669 | |||
| 670 | -Xcompiler) | ||
| 671 | arg_mode=arg # the next one goes into the "base_compile" arg list | ||
| 672 | continue # The current "srcfile" will either be retained or | ||
| 673 | ;; # replaced later. I would guess that would be a bug. | ||
| 674 | |||
| 675 | -Wc,*) | ||
| 676 | args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` | ||
| 677 | lastarg= | ||
| 678 | save_ifs="$IFS"; IFS=',' | ||
| 679 | for arg in $args; do | ||
| 680 | IFS="$save_ifs" | ||
| 681 | |||
| 682 | # Double-quote args containing other shell metacharacters. | ||
| 683 | # Many Bourne shells cannot handle close brackets correctly | ||
| 684 | # in scan sets, so we specify it separately. | ||
| 685 | case $arg in | ||
| 686 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 687 | arg="\"$arg\"" | ||
| 688 | ;; | ||
| 689 | esac | ||
| 690 | lastarg="$lastarg $arg" | ||
| 691 | done | ||
| 692 | IFS="$save_ifs" | ||
| 693 | lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` | ||
| 694 | |||
| 695 | # Add the arguments to base_compile. | ||
| 696 | base_compile="$base_compile $lastarg" | ||
| 697 | continue | ||
| 698 | ;; | ||
| 699 | |||
| 700 | * ) | ||
| 701 | # Accept the current argument as the source file. | ||
| 702 | # The previous "srcfile" becomes the current argument. | ||
| 703 | # | ||
| 704 | lastarg="$srcfile" | ||
| 705 | srcfile="$arg" | ||
| 706 | ;; | ||
| 707 | esac # case $arg | ||
| 708 | ;; | ||
| 709 | esac # case $arg_mode | ||
| 710 | |||
| 711 | # Aesthetically quote the previous argument. | ||
| 712 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` | ||
| 713 | |||
| 714 | case $lastarg in | ||
| 715 | # Double-quote args containing other shell metacharacters. | ||
| 716 | # Many Bourne shells cannot handle close brackets correctly | ||
| 717 | # in scan sets, and some SunOS ksh mistreat backslash-escaping | ||
| 718 | # in scan sets (worked around with variable expansion), | ||
| 719 | # and furthermore cannot handle '|' '&' '(' ')' in scan sets | ||
| 720 | # at all, so we specify them separately. | ||
| 721 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 722 | lastarg="\"$lastarg\"" | ||
| 723 | ;; | ||
| 724 | esac | ||
| 725 | |||
| 726 | base_compile="$base_compile $lastarg" | ||
| 727 | done # for arg | ||
| 728 | |||
| 729 | case $arg_mode in | ||
| 730 | arg) | ||
| 731 | $echo "$modename: you must specify an argument for -Xcompile" | ||
| 732 | exit $EXIT_FAILURE | ||
| 733 | ;; | ||
| 734 | target) | ||
| 735 | $echo "$modename: you must specify a target with \`-o'" 1>&2 | ||
| 736 | exit $EXIT_FAILURE | ||
| 737 | ;; | ||
| 738 | *) | ||
| 739 | # Get the name of the library object. | ||
| 740 | [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` | ||
| 741 | ;; | ||
| 742 | esac | ||
| 743 | |||
| 744 | # Recognize several different file suffixes. | ||
| 745 | # If the user specifies -o file.o, it is replaced with file.lo | ||
| 746 | xform='[cCFSifmso]' | ||
| 747 | case $libobj in | ||
| 748 | *.ada) xform=ada ;; | ||
| 749 | *.adb) xform=adb ;; | ||
| 750 | *.ads) xform=ads ;; | ||
| 751 | *.asm) xform=asm ;; | ||
| 752 | *.c++) xform=c++ ;; | ||
| 753 | *.cc) xform=cc ;; | ||
| 754 | *.ii) xform=ii ;; | ||
| 755 | *.class) xform=class ;; | ||
| 756 | *.cpp) xform=cpp ;; | ||
| 757 | *.cxx) xform=cxx ;; | ||
| 758 | *.f90) xform=f90 ;; | ||
| 759 | *.for) xform=for ;; | ||
| 760 | *.java) xform=java ;; | ||
| 761 | esac | ||
| 762 | |||
| 763 | libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` | ||
| 764 | |||
| 765 | case $libobj in | ||
| 766 | *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; | ||
| 767 | *) | ||
| 768 | $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 | ||
| 769 | exit $EXIT_FAILURE | ||
| 770 | ;; | ||
| 771 | esac | ||
| 772 | |||
| 773 | func_infer_tag $base_compile | ||
| 774 | |||
| 775 | for arg in $later; do | ||
| 776 | case $arg in | ||
| 777 | -static) | ||
| 778 | build_old_libs=yes | ||
| 779 | continue | ||
| 780 | ;; | ||
| 781 | |||
| 782 | -prefer-pic) | ||
| 783 | pic_mode=yes | ||
| 784 | continue | ||
| 785 | ;; | ||
| 786 | |||
| 787 | -prefer-non-pic) | ||
| 788 | pic_mode=no | ||
| 789 | continue | ||
| 790 | ;; | ||
| 791 | esac | ||
| 792 | done | ||
| 793 | |||
| 794 | qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` | ||
| 795 | case $qlibobj in | ||
| 796 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 797 | qlibobj="\"$qlibobj\"" ;; | ||
| 798 | esac | ||
| 799 | test "X$libobj" != "X$qlibobj" \ | ||
| 800 | && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ | ||
| 801 | && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." | ||
| 802 | objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` | ||
| 803 | xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` | ||
| 804 | if test "X$xdir" = "X$obj"; then | ||
| 805 | xdir= | ||
| 806 | else | ||
| 807 | xdir=$xdir/ | ||
| 808 | fi | ||
| 809 | lobj=${xdir}$objdir/$objname | ||
| 810 | |||
| 811 | if test -z "$base_compile"; then | ||
| 812 | $echo "$modename: you must specify a compilation command" 1>&2 | ||
| 813 | $echo "$help" 1>&2 | ||
| 814 | exit $EXIT_FAILURE | ||
| 815 | fi | ||
| 816 | |||
| 817 | # Delete any leftover library objects. | ||
| 818 | if test "$build_old_libs" = yes; then | ||
| 819 | removelist="$obj $lobj $libobj ${libobj}T" | ||
| 820 | else | ||
| 821 | removelist="$lobj $libobj ${libobj}T" | ||
| 822 | fi | ||
| 823 | |||
| 824 | $run $rm $removelist | ||
| 825 | trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 | ||
| 826 | |||
| 827 | # On Cygwin there's no "real" PIC flag so we must build both object types | ||
| 828 | case $host_os in | ||
| 829 | cygwin* | mingw* | pw32* | os2*) | ||
| 830 | pic_mode=default | ||
| 831 | ;; | ||
| 832 | esac | ||
| 833 | if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then | ||
| 834 | # non-PIC code in shared libraries is not supported | ||
| 835 | pic_mode=default | ||
| 836 | fi | ||
| 837 | |||
| 838 | # Calculate the filename of the output object if compiler does | ||
| 839 | # not support -o with -c | ||
| 840 | if test "$compiler_c_o" = no; then | ||
| 841 | output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} | ||
| 842 | lockfile="$output_obj.lock" | ||
| 843 | removelist="$removelist $output_obj $lockfile" | ||
| 844 | trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 | ||
| 845 | else | ||
| 846 | output_obj= | ||
| 847 | need_locks=no | ||
| 848 | lockfile= | ||
| 849 | fi | ||
| 850 | |||
| 851 | # Lock this critical section if it is needed | ||
| 852 | # We use this script file to make the link, it avoids creating a new file | ||
| 853 | if test "$need_locks" = yes; then | ||
| 854 | until $run ln "$progpath" "$lockfile" 2>/dev/null; do | ||
| 855 | $show "Waiting for $lockfile to be removed" | ||
| 856 | sleep 2 | ||
| 857 | done | ||
| 858 | elif test "$need_locks" = warn; then | ||
| 859 | if test -f "$lockfile"; then | ||
| 860 | $echo "\ | ||
| 861 | *** ERROR, $lockfile exists and contains: | ||
| 862 | `cat $lockfile 2>/dev/null` | ||
| 863 | |||
| 864 | This indicates that another process is trying to use the same | ||
| 865 | temporary object file, and libtool could not work around it because | ||
| 866 | your compiler does not support \`-c' and \`-o' together. If you | ||
| 867 | repeat this compilation, it may succeed, by chance, but you had better | ||
| 868 | avoid parallel builds (make -j) in this platform, or get a better | ||
| 869 | compiler." | ||
| 870 | |||
| 871 | $run $rm $removelist | ||
| 872 | exit $EXIT_FAILURE | ||
| 873 | fi | ||
| 874 | $echo "$srcfile" > "$lockfile" | ||
| 875 | fi | ||
| 876 | |||
| 877 | if test -n "$fix_srcfile_path"; then | ||
| 878 | eval srcfile=\"$fix_srcfile_path\" | ||
| 879 | fi | ||
| 880 | qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` | ||
| 881 | case $qsrcfile in | ||
| 882 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 883 | qsrcfile="\"$qsrcfile\"" ;; | ||
| 884 | esac | ||
| 885 | |||
| 886 | $run $rm "$libobj" "${libobj}T" | ||
| 887 | |||
| 888 | # Create a libtool object file (analogous to a ".la" file), | ||
| 889 | # but don't create it if we're doing a dry run. | ||
| 890 | test -z "$run" && cat > ${libobj}T <<EOF | ||
| 891 | # $libobj - a libtool object file | ||
| 892 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | ||
| 893 | # | ||
| 894 | # Please DO NOT delete this file! | ||
| 895 | # It is necessary for linking the library. | ||
| 896 | |||
| 897 | # Name of the PIC object. | ||
| 898 | EOF | ||
| 899 | |||
| 900 | # Only build a PIC object if we are building libtool libraries. | ||
| 901 | if test "$build_libtool_libs" = yes; then | ||
| 902 | # Without this assignment, base_compile gets emptied. | ||
| 903 | fbsd_hideous_sh_bug=$base_compile | ||
| 904 | |||
| 905 | if test "$pic_mode" != no; then | ||
| 906 | command="$base_compile $qsrcfile $pic_flag" | ||
| 907 | else | ||
| 908 | # Don't build PIC code | ||
| 909 | command="$base_compile $qsrcfile" | ||
| 910 | fi | ||
| 911 | |||
| 912 | if test ! -d "${xdir}$objdir"; then | ||
| 913 | $show "$mkdir ${xdir}$objdir" | ||
| 914 | $run $mkdir ${xdir}$objdir | ||
| 915 | exit_status=$? | ||
| 916 | if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then | ||
| 917 | exit $exit_status | ||
| 918 | fi | ||
| 919 | fi | ||
| 920 | |||
| 921 | if test -z "$output_obj"; then | ||
| 922 | # Place PIC objects in $objdir | ||
| 923 | command="$command -o $lobj" | ||
| 924 | fi | ||
| 925 | |||
| 926 | $run $rm "$lobj" "$output_obj" | ||
| 927 | |||
| 928 | $show "$command" | ||
| 929 | if $run eval "$command"; then : | ||
| 930 | else | ||
| 931 | test -n "$output_obj" && $run $rm $removelist | ||
| 932 | exit $EXIT_FAILURE | ||
| 933 | fi | ||
| 934 | |||
| 935 | if test "$need_locks" = warn && | ||
| 936 | test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then | ||
| 937 | $echo "\ | ||
| 938 | *** ERROR, $lockfile contains: | ||
| 939 | `cat $lockfile 2>/dev/null` | ||
| 940 | |||
| 941 | but it should contain: | ||
| 942 | $srcfile | ||
| 943 | |||
| 944 | This indicates that another process is trying to use the same | ||
| 945 | temporary object file, and libtool could not work around it because | ||
| 946 | your compiler does not support \`-c' and \`-o' together. If you | ||
| 947 | repeat this compilation, it may succeed, by chance, but you had better | ||
| 948 | avoid parallel builds (make -j) in this platform, or get a better | ||
| 949 | compiler." | ||
| 950 | |||
| 951 | $run $rm $removelist | ||
| 952 | exit $EXIT_FAILURE | ||
| 953 | fi | ||
| 954 | |||
| 955 | # Just move the object if needed, then go on to compile the next one | ||
| 956 | if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then | ||
| 957 | $show "$mv $output_obj $lobj" | ||
| 958 | if $run $mv $output_obj $lobj; then : | ||
| 959 | else | ||
| 960 | error=$? | ||
| 961 | $run $rm $removelist | ||
| 962 | exit $error | ||
| 963 | fi | ||
| 964 | fi | ||
| 965 | |||
| 966 | # Append the name of the PIC object to the libtool object file. | ||
| 967 | test -z "$run" && cat >> ${libobj}T <<EOF | ||
| 968 | pic_object='$objdir/$objname' | ||
| 969 | |||
| 970 | EOF | ||
| 971 | |||
| 972 | # Allow error messages only from the first compilation. | ||
| 973 | if test "$suppress_opt" = yes; then | ||
| 974 | suppress_output=' >/dev/null 2>&1' | ||
| 975 | fi | ||
| 976 | else | ||
| 977 | # No PIC object so indicate it doesn't exist in the libtool | ||
| 978 | # object file. | ||
| 979 | test -z "$run" && cat >> ${libobj}T <<EOF | ||
| 980 | pic_object=none | ||
| 981 | |||
| 982 | EOF | ||
| 983 | fi | ||
| 984 | |||
| 985 | # Only build a position-dependent object if we build old libraries. | ||
| 986 | if test "$build_old_libs" = yes; then | ||
| 987 | if test "$pic_mode" != yes; then | ||
| 988 | # Don't build PIC code | ||
| 989 | command="$base_compile $qsrcfile" | ||
| 990 | else | ||
| 991 | command="$base_compile $qsrcfile $pic_flag" | ||
| 992 | fi | ||
| 993 | if test "$compiler_c_o" = yes; then | ||
| 994 | command="$command -o $obj" | ||
| 995 | fi | ||
| 996 | |||
| 997 | # Suppress compiler output if we already did a PIC compilation. | ||
| 998 | command="$command$suppress_output" | ||
| 999 | $run $rm "$obj" "$output_obj" | ||
| 1000 | $show "$command" | ||
| 1001 | if $run eval "$command"; then : | ||
| 1002 | else | ||
| 1003 | $run $rm $removelist | ||
| 1004 | exit $EXIT_FAILURE | ||
| 1005 | fi | ||
| 1006 | |||
| 1007 | if test "$need_locks" = warn && | ||
| 1008 | test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then | ||
| 1009 | $echo "\ | ||
| 1010 | *** ERROR, $lockfile contains: | ||
| 1011 | `cat $lockfile 2>/dev/null` | ||
| 1012 | |||
| 1013 | but it should contain: | ||
| 1014 | $srcfile | ||
| 1015 | |||
| 1016 | This indicates that another process is trying to use the same | ||
| 1017 | temporary object file, and libtool could not work around it because | ||
| 1018 | your compiler does not support \`-c' and \`-o' together. If you | ||
| 1019 | repeat this compilation, it may succeed, by chance, but you had better | ||
| 1020 | avoid parallel builds (make -j) in this platform, or get a better | ||
| 1021 | compiler." | ||
| 1022 | |||
| 1023 | $run $rm $removelist | ||
| 1024 | exit $EXIT_FAILURE | ||
| 1025 | fi | ||
| 1026 | |||
| 1027 | # Just move the object if needed | ||
| 1028 | if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then | ||
| 1029 | $show "$mv $output_obj $obj" | ||
| 1030 | if $run $mv $output_obj $obj; then : | ||
| 1031 | else | ||
| 1032 | error=$? | ||
| 1033 | $run $rm $removelist | ||
| 1034 | exit $error | ||
| 1035 | fi | ||
| 1036 | fi | ||
| 1037 | |||
| 1038 | # Append the name of the non-PIC object the libtool object file. | ||
| 1039 | # Only append if the libtool object file exists. | ||
| 1040 | test -z "$run" && cat >> ${libobj}T <<EOF | ||
| 1041 | # Name of the non-PIC object. | ||
| 1042 | non_pic_object='$objname' | ||
| 1043 | |||
| 1044 | EOF | ||
| 1045 | else | ||
| 1046 | # Append the name of the non-PIC object the libtool object file. | ||
| 1047 | # Only append if the libtool object file exists. | ||
| 1048 | test -z "$run" && cat >> ${libobj}T <<EOF | ||
| 1049 | # Name of the non-PIC object. | ||
| 1050 | non_pic_object=none | ||
| 1051 | |||
| 1052 | EOF | ||
| 1053 | fi | ||
| 1054 | |||
| 1055 | $run $mv "${libobj}T" "${libobj}" | ||
| 1056 | |||
| 1057 | # Unlock the critical section if it was locked | ||
| 1058 | if test "$need_locks" != no; then | ||
| 1059 | $run $rm "$lockfile" | ||
| 1060 | fi | ||
| 1061 | |||
| 1062 | exit $EXIT_SUCCESS | ||
| 1063 | ;; | ||
| 1064 | |||
| 1065 | # libtool link mode | ||
| 1066 | link | relink) | ||
| 1067 | modename="$modename: link" | ||
| 1068 | case $host in | ||
| 1069 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
| 1070 | # It is impossible to link a dll without this setting, and | ||
| 1071 | # we shouldn't force the makefile maintainer to figure out | ||
| 1072 | # which system we are compiling for in order to pass an extra | ||
| 1073 | # flag for every libtool invocation. | ||
| 1074 | # allow_undefined=no | ||
| 1075 | |||
| 1076 | # FIXME: Unfortunately, there are problems with the above when trying | ||
| 1077 | # to make a dll which has undefined symbols, in which case not | ||
| 1078 | # even a static library is built. For now, we need to specify | ||
| 1079 | # -no-undefined on the libtool link line when we can be certain | ||
| 1080 | # that all symbols are satisfied, otherwise we get a static library. | ||
| 1081 | allow_undefined=yes | ||
| 1082 | ;; | ||
| 1083 | *) | ||
| 1084 | allow_undefined=yes | ||
| 1085 | ;; | ||
| 1086 | esac | ||
| 1087 | libtool_args="$nonopt" | ||
| 1088 | base_compile="$nonopt $@" | ||
| 1089 | compile_command="$nonopt" | ||
| 1090 | finalize_command="$nonopt" | ||
| 1091 | |||
| 1092 | compile_rpath= | ||
| 1093 | finalize_rpath= | ||
| 1094 | compile_shlibpath= | ||
| 1095 | finalize_shlibpath= | ||
| 1096 | convenience= | ||
| 1097 | old_convenience= | ||
| 1098 | deplibs= | ||
| 1099 | old_deplibs= | ||
| 1100 | compiler_flags= | ||
| 1101 | linker_flags= | ||
| 1102 | dllsearchpath= | ||
| 1103 | lib_search_path=`pwd` | ||
| 1104 | inst_prefix_dir= | ||
| 1105 | |||
| 1106 | avoid_version=no | ||
| 1107 | dlfiles= | ||
| 1108 | dlprefiles= | ||
| 1109 | dlself=no | ||
| 1110 | export_dynamic=no | ||
| 1111 | export_symbols= | ||
| 1112 | export_symbols_regex= | ||
| 1113 | generated= | ||
| 1114 | libobjs= | ||
| 1115 | ltlibs= | ||
| 1116 | module=no | ||
| 1117 | no_install=no | ||
| 1118 | objs= | ||
| 1119 | non_pic_objects= | ||
| 1120 | notinst_path= # paths that contain not-installed libtool libraries | ||
| 1121 | precious_files_regex= | ||
| 1122 | prefer_static_libs=no | ||
| 1123 | preload=no | ||
| 1124 | prev= | ||
| 1125 | prevarg= | ||
| 1126 | release= | ||
| 1127 | rpath= | ||
| 1128 | xrpath= | ||
| 1129 | perm_rpath= | ||
| 1130 | temp_rpath= | ||
| 1131 | thread_safe=no | ||
| 1132 | vinfo= | ||
| 1133 | vinfo_number=no | ||
| 1134 | |||
| 1135 | func_infer_tag $base_compile | ||
| 1136 | |||
| 1137 | # We need to know -static, to get the right output filenames. | ||
| 1138 | for arg | ||
| 1139 | do | ||
| 1140 | case $arg in | ||
| 1141 | -all-static | -static) | ||
| 1142 | if test "X$arg" = "X-all-static"; then | ||
| 1143 | if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then | ||
| 1144 | $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 | ||
| 1145 | fi | ||
| 1146 | if test -n "$link_static_flag"; then | ||
| 1147 | dlopen_self=$dlopen_self_static | ||
| 1148 | fi | ||
| 1149 | prefer_static_libs=yes | ||
| 1150 | else | ||
| 1151 | if test -z "$pic_flag" && test -n "$link_static_flag"; then | ||
| 1152 | dlopen_self=$dlopen_self_static | ||
| 1153 | fi | ||
| 1154 | prefer_static_libs=built | ||
| 1155 | fi | ||
| 1156 | build_libtool_libs=no | ||
| 1157 | build_old_libs=yes | ||
| 1158 | break | ||
| 1159 | ;; | ||
| 1160 | esac | ||
| 1161 | done | ||
| 1162 | |||
| 1163 | # See if our shared archives depend on static archives. | ||
| 1164 | test -n "$old_archive_from_new_cmds" && build_old_libs=yes | ||
| 1165 | |||
| 1166 | # Go through the arguments, transforming them on the way. | ||
| 1167 | while test "$#" -gt 0; do | ||
| 1168 | arg="$1" | ||
| 1169 | shift | ||
| 1170 | case $arg in | ||
| 1171 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 1172 | qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test | ||
| 1173 | ;; | ||
| 1174 | *) qarg=$arg ;; | ||
| 1175 | esac | ||
| 1176 | libtool_args="$libtool_args $qarg" | ||
| 1177 | |||
| 1178 | # If the previous option needs an argument, assign it. | ||
| 1179 | if test -n "$prev"; then | ||
| 1180 | case $prev in | ||
| 1181 | output) | ||
| 1182 | compile_command="$compile_command @OUTPUT@" | ||
| 1183 | finalize_command="$finalize_command @OUTPUT@" | ||
| 1184 | ;; | ||
| 1185 | esac | ||
| 1186 | |||
| 1187 | case $prev in | ||
| 1188 | dlfiles|dlprefiles) | ||
| 1189 | if test "$preload" = no; then | ||
| 1190 | # Add the symbol object into the linking commands. | ||
| 1191 | compile_command="$compile_command @SYMFILE@" | ||
| 1192 | finalize_command="$finalize_command @SYMFILE@" | ||
| 1193 | preload=yes | ||
| 1194 | fi | ||
| 1195 | case $arg in | ||
| 1196 | *.la | *.lo) ;; # We handle these cases below. | ||
| 1197 | force) | ||
| 1198 | if test "$dlself" = no; then | ||
| 1199 | dlself=needless | ||
| 1200 | export_dynamic=yes | ||
| 1201 | fi | ||
| 1202 | prev= | ||
| 1203 | continue | ||
| 1204 | ;; | ||
| 1205 | self) | ||
| 1206 | if test "$prev" = dlprefiles; then | ||
| 1207 | dlself=yes | ||
| 1208 | elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then | ||
| 1209 | dlself=yes | ||
| 1210 | else | ||
| 1211 | dlself=needless | ||
| 1212 | export_dynamic=yes | ||
| 1213 | fi | ||
| 1214 | prev= | ||
| 1215 | continue | ||
| 1216 | ;; | ||
| 1217 | *) | ||
| 1218 | if test "$prev" = dlfiles; then | ||
| 1219 | dlfiles="$dlfiles $arg" | ||
| 1220 | else | ||
| 1221 | dlprefiles="$dlprefiles $arg" | ||
| 1222 | fi | ||
| 1223 | prev= | ||
| 1224 | continue | ||
| 1225 | ;; | ||
| 1226 | esac | ||
| 1227 | ;; | ||
| 1228 | expsyms) | ||
| 1229 | export_symbols="$arg" | ||
| 1230 | if test ! -f "$arg"; then | ||
| 1231 | $echo "$modename: symbol file \`$arg' does not exist" | ||
| 1232 | exit $EXIT_FAILURE | ||
| 1233 | fi | ||
| 1234 | prev= | ||
| 1235 | continue | ||
| 1236 | ;; | ||
| 1237 | expsyms_regex) | ||
| 1238 | export_symbols_regex="$arg" | ||
| 1239 | prev= | ||
| 1240 | continue | ||
| 1241 | ;; | ||
| 1242 | inst_prefix) | ||
| 1243 | inst_prefix_dir="$arg" | ||
| 1244 | prev= | ||
| 1245 | continue | ||
| 1246 | ;; | ||
| 1247 | precious_regex) | ||
| 1248 | precious_files_regex="$arg" | ||
| 1249 | prev= | ||
| 1250 | continue | ||
| 1251 | ;; | ||
| 1252 | release) | ||
| 1253 | release="-$arg" | ||
| 1254 | prev= | ||
| 1255 | continue | ||
| 1256 | ;; | ||
| 1257 | objectlist) | ||
| 1258 | if test -f "$arg"; then | ||
| 1259 | save_arg=$arg | ||
| 1260 | moreargs= | ||
| 1261 | for fil in `cat $save_arg` | ||
| 1262 | do | ||
| 1263 | # moreargs="$moreargs $fil" | ||
| 1264 | arg=$fil | ||
| 1265 | # A libtool-controlled object. | ||
| 1266 | |||
| 1267 | # Check to see that this really is a libtool object. | ||
| 1268 | if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 1269 | pic_object= | ||
| 1270 | non_pic_object= | ||
| 1271 | |||
| 1272 | # Read the .lo file | ||
| 1273 | # If there is no directory component, then add one. | ||
| 1274 | case $arg in | ||
| 1275 | */* | *\\*) . $arg ;; | ||
| 1276 | *) . ./$arg ;; | ||
| 1277 | esac | ||
| 1278 | |||
| 1279 | if test -z "$pic_object" || \ | ||
| 1280 | test -z "$non_pic_object" || | ||
| 1281 | test "$pic_object" = none && \ | ||
| 1282 | test "$non_pic_object" = none; then | ||
| 1283 | $echo "$modename: cannot find name of object for \`$arg'" 1>&2 | ||
| 1284 | exit $EXIT_FAILURE | ||
| 1285 | fi | ||
| 1286 | |||
| 1287 | # Extract subdirectory from the argument. | ||
| 1288 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` | ||
| 1289 | if test "X$xdir" = "X$arg"; then | ||
| 1290 | xdir= | ||
| 1291 | else | ||
| 1292 | xdir="$xdir/" | ||
| 1293 | fi | ||
| 1294 | |||
| 1295 | if test "$pic_object" != none; then | ||
| 1296 | # Prepend the subdirectory the object is found in. | ||
| 1297 | pic_object="$xdir$pic_object" | ||
| 1298 | |||
| 1299 | if test "$prev" = dlfiles; then | ||
| 1300 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then | ||
| 1301 | dlfiles="$dlfiles $pic_object" | ||
| 1302 | prev= | ||
| 1303 | continue | ||
| 1304 | else | ||
| 1305 | # If libtool objects are unsupported, then we need to preload. | ||
| 1306 | prev=dlprefiles | ||
| 1307 | fi | ||
| 1308 | fi | ||
| 1309 | |||
| 1310 | # CHECK ME: I think I busted this. -Ossama | ||
| 1311 | if test "$prev" = dlprefiles; then | ||
| 1312 | # Preload the old-style object. | ||
| 1313 | dlprefiles="$dlprefiles $pic_object" | ||
| 1314 | prev= | ||
| 1315 | fi | ||
| 1316 | |||
| 1317 | # A PIC object. | ||
| 1318 | libobjs="$libobjs $pic_object" | ||
| 1319 | arg="$pic_object" | ||
| 1320 | fi | ||
| 1321 | |||
| 1322 | # Non-PIC object. | ||
| 1323 | if test "$non_pic_object" != none; then | ||
| 1324 | # Prepend the subdirectory the object is found in. | ||
| 1325 | non_pic_object="$xdir$non_pic_object" | ||
| 1326 | |||
| 1327 | # A standard non-PIC object | ||
| 1328 | non_pic_objects="$non_pic_objects $non_pic_object" | ||
| 1329 | if test -z "$pic_object" || test "$pic_object" = none ; then | ||
| 1330 | arg="$non_pic_object" | ||
| 1331 | fi | ||
| 1332 | else | ||
| 1333 | # If the PIC object exists, use it instead. | ||
| 1334 | # $xdir was prepended to $pic_object above. | ||
| 1335 | non_pic_object="$pic_object" | ||
| 1336 | non_pic_objects="$non_pic_objects $non_pic_object" | ||
| 1337 | fi | ||
| 1338 | else | ||
| 1339 | # Only an error if not doing a dry-run. | ||
| 1340 | if test -z "$run"; then | ||
| 1341 | $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 | ||
| 1342 | exit $EXIT_FAILURE | ||
| 1343 | else | ||
| 1344 | # Dry-run case. | ||
| 1345 | |||
| 1346 | # Extract subdirectory from the argument. | ||
| 1347 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` | ||
| 1348 | if test "X$xdir" = "X$arg"; then | ||
| 1349 | xdir= | ||
| 1350 | else | ||
| 1351 | xdir="$xdir/" | ||
| 1352 | fi | ||
| 1353 | |||
| 1354 | pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` | ||
| 1355 | non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` | ||
| 1356 | libobjs="$libobjs $pic_object" | ||
| 1357 | non_pic_objects="$non_pic_objects $non_pic_object" | ||
| 1358 | fi | ||
| 1359 | fi | ||
| 1360 | done | ||
| 1361 | else | ||
| 1362 | $echo "$modename: link input file \`$save_arg' does not exist" | ||
| 1363 | exit $EXIT_FAILURE | ||
| 1364 | fi | ||
| 1365 | arg=$save_arg | ||
| 1366 | prev= | ||
| 1367 | continue | ||
| 1368 | ;; | ||
| 1369 | rpath | xrpath) | ||
| 1370 | # We need an absolute path. | ||
| 1371 | case $arg in | ||
| 1372 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
| 1373 | *) | ||
| 1374 | $echo "$modename: only absolute run-paths are allowed" 1>&2 | ||
| 1375 | exit $EXIT_FAILURE | ||
| 1376 | ;; | ||
| 1377 | esac | ||
| 1378 | if test "$prev" = rpath; then | ||
| 1379 | case "$rpath " in | ||
| 1380 | *" $arg "*) ;; | ||
| 1381 | *) rpath="$rpath $arg" ;; | ||
| 1382 | esac | ||
| 1383 | else | ||
| 1384 | case "$xrpath " in | ||
| 1385 | *" $arg "*) ;; | ||
| 1386 | *) xrpath="$xrpath $arg" ;; | ||
| 1387 | esac | ||
| 1388 | fi | ||
| 1389 | prev= | ||
| 1390 | continue | ||
| 1391 | ;; | ||
| 1392 | xcompiler) | ||
| 1393 | compiler_flags="$compiler_flags $qarg" | ||
| 1394 | prev= | ||
| 1395 | compile_command="$compile_command $qarg" | ||
| 1396 | finalize_command="$finalize_command $qarg" | ||
| 1397 | continue | ||
| 1398 | ;; | ||
| 1399 | xlinker) | ||
| 1400 | linker_flags="$linker_flags $qarg" | ||
| 1401 | compiler_flags="$compiler_flags $wl$qarg" | ||
| 1402 | prev= | ||
| 1403 | compile_command="$compile_command $wl$qarg" | ||
| 1404 | finalize_command="$finalize_command $wl$qarg" | ||
| 1405 | continue | ||
| 1406 | ;; | ||
| 1407 | xcclinker) | ||
| 1408 | linker_flags="$linker_flags $qarg" | ||
| 1409 | compiler_flags="$compiler_flags $qarg" | ||
| 1410 | prev= | ||
| 1411 | compile_command="$compile_command $qarg" | ||
| 1412 | finalize_command="$finalize_command $qarg" | ||
| 1413 | continue | ||
| 1414 | ;; | ||
| 1415 | shrext) | ||
| 1416 | shrext_cmds="$arg" | ||
| 1417 | prev= | ||
| 1418 | continue | ||
| 1419 | ;; | ||
| 1420 | darwin_framework|darwin_framework_skip) | ||
| 1421 | test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" | ||
| 1422 | compile_command="$compile_command $arg" | ||
| 1423 | finalize_command="$finalize_command $arg" | ||
| 1424 | prev= | ||
| 1425 | continue | ||
| 1426 | ;; | ||
| 1427 | *) | ||
| 1428 | eval "$prev=\"\$arg\"" | ||
| 1429 | prev= | ||
| 1430 | continue | ||
| 1431 | ;; | ||
| 1432 | esac | ||
| 1433 | fi # test -n "$prev" | ||
| 1434 | |||
| 1435 | prevarg="$arg" | ||
| 1436 | |||
| 1437 | case $arg in | ||
| 1438 | -all-static) | ||
| 1439 | if test -n "$link_static_flag"; then | ||
| 1440 | compile_command="$compile_command $link_static_flag" | ||
| 1441 | finalize_command="$finalize_command $link_static_flag" | ||
| 1442 | fi | ||
| 1443 | continue | ||
| 1444 | ;; | ||
| 1445 | |||
| 1446 | -allow-undefined) | ||
| 1447 | # FIXME: remove this flag sometime in the future. | ||
| 1448 | $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 | ||
| 1449 | continue | ||
| 1450 | ;; | ||
| 1451 | |||
| 1452 | -avoid-version) | ||
| 1453 | avoid_version=yes | ||
| 1454 | continue | ||
| 1455 | ;; | ||
| 1456 | |||
| 1457 | -dlopen) | ||
| 1458 | prev=dlfiles | ||
| 1459 | continue | ||
| 1460 | ;; | ||
| 1461 | |||
| 1462 | -dlpreopen) | ||
| 1463 | prev=dlprefiles | ||
| 1464 | continue | ||
| 1465 | ;; | ||
| 1466 | |||
| 1467 | -export-dynamic) | ||
| 1468 | export_dynamic=yes | ||
| 1469 | continue | ||
| 1470 | ;; | ||
| 1471 | |||
| 1472 | -export-symbols | -export-symbols-regex) | ||
| 1473 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then | ||
| 1474 | $echo "$modename: more than one -exported-symbols argument is not allowed" | ||
| 1475 | exit $EXIT_FAILURE | ||
| 1476 | fi | ||
| 1477 | if test "X$arg" = "X-export-symbols"; then | ||
| 1478 | prev=expsyms | ||
| 1479 | else | ||
| 1480 | prev=expsyms_regex | ||
| 1481 | fi | ||
| 1482 | continue | ||
| 1483 | ;; | ||
| 1484 | |||
| 1485 | -framework|-arch|-isysroot) | ||
| 1486 | case " $CC " in | ||
| 1487 | *" ${arg} ${1} "* | *" ${arg} ${1} "*) | ||
| 1488 | prev=darwin_framework_skip ;; | ||
| 1489 | *) compiler_flags="$compiler_flags $arg" | ||
| 1490 | prev=darwin_framework ;; | ||
| 1491 | esac | ||
| 1492 | compile_command="$compile_command $arg" | ||
| 1493 | finalize_command="$finalize_command $arg" | ||
| 1494 | continue | ||
| 1495 | ;; | ||
| 1496 | |||
| 1497 | -inst-prefix-dir) | ||
| 1498 | prev=inst_prefix | ||
| 1499 | continue | ||
| 1500 | ;; | ||
| 1501 | |||
| 1502 | # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* | ||
| 1503 | # so, if we see these flags be careful not to treat them like -L | ||
| 1504 | -L[A-Z][A-Z]*:*) | ||
| 1505 | case $with_gcc/$host in | ||
| 1506 | no/*-*-irix* | /*-*-irix*) | ||
| 1507 | compile_command="$compile_command $arg" | ||
| 1508 | finalize_command="$finalize_command $arg" | ||
| 1509 | ;; | ||
| 1510 | esac | ||
| 1511 | continue | ||
| 1512 | ;; | ||
| 1513 | |||
| 1514 | -L*) | ||
| 1515 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` | ||
| 1516 | # We need an absolute path. | ||
| 1517 | case $dir in | ||
| 1518 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
| 1519 | *) | ||
| 1520 | absdir=`cd "$dir" && pwd` | ||
| 1521 | if test -z "$absdir"; then | ||
| 1522 | $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 | ||
| 1523 | absdir="$dir" | ||
| 1524 | notinst_path="$notinst_path $dir" | ||
| 1525 | fi | ||
| 1526 | dir="$absdir" | ||
| 1527 | ;; | ||
| 1528 | esac | ||
| 1529 | case "$deplibs " in | ||
| 1530 | *" -L$dir "*) ;; | ||
| 1531 | *) | ||
| 1532 | deplibs="$deplibs -L$dir" | ||
| 1533 | lib_search_path="$lib_search_path $dir" | ||
| 1534 | ;; | ||
| 1535 | esac | ||
| 1536 | case $host in | ||
| 1537 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
| 1538 | testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` | ||
| 1539 | case :$dllsearchpath: in | ||
| 1540 | *":$dir:"*) ;; | ||
| 1541 | *) dllsearchpath="$dllsearchpath:$dir";; | ||
| 1542 | esac | ||
| 1543 | case :$dllsearchpath: in | ||
| 1544 | *":$testbindir:"*) ;; | ||
| 1545 | *) dllsearchpath="$dllsearchpath:$testbindir";; | ||
| 1546 | esac | ||
| 1547 | ;; | ||
| 1548 | esac | ||
| 1549 | continue | ||
| 1550 | ;; | ||
| 1551 | |||
| 1552 | -l*) | ||
| 1553 | if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then | ||
| 1554 | case $host in | ||
| 1555 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) | ||
| 1556 | # These systems don't actually have a C or math library (as such) | ||
| 1557 | continue | ||
| 1558 | ;; | ||
| 1559 | *-*-os2*) | ||
| 1560 | # These systems don't actually have a C library (as such) | ||
| 1561 | test "X$arg" = "X-lc" && continue | ||
| 1562 | ;; | ||
| 1563 | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) | ||
| 1564 | # Do not include libc due to us having libc/libc_r. | ||
| 1565 | test "X$arg" = "X-lc" && continue | ||
| 1566 | ;; | ||
| 1567 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
| 1568 | # Rhapsody C and math libraries are in the System framework | ||
| 1569 | deplibs="$deplibs -framework System" | ||
| 1570 | continue | ||
| 1571 | ;; | ||
| 1572 | *-*-sco3.2v5* | *-*-sco5v6*) | ||
| 1573 | # Causes problems with __ctype | ||
| 1574 | test "X$arg" = "X-lc" && continue | ||
| 1575 | ;; | ||
| 1576 | *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) | ||
| 1577 | # Compiler inserts libc in the correct place for threads to work | ||
| 1578 | test "X$arg" = "X-lc" && continue | ||
| 1579 | ;; | ||
| 1580 | esac | ||
| 1581 | elif test "X$arg" = "X-lc_r"; then | ||
| 1582 | case $host in | ||
| 1583 | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) | ||
| 1584 | # Do not include libc_r directly, use -pthread flag. | ||
| 1585 | continue | ||
| 1586 | ;; | ||
| 1587 | esac | ||
| 1588 | fi | ||
| 1589 | deplibs="$deplibs $arg" | ||
| 1590 | continue | ||
| 1591 | ;; | ||
| 1592 | |||
| 1593 | # Tru64 UNIX uses -model [arg] to determine the layout of C++ | ||
| 1594 | # classes, name mangling, and exception handling. | ||
| 1595 | -model) | ||
| 1596 | compile_command="$compile_command $arg" | ||
| 1597 | compiler_flags="$compiler_flags $arg" | ||
| 1598 | finalize_command="$finalize_command $arg" | ||
| 1599 | prev=xcompiler | ||
| 1600 | continue | ||
| 1601 | ;; | ||
| 1602 | |||
| 1603 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) | ||
| 1604 | compiler_flags="$compiler_flags $arg" | ||
| 1605 | compile_command="$compile_command $arg" | ||
| 1606 | finalize_command="$finalize_command $arg" | ||
| 1607 | continue | ||
| 1608 | ;; | ||
| 1609 | |||
| 1610 | -module) | ||
| 1611 | module=yes | ||
| 1612 | continue | ||
| 1613 | ;; | ||
| 1614 | |||
| 1615 | # -64, -mips[0-9] enable 64-bit mode on the SGI compiler | ||
| 1616 | # -r[0-9][0-9]* specifies the processor on the SGI compiler | ||
| 1617 | # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler | ||
| 1618 | # +DA*, +DD* enable 64-bit mode on the HP compiler | ||
| 1619 | # -q* pass through compiler args for the IBM compiler | ||
| 1620 | # -m* pass through architecture-specific compiler args for GCC | ||
| 1621 | # -m*, -t[45]*, -txscale* pass through architecture-specific | ||
| 1622 | # compiler args for GCC | ||
| 1623 | # -pg pass through profiling flag for GCC | ||
| 1624 | # @file GCC response files | ||
| 1625 | -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ | ||
| 1626 | -t[45]*|-txscale*|@*) | ||
| 1627 | |||
| 1628 | # Unknown arguments in both finalize_command and compile_command need | ||
| 1629 | # to be aesthetically quoted because they are evaled later. | ||
| 1630 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
| 1631 | case $arg in | ||
| 1632 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 1633 | arg="\"$arg\"" | ||
| 1634 | ;; | ||
| 1635 | esac | ||
| 1636 | compile_command="$compile_command $arg" | ||
| 1637 | finalize_command="$finalize_command $arg" | ||
| 1638 | compiler_flags="$compiler_flags $arg" | ||
| 1639 | continue | ||
| 1640 | ;; | ||
| 1641 | |||
| 1642 | -shrext) | ||
| 1643 | prev=shrext | ||
| 1644 | continue | ||
| 1645 | ;; | ||
| 1646 | |||
| 1647 | -no-fast-install) | ||
| 1648 | fast_install=no | ||
| 1649 | continue | ||
| 1650 | ;; | ||
| 1651 | |||
| 1652 | -no-install) | ||
| 1653 | case $host in | ||
| 1654 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
| 1655 | # The PATH hackery in wrapper scripts is required on Windows | ||
| 1656 | # in order for the loader to find any dlls it needs. | ||
| 1657 | $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 | ||
| 1658 | $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 | ||
| 1659 | fast_install=no | ||
| 1660 | ;; | ||
| 1661 | *) no_install=yes ;; | ||
| 1662 | esac | ||
| 1663 | continue | ||
| 1664 | ;; | ||
| 1665 | |||
| 1666 | -no-undefined) | ||
| 1667 | allow_undefined=no | ||
| 1668 | continue | ||
| 1669 | ;; | ||
| 1670 | |||
| 1671 | -objectlist) | ||
| 1672 | prev=objectlist | ||
| 1673 | continue | ||
| 1674 | ;; | ||
| 1675 | |||
| 1676 | -o) prev=output ;; | ||
| 1677 | |||
| 1678 | -precious-files-regex) | ||
| 1679 | prev=precious_regex | ||
| 1680 | continue | ||
| 1681 | ;; | ||
| 1682 | |||
| 1683 | -release) | ||
| 1684 | prev=release | ||
| 1685 | continue | ||
| 1686 | ;; | ||
| 1687 | |||
| 1688 | -rpath) | ||
| 1689 | prev=rpath | ||
| 1690 | continue | ||
| 1691 | ;; | ||
| 1692 | |||
| 1693 | -R) | ||
| 1694 | prev=xrpath | ||
| 1695 | continue | ||
| 1696 | ;; | ||
| 1697 | |||
| 1698 | -R*) | ||
| 1699 | dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` | ||
| 1700 | # We need an absolute path. | ||
| 1701 | case $dir in | ||
| 1702 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
| 1703 | *) | ||
| 1704 | $echo "$modename: only absolute run-paths are allowed" 1>&2 | ||
| 1705 | exit $EXIT_FAILURE | ||
| 1706 | ;; | ||
| 1707 | esac | ||
| 1708 | case "$xrpath " in | ||
| 1709 | *" $dir "*) ;; | ||
| 1710 | *) xrpath="$xrpath $dir" ;; | ||
| 1711 | esac | ||
| 1712 | continue | ||
| 1713 | ;; | ||
| 1714 | |||
| 1715 | -static) | ||
| 1716 | # The effects of -static are defined in a previous loop. | ||
| 1717 | # We used to do the same as -all-static on platforms that | ||
| 1718 | # didn't have a PIC flag, but the assumption that the effects | ||
| 1719 | # would be equivalent was wrong. It would break on at least | ||
| 1720 | # Digital Unix and AIX. | ||
| 1721 | continue | ||
| 1722 | ;; | ||
| 1723 | |||
| 1724 | -thread-safe) | ||
| 1725 | thread_safe=yes | ||
| 1726 | continue | ||
| 1727 | ;; | ||
| 1728 | |||
| 1729 | -version-info) | ||
| 1730 | prev=vinfo | ||
| 1731 | continue | ||
| 1732 | ;; | ||
| 1733 | -version-number) | ||
| 1734 | prev=vinfo | ||
| 1735 | vinfo_number=yes | ||
| 1736 | continue | ||
| 1737 | ;; | ||
| 1738 | |||
| 1739 | -Wc,*) | ||
| 1740 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` | ||
| 1741 | arg= | ||
| 1742 | save_ifs="$IFS"; IFS=',' | ||
| 1743 | for flag in $args; do | ||
| 1744 | IFS="$save_ifs" | ||
| 1745 | case $flag in | ||
| 1746 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 1747 | flag="\"$flag\"" | ||
| 1748 | ;; | ||
| 1749 | esac | ||
| 1750 | arg="$arg $wl$flag" | ||
| 1751 | compiler_flags="$compiler_flags $flag" | ||
| 1752 | done | ||
| 1753 | IFS="$save_ifs" | ||
| 1754 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` | ||
| 1755 | ;; | ||
| 1756 | |||
| 1757 | -Wl,*) | ||
| 1758 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` | ||
| 1759 | arg= | ||
| 1760 | save_ifs="$IFS"; IFS=',' | ||
| 1761 | for flag in $args; do | ||
| 1762 | IFS="$save_ifs" | ||
| 1763 | case $flag in | ||
| 1764 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 1765 | flag="\"$flag\"" | ||
| 1766 | ;; | ||
| 1767 | esac | ||
| 1768 | arg="$arg $wl$flag" | ||
| 1769 | compiler_flags="$compiler_flags $wl$flag" | ||
| 1770 | linker_flags="$linker_flags $flag" | ||
| 1771 | done | ||
| 1772 | IFS="$save_ifs" | ||
| 1773 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` | ||
| 1774 | ;; | ||
| 1775 | |||
| 1776 | -Xcompiler) | ||
| 1777 | prev=xcompiler | ||
| 1778 | continue | ||
| 1779 | ;; | ||
| 1780 | |||
| 1781 | -Xlinker) | ||
| 1782 | prev=xlinker | ||
| 1783 | continue | ||
| 1784 | ;; | ||
| 1785 | |||
| 1786 | -XCClinker) | ||
| 1787 | prev=xcclinker | ||
| 1788 | continue | ||
| 1789 | ;; | ||
| 1790 | |||
| 1791 | # Some other compiler flag. | ||
| 1792 | -* | +*) | ||
| 1793 | # Unknown arguments in both finalize_command and compile_command need | ||
| 1794 | # to be aesthetically quoted because they are evaled later. | ||
| 1795 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
| 1796 | case $arg in | ||
| 1797 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 1798 | arg="\"$arg\"" | ||
| 1799 | ;; | ||
| 1800 | esac | ||
| 1801 | ;; | ||
| 1802 | |||
| 1803 | *.$objext) | ||
| 1804 | # A standard object. | ||
| 1805 | objs="$objs $arg" | ||
| 1806 | ;; | ||
| 1807 | |||
| 1808 | *.lo) | ||
| 1809 | # A libtool-controlled object. | ||
| 1810 | |||
| 1811 | # Check to see that this really is a libtool object. | ||
| 1812 | if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 1813 | pic_object= | ||
| 1814 | non_pic_object= | ||
| 1815 | |||
| 1816 | # Read the .lo file | ||
| 1817 | # If there is no directory component, then add one. | ||
| 1818 | case $arg in | ||
| 1819 | */* | *\\*) . $arg ;; | ||
| 1820 | *) . ./$arg ;; | ||
| 1821 | esac | ||
| 1822 | |||
| 1823 | if test -z "$pic_object" || \ | ||
| 1824 | test -z "$non_pic_object" || | ||
| 1825 | test "$pic_object" = none && \ | ||
| 1826 | test "$non_pic_object" = none; then | ||
| 1827 | $echo "$modename: cannot find name of object for \`$arg'" 1>&2 | ||
| 1828 | exit $EXIT_FAILURE | ||
| 1829 | fi | ||
| 1830 | |||
| 1831 | # Extract subdirectory from the argument. | ||
| 1832 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` | ||
| 1833 | if test "X$xdir" = "X$arg"; then | ||
| 1834 | xdir= | ||
| 1835 | else | ||
| 1836 | xdir="$xdir/" | ||
| 1837 | fi | ||
| 1838 | |||
| 1839 | if test "$pic_object" != none; then | ||
| 1840 | # Prepend the subdirectory the object is found in. | ||
| 1841 | pic_object="$xdir$pic_object" | ||
| 1842 | |||
| 1843 | if test "$prev" = dlfiles; then | ||
| 1844 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then | ||
| 1845 | dlfiles="$dlfiles $pic_object" | ||
| 1846 | prev= | ||
| 1847 | continue | ||
| 1848 | else | ||
| 1849 | # If libtool objects are unsupported, then we need to preload. | ||
| 1850 | prev=dlprefiles | ||
| 1851 | fi | ||
| 1852 | fi | ||
| 1853 | |||
| 1854 | # CHECK ME: I think I busted this. -Ossama | ||
| 1855 | if test "$prev" = dlprefiles; then | ||
| 1856 | # Preload the old-style object. | ||
| 1857 | dlprefiles="$dlprefiles $pic_object" | ||
| 1858 | prev= | ||
| 1859 | fi | ||
| 1860 | |||
| 1861 | # A PIC object. | ||
| 1862 | libobjs="$libobjs $pic_object" | ||
| 1863 | arg="$pic_object" | ||
| 1864 | fi | ||
| 1865 | |||
| 1866 | # Non-PIC object. | ||
| 1867 | if test "$non_pic_object" != none; then | ||
| 1868 | # Prepend the subdirectory the object is found in. | ||
| 1869 | non_pic_object="$xdir$non_pic_object" | ||
| 1870 | |||
| 1871 | # A standard non-PIC object | ||
| 1872 | non_pic_objects="$non_pic_objects $non_pic_object" | ||
| 1873 | if test -z "$pic_object" || test "$pic_object" = none ; then | ||
| 1874 | arg="$non_pic_object" | ||
| 1875 | fi | ||
| 1876 | else | ||
| 1877 | # If the PIC object exists, use it instead. | ||
| 1878 | # $xdir was prepended to $pic_object above. | ||
| 1879 | non_pic_object="$pic_object" | ||
| 1880 | non_pic_objects="$non_pic_objects $non_pic_object" | ||
| 1881 | fi | ||
| 1882 | else | ||
| 1883 | # Only an error if not doing a dry-run. | ||
| 1884 | if test -z "$run"; then | ||
| 1885 | $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 | ||
| 1886 | exit $EXIT_FAILURE | ||
| 1887 | else | ||
| 1888 | # Dry-run case. | ||
| 1889 | |||
| 1890 | # Extract subdirectory from the argument. | ||
| 1891 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` | ||
| 1892 | if test "X$xdir" = "X$arg"; then | ||
| 1893 | xdir= | ||
| 1894 | else | ||
| 1895 | xdir="$xdir/" | ||
| 1896 | fi | ||
| 1897 | |||
| 1898 | pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` | ||
| 1899 | non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` | ||
| 1900 | libobjs="$libobjs $pic_object" | ||
| 1901 | non_pic_objects="$non_pic_objects $non_pic_object" | ||
| 1902 | fi | ||
| 1903 | fi | ||
| 1904 | ;; | ||
| 1905 | |||
| 1906 | *.$libext) | ||
| 1907 | # An archive. | ||
| 1908 | deplibs="$deplibs $arg" | ||
| 1909 | old_deplibs="$old_deplibs $arg" | ||
| 1910 | continue | ||
| 1911 | ;; | ||
| 1912 | |||
| 1913 | *.la) | ||
| 1914 | # A libtool-controlled library. | ||
| 1915 | |||
| 1916 | if test "$prev" = dlfiles; then | ||
| 1917 | # This library was specified with -dlopen. | ||
| 1918 | dlfiles="$dlfiles $arg" | ||
| 1919 | prev= | ||
| 1920 | elif test "$prev" = dlprefiles; then | ||
| 1921 | # The library was specified with -dlpreopen. | ||
| 1922 | dlprefiles="$dlprefiles $arg" | ||
| 1923 | prev= | ||
| 1924 | else | ||
| 1925 | deplibs="$deplibs $arg" | ||
| 1926 | fi | ||
| 1927 | continue | ||
| 1928 | ;; | ||
| 1929 | |||
| 1930 | # Some other compiler argument. | ||
| 1931 | *) | ||
| 1932 | # Unknown arguments in both finalize_command and compile_command need | ||
| 1933 | # to be aesthetically quoted because they are evaled later. | ||
| 1934 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
| 1935 | case $arg in | ||
| 1936 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 1937 | arg="\"$arg\"" | ||
| 1938 | ;; | ||
| 1939 | esac | ||
| 1940 | ;; | ||
| 1941 | esac # arg | ||
| 1942 | |||
| 1943 | # Now actually substitute the argument into the commands. | ||
| 1944 | if test -n "$arg"; then | ||
| 1945 | compile_command="$compile_command $arg" | ||
| 1946 | finalize_command="$finalize_command $arg" | ||
| 1947 | fi | ||
| 1948 | done # argument parsing loop | ||
| 1949 | |||
| 1950 | if test -n "$prev"; then | ||
| 1951 | $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 | ||
| 1952 | $echo "$help" 1>&2 | ||
| 1953 | exit $EXIT_FAILURE | ||
| 1954 | fi | ||
| 1955 | |||
| 1956 | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then | ||
| 1957 | eval arg=\"$export_dynamic_flag_spec\" | ||
| 1958 | compile_command="$compile_command $arg" | ||
| 1959 | finalize_command="$finalize_command $arg" | ||
| 1960 | fi | ||
| 1961 | |||
| 1962 | oldlibs= | ||
| 1963 | # calculate the name of the file, without its directory | ||
| 1964 | outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` | ||
| 1965 | libobjs_save="$libobjs" | ||
| 1966 | |||
| 1967 | if test -n "$shlibpath_var"; then | ||
| 1968 | # get the directories listed in $shlibpath_var | ||
| 1969 | eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` | ||
| 1970 | else | ||
| 1971 | shlib_search_path= | ||
| 1972 | fi | ||
| 1973 | eval sys_lib_search_path=\"$sys_lib_search_path_spec\" | ||
| 1974 | eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" | ||
| 1975 | |||
| 1976 | output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` | ||
| 1977 | if test "X$output_objdir" = "X$output"; then | ||
| 1978 | output_objdir="$objdir" | ||
| 1979 | else | ||
| 1980 | output_objdir="$output_objdir/$objdir" | ||
| 1981 | fi | ||
| 1982 | # Create the object directory. | ||
| 1983 | if test ! -d "$output_objdir"; then | ||
| 1984 | $show "$mkdir $output_objdir" | ||
| 1985 | $run $mkdir $output_objdir | ||
| 1986 | exit_status=$? | ||
| 1987 | if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then | ||
| 1988 | exit $exit_status | ||
| 1989 | fi | ||
| 1990 | fi | ||
| 1991 | |||
| 1992 | # Determine the type of output | ||
| 1993 | case $output in | ||
| 1994 | "") | ||
| 1995 | $echo "$modename: you must specify an output file" 1>&2 | ||
| 1996 | $echo "$help" 1>&2 | ||
| 1997 | exit $EXIT_FAILURE | ||
| 1998 | ;; | ||
| 1999 | *.$libext) linkmode=oldlib ;; | ||
| 2000 | *.lo | *.$objext) linkmode=obj ;; | ||
| 2001 | *.la) linkmode=lib ;; | ||
| 2002 | *) linkmode=prog ;; # Anything else should be a program. | ||
| 2003 | esac | ||
| 2004 | |||
| 2005 | case $host in | ||
| 2006 | *cygwin* | *mingw* | *pw32*) | ||
| 2007 | # don't eliminate duplications in $postdeps and $predeps | ||
| 2008 | duplicate_compiler_generated_deps=yes | ||
| 2009 | ;; | ||
| 2010 | *) | ||
| 2011 | duplicate_compiler_generated_deps=$duplicate_deps | ||
| 2012 | ;; | ||
| 2013 | esac | ||
| 2014 | specialdeplibs= | ||
| 2015 | |||
| 2016 | libs= | ||
| 2017 | # Find all interdependent deplibs by searching for libraries | ||
| 2018 | # that are linked more than once (e.g. -la -lb -la) | ||
| 2019 | for deplib in $deplibs; do | ||
| 2020 | if test "X$duplicate_deps" = "Xyes" ; then | ||
| 2021 | case "$libs " in | ||
| 2022 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
| 2023 | esac | ||
| 2024 | fi | ||
| 2025 | libs="$libs $deplib" | ||
| 2026 | done | ||
| 2027 | |||
| 2028 | if test "$linkmode" = lib; then | ||
| 2029 | libs="$predeps $libs $compiler_lib_search_path $postdeps" | ||
| 2030 | |||
| 2031 | # Compute libraries that are listed more than once in $predeps | ||
| 2032 | # $postdeps and mark them as special (i.e., whose duplicates are | ||
| 2033 | # not to be eliminated). | ||
| 2034 | pre_post_deps= | ||
| 2035 | if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then | ||
| 2036 | for pre_post_dep in $predeps $postdeps; do | ||
| 2037 | case "$pre_post_deps " in | ||
| 2038 | *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; | ||
| 2039 | esac | ||
| 2040 | pre_post_deps="$pre_post_deps $pre_post_dep" | ||
| 2041 | done | ||
| 2042 | fi | ||
| 2043 | pre_post_deps= | ||
| 2044 | fi | ||
| 2045 | |||
| 2046 | deplibs= | ||
| 2047 | newdependency_libs= | ||
| 2048 | newlib_search_path= | ||
| 2049 | need_relink=no # whether we're linking any uninstalled libtool libraries | ||
| 2050 | notinst_deplibs= # not-installed libtool libraries | ||
| 2051 | case $linkmode in | ||
| 2052 | lib) | ||
| 2053 | passes="conv link" | ||
| 2054 | for file in $dlfiles $dlprefiles; do | ||
| 2055 | case $file in | ||
| 2056 | *.la) ;; | ||
| 2057 | *) | ||
| 2058 | $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 | ||
| 2059 | exit $EXIT_FAILURE | ||
| 2060 | ;; | ||
| 2061 | esac | ||
| 2062 | done | ||
| 2063 | ;; | ||
| 2064 | prog) | ||
| 2065 | compile_deplibs= | ||
| 2066 | finalize_deplibs= | ||
| 2067 | alldeplibs=no | ||
| 2068 | newdlfiles= | ||
| 2069 | newdlprefiles= | ||
| 2070 | passes="conv scan dlopen dlpreopen link" | ||
| 2071 | ;; | ||
| 2072 | *) passes="conv" | ||
| 2073 | ;; | ||
| 2074 | esac | ||
| 2075 | for pass in $passes; do | ||
| 2076 | if test "$linkmode,$pass" = "lib,link" || | ||
| 2077 | test "$linkmode,$pass" = "prog,scan"; then | ||
| 2078 | libs="$deplibs" | ||
| 2079 | deplibs= | ||
| 2080 | fi | ||
| 2081 | if test "$linkmode" = prog; then | ||
| 2082 | case $pass in | ||
| 2083 | dlopen) libs="$dlfiles" ;; | ||
| 2084 | dlpreopen) libs="$dlprefiles" ;; | ||
| 2085 | link) | ||
| 2086 | libs="$deplibs %DEPLIBS%" | ||
| 2087 | test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" | ||
| 2088 | ;; | ||
| 2089 | esac | ||
| 2090 | fi | ||
| 2091 | if test "$pass" = dlopen; then | ||
| 2092 | # Collect dlpreopened libraries | ||
| 2093 | save_deplibs="$deplibs" | ||
| 2094 | deplibs= | ||
| 2095 | fi | ||
| 2096 | for deplib in $libs; do | ||
| 2097 | lib= | ||
| 2098 | found=no | ||
| 2099 | case $deplib in | ||
| 2100 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) | ||
| 2101 | if test "$linkmode,$pass" = "prog,link"; then | ||
| 2102 | compile_deplibs="$deplib $compile_deplibs" | ||
| 2103 | finalize_deplibs="$deplib $finalize_deplibs" | ||
| 2104 | else | ||
| 2105 | compiler_flags="$compiler_flags $deplib" | ||
| 2106 | fi | ||
| 2107 | continue | ||
| 2108 | ;; | ||
| 2109 | -l*) | ||
| 2110 | if test "$linkmode" != lib && test "$linkmode" != prog; then | ||
| 2111 | $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 | ||
| 2112 | continue | ||
| 2113 | fi | ||
| 2114 | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` | ||
| 2115 | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
| 2116 | for search_ext in .la $std_shrext .so .a; do | ||
| 2117 | # Search the libtool library | ||
| 2118 | lib="$searchdir/lib${name}${search_ext}" | ||
| 2119 | if test -f "$lib"; then | ||
| 2120 | if test "$search_ext" = ".la"; then | ||
| 2121 | found=yes | ||
| 2122 | else | ||
| 2123 | found=no | ||
| 2124 | fi | ||
| 2125 | break 2 | ||
| 2126 | fi | ||
| 2127 | done | ||
| 2128 | done | ||
| 2129 | if test "$found" != yes; then | ||
| 2130 | # deplib doesn't seem to be a libtool library | ||
| 2131 | if test "$linkmode,$pass" = "prog,link"; then | ||
| 2132 | compile_deplibs="$deplib $compile_deplibs" | ||
| 2133 | finalize_deplibs="$deplib $finalize_deplibs" | ||
| 2134 | else | ||
| 2135 | deplibs="$deplib $deplibs" | ||
| 2136 | test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" | ||
| 2137 | fi | ||
| 2138 | continue | ||
| 2139 | else # deplib is a libtool library | ||
| 2140 | # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, | ||
| 2141 | # We need to do some special things here, and not later. | ||
| 2142 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
| 2143 | case " $predeps $postdeps " in | ||
| 2144 | *" $deplib "*) | ||
| 2145 | if (${SED} -e '2q' $lib | | ||
| 2146 | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 2147 | library_names= | ||
| 2148 | old_library= | ||
| 2149 | case $lib in | ||
| 2150 | */* | *\\*) . $lib ;; | ||
| 2151 | *) . ./$lib ;; | ||
| 2152 | esac | ||
| 2153 | for l in $old_library $library_names; do | ||
| 2154 | ll="$l" | ||
| 2155 | done | ||
| 2156 | if test "X$ll" = "X$old_library" ; then # only static version available | ||
| 2157 | found=no | ||
| 2158 | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` | ||
| 2159 | test "X$ladir" = "X$lib" && ladir="." | ||
| 2160 | lib=$ladir/$old_library | ||
| 2161 | if test "$linkmode,$pass" = "prog,link"; then | ||
| 2162 | compile_deplibs="$deplib $compile_deplibs" | ||
| 2163 | finalize_deplibs="$deplib $finalize_deplibs" | ||
| 2164 | else | ||
| 2165 | deplibs="$deplib $deplibs" | ||
| 2166 | test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" | ||
| 2167 | fi | ||
| 2168 | continue | ||
| 2169 | fi | ||
| 2170 | fi | ||
| 2171 | ;; | ||
| 2172 | *) ;; | ||
| 2173 | esac | ||
| 2174 | fi | ||
| 2175 | fi | ||
| 2176 | ;; # -l | ||
| 2177 | -L*) | ||
| 2178 | case $linkmode in | ||
| 2179 | lib) | ||
| 2180 | deplibs="$deplib $deplibs" | ||
| 2181 | test "$pass" = conv && continue | ||
| 2182 | newdependency_libs="$deplib $newdependency_libs" | ||
| 2183 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` | ||
| 2184 | ;; | ||
| 2185 | prog) | ||
| 2186 | if test "$pass" = conv; then | ||
| 2187 | deplibs="$deplib $deplibs" | ||
| 2188 | continue | ||
| 2189 | fi | ||
| 2190 | if test "$pass" = scan; then | ||
| 2191 | deplibs="$deplib $deplibs" | ||
| 2192 | else | ||
| 2193 | compile_deplibs="$deplib $compile_deplibs" | ||
| 2194 | finalize_deplibs="$deplib $finalize_deplibs" | ||
| 2195 | fi | ||
| 2196 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` | ||
| 2197 | ;; | ||
| 2198 | *) | ||
| 2199 | $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 | ||
| 2200 | ;; | ||
| 2201 | esac # linkmode | ||
| 2202 | continue | ||
| 2203 | ;; # -L | ||
| 2204 | -R*) | ||
| 2205 | if test "$pass" = link; then | ||
| 2206 | dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` | ||
| 2207 | # Make sure the xrpath contains only unique directories. | ||
| 2208 | case "$xrpath " in | ||
| 2209 | *" $dir "*) ;; | ||
| 2210 | *) xrpath="$xrpath $dir" ;; | ||
| 2211 | esac | ||
| 2212 | fi | ||
| 2213 | deplibs="$deplib $deplibs" | ||
| 2214 | continue | ||
| 2215 | ;; | ||
| 2216 | *.la) lib="$deplib" ;; | ||
| 2217 | *.$libext) | ||
| 2218 | if test "$pass" = conv; then | ||
| 2219 | deplibs="$deplib $deplibs" | ||
| 2220 | continue | ||
| 2221 | fi | ||
| 2222 | case $linkmode in | ||
| 2223 | lib) | ||
| 2224 | valid_a_lib=no | ||
| 2225 | case $deplibs_check_method in | ||
| 2226 | match_pattern*) | ||
| 2227 | set dummy $deplibs_check_method | ||
| 2228 | match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` | ||
| 2229 | if eval $echo \"$deplib\" 2>/dev/null \ | ||
| 2230 | | $SED 10q \ | ||
| 2231 | | $EGREP "$match_pattern_regex" > /dev/null; then | ||
| 2232 | valid_a_lib=yes | ||
| 2233 | fi | ||
| 2234 | ;; | ||
| 2235 | pass_all) | ||
| 2236 | valid_a_lib=yes | ||
| 2237 | ;; | ||
| 2238 | esac | ||
| 2239 | if test "$valid_a_lib" != yes; then | ||
| 2240 | $echo | ||
| 2241 | $echo "*** Warning: Trying to link with static lib archive $deplib." | ||
| 2242 | $echo "*** I have the capability to make that library automatically link in when" | ||
| 2243 | $echo "*** you link to this library. But I can only do this if you have a" | ||
| 2244 | $echo "*** shared version of the library, which you do not appear to have" | ||
| 2245 | $echo "*** because the file extensions .$libext of this argument makes me believe" | ||
| 2246 | $echo "*** that it is just a static archive that I should not used here." | ||
| 2247 | else | ||
| 2248 | $echo | ||
| 2249 | $echo "*** Warning: Linking the shared library $output against the" | ||
| 2250 | $echo "*** static library $deplib is not portable!" | ||
| 2251 | deplibs="$deplib $deplibs" | ||
| 2252 | fi | ||
| 2253 | continue | ||
| 2254 | ;; | ||
| 2255 | prog) | ||
| 2256 | if test "$pass" != link; then | ||
| 2257 | deplibs="$deplib $deplibs" | ||
| 2258 | else | ||
| 2259 | compile_deplibs="$deplib $compile_deplibs" | ||
| 2260 | finalize_deplibs="$deplib $finalize_deplibs" | ||
| 2261 | fi | ||
| 2262 | continue | ||
| 2263 | ;; | ||
| 2264 | esac # linkmode | ||
| 2265 | ;; # *.$libext | ||
| 2266 | *.lo | *.$objext) | ||
| 2267 | if test "$pass" = conv; then | ||
| 2268 | deplibs="$deplib $deplibs" | ||
| 2269 | elif test "$linkmode" = prog; then | ||
| 2270 | if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then | ||
| 2271 | # If there is no dlopen support or we're linking statically, | ||
| 2272 | # we need to preload. | ||
| 2273 | newdlprefiles="$newdlprefiles $deplib" | ||
| 2274 | compile_deplibs="$deplib $compile_deplibs" | ||
| 2275 | finalize_deplibs="$deplib $finalize_deplibs" | ||
| 2276 | else | ||
| 2277 | newdlfiles="$newdlfiles $deplib" | ||
| 2278 | fi | ||
| 2279 | fi | ||
| 2280 | continue | ||
| 2281 | ;; | ||
| 2282 | %DEPLIBS%) | ||
| 2283 | alldeplibs=yes | ||
| 2284 | continue | ||
| 2285 | ;; | ||
| 2286 | esac # case $deplib | ||
| 2287 | if test "$found" = yes || test -f "$lib"; then : | ||
| 2288 | else | ||
| 2289 | $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 | ||
| 2290 | exit $EXIT_FAILURE | ||
| 2291 | fi | ||
| 2292 | |||
| 2293 | # Check to see that this really is a libtool archive. | ||
| 2294 | if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | ||
| 2295 | else | ||
| 2296 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
| 2297 | exit $EXIT_FAILURE | ||
| 2298 | fi | ||
| 2299 | |||
| 2300 | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` | ||
| 2301 | test "X$ladir" = "X$lib" && ladir="." | ||
| 2302 | |||
| 2303 | dlname= | ||
| 2304 | dlopen= | ||
| 2305 | dlpreopen= | ||
| 2306 | libdir= | ||
| 2307 | library_names= | ||
| 2308 | old_library= | ||
| 2309 | # If the library was installed with an old release of libtool, | ||
| 2310 | # it will not redefine variables installed, or shouldnotlink | ||
| 2311 | installed=yes | ||
| 2312 | shouldnotlink=no | ||
| 2313 | avoidtemprpath= | ||
| 2314 | |||
| 2315 | |||
| 2316 | # Read the .la file | ||
| 2317 | case $lib in | ||
| 2318 | */* | *\\*) . $lib ;; | ||
| 2319 | *) . ./$lib ;; | ||
| 2320 | esac | ||
| 2321 | |||
| 2322 | if test "$linkmode,$pass" = "lib,link" || | ||
| 2323 | test "$linkmode,$pass" = "prog,scan" || | ||
| 2324 | { test "$linkmode" != prog && test "$linkmode" != lib; }; then | ||
| 2325 | test -n "$dlopen" && dlfiles="$dlfiles $dlopen" | ||
| 2326 | test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" | ||
| 2327 | fi | ||
| 2328 | |||
| 2329 | if test "$pass" = conv; then | ||
| 2330 | # Only check for convenience libraries | ||
| 2331 | deplibs="$lib $deplibs" | ||
| 2332 | if test -z "$libdir"; then | ||
| 2333 | if test -z "$old_library"; then | ||
| 2334 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 | ||
| 2335 | exit $EXIT_FAILURE | ||
| 2336 | fi | ||
| 2337 | # It is a libtool convenience library, so add in its objects. | ||
| 2338 | convenience="$convenience $ladir/$objdir/$old_library" | ||
| 2339 | old_convenience="$old_convenience $ladir/$objdir/$old_library" | ||
| 2340 | tmp_libs= | ||
| 2341 | for deplib in $dependency_libs; do | ||
| 2342 | deplibs="$deplib $deplibs" | ||
| 2343 | if test "X$duplicate_deps" = "Xyes" ; then | ||
| 2344 | case "$tmp_libs " in | ||
| 2345 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
| 2346 | esac | ||
| 2347 | fi | ||
| 2348 | tmp_libs="$tmp_libs $deplib" | ||
| 2349 | done | ||
| 2350 | elif test "$linkmode" != prog && test "$linkmode" != lib; then | ||
| 2351 | $echo "$modename: \`$lib' is not a convenience library" 1>&2 | ||
| 2352 | exit $EXIT_FAILURE | ||
| 2353 | fi | ||
| 2354 | continue | ||
| 2355 | fi # $pass = conv | ||
| 2356 | |||
| 2357 | |||
| 2358 | # Get the name of the library we link against. | ||
| 2359 | linklib= | ||
| 2360 | for l in $old_library $library_names; do | ||
| 2361 | linklib="$l" | ||
| 2362 | done | ||
| 2363 | if test -z "$linklib"; then | ||
| 2364 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 | ||
| 2365 | exit $EXIT_FAILURE | ||
| 2366 | fi | ||
| 2367 | |||
| 2368 | # This library was specified with -dlopen. | ||
| 2369 | if test "$pass" = dlopen; then | ||
| 2370 | if test -z "$libdir"; then | ||
| 2371 | $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 | ||
| 2372 | exit $EXIT_FAILURE | ||
| 2373 | fi | ||
| 2374 | if test -z "$dlname" || | ||
| 2375 | test "$dlopen_support" != yes || | ||
| 2376 | test "$build_libtool_libs" = no; then | ||
| 2377 | # If there is no dlname, no dlopen support or we're linking | ||
| 2378 | # statically, we need to preload. We also need to preload any | ||
| 2379 | # dependent libraries so libltdl's deplib preloader doesn't | ||
| 2380 | # bomb out in the load deplibs phase. | ||
| 2381 | dlprefiles="$dlprefiles $lib $dependency_libs" | ||
| 2382 | else | ||
| 2383 | newdlfiles="$newdlfiles $lib" | ||
| 2384 | fi | ||
| 2385 | continue | ||
| 2386 | fi # $pass = dlopen | ||
| 2387 | |||
| 2388 | # We need an absolute path. | ||
| 2389 | case $ladir in | ||
| 2390 | [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; | ||
| 2391 | *) | ||
| 2392 | abs_ladir=`cd "$ladir" && pwd` | ||
| 2393 | if test -z "$abs_ladir"; then | ||
| 2394 | $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 | ||
| 2395 | $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 | ||
| 2396 | abs_ladir="$ladir" | ||
| 2397 | fi | ||
| 2398 | ;; | ||
| 2399 | esac | ||
| 2400 | laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` | ||
| 2401 | |||
| 2402 | # Find the relevant object directory and library name. | ||
| 2403 | if test "X$installed" = Xyes; then | ||
| 2404 | if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then | ||
| 2405 | $echo "$modename: warning: library \`$lib' was moved." 1>&2 | ||
| 2406 | dir="$ladir" | ||
| 2407 | absdir="$abs_ladir" | ||
| 2408 | libdir="$abs_ladir" | ||
| 2409 | else | ||
| 2410 | dir="$libdir" | ||
| 2411 | absdir="$libdir" | ||
| 2412 | fi | ||
| 2413 | test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes | ||
| 2414 | else | ||
| 2415 | if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then | ||
| 2416 | dir="$ladir" | ||
| 2417 | absdir="$abs_ladir" | ||
| 2418 | # Remove this search path later | ||
| 2419 | notinst_path="$notinst_path $abs_ladir" | ||
| 2420 | else | ||
| 2421 | dir="$ladir/$objdir" | ||
| 2422 | absdir="$abs_ladir/$objdir" | ||
| 2423 | # Remove this search path later | ||
| 2424 | notinst_path="$notinst_path $abs_ladir" | ||
| 2425 | fi | ||
| 2426 | fi # $installed = yes | ||
| 2427 | name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` | ||
| 2428 | |||
| 2429 | # This library was specified with -dlpreopen. | ||
| 2430 | if test "$pass" = dlpreopen; then | ||
| 2431 | if test -z "$libdir"; then | ||
| 2432 | $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 | ||
| 2433 | exit $EXIT_FAILURE | ||
| 2434 | fi | ||
| 2435 | # Prefer using a static library (so that no silly _DYNAMIC symbols | ||
| 2436 | # are required to link). | ||
| 2437 | if test -n "$old_library"; then | ||
| 2438 | newdlprefiles="$newdlprefiles $dir/$old_library" | ||
| 2439 | # Otherwise, use the dlname, so that lt_dlopen finds it. | ||
| 2440 | elif test -n "$dlname"; then | ||
| 2441 | newdlprefiles="$newdlprefiles $dir/$dlname" | ||
| 2442 | else | ||
| 2443 | newdlprefiles="$newdlprefiles $dir/$linklib" | ||
| 2444 | fi | ||
| 2445 | fi # $pass = dlpreopen | ||
| 2446 | |||
| 2447 | if test -z "$libdir"; then | ||
| 2448 | # Link the convenience library | ||
| 2449 | if test "$linkmode" = lib; then | ||
| 2450 | deplibs="$dir/$old_library $deplibs" | ||
| 2451 | elif test "$linkmode,$pass" = "prog,link"; then | ||
| 2452 | compile_deplibs="$dir/$old_library $compile_deplibs" | ||
| 2453 | finalize_deplibs="$dir/$old_library $finalize_deplibs" | ||
| 2454 | else | ||
| 2455 | deplibs="$lib $deplibs" # used for prog,scan pass | ||
| 2456 | fi | ||
| 2457 | continue | ||
| 2458 | fi | ||
| 2459 | |||
| 2460 | |||
| 2461 | if test "$linkmode" = prog && test "$pass" != link; then | ||
| 2462 | newlib_search_path="$newlib_search_path $ladir" | ||
| 2463 | deplibs="$lib $deplibs" | ||
| 2464 | |||
| 2465 | linkalldeplibs=no | ||
| 2466 | if test "$link_all_deplibs" != no || test -z "$library_names" || | ||
| 2467 | test "$build_libtool_libs" = no; then | ||
| 2468 | linkalldeplibs=yes | ||
| 2469 | fi | ||
| 2470 | |||
| 2471 | tmp_libs= | ||
| 2472 | for deplib in $dependency_libs; do | ||
| 2473 | case $deplib in | ||
| 2474 | -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test | ||
| 2475 | esac | ||
| 2476 | # Need to link against all dependency_libs? | ||
| 2477 | if test "$linkalldeplibs" = yes; then | ||
| 2478 | deplibs="$deplib $deplibs" | ||
| 2479 | else | ||
| 2480 | # Need to hardcode shared library paths | ||
| 2481 | # or/and link against static libraries | ||
| 2482 | newdependency_libs="$deplib $newdependency_libs" | ||
| 2483 | fi | ||
| 2484 | if test "X$duplicate_deps" = "Xyes" ; then | ||
| 2485 | case "$tmp_libs " in | ||
| 2486 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
| 2487 | esac | ||
| 2488 | fi | ||
| 2489 | tmp_libs="$tmp_libs $deplib" | ||
| 2490 | done # for deplib | ||
| 2491 | continue | ||
| 2492 | fi # $linkmode = prog... | ||
| 2493 | |||
| 2494 | if test "$linkmode,$pass" = "prog,link"; then | ||
| 2495 | if test -n "$library_names" && | ||
| 2496 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then | ||
| 2497 | # We need to hardcode the library path | ||
| 2498 | if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then | ||
| 2499 | # Make sure the rpath contains only unique directories. | ||
| 2500 | case "$temp_rpath " in | ||
| 2501 | *" $dir "*) ;; | ||
| 2502 | *" $absdir "*) ;; | ||
| 2503 | *) temp_rpath="$temp_rpath $absdir" ;; | ||
| 2504 | esac | ||
| 2505 | fi | ||
| 2506 | |||
| 2507 | # Hardcode the library path. | ||
| 2508 | # Skip directories that are in the system default run-time | ||
| 2509 | # search path. | ||
| 2510 | case " $sys_lib_dlsearch_path " in | ||
| 2511 | *" $absdir "*) ;; | ||
| 2512 | *) | ||
| 2513 | case "$compile_rpath " in | ||
| 2514 | *" $absdir "*) ;; | ||
| 2515 | *) compile_rpath="$compile_rpath $absdir" | ||
| 2516 | esac | ||
| 2517 | ;; | ||
| 2518 | esac | ||
| 2519 | case " $sys_lib_dlsearch_path " in | ||
| 2520 | *" $libdir "*) ;; | ||
| 2521 | *) | ||
| 2522 | case "$finalize_rpath " in | ||
| 2523 | *" $libdir "*) ;; | ||
| 2524 | *) finalize_rpath="$finalize_rpath $libdir" | ||
| 2525 | esac | ||
| 2526 | ;; | ||
| 2527 | esac | ||
| 2528 | fi # $linkmode,$pass = prog,link... | ||
| 2529 | |||
| 2530 | if test "$alldeplibs" = yes && | ||
| 2531 | { test "$deplibs_check_method" = pass_all || | ||
| 2532 | { test "$build_libtool_libs" = yes && | ||
| 2533 | test -n "$library_names"; }; }; then | ||
| 2534 | # We only need to search for static libraries | ||
| 2535 | continue | ||
| 2536 | fi | ||
| 2537 | fi | ||
| 2538 | |||
| 2539 | link_static=no # Whether the deplib will be linked statically | ||
| 2540 | use_static_libs=$prefer_static_libs | ||
| 2541 | if test "$use_static_libs" = built && test "$installed" = yes ; then | ||
| 2542 | use_static_libs=no | ||
| 2543 | fi | ||
| 2544 | if test -n "$library_names" && | ||
| 2545 | { test "$use_static_libs" = no || test -z "$old_library"; }; then | ||
| 2546 | if test "$installed" = no; then | ||
| 2547 | notinst_deplibs="$notinst_deplibs $lib" | ||
| 2548 | need_relink=yes | ||
| 2549 | fi | ||
| 2550 | # This is a shared library | ||
| 2551 | |||
| 2552 | # Warn about portability, can't link against -module's on | ||
| 2553 | # some systems (darwin) | ||
| 2554 | if test "$shouldnotlink" = yes && test "$pass" = link ; then | ||
| 2555 | $echo | ||
| 2556 | if test "$linkmode" = prog; then | ||
| 2557 | $echo "*** Warning: Linking the executable $output against the loadable module" | ||
| 2558 | else | ||
| 2559 | $echo "*** Warning: Linking the shared library $output against the loadable module" | ||
| 2560 | fi | ||
| 2561 | $echo "*** $linklib is not portable!" | ||
| 2562 | fi | ||
| 2563 | if test "$linkmode" = lib && | ||
| 2564 | test "$hardcode_into_libs" = yes; then | ||
| 2565 | # Hardcode the library path. | ||
| 2566 | # Skip directories that are in the system default run-time | ||
| 2567 | # search path. | ||
| 2568 | case " $sys_lib_dlsearch_path " in | ||
| 2569 | *" $absdir "*) ;; | ||
| 2570 | *) | ||
| 2571 | case "$compile_rpath " in | ||
| 2572 | *" $absdir "*) ;; | ||
| 2573 | *) compile_rpath="$compile_rpath $absdir" | ||
| 2574 | esac | ||
| 2575 | ;; | ||
| 2576 | esac | ||
| 2577 | case " $sys_lib_dlsearch_path " in | ||
| 2578 | *" $libdir "*) ;; | ||
| 2579 | *) | ||
| 2580 | case "$finalize_rpath " in | ||
| 2581 | *" $libdir "*) ;; | ||
| 2582 | *) finalize_rpath="$finalize_rpath $libdir" | ||
| 2583 | esac | ||
| 2584 | ;; | ||
| 2585 | esac | ||
| 2586 | fi | ||
| 2587 | |||
| 2588 | if test -n "$old_archive_from_expsyms_cmds"; then | ||
| 2589 | # figure out the soname | ||
| 2590 | set dummy $library_names | ||
| 2591 | realname="$2" | ||
| 2592 | shift; shift | ||
| 2593 | libname=`eval \\$echo \"$libname_spec\"` | ||
| 2594 | # use dlname if we got it. it's perfectly good, no? | ||
| 2595 | if test -n "$dlname"; then | ||
| 2596 | soname="$dlname" | ||
| 2597 | elif test -n "$soname_spec"; then | ||
| 2598 | # bleh windows | ||
| 2599 | case $host in | ||
| 2600 | *cygwin* | mingw*) | ||
| 2601 | major=`expr $current - $age` | ||
| 2602 | versuffix="-$major" | ||
| 2603 | ;; | ||
| 2604 | esac | ||
| 2605 | eval soname=\"$soname_spec\" | ||
| 2606 | else | ||
| 2607 | soname="$realname" | ||
| 2608 | fi | ||
| 2609 | |||
| 2610 | # Make a new name for the extract_expsyms_cmds to use | ||
| 2611 | soroot="$soname" | ||
| 2612 | soname=`$echo $soroot | ${SED} -e 's/^.*\///'` | ||
| 2613 | newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" | ||
| 2614 | |||
| 2615 | # If the library has no export list, then create one now | ||
| 2616 | if test -f "$output_objdir/$soname-def"; then : | ||
| 2617 | else | ||
| 2618 | $show "extracting exported symbol list from \`$soname'" | ||
| 2619 | save_ifs="$IFS"; IFS='~' | ||
| 2620 | cmds=$extract_expsyms_cmds | ||
| 2621 | for cmd in $cmds; do | ||
| 2622 | IFS="$save_ifs" | ||
| 2623 | eval cmd=\"$cmd\" | ||
| 2624 | $show "$cmd" | ||
| 2625 | $run eval "$cmd" || exit $? | ||
| 2626 | done | ||
| 2627 | IFS="$save_ifs" | ||
| 2628 | fi | ||
| 2629 | |||
| 2630 | # Create $newlib | ||
| 2631 | if test -f "$output_objdir/$newlib"; then :; else | ||
| 2632 | $show "generating import library for \`$soname'" | ||
| 2633 | save_ifs="$IFS"; IFS='~' | ||
| 2634 | cmds=$old_archive_from_expsyms_cmds | ||
| 2635 | for cmd in $cmds; do | ||
| 2636 | IFS="$save_ifs" | ||
| 2637 | eval cmd=\"$cmd\" | ||
| 2638 | $show "$cmd" | ||
| 2639 | $run eval "$cmd" || exit $? | ||
| 2640 | done | ||
| 2641 | IFS="$save_ifs" | ||
| 2642 | fi | ||
| 2643 | # make sure the library variables are pointing to the new library | ||
| 2644 | dir=$output_objdir | ||
| 2645 | linklib=$newlib | ||
| 2646 | fi # test -n "$old_archive_from_expsyms_cmds" | ||
| 2647 | |||
| 2648 | if test "$linkmode" = prog || test "$mode" != relink; then | ||
| 2649 | add_shlibpath= | ||
| 2650 | add_dir= | ||
| 2651 | add= | ||
| 2652 | lib_linked=yes | ||
| 2653 | case $hardcode_action in | ||
| 2654 | immediate | unsupported) | ||
| 2655 | if test "$hardcode_direct" = no; then | ||
| 2656 | add="$dir/$linklib" | ||
| 2657 | case $host in | ||
| 2658 | *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; | ||
| 2659 | *-*-sysv4*uw2*) add_dir="-L$dir" ;; | ||
| 2660 | *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ | ||
| 2661 | *-*-unixware7*) add_dir="-L$dir" ;; | ||
| 2662 | *-*-darwin* ) | ||
| 2663 | # if the lib is a module then we can not link against | ||
| 2664 | # it, someone is ignoring the new warnings I added | ||
| 2665 | if /usr/bin/file -L $add 2> /dev/null | | ||
| 2666 | $EGREP ": [^:]* bundle" >/dev/null ; then | ||
| 2667 | $echo "** Warning, lib $linklib is a module, not a shared library" | ||
| 2668 | if test -z "$old_library" ; then | ||
| 2669 | $echo | ||
| 2670 | $echo "** And there doesn't seem to be a static archive available" | ||
| 2671 | $echo "** The link will probably fail, sorry" | ||
| 2672 | else | ||
| 2673 | add="$dir/$old_library" | ||
| 2674 | fi | ||
| 2675 | fi | ||
| 2676 | esac | ||
| 2677 | elif test "$hardcode_minus_L" = no; then | ||
| 2678 | case $host in | ||
| 2679 | *-*-sunos*) add_shlibpath="$dir" ;; | ||
| 2680 | esac | ||
| 2681 | add_dir="-L$dir" | ||
| 2682 | add="-l$name" | ||
| 2683 | elif test "$hardcode_shlibpath_var" = no; then | ||
| 2684 | add_shlibpath="$dir" | ||
| 2685 | add="-l$name" | ||
| 2686 | else | ||
| 2687 | lib_linked=no | ||
| 2688 | fi | ||
| 2689 | ;; | ||
| 2690 | relink) | ||
| 2691 | if test "$hardcode_direct" = yes; then | ||
| 2692 | add="$dir/$linklib" | ||
| 2693 | elif test "$hardcode_minus_L" = yes; then | ||
| 2694 | add_dir="-L$dir" | ||
| 2695 | # Try looking first in the location we're being installed to. | ||
| 2696 | if test -n "$inst_prefix_dir"; then | ||
| 2697 | case $libdir in | ||
| 2698 | [\\/]*) | ||
| 2699 | add_dir="$add_dir -L$inst_prefix_dir$libdir" | ||
| 2700 | ;; | ||
| 2701 | esac | ||
| 2702 | fi | ||
| 2703 | add="-l$name" | ||
| 2704 | elif test "$hardcode_shlibpath_var" = yes; then | ||
| 2705 | add_shlibpath="$dir" | ||
| 2706 | add="-l$name" | ||
| 2707 | else | ||
| 2708 | lib_linked=no | ||
| 2709 | fi | ||
| 2710 | ;; | ||
| 2711 | *) lib_linked=no ;; | ||
| 2712 | esac | ||
| 2713 | |||
| 2714 | if test "$lib_linked" != yes; then | ||
| 2715 | $echo "$modename: configuration error: unsupported hardcode properties" | ||
| 2716 | exit $EXIT_FAILURE | ||
| 2717 | fi | ||
| 2718 | |||
| 2719 | if test -n "$add_shlibpath"; then | ||
| 2720 | case :$compile_shlibpath: in | ||
| 2721 | *":$add_shlibpath:"*) ;; | ||
| 2722 | *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; | ||
| 2723 | esac | ||
| 2724 | fi | ||
| 2725 | if test "$linkmode" = prog; then | ||
| 2726 | test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" | ||
| 2727 | test -n "$add" && compile_deplibs="$add $compile_deplibs" | ||
| 2728 | else | ||
| 2729 | test -n "$add_dir" && deplibs="$add_dir $deplibs" | ||
| 2730 | test -n "$add" && deplibs="$add $deplibs" | ||
| 2731 | if test "$hardcode_direct" != yes && \ | ||
| 2732 | test "$hardcode_minus_L" != yes && \ | ||
| 2733 | test "$hardcode_shlibpath_var" = yes; then | ||
| 2734 | case :$finalize_shlibpath: in | ||
| 2735 | *":$libdir:"*) ;; | ||
| 2736 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; | ||
| 2737 | esac | ||
| 2738 | fi | ||
| 2739 | fi | ||
| 2740 | fi | ||
| 2741 | |||
| 2742 | if test "$linkmode" = prog || test "$mode" = relink; then | ||
| 2743 | add_shlibpath= | ||
| 2744 | add_dir= | ||
| 2745 | add= | ||
| 2746 | # Finalize command for both is simple: just hardcode it. | ||
| 2747 | if test "$hardcode_direct" = yes; then | ||
| 2748 | add="$libdir/$linklib" | ||
| 2749 | elif test "$hardcode_minus_L" = yes; then | ||
| 2750 | add_dir="-L$libdir" | ||
| 2751 | add="-l$name" | ||
| 2752 | elif test "$hardcode_shlibpath_var" = yes; then | ||
| 2753 | case :$finalize_shlibpath: in | ||
| 2754 | *":$libdir:"*) ;; | ||
| 2755 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; | ||
| 2756 | esac | ||
| 2757 | add="-l$name" | ||
| 2758 | elif test "$hardcode_automatic" = yes; then | ||
| 2759 | if test -n "$inst_prefix_dir" && | ||
| 2760 | test -f "$inst_prefix_dir$libdir/$linklib" ; then | ||
| 2761 | add="$inst_prefix_dir$libdir/$linklib" | ||
| 2762 | else | ||
| 2763 | add="$libdir/$linklib" | ||
| 2764 | fi | ||
| 2765 | else | ||
| 2766 | # We cannot seem to hardcode it, guess we'll fake it. | ||
| 2767 | add_dir="-L$libdir" | ||
| 2768 | # Try looking first in the location we're being installed to. | ||
| 2769 | if test -n "$inst_prefix_dir"; then | ||
| 2770 | case $libdir in | ||
| 2771 | [\\/]*) | ||
| 2772 | add_dir="$add_dir -L$inst_prefix_dir$libdir" | ||
| 2773 | ;; | ||
| 2774 | esac | ||
| 2775 | fi | ||
| 2776 | add="-l$name" | ||
| 2777 | fi | ||
| 2778 | |||
| 2779 | if test "$linkmode" = prog; then | ||
| 2780 | test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" | ||
| 2781 | test -n "$add" && finalize_deplibs="$add $finalize_deplibs" | ||
| 2782 | else | ||
| 2783 | test -n "$add_dir" && deplibs="$add_dir $deplibs" | ||
| 2784 | test -n "$add" && deplibs="$add $deplibs" | ||
| 2785 | fi | ||
| 2786 | fi | ||
| 2787 | elif test "$linkmode" = prog; then | ||
| 2788 | # Here we assume that one of hardcode_direct or hardcode_minus_L | ||
| 2789 | # is not unsupported. This is valid on all known static and | ||
| 2790 | # shared platforms. | ||
| 2791 | if test "$hardcode_direct" != unsupported; then | ||
| 2792 | test -n "$old_library" && linklib="$old_library" | ||
| 2793 | compile_deplibs="$dir/$linklib $compile_deplibs" | ||
| 2794 | finalize_deplibs="$dir/$linklib $finalize_deplibs" | ||
| 2795 | else | ||
| 2796 | compile_deplibs="-l$name -L$dir $compile_deplibs" | ||
| 2797 | finalize_deplibs="-l$name -L$dir $finalize_deplibs" | ||
| 2798 | fi | ||
| 2799 | elif test "$build_libtool_libs" = yes; then | ||
| 2800 | # Not a shared library | ||
| 2801 | if test "$deplibs_check_method" != pass_all; then | ||
| 2802 | # We're trying link a shared library against a static one | ||
| 2803 | # but the system doesn't support it. | ||
| 2804 | |||
| 2805 | # Just print a warning and add the library to dependency_libs so | ||
| 2806 | # that the program can be linked against the static library. | ||
| 2807 | $echo | ||
| 2808 | $echo "*** Warning: This system can not link to static lib archive $lib." | ||
| 2809 | $echo "*** I have the capability to make that library automatically link in when" | ||
| 2810 | $echo "*** you link to this library. But I can only do this if you have a" | ||
| 2811 | $echo "*** shared version of the library, which you do not appear to have." | ||
| 2812 | if test "$module" = yes; then | ||
| 2813 | $echo "*** But as you try to build a module library, libtool will still create " | ||
| 2814 | $echo "*** a static module, that should work as long as the dlopening application" | ||
| 2815 | $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." | ||
| 2816 | if test -z "$global_symbol_pipe"; then | ||
| 2817 | $echo | ||
| 2818 | $echo "*** However, this would only work if libtool was able to extract symbol" | ||
| 2819 | $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" | ||
| 2820 | $echo "*** not find such a program. So, this module is probably useless." | ||
| 2821 | $echo "*** \`nm' from GNU binutils and a full rebuild may help." | ||
| 2822 | fi | ||
| 2823 | if test "$build_old_libs" = no; then | ||
| 2824 | build_libtool_libs=module | ||
| 2825 | build_old_libs=yes | ||
| 2826 | else | ||
| 2827 | build_libtool_libs=no | ||
| 2828 | fi | ||
| 2829 | fi | ||
| 2830 | else | ||
| 2831 | deplibs="$dir/$old_library $deplibs" | ||
| 2832 | link_static=yes | ||
| 2833 | fi | ||
| 2834 | fi # link shared/static library? | ||
| 2835 | |||
| 2836 | if test "$linkmode" = lib; then | ||
| 2837 | if test -n "$dependency_libs" && | ||
| 2838 | { test "$hardcode_into_libs" != yes || | ||
| 2839 | test "$build_old_libs" = yes || | ||
| 2840 | test "$link_static" = yes; }; then | ||
| 2841 | # Extract -R from dependency_libs | ||
| 2842 | temp_deplibs= | ||
| 2843 | for libdir in $dependency_libs; do | ||
| 2844 | case $libdir in | ||
| 2845 | -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` | ||
| 2846 | case " $xrpath " in | ||
| 2847 | *" $temp_xrpath "*) ;; | ||
| 2848 | *) xrpath="$xrpath $temp_xrpath";; | ||
| 2849 | esac;; | ||
| 2850 | *) temp_deplibs="$temp_deplibs $libdir";; | ||
| 2851 | esac | ||
| 2852 | done | ||
| 2853 | dependency_libs="$temp_deplibs" | ||
| 2854 | fi | ||
| 2855 | |||
| 2856 | newlib_search_path="$newlib_search_path $absdir" | ||
| 2857 | # Link against this library | ||
| 2858 | test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" | ||
| 2859 | # ... and its dependency_libs | ||
| 2860 | tmp_libs= | ||
| 2861 | for deplib in $dependency_libs; do | ||
| 2862 | newdependency_libs="$deplib $newdependency_libs" | ||
| 2863 | if test "X$duplicate_deps" = "Xyes" ; then | ||
| 2864 | case "$tmp_libs " in | ||
| 2865 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
| 2866 | esac | ||
| 2867 | fi | ||
| 2868 | tmp_libs="$tmp_libs $deplib" | ||
| 2869 | done | ||
| 2870 | |||
| 2871 | if test "$link_all_deplibs" != no; then | ||
| 2872 | # Add the search paths of all dependency libraries | ||
| 2873 | for deplib in $dependency_libs; do | ||
| 2874 | case $deplib in | ||
| 2875 | -L*) path="$deplib" ;; | ||
| 2876 | *.la) | ||
| 2877 | dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` | ||
| 2878 | test "X$dir" = "X$deplib" && dir="." | ||
| 2879 | # We need an absolute path. | ||
| 2880 | case $dir in | ||
| 2881 | [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; | ||
| 2882 | *) | ||
| 2883 | absdir=`cd "$dir" && pwd` | ||
| 2884 | if test -z "$absdir"; then | ||
| 2885 | $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 | ||
| 2886 | absdir="$dir" | ||
| 2887 | fi | ||
| 2888 | ;; | ||
| 2889 | esac | ||
| 2890 | if grep "^installed=no" $deplib > /dev/null; then | ||
| 2891 | path="$absdir/$objdir" | ||
| 2892 | else | ||
| 2893 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
| 2894 | if test -z "$libdir"; then | ||
| 2895 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 | ||
| 2896 | exit $EXIT_FAILURE | ||
| 2897 | fi | ||
| 2898 | if test "$absdir" != "$libdir"; then | ||
| 2899 | $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 | ||
| 2900 | fi | ||
| 2901 | path="$absdir" | ||
| 2902 | fi | ||
| 2903 | depdepl= | ||
| 2904 | case $host in | ||
| 2905 | *-*-darwin*) | ||
| 2906 | # we do not want to link against static libs, | ||
| 2907 | # but need to link against shared | ||
| 2908 | eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` | ||
| 2909 | if test -n "$deplibrary_names" ; then | ||
| 2910 | for tmp in $deplibrary_names ; do | ||
| 2911 | depdepl=$tmp | ||
| 2912 | done | ||
| 2913 | if test -f "$path/$depdepl" ; then | ||
| 2914 | depdepl="$path/$depdepl" | ||
| 2915 | fi | ||
| 2916 | # do not add paths which are already there | ||
| 2917 | case " $newlib_search_path " in | ||
| 2918 | *" $path "*) ;; | ||
| 2919 | *) newlib_search_path="$newlib_search_path $path";; | ||
| 2920 | esac | ||
| 2921 | fi | ||
| 2922 | path="" | ||
| 2923 | ;; | ||
| 2924 | *) | ||
| 2925 | path="-L$path" | ||
| 2926 | ;; | ||
| 2927 | esac | ||
| 2928 | ;; | ||
| 2929 | -l*) | ||
| 2930 | case $host in | ||
| 2931 | *-*-darwin*) | ||
| 2932 | # Again, we only want to link against shared libraries | ||
| 2933 | eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` | ||
| 2934 | for tmp in $newlib_search_path ; do | ||
| 2935 | if test -f "$tmp/lib$tmp_libs.dylib" ; then | ||
| 2936 | eval depdepl="$tmp/lib$tmp_libs.dylib" | ||
| 2937 | break | ||
| 2938 | fi | ||
| 2939 | done | ||
| 2940 | path="" | ||
| 2941 | ;; | ||
| 2942 | *) continue ;; | ||
| 2943 | esac | ||
| 2944 | ;; | ||
| 2945 | *) continue ;; | ||
| 2946 | esac | ||
| 2947 | case " $deplibs " in | ||
| 2948 | *" $path "*) ;; | ||
| 2949 | *) deplibs="$path $deplibs" ;; | ||
| 2950 | esac | ||
| 2951 | case " $deplibs " in | ||
| 2952 | *" $depdepl "*) ;; | ||
| 2953 | *) deplibs="$depdepl $deplibs" ;; | ||
| 2954 | esac | ||
| 2955 | done | ||
| 2956 | fi # link_all_deplibs != no | ||
| 2957 | fi # linkmode = lib | ||
| 2958 | done # for deplib in $libs | ||
| 2959 | dependency_libs="$newdependency_libs" | ||
| 2960 | if test "$pass" = dlpreopen; then | ||
| 2961 | # Link the dlpreopened libraries before other libraries | ||
| 2962 | for deplib in $save_deplibs; do | ||
| 2963 | deplibs="$deplib $deplibs" | ||
| 2964 | done | ||
| 2965 | fi | ||
| 2966 | if test "$pass" != dlopen; then | ||
| 2967 | if test "$pass" != conv; then | ||
| 2968 | # Make sure lib_search_path contains only unique directories. | ||
| 2969 | lib_search_path= | ||
| 2970 | for dir in $newlib_search_path; do | ||
| 2971 | case "$lib_search_path " in | ||
| 2972 | *" $dir "*) ;; | ||
| 2973 | *) lib_search_path="$lib_search_path $dir" ;; | ||
| 2974 | esac | ||
| 2975 | done | ||
| 2976 | newlib_search_path= | ||
| 2977 | fi | ||
| 2978 | |||
| 2979 | if test "$linkmode,$pass" != "prog,link"; then | ||
| 2980 | vars="deplibs" | ||
| 2981 | else | ||
| 2982 | vars="compile_deplibs finalize_deplibs" | ||
| 2983 | fi | ||
| 2984 | for var in $vars dependency_libs; do | ||
| 2985 | # Add libraries to $var in reverse order | ||
| 2986 | eval tmp_libs=\"\$$var\" | ||
| 2987 | new_libs= | ||
| 2988 | for deplib in $tmp_libs; do | ||
| 2989 | # FIXME: Pedantically, this is the right thing to do, so | ||
| 2990 | # that some nasty dependency loop isn't accidentally | ||
| 2991 | # broken: | ||
| 2992 | #new_libs="$deplib $new_libs" | ||
| 2993 | # Pragmatically, this seems to cause very few problems in | ||
| 2994 | # practice: | ||
| 2995 | case $deplib in | ||
| 2996 | -L*) new_libs="$deplib $new_libs" ;; | ||
| 2997 | -R*) ;; | ||
| 2998 | *) | ||
| 2999 | # And here is the reason: when a library appears more | ||
| 3000 | # than once as an explicit dependence of a library, or | ||
| 3001 | # is implicitly linked in more than once by the | ||
| 3002 | # compiler, it is considered special, and multiple | ||
| 3003 | # occurrences thereof are not removed. Compare this | ||
| 3004 | # with having the same library being listed as a | ||
| 3005 | # dependency of multiple other libraries: in this case, | ||
| 3006 | # we know (pedantically, we assume) the library does not | ||
| 3007 | # need to be listed more than once, so we keep only the | ||
| 3008 | # last copy. This is not always right, but it is rare | ||
| 3009 | # enough that we require users that really mean to play | ||
| 3010 | # such unportable linking tricks to link the library | ||
| 3011 | # using -Wl,-lname, so that libtool does not consider it | ||
| 3012 | # for duplicate removal. | ||
| 3013 | case " $specialdeplibs " in | ||
| 3014 | *" $deplib "*) new_libs="$deplib $new_libs" ;; | ||
| 3015 | *) | ||
| 3016 | case " $new_libs " in | ||
| 3017 | *" $deplib "*) ;; | ||
| 3018 | *) new_libs="$deplib $new_libs" ;; | ||
| 3019 | esac | ||
| 3020 | ;; | ||
| 3021 | esac | ||
| 3022 | ;; | ||
| 3023 | esac | ||
| 3024 | done | ||
| 3025 | tmp_libs= | ||
| 3026 | for deplib in $new_libs; do | ||
| 3027 | case $deplib in | ||
| 3028 | -L*) | ||
| 3029 | case " $tmp_libs " in | ||
| 3030 | *" $deplib "*) ;; | ||
| 3031 | *) tmp_libs="$tmp_libs $deplib" ;; | ||
| 3032 | esac | ||
| 3033 | ;; | ||
| 3034 | *) tmp_libs="$tmp_libs $deplib" ;; | ||
| 3035 | esac | ||
| 3036 | done | ||
| 3037 | eval $var=\"$tmp_libs\" | ||
| 3038 | done # for var | ||
| 3039 | fi | ||
| 3040 | # Last step: remove runtime libs from dependency_libs | ||
| 3041 | # (they stay in deplibs) | ||
| 3042 | tmp_libs= | ||
| 3043 | for i in $dependency_libs ; do | ||
| 3044 | case " $predeps $postdeps $compiler_lib_search_path " in | ||
| 3045 | *" $i "*) | ||
| 3046 | i="" | ||
| 3047 | ;; | ||
| 3048 | esac | ||
| 3049 | if test -n "$i" ; then | ||
| 3050 | tmp_libs="$tmp_libs $i" | ||
| 3051 | fi | ||
| 3052 | done | ||
| 3053 | dependency_libs=$tmp_libs | ||
| 3054 | done # for pass | ||
| 3055 | if test "$linkmode" = prog; then | ||
| 3056 | dlfiles="$newdlfiles" | ||
| 3057 | dlprefiles="$newdlprefiles" | ||
| 3058 | fi | ||
| 3059 | |||
| 3060 | case $linkmode in | ||
| 3061 | oldlib) | ||
| 3062 | if test -n "$deplibs"; then | ||
| 3063 | $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 | ||
| 3064 | fi | ||
| 3065 | |||
| 3066 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | ||
| 3067 | $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 | ||
| 3068 | fi | ||
| 3069 | |||
| 3070 | if test -n "$rpath"; then | ||
| 3071 | $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 | ||
| 3072 | fi | ||
| 3073 | |||
| 3074 | if test -n "$xrpath"; then | ||
| 3075 | $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 | ||
| 3076 | fi | ||
| 3077 | |||
| 3078 | if test -n "$vinfo"; then | ||
| 3079 | $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 | ||
| 3080 | fi | ||
| 3081 | |||
| 3082 | if test -n "$release"; then | ||
| 3083 | $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 | ||
| 3084 | fi | ||
| 3085 | |||
| 3086 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then | ||
| 3087 | $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 | ||
| 3088 | fi | ||
| 3089 | |||
| 3090 | # Now set the variables for building old libraries. | ||
| 3091 | build_libtool_libs=no | ||
| 3092 | oldlibs="$output" | ||
| 3093 | objs="$objs$old_deplibs" | ||
| 3094 | ;; | ||
| 3095 | |||
| 3096 | lib) | ||
| 3097 | # Make sure we only generate libraries of the form `libNAME.la'. | ||
| 3098 | case $outputname in | ||
| 3099 | lib*) | ||
| 3100 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` | ||
| 3101 | eval shared_ext=\"$shrext_cmds\" | ||
| 3102 | eval libname=\"$libname_spec\" | ||
| 3103 | ;; | ||
| 3104 | *) | ||
| 3105 | if test "$module" = no; then | ||
| 3106 | $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 | ||
| 3107 | $echo "$help" 1>&2 | ||
| 3108 | exit $EXIT_FAILURE | ||
| 3109 | fi | ||
| 3110 | if test "$need_lib_prefix" != no; then | ||
| 3111 | # Add the "lib" prefix for modules if required | ||
| 3112 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | ||
| 3113 | eval shared_ext=\"$shrext_cmds\" | ||
| 3114 | eval libname=\"$libname_spec\" | ||
| 3115 | else | ||
| 3116 | libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | ||
| 3117 | fi | ||
| 3118 | ;; | ||
| 3119 | esac | ||
| 3120 | |||
| 3121 | if test -n "$objs"; then | ||
| 3122 | if test "$deplibs_check_method" != pass_all; then | ||
| 3123 | $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 | ||
| 3124 | exit $EXIT_FAILURE | ||
| 3125 | else | ||
| 3126 | $echo | ||
| 3127 | $echo "*** Warning: Linking the shared library $output against the non-libtool" | ||
| 3128 | $echo "*** objects $objs is not portable!" | ||
| 3129 | libobjs="$libobjs $objs" | ||
| 3130 | fi | ||
| 3131 | fi | ||
| 3132 | |||
| 3133 | if test "$dlself" != no; then | ||
| 3134 | $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 | ||
| 3135 | fi | ||
| 3136 | |||
| 3137 | set dummy $rpath | ||
| 3138 | if test "$#" -gt 2; then | ||
| 3139 | $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 | ||
| 3140 | fi | ||
| 3141 | install_libdir="$2" | ||
| 3142 | |||
| 3143 | oldlibs= | ||
| 3144 | if test -z "$rpath"; then | ||
| 3145 | if test "$build_libtool_libs" = yes; then | ||
| 3146 | # Building a libtool convenience library. | ||
| 3147 | # Some compilers have problems with a `.al' extension so | ||
| 3148 | # convenience libraries should have the same extension an | ||
| 3149 | # archive normally would. | ||
| 3150 | oldlibs="$output_objdir/$libname.$libext $oldlibs" | ||
| 3151 | build_libtool_libs=convenience | ||
| 3152 | build_old_libs=yes | ||
| 3153 | fi | ||
| 3154 | |||
| 3155 | if test -n "$vinfo"; then | ||
| 3156 | $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 | ||
| 3157 | fi | ||
| 3158 | |||
| 3159 | if test -n "$release"; then | ||
| 3160 | $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 | ||
| 3161 | fi | ||
| 3162 | else | ||
| 3163 | |||
| 3164 | # Parse the version information argument. | ||
| 3165 | save_ifs="$IFS"; IFS=':' | ||
| 3166 | set dummy $vinfo 0 0 0 | ||
| 3167 | IFS="$save_ifs" | ||
| 3168 | |||
| 3169 | if test -n "$8"; then | ||
| 3170 | $echo "$modename: too many parameters to \`-version-info'" 1>&2 | ||
| 3171 | $echo "$help" 1>&2 | ||
| 3172 | exit $EXIT_FAILURE | ||
| 3173 | fi | ||
| 3174 | |||
| 3175 | # convert absolute version numbers to libtool ages | ||
| 3176 | # this retains compatibility with .la files and attempts | ||
| 3177 | # to make the code below a bit more comprehensible | ||
| 3178 | |||
| 3179 | case $vinfo_number in | ||
| 3180 | yes) | ||
| 3181 | number_major="$2" | ||
| 3182 | number_minor="$3" | ||
| 3183 | number_revision="$4" | ||
| 3184 | # | ||
| 3185 | # There are really only two kinds -- those that | ||
| 3186 | # use the current revision as the major version | ||
| 3187 | # and those that subtract age and use age as | ||
| 3188 | # a minor version. But, then there is irix | ||
| 3189 | # which has an extra 1 added just for fun | ||
| 3190 | # | ||
| 3191 | case $version_type in | ||
| 3192 | darwin|linux|osf|windows) | ||
| 3193 | current=`expr $number_major + $number_minor` | ||
| 3194 | age="$number_minor" | ||
| 3195 | revision="$number_revision" | ||
| 3196 | ;; | ||
| 3197 | freebsd-aout|freebsd-elf|sunos) | ||
| 3198 | current="$number_major" | ||
| 3199 | revision="$number_minor" | ||
| 3200 | age="0" | ||
| 3201 | ;; | ||
| 3202 | irix|nonstopux) | ||
| 3203 | current=`expr $number_major + $number_minor - 1` | ||
| 3204 | age="$number_minor" | ||
| 3205 | revision="$number_minor" | ||
| 3206 | ;; | ||
| 3207 | *) | ||
| 3208 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 | ||
| 3209 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | ||
| 3210 | exit $EXIT_FAILURE | ||
| 3211 | ;; | ||
| 3212 | esac | ||
| 3213 | ;; | ||
| 3214 | no) | ||
| 3215 | current="$2" | ||
| 3216 | revision="$3" | ||
| 3217 | age="$4" | ||
| 3218 | ;; | ||
| 3219 | esac | ||
| 3220 | |||
| 3221 | # Check that each of the things are valid numbers. | ||
| 3222 | case $current in | ||
| 3223 | 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; | ||
| 3224 | *) | ||
| 3225 | $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 | ||
| 3226 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
| 3227 | exit $EXIT_FAILURE | ||
| 3228 | ;; | ||
| 3229 | esac | ||
| 3230 | |||
| 3231 | case $revision in | ||
| 3232 | 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; | ||
| 3233 | *) | ||
| 3234 | $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 | ||
| 3235 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
| 3236 | exit $EXIT_FAILURE | ||
| 3237 | ;; | ||
| 3238 | esac | ||
| 3239 | |||
| 3240 | case $age in | ||
| 3241 | 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; | ||
| 3242 | *) | ||
| 3243 | $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 | ||
| 3244 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
| 3245 | exit $EXIT_FAILURE | ||
| 3246 | ;; | ||
| 3247 | esac | ||
| 3248 | |||
| 3249 | if test "$age" -gt "$current"; then | ||
| 3250 | $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 | ||
| 3251 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | ||
| 3252 | exit $EXIT_FAILURE | ||
| 3253 | fi | ||
| 3254 | |||
| 3255 | # Calculate the version variables. | ||
| 3256 | major= | ||
| 3257 | versuffix= | ||
| 3258 | verstring= | ||
| 3259 | case $version_type in | ||
| 3260 | none) ;; | ||
| 3261 | |||
| 3262 | darwin) | ||
| 3263 | # Like Linux, but with the current version available in | ||
| 3264 | # verstring for coding it into the library header | ||
| 3265 | major=.`expr $current - $age` | ||
| 3266 | versuffix="$major.$age.$revision" | ||
| 3267 | # Darwin ld doesn't like 0 for these options... | ||
| 3268 | minor_current=`expr $current + 1` | ||
| 3269 | verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" | ||
| 3270 | ;; | ||
| 3271 | |||
| 3272 | freebsd-aout) | ||
| 3273 | major=".$current" | ||
| 3274 | versuffix=".$current.$revision"; | ||
| 3275 | ;; | ||
| 3276 | |||
| 3277 | freebsd-elf) | ||
| 3278 | major=".$current" | ||
| 3279 | versuffix=".$current"; | ||
| 3280 | ;; | ||
| 3281 | |||
| 3282 | irix | nonstopux) | ||
| 3283 | major=`expr $current - $age + 1` | ||
| 3284 | |||
| 3285 | case $version_type in | ||
| 3286 | nonstopux) verstring_prefix=nonstopux ;; | ||
| 3287 | *) verstring_prefix=sgi ;; | ||
| 3288 | esac | ||
| 3289 | verstring="$verstring_prefix$major.$revision" | ||
| 3290 | |||
| 3291 | # Add in all the interfaces that we are compatible with. | ||
| 3292 | loop=$revision | ||
| 3293 | while test "$loop" -ne 0; do | ||
| 3294 | iface=`expr $revision - $loop` | ||
| 3295 | loop=`expr $loop - 1` | ||
| 3296 | verstring="$verstring_prefix$major.$iface:$verstring" | ||
| 3297 | done | ||
| 3298 | |||
| 3299 | # Before this point, $major must not contain `.'. | ||
| 3300 | major=.$major | ||
| 3301 | versuffix="$major.$revision" | ||
| 3302 | ;; | ||
| 3303 | |||
| 3304 | linux) | ||
| 3305 | major=.`expr $current - $age` | ||
| 3306 | versuffix="$major.$age.$revision" | ||
| 3307 | ;; | ||
| 3308 | |||
| 3309 | osf) | ||
| 3310 | major=.`expr $current - $age` | ||
| 3311 | versuffix=".$current.$age.$revision" | ||
| 3312 | verstring="$current.$age.$revision" | ||
| 3313 | |||
| 3314 | # Add in all the interfaces that we are compatible with. | ||
| 3315 | loop=$age | ||
| 3316 | while test "$loop" -ne 0; do | ||
| 3317 | iface=`expr $current - $loop` | ||
| 3318 | loop=`expr $loop - 1` | ||
| 3319 | verstring="$verstring:${iface}.0" | ||
| 3320 | done | ||
| 3321 | |||
| 3322 | # Make executables depend on our current version. | ||
| 3323 | verstring="$verstring:${current}.0" | ||
| 3324 | ;; | ||
| 3325 | |||
| 3326 | sunos) | ||
| 3327 | major=".$current" | ||
| 3328 | versuffix=".$current.$revision" | ||
| 3329 | ;; | ||
| 3330 | |||
| 3331 | windows) | ||
| 3332 | # Use '-' rather than '.', since we only want one | ||
| 3333 | # extension on DOS 8.3 filesystems. | ||
| 3334 | major=`expr $current - $age` | ||
| 3335 | versuffix="-$major" | ||
| 3336 | ;; | ||
| 3337 | |||
| 3338 | *) | ||
| 3339 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 | ||
| 3340 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | ||
| 3341 | exit $EXIT_FAILURE | ||
| 3342 | ;; | ||
| 3343 | esac | ||
| 3344 | |||
| 3345 | # Clear the version info if we defaulted, and they specified a release. | ||
| 3346 | if test -z "$vinfo" && test -n "$release"; then | ||
| 3347 | major= | ||
| 3348 | case $version_type in | ||
| 3349 | darwin) | ||
| 3350 | # we can't check for "0.0" in archive_cmds due to quoting | ||
| 3351 | # problems, so we reset it completely | ||
| 3352 | verstring= | ||
| 3353 | ;; | ||
| 3354 | *) | ||
| 3355 | verstring="0.0" | ||
| 3356 | ;; | ||
| 3357 | esac | ||
| 3358 | if test "$need_version" = no; then | ||
| 3359 | versuffix= | ||
| 3360 | else | ||
| 3361 | versuffix=".0.0" | ||
| 3362 | fi | ||
| 3363 | fi | ||
| 3364 | |||
| 3365 | # Remove version info from name if versioning should be avoided | ||
| 3366 | if test "$avoid_version" = yes && test "$need_version" = no; then | ||
| 3367 | major= | ||
| 3368 | versuffix= | ||
| 3369 | verstring="" | ||
| 3370 | fi | ||
| 3371 | |||
| 3372 | # Check to see if the archive will have undefined symbols. | ||
| 3373 | if test "$allow_undefined" = yes; then | ||
| 3374 | if test "$allow_undefined_flag" = unsupported; then | ||
| 3375 | $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 | ||
| 3376 | build_libtool_libs=no | ||
| 3377 | build_old_libs=yes | ||
| 3378 | fi | ||
| 3379 | else | ||
| 3380 | # Don't allow undefined symbols. | ||
| 3381 | allow_undefined_flag="$no_undefined_flag" | ||
| 3382 | fi | ||
| 3383 | fi | ||
| 3384 | |||
| 3385 | if test "$mode" != relink; then | ||
| 3386 | # Remove our outputs, but don't remove object files since they | ||
| 3387 | # may have been created when compiling PIC objects. | ||
| 3388 | removelist= | ||
| 3389 | tempremovelist=`$echo "$output_objdir/*"` | ||
| 3390 | for p in $tempremovelist; do | ||
| 3391 | case $p in | ||
| 3392 | *.$objext) | ||
| 3393 | ;; | ||
| 3394 | $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) | ||
| 3395 | if test "X$precious_files_regex" != "X"; then | ||
| 3396 | if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 | ||
| 3397 | then | ||
| 3398 | continue | ||
| 3399 | fi | ||
| 3400 | fi | ||
| 3401 | removelist="$removelist $p" | ||
| 3402 | ;; | ||
| 3403 | *) ;; | ||
| 3404 | esac | ||
| 3405 | done | ||
| 3406 | if test -n "$removelist"; then | ||
| 3407 | $show "${rm}r $removelist" | ||
| 3408 | $run ${rm}r $removelist | ||
| 3409 | fi | ||
| 3410 | fi | ||
| 3411 | |||
| 3412 | # Now set the variables for building old libraries. | ||
| 3413 | if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then | ||
| 3414 | oldlibs="$oldlibs $output_objdir/$libname.$libext" | ||
| 3415 | |||
| 3416 | # Transform .lo files to .o files. | ||
| 3417 | oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` | ||
| 3418 | fi | ||
| 3419 | |||
| 3420 | # Eliminate all temporary directories. | ||
| 3421 | for path in $notinst_path; do | ||
| 3422 | lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` | ||
| 3423 | deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` | ||
| 3424 | dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` | ||
| 3425 | done | ||
| 3426 | |||
| 3427 | if test -n "$xrpath"; then | ||
| 3428 | # If the user specified any rpath flags, then add them. | ||
| 3429 | temp_xrpath= | ||
| 3430 | for libdir in $xrpath; do | ||
| 3431 | temp_xrpath="$temp_xrpath -R$libdir" | ||
| 3432 | case "$finalize_rpath " in | ||
| 3433 | *" $libdir "*) ;; | ||
| 3434 | *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
| 3435 | esac | ||
| 3436 | done | ||
| 3437 | if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then | ||
| 3438 | dependency_libs="$temp_xrpath $dependency_libs" | ||
| 3439 | fi | ||
| 3440 | fi | ||
| 3441 | |||
| 3442 | # Make sure dlfiles contains only unique files that won't be dlpreopened | ||
| 3443 | old_dlfiles="$dlfiles" | ||
| 3444 | dlfiles= | ||
| 3445 | for lib in $old_dlfiles; do | ||
| 3446 | case " $dlprefiles $dlfiles " in | ||
| 3447 | *" $lib "*) ;; | ||
| 3448 | *) dlfiles="$dlfiles $lib" ;; | ||
| 3449 | esac | ||
| 3450 | done | ||
| 3451 | |||
| 3452 | # Make sure dlprefiles contains only unique files | ||
| 3453 | old_dlprefiles="$dlprefiles" | ||
| 3454 | dlprefiles= | ||
| 3455 | for lib in $old_dlprefiles; do | ||
| 3456 | case "$dlprefiles " in | ||
| 3457 | *" $lib "*) ;; | ||
| 3458 | *) dlprefiles="$dlprefiles $lib" ;; | ||
| 3459 | esac | ||
| 3460 | done | ||
| 3461 | |||
| 3462 | if test "$build_libtool_libs" = yes; then | ||
| 3463 | if test -n "$rpath"; then | ||
| 3464 | case $host in | ||
| 3465 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) | ||
| 3466 | # these systems don't actually have a c library (as such)! | ||
| 3467 | ;; | ||
| 3468 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
| 3469 | # Rhapsody C library is in the System framework | ||
| 3470 | deplibs="$deplibs -framework System" | ||
| 3471 | ;; | ||
| 3472 | *-*-netbsd*) | ||
| 3473 | # Don't link with libc until the a.out ld.so is fixed. | ||
| 3474 | ;; | ||
| 3475 | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) | ||
| 3476 | # Do not include libc due to us having libc/libc_r. | ||
| 3477 | ;; | ||
| 3478 | *-*-sco3.2v5* | *-*-sco5v6*) | ||
| 3479 | # Causes problems with __ctype | ||
| 3480 | ;; | ||
| 3481 | *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) | ||
| 3482 | # Compiler inserts libc in the correct place for threads to work | ||
| 3483 | ;; | ||
| 3484 | *) | ||
| 3485 | # Add libc to deplibs on all other systems if necessary. | ||
| 3486 | if test "$build_libtool_need_lc" = "yes"; then | ||
| 3487 | deplibs="$deplibs -lc" | ||
| 3488 | fi | ||
| 3489 | ;; | ||
| 3490 | esac | ||
| 3491 | fi | ||
| 3492 | |||
| 3493 | # Transform deplibs into only deplibs that can be linked in shared. | ||
| 3494 | name_save=$name | ||
| 3495 | libname_save=$libname | ||
| 3496 | release_save=$release | ||
| 3497 | versuffix_save=$versuffix | ||
| 3498 | major_save=$major | ||
| 3499 | # I'm not sure if I'm treating the release correctly. I think | ||
| 3500 | # release should show up in the -l (ie -lgmp5) so we don't want to | ||
| 3501 | # add it in twice. Is that correct? | ||
| 3502 | release="" | ||
| 3503 | versuffix="" | ||
| 3504 | major="" | ||
| 3505 | newdeplibs= | ||
| 3506 | droppeddeps=no | ||
| 3507 | case $deplibs_check_method in | ||
| 3508 | pass_all) | ||
| 3509 | # Don't check for shared/static. Everything works. | ||
| 3510 | # This might be a little naive. We might want to check | ||
| 3511 | # whether the library exists or not. But this is on | ||
| 3512 | # osf3 & osf4 and I'm not really sure... Just | ||
| 3513 | # implementing what was already the behavior. | ||
| 3514 | newdeplibs=$deplibs | ||
| 3515 | ;; | ||
| 3516 | test_compile) | ||
| 3517 | # This code stresses the "libraries are programs" paradigm to its | ||
| 3518 | # limits. Maybe even breaks it. We compile a program, linking it | ||
| 3519 | # against the deplibs as a proxy for the library. Then we can check | ||
| 3520 | # whether they linked in statically or dynamically with ldd. | ||
| 3521 | $rm conftest.c | ||
| 3522 | cat > conftest.c <<EOF | ||
| 3523 | int main() { return 0; } | ||
| 3524 | EOF | ||
| 3525 | $rm conftest | ||
| 3526 | $LTCC $LTCFLAGS -o conftest conftest.c $deplibs | ||
| 3527 | if test "$?" -eq 0 ; then | ||
| 3528 | ldd_output=`ldd conftest` | ||
| 3529 | for i in $deplibs; do | ||
| 3530 | name=`expr $i : '-l\(.*\)'` | ||
| 3531 | # If $name is empty we are operating on a -L argument. | ||
| 3532 | if test "$name" != "" && test "$name" -ne "0"; then | ||
| 3533 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
| 3534 | case " $predeps $postdeps " in | ||
| 3535 | *" $i "*) | ||
| 3536 | newdeplibs="$newdeplibs $i" | ||
| 3537 | i="" | ||
| 3538 | ;; | ||
| 3539 | esac | ||
| 3540 | fi | ||
| 3541 | if test -n "$i" ; then | ||
| 3542 | libname=`eval \\$echo \"$libname_spec\"` | ||
| 3543 | deplib_matches=`eval \\$echo \"$library_names_spec\"` | ||
| 3544 | set dummy $deplib_matches | ||
| 3545 | deplib_match=$2 | ||
| 3546 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | ||
| 3547 | newdeplibs="$newdeplibs $i" | ||
| 3548 | else | ||
| 3549 | droppeddeps=yes | ||
| 3550 | $echo | ||
| 3551 | $echo "*** Warning: dynamic linker does not accept needed library $i." | ||
| 3552 | $echo "*** I have the capability to make that library automatically link in when" | ||
| 3553 | $echo "*** you link to this library. But I can only do this if you have a" | ||
| 3554 | $echo "*** shared version of the library, which I believe you do not have" | ||
| 3555 | $echo "*** because a test_compile did reveal that the linker did not use it for" | ||
| 3556 | $echo "*** its dynamic dependency list that programs get resolved with at runtime." | ||
| 3557 | fi | ||
| 3558 | fi | ||
| 3559 | else | ||
| 3560 | newdeplibs="$newdeplibs $i" | ||
| 3561 | fi | ||
| 3562 | done | ||
| 3563 | else | ||
| 3564 | # Error occurred in the first compile. Let's try to salvage | ||
| 3565 | # the situation: Compile a separate program for each library. | ||
| 3566 | for i in $deplibs; do | ||
| 3567 | name=`expr $i : '-l\(.*\)'` | ||
| 3568 | # If $name is empty we are operating on a -L argument. | ||
| 3569 | if test "$name" != "" && test "$name" != "0"; then | ||
| 3570 | $rm conftest | ||
| 3571 | $LTCC $LTCFLAGS -o conftest conftest.c $i | ||
| 3572 | # Did it work? | ||
| 3573 | if test "$?" -eq 0 ; then | ||
| 3574 | ldd_output=`ldd conftest` | ||
| 3575 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
| 3576 | case " $predeps $postdeps " in | ||
| 3577 | *" $i "*) | ||
| 3578 | newdeplibs="$newdeplibs $i" | ||
| 3579 | i="" | ||
| 3580 | ;; | ||
| 3581 | esac | ||
| 3582 | fi | ||
| 3583 | if test -n "$i" ; then | ||
| 3584 | libname=`eval \\$echo \"$libname_spec\"` | ||
| 3585 | deplib_matches=`eval \\$echo \"$library_names_spec\"` | ||
| 3586 | set dummy $deplib_matches | ||
| 3587 | deplib_match=$2 | ||
| 3588 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | ||
| 3589 | newdeplibs="$newdeplibs $i" | ||
| 3590 | else | ||
| 3591 | droppeddeps=yes | ||
| 3592 | $echo | ||
| 3593 | $echo "*** Warning: dynamic linker does not accept needed library $i." | ||
| 3594 | $echo "*** I have the capability to make that library automatically link in when" | ||
| 3595 | $echo "*** you link to this library. But I can only do this if you have a" | ||
| 3596 | $echo "*** shared version of the library, which you do not appear to have" | ||
| 3597 | $echo "*** because a test_compile did reveal that the linker did not use this one" | ||
| 3598 | $echo "*** as a dynamic dependency that programs can get resolved with at runtime." | ||
| 3599 | fi | ||
| 3600 | fi | ||
| 3601 | else | ||
| 3602 | droppeddeps=yes | ||
| 3603 | $echo | ||
| 3604 | $echo "*** Warning! Library $i is needed by this library but I was not able to" | ||
| 3605 | $echo "*** make it link in! You will probably need to install it or some" | ||
| 3606 | $echo "*** library that it depends on before this library will be fully" | ||
| 3607 | $echo "*** functional. Installing it before continuing would be even better." | ||
| 3608 | fi | ||
| 3609 | else | ||
| 3610 | newdeplibs="$newdeplibs $i" | ||
| 3611 | fi | ||
| 3612 | done | ||
| 3613 | fi | ||
| 3614 | ;; | ||
| 3615 | file_magic*) | ||
| 3616 | set dummy $deplibs_check_method | ||
| 3617 | file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` | ||
| 3618 | for a_deplib in $deplibs; do | ||
| 3619 | name=`expr $a_deplib : '-l\(.*\)'` | ||
| 3620 | # If $name is empty we are operating on a -L argument. | ||
| 3621 | if test "$name" != "" && test "$name" != "0"; then | ||
| 3622 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
| 3623 | case " $predeps $postdeps " in | ||
| 3624 | *" $a_deplib "*) | ||
| 3625 | newdeplibs="$newdeplibs $a_deplib" | ||
| 3626 | a_deplib="" | ||
| 3627 | ;; | ||
| 3628 | esac | ||
| 3629 | fi | ||
| 3630 | if test -n "$a_deplib" ; then | ||
| 3631 | libname=`eval \\$echo \"$libname_spec\"` | ||
| 3632 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
| 3633 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` | ||
| 3634 | for potent_lib in $potential_libs; do | ||
| 3635 | # Follow soft links. | ||
| 3636 | if ls -lLd "$potent_lib" 2>/dev/null \ | ||
| 3637 | | grep " -> " >/dev/null; then | ||
| 3638 | continue | ||
| 3639 | fi | ||
| 3640 | # The statement above tries to avoid entering an | ||
| 3641 | # endless loop below, in case of cyclic links. | ||
| 3642 | # We might still enter an endless loop, since a link | ||
| 3643 | # loop can be closed while we follow links, | ||
| 3644 | # but so what? | ||
| 3645 | potlib="$potent_lib" | ||
| 3646 | while test -h "$potlib" 2>/dev/null; do | ||
| 3647 | potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` | ||
| 3648 | case $potliblink in | ||
| 3649 | [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; | ||
| 3650 | *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; | ||
| 3651 | esac | ||
| 3652 | done | ||
| 3653 | if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ||
| 3654 | | ${SED} 10q \ | ||
| 3655 | | $EGREP "$file_magic_regex" > /dev/null; then | ||
| 3656 | newdeplibs="$newdeplibs $a_deplib" | ||
| 3657 | a_deplib="" | ||
| 3658 | break 2 | ||
| 3659 | fi | ||
| 3660 | done | ||
| 3661 | done | ||
| 3662 | fi | ||
| 3663 | if test -n "$a_deplib" ; then | ||
| 3664 | droppeddeps=yes | ||
| 3665 | $echo | ||
| 3666 | $echo "*** Warning: linker path does not have real file for library $a_deplib." | ||
| 3667 | $echo "*** I have the capability to make that library automatically link in when" | ||
| 3668 | $echo "*** you link to this library. But I can only do this if you have a" | ||
| 3669 | $echo "*** shared version of the library, which you do not appear to have" | ||
| 3670 | $echo "*** because I did check the linker path looking for a file starting" | ||
| 3671 | if test -z "$potlib" ; then | ||
| 3672 | $echo "*** with $libname but no candidates were found. (...for file magic test)" | ||
| 3673 | else | ||
| 3674 | $echo "*** with $libname and none of the candidates passed a file format test" | ||
| 3675 | $echo "*** using a file magic. Last file checked: $potlib" | ||
| 3676 | fi | ||
| 3677 | fi | ||
| 3678 | else | ||
| 3679 | # Add a -L argument. | ||
| 3680 | newdeplibs="$newdeplibs $a_deplib" | ||
| 3681 | fi | ||
| 3682 | done # Gone through all deplibs. | ||
| 3683 | ;; | ||
| 3684 | match_pattern*) | ||
| 3685 | set dummy $deplibs_check_method | ||
| 3686 | match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` | ||
| 3687 | for a_deplib in $deplibs; do | ||
| 3688 | name=`expr $a_deplib : '-l\(.*\)'` | ||
| 3689 | # If $name is empty we are operating on a -L argument. | ||
| 3690 | if test -n "$name" && test "$name" != "0"; then | ||
| 3691 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
| 3692 | case " $predeps $postdeps " in | ||
| 3693 | *" $a_deplib "*) | ||
| 3694 | newdeplibs="$newdeplibs $a_deplib" | ||
| 3695 | a_deplib="" | ||
| 3696 | ;; | ||
| 3697 | esac | ||
| 3698 | fi | ||
| 3699 | if test -n "$a_deplib" ; then | ||
| 3700 | libname=`eval \\$echo \"$libname_spec\"` | ||
| 3701 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
| 3702 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` | ||
| 3703 | for potent_lib in $potential_libs; do | ||
| 3704 | potlib="$potent_lib" # see symlink-check above in file_magic test | ||
| 3705 | if eval $echo \"$potent_lib\" 2>/dev/null \ | ||
| 3706 | | ${SED} 10q \ | ||
| 3707 | | $EGREP "$match_pattern_regex" > /dev/null; then | ||
| 3708 | newdeplibs="$newdeplibs $a_deplib" | ||
| 3709 | a_deplib="" | ||
| 3710 | break 2 | ||
| 3711 | fi | ||
| 3712 | done | ||
| 3713 | done | ||
| 3714 | fi | ||
| 3715 | if test -n "$a_deplib" ; then | ||
| 3716 | droppeddeps=yes | ||
| 3717 | $echo | ||
| 3718 | $echo "*** Warning: linker path does not have real file for library $a_deplib." | ||
| 3719 | $echo "*** I have the capability to make that library automatically link in when" | ||
| 3720 | $echo "*** you link to this library. But I can only do this if you have a" | ||
| 3721 | $echo "*** shared version of the library, which you do not appear to have" | ||
| 3722 | $echo "*** because I did check the linker path looking for a file starting" | ||
| 3723 | if test -z "$potlib" ; then | ||
| 3724 | $echo "*** with $libname but no candidates were found. (...for regex pattern test)" | ||
| 3725 | else | ||
| 3726 | $echo "*** with $libname and none of the candidates passed a file format test" | ||
| 3727 | $echo "*** using a regex pattern. Last file checked: $potlib" | ||
| 3728 | fi | ||
| 3729 | fi | ||
| 3730 | else | ||
| 3731 | # Add a -L argument. | ||
| 3732 | newdeplibs="$newdeplibs $a_deplib" | ||
| 3733 | fi | ||
| 3734 | done # Gone through all deplibs. | ||
| 3735 | ;; | ||
| 3736 | none | unknown | *) | ||
| 3737 | newdeplibs="" | ||
| 3738 | tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ | ||
| 3739 | -e 's/ -[LR][^ ]*//g'` | ||
| 3740 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
| 3741 | for i in $predeps $postdeps ; do | ||
| 3742 | # can't use Xsed below, because $i might contain '/' | ||
| 3743 | tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` | ||
| 3744 | done | ||
| 3745 | fi | ||
| 3746 | if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | ||
| 3747 | | grep . >/dev/null; then | ||
| 3748 | $echo | ||
| 3749 | if test "X$deplibs_check_method" = "Xnone"; then | ||
| 3750 | $echo "*** Warning: inter-library dependencies are not supported in this platform." | ||
| 3751 | else | ||
| 3752 | $echo "*** Warning: inter-library dependencies are not known to be supported." | ||
| 3753 | fi | ||
| 3754 | $echo "*** All declared inter-library dependencies are being dropped." | ||
| 3755 | droppeddeps=yes | ||
| 3756 | fi | ||
| 3757 | ;; | ||
| 3758 | esac | ||
| 3759 | versuffix=$versuffix_save | ||
| 3760 | major=$major_save | ||
| 3761 | release=$release_save | ||
| 3762 | libname=$libname_save | ||
| 3763 | name=$name_save | ||
| 3764 | |||
| 3765 | case $host in | ||
| 3766 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
| 3767 | # On Rhapsody replace the C library is the System framework | ||
| 3768 | newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` | ||
| 3769 | ;; | ||
| 3770 | esac | ||
| 3771 | |||
| 3772 | if test "$droppeddeps" = yes; then | ||
| 3773 | if test "$module" = yes; then | ||
| 3774 | $echo | ||
| 3775 | $echo "*** Warning: libtool could not satisfy all declared inter-library" | ||
| 3776 | $echo "*** dependencies of module $libname. Therefore, libtool will create" | ||
| 3777 | $echo "*** a static module, that should work as long as the dlopening" | ||
| 3778 | $echo "*** application is linked with the -dlopen flag." | ||
| 3779 | if test -z "$global_symbol_pipe"; then | ||
| 3780 | $echo | ||
| 3781 | $echo "*** However, this would only work if libtool was able to extract symbol" | ||
| 3782 | $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" | ||
| 3783 | $echo "*** not find such a program. So, this module is probably useless." | ||
| 3784 | $echo "*** \`nm' from GNU binutils and a full rebuild may help." | ||
| 3785 | fi | ||
| 3786 | if test "$build_old_libs" = no; then | ||
| 3787 | oldlibs="$output_objdir/$libname.$libext" | ||
| 3788 | build_libtool_libs=module | ||
| 3789 | build_old_libs=yes | ||
| 3790 | else | ||
| 3791 | build_libtool_libs=no | ||
| 3792 | fi | ||
| 3793 | else | ||
| 3794 | $echo "*** The inter-library dependencies that have been dropped here will be" | ||
| 3795 | $echo "*** automatically added whenever a program is linked with this library" | ||
| 3796 | $echo "*** or is declared to -dlopen it." | ||
| 3797 | |||
| 3798 | if test "$allow_undefined" = no; then | ||
| 3799 | $echo | ||
| 3800 | $echo "*** Since this library must not contain undefined symbols," | ||
| 3801 | $echo "*** because either the platform does not support them or" | ||
| 3802 | $echo "*** it was explicitly requested with -no-undefined," | ||
| 3803 | $echo "*** libtool will only create a static version of it." | ||
| 3804 | if test "$build_old_libs" = no; then | ||
| 3805 | oldlibs="$output_objdir/$libname.$libext" | ||
| 3806 | build_libtool_libs=module | ||
| 3807 | build_old_libs=yes | ||
| 3808 | else | ||
| 3809 | build_libtool_libs=no | ||
| 3810 | fi | ||
| 3811 | fi | ||
| 3812 | fi | ||
| 3813 | fi | ||
| 3814 | # Done checking deplibs! | ||
| 3815 | deplibs=$newdeplibs | ||
| 3816 | fi | ||
| 3817 | |||
| 3818 | |||
| 3819 | # move library search paths that coincide with paths to not yet | ||
| 3820 | # installed libraries to the beginning of the library search list | ||
| 3821 | new_libs= | ||
| 3822 | for path in $notinst_path; do | ||
| 3823 | case " $new_libs " in | ||
| 3824 | *" -L$path/$objdir "*) ;; | ||
| 3825 | *) | ||
| 3826 | case " $deplibs " in | ||
| 3827 | *" -L$path/$objdir "*) | ||
| 3828 | new_libs="$new_libs -L$path/$objdir" ;; | ||
| 3829 | esac | ||
| 3830 | ;; | ||
| 3831 | esac | ||
| 3832 | done | ||
| 3833 | for deplib in $deplibs; do | ||
| 3834 | case $deplib in | ||
| 3835 | -L*) | ||
| 3836 | case " $new_libs " in | ||
| 3837 | *" $deplib "*) ;; | ||
| 3838 | *) new_libs="$new_libs $deplib" ;; | ||
| 3839 | esac | ||
| 3840 | ;; | ||
| 3841 | *) new_libs="$new_libs $deplib" ;; | ||
| 3842 | esac | ||
| 3843 | done | ||
| 3844 | deplibs="$new_libs" | ||
| 3845 | |||
| 3846 | |||
| 3847 | # All the library-specific variables (install_libdir is set above). | ||
| 3848 | library_names= | ||
| 3849 | old_library= | ||
| 3850 | dlname= | ||
| 3851 | |||
| 3852 | # Test again, we may have decided not to build it any more | ||
| 3853 | if test "$build_libtool_libs" = yes; then | ||
| 3854 | if test "$hardcode_into_libs" = yes; then | ||
| 3855 | # Hardcode the library paths | ||
| 3856 | hardcode_libdirs= | ||
| 3857 | dep_rpath= | ||
| 3858 | rpath="$finalize_rpath" | ||
| 3859 | test "$mode" != relink && rpath="$compile_rpath$rpath" | ||
| 3860 | for libdir in $rpath; do | ||
| 3861 | if test -n "$hardcode_libdir_flag_spec"; then | ||
| 3862 | if test -n "$hardcode_libdir_separator"; then | ||
| 3863 | if test -z "$hardcode_libdirs"; then | ||
| 3864 | hardcode_libdirs="$libdir" | ||
| 3865 | else | ||
| 3866 | # Just accumulate the unique libdirs. | ||
| 3867 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in | ||
| 3868 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
| 3869 | ;; | ||
| 3870 | *) | ||
| 3871 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
| 3872 | ;; | ||
| 3873 | esac | ||
| 3874 | fi | ||
| 3875 | else | ||
| 3876 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
| 3877 | dep_rpath="$dep_rpath $flag" | ||
| 3878 | fi | ||
| 3879 | elif test -n "$runpath_var"; then | ||
| 3880 | case "$perm_rpath " in | ||
| 3881 | *" $libdir "*) ;; | ||
| 3882 | *) perm_rpath="$perm_rpath $libdir" ;; | ||
| 3883 | esac | ||
| 3884 | fi | ||
| 3885 | done | ||
| 3886 | # Substitute the hardcoded libdirs into the rpath. | ||
| 3887 | if test -n "$hardcode_libdir_separator" && | ||
| 3888 | test -n "$hardcode_libdirs"; then | ||
| 3889 | libdir="$hardcode_libdirs" | ||
| 3890 | if test -n "$hardcode_libdir_flag_spec_ld"; then | ||
| 3891 | eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" | ||
| 3892 | else | ||
| 3893 | eval dep_rpath=\"$hardcode_libdir_flag_spec\" | ||
| 3894 | fi | ||
| 3895 | fi | ||
| 3896 | if test -n "$runpath_var" && test -n "$perm_rpath"; then | ||
| 3897 | # We should set the runpath_var. | ||
| 3898 | rpath= | ||
| 3899 | for dir in $perm_rpath; do | ||
| 3900 | rpath="$rpath$dir:" | ||
| 3901 | done | ||
| 3902 | eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" | ||
| 3903 | fi | ||
| 3904 | test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" | ||
| 3905 | fi | ||
| 3906 | |||
| 3907 | shlibpath="$finalize_shlibpath" | ||
| 3908 | test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" | ||
| 3909 | if test -n "$shlibpath"; then | ||
| 3910 | eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" | ||
| 3911 | fi | ||
| 3912 | |||
| 3913 | # Get the real and link names of the library. | ||
| 3914 | eval shared_ext=\"$shrext_cmds\" | ||
| 3915 | eval library_names=\"$library_names_spec\" | ||
| 3916 | set dummy $library_names | ||
| 3917 | realname="$2" | ||
| 3918 | shift; shift | ||
| 3919 | |||
| 3920 | if test -n "$soname_spec"; then | ||
| 3921 | eval soname=\"$soname_spec\" | ||
| 3922 | else | ||
| 3923 | soname="$realname" | ||
| 3924 | fi | ||
| 3925 | if test -z "$dlname"; then | ||
| 3926 | dlname=$soname | ||
| 3927 | fi | ||
| 3928 | |||
| 3929 | lib="$output_objdir/$realname" | ||
| 3930 | linknames= | ||
| 3931 | for link | ||
| 3932 | do | ||
| 3933 | linknames="$linknames $link" | ||
| 3934 | done | ||
| 3935 | |||
| 3936 | # Use standard objects if they are pic | ||
| 3937 | test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
| 3938 | |||
| 3939 | # Prepare the list of exported symbols | ||
| 3940 | if test -z "$export_symbols"; then | ||
| 3941 | if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then | ||
| 3942 | $show "generating symbol list for \`$libname.la'" | ||
| 3943 | export_symbols="$output_objdir/$libname.exp" | ||
| 3944 | $run $rm $export_symbols | ||
| 3945 | cmds=$export_symbols_cmds | ||
| 3946 | save_ifs="$IFS"; IFS='~' | ||
| 3947 | for cmd in $cmds; do | ||
| 3948 | IFS="$save_ifs" | ||
| 3949 | eval cmd=\"$cmd\" | ||
| 3950 | if len=`expr "X$cmd" : ".*"` && | ||
| 3951 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then | ||
| 3952 | $show "$cmd" | ||
| 3953 | $run eval "$cmd" || exit $? | ||
| 3954 | skipped_export=false | ||
| 3955 | else | ||
| 3956 | # The command line is too long to execute in one step. | ||
| 3957 | $show "using reloadable object file for export list..." | ||
| 3958 | skipped_export=: | ||
| 3959 | # Break out early, otherwise skipped_export may be | ||
| 3960 | # set to false by a later but shorter cmd. | ||
| 3961 | break | ||
| 3962 | fi | ||
| 3963 | done | ||
| 3964 | IFS="$save_ifs" | ||
| 3965 | if test -n "$export_symbols_regex"; then | ||
| 3966 | $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" | ||
| 3967 | $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' | ||
| 3968 | $show "$mv \"${export_symbols}T\" \"$export_symbols\"" | ||
| 3969 | $run eval '$mv "${export_symbols}T" "$export_symbols"' | ||
| 3970 | fi | ||
| 3971 | fi | ||
| 3972 | fi | ||
| 3973 | |||
| 3974 | if test -n "$export_symbols" && test -n "$include_expsyms"; then | ||
| 3975 | $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' | ||
| 3976 | fi | ||
| 3977 | |||
| 3978 | tmp_deplibs= | ||
| 3979 | for test_deplib in $deplibs; do | ||
| 3980 | case " $convenience " in | ||
| 3981 | *" $test_deplib "*) ;; | ||
| 3982 | *) | ||
| 3983 | tmp_deplibs="$tmp_deplibs $test_deplib" | ||
| 3984 | ;; | ||
| 3985 | esac | ||
| 3986 | done | ||
| 3987 | deplibs="$tmp_deplibs" | ||
| 3988 | |||
| 3989 | if test -n "$convenience"; then | ||
| 3990 | if test -n "$whole_archive_flag_spec"; then | ||
| 3991 | save_libobjs=$libobjs | ||
| 3992 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" | ||
| 3993 | else | ||
| 3994 | gentop="$output_objdir/${outputname}x" | ||
| 3995 | generated="$generated $gentop" | ||
| 3996 | |||
| 3997 | func_extract_archives $gentop $convenience | ||
| 3998 | libobjs="$libobjs $func_extract_archives_result" | ||
| 3999 | fi | ||
| 4000 | fi | ||
| 4001 | |||
| 4002 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then | ||
| 4003 | eval flag=\"$thread_safe_flag_spec\" | ||
| 4004 | linker_flags="$linker_flags $flag" | ||
| 4005 | fi | ||
| 4006 | |||
| 4007 | # Make a backup of the uninstalled library when relinking | ||
| 4008 | if test "$mode" = relink; then | ||
| 4009 | $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? | ||
| 4010 | fi | ||
| 4011 | |||
| 4012 | # Do each of the archive commands. | ||
| 4013 | if test "$module" = yes && test -n "$module_cmds" ; then | ||
| 4014 | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then | ||
| 4015 | eval test_cmds=\"$module_expsym_cmds\" | ||
| 4016 | cmds=$module_expsym_cmds | ||
| 4017 | else | ||
| 4018 | eval test_cmds=\"$module_cmds\" | ||
| 4019 | cmds=$module_cmds | ||
| 4020 | fi | ||
| 4021 | else | ||
| 4022 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then | ||
| 4023 | eval test_cmds=\"$archive_expsym_cmds\" | ||
| 4024 | cmds=$archive_expsym_cmds | ||
| 4025 | else | ||
| 4026 | eval test_cmds=\"$archive_cmds\" | ||
| 4027 | cmds=$archive_cmds | ||
| 4028 | fi | ||
| 4029 | fi | ||
| 4030 | |||
| 4031 | if test "X$skipped_export" != "X:" && | ||
| 4032 | len=`expr "X$test_cmds" : ".*" 2>/dev/null` && | ||
| 4033 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then | ||
| 4034 | : | ||
| 4035 | else | ||
| 4036 | # The command line is too long to link in one step, link piecewise. | ||
| 4037 | $echo "creating reloadable object files..." | ||
| 4038 | |||
| 4039 | # Save the value of $output and $libobjs because we want to | ||
| 4040 | # use them later. If we have whole_archive_flag_spec, we | ||
| 4041 | # want to use save_libobjs as it was before | ||
| 4042 | # whole_archive_flag_spec was expanded, because we can't | ||
| 4043 | # assume the linker understands whole_archive_flag_spec. | ||
| 4044 | # This may have to be revisited, in case too many | ||
| 4045 | # convenience libraries get linked in and end up exceeding | ||
| 4046 | # the spec. | ||
| 4047 | if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then | ||
| 4048 | save_libobjs=$libobjs | ||
| 4049 | fi | ||
| 4050 | save_output=$output | ||
| 4051 | output_la=`$echo "X$output" | $Xsed -e "$basename"` | ||
| 4052 | |||
| 4053 | # Clear the reloadable object creation command queue and | ||
| 4054 | # initialize k to one. | ||
| 4055 | test_cmds= | ||
| 4056 | concat_cmds= | ||
| 4057 | objlist= | ||
| 4058 | delfiles= | ||
| 4059 | last_robj= | ||
| 4060 | k=1 | ||
| 4061 | output=$output_objdir/$output_la-${k}.$objext | ||
| 4062 | # Loop over the list of objects to be linked. | ||
| 4063 | for obj in $save_libobjs | ||
| 4064 | do | ||
| 4065 | eval test_cmds=\"$reload_cmds $objlist $last_robj\" | ||
| 4066 | if test "X$objlist" = X || | ||
| 4067 | { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && | ||
| 4068 | test "$len" -le "$max_cmd_len"; }; then | ||
| 4069 | objlist="$objlist $obj" | ||
| 4070 | else | ||
| 4071 | # The command $test_cmds is almost too long, add a | ||
| 4072 | # command to the queue. | ||
| 4073 | if test "$k" -eq 1 ; then | ||
| 4074 | # The first file doesn't have a previous command to add. | ||
| 4075 | eval concat_cmds=\"$reload_cmds $objlist $last_robj\" | ||
| 4076 | else | ||
| 4077 | # All subsequent reloadable object files will link in | ||
| 4078 | # the last one created. | ||
| 4079 | eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" | ||
| 4080 | fi | ||
| 4081 | last_robj=$output_objdir/$output_la-${k}.$objext | ||
| 4082 | k=`expr $k + 1` | ||
| 4083 | output=$output_objdir/$output_la-${k}.$objext | ||
| 4084 | objlist=$obj | ||
| 4085 | len=1 | ||
| 4086 | fi | ||
| 4087 | done | ||
| 4088 | # Handle the remaining objects by creating one last | ||
| 4089 | # reloadable object file. All subsequent reloadable object | ||
| 4090 | # files will link in the last one created. | ||
| 4091 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ | ||
| 4092 | eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" | ||
| 4093 | |||
| 4094 | if ${skipped_export-false}; then | ||
| 4095 | $show "generating symbol list for \`$libname.la'" | ||
| 4096 | export_symbols="$output_objdir/$libname.exp" | ||
| 4097 | $run $rm $export_symbols | ||
| 4098 | libobjs=$output | ||
| 4099 | # Append the command to create the export file. | ||
| 4100 | eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" | ||
| 4101 | fi | ||
| 4102 | |||
| 4103 | # Set up a command to remove the reloadable object files | ||
| 4104 | # after they are used. | ||
| 4105 | i=0 | ||
| 4106 | while test "$i" -lt "$k" | ||
| 4107 | do | ||
| 4108 | i=`expr $i + 1` | ||
| 4109 | delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" | ||
| 4110 | done | ||
| 4111 | |||
| 4112 | $echo "creating a temporary reloadable object file: $output" | ||
| 4113 | |||
| 4114 | # Loop through the commands generated above and execute them. | ||
| 4115 | save_ifs="$IFS"; IFS='~' | ||
| 4116 | for cmd in $concat_cmds; do | ||
| 4117 | IFS="$save_ifs" | ||
| 4118 | $show "$cmd" | ||
| 4119 | $run eval "$cmd" || exit $? | ||
| 4120 | done | ||
| 4121 | IFS="$save_ifs" | ||
| 4122 | |||
| 4123 | libobjs=$output | ||
| 4124 | # Restore the value of output. | ||
| 4125 | output=$save_output | ||
| 4126 | |||
| 4127 | if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then | ||
| 4128 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" | ||
| 4129 | fi | ||
| 4130 | # Expand the library linking commands again to reset the | ||
| 4131 | # value of $libobjs for piecewise linking. | ||
| 4132 | |||
| 4133 | # Do each of the archive commands. | ||
| 4134 | if test "$module" = yes && test -n "$module_cmds" ; then | ||
| 4135 | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then | ||
| 4136 | cmds=$module_expsym_cmds | ||
| 4137 | else | ||
| 4138 | cmds=$module_cmds | ||
| 4139 | fi | ||
| 4140 | else | ||
| 4141 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then | ||
| 4142 | cmds=$archive_expsym_cmds | ||
| 4143 | else | ||
| 4144 | cmds=$archive_cmds | ||
| 4145 | fi | ||
| 4146 | fi | ||
| 4147 | |||
| 4148 | # Append the command to remove the reloadable object files | ||
| 4149 | # to the just-reset $cmds. | ||
| 4150 | eval cmds=\"\$cmds~\$rm $delfiles\" | ||
| 4151 | fi | ||
| 4152 | save_ifs="$IFS"; IFS='~' | ||
| 4153 | for cmd in $cmds; do | ||
| 4154 | IFS="$save_ifs" | ||
| 4155 | eval cmd=\"$cmd\" | ||
| 4156 | $show "$cmd" | ||
| 4157 | $run eval "$cmd" || { | ||
| 4158 | lt_exit=$? | ||
| 4159 | |||
| 4160 | # Restore the uninstalled library and exit | ||
| 4161 | if test "$mode" = relink; then | ||
| 4162 | $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' | ||
| 4163 | fi | ||
| 4164 | |||
| 4165 | exit $lt_exit | ||
| 4166 | } | ||
| 4167 | done | ||
| 4168 | IFS="$save_ifs" | ||
| 4169 | |||
| 4170 | # Restore the uninstalled library and exit | ||
| 4171 | if test "$mode" = relink; then | ||
| 4172 | $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? | ||
| 4173 | |||
| 4174 | if test -n "$convenience"; then | ||
| 4175 | if test -z "$whole_archive_flag_spec"; then | ||
| 4176 | $show "${rm}r $gentop" | ||
| 4177 | $run ${rm}r "$gentop" | ||
| 4178 | fi | ||
| 4179 | fi | ||
| 4180 | |||
| 4181 | exit $EXIT_SUCCESS | ||
| 4182 | fi | ||
| 4183 | |||
| 4184 | # Create links to the real library. | ||
| 4185 | for linkname in $linknames; do | ||
| 4186 | if test "$realname" != "$linkname"; then | ||
| 4187 | $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" | ||
| 4188 | $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? | ||
| 4189 | fi | ||
| 4190 | done | ||
| 4191 | |||
| 4192 | # If -module or -export-dynamic was specified, set the dlname. | ||
| 4193 | if test "$module" = yes || test "$export_dynamic" = yes; then | ||
| 4194 | # On all known operating systems, these are identical. | ||
| 4195 | dlname="$soname" | ||
| 4196 | fi | ||
| 4197 | fi | ||
| 4198 | ;; | ||
| 4199 | |||
| 4200 | obj) | ||
| 4201 | if test -n "$deplibs"; then | ||
| 4202 | $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 | ||
| 4203 | fi | ||
| 4204 | |||
| 4205 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | ||
| 4206 | $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 | ||
| 4207 | fi | ||
| 4208 | |||
| 4209 | if test -n "$rpath"; then | ||
| 4210 | $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 | ||
| 4211 | fi | ||
| 4212 | |||
| 4213 | if test -n "$xrpath"; then | ||
| 4214 | $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 | ||
| 4215 | fi | ||
| 4216 | |||
| 4217 | if test -n "$vinfo"; then | ||
| 4218 | $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 | ||
| 4219 | fi | ||
| 4220 | |||
| 4221 | if test -n "$release"; then | ||
| 4222 | $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 | ||
| 4223 | fi | ||
| 4224 | |||
| 4225 | case $output in | ||
| 4226 | *.lo) | ||
| 4227 | if test -n "$objs$old_deplibs"; then | ||
| 4228 | $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 | ||
| 4229 | exit $EXIT_FAILURE | ||
| 4230 | fi | ||
| 4231 | libobj="$output" | ||
| 4232 | obj=`$echo "X$output" | $Xsed -e "$lo2o"` | ||
| 4233 | ;; | ||
| 4234 | *) | ||
| 4235 | libobj= | ||
| 4236 | obj="$output" | ||
| 4237 | ;; | ||
| 4238 | esac | ||
| 4239 | |||
| 4240 | # Delete the old objects. | ||
| 4241 | $run $rm $obj $libobj | ||
| 4242 | |||
| 4243 | # Objects from convenience libraries. This assumes | ||
| 4244 | # single-version convenience libraries. Whenever we create | ||
| 4245 | # different ones for PIC/non-PIC, this we'll have to duplicate | ||
| 4246 | # the extraction. | ||
| 4247 | reload_conv_objs= | ||
| 4248 | gentop= | ||
| 4249 | # reload_cmds runs $LD directly, so let us get rid of | ||
| 4250 | # -Wl from whole_archive_flag_spec | ||
| 4251 | wl= | ||
| 4252 | |||
| 4253 | if test -n "$convenience"; then | ||
| 4254 | if test -n "$whole_archive_flag_spec"; then | ||
| 4255 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" | ||
| 4256 | else | ||
| 4257 | gentop="$output_objdir/${obj}x" | ||
| 4258 | generated="$generated $gentop" | ||
| 4259 | |||
| 4260 | func_extract_archives $gentop $convenience | ||
| 4261 | reload_conv_objs="$reload_objs $func_extract_archives_result" | ||
| 4262 | fi | ||
| 4263 | fi | ||
| 4264 | |||
| 4265 | # Create the old-style object. | ||
| 4266 | reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test | ||
| 4267 | |||
| 4268 | output="$obj" | ||
| 4269 | cmds=$reload_cmds | ||
| 4270 | save_ifs="$IFS"; IFS='~' | ||
| 4271 | for cmd in $cmds; do | ||
| 4272 | IFS="$save_ifs" | ||
| 4273 | eval cmd=\"$cmd\" | ||
| 4274 | $show "$cmd" | ||
| 4275 | $run eval "$cmd" || exit $? | ||
| 4276 | done | ||
| 4277 | IFS="$save_ifs" | ||
| 4278 | |||
| 4279 | # Exit if we aren't doing a library object file. | ||
| 4280 | if test -z "$libobj"; then | ||
| 4281 | if test -n "$gentop"; then | ||
| 4282 | $show "${rm}r $gentop" | ||
| 4283 | $run ${rm}r $gentop | ||
| 4284 | fi | ||
| 4285 | |||
| 4286 | exit $EXIT_SUCCESS | ||
| 4287 | fi | ||
| 4288 | |||
| 4289 | if test "$build_libtool_libs" != yes; then | ||
| 4290 | if test -n "$gentop"; then | ||
| 4291 | $show "${rm}r $gentop" | ||
| 4292 | $run ${rm}r $gentop | ||
| 4293 | fi | ||
| 4294 | |||
| 4295 | # Create an invalid libtool object if no PIC, so that we don't | ||
| 4296 | # accidentally link it into a program. | ||
| 4297 | # $show "echo timestamp > $libobj" | ||
| 4298 | # $run eval "echo timestamp > $libobj" || exit $? | ||
| 4299 | exit $EXIT_SUCCESS | ||
| 4300 | fi | ||
| 4301 | |||
| 4302 | if test -n "$pic_flag" || test "$pic_mode" != default; then | ||
| 4303 | # Only do commands if we really have different PIC objects. | ||
| 4304 | reload_objs="$libobjs $reload_conv_objs" | ||
| 4305 | output="$libobj" | ||
| 4306 | cmds=$reload_cmds | ||
| 4307 | save_ifs="$IFS"; IFS='~' | ||
| 4308 | for cmd in $cmds; do | ||
| 4309 | IFS="$save_ifs" | ||
| 4310 | eval cmd=\"$cmd\" | ||
| 4311 | $show "$cmd" | ||
| 4312 | $run eval "$cmd" || exit $? | ||
| 4313 | done | ||
| 4314 | IFS="$save_ifs" | ||
| 4315 | fi | ||
| 4316 | |||
| 4317 | if test -n "$gentop"; then | ||
| 4318 | $show "${rm}r $gentop" | ||
| 4319 | $run ${rm}r $gentop | ||
| 4320 | fi | ||
| 4321 | |||
| 4322 | exit $EXIT_SUCCESS | ||
| 4323 | ;; | ||
| 4324 | |||
| 4325 | prog) | ||
| 4326 | case $host in | ||
| 4327 | *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; | ||
| 4328 | esac | ||
| 4329 | if test -n "$vinfo"; then | ||
| 4330 | $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 | ||
| 4331 | fi | ||
| 4332 | |||
| 4333 | if test -n "$release"; then | ||
| 4334 | $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 | ||
| 4335 | fi | ||
| 4336 | |||
| 4337 | if test "$preload" = yes; then | ||
| 4338 | if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && | ||
| 4339 | test "$dlopen_self_static" = unknown; then | ||
| 4340 | $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." | ||
| 4341 | fi | ||
| 4342 | fi | ||
| 4343 | |||
| 4344 | case $host in | ||
| 4345 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
| 4346 | # On Rhapsody replace the C library is the System framework | ||
| 4347 | compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` | ||
| 4348 | finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` | ||
| 4349 | ;; | ||
| 4350 | esac | ||
| 4351 | |||
| 4352 | case $host in | ||
| 4353 | *darwin*) | ||
| 4354 | # Don't allow lazy linking, it breaks C++ global constructors | ||
| 4355 | if test "$tagname" = CXX ; then | ||
| 4356 | compile_command="$compile_command ${wl}-bind_at_load" | ||
| 4357 | finalize_command="$finalize_command ${wl}-bind_at_load" | ||
| 4358 | fi | ||
| 4359 | ;; | ||
| 4360 | esac | ||
| 4361 | |||
| 4362 | |||
| 4363 | # move library search paths that coincide with paths to not yet | ||
| 4364 | # installed libraries to the beginning of the library search list | ||
| 4365 | new_libs= | ||
| 4366 | for path in $notinst_path; do | ||
| 4367 | case " $new_libs " in | ||
| 4368 | *" -L$path/$objdir "*) ;; | ||
| 4369 | *) | ||
| 4370 | case " $compile_deplibs " in | ||
| 4371 | *" -L$path/$objdir "*) | ||
| 4372 | new_libs="$new_libs -L$path/$objdir" ;; | ||
| 4373 | esac | ||
| 4374 | ;; | ||
| 4375 | esac | ||
| 4376 | done | ||
| 4377 | for deplib in $compile_deplibs; do | ||
| 4378 | case $deplib in | ||
| 4379 | -L*) | ||
| 4380 | case " $new_libs " in | ||
| 4381 | *" $deplib "*) ;; | ||
| 4382 | *) new_libs="$new_libs $deplib" ;; | ||
| 4383 | esac | ||
| 4384 | ;; | ||
| 4385 | *) new_libs="$new_libs $deplib" ;; | ||
| 4386 | esac | ||
| 4387 | done | ||
| 4388 | compile_deplibs="$new_libs" | ||
| 4389 | |||
| 4390 | |||
| 4391 | compile_command="$compile_command $compile_deplibs" | ||
| 4392 | finalize_command="$finalize_command $finalize_deplibs" | ||
| 4393 | |||
| 4394 | if test -n "$rpath$xrpath"; then | ||
| 4395 | # If the user specified any rpath flags, then add them. | ||
| 4396 | for libdir in $rpath $xrpath; do | ||
| 4397 | # This is the magic to use -rpath. | ||
| 4398 | case "$finalize_rpath " in | ||
| 4399 | *" $libdir "*) ;; | ||
| 4400 | *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
| 4401 | esac | ||
| 4402 | done | ||
| 4403 | fi | ||
| 4404 | |||
| 4405 | # Now hardcode the library paths | ||
| 4406 | rpath= | ||
| 4407 | hardcode_libdirs= | ||
| 4408 | for libdir in $compile_rpath $finalize_rpath; do | ||
| 4409 | if test -n "$hardcode_libdir_flag_spec"; then | ||
| 4410 | if test -n "$hardcode_libdir_separator"; then | ||
| 4411 | if test -z "$hardcode_libdirs"; then | ||
| 4412 | hardcode_libdirs="$libdir" | ||
| 4413 | else | ||
| 4414 | # Just accumulate the unique libdirs. | ||
| 4415 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in | ||
| 4416 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
| 4417 | ;; | ||
| 4418 | *) | ||
| 4419 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
| 4420 | ;; | ||
| 4421 | esac | ||
| 4422 | fi | ||
| 4423 | else | ||
| 4424 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
| 4425 | rpath="$rpath $flag" | ||
| 4426 | fi | ||
| 4427 | elif test -n "$runpath_var"; then | ||
| 4428 | case "$perm_rpath " in | ||
| 4429 | *" $libdir "*) ;; | ||
| 4430 | *) perm_rpath="$perm_rpath $libdir" ;; | ||
| 4431 | esac | ||
| 4432 | fi | ||
| 4433 | case $host in | ||
| 4434 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) | ||
| 4435 | testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` | ||
| 4436 | case :$dllsearchpath: in | ||
| 4437 | *":$libdir:"*) ;; | ||
| 4438 | *) dllsearchpath="$dllsearchpath:$libdir";; | ||
| 4439 | esac | ||
| 4440 | case :$dllsearchpath: in | ||
| 4441 | *":$testbindir:"*) ;; | ||
| 4442 | *) dllsearchpath="$dllsearchpath:$testbindir";; | ||
| 4443 | esac | ||
| 4444 | ;; | ||
| 4445 | esac | ||
| 4446 | done | ||
| 4447 | # Substitute the hardcoded libdirs into the rpath. | ||
| 4448 | if test -n "$hardcode_libdir_separator" && | ||
| 4449 | test -n "$hardcode_libdirs"; then | ||
| 4450 | libdir="$hardcode_libdirs" | ||
| 4451 | eval rpath=\" $hardcode_libdir_flag_spec\" | ||
| 4452 | fi | ||
| 4453 | compile_rpath="$rpath" | ||
| 4454 | |||
| 4455 | rpath= | ||
| 4456 | hardcode_libdirs= | ||
| 4457 | for libdir in $finalize_rpath; do | ||
| 4458 | if test -n "$hardcode_libdir_flag_spec"; then | ||
| 4459 | if test -n "$hardcode_libdir_separator"; then | ||
| 4460 | if test -z "$hardcode_libdirs"; then | ||
| 4461 | hardcode_libdirs="$libdir" | ||
| 4462 | else | ||
| 4463 | # Just accumulate the unique libdirs. | ||
| 4464 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in | ||
| 4465 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
| 4466 | ;; | ||
| 4467 | *) | ||
| 4468 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
| 4469 | ;; | ||
| 4470 | esac | ||
| 4471 | fi | ||
| 4472 | else | ||
| 4473 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
| 4474 | rpath="$rpath $flag" | ||
| 4475 | fi | ||
| 4476 | elif test -n "$runpath_var"; then | ||
| 4477 | case "$finalize_perm_rpath " in | ||
| 4478 | *" $libdir "*) ;; | ||
| 4479 | *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; | ||
| 4480 | esac | ||
| 4481 | fi | ||
| 4482 | done | ||
| 4483 | # Substitute the hardcoded libdirs into the rpath. | ||
| 4484 | if test -n "$hardcode_libdir_separator" && | ||
| 4485 | test -n "$hardcode_libdirs"; then | ||
| 4486 | libdir="$hardcode_libdirs" | ||
| 4487 | eval rpath=\" $hardcode_libdir_flag_spec\" | ||
| 4488 | fi | ||
| 4489 | finalize_rpath="$rpath" | ||
| 4490 | |||
| 4491 | if test -n "$libobjs" && test "$build_old_libs" = yes; then | ||
| 4492 | # Transform all the library objects into standard objects. | ||
| 4493 | compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
| 4494 | finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
| 4495 | fi | ||
| 4496 | |||
| 4497 | dlsyms= | ||
| 4498 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | ||
| 4499 | if test -n "$NM" && test -n "$global_symbol_pipe"; then | ||
| 4500 | dlsyms="${outputname}S.c" | ||
| 4501 | else | ||
| 4502 | $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 | ||
| 4503 | fi | ||
| 4504 | fi | ||
| 4505 | |||
| 4506 | if test -n "$dlsyms"; then | ||
| 4507 | case $dlsyms in | ||
| 4508 | "") ;; | ||
| 4509 | *.c) | ||
| 4510 | # Discover the nlist of each of the dlfiles. | ||
| 4511 | nlist="$output_objdir/${outputname}.nm" | ||
| 4512 | |||
| 4513 | $show "$rm $nlist ${nlist}S ${nlist}T" | ||
| 4514 | $run $rm "$nlist" "${nlist}S" "${nlist}T" | ||
| 4515 | |||
| 4516 | # Parse the name list into a source file. | ||
| 4517 | $show "creating $output_objdir/$dlsyms" | ||
| 4518 | |||
| 4519 | test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ | ||
| 4520 | /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ | ||
| 4521 | /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ | ||
| 4522 | |||
| 4523 | #ifdef __cplusplus | ||
| 4524 | extern \"C\" { | ||
| 4525 | #endif | ||
| 4526 | |||
| 4527 | /* Prevent the only kind of declaration conflicts we can make. */ | ||
| 4528 | #define lt_preloaded_symbols some_other_symbol | ||
| 4529 | |||
| 4530 | /* External symbol declarations for the compiler. */\ | ||
| 4531 | " | ||
| 4532 | |||
| 4533 | if test "$dlself" = yes; then | ||
| 4534 | $show "generating symbol list for \`$output'" | ||
| 4535 | |||
| 4536 | test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" | ||
| 4537 | |||
| 4538 | # Add our own program objects to the symbol list. | ||
| 4539 | progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | ||
| 4540 | for arg in $progfiles; do | ||
| 4541 | $show "extracting global C symbols from \`$arg'" | ||
| 4542 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" | ||
| 4543 | done | ||
| 4544 | |||
| 4545 | if test -n "$exclude_expsyms"; then | ||
| 4546 | $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' | ||
| 4547 | $run eval '$mv "$nlist"T "$nlist"' | ||
| 4548 | fi | ||
| 4549 | |||
| 4550 | if test -n "$export_symbols_regex"; then | ||
| 4551 | $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' | ||
| 4552 | $run eval '$mv "$nlist"T "$nlist"' | ||
| 4553 | fi | ||
| 4554 | |||
| 4555 | # Prepare the list of exported symbols | ||
| 4556 | if test -z "$export_symbols"; then | ||
| 4557 | export_symbols="$output_objdir/$outputname.exp" | ||
| 4558 | $run $rm $export_symbols | ||
| 4559 | $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' | ||
| 4560 | case $host in | ||
| 4561 | *cygwin* | *mingw* ) | ||
| 4562 | $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' | ||
| 4563 | $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' | ||
| 4564 | ;; | ||
| 4565 | esac | ||
| 4566 | else | ||
| 4567 | $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' | ||
| 4568 | $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' | ||
| 4569 | $run eval 'mv "$nlist"T "$nlist"' | ||
| 4570 | case $host in | ||
| 4571 | *cygwin* | *mingw* ) | ||
| 4572 | $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' | ||
| 4573 | $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' | ||
| 4574 | ;; | ||
| 4575 | esac | ||
| 4576 | fi | ||
| 4577 | fi | ||
| 4578 | |||
| 4579 | for arg in $dlprefiles; do | ||
| 4580 | $show "extracting global C symbols from \`$arg'" | ||
| 4581 | name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` | ||
| 4582 | $run eval '$echo ": $name " >> "$nlist"' | ||
| 4583 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" | ||
| 4584 | done | ||
| 4585 | |||
| 4586 | if test -z "$run"; then | ||
| 4587 | # Make sure we have at least an empty file. | ||
| 4588 | test -f "$nlist" || : > "$nlist" | ||
| 4589 | |||
| 4590 | if test -n "$exclude_expsyms"; then | ||
| 4591 | $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T | ||
| 4592 | $mv "$nlist"T "$nlist" | ||
| 4593 | fi | ||
| 4594 | |||
| 4595 | # Try sorting and uniquifying the output. | ||
| 4596 | if grep -v "^: " < "$nlist" | | ||
| 4597 | if sort -k 3 </dev/null >/dev/null 2>&1; then | ||
| 4598 | sort -k 3 | ||
| 4599 | else | ||
| 4600 | sort +2 | ||
| 4601 | fi | | ||
| 4602 | uniq > "$nlist"S; then | ||
| 4603 | : | ||
| 4604 | else | ||
| 4605 | grep -v "^: " < "$nlist" > "$nlist"S | ||
| 4606 | fi | ||
| 4607 | |||
| 4608 | if test -f "$nlist"S; then | ||
| 4609 | eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' | ||
| 4610 | else | ||
| 4611 | $echo '/* NONE */' >> "$output_objdir/$dlsyms" | ||
| 4612 | fi | ||
| 4613 | |||
| 4614 | $echo >> "$output_objdir/$dlsyms" "\ | ||
| 4615 | |||
| 4616 | #undef lt_preloaded_symbols | ||
| 4617 | |||
| 4618 | #if defined (__STDC__) && __STDC__ | ||
| 4619 | # define lt_ptr void * | ||
| 4620 | #else | ||
| 4621 | # define lt_ptr char * | ||
| 4622 | # define const | ||
| 4623 | #endif | ||
| 4624 | |||
| 4625 | /* The mapping between symbol names and symbols. */ | ||
| 4626 | " | ||
| 4627 | |||
| 4628 | case $host in | ||
| 4629 | *cygwin* | *mingw* ) | ||
| 4630 | $echo >> "$output_objdir/$dlsyms" "\ | ||
| 4631 | /* DATA imports from DLLs on WIN32 can't be const, because | ||
| 4632 | runtime relocations are performed -- see ld's documentation | ||
| 4633 | on pseudo-relocs */ | ||
| 4634 | struct { | ||
| 4635 | " | ||
| 4636 | ;; | ||
| 4637 | * ) | ||
| 4638 | $echo >> "$output_objdir/$dlsyms" "\ | ||
| 4639 | const struct { | ||
| 4640 | " | ||
| 4641 | ;; | ||
| 4642 | esac | ||
| 4643 | |||
| 4644 | |||
| 4645 | $echo >> "$output_objdir/$dlsyms" "\ | ||
| 4646 | const char *name; | ||
| 4647 | lt_ptr address; | ||
| 4648 | } | ||
| 4649 | lt_preloaded_symbols[] = | ||
| 4650 | {\ | ||
| 4651 | " | ||
| 4652 | |||
| 4653 | eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" | ||
| 4654 | |||
| 4655 | $echo >> "$output_objdir/$dlsyms" "\ | ||
| 4656 | {0, (lt_ptr) 0} | ||
| 4657 | }; | ||
| 4658 | |||
| 4659 | /* This works around a problem in FreeBSD linker */ | ||
| 4660 | #ifdef FREEBSD_WORKAROUND | ||
| 4661 | static const void *lt_preloaded_setup() { | ||
| 4662 | return lt_preloaded_symbols; | ||
| 4663 | } | ||
| 4664 | #endif | ||
| 4665 | |||
| 4666 | #ifdef __cplusplus | ||
| 4667 | } | ||
| 4668 | #endif\ | ||
| 4669 | " | ||
| 4670 | fi | ||
| 4671 | |||
| 4672 | pic_flag_for_symtable= | ||
| 4673 | case $host in | ||
| 4674 | # compiling the symbol table file with pic_flag works around | ||
| 4675 | # a FreeBSD bug that causes programs to crash when -lm is | ||
| 4676 | # linked before any other PIC object. But we must not use | ||
| 4677 | # pic_flag when linking with -static. The problem exists in | ||
| 4678 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. | ||
| 4679 | *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) | ||
| 4680 | case "$compile_command " in | ||
| 4681 | *" -static "*) ;; | ||
| 4682 | *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; | ||
| 4683 | esac;; | ||
| 4684 | *-*-hpux*) | ||
| 4685 | case "$compile_command " in | ||
| 4686 | *" -static "*) ;; | ||
| 4687 | *) pic_flag_for_symtable=" $pic_flag";; | ||
| 4688 | esac | ||
| 4689 | esac | ||
| 4690 | |||
| 4691 | # Now compile the dynamic symbol file. | ||
| 4692 | $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" | ||
| 4693 | $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? | ||
| 4694 | |||
| 4695 | # Clean up the generated files. | ||
| 4696 | $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" | ||
| 4697 | $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" | ||
| 4698 | |||
| 4699 | # Transform the symbol file into the correct name. | ||
| 4700 | case $host in | ||
| 4701 | *cygwin* | *mingw* ) | ||
| 4702 | if test -f "$output_objdir/${outputname}.def" ; then | ||
| 4703 | compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` | ||
| 4704 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` | ||
| 4705 | else | ||
| 4706 | compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | ||
| 4707 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | ||
| 4708 | fi | ||
| 4709 | ;; | ||
| 4710 | * ) | ||
| 4711 | compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | ||
| 4712 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | ||
| 4713 | ;; | ||
| 4714 | esac | ||
| 4715 | ;; | ||
| 4716 | *) | ||
| 4717 | $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 | ||
| 4718 | exit $EXIT_FAILURE | ||
| 4719 | ;; | ||
| 4720 | esac | ||
| 4721 | else | ||
| 4722 | # We keep going just in case the user didn't refer to | ||
| 4723 | # lt_preloaded_symbols. The linker will fail if global_symbol_pipe | ||
| 4724 | # really was required. | ||
| 4725 | |||
| 4726 | # Nullify the symbol file. | ||
| 4727 | compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` | ||
| 4728 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` | ||
| 4729 | fi | ||
| 4730 | |||
| 4731 | if test "$need_relink" = no || test "$build_libtool_libs" != yes; then | ||
| 4732 | # Replace the output file specification. | ||
| 4733 | compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` | ||
| 4734 | link_command="$compile_command$compile_rpath" | ||
| 4735 | |||
| 4736 | # We have no uninstalled library dependencies, so finalize right now. | ||
| 4737 | $show "$link_command" | ||
| 4738 | $run eval "$link_command" | ||
| 4739 | exit_status=$? | ||
| 4740 | |||
| 4741 | # Delete the generated files. | ||
| 4742 | if test -n "$dlsyms"; then | ||
| 4743 | $show "$rm $output_objdir/${outputname}S.${objext}" | ||
| 4744 | $run $rm "$output_objdir/${outputname}S.${objext}" | ||
| 4745 | fi | ||
| 4746 | |||
| 4747 | exit $exit_status | ||
| 4748 | fi | ||
| 4749 | |||
| 4750 | if test -n "$shlibpath_var"; then | ||
| 4751 | # We should set the shlibpath_var | ||
| 4752 | rpath= | ||
| 4753 | for dir in $temp_rpath; do | ||
| 4754 | case $dir in | ||
| 4755 | [\\/]* | [A-Za-z]:[\\/]*) | ||
| 4756 | # Absolute path. | ||
| 4757 | rpath="$rpath$dir:" | ||
| 4758 | ;; | ||
| 4759 | *) | ||
| 4760 | # Relative path: add a thisdir entry. | ||
| 4761 | rpath="$rpath\$thisdir/$dir:" | ||
| 4762 | ;; | ||
| 4763 | esac | ||
| 4764 | done | ||
| 4765 | temp_rpath="$rpath" | ||
| 4766 | fi | ||
| 4767 | |||
| 4768 | if test -n "$compile_shlibpath$finalize_shlibpath"; then | ||
| 4769 | compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" | ||
| 4770 | fi | ||
| 4771 | if test -n "$finalize_shlibpath"; then | ||
| 4772 | finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" | ||
| 4773 | fi | ||
| 4774 | |||
| 4775 | compile_var= | ||
| 4776 | finalize_var= | ||
| 4777 | if test -n "$runpath_var"; then | ||
| 4778 | if test -n "$perm_rpath"; then | ||
| 4779 | # We should set the runpath_var. | ||
| 4780 | rpath= | ||
| 4781 | for dir in $perm_rpath; do | ||
| 4782 | rpath="$rpath$dir:" | ||
| 4783 | done | ||
| 4784 | compile_var="$runpath_var=\"$rpath\$$runpath_var\" " | ||
| 4785 | fi | ||
| 4786 | if test -n "$finalize_perm_rpath"; then | ||
| 4787 | # We should set the runpath_var. | ||
| 4788 | rpath= | ||
| 4789 | for dir in $finalize_perm_rpath; do | ||
| 4790 | rpath="$rpath$dir:" | ||
| 4791 | done | ||
| 4792 | finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " | ||
| 4793 | fi | ||
| 4794 | fi | ||
| 4795 | |||
| 4796 | if test "$no_install" = yes; then | ||
| 4797 | # We don't need to create a wrapper script. | ||
| 4798 | link_command="$compile_var$compile_command$compile_rpath" | ||
| 4799 | # Replace the output file specification. | ||
| 4800 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` | ||
| 4801 | # Delete the old output file. | ||
| 4802 | $run $rm $output | ||
| 4803 | # Link the executable and exit | ||
| 4804 | $show "$link_command" | ||
| 4805 | $run eval "$link_command" || exit $? | ||
| 4806 | exit $EXIT_SUCCESS | ||
| 4807 | fi | ||
| 4808 | |||
| 4809 | if test "$hardcode_action" = relink; then | ||
| 4810 | # Fast installation is not supported | ||
| 4811 | link_command="$compile_var$compile_command$compile_rpath" | ||
| 4812 | relink_command="$finalize_var$finalize_command$finalize_rpath" | ||
| 4813 | |||
| 4814 | $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 | ||
| 4815 | $echo "$modename: \`$output' will be relinked during installation" 1>&2 | ||
| 4816 | else | ||
| 4817 | if test "$fast_install" != no; then | ||
| 4818 | link_command="$finalize_var$compile_command$finalize_rpath" | ||
| 4819 | if test "$fast_install" = yes; then | ||
| 4820 | relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` | ||
| 4821 | else | ||
| 4822 | # fast_install is set to needless | ||
| 4823 | relink_command= | ||
| 4824 | fi | ||
| 4825 | else | ||
| 4826 | link_command="$compile_var$compile_command$compile_rpath" | ||
| 4827 | relink_command="$finalize_var$finalize_command$finalize_rpath" | ||
| 4828 | fi | ||
| 4829 | fi | ||
| 4830 | |||
| 4831 | # Replace the output file specification. | ||
| 4832 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` | ||
| 4833 | |||
| 4834 | # Delete the old output files. | ||
| 4835 | $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname | ||
| 4836 | |||
| 4837 | $show "$link_command" | ||
| 4838 | $run eval "$link_command" || exit $? | ||
| 4839 | |||
| 4840 | # Now create the wrapper script. | ||
| 4841 | $show "creating $output" | ||
| 4842 | |||
| 4843 | # Quote the relink command for shipping. | ||
| 4844 | if test -n "$relink_command"; then | ||
| 4845 | # Preserve any variables that may affect compiler behavior | ||
| 4846 | for var in $variables_saved_for_relink; do | ||
| 4847 | if eval test -z \"\${$var+set}\"; then | ||
| 4848 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" | ||
| 4849 | elif eval var_value=\$$var; test -z "$var_value"; then | ||
| 4850 | relink_command="$var=; export $var; $relink_command" | ||
| 4851 | else | ||
| 4852 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` | ||
| 4853 | relink_command="$var=\"$var_value\"; export $var; $relink_command" | ||
| 4854 | fi | ||
| 4855 | done | ||
| 4856 | relink_command="(cd `pwd`; $relink_command)" | ||
| 4857 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | ||
| 4858 | fi | ||
| 4859 | |||
| 4860 | # Quote $echo for shipping. | ||
| 4861 | if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then | ||
| 4862 | case $progpath in | ||
| 4863 | [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; | ||
| 4864 | *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; | ||
| 4865 | esac | ||
| 4866 | qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` | ||
| 4867 | else | ||
| 4868 | qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` | ||
| 4869 | fi | ||
| 4870 | |||
| 4871 | # Only actually do things if our run command is non-null. | ||
| 4872 | if test -z "$run"; then | ||
| 4873 | # win32 will think the script is a binary if it has | ||
| 4874 | # a .exe suffix, so we strip it off here. | ||
| 4875 | case $output in | ||
| 4876 | *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; | ||
| 4877 | esac | ||
| 4878 | # test for cygwin because mv fails w/o .exe extensions | ||
| 4879 | case $host in | ||
| 4880 | *cygwin*) | ||
| 4881 | exeext=.exe | ||
| 4882 | outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; | ||
| 4883 | *) exeext= ;; | ||
| 4884 | esac | ||
| 4885 | case $host in | ||
| 4886 | *cygwin* | *mingw* ) | ||
| 4887 | output_name=`basename $output` | ||
| 4888 | output_path=`dirname $output` | ||
| 4889 | cwrappersource="$output_path/$objdir/lt-$output_name.c" | ||
| 4890 | cwrapper="$output_path/$output_name.exe" | ||
| 4891 | $rm $cwrappersource $cwrapper | ||
| 4892 | trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 | ||
| 4893 | |||
| 4894 | cat > $cwrappersource <<EOF | ||
| 4895 | |||
| 4896 | /* $cwrappersource - temporary wrapper executable for $objdir/$outputname | ||
| 4897 | Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | ||
| 4898 | |||
| 4899 | The $output program cannot be directly executed until all the libtool | ||
| 4900 | libraries that it depends on are installed. | ||
| 4901 | |||
| 4902 | This wrapper executable should never be moved out of the build directory. | ||
| 4903 | If it is, it will not operate correctly. | ||
| 4904 | |||
| 4905 | Currently, it simply execs the wrapper *script* "/bin/sh $output", | ||
| 4906 | but could eventually absorb all of the scripts functionality and | ||
| 4907 | exec $objdir/$outputname directly. | ||
| 4908 | */ | ||
| 4909 | EOF | ||
| 4910 | cat >> $cwrappersource<<"EOF" | ||
| 4911 | #include <stdio.h> | ||
| 4912 | #include <stdlib.h> | ||
| 4913 | #include <unistd.h> | ||
| 4914 | #include <malloc.h> | ||
| 4915 | #include <stdarg.h> | ||
| 4916 | #include <assert.h> | ||
| 4917 | #include <string.h> | ||
| 4918 | #include <ctype.h> | ||
| 4919 | #include <sys/stat.h> | ||
| 4920 | |||
| 4921 | #if defined(PATH_MAX) | ||
| 4922 | # define LT_PATHMAX PATH_MAX | ||
| 4923 | #elif defined(MAXPATHLEN) | ||
| 4924 | # define LT_PATHMAX MAXPATHLEN | ||
| 4925 | #else | ||
| 4926 | # define LT_PATHMAX 1024 | ||
| 4927 | #endif | ||
| 4928 | |||
| 4929 | #ifndef DIR_SEPARATOR | ||
| 4930 | # define DIR_SEPARATOR '/' | ||
| 4931 | # define PATH_SEPARATOR ':' | ||
| 4932 | #endif | ||
| 4933 | |||
| 4934 | #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ | ||
| 4935 | defined (__OS2__) | ||
| 4936 | # define HAVE_DOS_BASED_FILE_SYSTEM | ||
| 4937 | # ifndef DIR_SEPARATOR_2 | ||
| 4938 | # define DIR_SEPARATOR_2 '\\' | ||
| 4939 | # endif | ||
| 4940 | # ifndef PATH_SEPARATOR_2 | ||
| 4941 | # define PATH_SEPARATOR_2 ';' | ||
| 4942 | # endif | ||
| 4943 | #endif | ||
| 4944 | |||
| 4945 | #ifndef DIR_SEPARATOR_2 | ||
| 4946 | # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) | ||
| 4947 | #else /* DIR_SEPARATOR_2 */ | ||
| 4948 | # define IS_DIR_SEPARATOR(ch) \ | ||
| 4949 | (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) | ||
| 4950 | #endif /* DIR_SEPARATOR_2 */ | ||
| 4951 | |||
| 4952 | #ifndef PATH_SEPARATOR_2 | ||
| 4953 | # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) | ||
| 4954 | #else /* PATH_SEPARATOR_2 */ | ||
| 4955 | # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) | ||
| 4956 | #endif /* PATH_SEPARATOR_2 */ | ||
| 4957 | |||
| 4958 | #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) | ||
| 4959 | #define XFREE(stale) do { \ | ||
| 4960 | if (stale) { free ((void *) stale); stale = 0; } \ | ||
| 4961 | } while (0) | ||
| 4962 | |||
| 4963 | /* -DDEBUG is fairly common in CFLAGS. */ | ||
| 4964 | #undef DEBUG | ||
| 4965 | #if defined DEBUGWRAPPER | ||
| 4966 | # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) | ||
| 4967 | #else | ||
| 4968 | # define DEBUG(format, ...) | ||
| 4969 | #endif | ||
| 4970 | |||
| 4971 | const char *program_name = NULL; | ||
| 4972 | |||
| 4973 | void * xmalloc (size_t num); | ||
| 4974 | char * xstrdup (const char *string); | ||
| 4975 | const char * base_name (const char *name); | ||
| 4976 | char * find_executable(const char *wrapper); | ||
| 4977 | int check_executable(const char *path); | ||
| 4978 | char * strendzap(char *str, const char *pat); | ||
| 4979 | void lt_fatal (const char *message, ...); | ||
| 4980 | |||
| 4981 | int | ||
| 4982 | main (int argc, char *argv[]) | ||
| 4983 | { | ||
| 4984 | char **newargz; | ||
| 4985 | int i; | ||
| 4986 | |||
| 4987 | program_name = (char *) xstrdup (base_name (argv[0])); | ||
| 4988 | DEBUG("(main) argv[0] : %s\n",argv[0]); | ||
| 4989 | DEBUG("(main) program_name : %s\n",program_name); | ||
| 4990 | newargz = XMALLOC(char *, argc+2); | ||
| 4991 | EOF | ||
| 4992 | |||
| 4993 | cat >> $cwrappersource <<EOF | ||
| 4994 | newargz[0] = (char *) xstrdup("$SHELL"); | ||
| 4995 | EOF | ||
| 4996 | |||
| 4997 | cat >> $cwrappersource <<"EOF" | ||
| 4998 | newargz[1] = find_executable(argv[0]); | ||
| 4999 | if (newargz[1] == NULL) | ||
| 5000 | lt_fatal("Couldn't find %s", argv[0]); | ||
| 5001 | DEBUG("(main) found exe at : %s\n",newargz[1]); | ||
| 5002 | /* we know the script has the same name, without the .exe */ | ||
| 5003 | /* so make sure newargz[1] doesn't end in .exe */ | ||
| 5004 | strendzap(newargz[1],".exe"); | ||
| 5005 | for (i = 1; i < argc; i++) | ||
| 5006 | newargz[i+1] = xstrdup(argv[i]); | ||
| 5007 | newargz[argc+1] = NULL; | ||
| 5008 | |||
| 5009 | for (i=0; i<argc+1; i++) | ||
| 5010 | { | ||
| 5011 | DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); | ||
| 5012 | ; | ||
| 5013 | } | ||
| 5014 | |||
| 5015 | EOF | ||
| 5016 | |||
| 5017 | case $host_os in | ||
| 5018 | mingw*) | ||
| 5019 | cat >> $cwrappersource <<EOF | ||
| 5020 | execv("$SHELL",(char const **)newargz); | ||
| 5021 | EOF | ||
| 5022 | ;; | ||
| 5023 | *) | ||
| 5024 | cat >> $cwrappersource <<EOF | ||
| 5025 | execv("$SHELL",newargz); | ||
| 5026 | EOF | ||
| 5027 | ;; | ||
| 5028 | esac | ||
| 5029 | |||
| 5030 | cat >> $cwrappersource <<"EOF" | ||
| 5031 | return 127; | ||
| 5032 | } | ||
| 5033 | |||
| 5034 | void * | ||
| 5035 | xmalloc (size_t num) | ||
| 5036 | { | ||
| 5037 | void * p = (void *) malloc (num); | ||
| 5038 | if (!p) | ||
| 5039 | lt_fatal ("Memory exhausted"); | ||
| 5040 | |||
| 5041 | return p; | ||
| 5042 | } | ||
| 5043 | |||
| 5044 | char * | ||
| 5045 | xstrdup (const char *string) | ||
| 5046 | { | ||
| 5047 | return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL | ||
| 5048 | ; | ||
| 5049 | } | ||
| 5050 | |||
| 5051 | const char * | ||
| 5052 | base_name (const char *name) | ||
| 5053 | { | ||
| 5054 | const char *base; | ||
| 5055 | |||
| 5056 | #if defined (HAVE_DOS_BASED_FILE_SYSTEM) | ||
| 5057 | /* Skip over the disk name in MSDOS pathnames. */ | ||
| 5058 | if (isalpha ((unsigned char)name[0]) && name[1] == ':') | ||
| 5059 | name += 2; | ||
| 5060 | #endif | ||
| 5061 | |||
| 5062 | for (base = name; *name; name++) | ||
| 5063 | if (IS_DIR_SEPARATOR (*name)) | ||
| 5064 | base = name + 1; | ||
| 5065 | return base; | ||
| 5066 | } | ||
| 5067 | |||
| 5068 | int | ||
| 5069 | check_executable(const char * path) | ||
| 5070 | { | ||
| 5071 | struct stat st; | ||
| 5072 | |||
| 5073 | DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); | ||
| 5074 | if ((!path) || (!*path)) | ||
| 5075 | return 0; | ||
| 5076 | |||
| 5077 | if ((stat (path, &st) >= 0) && | ||
| 5078 | ( | ||
| 5079 | /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ | ||
| 5080 | #if defined (S_IXOTH) | ||
| 5081 | ((st.st_mode & S_IXOTH) == S_IXOTH) || | ||
| 5082 | #endif | ||
| 5083 | #if defined (S_IXGRP) | ||
| 5084 | ((st.st_mode & S_IXGRP) == S_IXGRP) || | ||
| 5085 | #endif | ||
| 5086 | ((st.st_mode & S_IXUSR) == S_IXUSR)) | ||
| 5087 | ) | ||
| 5088 | return 1; | ||
| 5089 | else | ||
| 5090 | return 0; | ||
| 5091 | } | ||
| 5092 | |||
| 5093 | /* Searches for the full path of the wrapper. Returns | ||
| 5094 | newly allocated full path name if found, NULL otherwise */ | ||
| 5095 | char * | ||
| 5096 | find_executable (const char* wrapper) | ||
| 5097 | { | ||
| 5098 | int has_slash = 0; | ||
| 5099 | const char* p; | ||
| 5100 | const char* p_next; | ||
| 5101 | /* static buffer for getcwd */ | ||
| 5102 | char tmp[LT_PATHMAX + 1]; | ||
| 5103 | int tmp_len; | ||
| 5104 | char* concat_name; | ||
| 5105 | |||
| 5106 | DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); | ||
| 5107 | |||
| 5108 | if ((wrapper == NULL) || (*wrapper == '\0')) | ||
| 5109 | return NULL; | ||
| 5110 | |||
| 5111 | /* Absolute path? */ | ||
| 5112 | #if defined (HAVE_DOS_BASED_FILE_SYSTEM) | ||
| 5113 | if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') | ||
| 5114 | { | ||
| 5115 | concat_name = xstrdup (wrapper); | ||
| 5116 | if (check_executable(concat_name)) | ||
| 5117 | return concat_name; | ||
| 5118 | XFREE(concat_name); | ||
| 5119 | } | ||
| 5120 | else | ||
| 5121 | { | ||
| 5122 | #endif | ||
| 5123 | if (IS_DIR_SEPARATOR (wrapper[0])) | ||
| 5124 | { | ||
| 5125 | concat_name = xstrdup (wrapper); | ||
| 5126 | if (check_executable(concat_name)) | ||
| 5127 | return concat_name; | ||
| 5128 | XFREE(concat_name); | ||
| 5129 | } | ||
| 5130 | #if defined (HAVE_DOS_BASED_FILE_SYSTEM) | ||
| 5131 | } | ||
| 5132 | #endif | ||
| 5133 | |||
| 5134 | for (p = wrapper; *p; p++) | ||
| 5135 | if (*p == '/') | ||
| 5136 | { | ||
| 5137 | has_slash = 1; | ||
| 5138 | break; | ||
| 5139 | } | ||
| 5140 | if (!has_slash) | ||
| 5141 | { | ||
| 5142 | /* no slashes; search PATH */ | ||
| 5143 | const char* path = getenv ("PATH"); | ||
| 5144 | if (path != NULL) | ||
| 5145 | { | ||
| 5146 | for (p = path; *p; p = p_next) | ||
| 5147 | { | ||
| 5148 | const char* q; | ||
| 5149 | size_t p_len; | ||
| 5150 | for (q = p; *q; q++) | ||
| 5151 | if (IS_PATH_SEPARATOR(*q)) | ||
| 5152 | break; | ||
| 5153 | p_len = q - p; | ||
| 5154 | p_next = (*q == '\0' ? q : q + 1); | ||
| 5155 | if (p_len == 0) | ||
| 5156 | { | ||
| 5157 | /* empty path: current directory */ | ||
| 5158 | if (getcwd (tmp, LT_PATHMAX) == NULL) | ||
| 5159 | lt_fatal ("getcwd failed"); | ||
| 5160 | tmp_len = strlen(tmp); | ||
| 5161 | concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); | ||
| 5162 | memcpy (concat_name, tmp, tmp_len); | ||
| 5163 | concat_name[tmp_len] = '/'; | ||
| 5164 | strcpy (concat_name + tmp_len + 1, wrapper); | ||
| 5165 | } | ||
| 5166 | else | ||
| 5167 | { | ||
| 5168 | concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); | ||
| 5169 | memcpy (concat_name, p, p_len); | ||
| 5170 | concat_name[p_len] = '/'; | ||
| 5171 | strcpy (concat_name + p_len + 1, wrapper); | ||
| 5172 | } | ||
| 5173 | if (check_executable(concat_name)) | ||
| 5174 | return concat_name; | ||
| 5175 | XFREE(concat_name); | ||
| 5176 | } | ||
| 5177 | } | ||
| 5178 | /* not found in PATH; assume curdir */ | ||
| 5179 | } | ||
| 5180 | /* Relative path | not found in path: prepend cwd */ | ||
| 5181 | if (getcwd (tmp, LT_PATHMAX) == NULL) | ||
| 5182 | lt_fatal ("getcwd failed"); | ||
| 5183 | tmp_len = strlen(tmp); | ||
| 5184 | concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); | ||
| 5185 | memcpy (concat_name, tmp, tmp_len); | ||
| 5186 | concat_name[tmp_len] = '/'; | ||
| 5187 | strcpy (concat_name + tmp_len + 1, wrapper); | ||
| 5188 | |||
| 5189 | if (check_executable(concat_name)) | ||
| 5190 | return concat_name; | ||
| 5191 | XFREE(concat_name); | ||
| 5192 | return NULL; | ||
| 5193 | } | ||
| 5194 | |||
| 5195 | char * | ||
| 5196 | strendzap(char *str, const char *pat) | ||
| 5197 | { | ||
| 5198 | size_t len, patlen; | ||
| 5199 | |||
| 5200 | assert(str != NULL); | ||
| 5201 | assert(pat != NULL); | ||
| 5202 | |||
| 5203 | len = strlen(str); | ||
| 5204 | patlen = strlen(pat); | ||
| 5205 | |||
| 5206 | if (patlen <= len) | ||
| 5207 | { | ||
| 5208 | str += len - patlen; | ||
| 5209 | if (strcmp(str, pat) == 0) | ||
| 5210 | *str = '\0'; | ||
| 5211 | } | ||
| 5212 | return str; | ||
| 5213 | } | ||
| 5214 | |||
| 5215 | static void | ||
| 5216 | lt_error_core (int exit_status, const char * mode, | ||
| 5217 | const char * message, va_list ap) | ||
| 5218 | { | ||
| 5219 | fprintf (stderr, "%s: %s: ", program_name, mode); | ||
| 5220 | vfprintf (stderr, message, ap); | ||
| 5221 | fprintf (stderr, ".\n"); | ||
| 5222 | |||
| 5223 | if (exit_status >= 0) | ||
| 5224 | exit (exit_status); | ||
| 5225 | } | ||
| 5226 | |||
| 5227 | void | ||
| 5228 | lt_fatal (const char *message, ...) | ||
| 5229 | { | ||
| 5230 | va_list ap; | ||
| 5231 | va_start (ap, message); | ||
| 5232 | lt_error_core (EXIT_FAILURE, "FATAL", message, ap); | ||
| 5233 | va_end (ap); | ||
| 5234 | } | ||
| 5235 | EOF | ||
| 5236 | # we should really use a build-platform specific compiler | ||
| 5237 | # here, but OTOH, the wrappers (shell script and this C one) | ||
| 5238 | # are only useful if you want to execute the "real" binary. | ||
| 5239 | # Since the "real" binary is built for $host, then this | ||
| 5240 | # wrapper might as well be built for $host, too. | ||
| 5241 | $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource | ||
| 5242 | ;; | ||
| 5243 | esac | ||
| 5244 | $rm $output | ||
| 5245 | trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 | ||
| 5246 | |||
| 5247 | $echo > $output "\ | ||
| 5248 | #! $SHELL | ||
| 5249 | |||
| 5250 | # $output - temporary wrapper script for $objdir/$outputname | ||
| 5251 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | ||
| 5252 | # | ||
| 5253 | # The $output program cannot be directly executed until all the libtool | ||
| 5254 | # libraries that it depends on are installed. | ||
| 5255 | # | ||
| 5256 | # This wrapper script should never be moved out of the build directory. | ||
| 5257 | # If it is, it will not operate correctly. | ||
| 5258 | |||
| 5259 | # Sed substitution that helps us do robust quoting. It backslashifies | ||
| 5260 | # metacharacters that are still active within double-quoted strings. | ||
| 5261 | Xsed='${SED} -e 1s/^X//' | ||
| 5262 | sed_quote_subst='$sed_quote_subst' | ||
| 5263 | |||
| 5264 | # The HP-UX ksh and POSIX shell print the target directory to stdout | ||
| 5265 | # if CDPATH is set. | ||
| 5266 | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH | ||
| 5267 | |||
| 5268 | relink_command=\"$relink_command\" | ||
| 5269 | |||
| 5270 | # This environment variable determines our operation mode. | ||
| 5271 | if test \"\$libtool_install_magic\" = \"$magic\"; then | ||
| 5272 | # install mode needs the following variable: | ||
| 5273 | notinst_deplibs='$notinst_deplibs' | ||
| 5274 | else | ||
| 5275 | # When we are sourced in execute mode, \$file and \$echo are already set. | ||
| 5276 | if test \"\$libtool_execute_magic\" != \"$magic\"; then | ||
| 5277 | echo=\"$qecho\" | ||
| 5278 | file=\"\$0\" | ||
| 5279 | # Make sure echo works. | ||
| 5280 | if test \"X\$1\" = X--no-reexec; then | ||
| 5281 | # Discard the --no-reexec flag, and continue. | ||
| 5282 | shift | ||
| 5283 | elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then | ||
| 5284 | # Yippee, \$echo works! | ||
| 5285 | : | ||
| 5286 | else | ||
| 5287 | # Restart under the correct shell, and then maybe \$echo will work. | ||
| 5288 | exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} | ||
| 5289 | fi | ||
| 5290 | fi\ | ||
| 5291 | " | ||
| 5292 | $echo >> $output "\ | ||
| 5293 | |||
| 5294 | # Find the directory that this script lives in. | ||
| 5295 | thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` | ||
| 5296 | test \"x\$thisdir\" = \"x\$file\" && thisdir=. | ||
| 5297 | |||
| 5298 | # Follow symbolic links until we get to the real thisdir. | ||
| 5299 | file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` | ||
| 5300 | while test -n \"\$file\"; do | ||
| 5301 | destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` | ||
| 5302 | |||
| 5303 | # If there was a directory component, then change thisdir. | ||
| 5304 | if test \"x\$destdir\" != \"x\$file\"; then | ||
| 5305 | case \"\$destdir\" in | ||
| 5306 | [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; | ||
| 5307 | *) thisdir=\"\$thisdir/\$destdir\" ;; | ||
| 5308 | esac | ||
| 5309 | fi | ||
| 5310 | |||
| 5311 | file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` | ||
| 5312 | file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` | ||
| 5313 | done | ||
| 5314 | |||
| 5315 | # Try to get the absolute directory name. | ||
| 5316 | absdir=\`cd \"\$thisdir\" && pwd\` | ||
| 5317 | test -n \"\$absdir\" && thisdir=\"\$absdir\" | ||
| 5318 | " | ||
| 5319 | |||
| 5320 | if test "$fast_install" = yes; then | ||
| 5321 | $echo >> $output "\ | ||
| 5322 | program=lt-'$outputname'$exeext | ||
| 5323 | progdir=\"\$thisdir/$objdir\" | ||
| 5324 | |||
| 5325 | if test ! -f \"\$progdir/\$program\" || \\ | ||
| 5326 | { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ | ||
| 5327 | test \"X\$file\" != \"X\$progdir/\$program\"; }; then | ||
| 5328 | |||
| 5329 | file=\"\$\$-\$program\" | ||
| 5330 | |||
| 5331 | if test ! -d \"\$progdir\"; then | ||
| 5332 | $mkdir \"\$progdir\" | ||
| 5333 | else | ||
| 5334 | $rm \"\$progdir/\$file\" | ||
| 5335 | fi" | ||
| 5336 | |||
| 5337 | $echo >> $output "\ | ||
| 5338 | |||
| 5339 | # relink executable if necessary | ||
| 5340 | if test -n \"\$relink_command\"; then | ||
| 5341 | if relink_command_output=\`eval \$relink_command 2>&1\`; then : | ||
| 5342 | else | ||
| 5343 | $echo \"\$relink_command_output\" >&2 | ||
| 5344 | $rm \"\$progdir/\$file\" | ||
| 5345 | exit $EXIT_FAILURE | ||
| 5346 | fi | ||
| 5347 | fi | ||
| 5348 | |||
| 5349 | $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || | ||
| 5350 | { $rm \"\$progdir/\$program\"; | ||
| 5351 | $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } | ||
| 5352 | $rm \"\$progdir/\$file\" | ||
| 5353 | fi" | ||
| 5354 | else | ||
| 5355 | $echo >> $output "\ | ||
| 5356 | program='$outputname' | ||
| 5357 | progdir=\"\$thisdir/$objdir\" | ||
| 5358 | " | ||
| 5359 | fi | ||
| 5360 | |||
| 5361 | $echo >> $output "\ | ||
| 5362 | |||
| 5363 | if test -f \"\$progdir/\$program\"; then" | ||
| 5364 | |||
| 5365 | # Export our shlibpath_var if we have one. | ||
| 5366 | if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then | ||
| 5367 | $echo >> $output "\ | ||
| 5368 | # Add our own library path to $shlibpath_var | ||
| 5369 | $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" | ||
| 5370 | |||
| 5371 | # Some systems cannot cope with colon-terminated $shlibpath_var | ||
| 5372 | # The second colon is a workaround for a bug in BeOS R4 sed | ||
| 5373 | $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` | ||
| 5374 | |||
| 5375 | export $shlibpath_var | ||
| 5376 | " | ||
| 5377 | fi | ||
| 5378 | |||
| 5379 | # fixup the dll searchpath if we need to. | ||
| 5380 | if test -n "$dllsearchpath"; then | ||
| 5381 | $echo >> $output "\ | ||
| 5382 | # Add the dll search path components to the executable PATH | ||
| 5383 | PATH=$dllsearchpath:\$PATH | ||
| 5384 | " | ||
| 5385 | fi | ||
| 5386 | |||
| 5387 | $echo >> $output "\ | ||
| 5388 | if test \"\$libtool_execute_magic\" != \"$magic\"; then | ||
| 5389 | # Run the actual program with our arguments. | ||
| 5390 | " | ||
| 5391 | case $host in | ||
| 5392 | # Backslashes separate directories on plain windows | ||
| 5393 | *-*-mingw | *-*-os2*) | ||
| 5394 | $echo >> $output "\ | ||
| 5395 | exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} | ||
| 5396 | " | ||
| 5397 | ;; | ||
| 5398 | |||
| 5399 | *) | ||
| 5400 | $echo >> $output "\ | ||
| 5401 | exec \"\$progdir/\$program\" \${1+\"\$@\"} | ||
| 5402 | " | ||
| 5403 | ;; | ||
| 5404 | esac | ||
| 5405 | $echo >> $output "\ | ||
| 5406 | \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" | ||
| 5407 | exit $EXIT_FAILURE | ||
| 5408 | fi | ||
| 5409 | else | ||
| 5410 | # The program doesn't exist. | ||
| 5411 | \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 | ||
| 5412 | \$echo \"This script is just a wrapper for \$program.\" 1>&2 | ||
| 5413 | $echo \"See the $PACKAGE documentation for more information.\" 1>&2 | ||
| 5414 | exit $EXIT_FAILURE | ||
| 5415 | fi | ||
| 5416 | fi\ | ||
| 5417 | " | ||
| 5418 | chmod +x $output | ||
| 5419 | fi | ||
| 5420 | exit $EXIT_SUCCESS | ||
| 5421 | ;; | ||
| 5422 | esac | ||
| 5423 | |||
| 5424 | # See if we need to build an old-fashioned archive. | ||
| 5425 | for oldlib in $oldlibs; do | ||
| 5426 | |||
| 5427 | if test "$build_libtool_libs" = convenience; then | ||
| 5428 | oldobjs="$libobjs_save" | ||
| 5429 | addlibs="$convenience" | ||
| 5430 | build_libtool_libs=no | ||
| 5431 | else | ||
| 5432 | if test "$build_libtool_libs" = module; then | ||
| 5433 | oldobjs="$libobjs_save" | ||
| 5434 | build_libtool_libs=no | ||
| 5435 | else | ||
| 5436 | oldobjs="$old_deplibs $non_pic_objects" | ||
| 5437 | fi | ||
| 5438 | addlibs="$old_convenience" | ||
| 5439 | fi | ||
| 5440 | |||
| 5441 | if test -n "$addlibs"; then | ||
| 5442 | gentop="$output_objdir/${outputname}x" | ||
| 5443 | generated="$generated $gentop" | ||
| 5444 | |||
| 5445 | func_extract_archives $gentop $addlibs | ||
| 5446 | oldobjs="$oldobjs $func_extract_archives_result" | ||
| 5447 | fi | ||
| 5448 | |||
| 5449 | # Do each command in the archive commands. | ||
| 5450 | if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then | ||
| 5451 | cmds=$old_archive_from_new_cmds | ||
| 5452 | else | ||
| 5453 | # POSIX demands no paths to be encoded in archives. We have | ||
| 5454 | # to avoid creating archives with duplicate basenames if we | ||
| 5455 | # might have to extract them afterwards, e.g., when creating a | ||
| 5456 | # static archive out of a convenience library, or when linking | ||
| 5457 | # the entirety of a libtool archive into another (currently | ||
| 5458 | # not supported by libtool). | ||
| 5459 | if (for obj in $oldobjs | ||
| 5460 | do | ||
| 5461 | $echo "X$obj" | $Xsed -e 's%^.*/%%' | ||
| 5462 | done | sort | sort -uc >/dev/null 2>&1); then | ||
| 5463 | : | ||
| 5464 | else | ||
| 5465 | $echo "copying selected object files to avoid basename conflicts..." | ||
| 5466 | |||
| 5467 | if test -z "$gentop"; then | ||
| 5468 | gentop="$output_objdir/${outputname}x" | ||
| 5469 | generated="$generated $gentop" | ||
| 5470 | |||
| 5471 | $show "${rm}r $gentop" | ||
| 5472 | $run ${rm}r "$gentop" | ||
| 5473 | $show "$mkdir $gentop" | ||
| 5474 | $run $mkdir "$gentop" | ||
| 5475 | exit_status=$? | ||
| 5476 | if test "$exit_status" -ne 0 && test ! -d "$gentop"; then | ||
| 5477 | exit $exit_status | ||
| 5478 | fi | ||
| 5479 | fi | ||
| 5480 | |||
| 5481 | save_oldobjs=$oldobjs | ||
| 5482 | oldobjs= | ||
| 5483 | counter=1 | ||
| 5484 | for obj in $save_oldobjs | ||
| 5485 | do | ||
| 5486 | objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` | ||
| 5487 | case " $oldobjs " in | ||
| 5488 | " ") oldobjs=$obj ;; | ||
| 5489 | *[\ /]"$objbase "*) | ||
| 5490 | while :; do | ||
| 5491 | # Make sure we don't pick an alternate name that also | ||
| 5492 | # overlaps. | ||
| 5493 | newobj=lt$counter-$objbase | ||
| 5494 | counter=`expr $counter + 1` | ||
| 5495 | case " $oldobjs " in | ||
| 5496 | *[\ /]"$newobj "*) ;; | ||
| 5497 | *) if test ! -f "$gentop/$newobj"; then break; fi ;; | ||
| 5498 | esac | ||
| 5499 | done | ||
| 5500 | $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" | ||
| 5501 | $run ln "$obj" "$gentop/$newobj" || | ||
| 5502 | $run cp "$obj" "$gentop/$newobj" | ||
| 5503 | oldobjs="$oldobjs $gentop/$newobj" | ||
| 5504 | ;; | ||
| 5505 | *) oldobjs="$oldobjs $obj" ;; | ||
| 5506 | esac | ||
| 5507 | done | ||
| 5508 | fi | ||
| 5509 | |||
| 5510 | eval cmds=\"$old_archive_cmds\" | ||
| 5511 | |||
| 5512 | if len=`expr "X$cmds" : ".*"` && | ||
| 5513 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then | ||
| 5514 | cmds=$old_archive_cmds | ||
| 5515 | else | ||
| 5516 | # the command line is too long to link in one step, link in parts | ||
| 5517 | $echo "using piecewise archive linking..." | ||
| 5518 | save_RANLIB=$RANLIB | ||
| 5519 | RANLIB=: | ||
| 5520 | objlist= | ||
| 5521 | concat_cmds= | ||
| 5522 | save_oldobjs=$oldobjs | ||
| 5523 | |||
| 5524 | # Is there a better way of finding the last object in the list? | ||
| 5525 | for obj in $save_oldobjs | ||
| 5526 | do | ||
| 5527 | last_oldobj=$obj | ||
| 5528 | done | ||
| 5529 | for obj in $save_oldobjs | ||
| 5530 | do | ||
| 5531 | oldobjs="$objlist $obj" | ||
| 5532 | objlist="$objlist $obj" | ||
| 5533 | eval test_cmds=\"$old_archive_cmds\" | ||
| 5534 | if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && | ||
| 5535 | test "$len" -le "$max_cmd_len"; then | ||
| 5536 | : | ||
| 5537 | else | ||
| 5538 | # the above command should be used before it gets too long | ||
| 5539 | oldobjs=$objlist | ||
| 5540 | if test "$obj" = "$last_oldobj" ; then | ||
| 5541 | RANLIB=$save_RANLIB | ||
| 5542 | fi | ||
| 5543 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ | ||
| 5544 | eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" | ||
| 5545 | objlist= | ||
| 5546 | fi | ||
| 5547 | done | ||
| 5548 | RANLIB=$save_RANLIB | ||
| 5549 | oldobjs=$objlist | ||
| 5550 | if test "X$oldobjs" = "X" ; then | ||
| 5551 | eval cmds=\"\$concat_cmds\" | ||
| 5552 | else | ||
| 5553 | eval cmds=\"\$concat_cmds~\$old_archive_cmds\" | ||
| 5554 | fi | ||
| 5555 | fi | ||
| 5556 | fi | ||
| 5557 | save_ifs="$IFS"; IFS='~' | ||
| 5558 | for cmd in $cmds; do | ||
| 5559 | eval cmd=\"$cmd\" | ||
| 5560 | IFS="$save_ifs" | ||
| 5561 | $show "$cmd" | ||
| 5562 | $run eval "$cmd" || exit $? | ||
| 5563 | done | ||
| 5564 | IFS="$save_ifs" | ||
| 5565 | done | ||
| 5566 | |||
| 5567 | if test -n "$generated"; then | ||
| 5568 | $show "${rm}r$generated" | ||
| 5569 | $run ${rm}r$generated | ||
| 5570 | fi | ||
| 5571 | |||
| 5572 | # Now create the libtool archive. | ||
| 5573 | case $output in | ||
| 5574 | *.la) | ||
| 5575 | old_library= | ||
| 5576 | test "$build_old_libs" = yes && old_library="$libname.$libext" | ||
| 5577 | $show "creating $output" | ||
| 5578 | |||
| 5579 | # Preserve any variables that may affect compiler behavior | ||
| 5580 | for var in $variables_saved_for_relink; do | ||
| 5581 | if eval test -z \"\${$var+set}\"; then | ||
| 5582 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" | ||
| 5583 | elif eval var_value=\$$var; test -z "$var_value"; then | ||
| 5584 | relink_command="$var=; export $var; $relink_command" | ||
| 5585 | else | ||
| 5586 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` | ||
| 5587 | relink_command="$var=\"$var_value\"; export $var; $relink_command" | ||
| 5588 | fi | ||
| 5589 | done | ||
| 5590 | # Quote the link command for shipping. | ||
| 5591 | relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" | ||
| 5592 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | ||
| 5593 | if test "$hardcode_automatic" = yes ; then | ||
| 5594 | relink_command= | ||
| 5595 | fi | ||
| 5596 | |||
| 5597 | |||
| 5598 | # Only create the output if not a dry run. | ||
| 5599 | if test -z "$run"; then | ||
| 5600 | for installed in no yes; do | ||
| 5601 | if test "$installed" = yes; then | ||
| 5602 | if test -z "$install_libdir"; then | ||
| 5603 | break | ||
| 5604 | fi | ||
| 5605 | output="$output_objdir/$outputname"i | ||
| 5606 | # Replace all uninstalled libtool libraries with the installed ones | ||
| 5607 | newdependency_libs= | ||
| 5608 | for deplib in $dependency_libs; do | ||
| 5609 | case $deplib in | ||
| 5610 | *.la) | ||
| 5611 | name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` | ||
| 5612 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
| 5613 | if test -z "$libdir"; then | ||
| 5614 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 | ||
| 5615 | exit $EXIT_FAILURE | ||
| 5616 | fi | ||
| 5617 | newdependency_libs="$newdependency_libs $libdir/$name" | ||
| 5618 | ;; | ||
| 5619 | *) newdependency_libs="$newdependency_libs $deplib" ;; | ||
| 5620 | esac | ||
| 5621 | done | ||
| 5622 | dependency_libs="$newdependency_libs" | ||
| 5623 | newdlfiles= | ||
| 5624 | for lib in $dlfiles; do | ||
| 5625 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` | ||
| 5626 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | ||
| 5627 | if test -z "$libdir"; then | ||
| 5628 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
| 5629 | exit $EXIT_FAILURE | ||
| 5630 | fi | ||
| 5631 | newdlfiles="$newdlfiles $libdir/$name" | ||
| 5632 | done | ||
| 5633 | dlfiles="$newdlfiles" | ||
| 5634 | newdlprefiles= | ||
| 5635 | for lib in $dlprefiles; do | ||
| 5636 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` | ||
| 5637 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | ||
| 5638 | if test -z "$libdir"; then | ||
| 5639 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
| 5640 | exit $EXIT_FAILURE | ||
| 5641 | fi | ||
| 5642 | newdlprefiles="$newdlprefiles $libdir/$name" | ||
| 5643 | done | ||
| 5644 | dlprefiles="$newdlprefiles" | ||
| 5645 | else | ||
| 5646 | newdlfiles= | ||
| 5647 | for lib in $dlfiles; do | ||
| 5648 | case $lib in | ||
| 5649 | [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; | ||
| 5650 | *) abs=`pwd`"/$lib" ;; | ||
| 5651 | esac | ||
| 5652 | newdlfiles="$newdlfiles $abs" | ||
| 5653 | done | ||
| 5654 | dlfiles="$newdlfiles" | ||
| 5655 | newdlprefiles= | ||
| 5656 | for lib in $dlprefiles; do | ||
| 5657 | case $lib in | ||
| 5658 | [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; | ||
| 5659 | *) abs=`pwd`"/$lib" ;; | ||
| 5660 | esac | ||
| 5661 | newdlprefiles="$newdlprefiles $abs" | ||
| 5662 | done | ||
| 5663 | dlprefiles="$newdlprefiles" | ||
| 5664 | fi | ||
| 5665 | $rm $output | ||
| 5666 | # place dlname in correct position for cygwin | ||
| 5667 | tdlname=$dlname | ||
| 5668 | case $host,$output,$installed,$module,$dlname in | ||
| 5669 | *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; | ||
| 5670 | esac | ||
| 5671 | $echo > $output "\ | ||
| 5672 | # $outputname - a libtool library file | ||
| 5673 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | ||
| 5674 | # | ||
| 5675 | # Please DO NOT delete this file! | ||
| 5676 | # It is necessary for linking the library. | ||
| 5677 | |||
| 5678 | # The name that we can dlopen(3). | ||
| 5679 | dlname='$tdlname' | ||
| 5680 | |||
| 5681 | # Names of this library. | ||
| 5682 | library_names='$library_names' | ||
| 5683 | |||
| 5684 | # The name of the static archive. | ||
| 5685 | old_library='$old_library' | ||
| 5686 | |||
| 5687 | # Libraries that this one depends upon. | ||
| 5688 | dependency_libs='$dependency_libs' | ||
| 5689 | |||
| 5690 | # Version information for $libname. | ||
| 5691 | current=$current | ||
| 5692 | age=$age | ||
| 5693 | revision=$revision | ||
| 5694 | |||
| 5695 | # Is this an already installed library? | ||
| 5696 | installed=$installed | ||
| 5697 | |||
| 5698 | # Should we warn about portability when linking against -modules? | ||
| 5699 | shouldnotlink=$module | ||
| 5700 | |||
| 5701 | # Files to dlopen/dlpreopen | ||
| 5702 | dlopen='$dlfiles' | ||
| 5703 | dlpreopen='$dlprefiles' | ||
| 5704 | |||
| 5705 | # Directory that this library needs to be installed in: | ||
| 5706 | libdir='$install_libdir'" | ||
| 5707 | if test "$installed" = no && test "$need_relink" = yes; then | ||
| 5708 | $echo >> $output "\ | ||
| 5709 | relink_command=\"$relink_command\"" | ||
| 5710 | fi | ||
| 5711 | done | ||
| 5712 | fi | ||
| 5713 | |||
| 5714 | # Do a symbolic link so that the libtool archive can be found in | ||
| 5715 | # LD_LIBRARY_PATH before the program is installed. | ||
| 5716 | $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" | ||
| 5717 | $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? | ||
| 5718 | ;; | ||
| 5719 | esac | ||
| 5720 | exit $EXIT_SUCCESS | ||
| 5721 | ;; | ||
| 5722 | |||
| 5723 | # libtool install mode | ||
| 5724 | install) | ||
| 5725 | modename="$modename: install" | ||
| 5726 | |||
| 5727 | # There may be an optional sh(1) argument at the beginning of | ||
| 5728 | # install_prog (especially on Windows NT). | ||
| 5729 | if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || | ||
| 5730 | # Allow the use of GNU shtool's install command. | ||
| 5731 | $echo "X$nonopt" | grep shtool > /dev/null; then | ||
| 5732 | # Aesthetically quote it. | ||
| 5733 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` | ||
| 5734 | case $arg in | ||
| 5735 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 5736 | arg="\"$arg\"" | ||
| 5737 | ;; | ||
| 5738 | esac | ||
| 5739 | install_prog="$arg " | ||
| 5740 | arg="$1" | ||
| 5741 | shift | ||
| 5742 | else | ||
| 5743 | install_prog= | ||
| 5744 | arg=$nonopt | ||
| 5745 | fi | ||
| 5746 | |||
| 5747 | # The real first argument should be the name of the installation program. | ||
| 5748 | # Aesthetically quote it. | ||
| 5749 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
| 5750 | case $arg in | ||
| 5751 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 5752 | arg="\"$arg\"" | ||
| 5753 | ;; | ||
| 5754 | esac | ||
| 5755 | install_prog="$install_prog$arg" | ||
| 5756 | |||
| 5757 | # We need to accept at least all the BSD install flags. | ||
| 5758 | dest= | ||
| 5759 | files= | ||
| 5760 | opts= | ||
| 5761 | prev= | ||
| 5762 | install_type= | ||
| 5763 | isdir=no | ||
| 5764 | stripme= | ||
| 5765 | for arg | ||
| 5766 | do | ||
| 5767 | if test -n "$dest"; then | ||
| 5768 | files="$files $dest" | ||
| 5769 | dest=$arg | ||
| 5770 | continue | ||
| 5771 | fi | ||
| 5772 | |||
| 5773 | case $arg in | ||
| 5774 | -d) isdir=yes ;; | ||
| 5775 | -f) | ||
| 5776 | case " $install_prog " in | ||
| 5777 | *[\\\ /]cp\ *) ;; | ||
| 5778 | *) prev=$arg ;; | ||
| 5779 | esac | ||
| 5780 | ;; | ||
| 5781 | -g | -m | -o) prev=$arg ;; | ||
| 5782 | -s) | ||
| 5783 | stripme=" -s" | ||
| 5784 | continue | ||
| 5785 | ;; | ||
| 5786 | -*) | ||
| 5787 | ;; | ||
| 5788 | *) | ||
| 5789 | # If the previous option needed an argument, then skip it. | ||
| 5790 | if test -n "$prev"; then | ||
| 5791 | prev= | ||
| 5792 | else | ||
| 5793 | dest=$arg | ||
| 5794 | continue | ||
| 5795 | fi | ||
| 5796 | ;; | ||
| 5797 | esac | ||
| 5798 | |||
| 5799 | # Aesthetically quote the argument. | ||
| 5800 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | ||
| 5801 | case $arg in | ||
| 5802 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | ||
| 5803 | arg="\"$arg\"" | ||
| 5804 | ;; | ||
| 5805 | esac | ||
| 5806 | install_prog="$install_prog $arg" | ||
| 5807 | done | ||
| 5808 | |||
| 5809 | if test -z "$install_prog"; then | ||
| 5810 | $echo "$modename: you must specify an install program" 1>&2 | ||
| 5811 | $echo "$help" 1>&2 | ||
| 5812 | exit $EXIT_FAILURE | ||
| 5813 | fi | ||
| 5814 | |||
| 5815 | if test -n "$prev"; then | ||
| 5816 | $echo "$modename: the \`$prev' option requires an argument" 1>&2 | ||
| 5817 | $echo "$help" 1>&2 | ||
| 5818 | exit $EXIT_FAILURE | ||
| 5819 | fi | ||
| 5820 | |||
| 5821 | if test -z "$files"; then | ||
| 5822 | if test -z "$dest"; then | ||
| 5823 | $echo "$modename: no file or destination specified" 1>&2 | ||
| 5824 | else | ||
| 5825 | $echo "$modename: you must specify a destination" 1>&2 | ||
| 5826 | fi | ||
| 5827 | $echo "$help" 1>&2 | ||
| 5828 | exit $EXIT_FAILURE | ||
| 5829 | fi | ||
| 5830 | |||
| 5831 | # Strip any trailing slash from the destination. | ||
| 5832 | dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` | ||
| 5833 | |||
| 5834 | # Check to see that the destination is a directory. | ||
| 5835 | test -d "$dest" && isdir=yes | ||
| 5836 | if test "$isdir" = yes; then | ||
| 5837 | destdir="$dest" | ||
| 5838 | destname= | ||
| 5839 | else | ||
| 5840 | destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` | ||
| 5841 | test "X$destdir" = "X$dest" && destdir=. | ||
| 5842 | destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` | ||
| 5843 | |||
| 5844 | # Not a directory, so check to see that there is only one file specified. | ||
| 5845 | set dummy $files | ||
| 5846 | if test "$#" -gt 2; then | ||
| 5847 | $echo "$modename: \`$dest' is not a directory" 1>&2 | ||
| 5848 | $echo "$help" 1>&2 | ||
| 5849 | exit $EXIT_FAILURE | ||
| 5850 | fi | ||
| 5851 | fi | ||
| 5852 | case $destdir in | ||
| 5853 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
| 5854 | *) | ||
| 5855 | for file in $files; do | ||
| 5856 | case $file in | ||
| 5857 | *.lo) ;; | ||
| 5858 | *) | ||
| 5859 | $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 | ||
| 5860 | $echo "$help" 1>&2 | ||
| 5861 | exit $EXIT_FAILURE | ||
| 5862 | ;; | ||
| 5863 | esac | ||
| 5864 | done | ||
| 5865 | ;; | ||
| 5866 | esac | ||
| 5867 | |||
| 5868 | # This variable tells wrapper scripts just to set variables rather | ||
| 5869 | # than running their programs. | ||
| 5870 | libtool_install_magic="$magic" | ||
| 5871 | |||
| 5872 | staticlibs= | ||
| 5873 | future_libdirs= | ||
| 5874 | current_libdirs= | ||
| 5875 | for file in $files; do | ||
| 5876 | |||
| 5877 | # Do each installation. | ||
| 5878 | case $file in | ||
| 5879 | *.$libext) | ||
| 5880 | # Do the static libraries later. | ||
| 5881 | staticlibs="$staticlibs $file" | ||
| 5882 | ;; | ||
| 5883 | |||
| 5884 | *.la) | ||
| 5885 | # Check to see that this really is a libtool archive. | ||
| 5886 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | ||
| 5887 | else | ||
| 5888 | $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 | ||
| 5889 | $echo "$help" 1>&2 | ||
| 5890 | exit $EXIT_FAILURE | ||
| 5891 | fi | ||
| 5892 | |||
| 5893 | library_names= | ||
| 5894 | old_library= | ||
| 5895 | relink_command= | ||
| 5896 | # If there is no directory component, then add one. | ||
| 5897 | case $file in | ||
| 5898 | */* | *\\*) . $file ;; | ||
| 5899 | *) . ./$file ;; | ||
| 5900 | esac | ||
| 5901 | |||
| 5902 | # Add the libdir to current_libdirs if it is the destination. | ||
| 5903 | if test "X$destdir" = "X$libdir"; then | ||
| 5904 | case "$current_libdirs " in | ||
| 5905 | *" $libdir "*) ;; | ||
| 5906 | *) current_libdirs="$current_libdirs $libdir" ;; | ||
| 5907 | esac | ||
| 5908 | else | ||
| 5909 | # Note the libdir as a future libdir. | ||
| 5910 | case "$future_libdirs " in | ||
| 5911 | *" $libdir "*) ;; | ||
| 5912 | *) future_libdirs="$future_libdirs $libdir" ;; | ||
| 5913 | esac | ||
| 5914 | fi | ||
| 5915 | |||
| 5916 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ | ||
| 5917 | test "X$dir" = "X$file/" && dir= | ||
| 5918 | dir="$dir$objdir" | ||
| 5919 | |||
| 5920 | if test -n "$relink_command"; then | ||
| 5921 | # Determine the prefix the user has applied to our future dir. | ||
| 5922 | inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` | ||
| 5923 | |||
| 5924 | # Don't allow the user to place us outside of our expected | ||
| 5925 | # location b/c this prevents finding dependent libraries that | ||
| 5926 | # are installed to the same prefix. | ||
| 5927 | # At present, this check doesn't affect windows .dll's that | ||
| 5928 | # are installed into $libdir/../bin (currently, that works fine) | ||
| 5929 | # but it's something to keep an eye on. | ||
| 5930 | if test "$inst_prefix_dir" = "$destdir"; then | ||
| 5931 | $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 | ||
| 5932 | exit $EXIT_FAILURE | ||
| 5933 | fi | ||
| 5934 | |||
| 5935 | if test -n "$inst_prefix_dir"; then | ||
| 5936 | # Stick the inst_prefix_dir data into the link command. | ||
| 5937 | relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` | ||
| 5938 | else | ||
| 5939 | relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` | ||
| 5940 | fi | ||
| 5941 | |||
| 5942 | $echo "$modename: warning: relinking \`$file'" 1>&2 | ||
| 5943 | $show "$relink_command" | ||
| 5944 | if $run eval "$relink_command"; then : | ||
| 5945 | else | ||
| 5946 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 | ||
| 5947 | exit $EXIT_FAILURE | ||
| 5948 | fi | ||
| 5949 | fi | ||
| 5950 | |||
| 5951 | # See the names of the shared library. | ||
| 5952 | set dummy $library_names | ||
| 5953 | if test -n "$2"; then | ||
| 5954 | realname="$2" | ||
| 5955 | shift | ||
| 5956 | shift | ||
| 5957 | |||
| 5958 | srcname="$realname" | ||
| 5959 | test -n "$relink_command" && srcname="$realname"T | ||
| 5960 | |||
| 5961 | # Install the shared library and build the symlinks. | ||
| 5962 | $show "$install_prog $dir/$srcname $destdir/$realname" | ||
| 5963 | $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? | ||
| 5964 | if test -n "$stripme" && test -n "$striplib"; then | ||
| 5965 | $show "$striplib $destdir/$realname" | ||
| 5966 | $run eval "$striplib $destdir/$realname" || exit $? | ||
| 5967 | fi | ||
| 5968 | |||
| 5969 | if test "$#" -gt 0; then | ||
| 5970 | # Delete the old symlinks, and create new ones. | ||
| 5971 | # Try `ln -sf' first, because the `ln' binary might depend on | ||
| 5972 | # the symlink we replace! Solaris /bin/ln does not understand -f, | ||
| 5973 | # so we also need to try rm && ln -s. | ||
| 5974 | for linkname | ||
| 5975 | do | ||
| 5976 | if test "$linkname" != "$realname"; then | ||
| 5977 | $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" | ||
| 5978 | $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" | ||
| 5979 | fi | ||
| 5980 | done | ||
| 5981 | fi | ||
| 5982 | |||
| 5983 | # Do each command in the postinstall commands. | ||
| 5984 | lib="$destdir/$realname" | ||
| 5985 | cmds=$postinstall_cmds | ||
| 5986 | save_ifs="$IFS"; IFS='~' | ||
| 5987 | for cmd in $cmds; do | ||
| 5988 | IFS="$save_ifs" | ||
| 5989 | eval cmd=\"$cmd\" | ||
| 5990 | $show "$cmd" | ||
| 5991 | $run eval "$cmd" || { | ||
| 5992 | lt_exit=$? | ||
| 5993 | |||
| 5994 | # Restore the uninstalled library and exit | ||
| 5995 | if test "$mode" = relink; then | ||
| 5996 | $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' | ||
| 5997 | fi | ||
| 5998 | |||
| 5999 | exit $lt_exit | ||
| 6000 | } | ||
| 6001 | done | ||
| 6002 | IFS="$save_ifs" | ||
| 6003 | fi | ||
| 6004 | |||
| 6005 | # Install the pseudo-library for information purposes. | ||
| 6006 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
| 6007 | instname="$dir/$name"i | ||
| 6008 | $show "$install_prog $instname $destdir/$name" | ||
| 6009 | $run eval "$install_prog $instname $destdir/$name" || exit $? | ||
| 6010 | |||
| 6011 | # Maybe install the static library, too. | ||
| 6012 | test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" | ||
| 6013 | ;; | ||
| 6014 | |||
| 6015 | *.lo) | ||
| 6016 | # Install (i.e. copy) a libtool object. | ||
| 6017 | |||
| 6018 | # Figure out destination file name, if it wasn't already specified. | ||
| 6019 | if test -n "$destname"; then | ||
| 6020 | destfile="$destdir/$destname" | ||
| 6021 | else | ||
| 6022 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
| 6023 | destfile="$destdir/$destfile" | ||
| 6024 | fi | ||
| 6025 | |||
| 6026 | # Deduce the name of the destination old-style object file. | ||
| 6027 | case $destfile in | ||
| 6028 | *.lo) | ||
| 6029 | staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` | ||
| 6030 | ;; | ||
| 6031 | *.$objext) | ||
| 6032 | staticdest="$destfile" | ||
| 6033 | destfile= | ||
| 6034 | ;; | ||
| 6035 | *) | ||
| 6036 | $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 | ||
| 6037 | $echo "$help" 1>&2 | ||
| 6038 | exit $EXIT_FAILURE | ||
| 6039 | ;; | ||
| 6040 | esac | ||
| 6041 | |||
| 6042 | # Install the libtool object if requested. | ||
| 6043 | if test -n "$destfile"; then | ||
| 6044 | $show "$install_prog $file $destfile" | ||
| 6045 | $run eval "$install_prog $file $destfile" || exit $? | ||
| 6046 | fi | ||
| 6047 | |||
| 6048 | # Install the old object if enabled. | ||
| 6049 | if test "$build_old_libs" = yes; then | ||
| 6050 | # Deduce the name of the old-style object file. | ||
| 6051 | staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` | ||
| 6052 | |||
| 6053 | $show "$install_prog $staticobj $staticdest" | ||
| 6054 | $run eval "$install_prog \$staticobj \$staticdest" || exit $? | ||
| 6055 | fi | ||
| 6056 | exit $EXIT_SUCCESS | ||
| 6057 | ;; | ||
| 6058 | |||
| 6059 | *) | ||
| 6060 | # Figure out destination file name, if it wasn't already specified. | ||
| 6061 | if test -n "$destname"; then | ||
| 6062 | destfile="$destdir/$destname" | ||
| 6063 | else | ||
| 6064 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
| 6065 | destfile="$destdir/$destfile" | ||
| 6066 | fi | ||
| 6067 | |||
| 6068 | # If the file is missing, and there is a .exe on the end, strip it | ||
| 6069 | # because it is most likely a libtool script we actually want to | ||
| 6070 | # install | ||
| 6071 | stripped_ext="" | ||
| 6072 | case $file in | ||
| 6073 | *.exe) | ||
| 6074 | if test ! -f "$file"; then | ||
| 6075 | file=`$echo $file|${SED} 's,.exe$,,'` | ||
| 6076 | stripped_ext=".exe" | ||
| 6077 | fi | ||
| 6078 | ;; | ||
| 6079 | esac | ||
| 6080 | |||
| 6081 | # Do a test to see if this is really a libtool program. | ||
| 6082 | case $host in | ||
| 6083 | *cygwin*|*mingw*) | ||
| 6084 | wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` | ||
| 6085 | ;; | ||
| 6086 | *) | ||
| 6087 | wrapper=$file | ||
| 6088 | ;; | ||
| 6089 | esac | ||
| 6090 | if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then | ||
| 6091 | notinst_deplibs= | ||
| 6092 | relink_command= | ||
| 6093 | |||
| 6094 | # Note that it is not necessary on cygwin/mingw to append a dot to | ||
| 6095 | # foo even if both foo and FILE.exe exist: automatic-append-.exe | ||
| 6096 | # behavior happens only for exec(3), not for open(2)! Also, sourcing | ||
| 6097 | # `FILE.' does not work on cygwin managed mounts. | ||
| 6098 | # | ||
| 6099 | # If there is no directory component, then add one. | ||
| 6100 | case $wrapper in | ||
| 6101 | */* | *\\*) . ${wrapper} ;; | ||
| 6102 | *) . ./${wrapper} ;; | ||
| 6103 | esac | ||
| 6104 | |||
| 6105 | # Check the variables that should have been set. | ||
| 6106 | if test -z "$notinst_deplibs"; then | ||
| 6107 | $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 | ||
| 6108 | exit $EXIT_FAILURE | ||
| 6109 | fi | ||
| 6110 | |||
| 6111 | finalize=yes | ||
| 6112 | for lib in $notinst_deplibs; do | ||
| 6113 | # Check to see that each library is installed. | ||
| 6114 | libdir= | ||
| 6115 | if test -f "$lib"; then | ||
| 6116 | # If there is no directory component, then add one. | ||
| 6117 | case $lib in | ||
| 6118 | */* | *\\*) . $lib ;; | ||
| 6119 | *) . ./$lib ;; | ||
| 6120 | esac | ||
| 6121 | fi | ||
| 6122 | libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test | ||
| 6123 | if test -n "$libdir" && test ! -f "$libfile"; then | ||
| 6124 | $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 | ||
| 6125 | finalize=no | ||
| 6126 | fi | ||
| 6127 | done | ||
| 6128 | |||
| 6129 | relink_command= | ||
| 6130 | # Note that it is not necessary on cygwin/mingw to append a dot to | ||
| 6131 | # foo even if both foo and FILE.exe exist: automatic-append-.exe | ||
| 6132 | # behavior happens only for exec(3), not for open(2)! Also, sourcing | ||
| 6133 | # `FILE.' does not work on cygwin managed mounts. | ||
| 6134 | # | ||
| 6135 | # If there is no directory component, then add one. | ||
| 6136 | case $wrapper in | ||
| 6137 | */* | *\\*) . ${wrapper} ;; | ||
| 6138 | *) . ./${wrapper} ;; | ||
| 6139 | esac | ||
| 6140 | |||
| 6141 | outputname= | ||
| 6142 | if test "$fast_install" = no && test -n "$relink_command"; then | ||
| 6143 | if test "$finalize" = yes && test -z "$run"; then | ||
| 6144 | tmpdir=`func_mktempdir` | ||
| 6145 | file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` | ||
| 6146 | outputname="$tmpdir/$file" | ||
| 6147 | # Replace the output file specification. | ||
| 6148 | relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` | ||
| 6149 | |||
| 6150 | $show "$relink_command" | ||
| 6151 | if $run eval "$relink_command"; then : | ||
| 6152 | else | ||
| 6153 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 | ||
| 6154 | ${rm}r "$tmpdir" | ||
| 6155 | continue | ||
| 6156 | fi | ||
| 6157 | file="$outputname" | ||
| 6158 | else | ||
| 6159 | $echo "$modename: warning: cannot relink \`$file'" 1>&2 | ||
| 6160 | fi | ||
| 6161 | else | ||
| 6162 | # Install the binary that we compiled earlier. | ||
| 6163 | file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` | ||
| 6164 | fi | ||
| 6165 | fi | ||
| 6166 | |||
| 6167 | # remove .exe since cygwin /usr/bin/install will append another | ||
| 6168 | # one anyway | ||
| 6169 | case $install_prog,$host in | ||
| 6170 | */usr/bin/install*,*cygwin*) | ||
| 6171 | case $file:$destfile in | ||
| 6172 | *.exe:*.exe) | ||
| 6173 | # this is ok | ||
| 6174 | ;; | ||
| 6175 | *.exe:*) | ||
| 6176 | destfile=$destfile.exe | ||
| 6177 | ;; | ||
| 6178 | *:*.exe) | ||
| 6179 | destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` | ||
| 6180 | ;; | ||
| 6181 | esac | ||
| 6182 | ;; | ||
| 6183 | esac | ||
| 6184 | $show "$install_prog$stripme $file $destfile" | ||
| 6185 | $run eval "$install_prog\$stripme \$file \$destfile" || exit $? | ||
| 6186 | test -n "$outputname" && ${rm}r "$tmpdir" | ||
| 6187 | ;; | ||
| 6188 | esac | ||
| 6189 | done | ||
| 6190 | |||
| 6191 | for file in $staticlibs; do | ||
| 6192 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
| 6193 | |||
| 6194 | # Set up the ranlib parameters. | ||
| 6195 | oldlib="$destdir/$name" | ||
| 6196 | |||
| 6197 | $show "$install_prog $file $oldlib" | ||
| 6198 | $run eval "$install_prog \$file \$oldlib" || exit $? | ||
| 6199 | |||
| 6200 | if test -n "$stripme" && test -n "$old_striplib"; then | ||
| 6201 | $show "$old_striplib $oldlib" | ||
| 6202 | $run eval "$old_striplib $oldlib" || exit $? | ||
| 6203 | fi | ||
| 6204 | |||
| 6205 | # Do each command in the postinstall commands. | ||
| 6206 | cmds=$old_postinstall_cmds | ||
| 6207 | save_ifs="$IFS"; IFS='~' | ||
| 6208 | for cmd in $cmds; do | ||
| 6209 | IFS="$save_ifs" | ||
| 6210 | eval cmd=\"$cmd\" | ||
| 6211 | $show "$cmd" | ||
| 6212 | $run eval "$cmd" || exit $? | ||
| 6213 | done | ||
| 6214 | IFS="$save_ifs" | ||
| 6215 | done | ||
| 6216 | |||
| 6217 | if test -n "$future_libdirs"; then | ||
| 6218 | $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 | ||
| 6219 | fi | ||
| 6220 | |||
| 6221 | if test -n "$current_libdirs"; then | ||
| 6222 | # Maybe just do a dry run. | ||
| 6223 | test -n "$run" && current_libdirs=" -n$current_libdirs" | ||
| 6224 | exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' | ||
| 6225 | else | ||
| 6226 | exit $EXIT_SUCCESS | ||
| 6227 | fi | ||
| 6228 | ;; | ||
| 6229 | |||
| 6230 | # libtool finish mode | ||
| 6231 | finish) | ||
| 6232 | modename="$modename: finish" | ||
| 6233 | libdirs="$nonopt" | ||
| 6234 | admincmds= | ||
| 6235 | |||
| 6236 | if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then | ||
| 6237 | for dir | ||
| 6238 | do | ||
| 6239 | libdirs="$libdirs $dir" | ||
| 6240 | done | ||
| 6241 | |||
| 6242 | for libdir in $libdirs; do | ||
| 6243 | if test -n "$finish_cmds"; then | ||
| 6244 | # Do each command in the finish commands. | ||
| 6245 | cmds=$finish_cmds | ||
| 6246 | save_ifs="$IFS"; IFS='~' | ||
| 6247 | for cmd in $cmds; do | ||
| 6248 | IFS="$save_ifs" | ||
| 6249 | eval cmd=\"$cmd\" | ||
| 6250 | $show "$cmd" | ||
| 6251 | $run eval "$cmd" || admincmds="$admincmds | ||
| 6252 | $cmd" | ||
| 6253 | done | ||
| 6254 | IFS="$save_ifs" | ||
| 6255 | fi | ||
| 6256 | if test -n "$finish_eval"; then | ||
| 6257 | # Do the single finish_eval. | ||
| 6258 | eval cmds=\"$finish_eval\" | ||
| 6259 | $run eval "$cmds" || admincmds="$admincmds | ||
| 6260 | $cmds" | ||
| 6261 | fi | ||
| 6262 | done | ||
| 6263 | fi | ||
| 6264 | |||
| 6265 | # Exit here if they wanted silent mode. | ||
| 6266 | test "$show" = : && exit $EXIT_SUCCESS | ||
| 6267 | |||
| 6268 | $echo "X----------------------------------------------------------------------" | $Xsed | ||
| 6269 | $echo "Libraries have been installed in:" | ||
| 6270 | for libdir in $libdirs; do | ||
| 6271 | $echo " $libdir" | ||
| 6272 | done | ||
| 6273 | $echo | ||
| 6274 | $echo "If you ever happen to want to link against installed libraries" | ||
| 6275 | $echo "in a given directory, LIBDIR, you must either use libtool, and" | ||
| 6276 | $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" | ||
| 6277 | $echo "flag during linking and do at least one of the following:" | ||
| 6278 | if test -n "$shlibpath_var"; then | ||
| 6279 | $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" | ||
| 6280 | $echo " during execution" | ||
| 6281 | fi | ||
| 6282 | if test -n "$runpath_var"; then | ||
| 6283 | $echo " - add LIBDIR to the \`$runpath_var' environment variable" | ||
| 6284 | $echo " during linking" | ||
| 6285 | fi | ||
| 6286 | if test -n "$hardcode_libdir_flag_spec"; then | ||
| 6287 | libdir=LIBDIR | ||
| 6288 | eval flag=\"$hardcode_libdir_flag_spec\" | ||
| 6289 | |||
| 6290 | $echo " - use the \`$flag' linker flag" | ||
| 6291 | fi | ||
| 6292 | if test -n "$admincmds"; then | ||
| 6293 | $echo " - have your system administrator run these commands:$admincmds" | ||
| 6294 | fi | ||
| 6295 | if test -f /etc/ld.so.conf; then | ||
| 6296 | $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" | ||
| 6297 | fi | ||
| 6298 | $echo | ||
| 6299 | $echo "See any operating system documentation about shared libraries for" | ||
| 6300 | $echo "more information, such as the ld(1) and ld.so(8) manual pages." | ||
| 6301 | $echo "X----------------------------------------------------------------------" | $Xsed | ||
| 6302 | exit $EXIT_SUCCESS | ||
| 6303 | ;; | ||
| 6304 | |||
| 6305 | # libtool execute mode | ||
| 6306 | execute) | ||
| 6307 | modename="$modename: execute" | ||
| 6308 | |||
| 6309 | # The first argument is the command name. | ||
| 6310 | cmd="$nonopt" | ||
| 6311 | if test -z "$cmd"; then | ||
| 6312 | $echo "$modename: you must specify a COMMAND" 1>&2 | ||
| 6313 | $echo "$help" | ||
| 6314 | exit $EXIT_FAILURE | ||
| 6315 | fi | ||
| 6316 | |||
| 6317 | # Handle -dlopen flags immediately. | ||
| 6318 | for file in $execute_dlfiles; do | ||
| 6319 | if test ! -f "$file"; then | ||
| 6320 | $echo "$modename: \`$file' is not a file" 1>&2 | ||
| 6321 | $echo "$help" 1>&2 | ||
| 6322 | exit $EXIT_FAILURE | ||
| 6323 | fi | ||
| 6324 | |||
| 6325 | dir= | ||
| 6326 | case $file in | ||
| 6327 | *.la) | ||
| 6328 | # Check to see that this really is a libtool archive. | ||
| 6329 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | ||
| 6330 | else | ||
| 6331 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | ||
| 6332 | $echo "$help" 1>&2 | ||
| 6333 | exit $EXIT_FAILURE | ||
| 6334 | fi | ||
| 6335 | |||
| 6336 | # Read the libtool library. | ||
| 6337 | dlname= | ||
| 6338 | library_names= | ||
| 6339 | |||
| 6340 | # If there is no directory component, then add one. | ||
| 6341 | case $file in | ||
| 6342 | */* | *\\*) . $file ;; | ||
| 6343 | *) . ./$file ;; | ||
| 6344 | esac | ||
| 6345 | |||
| 6346 | # Skip this library if it cannot be dlopened. | ||
| 6347 | if test -z "$dlname"; then | ||
| 6348 | # Warn if it was a shared library. | ||
| 6349 | test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" | ||
| 6350 | continue | ||
| 6351 | fi | ||
| 6352 | |||
| 6353 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | ||
| 6354 | test "X$dir" = "X$file" && dir=. | ||
| 6355 | |||
| 6356 | if test -f "$dir/$objdir/$dlname"; then | ||
| 6357 | dir="$dir/$objdir" | ||
| 6358 | else | ||
| 6359 | $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 | ||
| 6360 | exit $EXIT_FAILURE | ||
| 6361 | fi | ||
| 6362 | ;; | ||
| 6363 | |||
| 6364 | *.lo) | ||
| 6365 | # Just add the directory containing the .lo file. | ||
| 6366 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | ||
| 6367 | test "X$dir" = "X$file" && dir=. | ||
| 6368 | ;; | ||
| 6369 | |||
| 6370 | *) | ||
| 6371 | $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 | ||
| 6372 | continue | ||
| 6373 | ;; | ||
| 6374 | esac | ||
| 6375 | |||
| 6376 | # Get the absolute pathname. | ||
| 6377 | absdir=`cd "$dir" && pwd` | ||
| 6378 | test -n "$absdir" && dir="$absdir" | ||
| 6379 | |||
| 6380 | # Now add the directory to shlibpath_var. | ||
| 6381 | if eval "test -z \"\$$shlibpath_var\""; then | ||
| 6382 | eval "$shlibpath_var=\"\$dir\"" | ||
| 6383 | else | ||
| 6384 | eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" | ||
| 6385 | fi | ||
| 6386 | done | ||
| 6387 | |||
| 6388 | # This variable tells wrapper scripts just to set shlibpath_var | ||
| 6389 | # rather than running their programs. | ||
| 6390 | libtool_execute_magic="$magic" | ||
| 6391 | |||
| 6392 | # Check if any of the arguments is a wrapper script. | ||
| 6393 | args= | ||
| 6394 | for file | ||
| 6395 | do | ||
| 6396 | case $file in | ||
| 6397 | -*) ;; | ||
| 6398 | *) | ||
| 6399 | # Do a test to see if this is really a libtool program. | ||
| 6400 | if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 6401 | # If there is no directory component, then add one. | ||
| 6402 | case $file in | ||
| 6403 | */* | *\\*) . $file ;; | ||
| 6404 | *) . ./$file ;; | ||
| 6405 | esac | ||
| 6406 | |||
| 6407 | # Transform arg to wrapped name. | ||
| 6408 | file="$progdir/$program" | ||
| 6409 | fi | ||
| 6410 | ;; | ||
| 6411 | esac | ||
| 6412 | # Quote arguments (to preserve shell metacharacters). | ||
| 6413 | file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` | ||
| 6414 | args="$args \"$file\"" | ||
| 6415 | done | ||
| 6416 | |||
| 6417 | if test -z "$run"; then | ||
| 6418 | if test -n "$shlibpath_var"; then | ||
| 6419 | # Export the shlibpath_var. | ||
| 6420 | eval "export $shlibpath_var" | ||
| 6421 | fi | ||
| 6422 | |||
| 6423 | # Restore saved environment variables | ||
| 6424 | if test "${save_LC_ALL+set}" = set; then | ||
| 6425 | LC_ALL="$save_LC_ALL"; export LC_ALL | ||
| 6426 | fi | ||
| 6427 | if test "${save_LANG+set}" = set; then | ||
| 6428 | LANG="$save_LANG"; export LANG | ||
| 6429 | fi | ||
| 6430 | |||
| 6431 | # Now prepare to actually exec the command. | ||
| 6432 | exec_cmd="\$cmd$args" | ||
| 6433 | else | ||
| 6434 | # Display what would be done. | ||
| 6435 | if test -n "$shlibpath_var"; then | ||
| 6436 | eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" | ||
| 6437 | $echo "export $shlibpath_var" | ||
| 6438 | fi | ||
| 6439 | $echo "$cmd$args" | ||
| 6440 | exit $EXIT_SUCCESS | ||
| 6441 | fi | ||
| 6442 | ;; | ||
| 6443 | |||
| 6444 | # libtool clean and uninstall mode | ||
| 6445 | clean | uninstall) | ||
| 6446 | modename="$modename: $mode" | ||
| 6447 | rm="$nonopt" | ||
| 6448 | files= | ||
| 6449 | rmforce= | ||
| 6450 | exit_status=0 | ||
| 6451 | |||
| 6452 | # This variable tells wrapper scripts just to set variables rather | ||
| 6453 | # than running their programs. | ||
| 6454 | libtool_install_magic="$magic" | ||
| 6455 | |||
| 6456 | for arg | ||
| 6457 | do | ||
| 6458 | case $arg in | ||
| 6459 | -f) rm="$rm $arg"; rmforce=yes ;; | ||
| 6460 | -*) rm="$rm $arg" ;; | ||
| 6461 | *) files="$files $arg" ;; | ||
| 6462 | esac | ||
| 6463 | done | ||
| 6464 | |||
| 6465 | if test -z "$rm"; then | ||
| 6466 | $echo "$modename: you must specify an RM program" 1>&2 | ||
| 6467 | $echo "$help" 1>&2 | ||
| 6468 | exit $EXIT_FAILURE | ||
| 6469 | fi | ||
| 6470 | |||
| 6471 | rmdirs= | ||
| 6472 | |||
| 6473 | origobjdir="$objdir" | ||
| 6474 | for file in $files; do | ||
| 6475 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | ||
| 6476 | if test "X$dir" = "X$file"; then | ||
| 6477 | dir=. | ||
| 6478 | objdir="$origobjdir" | ||
| 6479 | else | ||
| 6480 | objdir="$dir/$origobjdir" | ||
| 6481 | fi | ||
| 6482 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | ||
| 6483 | test "$mode" = uninstall && objdir="$dir" | ||
| 6484 | |||
| 6485 | # Remember objdir for removal later, being careful to avoid duplicates | ||
| 6486 | if test "$mode" = clean; then | ||
| 6487 | case " $rmdirs " in | ||
| 6488 | *" $objdir "*) ;; | ||
| 6489 | *) rmdirs="$rmdirs $objdir" ;; | ||
| 6490 | esac | ||
| 6491 | fi | ||
| 6492 | |||
| 6493 | # Don't error if the file doesn't exist and rm -f was used. | ||
| 6494 | if (test -L "$file") >/dev/null 2>&1 \ | ||
| 6495 | || (test -h "$file") >/dev/null 2>&1 \ | ||
| 6496 | || test -f "$file"; then | ||
| 6497 | : | ||
| 6498 | elif test -d "$file"; then | ||
| 6499 | exit_status=1 | ||
| 6500 | continue | ||
| 6501 | elif test "$rmforce" = yes; then | ||
| 6502 | continue | ||
| 6503 | fi | ||
| 6504 | |||
| 6505 | rmfiles="$file" | ||
| 6506 | |||
| 6507 | case $name in | ||
| 6508 | *.la) | ||
| 6509 | # Possibly a libtool archive, so verify it. | ||
| 6510 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 6511 | . $dir/$name | ||
| 6512 | |||
| 6513 | # Delete the libtool libraries and symlinks. | ||
| 6514 | for n in $library_names; do | ||
| 6515 | rmfiles="$rmfiles $objdir/$n" | ||
| 6516 | done | ||
| 6517 | test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" | ||
| 6518 | |||
| 6519 | case "$mode" in | ||
| 6520 | clean) | ||
| 6521 | case " $library_names " in | ||
| 6522 | # " " in the beginning catches empty $dlname | ||
| 6523 | *" $dlname "*) ;; | ||
| 6524 | *) rmfiles="$rmfiles $objdir/$dlname" ;; | ||
| 6525 | esac | ||
| 6526 | test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" | ||
| 6527 | ;; | ||
| 6528 | uninstall) | ||
| 6529 | if test -n "$library_names"; then | ||
| 6530 | # Do each command in the postuninstall commands. | ||
| 6531 | cmds=$postuninstall_cmds | ||
| 6532 | save_ifs="$IFS"; IFS='~' | ||
| 6533 | for cmd in $cmds; do | ||
| 6534 | IFS="$save_ifs" | ||
| 6535 | eval cmd=\"$cmd\" | ||
| 6536 | $show "$cmd" | ||
| 6537 | $run eval "$cmd" | ||
| 6538 | if test "$?" -ne 0 && test "$rmforce" != yes; then | ||
| 6539 | exit_status=1 | ||
| 6540 | fi | ||
| 6541 | done | ||
| 6542 | IFS="$save_ifs" | ||
| 6543 | fi | ||
| 6544 | |||
| 6545 | if test -n "$old_library"; then | ||
| 6546 | # Do each command in the old_postuninstall commands. | ||
| 6547 | cmds=$old_postuninstall_cmds | ||
| 6548 | save_ifs="$IFS"; IFS='~' | ||
| 6549 | for cmd in $cmds; do | ||
| 6550 | IFS="$save_ifs" | ||
| 6551 | eval cmd=\"$cmd\" | ||
| 6552 | $show "$cmd" | ||
| 6553 | $run eval "$cmd" | ||
| 6554 | if test "$?" -ne 0 && test "$rmforce" != yes; then | ||
| 6555 | exit_status=1 | ||
| 6556 | fi | ||
| 6557 | done | ||
| 6558 | IFS="$save_ifs" | ||
| 6559 | fi | ||
| 6560 | # FIXME: should reinstall the best remaining shared library. | ||
| 6561 | ;; | ||
| 6562 | esac | ||
| 6563 | fi | ||
| 6564 | ;; | ||
| 6565 | |||
| 6566 | *.lo) | ||
| 6567 | # Possibly a libtool object, so verify it. | ||
| 6568 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 6569 | |||
| 6570 | # Read the .lo file | ||
| 6571 | . $dir/$name | ||
| 6572 | |||
| 6573 | # Add PIC object to the list of files to remove. | ||
| 6574 | if test -n "$pic_object" \ | ||
| 6575 | && test "$pic_object" != none; then | ||
| 6576 | rmfiles="$rmfiles $dir/$pic_object" | ||
| 6577 | fi | ||
| 6578 | |||
| 6579 | # Add non-PIC object to the list of files to remove. | ||
| 6580 | if test -n "$non_pic_object" \ | ||
| 6581 | && test "$non_pic_object" != none; then | ||
| 6582 | rmfiles="$rmfiles $dir/$non_pic_object" | ||
| 6583 | fi | ||
| 6584 | fi | ||
| 6585 | ;; | ||
| 6586 | |||
| 6587 | *) | ||
| 6588 | if test "$mode" = clean ; then | ||
| 6589 | noexename=$name | ||
| 6590 | case $file in | ||
| 6591 | *.exe) | ||
| 6592 | file=`$echo $file|${SED} 's,.exe$,,'` | ||
| 6593 | noexename=`$echo $name|${SED} 's,.exe$,,'` | ||
| 6594 | # $file with .exe has already been added to rmfiles, | ||
| 6595 | # add $file without .exe | ||
| 6596 | rmfiles="$rmfiles $file" | ||
| 6597 | ;; | ||
| 6598 | esac | ||
| 6599 | # Do a test to see if this is a libtool program. | ||
| 6600 | if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then | ||
| 6601 | relink_command= | ||
| 6602 | . $dir/$noexename | ||
| 6603 | |||
| 6604 | # note $name still contains .exe if it was in $file originally | ||
| 6605 | # as does the version of $file that was added into $rmfiles | ||
| 6606 | rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" | ||
| 6607 | if test "$fast_install" = yes && test -n "$relink_command"; then | ||
| 6608 | rmfiles="$rmfiles $objdir/lt-$name" | ||
| 6609 | fi | ||
| 6610 | if test "X$noexename" != "X$name" ; then | ||
| 6611 | rmfiles="$rmfiles $objdir/lt-${noexename}.c" | ||
| 6612 | fi | ||
| 6613 | fi | ||
| 6614 | fi | ||
| 6615 | ;; | ||
| 6616 | esac | ||
| 6617 | $show "$rm $rmfiles" | ||
| 6618 | $run $rm $rmfiles || exit_status=1 | ||
| 6619 | done | ||
| 6620 | objdir="$origobjdir" | ||
| 6621 | |||
| 6622 | # Try to remove the ${objdir}s in the directories where we deleted files | ||
| 6623 | for dir in $rmdirs; do | ||
| 6624 | if test -d "$dir"; then | ||
| 6625 | $show "rmdir $dir" | ||
| 6626 | $run rmdir $dir >/dev/null 2>&1 | ||
| 6627 | fi | ||
| 6628 | done | ||
| 6629 | |||
| 6630 | exit $exit_status | ||
| 6631 | ;; | ||
| 6632 | |||
| 6633 | "") | ||
| 6634 | $echo "$modename: you must specify a MODE" 1>&2 | ||
| 6635 | $echo "$generic_help" 1>&2 | ||
| 6636 | exit $EXIT_FAILURE | ||
| 6637 | ;; | ||
| 6638 | esac | ||
| 6639 | |||
| 6640 | if test -z "$exec_cmd"; then | ||
| 6641 | $echo "$modename: invalid operation mode \`$mode'" 1>&2 | ||
| 6642 | $echo "$generic_help" 1>&2 | ||
| 6643 | exit $EXIT_FAILURE | ||
| 6644 | fi | ||
| 6645 | fi # test -z "$show_help" | ||
| 6646 | |||
| 6647 | if test -n "$exec_cmd"; then | ||
| 6648 | eval exec $exec_cmd | ||
| 6649 | exit $EXIT_FAILURE | ||
| 6650 | fi | ||
| 6651 | |||
| 6652 | # We need to display help for each of the modes. | ||
| 6653 | case $mode in | ||
| 6654 | "") $echo \ | ||
| 6655 | "Usage: $modename [OPTION]... [MODE-ARG]... | ||
| 6656 | |||
| 6657 | Provide generalized library-building support services. | ||
| 6658 | |||
| 6659 | --config show all configuration variables | ||
| 6660 | --debug enable verbose shell tracing | ||
| 6661 | -n, --dry-run display commands without modifying any files | ||
| 6662 | --features display basic configuration information and exit | ||
| 6663 | --finish same as \`--mode=finish' | ||
| 6664 | --help display this help message and exit | ||
| 6665 | --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] | ||
| 6666 | --quiet same as \`--silent' | ||
| 6667 | --silent don't print informational messages | ||
| 6668 | --tag=TAG use configuration variables from tag TAG | ||
| 6669 | --version print version information | ||
| 6670 | |||
| 6671 | MODE must be one of the following: | ||
| 6672 | |||
| 6673 | clean remove files from the build directory | ||
| 6674 | compile compile a source file into a libtool object | ||
| 6675 | execute automatically set library path, then run a program | ||
| 6676 | finish complete the installation of libtool libraries | ||
| 6677 | install install libraries or executables | ||
| 6678 | link create a library or an executable | ||
| 6679 | uninstall remove libraries from an installed directory | ||
| 6680 | |||
| 6681 | MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for | ||
| 6682 | a more detailed description of MODE. | ||
| 6683 | |||
| 6684 | Report bugs to <bug-libtool@gnu.org>." | ||
| 6685 | exit $EXIT_SUCCESS | ||
| 6686 | ;; | ||
| 6687 | |||
| 6688 | clean) | ||
| 6689 | $echo \ | ||
| 6690 | "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... | ||
| 6691 | |||
| 6692 | Remove files from the build directory. | ||
| 6693 | |||
| 6694 | RM is the name of the program to use to delete files associated with each FILE | ||
| 6695 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed | ||
| 6696 | to RM. | ||
| 6697 | |||
| 6698 | If FILE is a libtool library, object or program, all the files associated | ||
| 6699 | with it are deleted. Otherwise, only FILE itself is deleted using RM." | ||
| 6700 | ;; | ||
| 6701 | |||
| 6702 | compile) | ||
| 6703 | $echo \ | ||
| 6704 | "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE | ||
| 6705 | |||
| 6706 | Compile a source file into a libtool library object. | ||
| 6707 | |||
| 6708 | This mode accepts the following additional options: | ||
| 6709 | |||
| 6710 | -o OUTPUT-FILE set the output file name to OUTPUT-FILE | ||
| 6711 | -prefer-pic try to building PIC objects only | ||
| 6712 | -prefer-non-pic try to building non-PIC objects only | ||
| 6713 | -static always build a \`.o' file suitable for static linking | ||
| 6714 | |||
| 6715 | COMPILE-COMMAND is a command to be used in creating a \`standard' object file | ||
| 6716 | from the given SOURCEFILE. | ||
| 6717 | |||
| 6718 | The output file name is determined by removing the directory component from | ||
| 6719 | SOURCEFILE, then substituting the C source code suffix \`.c' with the | ||
| 6720 | library object suffix, \`.lo'." | ||
| 6721 | ;; | ||
| 6722 | |||
| 6723 | execute) | ||
| 6724 | $echo \ | ||
| 6725 | "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... | ||
| 6726 | |||
| 6727 | Automatically set library path, then run a program. | ||
| 6728 | |||
| 6729 | This mode accepts the following additional options: | ||
| 6730 | |||
| 6731 | -dlopen FILE add the directory containing FILE to the library path | ||
| 6732 | |||
| 6733 | This mode sets the library path environment variable according to \`-dlopen' | ||
| 6734 | flags. | ||
| 6735 | |||
| 6736 | If any of the ARGS are libtool executable wrappers, then they are translated | ||
| 6737 | into their corresponding uninstalled binary, and any of their required library | ||
| 6738 | directories are added to the library path. | ||
| 6739 | |||
| 6740 | Then, COMMAND is executed, with ARGS as arguments." | ||
| 6741 | ;; | ||
| 6742 | |||
| 6743 | finish) | ||
| 6744 | $echo \ | ||
| 6745 | "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... | ||
| 6746 | |||
| 6747 | Complete the installation of libtool libraries. | ||
| 6748 | |||
| 6749 | Each LIBDIR is a directory that contains libtool libraries. | ||
| 6750 | |||
| 6751 | The commands that this mode executes may require superuser privileges. Use | ||
| 6752 | the \`--dry-run' option if you just want to see what would be executed." | ||
| 6753 | ;; | ||
| 6754 | |||
| 6755 | install) | ||
| 6756 | $echo \ | ||
| 6757 | "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... | ||
| 6758 | |||
| 6759 | Install executables or libraries. | ||
| 6760 | |||
| 6761 | INSTALL-COMMAND is the installation command. The first component should be | ||
| 6762 | either the \`install' or \`cp' program. | ||
| 6763 | |||
| 6764 | The rest of the components are interpreted as arguments to that command (only | ||
| 6765 | BSD-compatible install options are recognized)." | ||
| 6766 | ;; | ||
| 6767 | |||
| 6768 | link) | ||
| 6769 | $echo \ | ||
| 6770 | "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... | ||
| 6771 | |||
| 6772 | Link object files or libraries together to form another library, or to | ||
| 6773 | create an executable program. | ||
| 6774 | |||
| 6775 | LINK-COMMAND is a command using the C compiler that you would use to create | ||
| 6776 | a program from several object files. | ||
| 6777 | |||
| 6778 | The following components of LINK-COMMAND are treated specially: | ||
| 6779 | |||
| 6780 | -all-static do not do any dynamic linking at all | ||
| 6781 | -avoid-version do not add a version suffix if possible | ||
| 6782 | -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime | ||
| 6783 | -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols | ||
| 6784 | -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) | ||
| 6785 | -export-symbols SYMFILE | ||
| 6786 | try to export only the symbols listed in SYMFILE | ||
| 6787 | -export-symbols-regex REGEX | ||
| 6788 | try to export only the symbols matching REGEX | ||
| 6789 | -LLIBDIR search LIBDIR for required installed libraries | ||
| 6790 | -lNAME OUTPUT-FILE requires the installed library libNAME | ||
| 6791 | -module build a library that can dlopened | ||
| 6792 | -no-fast-install disable the fast-install mode | ||
| 6793 | -no-install link a not-installable executable | ||
| 6794 | -no-undefined declare that a library does not refer to external symbols | ||
| 6795 | -o OUTPUT-FILE create OUTPUT-FILE from the specified objects | ||
| 6796 | -objectlist FILE Use a list of object files found in FILE to specify objects | ||
| 6797 | -precious-files-regex REGEX | ||
| 6798 | don't remove output files matching REGEX | ||
| 6799 | -release RELEASE specify package release information | ||
| 6800 | -rpath LIBDIR the created library will eventually be installed in LIBDIR | ||
| 6801 | -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries | ||
| 6802 | -static do not do any dynamic linking of libtool libraries | ||
| 6803 | -version-info CURRENT[:REVISION[:AGE]] | ||
| 6804 | specify library version info [each variable defaults to 0] | ||
| 6805 | |||
| 6806 | All other options (arguments beginning with \`-') are ignored. | ||
| 6807 | |||
| 6808 | Every other argument is treated as a filename. Files ending in \`.la' are | ||
| 6809 | treated as uninstalled libtool libraries, other files are standard or library | ||
| 6810 | object files. | ||
| 6811 | |||
| 6812 | If the OUTPUT-FILE ends in \`.la', then a libtool library is created, | ||
| 6813 | only library objects (\`.lo' files) may be specified, and \`-rpath' is | ||
| 6814 | required, except when creating a convenience library. | ||
| 6815 | |||
| 6816 | If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created | ||
| 6817 | using \`ar' and \`ranlib', or on Windows using \`lib'. | ||
| 6818 | |||
| 6819 | If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file | ||
| 6820 | is created, otherwise an executable program is created." | ||
| 6821 | ;; | ||
| 6822 | |||
| 6823 | uninstall) | ||
| 6824 | $echo \ | ||
| 6825 | "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... | ||
| 6826 | |||
| 6827 | Remove libraries from an installation directory. | ||
| 6828 | |||
| 6829 | RM is the name of the program to use to delete files associated with each FILE | ||
| 6830 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed | ||
| 6831 | to RM. | ||
| 6832 | |||
| 6833 | If FILE is a libtool library, all the files associated with it are deleted. | ||
| 6834 | Otherwise, only FILE itself is deleted using RM." | ||
| 6835 | ;; | ||
| 6836 | |||
| 6837 | *) | ||
| 6838 | $echo "$modename: invalid operation mode \`$mode'" 1>&2 | ||
| 6839 | $echo "$help" 1>&2 | ||
| 6840 | exit $EXIT_FAILURE | ||
| 6841 | ;; | ||
| 6842 | esac | ||
| 6843 | |||
| 6844 | $echo | ||
| 6845 | $echo "Try \`$modename --help' for more information about other modes." | ||
| 6846 | |||
| 6847 | exit $? | ||
| 6848 | |||
| 6849 | # The TAGs below are defined such that we never get into a situation | ||
| 6850 | # in which we disable both kinds of libraries. Given conflicting | ||
| 6851 | # choices, we go for a static library, that is the most portable, | ||
| 6852 | # since we can't tell whether shared libraries were disabled because | ||
| 6853 | # the user asked for that or because the platform doesn't support | ||
| 6854 | # them. This is particularly important on AIX, because we don't | ||
| 6855 | # support having both static and shared libraries enabled at the same | ||
| 6856 | # time on that platform, so we default to a shared-only configuration. | ||
| 6857 | # If a disable-shared tag is given, we'll fallback to a static-only | ||
| 6858 | # configuration. But we'll never go from static-only to shared-only. | ||
| 6859 | |||
| 6860 | # ### BEGIN LIBTOOL TAG CONFIG: disable-shared | ||
| 6861 | disable_libs=shared | ||
| 6862 | # ### END LIBTOOL TAG CONFIG: disable-shared | ||
| 6863 | |||
| 6864 | # ### BEGIN LIBTOOL TAG CONFIG: disable-static | ||
| 6865 | disable_libs=static | ||
| 6866 | # ### END LIBTOOL TAG CONFIG: disable-static | ||
| 6867 | |||
| 6868 | # Local Variables: | ||
| 6869 | # mode:shell-script | ||
| 6870 | # sh-indentation:2 | ||
| 6871 | # End: | ||
