Codebase list getdns / 0607510
Imported Upstream version 0.3.2~rc1 Daniel Kahn Gillmor 8 years ago
52 changed file(s) with 8678 addition(s) and 11975 deletion(s). Raw diff Collapse all Expand all
0 * 2015-07.18: Version 0.3.1
0 * 2015-09-??: Version 0.3.2
1 * Fix returned upstreams list by getdns_context_get_api_information()
2 * Fix some autoconf issues when srcdir != builddir
3 * Fix remove build date from manpage version for reproducable builds
4 * Fix transport fallback issues plus transport fallback unit test script
5 * Fix string bindata's need not contain trailing zero byte
6 * --enable-stub-only configure option for stub only operation.
7 Stub mode will be the default. Removes the dependency on libunbound
8 * --with-getdns_query compiles and installs the getdns_query tool too
9
10 * 2015-07-18: Version 0.3.1
111 * Fix repeating rdata fields
212
313 * 2015-07-17: Version 0.3.0
4242 srcdir = @srcdir@
4343 INSTALL = @INSTALL@
4444
45 all : default @GETDNS_QUERY@
46
4547 default:
4648 cd src && $(MAKE) $@
4749
48 all : default
49
50 install: all
50 install: all @INSTALL_GETDNS_QUERY@
5151 $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
5252 $(INSTALL) -m 644 $(srcdir)/AUTHORS $(DESTDIR)$(docdir)
5353 $(INSTALL) -m 644 $(srcdir)/ChangeLog $(DESTDIR)$(docdir)
7979 @echo "*** at package installation time from the post-install script."
8080 @echo "***"
8181
82 uninstall:
82 uninstall: @UNINSTALL_GETDNS_QUERY@
8383 rm -rf $(DESTDIR)$(docdir)
8484 cd doc && $(MAKE) $@
8585 cd src && $(MAKE) $@
9595
9696 getdns_query:
9797 cd src && $(MAKE) $@
98
99 install-getdns_query:
100 cd src/test && $(MAKE) install
101
102 uninstall-getdns_query:
103 cd src/test && $(MAKE) uninstall
98104
99105 clean:
100106 cd src && $(MAKE) $@
115121 rmdir spec 2>/dev/null || true
116122 rm -f config.log config.status Makefile libtool
117123 rm -fR autom4te.cache
118 rm -fR m4
124 rm -f m4/libtool.m4
125 rm -f m4/lt~obsolete.m4
126 rm -f m4/ltoptions.m4
127 rm -f m4/ltsugar.m4
128 rm -f m4/ltversion.m4
129 rm -f $(distdir).tar.gz $(distdir).tar.gz.sha1
130 rm -f $(distdir).tar.gz.md5 $(distdir).tar.gz.asc
131
132 megaclean:
133 cd $(srcdir) && rm -fr * .dir-locals.el .gitignore .indent.pro .travis.yml && git reset --hard
119134
120135 dist: $(distdir).tar.gz
136
137 pub: $(distdir).tar.gz.sha1 $(distdir).tar.gz.md5 $(distdir).tar.gz.asc
138
139 $(distdir).tar.gz.sha1: $(distdir).tar.gz
140 openssl sha1 $(distdir).tar.gz >$@
141
142 $(distdir).tar.gz.md5: $(distdir).tar.gz
143 openssl md5 $(distdir).tar.gz >$@
144
145 $(distdir).tar.gz.asc: $(distdir).tar.gz
146 gpg --armor --detach-sig $(distdir).tar.gz
121147
122148 bindist: $(bintar)
123149
00 getdns API
11 ==========
22
3 * Date: 2015-05-20
3 * Date: 2015-08-27
44 * GitHub: <https://github.com/getdnsapi/getdns>
55
66 getdns is an implementation of a modern asynchronous DNS API specification
225225
226226 Contributors
227227 ============
228 * Theogene Bucuti
228229 * Craig Despeaux, Verisign, Inc.
229230 * John Dickinson, Sinodun
230231 * Sara Dickinson, Sinodun
234235 * Olaf Kolkman, NLnet Labs
235236 * Sanjay Mahurpawar, Verisign, Inc.
236237 * Allison Mankin, Verisign, Inc. - Verisign Labs.
238 * Sai Mogali, Verisign, Inc.
237239 * Benno Overeinder, NLnet Labs
238240 * Prithvi Ranganath, Verisign, Inc.
239241 * Rushi Shah, Verisign, Inc.
240242 * Melinda Shore, No Mountain Software LLC
243 * Bob Steagall, Verisign, Inc.
241244 * Willem Toorop, NLnet Labs
242245 * Gowri Visweswaran, Verisign Labs
243246 * Wouter Wijngaards, NLnet Labs
00 #! /bin/sh
11 # Attempt to guess a canonical system name.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 # 2011, 2012 Free Software Foundation, Inc.
5
6 timestamp='2012-06-10'
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-03-23'
75
86 # This file is free software; you can redistribute it and/or modify it
97 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
8 # the Free Software Foundation; either version 3 of the License, or
119 # (at your option) any later version.
1210 #
1311 # This program is distributed in the hope that it will be useful, but
2119 # As a special exception to the GNU General Public License, if you
2220 # distribute this file as part of a program that contains a
2321 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25
26
27 # Originally written by Per Bothner. Please send patches (context
28 # diff format) to <config-patches@gnu.org> and include a ChangeLog
29 # entry.
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
3025 #
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.
26 # Originally written by Per Bothner.
3427 #
3528 # You can get the latest version of this script from:
3629 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
30 #
31 # Please send patches with a ChangeLog entry to config-patches@gnu.org.
32
3733
3834 me=`echo "$0" | sed -e 's,.*/,,'`
3935
5349 GNU config.guess ($timestamp)
5450
5551 Originally written by Per Bothner.
56 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
57 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
58 Free Software Foundation, Inc.
52 Copyright 1992-2014 Free Software Foundation, Inc.
5953
6054 This is free software; see the source for copying conditions. There is NO
6155 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
136130 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
137131 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
138132 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
133
134 case "${UNAME_SYSTEM}" in
135 Linux|GNU|GNU/*)
136 # If the system lacks a compiler, then just pick glibc.
137 # We could probably try harder.
138 LIBC=gnu
139
140 eval $set_cc_for_build
141 cat <<-EOF > $dummy.c
142 #include <features.h>
143 #if defined(__UCLIBC__)
144 LIBC=uclibc
145 #elif defined(__dietlibc__)
146 LIBC=dietlibc
147 #else
148 LIBC=gnu
149 #endif
150 EOF
151 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
152 ;;
153 esac
139154
140155 # Note: order is significant - the case branches are not exclusive.
141156
198213 # contains redundant information, the shorter form:
199214 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
200215 echo "${machine}-${os}${release}"
216 exit ;;
217 *:Bitrig:*:*)
218 UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
219 echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
201220 exit ;;
202221 *:OpenBSD:*:*)
203222 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
301320 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
302321 echo arm-acorn-riscix${UNAME_RELEASE}
303322 exit ;;
304 arm:riscos:*:*|arm:RISCOS:*:*)
323 arm*:riscos:*:*|arm*:RISCOS:*:*)
305324 echo arm-unknown-riscos
306325 exit ;;
307326 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
800819 i*:CYGWIN*:*)
801820 echo ${UNAME_MACHINE}-pc-cygwin
802821 exit ;;
822 *:MINGW64*:*)
823 echo ${UNAME_MACHINE}-pc-mingw64
824 exit ;;
803825 *:MINGW*:*)
804826 echo ${UNAME_MACHINE}-pc-mingw32
805827 exit ;;
806 i*:MSYS*:*)
828 *:MSYS*:*)
807829 echo ${UNAME_MACHINE}-pc-msys
808830 exit ;;
809831 i*:windows32*:*)
851873 exit ;;
852874 *:GNU:*:*)
853875 # the GNU system
854 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
876 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
855877 exit ;;
856878 *:GNU/*:*:*)
857879 # other systems with GNU libc and userland
858 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
880 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
859881 exit ;;
860882 i*86:Minix:*:*)
861883 echo ${UNAME_MACHINE}-pc-minix
862884 exit ;;
863885 aarch64:Linux:*:*)
864 echo ${UNAME_MACHINE}-unknown-linux-gnu
886 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
865887 exit ;;
866888 aarch64_be:Linux:*:*)
867889 UNAME_MACHINE=aarch64_be
868 echo ${UNAME_MACHINE}-unknown-linux-gnu
890 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
869891 exit ;;
870892 alpha:Linux:*:*)
871893 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
878900 EV68*) UNAME_MACHINE=alphaev68 ;;
879901 esac
880902 objdump --private-headers /bin/sh | grep -q ld.so.1
881 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
882 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
903 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
904 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
905 exit ;;
906 arc:Linux:*:* | arceb:Linux:*:*)
907 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
883908 exit ;;
884909 arm*:Linux:*:*)
885910 eval $set_cc_for_build
886911 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
887912 | grep -q __ARM_EABI__
888913 then
889 echo ${UNAME_MACHINE}-unknown-linux-gnu
914 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
890915 else
891916 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
892917 | grep -q __ARM_PCS_VFP
893918 then
894 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
919 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
895920 else
896 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
921 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
897922 fi
898923 fi
899924 exit ;;
900925 avr32*:Linux:*:*)
901 echo ${UNAME_MACHINE}-unknown-linux-gnu
926 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
902927 exit ;;
903928 cris:Linux:*:*)
904 echo ${UNAME_MACHINE}-axis-linux-gnu
929 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
905930 exit ;;
906931 crisv32:Linux:*:*)
907 echo ${UNAME_MACHINE}-axis-linux-gnu
932 echo ${UNAME_MACHINE}-axis-linux-${LIBC}
908933 exit ;;
909934 frv:Linux:*:*)
910 echo ${UNAME_MACHINE}-unknown-linux-gnu
935 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
911936 exit ;;
912937 hexagon:Linux:*:*)
913 echo ${UNAME_MACHINE}-unknown-linux-gnu
938 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
914939 exit ;;
915940 i*86:Linux:*:*)
916 LIBC=gnu
917 eval $set_cc_for_build
918 sed 's/^ //' << EOF >$dummy.c
919 #ifdef __dietlibc__
920 LIBC=dietlibc
921 #endif
922 EOF
923 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
924 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
941 echo ${UNAME_MACHINE}-pc-linux-${LIBC}
925942 exit ;;
926943 ia64:Linux:*:*)
927 echo ${UNAME_MACHINE}-unknown-linux-gnu
944 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
928945 exit ;;
929946 m32r*:Linux:*:*)
930 echo ${UNAME_MACHINE}-unknown-linux-gnu
947 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
931948 exit ;;
932949 m68*:Linux:*:*)
933 echo ${UNAME_MACHINE}-unknown-linux-gnu
950 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
934951 exit ;;
935952 mips:Linux:*:* | mips64:Linux:*:*)
936953 eval $set_cc_for_build
949966 #endif
950967 EOF
951968 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
952 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
969 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
953970 ;;
954 or32:Linux:*:*)
955 echo ${UNAME_MACHINE}-unknown-linux-gnu
971 openrisc*:Linux:*:*)
972 echo or1k-unknown-linux-${LIBC}
973 exit ;;
974 or32:Linux:*:* | or1k*:Linux:*:*)
975 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
956976 exit ;;
957977 padre:Linux:*:*)
958 echo sparc-unknown-linux-gnu
978 echo sparc-unknown-linux-${LIBC}
959979 exit ;;
960980 parisc64:Linux:*:* | hppa64:Linux:*:*)
961 echo hppa64-unknown-linux-gnu
981 echo hppa64-unknown-linux-${LIBC}
962982 exit ;;
963983 parisc:Linux:*:* | hppa:Linux:*:*)
964984 # Look for CPU level
965985 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
966 PA7*) echo hppa1.1-unknown-linux-gnu ;;
967 PA8*) echo hppa2.0-unknown-linux-gnu ;;
968 *) echo hppa-unknown-linux-gnu ;;
986 PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
987 PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
988 *) echo hppa-unknown-linux-${LIBC} ;;
969989 esac
970990 exit ;;
971991 ppc64:Linux:*:*)
972 echo powerpc64-unknown-linux-gnu
992 echo powerpc64-unknown-linux-${LIBC}
973993 exit ;;
974994 ppc:Linux:*:*)
975 echo powerpc-unknown-linux-gnu
995 echo powerpc-unknown-linux-${LIBC}
996 exit ;;
997 ppc64le:Linux:*:*)
998 echo powerpc64le-unknown-linux-${LIBC}
999 exit ;;
1000 ppcle:Linux:*:*)
1001 echo powerpcle-unknown-linux-${LIBC}
9761002 exit ;;
9771003 s390:Linux:*:* | s390x:Linux:*:*)
978 echo ${UNAME_MACHINE}-ibm-linux
1004 echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
9791005 exit ;;
9801006 sh64*:Linux:*:*)
981 echo ${UNAME_MACHINE}-unknown-linux-gnu
1007 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9821008 exit ;;
9831009 sh*:Linux:*:*)
984 echo ${UNAME_MACHINE}-unknown-linux-gnu
1010 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9851011 exit ;;
9861012 sparc:Linux:*:* | sparc64:Linux:*:*)
987 echo ${UNAME_MACHINE}-unknown-linux-gnu
1013 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9881014 exit ;;
9891015 tile*:Linux:*:*)
990 echo ${UNAME_MACHINE}-unknown-linux-gnu
1016 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9911017 exit ;;
9921018 vax:Linux:*:*)
993 echo ${UNAME_MACHINE}-dec-linux-gnu
1019 echo ${UNAME_MACHINE}-dec-linux-${LIBC}
9941020 exit ;;
9951021 x86_64:Linux:*:*)
996 echo ${UNAME_MACHINE}-unknown-linux-gnu
1022 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9971023 exit ;;
9981024 xtensa*:Linux:*:*)
999 echo ${UNAME_MACHINE}-unknown-linux-gnu
1025 echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10001026 exit ;;
10011027 i*86:DYNIX/ptx:4*:*)
10021028 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
12001226 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
12011227 echo i586-pc-haiku
12021228 exit ;;
1229 x86_64:Haiku:*:*)
1230 echo x86_64-unknown-haiku
1231 exit ;;
12031232 SX-4:SUPER-UX:*:*)
12041233 echo sx4-nec-superux${UNAME_RELEASE}
12051234 exit ;;
12261255 exit ;;
12271256 *:Darwin:*:*)
12281257 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1229 case $UNAME_PROCESSOR in
1230 i386)
1231 eval $set_cc_for_build
1232 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1233 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1234 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1235 grep IS_64BIT_ARCH >/dev/null
1236 then
1237 UNAME_PROCESSOR="x86_64"
1238 fi
1239 fi ;;
1240 unknown) UNAME_PROCESSOR=powerpc ;;
1241 esac
1258 eval $set_cc_for_build
1259 if test "$UNAME_PROCESSOR" = unknown ; then
1260 UNAME_PROCESSOR=powerpc
1261 fi
1262 if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
1263 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1264 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1265 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1266 grep IS_64BIT_ARCH >/dev/null
1267 then
1268 case $UNAME_PROCESSOR in
1269 i386) UNAME_PROCESSOR=x86_64 ;;
1270 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1271 esac
1272 fi
1273 fi
1274 elif test "$UNAME_PROCESSOR" = i386 ; then
1275 # Avoid executing cc on OS X 10.9, as it ships with a stub
1276 # that puts up a graphical alert prompting to install
1277 # developer tools. Any system running Mac OS X 10.7 or
1278 # later (Darwin 11 and later) is required to have a 64-bit
1279 # processor. This is not true of the ARM version of Darwin
1280 # that Apple uses in portable devices.
1281 UNAME_PROCESSOR=x86_64
1282 fi
12421283 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12431284 exit ;;
12441285 *:procnto*:*:* | *:QNX:[0123456789]*:*)
13291370 exit ;;
13301371 esac
13311372
1332 #echo '(No uname command or uname output not recognized.)' 1>&2
1333 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1334
1335 eval $set_cc_for_build
1336 cat >$dummy.c <<EOF
1337 #ifdef _SEQUENT_
1338 # include <sys/types.h>
1339 # include <sys/utsname.h>
1340 #endif
1341 main ()
1342 {
1343 #if defined (sony)
1344 #if defined (MIPSEB)
1345 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
1346 I don't know.... */
1347 printf ("mips-sony-bsd\n"); exit (0);
1348 #else
1349 #include <sys/param.h>
1350 printf ("m68k-sony-newsos%s\n",
1351 #ifdef NEWSOS4
1352 "4"
1353 #else
1354 ""
1355 #endif
1356 ); exit (0);
1357 #endif
1358 #endif
1359
1360 #if defined (__arm) && defined (__acorn) && defined (__unix)
1361 printf ("arm-acorn-riscix\n"); exit (0);
1362 #endif
1363
1364 #if defined (hp300) && !defined (hpux)
1365 printf ("m68k-hp-bsd\n"); exit (0);
1366 #endif
1367
1368 #if defined (NeXT)
1369 #if !defined (__ARCHITECTURE__)
1370 #define __ARCHITECTURE__ "m68k"
1371 #endif
1372 int version;
1373 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1374 if (version < 4)
1375 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1376 else
1377 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1378 exit (0);
1379 #endif
1380
1381 #if defined (MULTIMAX) || defined (n16)
1382 #if defined (UMAXV)
1383 printf ("ns32k-encore-sysv\n"); exit (0);
1384 #else
1385 #if defined (CMU)
1386 printf ("ns32k-encore-mach\n"); exit (0);
1387 #else
1388 printf ("ns32k-encore-bsd\n"); exit (0);
1389 #endif
1390 #endif
1391 #endif
1392
1393 #if defined (__386BSD__)
1394 printf ("i386-pc-bsd\n"); exit (0);
1395 #endif
1396
1397 #if defined (sequent)
1398 #if defined (i386)
1399 printf ("i386-sequent-dynix\n"); exit (0);
1400 #endif
1401 #if defined (ns32000)
1402 printf ("ns32k-sequent-dynix\n"); exit (0);
1403 #endif
1404 #endif
1405
1406 #if defined (_SEQUENT_)
1407 struct utsname un;
1408
1409 uname(&un);
1410
1411 if (strncmp(un.version, "V2", 2) == 0) {
1412 printf ("i386-sequent-ptx2\n"); exit (0);
1413 }
1414 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1415 printf ("i386-sequent-ptx1\n"); exit (0);
1416 }
1417 printf ("i386-sequent-ptx\n"); exit (0);
1418
1419 #endif
1420
1421 #if defined (vax)
1422 # if !defined (ultrix)
1423 # include <sys/param.h>
1424 # if defined (BSD)
1425 # if BSD == 43
1426 printf ("vax-dec-bsd4.3\n"); exit (0);
1427 # else
1428 # if BSD == 199006
1429 printf ("vax-dec-bsd4.3reno\n"); exit (0);
1430 # else
1431 printf ("vax-dec-bsd\n"); exit (0);
1432 # endif
1433 # endif
1434 # else
1435 printf ("vax-dec-bsd\n"); exit (0);
1436 # endif
1437 # else
1438 printf ("vax-dec-ultrix\n"); exit (0);
1439 # endif
1440 #endif
1441
1442 #if defined (alliant) && defined (i860)
1443 printf ("i860-alliant-bsd\n"); exit (0);
1444 #endif
1445
1446 exit (1);
1447 }
1448 EOF
1449
1450 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1451 { echo "$SYSTEM_NAME"; exit; }
1452
1453 # Apollos put the system type in the environment.
1454
1455 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1456
1457 # Convex versions that predate uname can use getsysinfo(1)
1458
1459 if [ -x /usr/convex/getsysinfo ]
1460 then
1461 case `getsysinfo -f cpu_type` in
1462 c1*)
1463 echo c1-convex-bsd
1464 exit ;;
1465 c2*)
1466 if getsysinfo -f scalar_acc
1467 then echo c32-convex-bsd
1468 else echo c2-convex-bsd
1469 fi
1470 exit ;;
1471 c34*)
1472 echo c34-convex-bsd
1473 exit ;;
1474 c38*)
1475 echo c38-convex-bsd
1476 exit ;;
1477 c4*)
1478 echo c4-convex-bsd
1479 exit ;;
1480 esac
1481 fi
1482
14831373 cat >&2 <<EOF
14841374 $0: unable to guess system type
14851375
00 #! /bin/sh
11 # Configuration validation subroutine script.
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
4 # 2011, 2012 Free Software Foundation, Inc.
5
6 timestamp='2012-04-18'
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
2 # Copyright 1992-2014 Free Software Foundation, Inc.
3
4 timestamp='2014-09-11'
5
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
159 # (at your option) any later version.
1610 #
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.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
2115 #
2216 # You should have received a copy of the GNU General Public License
2317 # along with this program; if not, see <http://www.gnu.org/licenses/>.
2519 # As a special exception to the GNU General Public License, if you
2620 # distribute this file as part of a program that contains a
2721 # configuration script generated by Autoconf, you may include it under
28 # the same distribution terms that you use for the rest of that program.
29
30
31 # Please send patches to <config-patches@gnu.org>. Submit a context
32 # diff and a properly formatted GNU ChangeLog entry.
22 # the same distribution terms that you use for the rest of that
23 # program. This Exception is an additional permission under section 7
24 # of the GNU General Public License, version 3 ("GPLv3").
25
26
27 # Please send patches with a ChangeLog entry to config-patches@gnu.org.
3328 #
3429 # Configuration subroutine to validate and canonicalize a configuration type.
3530 # Supply the specified configuration type as an argument.
7267 version="\
7368 GNU config.sub ($timestamp)
7469
75 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
76 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
77 Free Software Foundation, Inc.
70 Copyright 1992-2014 Free Software Foundation, Inc.
7871
7972 This is free software; see the source for copying conditions. There is NO
8073 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
122115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
123116 case $maybe_os in
124117 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
125 linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
118 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
126119 knetbsd*-gnu* | netbsd*-gnu* | \
127120 kopensolaris*-gnu* | \
128121 storm-chaos* | os2-emx* | rtmk-nova*)
155148 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
156149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
157150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
158 -apple | -axis | -knuth | -cray | -microblaze)
151 -apple | -axis | -knuth | -cray | -microblaze*)
159152 os=
160153 basic_machine=$1
161154 ;;
258251 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
259252 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
260253 | am33_2.0 \
261 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
262 | be32 | be64 \
254 | arc | arceb \
255 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256 | avr | avr32 \
257 | be32 | be64 \
263258 | bfin \
264 | c4x | clipper \
259 | c4x | c8051 | clipper \
265260 | d10v | d30v | dlx | dsp16xx \
266261 | epiphany \
267262 | fido | fr30 | frv \
269264 | hexagon \
270265 | i370 | i860 | i960 | ia64 \
271266 | ip2k | iq2000 \
267 | k1om \
272268 | le32 | le64 \
273269 | lm32 \
274270 | m32c | m32r | m32rle | m68000 | m68k | m88k \
275 | maxq | mb | microblaze | mcore | mep | metag \
271 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
276272 | mips | mipsbe | mipseb | mipsel | mipsle \
277273 | mips16 \
278274 | mips64 | mips64el \
286282 | mips64vr5900 | mips64vr5900el \
287283 | mipsisa32 | mipsisa32el \
288284 | mipsisa32r2 | mipsisa32r2el \
285 | mipsisa32r6 | mipsisa32r6el \
289286 | mipsisa64 | mipsisa64el \
290287 | mipsisa64r2 | mipsisa64r2el \
288 | mipsisa64r6 | mipsisa64r6el \
291289 | mipsisa64sb1 | mipsisa64sb1el \
292290 | mipsisa64sr71k | mipsisa64sr71kel \
291 | mipsr5900 | mipsr5900el \
293292 | mipstx39 | mipstx39el \
294293 | mn10200 | mn10300 \
295294 | moxie \
296295 | mt \
297296 | msp430 \
298297 | nds32 | nds32le | nds32be \
299 | nios | nios2 \
298 | nios | nios2 | nios2eb | nios2el \
300299 | ns16k | ns32k \
301 | open8 \
302 | or32 \
300 | open8 | or1k | or1knd | or32 \
303301 | pdp10 | pdp11 | pj | pjl \
304302 | powerpc | powerpc64 | powerpc64le | powerpcle \
305303 | pyramid \
304 | riscv32 | riscv64 \
306305 | rl78 | rx \
307306 | score \
308307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
327326 c6x)
328327 basic_machine=tic6x-unknown
329328 ;;
330 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
329 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
331330 basic_machine=$basic_machine-unknown
332331 os=-none
333332 ;;
369368 | aarch64-* | aarch64_be-* \
370369 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
371370 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
372 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
371 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
373372 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
374373 | avr-* | avr32-* \
375374 | be32-* | be64-* \
376375 | bfin-* | bs2000-* \
377376 | c[123]* | c30-* | [cjt]90-* | c4x-* \
378 | clipper-* | craynv-* | cydra-* \
377 | c8051-* | clipper-* | craynv-* | cydra-* \
379378 | d10v-* | d30v-* | dlx-* \
380379 | elxsi-* \
381380 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
384383 | hexagon-* \
385384 | i*86-* | i860-* | i960-* | ia64-* \
386385 | ip2k-* | iq2000-* \
386 | k1om-* \
387387 | le32-* | le64-* \
388388 | lm32-* \
389389 | m32c-* | m32r-* | m32rle-* \
390390 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
391 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
391 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
392 | microblaze-* | microblazeel-* \
392393 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
393394 | mips16-* \
394395 | mips64-* | mips64el-* \
402403 | mips64vr5900-* | mips64vr5900el-* \
403404 | mipsisa32-* | mipsisa32el-* \
404405 | mipsisa32r2-* | mipsisa32r2el-* \
406 | mipsisa32r6-* | mipsisa32r6el-* \
405407 | mipsisa64-* | mipsisa64el-* \
406408 | mipsisa64r2-* | mipsisa64r2el-* \
409 | mipsisa64r6-* | mipsisa64r6el-* \
407410 | mipsisa64sb1-* | mipsisa64sb1el-* \
408411 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
412 | mipsr5900-* | mipsr5900el-* \
409413 | mipstx39-* | mipstx39el-* \
410414 | mmix-* \
411415 | mt-* \
412416 | msp430-* \
413417 | nds32-* | nds32le-* | nds32be-* \
414 | nios-* | nios2-* \
418 | nios-* | nios2-* | nios2eb-* | nios2el-* \
415419 | none-* | np1-* | ns16k-* | ns32k-* \
416420 | open8-* \
421 | or1k*-* \
417422 | orion-* \
418423 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
419424 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
787792 basic_machine=ns32k-utek
788793 os=-sysv
789794 ;;
790 microblaze)
795 microblaze*)
791796 basic_machine=microblaze-xilinx
792797 ;;
798 mingw64)
799 basic_machine=x86_64-pc
800 os=-mingw64
801 ;;
793802 mingw32)
794 basic_machine=i386-pc
803 basic_machine=i686-pc
795804 os=-mingw32
796805 ;;
797806 mingw32ce)
819828 basic_machine=powerpc-unknown
820829 os=-morphos
821830 ;;
831 moxiebox)
832 basic_machine=moxie-unknown
833 os=-moxiebox
834 ;;
822835 msdos)
823836 basic_machine=i386-pc
824837 os=-msdos
827840 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
828841 ;;
829842 msys)
830 basic_machine=i386-pc
843 basic_machine=i686-pc
831844 os=-msys
832845 ;;
833846 mvs)
10181031 basic_machine=i586-unknown
10191032 os=-pw32
10201033 ;;
1021 rdos)
1034 rdos | rdos64)
1035 basic_machine=x86_64-pc
1036 os=-rdos
1037 ;;
1038 rdos32)
10221039 basic_machine=i386-pc
10231040 os=-rdos
10241041 ;;
13451362 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
13461363 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
13471364 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1348 | -sym* | -kopensolaris* \
1365 | -sym* | -kopensolaris* | -plan9* \
13491366 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
13501367 | -aos* | -aros* \
13511368 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13521369 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13531370 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1354 | -openbsd* | -solidbsd* \
1371 | -bitrig* | -openbsd* | -solidbsd* \
13551372 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13561373 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13571374 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13581375 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
13591376 | -chorusos* | -chorusrdb* | -cegcc* \
13601377 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1361 | -mingw32* | -linux-gnu* | -linux-android* \
1362 | -linux-newlib* | -linux-uclibc* \
1363 | -uxpv* | -beos* | -mpeix* | -udk* \
1378 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1379 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1380 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
13641381 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13651382 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13661383 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13671384 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13681385 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13691386 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1370 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1387 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
13711388 # Remember, each alternative MUST END IN *, to match a version number.
13721389 ;;
13731390 -qnx*)
14911508 -aros*)
14921509 os=-aros
14931510 ;;
1494 -kaos*)
1495 os=-kaos
1496 ;;
14971511 -zvmoe)
14981512 os=-zvmoe
14991513 ;;
15411555 ;;
15421556 c4x-* | tic4x-*)
15431557 os=-coff
1558 ;;
1559 c8051-*)
1560 os=-elf
15441561 ;;
15451562 hexagon-*)
15461563 os=-elf
+970
-1309
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for getdns 0.3.1.
2 # Generated by GNU Autoconf 2.69 for getdns 0.3.2.
33 #
44 # Report bugs to <stub-resolver@verisignlabs.com>.
55 #
589589 # Identity of this package.
590590 PACKAGE_NAME='getdns'
591591 PACKAGE_TARNAME='getdns'
592 PACKAGE_VERSION='0.3.1'
593 PACKAGE_STRING='getdns 0.3.1'
592 PACKAGE_VERSION='0.3.2'
593 PACKAGE_STRING='getdns 0.3.2'
594594 PACKAGE_BUGREPORT='stub-resolver@verisignlabs.com'
595 PACKAGE_URL='http://getdnsapi.net'
595 PACKAGE_URL='https://getdnsapi.net'
596596
597597 ac_unique_file="src/getdns/getdns.h.in"
598598 # Factoring default headers for most tests.
658658 PKG_CONFIG_PATH
659659 PKG_CONFIG
660660 DOXYGEN
661 UNINSTALL_GETDNS_QUERY
662 INSTALL_GETDNS_QUERY
663 GETDNS_QUERY
661664 RUNTIME_PATH
662665 HAVE_SSL
663666 INSTALL_DATA
664667 INSTALL_SCRIPT
665668 INSTALL_PROGRAM
666 LT_SYS_LIBRARY_PATH
667669 OTOOL64
668670 OTOOL
669671 LIPO
757759 enable_static
758760 with_pic
759761 enable_fast_install
760 with_aix_soname
761762 with_gnu_ld
762763 with_sysroot
763764 enable_libtool_lock
769770 enable_native_stub_dnssec
770771 with_ssl
771772 enable_draft_edns_cookies
773 enable_stub_only
774 with_getdns_query
772775 with_libidn
773776 with_libldns
774777 with_libunbound
786789 LIBS
787790 CPPFLAGS
788791 CPP
789 LT_SYS_LIBRARY_PATH
790792 PKG_CONFIG
791793 PKG_CONFIG_PATH
792794 PKG_CONFIG_LIBDIR
13321334 # Omit some internal or obsolete options to make the list less imposing.
13331335 # This message is too long to be a string in the A/UX 3.1 sh.
13341336 cat <<_ACEOF
1335 \`configure' configures getdns 0.3.1 to adapt to many kinds of systems.
1337 \`configure' configures getdns 0.3.2 to adapt to many kinds of systems.
13361338
13371339 Usage: $0 [OPTION]... [VAR=VALUE]...
13381340
13971399
13981400 if test -n "$ac_init_help"; then
13991401 case $ac_init_help in
1400 short | recursive ) echo "Configuration of getdns 0.3.1:";;
1402 short | recursive ) echo "Configuration of getdns 0.3.2:";;
14011403 esac
14021404 cat <<\_ACEOF
14031405
14191421 Disable native stub DNSSEC support
14201422 --enable-draft-edns-cookies
14211423 Enable experimental edns cookies
1424 --enable-stub-only Restricts resolution modes to STUB (which will be
1425 the default mode). Removes the libunbound
1426 dependency.
14221427
14231428 Optional Packages:
14241429 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
14281433
14291434 --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
14301435 both]
1431 --with-aix-soname=aix|svr4|both
1432 shared library versioning (aka "SONAME") variant to
1433 provide on AIX, [default=aix].
14341436 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1435 --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
1436 compiler's sysroot if not specified).
1437 --with-sysroot=DIR Search for dependent libraries within DIR
1438 (or the compiler's sysroot if not specified).
14371439 --with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl
14381440 /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw
14391441 /usr)
1442 --with-getdns_query Also compile and install the getdns_query tool
14401443 --with-libidn=pathname path to libidn (default: search /usr/local ..)
14411444 --with-libldns=pathname path to libldns (default: search /usr/local ..)
14421445 --with-libunbound=pathname
14571460 CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
14581461 you have headers in a nonstandard directory <include dir>
14591462 CPP C preprocessor
1460 LT_SYS_LIBRARY_PATH
1461 User-defined run-time library search path.
14621463 PKG_CONFIG path to pkg-config utility
14631464 PKG_CONFIG_PATH
14641465 directories to add to pkg-config's search path
14721473 it to find libraries and programs with nonstandard names/locations.
14731474
14741475 Report bugs to <stub-resolver@verisignlabs.com>.
1475 getdns home page: <http://getdnsapi.net>.
1476 getdns home page: <https://getdnsapi.net>.
14761477 _ACEOF
14771478 ac_status=$?
14781479 fi
15351536 test -n "$ac_init_help" && exit $ac_status
15361537 if $ac_init_version; then
15371538 cat <<\_ACEOF
1538 getdns configure 0.3.1
1539 getdns configure 0.3.2
15391540 generated by GNU Autoconf 2.69
15401541
15411542 Copyright (C) 2012 Free Software Foundation, Inc.
20242025 This file contains any messages produced by compilers while
20252026 running configure, to aid debugging if configure makes a mistake.
20262027
2027 It was created by getdns $as_me 0.3.1, which was
2028 It was created by getdns $as_me 0.3.2, which was
20282029 generated by GNU Autoconf 2.69. Invocation command line was
20292030
20302031 $ $0 $@
23722373 ac_compiler_gnu=$ac_cv_c_compiler_gnu
23732374
23742375
2376 RELEASE_CANDIDATE=rc1
23752377
23762378
23772379 # Set current date from system if not set
23842386 fi
23852387
23862388
2387 GETDNS_VERSION="0.3.1$RELEASE_CANDIDATE"
2388
2389 GETDNS_NUMERIC_VERSION=0x00030000
2389 GETDNS_VERSION="0.3.2$RELEASE_CANDIDATE"
2390
2391 GETDNS_NUMERIC_VERSION=0x00030101
23902392
23912393 API_VERSION="July 2015"
23922394
24132415 # getdns-0.1.8 had libversion 1:3:0 (but should have had 2:1:1)
24142416 # getdns-0.2.0 had libversion 2:2:1
24152417 # getdns-0.3.0 had libversion 3:3:2
2416 # getdns-0.3.1 has libversion 3:4:2
2418 # getdns-0.3.1 had libversion 3:4:2
2419 # getdns-0.3.2 has libversion 3:5:2
24172420 #
2418 GETDNS_LIBVERSION=3:3:2
2421 GETDNS_LIBVERSION=3:5:2
24192422
24202423
24212424
37253728
37263729
37273730
3728 macro_version='2.4.6'
3729 macro_revision='2.4.6'
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743 ltmain=$ac_aux_dir/ltmain.sh
3731 macro_version='2.4.2'
3732 macro_revision='1.3337'
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746 ltmain="$ac_aux_dir/ltmain.sh"
37443747
37453748 # Backslashify metacharacters that are still active within
37463749 # double-quoted strings.
37893792 $ECHO ""
37903793 }
37913794
3792 case $ECHO in
3795 case "$ECHO" in
37933796 printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
37943797 $as_echo "printf" >&6; } ;;
37953798 print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
41124115
41134116 # Check whether --with-gnu-ld was given.
41144117 if test "${with_gnu_ld+set}" = set; then :
4115 withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
4118 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
41164119 else
41174120 with_gnu_ld=no
41184121 fi
41194122
41204123 ac_prog=ld
4121 if test yes = "$GCC"; then
4124 if test "$GCC" = yes; then
41224125 # Check if gcc -print-prog-name=ld gives a path.
41234126 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
41244127 $as_echo_n "checking for ld used by $CC... " >&6; }
41254128 case $host in
41264129 *-*-mingw*)
4127 # gcc leaves a trailing carriage return, which upsets mingw
4130 # gcc leaves a trailing carriage return which upsets mingw
41284131 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
41294132 *)
41304133 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
41384141 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
41394142 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
41404143 done
4141 test -z "$LD" && LD=$ac_prog
4144 test -z "$LD" && LD="$ac_prog"
41424145 ;;
41434146 "")
41444147 # If it fails, then pretend we aren't using GCC.
41494152 with_gnu_ld=unknown
41504153 ;;
41514154 esac
4152 elif test yes = "$with_gnu_ld"; then
4155 elif test "$with_gnu_ld" = yes; then
41534156 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
41544157 $as_echo_n "checking for GNU ld... " >&6; }
41554158 else
41604163 $as_echo_n "(cached) " >&6
41614164 else
41624165 if test -z "$LD"; then
4163 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
4166 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
41644167 for ac_dir in $PATH; do
4165 IFS=$lt_save_ifs
4168 IFS="$lt_save_ifs"
41664169 test -z "$ac_dir" && ac_dir=.
41674170 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4168 lt_cv_path_LD=$ac_dir/$ac_prog
4171 lt_cv_path_LD="$ac_dir/$ac_prog"
41694172 # Check to see if the program is GNU ld. I'd rather use --version,
41704173 # but apparently some variants of GNU ld only accept -v.
41714174 # Break only if it was the GNU/non-GNU ld that we prefer.
41724175 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
41734176 *GNU* | *'with BFD'*)
4174 test no != "$with_gnu_ld" && break
4177 test "$with_gnu_ld" != no && break
41754178 ;;
41764179 *)
4177 test yes != "$with_gnu_ld" && break
4180 test "$with_gnu_ld" != yes && break
41784181 ;;
41794182 esac
41804183 fi
41814184 done
4182 IFS=$lt_save_ifs
4183 else
4184 lt_cv_path_LD=$LD # Let the user override the test with a path.
4185 fi
4186 fi
4187
4188 LD=$lt_cv_path_LD
4185 IFS="$lt_save_ifs"
4186 else
4187 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4188 fi
4189 fi
4190
4191 LD="$lt_cv_path_LD"
41894192 if test -n "$LD"; then
41904193 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
41914194 $as_echo "$LD" >&6; }
42284231 else
42294232 if test -n "$NM"; then
42304233 # Let the user override the test.
4231 lt_cv_path_NM=$NM
4232 else
4233 lt_nm_to_check=${ac_tool_prefix}nm
4234 lt_cv_path_NM="$NM"
4235 else
4236 lt_nm_to_check="${ac_tool_prefix}nm"
42344237 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
42354238 lt_nm_to_check="$lt_nm_to_check nm"
42364239 fi
42374240 for lt_tmp_nm in $lt_nm_to_check; do
4238 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
4241 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
42394242 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4240 IFS=$lt_save_ifs
4243 IFS="$lt_save_ifs"
42414244 test -z "$ac_dir" && ac_dir=.
4242 tmp_nm=$ac_dir/$lt_tmp_nm
4243 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
4245 tmp_nm="$ac_dir/$lt_tmp_nm"
4246 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
42444247 # Check to see if the nm accepts a BSD-compat flag.
4245 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
4248 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
42464249 # nm: unknown option "B" ignored
42474250 # Tru64's nm complains that /dev/null is an invalid object file
4248 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
4249 case $build_os in
4250 mingw*) lt_bad_file=conftest.nm/nofile ;;
4251 *) lt_bad_file=/dev/null ;;
4252 esac
4253 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
4254 *$lt_bad_file* | *'Invalid file or object type'*)
4251 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4252 */dev/null* | *'Invalid file or object type'*)
42554253 lt_cv_path_NM="$tmp_nm -B"
4256 break 2
4254 break
42574255 ;;
42584256 *)
42594257 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
42604258 */dev/null*)
42614259 lt_cv_path_NM="$tmp_nm -p"
4262 break 2
4260 break
42634261 ;;
42644262 *)
42654263 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
42704268 esac
42714269 fi
42724270 done
4273 IFS=$lt_save_ifs
4271 IFS="$lt_save_ifs"
42744272 done
42754273 : ${lt_cv_path_NM=no}
42764274 fi
42774275 fi
42784276 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
42794277 $as_echo "$lt_cv_path_NM" >&6; }
4280 if test no != "$lt_cv_path_NM"; then
4281 NM=$lt_cv_path_NM
4278 if test "$lt_cv_path_NM" != "no"; then
4279 NM="$lt_cv_path_NM"
42824280 else
42834281 # Didn't find any BSD compatible name lister, look for dumpbin.
42844282 if test -n "$DUMPBIN"; then :
43844382 fi
43854383 fi
43864384
4387 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
4385 case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
43884386 *COFF*)
4389 DUMPBIN="$DUMPBIN -symbols -headers"
4387 DUMPBIN="$DUMPBIN -symbols"
43904388 ;;
43914389 *)
43924390 DUMPBIN=:
43944392 esac
43954393 fi
43964394
4397 if test : != "$DUMPBIN"; then
4398 NM=$DUMPBIN
4395 if test "$DUMPBIN" != ":"; then
4396 NM="$DUMPBIN"
43994397 fi
44004398 fi
44014399 test -z "$NM" && NM=nm
44464444 $as_echo_n "(cached) " >&6
44474445 else
44484446 i=0
4449 teststring=ABCD
4447 teststring="ABCD"
44504448
44514449 case $build_os in
44524450 msdosdjgpp*)
44864484 lt_cv_sys_max_cmd_len=8192;
44874485 ;;
44884486
4489 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
4487 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
44904488 # This has been around since 386BSD, at least. Likely further.
44914489 if test -x /sbin/sysctl; then
44924490 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
45374535 *)
45384536 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
45394537 if test -n "$lt_cv_sys_max_cmd_len" && \
4540 test undefined != "$lt_cv_sys_max_cmd_len"; then
4538 test undefined != "$lt_cv_sys_max_cmd_len"; then
45414539 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
45424540 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
45434541 else
45444542 # Make teststring a little bigger before we do anything with it.
45454543 # a 1K string should be a reasonable start.
4546 for i in 1 2 3 4 5 6 7 8; do
4544 for i in 1 2 3 4 5 6 7 8 ; do
45474545 teststring=$teststring$teststring
45484546 done
45494547 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
45504548 # If test is not a shell built-in, we'll probably end up computing a
45514549 # maximum length that is only half of the actual maximum length, but
45524550 # we can't tell.
4553 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
4551 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
45544552 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
4555 test 17 != "$i" # 1/2 MB should be enough
4553 test $i != 17 # 1/2 MB should be enough
45564554 do
45574555 i=`expr $i + 1`
45584556 teststring=$teststring$teststring
45704568
45714569 fi
45724570
4573 if test -n "$lt_cv_sys_max_cmd_len"; then
4571 if test -n $lt_cv_sys_max_cmd_len ; then
45744572 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
45754573 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
45764574 else
45874585 : ${CP="cp -f"}
45884586 : ${MV="mv -f"}
45894587 : ${RM="rm -f"}
4588
4589 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
4590 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
4591 # Try some XSI features
4592 xsi_shell=no
4593 ( _lt_dummy="a/b/c"
4594 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
4595 = c,a/b,b/c, \
4596 && eval 'test $(( 1 + 1 )) -eq 2 \
4597 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
4598 && xsi_shell=yes
4599 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
4600 $as_echo "$xsi_shell" >&6; }
4601
4602
4603 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
4604 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
4605 lt_shell_append=no
4606 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
4607 >/dev/null 2>&1 \
4608 && lt_shell_append=yes
4609 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
4610 $as_echo "$lt_shell_append" >&6; }
4611
45904612
45914613 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
45924614 lt_unset=unset
47104732 reload_cmds='$LD$reload_flag -o $output$reload_objs'
47114733 case $host_os in
47124734 cygwin* | mingw* | pw32* | cegcc*)
4713 if test yes != "$GCC"; then
4735 if test "$GCC" != yes; then
47144736 reload_cmds=false
47154737 fi
47164738 ;;
47174739 darwin*)
4718 if test yes = "$GCC"; then
4719 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
4740 if test "$GCC" = yes; then
4741 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
47204742 else
47214743 reload_cmds='$LD$reload_flag -o $output$reload_objs'
47224744 fi
48444866 # Need to set the preceding variable on all platforms that support
48454867 # interlibrary dependencies.
48464868 # 'none' -- dependencies not supported.
4847 # 'unknown' -- same as none, but documents that we really don't know.
4869 # `unknown' -- same as none, but documents that we really don't know.
48484870 # 'pass_all' -- all dependencies passed with no checks.
48494871 # 'test_compile' -- check by making test program.
48504872 # 'file_magic [[regex]]' -- check by looking for files in library path
4851 # that responds to the $file_magic_cmd with a given extended regex.
4852 # If you have 'file' or equivalent on your system and you're not sure
4853 # whether 'pass_all' will *always* work, you probably want this one.
4873 # which responds to the $file_magic_cmd with a given extended regex.
4874 # If you have `file' or equivalent on your system and you're not sure
4875 # whether `pass_all' will *always* work, you probably want this one.
48544876
48554877 case $host_os in
48564878 aix[4-9]*)
48774899 # Base MSYS/MinGW do not provide the 'file' command needed by
48784900 # func_win32_libid shell function, so use a weaker test based on 'objdump',
48794901 # unless we find 'file', for example because we are cross-compiling.
4880 if ( file / ) >/dev/null 2>&1; then
4902 # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
4903 if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
48814904 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
48824905 lt_cv_file_magic_cmd='func_win32_libid'
48834906 else
49554978 lt_cv_deplibs_check_method=pass_all
49564979 ;;
49574980
4958 netbsd*)
4981 netbsd* | netbsdelf*-gnu)
49594982 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
49604983 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
49614984 else
49734996 lt_cv_deplibs_check_method=pass_all
49744997 ;;
49754998
4976 openbsd* | bitrig*)
4977 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
4999 openbsd*)
5000 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
49785001 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
49795002 else
49805003 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
50275050 tpf*)
50285051 lt_cv_deplibs_check_method=pass_all
50295052 ;;
5030 os2*)
5031 lt_cv_deplibs_check_method=pass_all
5032 ;;
50335053 esac
50345054
50355055 fi
51875207
51885208 case $host_os in
51895209 cygwin* | mingw* | pw32* | cegcc*)
5190 # two different shell functions defined in ltmain.sh;
5191 # decide which one to use based on capabilities of $DLLTOOL
5210 # two different shell functions defined in ltmain.sh
5211 # decide which to use based on capabilities of $DLLTOOL
51925212 case `$DLLTOOL --help 2>&1` in
51935213 *--identify-strict*)
51945214 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
52005220 ;;
52015221 *)
52025222 # fallback: assume linklib IS sharedlib
5203 lt_cv_sharedlib_from_linklib_cmd=$ECHO
5223 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
52045224 ;;
52055225 esac
52065226
53545374 ac_status=$?
53555375 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
53565376 test $ac_status = 0; }
5357 if test 0 -eq "$ac_status"; then
5377 if test "$ac_status" -eq 0; then
53585378 # Ensure the archiver fails upon bogus file names.
53595379 rm -f conftest.$ac_objext libconftest.a
53605380 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
53625382 ac_status=$?
53635383 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
53645384 test $ac_status = 0; }
5365 if test 0 -ne "$ac_status"; then
5385 if test "$ac_status" -ne 0; then
53665386 lt_cv_ar_at_file=@
53675387 fi
53685388 fi
53755395 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
53765396 $as_echo "$lt_cv_ar_at_file" >&6; }
53775397
5378 if test no = "$lt_cv_ar_at_file"; then
5398 if test "x$lt_cv_ar_at_file" = xno; then
53795399 archiver_list_spec=
53805400 else
53815401 archiver_list_spec=$lt_cv_ar_at_file
55925612
55935613 if test -n "$RANLIB"; then
55945614 case $host_os in
5595 bitrig* | openbsd*)
5615 openbsd*)
55965616 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
55975617 ;;
55985618 *)
57245744 symcode='[ABCDGISTW]'
57255745 ;;
57265746 hpux*)
5727 if test ia64 = "$host_cpu"; then
5747 if test "$host_cpu" = ia64; then
57285748 symcode='[ABCDEGRST]'
57295749 fi
57305750 ;;
57575777 symcode='[ABCDGIRSTW]' ;;
57585778 esac
57595779
5760 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5761 # Gets list of data symbols to import.
5762 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
5763 # Adjust the below global symbol transforms to fixup imported variables.
5764 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
5765 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
5766 lt_c_name_lib_hook="\
5767 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
5768 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
5769 else
5770 # Disable hooks by default.
5771 lt_cv_sys_global_symbol_to_import=
5772 lt_cdecl_hook=
5773 lt_c_name_hook=
5774 lt_c_name_lib_hook=
5775 fi
5776
57775780 # Transform an extracted symbol line into a proper C declaration.
57785781 # Some systems (esp. on ia64) link data and code symbols differently,
57795782 # so use this general approach.
5780 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
5781 $lt_cdecl_hook\
5782 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
5783 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
5783 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
57845784
57855785 # Transform an extracted symbol line into symbol name and symbol address
5786 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
5787 $lt_c_name_hook\
5788 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
5789 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
5790
5791 # Transform an extracted symbol line into symbol name with lib prefix and
5792 # symbol address.
5793 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
5794 $lt_c_name_lib_hook\
5795 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
5796 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
5797 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
5786 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
5787 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
57985788
57995789 # Handle CRLF in mingw tool chain
58005790 opt_cr=
58125802
58135803 # Write the raw and C identifiers.
58145804 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5815 # Fake it for dumpbin and say T for any non-static function,
5816 # D for any global variable and I for any imported variable.
5805 # Fake it for dumpbin and say T for any non-static function
5806 # and D for any global variable.
58175807 # Also find C++ and __fastcall symbols from MSVC++,
58185808 # which start with @ or ?.
58195809 lt_cv_sys_global_symbol_pipe="$AWK '"\
58205810 " {last_section=section; section=\$ 3};"\
58215811 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
58225812 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5823 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
5824 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
5825 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
58265813 " \$ 0!~/External *\|/{next};"\
58275814 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
58285815 " {if(hide[section]) next};"\
5829 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
5830 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
5831 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
5832 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
5816 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5817 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5818 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
5819 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
58335820 " ' prfx=^$ac_symprfx"
58345821 else
58355822 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
58775864 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
58785865 cat <<_LT_EOF > conftest.$ac_ext
58795866 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
5880 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
5881 /* DATA imports from DLLs on WIN32 can't be const, because runtime
5867 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
5868 /* DATA imports from DLLs on WIN32 con't be const, because runtime
58825869 relocations are performed -- see ld's documentation on pseudo-relocs. */
58835870 # define LT_DLSYM_CONST
5884 #elif defined __osf__
5871 #elif defined(__osf__)
58855872 /* This system does not cope well with relocations in const data. */
58865873 # define LT_DLSYM_CONST
58875874 #else
59075894 {
59085895 { "@PROGRAM@", (void *) 0 },
59095896 _LT_EOF
5910 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5897 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
59115898 cat <<\_LT_EOF >> conftest.$ac_ext
59125899 {0, (void *) 0}
59135900 };
59275914 mv conftest.$ac_objext conftstm.$ac_objext
59285915 lt_globsym_save_LIBS=$LIBS
59295916 lt_globsym_save_CFLAGS=$CFLAGS
5930 LIBS=conftstm.$ac_objext
5917 LIBS="conftstm.$ac_objext"
59315918 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
59325919 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
59335920 (eval $ac_link) 2>&5
59345921 ac_status=$?
59355922 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5936 test $ac_status = 0; } && test -s conftest$ac_exeext; then
5923 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
59375924 pipe_works=yes
59385925 fi
59395926 LIBS=$lt_globsym_save_LIBS
59545941 rm -rf conftest* conftst*
59555942
59565943 # Do not use the global_symbol_pipe unless it works.
5957 if test yes = "$pipe_works"; then
5944 if test "$pipe_works" = yes; then
59585945 break
59595946 else
59605947 lt_cv_sys_global_symbol_pipe=
60075994
60085995
60095996
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
60205997 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
60215998 $as_echo_n "checking for sysroot... " >&6; }
60225999
60296006
60306007
60316008 lt_sysroot=
6032 case $with_sysroot in #(
6009 case ${with_sysroot} in #(
60336010 yes)
6034 if test yes = "$GCC"; then
6011 if test "$GCC" = yes; then
60356012 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
60366013 fi
60376014 ;; #(
60416018 no|'')
60426019 ;; #(
60436020 *)
6044 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
6045 $as_echo "$with_sysroot" >&6; }
6021 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
6022 $as_echo "${with_sysroot}" >&6; }
60466023 as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
60476024 ;;
60486025 esac
60546031
60556032
60566033
6057 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
6058 $as_echo_n "checking for a working dd... " >&6; }
6059 if ${ac_cv_path_lt_DD+:} false; then :
6060 $as_echo_n "(cached) " >&6
6061 else
6062 printf 0123456789abcdef0123456789abcdef >conftest.i
6063 cat conftest.i conftest.i >conftest2.i
6064 : ${lt_DD:=$DD}
6065 if test -z "$lt_DD"; then
6066 ac_path_lt_DD_found=false
6067 # Loop through the user's path and test for each of PROGNAME-LIST
6068 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6069 for as_dir in $PATH
6070 do
6071 IFS=$as_save_IFS
6072 test -z "$as_dir" && as_dir=.
6073 for ac_prog in dd; do
6074 for ac_exec_ext in '' $ac_executable_extensions; do
6075 ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
6076 as_fn_executable_p "$ac_path_lt_DD" || continue
6077 if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6078 cmp -s conftest.i conftest.out \
6079 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
6080 fi
6081 $ac_path_lt_DD_found && break 3
6082 done
6083 done
6084 done
6085 IFS=$as_save_IFS
6086 if test -z "$ac_cv_path_lt_DD"; then
6087 :
6088 fi
6089 else
6090 ac_cv_path_lt_DD=$lt_DD
6091 fi
6092
6093 rm -f conftest.i conftest2.i conftest.out
6094 fi
6095 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
6096 $as_echo "$ac_cv_path_lt_DD" >&6; }
6097
6098
6099 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
6100 $as_echo_n "checking how to truncate binary pipes... " >&6; }
6101 if ${lt_cv_truncate_bin+:} false; then :
6102 $as_echo_n "(cached) " >&6
6103 else
6104 printf 0123456789abcdef0123456789abcdef >conftest.i
6105 cat conftest.i conftest.i >conftest2.i
6106 lt_cv_truncate_bin=
6107 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
6108 cmp -s conftest.i conftest.out \
6109 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
6110 fi
6111 rm -f conftest.i conftest2.i conftest.out
6112 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
6113 fi
6114 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
6115 $as_echo "$lt_cv_truncate_bin" >&6; }
6116
6117
6118
6119
6120
6121
6122
6123 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
6124 func_cc_basename ()
6125 {
6126 for cc_temp in $*""; do
6127 case $cc_temp in
6128 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
6129 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
6130 \-*) ;;
6131 *) break;;
6132 esac
6133 done
6134 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
6135 }
6136
61376034 # Check whether --enable-libtool-lock was given.
61386035 if test "${enable_libtool_lock+set}" = set; then :
61396036 enableval=$enable_libtool_lock;
61406037 fi
61416038
6142 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
6039 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
61436040
61446041 # Some flags need to be propagated to the compiler or linker for good
61456042 # libtool support.
61466043 case $host in
61476044 ia64-*-hpux*)
6148 # Find out what ABI is being produced by ac_compile, and set mode
6149 # options accordingly.
6045 # Find out which ABI we are using.
61506046 echo 'int i;' > conftest.$ac_ext
61516047 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
61526048 (eval $ac_compile) 2>&5
61556051 test $ac_status = 0; }; then
61566052 case `/usr/bin/file conftest.$ac_objext` in
61576053 *ELF-32*)
6158 HPUX_IA64_MODE=32
6054 HPUX_IA64_MODE="32"
61596055 ;;
61606056 *ELF-64*)
6161 HPUX_IA64_MODE=64
6057 HPUX_IA64_MODE="64"
61626058 ;;
61636059 esac
61646060 fi
61656061 rm -rf conftest*
61666062 ;;
61676063 *-*-irix6*)
6168 # Find out what ABI is being produced by ac_compile, and set linker
6169 # options accordingly.
6064 # Find out which ABI we are using.
61706065 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
61716066 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
61726067 (eval $ac_compile) 2>&5
61736068 ac_status=$?
61746069 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
61756070 test $ac_status = 0; }; then
6176 if test yes = "$lt_cv_prog_gnu_ld"; then
6071 if test "$lt_cv_prog_gnu_ld" = yes; then
61776072 case `/usr/bin/file conftest.$ac_objext` in
61786073 *32-bit*)
61796074 LD="${LD-ld} -melf32bsmip"
62026097 rm -rf conftest*
62036098 ;;
62046099
6205 mips64*-*linux*)
6206 # Find out what ABI is being produced by ac_compile, and set linker
6207 # options accordingly.
6208 echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6209 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6210 (eval $ac_compile) 2>&5
6211 ac_status=$?
6212 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6213 test $ac_status = 0; }; then
6214 emul=elf
6215 case `/usr/bin/file conftest.$ac_objext` in
6216 *32-bit*)
6217 emul="${emul}32"
6218 ;;
6219 *64-bit*)
6220 emul="${emul}64"
6221 ;;
6222 esac
6223 case `/usr/bin/file conftest.$ac_objext` in
6224 *MSB*)
6225 emul="${emul}btsmip"
6226 ;;
6227 *LSB*)
6228 emul="${emul}ltsmip"
6229 ;;
6230 esac
6231 case `/usr/bin/file conftest.$ac_objext` in
6232 *N32*)
6233 emul="${emul}n32"
6234 ;;
6235 esac
6236 LD="${LD-ld} -m $emul"
6237 fi
6238 rm -rf conftest*
6239 ;;
6240
62416100 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
62426101 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6243 # Find out what ABI is being produced by ac_compile, and set linker
6244 # options accordingly. Note that the listed cases only cover the
6245 # situations where additional linker options are needed (such as when
6246 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
6247 # vice versa); the common cases where no linker options are needed do
6248 # not appear in the list.
6102 # Find out which ABI we are using.
62496103 echo 'int i;' > conftest.$ac_ext
62506104 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
62516105 (eval $ac_compile) 2>&5
62686122 ;;
62696123 esac
62706124 ;;
6271 powerpc64le-*linux*)
6125 powerpc64le-*)
62726126 LD="${LD-ld} -m elf32lppclinux"
62736127 ;;
6274 powerpc64-*linux*)
6128 powerpc64-*)
62756129 LD="${LD-ld} -m elf32ppclinux"
62766130 ;;
62776131 s390x-*linux*)
62906144 x86_64-*linux*)
62916145 LD="${LD-ld} -m elf_x86_64"
62926146 ;;
6293 powerpcle-*linux*)
6147 powerpcle-*)
62946148 LD="${LD-ld} -m elf64lppc"
62956149 ;;
6296 powerpc-*linux*)
6150 powerpc-*)
62976151 LD="${LD-ld} -m elf64ppc"
62986152 ;;
62996153 s390*-*linux*|s390*-*tpf*)
63116165
63126166 *-*-sco3.2v5*)
63136167 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6314 SAVE_CFLAGS=$CFLAGS
6168 SAVE_CFLAGS="$CFLAGS"
63156169 CFLAGS="$CFLAGS -belf"
63166170 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
63176171 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
63516205 fi
63526206 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
63536207 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6354 if test yes != "$lt_cv_cc_needs_belf"; then
6208 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
63556209 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6356 CFLAGS=$SAVE_CFLAGS
6210 CFLAGS="$SAVE_CFLAGS"
63576211 fi
63586212 ;;
63596213 *-*solaris*)
6360 # Find out what ABI is being produced by ac_compile, and set linker
6361 # options accordingly.
6214 # Find out which ABI we are using.
63626215 echo 'int i;' > conftest.$ac_ext
63636216 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
63646217 (eval $ac_compile) 2>&5
63706223 case $lt_cv_prog_gnu_ld in
63716224 yes*)
63726225 case $host in
6373 i?86-*-solaris*|x86_64-*-solaris*)
6226 i?86-*-solaris*)
63746227 LD="${LD-ld} -m elf_x86_64"
63756228 ;;
63766229 sparc*-*-solaris*)
63796232 esac
63806233 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
63816234 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
6382 LD=${LD-ld}_sol2
6235 LD="${LD-ld}_sol2"
63836236 fi
63846237 ;;
63856238 *)
63956248 ;;
63966249 esac
63976250
6398 need_locks=$enable_libtool_lock
6251 need_locks="$enable_libtool_lock"
63996252
64006253 if test -n "$ac_tool_prefix"; then
64016254 # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
65066359 fi
65076360 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
65086361 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
6509 if test yes != "$lt_cv_path_mainfest_tool"; then
6362 if test "x$lt_cv_path_mainfest_tool" != xyes; then
65106363 MANIFEST_TOOL=:
65116364 fi
65126365
70096862 $as_echo_n "(cached) " >&6
70106863 else
70116864 lt_cv_apple_cc_single_mod=no
7012 if test -z "$LT_MULTI_MODULE"; then
6865 if test -z "${LT_MULTI_MODULE}"; then
70136866 # By default we will add the -single_module flag. You can override
70146867 # by either setting the environment variable LT_MULTI_MODULE
70156868 # non-empty at configure time, or by adding -multi_module to the
70276880 cat conftest.err >&5
70286881 # Otherwise, if the output was created with a 0 exit code from
70296882 # the compiler, it worked.
7030 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
6883 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
70316884 lt_cv_apple_cc_single_mod=yes
70326885 else
70336886 cat conftest.err >&5
70666919 fi
70676920 rm -f core conftest.err conftest.$ac_objext \
70686921 conftest$ac_exeext conftest.$ac_ext
7069 LDFLAGS=$save_LDFLAGS
6922 LDFLAGS="$save_LDFLAGS"
70706923
70716924 fi
70726925 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
70956948 _lt_result=$?
70966949 if test -s conftest.err && $GREP force_load conftest.err; then
70976950 cat conftest.err >&5
7098 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
6951 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
70996952 lt_cv_ld_force_load=yes
71006953 else
71016954 cat conftest.err >&5
71086961 $as_echo "$lt_cv_ld_force_load" >&6; }
71096962 case $host_os in
71106963 rhapsody* | darwin1.[012])
7111 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
6964 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
71126965 darwin1.*)
7113 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
6966 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
71146967 darwin*) # darwin 5.x on
71156968 # if running on 10.5 or later, the deployment target defaults
71166969 # to the OS version, if on x86, and 10.4, the deployment
71176970 # target defaults to 10.4. Don't you love it?
71186971 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
71196972 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7120 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
7121 10.[012][,.]*)
7122 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
6973 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6974 10.[012]*)
6975 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
71236976 10.*)
7124 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
6977 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
71256978 esac
71266979 ;;
71276980 esac
7128 if test yes = "$lt_cv_apple_cc_single_mod"; then
6981 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
71296982 _lt_dar_single_mod='$single_module'
71306983 fi
7131 if test yes = "$lt_cv_ld_exported_symbols_list"; then
7132 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
6984 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
6985 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
71336986 else
7134 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
6987 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
71356988 fi
7136 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
6989 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
71376990 _lt_dsymutil='~$DSYMUTIL $lib || :'
71386991 else
71396992 _lt_dsymutil=
71406993 fi
71416994 ;;
71426995 esac
7143
7144 # func_munge_path_list VARIABLE PATH
7145 # -----------------------------------
7146 # VARIABLE is name of variable containing _space_ separated list of
7147 # directories to be munged by the contents of PATH, which is string
7148 # having a format:
7149 # "DIR[:DIR]:"
7150 # string "DIR[ DIR]" will be prepended to VARIABLE
7151 # ":DIR[:DIR]"
7152 # string "DIR[ DIR]" will be appended to VARIABLE
7153 # "DIRP[:DIRP]::[DIRA:]DIRA"
7154 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
7155 # "DIRA[ DIRA]" will be appended to VARIABLE
7156 # "DIR[:DIR]"
7157 # VARIABLE will be replaced by "DIR[ DIR]"
7158 func_munge_path_list ()
7159 {
7160 case x$2 in
7161 x)
7162 ;;
7163 *:)
7164 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
7165 ;;
7166 x:*)
7167 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
7168 ;;
7169 *::*)
7170 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
7171 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
7172 ;;
7173 *)
7174 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
7175 ;;
7176 esac
7177 }
71786996
71796997
71806998 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
73427160 *)
73437161 enable_shared=no
73447162 # Look at the argument we got. We use all the common list separators.
7345 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7163 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
73467164 for pkg in $enableval; do
7347 IFS=$lt_save_ifs
7165 IFS="$lt_save_ifs"
73487166 if test "X$pkg" = "X$p"; then
73497167 enable_shared=yes
73507168 fi
73517169 done
7352 IFS=$lt_save_ifs
7170 IFS="$lt_save_ifs"
73537171 ;;
73547172 esac
73557173 else
73737191 *)
73747192 enable_static=no
73757193 # Look at the argument we got. We use all the common list separators.
7376 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7194 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
73777195 for pkg in $enableval; do
7378 IFS=$lt_save_ifs
7196 IFS="$lt_save_ifs"
73797197 if test "X$pkg" = "X$p"; then
73807198 enable_static=yes
73817199 fi
73827200 done
7383 IFS=$lt_save_ifs
7201 IFS="$lt_save_ifs"
73847202 ;;
73857203 esac
73867204 else
74047222 *)
74057223 pic_mode=default
74067224 # Look at the argument we got. We use all the common list separators.
7407 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7225 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
74087226 for lt_pkg in $withval; do
7409 IFS=$lt_save_ifs
7227 IFS="$lt_save_ifs"
74107228 if test "X$lt_pkg" = "X$lt_p"; then
74117229 pic_mode=yes
74127230 fi
74137231 done
7414 IFS=$lt_save_ifs
7232 IFS="$lt_save_ifs"
74157233 ;;
74167234 esac
74177235 else
74187236 pic_mode=default
74197237 fi
74207238
7239
7240 test -z "$pic_mode" && pic_mode=default
74217241
74227242
74237243
74347254 *)
74357255 enable_fast_install=no
74367256 # Look at the argument we got. We use all the common list separators.
7437 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
7257 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
74387258 for pkg in $enableval; do
7439 IFS=$lt_save_ifs
7259 IFS="$lt_save_ifs"
74407260 if test "X$pkg" = "X$p"; then
74417261 enable_fast_install=yes
74427262 fi
74437263 done
7444 IFS=$lt_save_ifs
7264 IFS="$lt_save_ifs"
74457265 ;;
74467266 esac
74477267 else
74557275
74567276
74577277
7458 shared_archive_member_spec=
7459 case $host,$enable_shared in
7460 power*-*-aix[5-9]*,yes)
7461 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
7462 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
7463
7464 # Check whether --with-aix-soname was given.
7465 if test "${with_aix_soname+set}" = set; then :
7466 withval=$with_aix_soname; case $withval in
7467 aix|svr4|both)
7468 ;;
7469 *)
7470 as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
7471 ;;
7472 esac
7473 lt_cv_with_aix_soname=$with_aix_soname
7474 else
7475 if ${lt_cv_with_aix_soname+:} false; then :
7476 $as_echo_n "(cached) " >&6
7477 else
7478 lt_cv_with_aix_soname=aix
7479 fi
7480
7481 with_aix_soname=$lt_cv_with_aix_soname
7482 fi
7483
7484 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
7485 $as_echo "$with_aix_soname" >&6; }
7486 if test aix != "$with_aix_soname"; then
7487 # For the AIX way of multilib, we name the shared archive member
7488 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
7489 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
7490 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
7491 # the AIX toolchain works better with OBJECT_MODE set (default 32).
7492 if test 64 = "${OBJECT_MODE-32}"; then
7493 shared_archive_member_spec=shr_64
7494 else
7495 shared_archive_member_spec=shr
7496 fi
7497 fi
7498 ;;
7499 *)
7500 with_aix_soname=aix
7501 ;;
7502 esac
7503
7504
7505
7506
7507
7508
7509
75107278
75117279
75127280
75137281 # This can be used to rebuild libtool when needed
7514 LIBTOOL_DEPS=$ltmain
7282 LIBTOOL_DEPS="$ltmain"
75157283
75167284 # Always use our own libtool.
75177285 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
75607328
75617329
75627330
7563 if test -n "${ZSH_VERSION+set}"; then
7331 if test -n "${ZSH_VERSION+set}" ; then
75647332 setopt NO_GLOB_SUBST
75657333 fi
75667334
75997367 # AIX sometimes has problems with the GCC collect2 program. For some
76007368 # reason, if we set the COLLECT_NAMES environment variable, the problems
76017369 # vanish in a puff of smoke.
7602 if test set != "${COLLECT_NAMES+set}"; then
7370 if test "X${COLLECT_NAMES+set}" != Xset; then
76037371 COLLECT_NAMES=
76047372 export COLLECT_NAMES
76057373 fi
76107378 ofile=libtool
76117379 can_build_shared=yes
76127380
7613 # All known linkers require a '.a' archive for static linking (except MSVC,
7381 # All known linkers require a `.a' archive for static linking (except MSVC,
76147382 # which needs '.lib').
76157383 libext=a
76167384
7617 with_gnu_ld=$lt_cv_prog_gnu_ld
7618
7619 old_CC=$CC
7620 old_CFLAGS=$CFLAGS
7385 with_gnu_ld="$lt_cv_prog_gnu_ld"
7386
7387 old_CC="$CC"
7388 old_CFLAGS="$CFLAGS"
76217389
76227390 # Set sane defaults for various variables
76237391 test -z "$CC" && CC=cc
76267394 test -z "$LD" && LD=ld
76277395 test -z "$ac_objext" && ac_objext=o
76287396
7629 func_cc_basename $compiler
7630 cc_basename=$func_cc_basename_result
7397 for cc_temp in $compiler""; do
7398 case $cc_temp in
7399 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
7400 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
7401 \-*) ;;
7402 *) break;;
7403 esac
7404 done
7405 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
76317406
76327407
76337408 # Only perform the check for file, if the check method requires it
76427417 else
76437418 case $MAGIC_CMD in
76447419 [\\/*] | ?:[\\/]*)
7645 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
7420 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
76467421 ;;
76477422 *)
7648 lt_save_MAGIC_CMD=$MAGIC_CMD
7649 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7423 lt_save_MAGIC_CMD="$MAGIC_CMD"
7424 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
76507425 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
76517426 for ac_dir in $ac_dummy; do
7652 IFS=$lt_save_ifs
7427 IFS="$lt_save_ifs"
76537428 test -z "$ac_dir" && ac_dir=.
7654 if test -f "$ac_dir/${ac_tool_prefix}file"; then
7655 lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
7429 if test -f $ac_dir/${ac_tool_prefix}file; then
7430 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
76567431 if test -n "$file_magic_test_file"; then
76577432 case $deplibs_check_method in
76587433 "file_magic "*)
76597434 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7660 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
7435 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
76617436 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
76627437 $EGREP "$file_magic_regex" > /dev/null; then
76637438 :
76807455 break
76817456 fi
76827457 done
7683 IFS=$lt_save_ifs
7684 MAGIC_CMD=$lt_save_MAGIC_CMD
7458 IFS="$lt_save_ifs"
7459 MAGIC_CMD="$lt_save_MAGIC_CMD"
76857460 ;;
76867461 esac
76877462 fi
76887463
7689 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
7464 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
76907465 if test -n "$MAGIC_CMD"; then
76917466 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
76927467 $as_echo "$MAGIC_CMD" >&6; }
77087483 else
77097484 case $MAGIC_CMD in
77107485 [\\/*] | ?:[\\/]*)
7711 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
7486 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
77127487 ;;
77137488 *)
7714 lt_save_MAGIC_CMD=$MAGIC_CMD
7715 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
7489 lt_save_MAGIC_CMD="$MAGIC_CMD"
7490 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
77167491 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
77177492 for ac_dir in $ac_dummy; do
7718 IFS=$lt_save_ifs
7493 IFS="$lt_save_ifs"
77197494 test -z "$ac_dir" && ac_dir=.
7720 if test -f "$ac_dir/file"; then
7721 lt_cv_path_MAGIC_CMD=$ac_dir/"file"
7495 if test -f $ac_dir/file; then
7496 lt_cv_path_MAGIC_CMD="$ac_dir/file"
77227497 if test -n "$file_magic_test_file"; then
77237498 case $deplibs_check_method in
77247499 "file_magic "*)
77257500 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7726 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
7501 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
77277502 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
77287503 $EGREP "$file_magic_regex" > /dev/null; then
77297504 :
77467521 break
77477522 fi
77487523 done
7749 IFS=$lt_save_ifs
7750 MAGIC_CMD=$lt_save_MAGIC_CMD
7524 IFS="$lt_save_ifs"
7525 MAGIC_CMD="$lt_save_MAGIC_CMD"
77517526 ;;
77527527 esac
77537528 fi
77547529
7755 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
7530 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
77567531 if test -n "$MAGIC_CMD"; then
77577532 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
77587533 $as_echo "$MAGIC_CMD" >&6; }
77737548
77747549 # Use C for the default configuration in the libtool script
77757550
7776 lt_save_CC=$CC
7551 lt_save_CC="$CC"
77777552 ac_ext=c
77787553 ac_cpp='$CPP $CPPFLAGS'
77797554 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
78357610
78367611 lt_prog_compiler_no_builtin_flag=
78377612
7838 if test yes = "$GCC"; then
7613 if test "$GCC" = yes; then
78397614 case $cc_basename in
78407615 nvcc*)
78417616 lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
78517626 lt_cv_prog_compiler_rtti_exceptions=no
78527627 ac_outfile=conftest.$ac_objext
78537628 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7854 lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
7629 lt_compiler_flag="-fno-rtti -fno-exceptions"
78557630 # Insert the option either (1) after the last *FLAGS variable, or
78567631 # (2) before a word containing "conftest.", or (3) at the end.
78577632 # Note that $ac_compile itself does not contain backslashes and begins
78817656 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
78827657 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
78837658
7884 if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
7659 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
78857660 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
78867661 else
78877662 :
78997674 lt_prog_compiler_static=
79007675
79017676
7902 if test yes = "$GCC"; then
7677 if test "$GCC" = yes; then
79037678 lt_prog_compiler_wl='-Wl,'
79047679 lt_prog_compiler_static='-static'
79057680
79067681 case $host_os in
79077682 aix*)
79087683 # All AIX code is PIC.
7909 if test ia64 = "$host_cpu"; then
7684 if test "$host_cpu" = ia64; then
79107685 # AIX 5 now supports IA64 processor
79117686 lt_prog_compiler_static='-Bstatic'
79127687 fi
7913 lt_prog_compiler_pic='-fPIC'
79147688 ;;
79157689
79167690 amigaos*)
79217695 ;;
79227696 m68k)
79237697 # FIXME: we need at least 68020 code to build shared libraries, but
7924 # adding the '-m68020' flag to GCC prevents building anything better,
7925 # like '-m68040'.
7698 # adding the `-m68020' flag to GCC prevents building anything better,
7699 # like `-m68040'.
79267700 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
79277701 ;;
79287702 esac
79387712 # Although the cygwin gcc ignores -fPIC, still need this for old-style
79397713 # (--disable-auto-import) libraries
79407714 lt_prog_compiler_pic='-DDLL_EXPORT'
7941 case $host_os in
7942 os2*)
7943 lt_prog_compiler_static='$wl-static'
7944 ;;
7945 esac
79467715 ;;
79477716
79487717 darwin* | rhapsody*)
80137782 case $host_os in
80147783 aix*)
80157784 lt_prog_compiler_wl='-Wl,'
8016 if test ia64 = "$host_cpu"; then
7785 if test "$host_cpu" = ia64; then
80177786 # AIX 5 now supports IA64 processor
80187787 lt_prog_compiler_static='-Bstatic'
80197788 else
80217790 fi
80227791 ;;
80237792
8024 darwin* | rhapsody*)
8025 # PIC is the default on this platform
8026 # Common symbols not allowed in MH_DYLIB files
8027 lt_prog_compiler_pic='-fno-common'
8028 case $cc_basename in
8029 nagfor*)
8030 # NAG Fortran compiler
8031 lt_prog_compiler_wl='-Wl,-Wl,,'
8032 lt_prog_compiler_pic='-PIC'
8033 lt_prog_compiler_static='-Bstatic'
8034 ;;
8035 esac
8036 ;;
8037
80387793 mingw* | cygwin* | pw32* | os2* | cegcc*)
80397794 # This hack is so that the source file can tell whether it is being
80407795 # built for inclusion in a dll (and should export symbols for example).
80417796 lt_prog_compiler_pic='-DDLL_EXPORT'
8042 case $host_os in
8043 os2*)
8044 lt_prog_compiler_static='$wl-static'
8045 ;;
8046 esac
80477797 ;;
80487798
80497799 hpux9* | hpux10* | hpux11*)
80597809 ;;
80607810 esac
80617811 # Is there a better lt_prog_compiler_static that works with the bundled CC?
8062 lt_prog_compiler_static='$wl-a ${wl}archive'
7812 lt_prog_compiler_static='${wl}-a ${wl}archive'
80637813 ;;
80647814
80657815 irix5* | irix6* | nonstopux*)
80707820
80717821 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
80727822 case $cc_basename in
8073 # old Intel for x86_64, which still supported -KPIC.
7823 # old Intel for x86_64 which still supported -KPIC.
80747824 ecc*)
80757825 lt_prog_compiler_wl='-Wl,'
80767826 lt_prog_compiler_pic='-KPIC'
80947844 lt_prog_compiler_wl='-Wl,-Wl,,'
80957845 lt_prog_compiler_pic='-PIC'
80967846 lt_prog_compiler_static='-Bstatic'
8097 ;;
8098 tcc*)
8099 # Fabrice Bellard et al's Tiny C Compiler
8100 lt_prog_compiler_wl='-Wl,'
8101 lt_prog_compiler_pic='-fPIC'
8102 lt_prog_compiler_static='-static'
81037847 ;;
81047848 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
81057849 # Portland Group compilers (*not* the Pentium gcc compiler,
81987942 ;;
81997943
82007944 sysv4*MP*)
8201 if test -d /usr/nec; then
7945 if test -d /usr/nec ;then
82027946 lt_prog_compiler_pic='-Kconform_pic'
82037947 lt_prog_compiler_static='-Bstatic'
82047948 fi
82277971 fi
82287972
82297973 case $host_os in
8230 # For platforms that do not support PIC, -DPIC is meaningless:
7974 # For platforms which do not support PIC, -DPIC is meaningless:
82317975 *djgpp*)
82327976 lt_prog_compiler_pic=
82337977 ;;
82598003 lt_cv_prog_compiler_pic_works=no
82608004 ac_outfile=conftest.$ac_objext
82618005 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8262 lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
8006 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
82638007 # Insert the option either (1) after the last *FLAGS variable, or
82648008 # (2) before a word containing "conftest.", or (3) at the end.
82658009 # Note that $ac_compile itself does not contain backslashes and begins
82898033 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
82908034 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
82918035
8292 if test yes = "$lt_cv_prog_compiler_pic_works"; then
8036 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
82938037 case $lt_prog_compiler_pic in
82948038 "" | " "*) ;;
82958039 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
83218065 $as_echo_n "(cached) " >&6
83228066 else
83238067 lt_cv_prog_compiler_static_works=no
8324 save_LDFLAGS=$LDFLAGS
8068 save_LDFLAGS="$LDFLAGS"
83258069 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
83268070 echo "$lt_simple_link_test_code" > conftest.$ac_ext
83278071 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
83408084 fi
83418085 fi
83428086 $RM -r conftest*
8343 LDFLAGS=$save_LDFLAGS
8087 LDFLAGS="$save_LDFLAGS"
83448088
83458089 fi
83468090 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
83478091 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
83488092
8349 if test yes = "$lt_cv_prog_compiler_static_works"; then
8093 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
83508094 :
83518095 else
83528096 lt_prog_compiler_static=
84668210
84678211
84688212
8469 hard_links=nottested
8470 if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
8213 hard_links="nottested"
8214 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
84718215 # do not overwrite the value of need_locks provided by the user
84728216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
84738217 $as_echo_n "checking if we can lock with hard links... " >&6; }
84798223 ln conftest.a conftest.b 2>/dev/null && hard_links=no
84808224 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
84818225 $as_echo "$hard_links" >&6; }
8482 if test no = "$hard_links"; then
8483 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
8484 $as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
8226 if test "$hard_links" = no; then
8227 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
8228 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
84858229 need_locks=warn
84868230 fi
84878231 else
85248268 # included in the symbol list
85258269 include_expsyms=
85268270 # exclude_expsyms can be an extended regexp of symbols to exclude
8527 # it will be wrapped by ' (' and ')$', so one must not match beginning or
8528 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
8529 # as well as any symbol that contains 'd'.
8271 # it will be wrapped by ` (' and `)$', so one must not match beginning or
8272 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
8273 # as well as any symbol that contains `d'.
85308274 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
85318275 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
85328276 # platforms (ab)use it in PIC code, but their linkers get confused if
85418285 # FIXME: the MSVC++ port hasn't been tested in a loooong time
85428286 # When not using gcc, we currently assume that we are using
85438287 # Microsoft Visual C++.
8544 if test yes != "$GCC"; then
8288 if test "$GCC" != yes; then
85458289 with_gnu_ld=no
85468290 fi
85478291 ;;
85498293 # we just hope/assume this is gcc and not c89 (= MSVC++)
85508294 with_gnu_ld=yes
85518295 ;;
8552 openbsd* | bitrig*)
8296 openbsd*)
85538297 with_gnu_ld=no
8298 ;;
8299 linux* | k*bsd*-gnu | gnu*)
8300 link_all_deplibs=no
85548301 ;;
85558302 esac
85568303
85598306 # On some targets, GNU ld is compatible enough with the native linker
85608307 # that we're better off using the native interface for both.
85618308 lt_use_gnu_ld_interface=no
8562 if test yes = "$with_gnu_ld"; then
8309 if test "$with_gnu_ld" = yes; then
85638310 case $host_os in
85648311 aix*)
85658312 # The AIX port of GNU ld has always aspired to compatibility
85818328 esac
85828329 fi
85838330
8584 if test yes = "$lt_use_gnu_ld_interface"; then
8331 if test "$lt_use_gnu_ld_interface" = yes; then
85858332 # If archive_cmds runs LD, not CC, wlarc should be empty
8586 wlarc='$wl'
8333 wlarc='${wl}'
85878334
85888335 # Set some defaults for GNU ld with shared library support. These
85898336 # are reset later if shared libraries are not supported. Putting them
85908337 # here allows them to be overridden if necessary.
85918338 runpath_var=LD_RUN_PATH
8592 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
8593 export_dynamic_flag_spec='$wl--export-dynamic'
8339 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8340 export_dynamic_flag_spec='${wl}--export-dynamic'
85948341 # ancient GNU ld didn't support --whole-archive et. al.
85958342 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8596 whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
8343 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
85978344 else
85988345 whole_archive_flag_spec=
85998346 fi
86008347 supports_anon_versioning=no
8601 case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
8348 case `$LD -v 2>&1` in
86028349 *GNU\ gold*) supports_anon_versioning=yes ;;
86038350 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
86048351 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
86118358 case $host_os in
86128359 aix[3-9]*)
86138360 # On AIX/PPC, the GNU linker is very broken
8614 if test ia64 != "$host_cpu"; then
8361 if test "$host_cpu" != ia64; then
86158362 ld_shlibs=no
86168363 cat <<_LT_EOF 1>&2
86178364
86308377 case $host_cpu in
86318378 powerpc)
86328379 # see comment about AmigaOS4 .so support
8633 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8380 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
86348381 archive_expsym_cmds=''
86358382 ;;
86368383 m68k)
86468393 allow_undefined_flag=unsupported
86478394 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
86488395 # support --undefined. This deserves some investigation. FIXME
8649 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8396 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
86508397 else
86518398 ld_shlibs=no
86528399 fi
86568403 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
86578404 # as there is no search path for DLLs.
86588405 hardcode_libdir_flag_spec='-L$libdir'
8659 export_dynamic_flag_spec='$wl--export-all-symbols'
8406 export_dynamic_flag_spec='${wl}--export-all-symbols'
86608407 allow_undefined_flag=unsupported
86618408 always_export_symbols=no
86628409 enable_shared_with_static_runtimes=yes
86648411 exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
86658412
86668413 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8667 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8668 # If the export-symbols file already is a .def file, use it as
8669 # is; otherwise, prepend EXPORTS...
8670 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
8671 cp $export_symbols $output_objdir/$soname.def;
8672 else
8673 echo EXPORTS > $output_objdir/$soname.def;
8674 cat $export_symbols >> $output_objdir/$soname.def;
8675 fi~
8676 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8414 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8415 # If the export-symbols file already is a .def file (1st line
8416 # is EXPORTS), use it as is; otherwise, prepend...
8417 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8418 cp $export_symbols $output_objdir/$soname.def;
8419 else
8420 echo EXPORTS > $output_objdir/$soname.def;
8421 cat $export_symbols >> $output_objdir/$soname.def;
8422 fi~
8423 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
86778424 else
86788425 ld_shlibs=no
86798426 fi
86808427 ;;
86818428
86828429 haiku*)
8683 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8430 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
86848431 link_all_deplibs=yes
8685 ;;
8686
8687 os2*)
8688 hardcode_libdir_flag_spec='-L$libdir'
8689 hardcode_minus_L=yes
8690 allow_undefined_flag=unsupported
8691 shrext_cmds=.dll
8692 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8693 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8694 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8695 $ECHO EXPORTS >> $output_objdir/$libname.def~
8696 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
8697 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8698 emximp -o $lib $output_objdir/$libname.def'
8699 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
8700 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
8701 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
8702 $ECHO EXPORTS >> $output_objdir/$libname.def~
8703 prefix_cmds="$SED"~
8704 if test EXPORTS = "`$SED 1q $export_symbols`"; then
8705 prefix_cmds="$prefix_cmds -e 1d";
8706 fi~
8707 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
8708 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
8709 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
8710 emximp -o $lib $output_objdir/$libname.def'
8711 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
8712 enable_shared_with_static_runtimes=yes
87138432 ;;
87148433
87158434 interix[3-9]*)
87168435 hardcode_direct=no
87178436 hardcode_shlibpath_var=no
8718 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
8719 export_dynamic_flag_spec='$wl-E'
8437 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8438 export_dynamic_flag_spec='${wl}-E'
87208439 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
87218440 # Instead, shared libraries are loaded at an image base (0x10000000 by
87228441 # default) and relocated if they conflict, which is a slow very memory
87238442 # consuming and fragmenting process. To avoid this, we pick a random,
87248443 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
87258444 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
8726 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8727 archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8445 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8446 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
87288447 ;;
87298448
87308449 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
87318450 tmp_diet=no
8732 if test linux-dietlibc = "$host_os"; then
8451 if test "$host_os" = linux-dietlibc; then
87338452 case $cc_basename in
87348453 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
87358454 esac
87368455 fi
87378456 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8738 && test no = "$tmp_diet"
8457 && test "$tmp_diet" = no
87398458 then
87408459 tmp_addflag=' $pic_flag'
87418460 tmp_sharedflag='-shared'
87428461 case $cc_basename,$host_cpu in
87438462 pgcc*) # Portland Group C compiler
8744 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8463 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
87458464 tmp_addflag=' $pic_flag'
87468465 ;;
87478466 pgf77* | pgf90* | pgf95* | pgfortran*)
87488467 # Portland Group f77 and f90 compilers
8749 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8468 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
87508469 tmp_addflag=' $pic_flag -Mnomain' ;;
87518470 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
87528471 tmp_addflag=' -i_dynamic' ;;
87578476 lf95*) # Lahey Fortran 8.1
87588477 whole_archive_flag_spec=
87598478 tmp_sharedflag='--shared' ;;
8760 nagfor*) # NAGFOR 5.3
8761 tmp_sharedflag='-Wl,-shared' ;;
87628479 xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
87638480 tmp_sharedflag='-qmkshrobj'
87648481 tmp_addflag= ;;
87658482 nvcc*) # Cuda Compiler Driver 2.2
8766 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8483 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
87678484 compiler_needs_object=yes
87688485 ;;
87698486 esac
87708487 case `$CC -V 2>&1 | sed 5q` in
87718488 *Sun\ C*) # Sun C 5.9
8772 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
8489 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
87738490 compiler_needs_object=yes
87748491 tmp_sharedflag='-G' ;;
87758492 *Sun\ F*) # Sun Fortran 8.3
87768493 tmp_sharedflag='-G' ;;
87778494 esac
8778 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8779
8780 if test yes = "$supports_anon_versioning"; then
8495 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8496
8497 if test "x$supports_anon_versioning" = xyes; then
87818498 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8782 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8783 echo "local: *; };" >> $output_objdir/$libname.ver~
8784 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
8499 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8500 echo "local: *; };" >> $output_objdir/$libname.ver~
8501 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
87858502 fi
87868503
87878504 case $cc_basename in
8788 tcc*)
8789 export_dynamic_flag_spec='-rdynamic'
8790 ;;
87918505 xlf* | bgf* | bgxlf* | mpixlf*)
87928506 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
87938507 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
8794 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
8508 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
87958509 archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
8796 if test yes = "$supports_anon_versioning"; then
8510 if test "x$supports_anon_versioning" = xyes; then
87978511 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8798 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8799 echo "local: *; };" >> $output_objdir/$libname.ver~
8800 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8512 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8513 echo "local: *; };" >> $output_objdir/$libname.ver~
8514 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
88018515 fi
88028516 ;;
88038517 esac
88068520 fi
88078521 ;;
88088522
8809 netbsd*)
8523 netbsd* | netbsdelf*-gnu)
88108524 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
88118525 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
88128526 wlarc=
88138527 else
8814 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8815 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8528 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8529 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
88168530 fi
88178531 ;;
88188532
88308544
88318545 _LT_EOF
88328546 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8833 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8834 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8547 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8548 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
88358549 else
88368550 ld_shlibs=no
88378551 fi
88438557 ld_shlibs=no
88448558 cat <<_LT_EOF 1>&2
88458559
8846 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
8560 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
88478561 *** reliably create shared libraries on SCO systems. Therefore, libtool
88488562 *** is disabling shared libraries support. We urge you to upgrade GNU
88498563 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
88588572 # DT_RUNPATH tag from executables and libraries. But doing so
88598573 # requires that you compile everything twice, which is a pain.
88608574 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8861 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
8862 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8863 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8575 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8576 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8577 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
88648578 else
88658579 ld_shlibs=no
88668580 fi
88778591
88788592 *)
88798593 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8880 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8881 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
8594 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8595 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
88828596 else
88838597 ld_shlibs=no
88848598 fi
88858599 ;;
88868600 esac
88878601
8888 if test no = "$ld_shlibs"; then
8602 if test "$ld_shlibs" = no; then
88898603 runpath_var=
88908604 hardcode_libdir_flag_spec=
88918605 export_dynamic_flag_spec=
89018615 # Note: this linker hardcodes the directories in LIBPATH if there
89028616 # are no directories specified by -L.
89038617 hardcode_minus_L=yes
8904 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
8618 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
89058619 # Neither direct hardcoding nor static linking is supported with a
89068620 # broken collect2.
89078621 hardcode_direct=unsupported
89098623 ;;
89108624
89118625 aix[4-9]*)
8912 if test ia64 = "$host_cpu"; then
8626 if test "$host_cpu" = ia64; then
89138627 # On IA64, the linker does run time linking by default, so we don't
89148628 # have to do anything special.
89158629 aix_use_runtimelinking=no
89168630 exp_sym_flag='-Bexport'
8917 no_entry_flag=
8631 no_entry_flag=""
89188632 else
89198633 # If we're using GNU nm, then we don't want the "-C" option.
8920 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
8921 # Without the "-l" option, or with the "-B" option, AIX nm treats
8922 # weak defined symbols like other global defined symbols, whereas
8923 # GNU nm marks them as "W".
8924 # While the 'weak' keyword is ignored in the Export File, we need
8925 # it in the Import File for the 'aix-soname' feature, so we have
8926 # to replace the "-B" option with "-P" for AIX nm.
8634 # -C means demangle to AIX nm, but means don't demangle with GNU nm
8635 # Also, AIX nm treats weak defined symbols like other global
8636 # defined symbols, whereas GNU nm marks them as "W".
89278637 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8928 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
8638 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
89298639 else
8930 export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
8640 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
89318641 fi
89328642 aix_use_runtimelinking=no
89338643
89348644 # Test if we are trying to use run time linking or normal
89358645 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
8936 # have runtime linking enabled, and use it for executables.
8937 # For shared libraries, we enable/disable runtime linking
8938 # depending on the kind of the shared library created -
8939 # when "with_aix_soname,aix_use_runtimelinking" is:
8940 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
8941 # "aix,yes" lib.so shared, rtl:yes, for executables
8942 # lib.a static archive
8943 # "both,no" lib.so.V(shr.o) shared, rtl:yes
8944 # lib.a(lib.so.V) shared, rtl:no, for executables
8945 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
8946 # lib.a(lib.so.V) shared, rtl:no
8947 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
8948 # lib.a static archive
8646 # need to do runtime linking.
89498647 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
89508648 for ld_flag in $LDFLAGS; do
8951 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
8649 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
89528650 aix_use_runtimelinking=yes
89538651 break
89548652 fi
89558653 done
8956 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
8957 # With aix-soname=svr4, we create the lib.so.V shared archives only,
8958 # so we don't have lib.a shared libs to link our executables.
8959 # We have to force runtime linking in this case.
8960 aix_use_runtimelinking=yes
8961 LDFLAGS="$LDFLAGS -Wl,-brtl"
8962 fi
89638654 ;;
89648655 esac
89658656
89788669 hardcode_direct_absolute=yes
89798670 hardcode_libdir_separator=':'
89808671 link_all_deplibs=yes
8981 file_list_spec='$wl-f,'
8982 case $with_aix_soname,$aix_use_runtimelinking in
8983 aix,*) ;; # traditional, no import file
8984 svr4,* | *,yes) # use import file
8985 # The Import File defines what to hardcode.
8986 hardcode_direct=no
8987 hardcode_direct_absolute=no
8988 ;;
8989 esac
8990
8991 if test yes = "$GCC"; then
8672 file_list_spec='${wl}-f,'
8673
8674 if test "$GCC" = yes; then
89928675 case $host_os in aix4.[012]|aix4.[012].*)
89938676 # We only want to do this on AIX 4.2 and lower, the check
89948677 # below for broken collect2 doesn't work under 4.3+
8995 collect2name=`$CC -print-prog-name=collect2`
8678 collect2name=`${CC} -print-prog-name=collect2`
89968679 if test -f "$collect2name" &&
89978680 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
89988681 then
90118694 ;;
90128695 esac
90138696 shared_flag='-shared'
9014 if test yes = "$aix_use_runtimelinking"; then
9015 shared_flag="$shared_flag "'$wl-G'
8697 if test "$aix_use_runtimelinking" = yes; then
8698 shared_flag="$shared_flag "'${wl}-G'
90168699 fi
9017 # Need to ensure runtime linking is disabled for the traditional
9018 # shared library, or the linker may eventually find shared libraries
9019 # /with/ Import File - we do not want to mix them.
9020 shared_flag_aix='-shared'
9021 shared_flag_svr4='-shared $wl-G'
8700 link_all_deplibs=no
90228701 else
90238702 # not using gcc
9024 if test ia64 = "$host_cpu"; then
8703 if test "$host_cpu" = ia64; then
90258704 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
90268705 # chokes on -Wl,-G. The following line is correct:
90278706 shared_flag='-G'
90288707 else
9029 if test yes = "$aix_use_runtimelinking"; then
9030 shared_flag='$wl-G'
8708 if test "$aix_use_runtimelinking" = yes; then
8709 shared_flag='${wl}-G'
90318710 else
9032 shared_flag='$wl-bM:SRE'
8711 shared_flag='${wl}-bM:SRE'
90338712 fi
9034 shared_flag_aix='$wl-bM:SRE'
9035 shared_flag_svr4='$wl-G'
90368713 fi
90378714 fi
90388715
9039 export_dynamic_flag_spec='$wl-bexpall'
8716 export_dynamic_flag_spec='${wl}-bexpall'
90408717 # It seems that -bexpall does not export symbols beginning with
90418718 # underscore (_), so it is better to generate a list of symbols to export.
90428719 always_export_symbols=yes
9043 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
8720 if test "$aix_use_runtimelinking" = yes; then
90448721 # Warning - without using the other runtime loading flags (-brtl),
90458722 # -berok will link without error, but may produce a broken library.
90468723 allow_undefined_flag='-berok'
90478724 # Determine the default libpath from the value encoded in an
90488725 # empty executable.
9049 if test set = "${lt_cv_aix_libpath+set}"; then
8726 if test "${lt_cv_aix_libpath+set}" = set; then
90508727 aix_libpath=$lt_cv_aix_libpath
90518728 else
90528729 if ${lt_cv_aix_libpath_+:} false; then :
90818758 rm -f core conftest.err conftest.$ac_objext \
90828759 conftest$ac_exeext conftest.$ac_ext
90838760 if test -z "$lt_cv_aix_libpath_"; then
9084 lt_cv_aix_libpath_=/usr/lib:/lib
8761 lt_cv_aix_libpath_="/usr/lib:/lib"
90858762 fi
90868763
90878764 fi
90898766 aix_libpath=$lt_cv_aix_libpath_
90908767 fi
90918768
9092 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
9093 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
8769 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8770 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
90948771 else
9095 if test ia64 = "$host_cpu"; then
9096 hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
8772 if test "$host_cpu" = ia64; then
8773 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
90978774 allow_undefined_flag="-z nodefs"
9098 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
8775 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
90998776 else
91008777 # Determine the default libpath from the value encoded in an
91018778 # empty executable.
9102 if test set = "${lt_cv_aix_libpath+set}"; then
8779 if test "${lt_cv_aix_libpath+set}" = set; then
91038780 aix_libpath=$lt_cv_aix_libpath
91048781 else
91058782 if ${lt_cv_aix_libpath_+:} false; then :
91348811 rm -f core conftest.err conftest.$ac_objext \
91358812 conftest$ac_exeext conftest.$ac_ext
91368813 if test -z "$lt_cv_aix_libpath_"; then
9137 lt_cv_aix_libpath_=/usr/lib:/lib
8814 lt_cv_aix_libpath_="/usr/lib:/lib"
91388815 fi
91398816
91408817 fi
91428819 aix_libpath=$lt_cv_aix_libpath_
91438820 fi
91448821
9145 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
8822 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
91468823 # Warning - without using the other run time loading flags,
91478824 # -berok will link without error, but may produce a broken library.
9148 no_undefined_flag=' $wl-bernotok'
9149 allow_undefined_flag=' $wl-berok'
9150 if test yes = "$with_gnu_ld"; then
8825 no_undefined_flag=' ${wl}-bernotok'
8826 allow_undefined_flag=' ${wl}-berok'
8827 if test "$with_gnu_ld" = yes; then
91518828 # We only use this code for GNU lds that support --whole-archive.
9152 whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
8829 whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
91538830 else
91548831 # Exported symbols can be pulled into shared objects from archives
91558832 whole_archive_flag_spec='$convenience'
91568833 fi
91578834 archive_cmds_need_lc=yes
9158 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
9159 # -brtl affects multiple linker settings, -berok does not and is overridden later
9160 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
9161 if test svr4 != "$with_aix_soname"; then
9162 # This is similar to how AIX traditionally builds its shared libraries.
9163 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
9164 fi
9165 if test aix != "$with_aix_soname"; then
9166 archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
9167 else
9168 # used by -dlpreopen to get the symbols
9169 archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
9170 fi
9171 archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
8835 # This is similar to how AIX traditionally builds its shared libraries.
8836 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
91728837 fi
91738838 fi
91748839 ;;
91778842 case $host_cpu in
91788843 powerpc)
91798844 # see comment about AmigaOS4 .so support
9180 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
8845 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
91818846 archive_expsym_cmds=''
91828847 ;;
91838848 m68k)
92078872 # Tell ltmain to make .lib files, not .a files.
92088873 libext=lib
92098874 # Tell ltmain to make .dll files, not .so files.
9210 shrext_cmds=.dll
8875 shrext_cmds=".dll"
92118876 # FIXME: Setting linknames here is a bad hack.
9212 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
9213 archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
9214 cp "$export_symbols" "$output_objdir/$soname.def";
9215 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
9216 else
9217 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
9218 fi~
9219 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9220 linknames='
8877 archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
8878 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8879 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
8880 else
8881 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
8882 fi~
8883 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
8884 linknames='
92218885 # The linker will not automatically build a static lib if we build a DLL.
92228886 # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
92238887 enable_shared_with_static_runtimes=yes
92268890 # Don't use ranlib
92278891 old_postinstall_cmds='chmod 644 $oldlib'
92288892 postlink_cmds='lt_outputfile="@OUTPUT@"~
9229 lt_tool_outputfile="@TOOL_OUTPUT@"~
9230 case $lt_outputfile in
9231 *.exe|*.EXE) ;;
9232 *)
9233 lt_outputfile=$lt_outputfile.exe
9234 lt_tool_outputfile=$lt_tool_outputfile.exe
9235 ;;
9236 esac~
9237 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
9238 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9239 $RM "$lt_outputfile.manifest";
9240 fi'
8893 lt_tool_outputfile="@TOOL_OUTPUT@"~
8894 case $lt_outputfile in
8895 *.exe|*.EXE) ;;
8896 *)
8897 lt_outputfile="$lt_outputfile.exe"
8898 lt_tool_outputfile="$lt_tool_outputfile.exe"
8899 ;;
8900 esac~
8901 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
8902 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
8903 $RM "$lt_outputfile.manifest";
8904 fi'
92418905 ;;
92428906 *)
92438907 # Assume MSVC wrapper
92468910 # Tell ltmain to make .lib files, not .a files.
92478911 libext=lib
92488912 # Tell ltmain to make .dll files, not .so files.
9249 shrext_cmds=.dll
8913 shrext_cmds=".dll"
92508914 # FIXME: Setting linknames here is a bad hack.
92518915 archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
92528916 # The linker will automatically build a .lib file if we build a DLL.
92658929 hardcode_direct=no
92668930 hardcode_automatic=yes
92678931 hardcode_shlibpath_var=unsupported
9268 if test yes = "$lt_cv_ld_force_load"; then
9269 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
8932 if test "$lt_cv_ld_force_load" = "yes"; then
8933 whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
92708934
92718935 else
92728936 whole_archive_flag_spec=''
92738937 fi
92748938 link_all_deplibs=yes
9275 allow_undefined_flag=$_lt_dar_allow_undefined
8939 allow_undefined_flag="$_lt_dar_allow_undefined"
92768940 case $cc_basename in
9277 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
8941 ifort*) _lt_dar_can_shared=yes ;;
92788942 *) _lt_dar_can_shared=$GCC ;;
92798943 esac
9280 if test yes = "$_lt_dar_can_shared"; then
8944 if test "$_lt_dar_can_shared" = "yes"; then
92818945 output_verbose_link_cmd=func_echo_all
9282 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
9283 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
9284 archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
9285 module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
8946 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
8947 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
8948 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
8949 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
92868950
92878951 else
92888952 ld_shlibs=no
93248988 ;;
93258989
93268990 hpux9*)
9327 if test yes = "$GCC"; then
9328 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
8991 if test "$GCC" = yes; then
8992 archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
93298993 else
9330 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
8994 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
93318995 fi
9332 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
8996 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
93338997 hardcode_libdir_separator=:
93348998 hardcode_direct=yes
93358999
93369000 # hardcode_minus_L: Not really in the search PATH,
93379001 # but as the default location of the library.
93389002 hardcode_minus_L=yes
9339 export_dynamic_flag_spec='$wl-E'
9003 export_dynamic_flag_spec='${wl}-E'
93409004 ;;
93419005
93429006 hpux10*)
9343 if test yes,no = "$GCC,$with_gnu_ld"; then
9344 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9007 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
9008 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
93459009 else
93469010 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
93479011 fi
9348 if test no = "$with_gnu_ld"; then
9349 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9012 if test "$with_gnu_ld" = no; then
9013 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
93509014 hardcode_libdir_separator=:
93519015 hardcode_direct=yes
93529016 hardcode_direct_absolute=yes
9353 export_dynamic_flag_spec='$wl-E'
9017 export_dynamic_flag_spec='${wl}-E'
93549018 # hardcode_minus_L: Not really in the search PATH,
93559019 # but as the default location of the library.
93569020 hardcode_minus_L=yes
93589022 ;;
93599023
93609024 hpux11*)
9361 if test yes,no = "$GCC,$with_gnu_ld"; then
9025 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
93629026 case $host_cpu in
93639027 hppa*64*)
9364 archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9028 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
93659029 ;;
93669030 ia64*)
9367 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9031 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
93689032 ;;
93699033 *)
9370 archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9034 archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
93719035 ;;
93729036 esac
93739037 else
93749038 case $host_cpu in
93759039 hppa*64*)
9376 archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9040 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
93779041 ;;
93789042 ia64*)
9379 archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9043 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
93809044 ;;
93819045 *)
93829046
93889052 $as_echo_n "(cached) " >&6
93899053 else
93909054 lt_cv_prog_compiler__b=no
9391 save_LDFLAGS=$LDFLAGS
9055 save_LDFLAGS="$LDFLAGS"
93929056 LDFLAGS="$LDFLAGS -b"
93939057 echo "$lt_simple_link_test_code" > conftest.$ac_ext
93949058 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
94079071 fi
94089072 fi
94099073 $RM -r conftest*
9410 LDFLAGS=$save_LDFLAGS
9074 LDFLAGS="$save_LDFLAGS"
94119075
94129076 fi
94139077 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
94149078 $as_echo "$lt_cv_prog_compiler__b" >&6; }
94159079
9416 if test yes = "$lt_cv_prog_compiler__b"; then
9417 archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9080 if test x"$lt_cv_prog_compiler__b" = xyes; then
9081 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
94189082 else
94199083 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
94209084 fi
94229086 ;;
94239087 esac
94249088 fi
9425 if test no = "$with_gnu_ld"; then
9426 hardcode_libdir_flag_spec='$wl+b $wl$libdir'
9089 if test "$with_gnu_ld" = no; then
9090 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
94279091 hardcode_libdir_separator=:
94289092
94299093 case $host_cpu in
94349098 *)
94359099 hardcode_direct=yes
94369100 hardcode_direct_absolute=yes
9437 export_dynamic_flag_spec='$wl-E'
9101 export_dynamic_flag_spec='${wl}-E'
94389102
94399103 # hardcode_minus_L: Not really in the search PATH,
94409104 # but as the default location of the library.
94459109 ;;
94469110
94479111 irix5* | irix6* | nonstopux*)
9448 if test yes = "$GCC"; then
9449 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9112 if test "$GCC" = yes; then
9113 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
94509114 # Try to use the -exported_symbol ld option, if it does not
94519115 # work, assume that -exports_file does not work either and
94529116 # implicitly export all symbols.
94569120 if ${lt_cv_irix_exported_symbol+:} false; then :
94579121 $as_echo_n "(cached) " >&6
94589122 else
9459 save_LDFLAGS=$LDFLAGS
9460 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
9123 save_LDFLAGS="$LDFLAGS"
9124 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
94619125 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
94629126 /* end confdefs.h. */
94639127 int foo (void) { return 0; }
94699133 fi
94709134 rm -f core conftest.err conftest.$ac_objext \
94719135 conftest$ac_exeext conftest.$ac_ext
9472 LDFLAGS=$save_LDFLAGS
9136 LDFLAGS="$save_LDFLAGS"
94739137 fi
94749138 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
94759139 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
9476 if test yes = "$lt_cv_irix_exported_symbol"; then
9477 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
9140 if test "$lt_cv_irix_exported_symbol" = yes; then
9141 archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
94789142 fi
94799143 else
9480 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9481 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
9144 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
9145 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
94829146 fi
94839147 archive_cmds_need_lc='no'
9484 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9148 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
94859149 hardcode_libdir_separator=:
94869150 inherit_rpath=yes
94879151 link_all_deplibs=yes
94889152 ;;
94899153
9490 linux*)
9491 case $cc_basename in
9492 tcc*)
9493 # Fabrice Bellard et al's Tiny C Compiler
9494 ld_shlibs=yes
9495 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9496 ;;
9497 esac
9498 ;;
9499
9500 netbsd*)
9154 netbsd* | netbsdelf*-gnu)
95019155 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
95029156 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
95039157 else
95119165 newsos6)
95129166 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
95139167 hardcode_direct=yes
9514 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9168 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
95159169 hardcode_libdir_separator=:
95169170 hardcode_shlibpath_var=no
95179171 ;;
95199173 *nto* | *qnx*)
95209174 ;;
95219175
9522 openbsd* | bitrig*)
9176 openbsd*)
95239177 if test -f /usr/libexec/ld.so; then
95249178 hardcode_direct=yes
95259179 hardcode_shlibpath_var=no
95269180 hardcode_direct_absolute=yes
9527 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
9181 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
95289182 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9529 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
9530 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9531 export_dynamic_flag_spec='$wl-E'
9183 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
9184 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9185 export_dynamic_flag_spec='${wl}-E'
95329186 else
9533 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9534 hardcode_libdir_flag_spec='$wl-rpath,$libdir'
9187 case $host_os in
9188 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
9189 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9190 hardcode_libdir_flag_spec='-R$libdir'
9191 ;;
9192 *)
9193 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9194 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9195 ;;
9196 esac
95359197 fi
95369198 else
95379199 ld_shlibs=no
95429204 hardcode_libdir_flag_spec='-L$libdir'
95439205 hardcode_minus_L=yes
95449206 allow_undefined_flag=unsupported
9545 shrext_cmds=.dll
9546 archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9547 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9548 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9549 $ECHO EXPORTS >> $output_objdir/$libname.def~
9550 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
9551 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9552 emximp -o $lib $output_objdir/$libname.def'
9553 archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
9554 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
9555 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
9556 $ECHO EXPORTS >> $output_objdir/$libname.def~
9557 prefix_cmds="$SED"~
9558 if test EXPORTS = "`$SED 1q $export_symbols`"; then
9559 prefix_cmds="$prefix_cmds -e 1d";
9560 fi~
9561 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
9562 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
9563 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
9564 emximp -o $lib $output_objdir/$libname.def'
9565 old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
9566 enable_shared_with_static_runtimes=yes
9207 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
9208 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
95679209 ;;
95689210
95699211 osf3*)
9570 if test yes = "$GCC"; then
9571 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
9572 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9212 if test "$GCC" = yes; then
9213 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
9214 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
95739215 else
95749216 allow_undefined_flag=' -expect_unresolved \*'
9575 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9217 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
95769218 fi
95779219 archive_cmds_need_lc='no'
9578 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9220 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
95799221 hardcode_libdir_separator=:
95809222 ;;
95819223
95829224 osf4* | osf5*) # as osf3* with the addition of -msym flag
9583 if test yes = "$GCC"; then
9584 allow_undefined_flag=' $wl-expect_unresolved $wl\*'
9585 archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
9586 hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
9225 if test "$GCC" = yes; then
9226 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
9227 archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
9228 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
95879229 else
95889230 allow_undefined_flag=' -expect_unresolved \*'
9589 archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
9231 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
95909232 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
9591 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
9233 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
95929234
95939235 # Both c and cxx compiler support -rpath directly
95949236 hardcode_libdir_flag_spec='-rpath $libdir'
95999241
96009242 solaris*)
96019243 no_undefined_flag=' -z defs'
9602 if test yes = "$GCC"; then
9603 wlarc='$wl'
9604 archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
9244 if test "$GCC" = yes; then
9245 wlarc='${wl}'
9246 archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
96059247 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9606 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9248 $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
96079249 else
96089250 case `$CC -V 2>&1` in
96099251 *"Compilers 5.0"*)
96109252 wlarc=''
9611 archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
9253 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
96129254 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9613 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9255 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
96149256 ;;
96159257 *)
9616 wlarc='$wl'
9617 archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9258 wlarc='${wl}'
9259 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
96189260 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9619 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9261 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
96209262 ;;
96219263 esac
96229264 fi
96269268 solaris2.[0-5] | solaris2.[0-5].*) ;;
96279269 *)
96289270 # The compiler driver will combine and reorder linker options,
9629 # but understands '-z linker_flag'. GCC discards it without '$wl',
9271 # but understands `-z linker_flag'. GCC discards it without `$wl',
96309272 # but is careful enough not to reorder.
96319273 # Supported since Solaris 2.6 (maybe 2.5.1?)
9632 if test yes = "$GCC"; then
9633 whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
9274 if test "$GCC" = yes; then
9275 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
96349276 else
96359277 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
96369278 fi
96409282 ;;
96419283
96429284 sunos4*)
9643 if test sequent = "$host_vendor"; then
9285 if test "x$host_vendor" = xsequent; then
96449286 # Use $CC to link under sequent, because it throws in some extra .o
96459287 # files that make .init and .fini sections work.
9646 archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9288 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
96479289 else
96489290 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
96499291 fi
96929334 ;;
96939335
96949336 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
9695 no_undefined_flag='$wl-z,text'
9337 no_undefined_flag='${wl}-z,text'
96969338 archive_cmds_need_lc=no
96979339 hardcode_shlibpath_var=no
96989340 runpath_var='LD_RUN_PATH'
96999341
9700 if test yes = "$GCC"; then
9701 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9702 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9342 if test "$GCC" = yes; then
9343 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9344 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
97039345 else
9704 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9705 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9346 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9347 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
97069348 fi
97079349 ;;
97089350
97099351 sysv5* | sco3.2v5* | sco5v6*)
9710 # Note: We CANNOT use -z defs as we might desire, because we do not
9352 # Note: We can NOT use -z defs as we might desire, because we do not
97119353 # link with -lc, and that would cause any symbols used from libc to
97129354 # always be unresolved, which means just about no library would
97139355 # ever link correctly. If we're not using GNU ld we use -z text
97149356 # though, which does catch some bad symbols but isn't as heavy-handed
97159357 # as -z defs.
9716 no_undefined_flag='$wl-z,text'
9717 allow_undefined_flag='$wl-z,nodefs'
9358 no_undefined_flag='${wl}-z,text'
9359 allow_undefined_flag='${wl}-z,nodefs'
97189360 archive_cmds_need_lc=no
97199361 hardcode_shlibpath_var=no
9720 hardcode_libdir_flag_spec='$wl-R,$libdir'
9362 hardcode_libdir_flag_spec='${wl}-R,$libdir'
97219363 hardcode_libdir_separator=':'
97229364 link_all_deplibs=yes
9723 export_dynamic_flag_spec='$wl-Bexport'
9365 export_dynamic_flag_spec='${wl}-Bexport'
97249366 runpath_var='LD_RUN_PATH'
97259367
9726 if test yes = "$GCC"; then
9727 archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9728 archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9368 if test "$GCC" = yes; then
9369 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9370 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
97299371 else
9730 archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9731 archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9372 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9373 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
97329374 fi
97339375 ;;
97349376
97439385 ;;
97449386 esac
97459387
9746 if test sni = "$host_vendor"; then
9388 if test x$host_vendor = xsni; then
97479389 case $host in
97489390 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9749 export_dynamic_flag_spec='$wl-Blargedynsym'
9391 export_dynamic_flag_spec='${wl}-Blargedynsym'
97509392 ;;
97519393 esac
97529394 fi
97549396
97559397 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
97569398 $as_echo "$ld_shlibs" >&6; }
9757 test no = "$ld_shlibs" && can_build_shared=no
9399 test "$ld_shlibs" = no && can_build_shared=no
97589400
97599401 with_gnu_ld=$with_gnu_ld
97609402
97809422 # Assume -lc should be added
97819423 archive_cmds_need_lc=yes
97829424
9783 if test yes,yes = "$GCC,$enable_shared"; then
9425 if test "$enable_shared" = yes && test "$GCC" = yes; then
97849426 case $archive_cmds in
97859427 *'~'*)
97869428 # FIXME: we may have to deal with multi-command sequences.
99959637 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
99969638 $as_echo_n "checking dynamic linker characteristics... " >&6; }
99979639
9998 if test yes = "$GCC"; then
9640 if test "$GCC" = yes; then
99999641 case $host_os in
10000 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
10001 *) lt_awk_arg='/^libraries:/' ;;
9642 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
9643 *) lt_awk_arg="/^libraries:/" ;;
100029644 esac
100039645 case $host_os in
10004 mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
10005 *) lt_sed_strip_eq='s|=/|/|g' ;;
9646 mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
9647 *) lt_sed_strip_eq="s,=/,/,g" ;;
100069648 esac
100079649 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
100089650 case $lt_search_path_spec in
100189660 ;;
100199661 esac
100209662 # Ok, now we have the path, separated by spaces, we can step through it
10021 # and add multilib dir if necessary...
9663 # and add multilib dir if necessary.
100229664 lt_tmp_lt_search_path_spec=
10023 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
10024 # ...but if some path component already ends with the multilib dir we assume
10025 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
10026 case "$lt_multi_os_dir; $lt_search_path_spec " in
10027 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
10028 lt_multi_os_dir=
10029 ;;
10030 esac
9665 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
100319666 for lt_sys_path in $lt_search_path_spec; do
10032 if test -d "$lt_sys_path$lt_multi_os_dir"; then
10033 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
10034 elif test -n "$lt_multi_os_dir"; then
9667 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
9668 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
9669 else
100359670 test -d "$lt_sys_path" && \
100369671 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
100379672 fi
100389673 done
100399674 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
10040 BEGIN {RS = " "; FS = "/|\n";} {
10041 lt_foo = "";
10042 lt_count = 0;
9675 BEGIN {RS=" "; FS="/|\n";} {
9676 lt_foo="";
9677 lt_count=0;
100439678 for (lt_i = NF; lt_i > 0; lt_i--) {
100449679 if ($lt_i != "" && $lt_i != ".") {
100459680 if ($lt_i == "..") {
100469681 lt_count++;
100479682 } else {
100489683 if (lt_count == 0) {
10049 lt_foo = "/" $lt_i lt_foo;
9684 lt_foo="/" $lt_i lt_foo;
100509685 } else {
100519686 lt_count--;
100529687 }
100609695 # for these hosts.
100619696 case $host_os in
100629697 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
10063 $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
9698 $SED 's,/\([A-Za-z]:\),\1,g'` ;;
100649699 esac
100659700 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
100669701 else
100699704 library_names_spec=
100709705 libname_spec='lib$name'
100719706 soname_spec=
10072 shrext_cmds=.so
9707 shrext_cmds=".so"
100739708 postinstall_cmds=
100749709 postuninstall_cmds=
100759710 finish_cmds=
100869721 # flags to be left without arguments
100879722 need_version=unknown
100889723
10089
10090
100919724 case $host_os in
100929725 aix3*)
100939726 version_type=linux # correct to gnu/linux during the next big refactor
10094 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
9727 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
100959728 shlibpath_var=LIBPATH
100969729
100979730 # AIX 3 has no versioning support, so we append a major version to the name.
10098 soname_spec='$libname$release$shared_ext$major'
9731 soname_spec='${libname}${release}${shared_ext}$major'
100999732 ;;
101009733
101019734 aix[4-9]*)
101039736 need_lib_prefix=no
101049737 need_version=no
101059738 hardcode_into_libs=yes
10106 if test ia64 = "$host_cpu"; then
9739 if test "$host_cpu" = ia64; then
101079740 # AIX 5 supports IA64
10108 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
9741 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
101099742 shlibpath_var=LD_LIBRARY_PATH
101109743 else
101119744 # With GCC up to 2.95.x, collect2 would create an import file
101129745 # for dependence libraries. The import file would start with
10113 # the line '#! .'. This would cause the generated library to
10114 # depend on '.', always an invalid library. This was fixed in
9746 # the line `#! .'. This would cause the generated library to
9747 # depend on `.', always an invalid library. This was fixed in
101159748 # development snapshots of GCC prior to 3.0.
101169749 case $host_os in
101179750 aix4 | aix4.[01] | aix4.[01].*)
101189751 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
101199752 echo ' yes '
10120 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
9753 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
101219754 :
101229755 else
101239756 can_build_shared=no
101249757 fi
101259758 ;;
101269759 esac
10127 # Using Import Files as archive members, it is possible to support
10128 # filename-based versioning of shared library archives on AIX. While
10129 # this would work for both with and without runtime linking, it will
10130 # prevent static linking of such archives. So we do filename-based
10131 # shared library versioning with .so extension only, which is used
10132 # when both runtime linking and shared linking is enabled.
10133 # Unfortunately, runtime linking may impact performance, so we do
10134 # not want this to be the default eventually. Also, we use the
10135 # versioned .so libs for executables only if there is the -brtl
10136 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
10137 # To allow for filename-based versioning support, we need to create
10138 # libNAME.so.V as an archive file, containing:
10139 # *) an Import File, referring to the versioned filename of the
10140 # archive as well as the shared archive member, telling the
10141 # bitwidth (32 or 64) of that shared object, and providing the
10142 # list of exported symbols of that shared object, eventually
10143 # decorated with the 'weak' keyword
10144 # *) the shared object with the F_LOADONLY flag set, to really avoid
10145 # it being seen by the linker.
10146 # At run time we better use the real file rather than another symlink,
10147 # but for link time we create the symlink libNAME.so -> libNAME.so.V
10148
10149 case $with_aix_soname,$aix_use_runtimelinking in
10150 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
9760 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
101519761 # soname into executable. Probably we can add versioning support to
101529762 # collect2, so additional links can be useful in future.
10153 aix,yes) # traditional libtool
10154 dynamic_linker='AIX unversionable lib.so'
9763 if test "$aix_use_runtimelinking" = yes; then
101559764 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
101569765 # instead of lib<name>.a to let people know that these are not
101579766 # typical AIX shared libraries.
10158 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10159 ;;
10160 aix,no) # traditional AIX only
10161 dynamic_linker='AIX lib.a(lib.so.V)'
9767 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9768 else
101629769 # We preserve .a as extension for shared libraries through AIX4.2
101639770 # and later when we are not doing run time linking.
10164 library_names_spec='$libname$release.a $libname.a'
10165 soname_spec='$libname$release$shared_ext$major'
10166 ;;
10167 svr4,*) # full svr4 only
10168 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
10169 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
10170 # We do not specify a path in Import Files, so LIBPATH fires.
10171 shlibpath_overrides_runpath=yes
10172 ;;
10173 *,yes) # both, prefer svr4
10174 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
10175 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
10176 # unpreferred sharedlib libNAME.a needs extra handling
10177 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
10178 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
10179 # We do not specify a path in Import Files, so LIBPATH fires.
10180 shlibpath_overrides_runpath=yes
10181 ;;
10182 *,no) # both, prefer aix
10183 dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
10184 library_names_spec='$libname$release.a $libname.a'
10185 soname_spec='$libname$release$shared_ext$major'
10186 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
10187 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
10188 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
10189 ;;
10190 esac
9771 library_names_spec='${libname}${release}.a $libname.a'
9772 soname_spec='${libname}${release}${shared_ext}$major'
9773 fi
101919774 shlibpath_var=LIBPATH
101929775 fi
101939776 ;;
101979780 powerpc)
101989781 # Since July 2007 AmigaOS4 officially supports .so libraries.
101999782 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
10200 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
9783 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
102019784 ;;
102029785 m68k)
102039786 library_names_spec='$libname.ixlibrary $libname.a'
102049787 # Create ${libname}_ixlibrary.a entries in /sys/libs.
10205 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
9788 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
102069789 ;;
102079790 esac
102089791 ;;
102099792
102109793 beos*)
10211 library_names_spec='$libname$shared_ext'
9794 library_names_spec='${libname}${shared_ext}'
102129795 dynamic_linker="$host_os ld.so"
102139796 shlibpath_var=LIBRARY_PATH
102149797 ;;
102169799 bsdi[45]*)
102179800 version_type=linux # correct to gnu/linux during the next big refactor
102189801 need_version=no
10219 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10220 soname_spec='$libname$release$shared_ext$major'
9802 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9803 soname_spec='${libname}${release}${shared_ext}$major'
102219804 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
102229805 shlibpath_var=LD_LIBRARY_PATH
102239806 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
102299812
102309813 cygwin* | mingw* | pw32* | cegcc*)
102319814 version_type=windows
10232 shrext_cmds=.dll
9815 shrext_cmds=".dll"
102339816 need_version=no
102349817 need_lib_prefix=no
102359818
102389821 # gcc
102399822 library_names_spec='$libname.dll.a'
102409823 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10241 postinstall_cmds='base_file=`basename \$file`~
10242 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
9824 postinstall_cmds='base_file=`basename \${file}`~
9825 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
102439826 dldir=$destdir/`dirname \$dlpath`~
102449827 test -d \$dldir || mkdir -p \$dldir~
102459828 $install_prog $dir/$dlname \$dldir/$dlname~
102559838 case $host_os in
102569839 cygwin*)
102579840 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
10258 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
9841 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
102599842
102609843 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
102619844 ;;
102629845 mingw* | cegcc*)
102639846 # MinGW DLLs use traditional 'lib' prefix
10264 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
9847 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
102659848 ;;
102669849 pw32*)
102679850 # pw32 DLLs use 'pw' prefix rather than 'lib'
10268 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
9851 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
102699852 ;;
102709853 esac
102719854 dynamic_linker='Win32 ld.exe'
102749857 *,cl*)
102759858 # Native MSVC
102769859 libname_spec='$name'
10277 soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
10278 library_names_spec='$libname.dll.lib'
9860 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9861 library_names_spec='${libname}.dll.lib'
102799862
102809863 case $build_os in
102819864 mingw*)
103029885 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
103039886 ;;
103049887 *)
10305 sys_lib_search_path_spec=$LIB
9888 sys_lib_search_path_spec="$LIB"
103069889 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
103079890 # It is most probably a Windows format PATH.
103089891 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
103159898 esac
103169899
103179900 # DLL is installed to $(libdir)/../bin by postinstall_cmds
10318 postinstall_cmds='base_file=`basename \$file`~
10319 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
9901 postinstall_cmds='base_file=`basename \${file}`~
9902 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
103209903 dldir=$destdir/`dirname \$dlpath`~
103219904 test -d \$dldir || mkdir -p \$dldir~
103229905 $install_prog $dir/$dlname \$dldir/$dlname'
103299912
103309913 *)
103319914 # Assume MSVC wrapper
10332 library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
9915 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
103339916 dynamic_linker='Win32 ld.exe'
103349917 ;;
103359918 esac
103429925 version_type=darwin
103439926 need_lib_prefix=no
103449927 need_version=no
10345 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
10346 soname_spec='$libname$release$major$shared_ext'
9928 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
9929 soname_spec='${libname}${release}${major}$shared_ext'
103479930 shlibpath_overrides_runpath=yes
103489931 shlibpath_var=DYLD_LIBRARY_PATH
103499932 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
103569939 version_type=linux # correct to gnu/linux during the next big refactor
103579940 need_lib_prefix=no
103589941 need_version=no
10359 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10360 soname_spec='$libname$release$shared_ext$major'
9942 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
9943 soname_spec='${libname}${release}${shared_ext}$major'
103619944 shlibpath_var=LD_LIBRARY_PATH
103629945 ;;
103639946
103759958 version_type=freebsd-$objformat
103769959 case $version_type in
103779960 freebsd-elf*)
10378 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10379 soname_spec='$libname$release$shared_ext$major'
9961 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
103809962 need_version=no
103819963 need_lib_prefix=no
103829964 ;;
103839965 freebsd-*)
10384 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
9966 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
103859967 need_version=yes
103869968 ;;
103879969 esac
104119993 need_lib_prefix=no
104129994 need_version=no
104139995 dynamic_linker="$host_os runtime_loader"
10414 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10415 soname_spec='$libname$release$shared_ext$major'
9996 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
9997 soname_spec='${libname}${release}${shared_ext}$major'
104169998 shlibpath_var=LIBRARY_PATH
10417 shlibpath_overrides_runpath=no
9999 shlibpath_overrides_runpath=yes
1041810000 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
1041910001 hardcode_into_libs=yes
1042010002 ;;
1043210014 dynamic_linker="$host_os dld.so"
1043310015 shlibpath_var=LD_LIBRARY_PATH
1043410016 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10435 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10436 soname_spec='$libname$release$shared_ext$major'
10437 if test 32 = "$HPUX_IA64_MODE"; then
10017 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10018 soname_spec='${libname}${release}${shared_ext}$major'
10019 if test "X$HPUX_IA64_MODE" = X32; then
1043810020 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
10439 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
1044010021 else
1044110022 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
10442 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
1044310023 fi
10024 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1044410025 ;;
1044510026 hppa*64*)
1044610027 shrext_cmds='.sl'
1044810029 dynamic_linker="$host_os dld.sl"
1044910030 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1045010031 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10451 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10452 soname_spec='$libname$release$shared_ext$major'
10032 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10033 soname_spec='${libname}${release}${shared_ext}$major'
1045310034 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1045410035 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1045510036 ;;
1045810039 dynamic_linker="$host_os dld.sl"
1045910040 shlibpath_var=SHLIB_PATH
1046010041 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
10461 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10462 soname_spec='$libname$release$shared_ext$major'
10042 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10043 soname_spec='${libname}${release}${shared_ext}$major'
1046310044 ;;
1046410045 esac
1046510046 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
1047210053 version_type=linux # correct to gnu/linux during the next big refactor
1047310054 need_lib_prefix=no
1047410055 need_version=no
10475 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10476 soname_spec='$libname$release$shared_ext$major'
10056 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10057 soname_spec='${libname}${release}${shared_ext}$major'
1047710058 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
1047810059 shlibpath_var=LD_LIBRARY_PATH
1047910060 shlibpath_overrides_runpath=no
1048410065 case $host_os in
1048510066 nonstopux*) version_type=nonstopux ;;
1048610067 *)
10487 if test yes = "$lt_cv_prog_gnu_ld"; then
10068 if test "$lt_cv_prog_gnu_ld" = yes; then
1048810069 version_type=linux # correct to gnu/linux during the next big refactor
1048910070 else
1049010071 version_type=irix
1049210073 esac
1049310074 need_lib_prefix=no
1049410075 need_version=no
10495 soname_spec='$libname$release$shared_ext$major'
10496 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
10076 soname_spec='${libname}${release}${shared_ext}$major'
10077 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
1049710078 case $host_os in
1049810079 irix5* | nonstopux*)
1049910080 libsuff= shlibsuff=
1051210093 esac
1051310094 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
1051410095 shlibpath_overrides_runpath=no
10515 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
10516 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
10096 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
10097 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
1051710098 hardcode_into_libs=yes
1051810099 ;;
1051910100
1052010101 # No shared lib support for Linux oldld, aout, or coff.
1052110102 linux*oldld* | linux*aout* | linux*coff*)
1052210103 dynamic_linker=no
10523 ;;
10524
10525 linux*android*)
10526 version_type=none # Android doesn't support versioned libraries.
10527 need_lib_prefix=no
10528 need_version=no
10529 library_names_spec='$libname$release$shared_ext'
10530 soname_spec='$libname$release$shared_ext'
10531 finish_cmds=
10532 shlibpath_var=LD_LIBRARY_PATH
10533 shlibpath_overrides_runpath=yes
10534
10535 # This implies no fast_install, which is unacceptable.
10536 # Some rework will be needed to allow for fast_install
10537 # before this can be enabled.
10538 hardcode_into_libs=yes
10539
10540 dynamic_linker='Android linker'
10541 # Don't embed -rpath directories since the linker doesn't support them.
10542 hardcode_libdir_flag_spec='-L$libdir'
1054310104 ;;
1054410105
1054510106 # This must be glibc/ELF.
1054710108 version_type=linux # correct to gnu/linux during the next big refactor
1054810109 need_lib_prefix=no
1054910110 need_version=no
10550 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10551 soname_spec='$libname$release$shared_ext$major'
10111 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10112 soname_spec='${libname}${release}${shared_ext}$major'
1055210113 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1055310114 shlibpath_var=LD_LIBRARY_PATH
1055410115 shlibpath_overrides_runpath=no
1059210153 # before this can be enabled.
1059310154 hardcode_into_libs=yes
1059410155
10595 # Ideally, we could use ldconfig to report *all* directores which are
10596 # searched for libraries, however this is still not possible. Aside from not
10597 # being certain /sbin/ldconfig is available, command
10598 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
10599 # even though it is searched at run-time. Try to do the best guess by
10600 # appending ld.so.conf contents (and includes) to the search path.
10156 # Append ld.so.conf contents to the search path
1060110157 if test -f /etc/ld.so.conf; then
1060210158 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
1060310159 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
1061210168 dynamic_linker='GNU/Linux ld.so'
1061310169 ;;
1061410170
10171 netbsdelf*-gnu)
10172 version_type=linux
10173 need_lib_prefix=no
10174 need_version=no
10175 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10176 soname_spec='${libname}${release}${shared_ext}$major'
10177 shlibpath_var=LD_LIBRARY_PATH
10178 shlibpath_overrides_runpath=no
10179 hardcode_into_libs=yes
10180 dynamic_linker='NetBSD ld.elf_so'
10181 ;;
10182
1061510183 netbsd*)
1061610184 version_type=sunos
1061710185 need_lib_prefix=no
1061810186 need_version=no
1061910187 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10620 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
10188 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1062110189 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1062210190 dynamic_linker='NetBSD (a.out) ld.so'
1062310191 else
10624 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10625 soname_spec='$libname$release$shared_ext$major'
10192 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10193 soname_spec='${libname}${release}${shared_ext}$major'
1062610194 dynamic_linker='NetBSD ld.elf_so'
1062710195 fi
1062810196 shlibpath_var=LD_LIBRARY_PATH
1063210200
1063310201 newsos6)
1063410202 version_type=linux # correct to gnu/linux during the next big refactor
10635 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10203 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1063610204 shlibpath_var=LD_LIBRARY_PATH
1063710205 shlibpath_overrides_runpath=yes
1063810206 ;;
1064110209 version_type=qnx
1064210210 need_lib_prefix=no
1064310211 need_version=no
10644 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10645 soname_spec='$libname$release$shared_ext$major'
10212 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10213 soname_spec='${libname}${release}${shared_ext}$major'
1064610214 shlibpath_var=LD_LIBRARY_PATH
1064710215 shlibpath_overrides_runpath=no
1064810216 hardcode_into_libs=yes
1064910217 dynamic_linker='ldqnx.so'
1065010218 ;;
1065110219
10652 openbsd* | bitrig*)
10220 openbsd*)
1065310221 version_type=sunos
10654 sys_lib_dlsearch_path_spec=/usr/lib
10222 sys_lib_dlsearch_path_spec="/usr/lib"
1065510223 need_lib_prefix=no
10656 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
10657 need_version=no
10658 else
10659 need_version=yes
10660 fi
10661 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
10224 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
10225 case $host_os in
10226 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
10227 *) need_version=no ;;
10228 esac
10229 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1066210230 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1066310231 shlibpath_var=LD_LIBRARY_PATH
10664 shlibpath_overrides_runpath=yes
10232 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10233 case $host_os in
10234 openbsd2.[89] | openbsd2.[89].*)
10235 shlibpath_overrides_runpath=no
10236 ;;
10237 *)
10238 shlibpath_overrides_runpath=yes
10239 ;;
10240 esac
10241 else
10242 shlibpath_overrides_runpath=yes
10243 fi
1066510244 ;;
1066610245
1066710246 os2*)
1066810247 libname_spec='$name'
10669 version_type=windows
10670 shrext_cmds=.dll
10671 need_version=no
10248 shrext_cmds=".dll"
1067210249 need_lib_prefix=no
10673 # OS/2 can only load a DLL with a base name of 8 characters or less.
10674 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
10675 v=$($ECHO $release$versuffix | tr -d .-);
10676 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
10677 $ECHO $n$v`$shared_ext'
10678 library_names_spec='${libname}_dll.$libext'
10250 library_names_spec='$libname${shared_ext} $libname.a'
1067910251 dynamic_linker='OS/2 ld.exe'
10680 shlibpath_var=BEGINLIBPATH
10681 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
10682 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
10683 postinstall_cmds='base_file=`basename \$file`~
10684 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
10685 dldir=$destdir/`dirname \$dlpath`~
10686 test -d \$dldir || mkdir -p \$dldir~
10687 $install_prog $dir/$dlname \$dldir/$dlname~
10688 chmod a+x \$dldir/$dlname~
10689 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
10690 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
10691 fi'
10692 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
10693 dlpath=$dir/\$dldll~
10694 $RM \$dlpath'
10252 shlibpath_var=LIBPATH
1069510253 ;;
1069610254
1069710255 osf3* | osf4* | osf5*)
1069810256 version_type=osf
1069910257 need_lib_prefix=no
1070010258 need_version=no
10701 soname_spec='$libname$release$shared_ext$major'
10702 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10259 soname_spec='${libname}${release}${shared_ext}$major'
10260 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1070310261 shlibpath_var=LD_LIBRARY_PATH
1070410262 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
10705 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
10263 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
1070610264 ;;
1070710265
1070810266 rdos*)
1071310271 version_type=linux # correct to gnu/linux during the next big refactor
1071410272 need_lib_prefix=no
1071510273 need_version=no
10716 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10717 soname_spec='$libname$release$shared_ext$major'
10274 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10275 soname_spec='${libname}${release}${shared_ext}$major'
1071810276 shlibpath_var=LD_LIBRARY_PATH
1071910277 shlibpath_overrides_runpath=yes
1072010278 hardcode_into_libs=yes
1072410282
1072510283 sunos4*)
1072610284 version_type=sunos
10727 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
10285 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
1072810286 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1072910287 shlibpath_var=LD_LIBRARY_PATH
1073010288 shlibpath_overrides_runpath=yes
10731 if test yes = "$with_gnu_ld"; then
10289 if test "$with_gnu_ld" = yes; then
1073210290 need_lib_prefix=no
1073310291 fi
1073410292 need_version=yes
1073610294
1073710295 sysv4 | sysv4.3*)
1073810296 version_type=linux # correct to gnu/linux during the next big refactor
10739 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10740 soname_spec='$libname$release$shared_ext$major'
10297 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10298 soname_spec='${libname}${release}${shared_ext}$major'
1074110299 shlibpath_var=LD_LIBRARY_PATH
1074210300 case $host_vendor in
1074310301 sni)
1075810316 ;;
1075910317
1076010318 sysv4*MP*)
10761 if test -d /usr/nec; then
10319 if test -d /usr/nec ;then
1076210320 version_type=linux # correct to gnu/linux during the next big refactor
10763 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
10764 soname_spec='$libname$shared_ext.$major'
10321 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
10322 soname_spec='$libname${shared_ext}.$major'
1076510323 shlibpath_var=LD_LIBRARY_PATH
1076610324 fi
1076710325 ;;
1076810326
1076910327 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
10770 version_type=sco
10328 version_type=freebsd-elf
1077110329 need_lib_prefix=no
1077210330 need_version=no
10773 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
10774 soname_spec='$libname$release$shared_ext$major'
10331 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
10332 soname_spec='${libname}${release}${shared_ext}$major'
1077510333 shlibpath_var=LD_LIBRARY_PATH
1077610334 shlibpath_overrides_runpath=yes
1077710335 hardcode_into_libs=yes
10778 if test yes = "$with_gnu_ld"; then
10336 if test "$with_gnu_ld" = yes; then
1077910337 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
1078010338 else
1078110339 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
1079310351 version_type=linux # correct to gnu/linux during the next big refactor
1079410352 need_lib_prefix=no
1079510353 need_version=no
10796 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10354 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1079710355 shlibpath_var=LD_LIBRARY_PATH
1079810356 shlibpath_overrides_runpath=no
1079910357 hardcode_into_libs=yes
1080110359
1080210360 uts4*)
1080310361 version_type=linux # correct to gnu/linux during the next big refactor
10804 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
10805 soname_spec='$libname$release$shared_ext$major'
10362 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10363 soname_spec='${libname}${release}${shared_ext}$major'
1080610364 shlibpath_var=LD_LIBRARY_PATH
1080710365 ;;
1080810366
1081210370 esac
1081310371 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
1081410372 $as_echo "$dynamic_linker" >&6; }
10815 test no = "$dynamic_linker" && can_build_shared=no
10373 test "$dynamic_linker" = no && can_build_shared=no
1081610374
1081710375 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
10818 if test yes = "$GCC"; then
10376 if test "$GCC" = yes; then
1081910377 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
1082010378 fi
1082110379
10822 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
10823 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
10824 fi
10825
10826 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
10827 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
10828 fi
10829
10830 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
10831 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
10832
10833 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
10834 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
10835
10836 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
10837 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
10838
10839
10840
10841
10842
10380 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
10381 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
10382 fi
10383 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
10384 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
10385 fi
1084310386
1084410387
1084510388
1093710480 hardcode_action=
1093810481 if test -n "$hardcode_libdir_flag_spec" ||
1093910482 test -n "$runpath_var" ||
10940 test yes = "$hardcode_automatic"; then
10483 test "X$hardcode_automatic" = "Xyes" ; then
1094110484
1094210485 # We can hardcode non-existent directories.
10943 if test no != "$hardcode_direct" &&
10486 if test "$hardcode_direct" != no &&
1094410487 # If the only mechanism to avoid hardcoding is shlibpath_var, we
1094510488 # have to relink, otherwise we might link with an installed library
1094610489 # when we should be linking with a yet-to-be-installed one
10947 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
10948 test no != "$hardcode_minus_L"; then
10490 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
10491 test "$hardcode_minus_L" != no; then
1094910492 # Linking always hardcodes the temporary library directory.
1095010493 hardcode_action=relink
1095110494 else
1096010503 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
1096110504 $as_echo "$hardcode_action" >&6; }
1096210505
10963 if test relink = "$hardcode_action" ||
10964 test yes = "$inherit_rpath"; then
10506 if test "$hardcode_action" = relink ||
10507 test "$inherit_rpath" = yes; then
1096510508 # Fast installation is not supported
1096610509 enable_fast_install=no
10967 elif test yes = "$shlibpath_overrides_runpath" ||
10968 test no = "$enable_shared"; then
10510 elif test "$shlibpath_overrides_runpath" = yes ||
10511 test "$enable_shared" = no; then
1096910512 # Fast installation is not necessary
1097010513 enable_fast_install=needless
1097110514 fi
1097510518
1097610519
1097710520
10978 if test yes != "$enable_dlopen"; then
10521 if test "x$enable_dlopen" != xyes; then
1097910522 enable_dlopen=unknown
1098010523 enable_dlopen_self=unknown
1098110524 enable_dlopen_self_static=unknown
1098510528
1098610529 case $host_os in
1098710530 beos*)
10988 lt_cv_dlopen=load_add_on
10531 lt_cv_dlopen="load_add_on"
1098910532 lt_cv_dlopen_libs=
1099010533 lt_cv_dlopen_self=yes
1099110534 ;;
1099210535
1099310536 mingw* | pw32* | cegcc*)
10994 lt_cv_dlopen=LoadLibrary
10537 lt_cv_dlopen="LoadLibrary"
1099510538 lt_cv_dlopen_libs=
1099610539 ;;
1099710540
1099810541 cygwin*)
10999 lt_cv_dlopen=dlopen
10542 lt_cv_dlopen="dlopen"
1100010543 lt_cv_dlopen_libs=
1100110544 ;;
1100210545
1100310546 darwin*)
11004 # if libdl is installed we need to link against it
10547 # if libdl is installed we need to link against it
1100510548 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
1100610549 $as_echo_n "checking for dlopen in -ldl... " >&6; }
1100710550 if ${ac_cv_lib_dl_dlopen+:} false; then :
1103910582 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
1104010583 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
1104110584 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11042 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
11043 else
11044
11045 lt_cv_dlopen=dyld
10585 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10586 else
10587
10588 lt_cv_dlopen="dyld"
1104610589 lt_cv_dlopen_libs=
1104710590 lt_cv_dlopen_self=yes
1104810591
1104910592 fi
1105010593
11051 ;;
11052
11053 tpf*)
11054 # Don't try to run any link tests for TPF. We know it's impossible
11055 # because TPF is a cross-compiler, and we know how we open DSOs.
11056 lt_cv_dlopen=dlopen
11057 lt_cv_dlopen_libs=
11058 lt_cv_dlopen_self=no
1105910594 ;;
1106010595
1106110596 *)
1106210597 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
1106310598 if test "x$ac_cv_func_shl_load" = xyes; then :
11064 lt_cv_dlopen=shl_load
10599 lt_cv_dlopen="shl_load"
1106510600 else
1106610601 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
1106710602 $as_echo_n "checking for shl_load in -ldld... " >&6; }
1110010635 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
1110110636 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
1110210637 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
11103 lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
10638 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
1110410639 else
1110510640 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
1110610641 if test "x$ac_cv_func_dlopen" = xyes; then :
11107 lt_cv_dlopen=dlopen
10642 lt_cv_dlopen="dlopen"
1110810643 else
1110910644 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
1111010645 $as_echo_n "checking for dlopen in -ldl... " >&6; }
1114310678 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
1114410679 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
1114510680 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11146 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
10681 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
1114710682 else
1114810683 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
1114910684 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
1118210717 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
1118310718 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
1118410719 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
11185 lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
10720 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
1118610721 else
1118710722 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
1118810723 $as_echo_n "checking for dld_link in -ldld... " >&6; }
1122110756 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
1122210757 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
1122310758 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
11224 lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
10759 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
1122510760 fi
1122610761
1122710762
1124210777 ;;
1124310778 esac
1124410779
11245 if test no = "$lt_cv_dlopen"; then
10780 if test "x$lt_cv_dlopen" != xno; then
10781 enable_dlopen=yes
10782 else
1124610783 enable_dlopen=no
11247 else
11248 enable_dlopen=yes
1124910784 fi
1125010785
1125110786 case $lt_cv_dlopen in
1125210787 dlopen)
11253 save_CPPFLAGS=$CPPFLAGS
11254 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
11255
11256 save_LDFLAGS=$LDFLAGS
10788 save_CPPFLAGS="$CPPFLAGS"
10789 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
10790
10791 save_LDFLAGS="$LDFLAGS"
1125710792 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1125810793
11259 save_LIBS=$LIBS
10794 save_LIBS="$LIBS"
1126010795 LIBS="$lt_cv_dlopen_libs $LIBS"
1126110796
1126210797 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
1126410799 if ${lt_cv_dlopen_self+:} false; then :
1126510800 $as_echo_n "(cached) " >&6
1126610801 else
11267 if test yes = "$cross_compiling"; then :
10802 if test "$cross_compiling" = yes; then :
1126810803 lt_cv_dlopen_self=cross
1126910804 else
1127010805 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1131110846 # endif
1131210847 #endif
1131310848
11314 /* When -fvisibility=hidden is used, assume the code has been annotated
10849 /* When -fvisbility=hidden is used, assume the code has been annotated
1131510850 correspondingly for the symbols needed. */
11316 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
10851 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1131710852 int fnord () __attribute__((visibility("default")));
1131810853 #endif
1131910854
1134310878 (eval $ac_link) 2>&5
1134410879 ac_status=$?
1134510880 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11346 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
10881 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
1134710882 (./conftest; exit; ) >&5 2>/dev/null
1134810883 lt_status=$?
1134910884 case x$lt_status in
1136310898 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
1136410899 $as_echo "$lt_cv_dlopen_self" >&6; }
1136510900
11366 if test yes = "$lt_cv_dlopen_self"; then
10901 if test "x$lt_cv_dlopen_self" = xyes; then
1136710902 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1136810903 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
1136910904 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
1137010905 if ${lt_cv_dlopen_self_static+:} false; then :
1137110906 $as_echo_n "(cached) " >&6
1137210907 else
11373 if test yes = "$cross_compiling"; then :
10908 if test "$cross_compiling" = yes; then :
1137410909 lt_cv_dlopen_self_static=cross
1137510910 else
1137610911 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1141710952 # endif
1141810953 #endif
1141910954
11420 /* When -fvisibility=hidden is used, assume the code has been annotated
10955 /* When -fvisbility=hidden is used, assume the code has been annotated
1142110956 correspondingly for the symbols needed. */
11422 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
10957 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1142310958 int fnord () __attribute__((visibility("default")));
1142410959 #endif
1142510960
1144910984 (eval $ac_link) 2>&5
1145010985 ac_status=$?
1145110986 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11452 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
10987 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
1145310988 (./conftest; exit; ) >&5 2>/dev/null
1145410989 lt_status=$?
1145510990 case x$lt_status in
1147011005 $as_echo "$lt_cv_dlopen_self_static" >&6; }
1147111006 fi
1147211007
11473 CPPFLAGS=$save_CPPFLAGS
11474 LDFLAGS=$save_LDFLAGS
11475 LIBS=$save_LIBS
11008 CPPFLAGS="$save_CPPFLAGS"
11009 LDFLAGS="$save_LDFLAGS"
11010 LIBS="$save_LIBS"
1147611011 ;;
1147711012 esac
1147811013
1151611051 # FIXME - insert some real tests, host_os isn't really good enough
1151711052 case $host_os in
1151811053 darwin*)
11519 if test -n "$STRIP"; then
11054 if test -n "$STRIP" ; then
1152011055 striplib="$STRIP -x"
1152111056 old_striplib="$STRIP -S"
1152211057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1154411079
1154511080
1154611081
11547 # Report what library types will actually be built
11082 # Report which library types will actually be built
1154811083 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
1154911084 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
1155011085 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
1155211087
1155311088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
1155411089 $as_echo_n "checking whether to build shared libraries... " >&6; }
11555 test no = "$can_build_shared" && enable_shared=no
11090 test "$can_build_shared" = "no" && enable_shared=no
1155611091
1155711092 # On AIX, shared libraries and static libraries use the same namespace, and
1155811093 # are all built from PIC.
1155911094 case $host_os in
1156011095 aix3*)
11561 test yes = "$enable_shared" && enable_static=no
11096 test "$enable_shared" = yes && enable_static=no
1156211097 if test -n "$RANLIB"; then
1156311098 archive_cmds="$archive_cmds~\$RANLIB \$lib"
1156411099 postinstall_cmds='$RANLIB $lib'
1156611101 ;;
1156711102
1156811103 aix[4-9]*)
11569 if test ia64 != "$host_cpu"; then
11570 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
11571 yes,aix,yes) ;; # shared object as lib.so file only
11572 yes,svr4,*) ;; # shared object as lib.so archive member only
11573 yes,*) enable_static=no ;; # shared object in lib.a archive as well
11574 esac
11104 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
11105 test "$enable_shared" = yes && enable_static=no
1157511106 fi
1157611107 ;;
1157711108 esac
1158111112 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
1158211113 $as_echo_n "checking whether to build static libraries... " >&6; }
1158311114 # Make sure either enable_shared or enable_static is yes.
11584 test yes = "$enable_shared" || enable_static=yes
11115 test "$enable_shared" = yes || enable_static=yes
1158511116 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
1158611117 $as_echo "$enable_static" >&6; }
1158711118
1159511126 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1159611127 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1159711128
11598 CC=$lt_save_CC
11129 CC="$lt_save_CC"
1159911130
1160011131
1160111132
1218111712 _ACEOF
1218211713
1218311714
11715 my_with_libunbound=1
11716 # Check whether --enable-stub-only was given.
11717 if test "${enable_stub_only+set}" = set; then :
11718 enableval=$enable_stub_only;
11719 fi
11720
11721 case "$enable_stub_only" in
11722 yes)
11723 my_with_libunbound=0
11724 ;;
11725 no|*)
11726 ;;
11727 esac
11728
11729
11730 # Check whether --with-getdns_query was given.
11731 if test "${with_getdns_query+set}" = set; then :
11732 withval=$with_getdns_query;
11733 else
11734 withval="no"
11735 fi
11736
11737 if test x_$withval = x_no; then
11738 GETDNS_QUERY=""
11739 INSTALL_GETDNS_QUERY=""
11740 UNINSTALL_GETDNS_QUERY=""
11741 else
11742 GETDNS_QUERY="getdns_query"
11743 INSTALL_GETDNS_QUERY="install-getdns_query"
11744 UNINSTALL_GETDNS_QUERY="uninstall-getdns_query"
11745 fi
11746
11747
11748
11749
11750
1218411751 # search to set include and library paths right
1218511752 # find libidn
11753 my_with_libidn=1
1218611754
1218711755 # Check whether --with-libidn was given.
1218811756 if test "${with_libidn+set}" = set; then :
1221811786 if test x_$withval != x_no; then
1221911787 CFLAGS="$CFLAGS -I$withval/include"
1222011788 LDFLAGS="$LDFLAGS -L$withval/lib"
11789 else
11790 my_with_libidn=0
1222111791 fi
1222211792 fi
1222311793
1224711817 fi
1224811818 fi
1224911819
12250 # find libunbound
11820 if test $my_with_libunbound = 1
11821 then
11822 # find libunbound
1225111823
1225211824 # Check whether --with-libunbound was given.
1225311825 if test "${with_libunbound+set}" = set; then :
1225611828 withval="yes"
1225711829 fi
1225811830
12259 if test x_$withval = x_yes; then
12260 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
12261 if test -f "$dir/include/unbound.h"; then
12262 CFLAGS="$CFLAGS -I$dir/include"
12263 LDFLAGS="$LDFLAGS -L$dir/lib"
12264 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libunbound in $dir" >&5
11831 if test x_$withval = x_yes; then
11832 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
11833 if test -f "$dir/include/unbound.h"; then
11834 CFLAGS="$CFLAGS -I$dir/include"
11835 LDFLAGS="$LDFLAGS -L$dir/lib"
11836 { $as_echo "$as_me:${as_lineno-$LINENO}: Found libunbound in $dir" >&5
1226511837 $as_echo "$as_me: Found libunbound in $dir" >&6;}
12266 break
11838 break
11839 fi
11840 done
11841 else
11842 if test x_$withval != x_no; then
11843 CFLAGS="$CFLAGS -I$withval/include"
11844 LDFLAGS="$LDFLAGS -L$withval/lib"
11845 else
11846
11847 cat >>confdefs.h <<_ACEOF
11848 #define DISABLE_RESOLUTION_RECURSING 1
11849 _ACEOF
11850
11851 my_with_libunbound=0
1226711852 fi
12268 done
12269 else
12270 if test x_$withval != x_no; then
12271 CFLAGS="$CFLAGS -I$withval/include"
12272 LDFLAGS="$LDFLAGS -L$withval/lib"
1227311853 fi
1227411854 fi
1227511855
1232411904 found_all_libs=0
1232511905 fi
1232611906
12327 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libidn" >&5
11907
11908 if test $my_with_libidn = 1
11909 then
11910 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libidn" >&5
1232811911 $as_echo "$as_me: Checking for dependency libidn" >&6;}
12329 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for idna_to_ascii_8z in -lidn" >&5
11912 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for idna_to_ascii_8z in -lidn" >&5
1233011913 $as_echo_n "checking for idna_to_ascii_8z in -lidn... " >&6; }
1233111914 if ${ac_cv_lib_idn_idna_to_ascii_8z+:} false; then :
1233211915 $as_echo_n "(cached) " >&6
1237311956 found_all_libs=0
1237411957 fi
1237511958
11959 fi
1237611960
1237711961 ac_fn_c_check_member "$LINENO" "struct ldns_struct_dnssec_zone" "hashed_names" "ac_cv_member_struct_ldns_struct_dnssec_zone_hashed_names" "#include <ldns/ldns.h>
1237811962 "
1238511969 fi
1238611970
1238711971
12388 if test $found_all_libs == 0
11972 if test $my_with_libunbound = 1
1238911973 then
12390 as_fn_error $? "One more dependencies is missing" "$LINENO" 5
12391 fi
12392
12393 # break out libunbound from other libraries since we are currently using a
12394 # patch to the sources
12395 found_libunbound=1
12396 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libunbound" >&5
11974 { $as_echo "$as_me:${as_lineno-$LINENO}: Checking for dependency libunbound" >&5
1239711975 $as_echo "$as_me: Checking for dependency libunbound" >&6;}
12398 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ub_fd in -lunbound" >&5
11976 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ub_fd in -lunbound" >&5
1239911977 $as_echo_n "checking for ub_fd in -lunbound... " >&6; }
1240011978 if ${ac_cv_lib_unbound_ub_fd+:} false; then :
1240111979 $as_echo_n "(cached) " >&6
1243912017 LIBS="-lunbound $LIBS"
1244012018
1244112019 else
12442 found_libunbound=0
12443 fi
12444
12445 if test $found_libunbound == 0
12020 found_all_libs=0
12021 fi
12022
12023 fi
12024
12025 if test $found_all_libs = 0
1244612026 then
12447 as_fn_error $? "libunbound is missing." "$LINENO" 5
12027 as_fn_error $? "One more dependencies is missing" "$LINENO" 5
1244812028 fi
1244912029
1245012030 # Extract the first word of "doxygen", so it can be a program name with args.
1488114461 # report actual input values of CONFIG_FILES etc. instead of their
1488214462 # values after options handling.
1488314463 ac_log="
14884 This file was extended by getdns $as_me 0.3.1, which was
14464 This file was extended by getdns $as_me 0.3.2, which was
1488514465 generated by GNU Autoconf 2.69. Invocation command line was
1488614466
1488714467 CONFIG_FILES = $CONFIG_FILES
1494214522 $config_commands
1494314523
1494414524 Report bugs to <stub-resolver@verisignlabs.com>.
14945 getdns home page: <http://getdnsapi.net>."
14525 getdns home page: <https://getdnsapi.net>."
1494614526
1494714527 _ACEOF
1494814528 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1494914529 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1495014530 ac_cs_version="\\
14951 getdns config.status 0.3.1
14531 getdns config.status 0.3.2
1495214532 configured by $0, generated by GNU Autoconf 2.69,
1495314533 with options \\"\$ac_cs_config\\"
1495414534
1508114661 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
1508214662 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
1508314663 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
15084 shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
1508514664 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
1508614665 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
1508714666 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
1513114710 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
1513214711 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
1513314712 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
15134 lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
1513514713 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
1513614714 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
15137 lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
1513814715 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
1513914716 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
15140 lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
1514114717 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
1514214718 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
1514314719 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
1520214778 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
1520314779 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
1520414780 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
15205 configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
15206 configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
14781 sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
1520714782 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
1520814783 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
1520914784 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
1525414829 compiler \
1525514830 lt_cv_sys_global_symbol_pipe \
1525614831 lt_cv_sys_global_symbol_to_cdecl \
15257 lt_cv_sys_global_symbol_to_import \
1525814832 lt_cv_sys_global_symbol_to_c_name_address \
1525914833 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
15260 lt_cv_nm_interface \
1526114834 nm_file_list_spec \
15262 lt_cv_truncate_bin \
1526314835 lt_prog_compiler_no_builtin_flag \
1526414836 lt_prog_compiler_pic \
1526514837 lt_prog_compiler_wl \
1529414866 striplib; do
1529514867 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1529614868 *[\\\\\\\`\\"\\\$]*)
15297 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
14869 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
1529814870 ;;
1529914871 *)
1530014872 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1532114893 postuninstall_cmds \
1532214894 finish_cmds \
1532314895 sys_lib_search_path_spec \
15324 configure_time_dlsearch_path \
15325 configure_time_lt_sys_library_path; do
14896 sys_lib_dlsearch_path_spec; do
1532614897 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
1532714898 *[\\\\\\\`\\"\\\$]*)
15328 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
14899 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
1532914900 ;;
1533014901 *)
1533114902 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
1533414905 done
1533514906
1533614907 ac_aux_dir='$ac_aux_dir'
15337
15338 # See if we are running on zsh, and set the options that allow our
14908 xsi_shell='$xsi_shell'
14909 lt_shell_append='$lt_shell_append'
14910
14911 # See if we are running on zsh, and set the options which allow our
1533914912 # commands through without removal of \ escapes INIT.
15340 if test -n "\${ZSH_VERSION+set}"; then
14913 if test -n "\${ZSH_VERSION+set}" ; then
1534114914 setopt NO_GLOB_SUBST
1534214915 fi
1534314916
1534414917
1534514918 PACKAGE='$PACKAGE'
1534614919 VERSION='$VERSION'
14920 TIMESTAMP='$TIMESTAMP'
1534714921 RM='$RM'
1534814922 ofile='$ofile'
1534914923
1592715501 case $ac_file$ac_mode in
1592815502 "libtool":C)
1592915503
15930 # See if we are running on zsh, and set the options that allow our
15504 # See if we are running on zsh, and set the options which allow our
1593115505 # commands through without removal of \ escapes.
15932 if test -n "${ZSH_VERSION+set}"; then
15506 if test -n "${ZSH_VERSION+set}" ; then
1593315507 setopt NO_GLOB_SUBST
1593415508 fi
1593515509
15936 cfgfile=${ofile}T
15510 cfgfile="${ofile}T"
1593715511 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
1593815512 $RM "$cfgfile"
1593915513
1594015514 cat <<_LT_EOF >> "$cfgfile"
1594115515 #! $SHELL
15942 # Generated automatically by $as_me ($PACKAGE) $VERSION
15516
15517 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
15518 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
1594315519 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1594415520 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
15945
15946 # Provide generalized library-building support services.
15947 # Written by Gordon Matzigkeit, 1996
15948
15949 # Copyright (C) 2014 Free Software Foundation, Inc.
15950 # This is free software; see the source for copying conditions. There is NO
15951 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15952
15953 # GNU Libtool is free software; you can redistribute it and/or modify
15954 # it under the terms of the GNU General Public License as published by
15955 # the Free Software Foundation; either version 2 of of the License, or
15956 # (at your option) any later version.
1595715521 #
15958 # As a special exception to the GNU General Public License, if you
15959 # distribute this file as part of a program or library that is built
15960 # using GNU Libtool, you may include this file under the same
15961 # distribution terms that you use for the rest of that program.
15522 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
15523 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
15524 # Foundation, Inc.
15525 # Written by Gordon Matzigkeit, 1996
1596215526 #
15963 # GNU Libtool is distributed in the hope that it will be useful, but
15964 # WITHOUT ANY WARRANTY; without even the implied warranty of
15527 # This file is part of GNU Libtool.
15528 #
15529 # GNU Libtool is free software; you can redistribute it and/or
15530 # modify it under the terms of the GNU General Public License as
15531 # published by the Free Software Foundation; either version 2 of
15532 # the License, or (at your option) any later version.
15533 #
15534 # As a special exception to the GNU General Public License,
15535 # if you distribute this file as part of a program or library that
15536 # is built using GNU Libtool, you may include this file under the
15537 # same distribution terms that you use for the rest of that program.
15538 #
15539 # GNU Libtool is distributed in the hope that it will be useful,
15540 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1596515541 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1596615542 # GNU General Public License for more details.
1596715543 #
1596815544 # You should have received a copy of the GNU General Public License
15969 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15545 # along with GNU Libtool; see the file COPYING. If not, a copy
15546 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
15547 # obtained by writing to the Free Software Foundation, Inc.,
15548 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1597015549
1597115550
1597215551 # The names of the tagged configurations supported by this script.
15973 available_tags=''
15974
15975 # Configured defaults for sys_lib_dlsearch_path munging.
15976 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
15552 available_tags=""
1597715553
1597815554 # ### BEGIN LIBTOOL CONFIG
1597915555
1599215568
1599315569 # Whether or not to optimize for fast installation.
1599415570 fast_install=$enable_fast_install
15995
15996 # Shared archive member basename,for filename based shared library versioning on AIX.
15997 shared_archive_member_spec=$shared_archive_member_spec
1599815571
1599915572 # Shell to use when invoking shell scripts.
1600015573 SHELL=$lt_SHELL
1611315686 # Transform the output of nm in a proper C declaration.
1611415687 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
1611515688
16116 # Transform the output of nm into a list of symbols to manually relocate.
16117 global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
16118
1611915689 # Transform the output of nm in a C name address pair.
1612015690 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
1612115691
1612215692 # Transform the output of nm in a C name address pair when lib prefix is needed.
1612315693 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
1612415694
16125 # The name lister interface.
16126 nm_interface=$lt_lt_cv_nm_interface
16127
1612815695 # Specify filename containing input files for \$NM.
1612915696 nm_file_list_spec=$lt_nm_file_list_spec
1613015697
16131 # The root where to search for dependent libraries,and where our libraries should be installed.
15698 # The root where to search for dependent libraries,and in which our libraries should be installed.
1613215699 lt_sysroot=$lt_sysroot
16133
16134 # Command to truncate a binary pipe.
16135 lt_truncate_bin=$lt_lt_cv_truncate_bin
1613615700
1613715701 # The name of the directory that contains temporary libtool files.
1613815702 objdir=$objdir
1622415788 # Compile-time system search path for libraries.
1622515789 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
1622615790
16227 # Detected run-time system search path for libraries.
16228 sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
16229
16230 # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
16231 configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
15791 # Run-time system search path for libraries.
15792 sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
1623215793
1623315794 # Whether dlopen is supported.
1623415795 dlopen_support=$enable_dlopen
1632115882 # Whether we need a single "-rpath" flag with a separated argument.
1632215883 hardcode_libdir_separator=$lt_hardcode_libdir_separator
1632315884
16324 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
15885 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
1632515886 # DIR into the resulting binary.
1632615887 hardcode_direct=$hardcode_direct
1632715888
16328 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
15889 # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
1632915890 # DIR into the resulting binary and the resulting library dependency is
16330 # "absolute",i.e impossible to change by setting \$shlibpath_var if the
15891 # "absolute",i.e impossible to change by setting \${shlibpath_var} if the
1633115892 # library is relocated.
1633215893 hardcode_direct_absolute=$hardcode_direct_absolute
1633315894
1637615937 hardcode_action=$hardcode_action
1637715938
1637815939 # ### END LIBTOOL CONFIG
16379
16380 _LT_EOF
16381
16382 cat <<'_LT_EOF' >> "$cfgfile"
16383
16384 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
16385
16386 # func_munge_path_list VARIABLE PATH
16387 # -----------------------------------
16388 # VARIABLE is name of variable containing _space_ separated list of
16389 # directories to be munged by the contents of PATH, which is string
16390 # having a format:
16391 # "DIR[:DIR]:"
16392 # string "DIR[ DIR]" will be prepended to VARIABLE
16393 # ":DIR[:DIR]"
16394 # string "DIR[ DIR]" will be appended to VARIABLE
16395 # "DIRP[:DIRP]::[DIRA:]DIRA"
16396 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
16397 # "DIRA[ DIRA]" will be appended to VARIABLE
16398 # "DIR[:DIR]"
16399 # VARIABLE will be replaced by "DIR[ DIR]"
16400 func_munge_path_list ()
16401 {
16402 case x$2 in
16403 x)
16404 ;;
16405 *:)
16406 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
16407 ;;
16408 x:*)
16409 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
16410 ;;
16411 *::*)
16412 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
16413 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
16414 ;;
16415 *)
16416 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
16417 ;;
16418 esac
16419 }
16420
16421
16422 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
16423 func_cc_basename ()
16424 {
16425 for cc_temp in $*""; do
16426 case $cc_temp in
16427 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
16428 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
16429 \-*) ;;
16430 *) break;;
16431 esac
16432 done
16433 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
16434 }
16435
16436
16437 # ### END FUNCTIONS SHARED WITH CONFIGURE
1643815940
1643915941 _LT_EOF
1644015942
1644415946 # AIX sometimes has problems with the GCC collect2 program. For some
1644515947 # reason, if we set the COLLECT_NAMES environment variable, the problems
1644615948 # vanish in a puff of smoke.
16447 if test set != "${COLLECT_NAMES+set}"; then
15949 if test "X${COLLECT_NAMES+set}" != Xset; then
1644815950 COLLECT_NAMES=
1644915951 export COLLECT_NAMES
1645015952 fi
1645315955 esac
1645415956
1645515957
16456 ltmain=$ac_aux_dir/ltmain.sh
15958 ltmain="$ac_aux_dir/ltmain.sh"
1645715959
1645815960
1645915961 # We use sed instead of cat because bash on DJGPP gets confused if
1646215964 # is reportedly fixed, but why not run on old versions too?
1646315965 sed '$q' "$ltmain" >> "$cfgfile" \
1646415966 || (rm -f "$cfgfile"; exit 1)
15967
15968 if test x"$xsi_shell" = xyes; then
15969 sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
15970 func_dirname ()\
15971 {\
15972 \ case ${1} in\
15973 \ */*) func_dirname_result="${1%/*}${2}" ;;\
15974 \ * ) func_dirname_result="${3}" ;;\
15975 \ esac\
15976 } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
15977 && mv -f "$cfgfile.tmp" "$cfgfile" \
15978 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15979 test 0 -eq $? || _lt_function_replace_fail=:
15980
15981
15982 sed -e '/^func_basename ()$/,/^} # func_basename /c\
15983 func_basename ()\
15984 {\
15985 \ func_basename_result="${1##*/}"\
15986 } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
15987 && mv -f "$cfgfile.tmp" "$cfgfile" \
15988 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
15989 test 0 -eq $? || _lt_function_replace_fail=:
15990
15991
15992 sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
15993 func_dirname_and_basename ()\
15994 {\
15995 \ case ${1} in\
15996 \ */*) func_dirname_result="${1%/*}${2}" ;;\
15997 \ * ) func_dirname_result="${3}" ;;\
15998 \ esac\
15999 \ func_basename_result="${1##*/}"\
16000 } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
16001 && mv -f "$cfgfile.tmp" "$cfgfile" \
16002 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16003 test 0 -eq $? || _lt_function_replace_fail=:
16004
16005
16006 sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
16007 func_stripname ()\
16008 {\
16009 \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
16010 \ # positional parameters, so assign one to ordinary parameter first.\
16011 \ func_stripname_result=${3}\
16012 \ func_stripname_result=${func_stripname_result#"${1}"}\
16013 \ func_stripname_result=${func_stripname_result%"${2}"}\
16014 } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
16015 && mv -f "$cfgfile.tmp" "$cfgfile" \
16016 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16017 test 0 -eq $? || _lt_function_replace_fail=:
16018
16019
16020 sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
16021 func_split_long_opt ()\
16022 {\
16023 \ func_split_long_opt_name=${1%%=*}\
16024 \ func_split_long_opt_arg=${1#*=}\
16025 } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
16026 && mv -f "$cfgfile.tmp" "$cfgfile" \
16027 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16028 test 0 -eq $? || _lt_function_replace_fail=:
16029
16030
16031 sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
16032 func_split_short_opt ()\
16033 {\
16034 \ func_split_short_opt_arg=${1#??}\
16035 \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
16036 } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
16037 && mv -f "$cfgfile.tmp" "$cfgfile" \
16038 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16039 test 0 -eq $? || _lt_function_replace_fail=:
16040
16041
16042 sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
16043 func_lo2o ()\
16044 {\
16045 \ case ${1} in\
16046 \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
16047 \ *) func_lo2o_result=${1} ;;\
16048 \ esac\
16049 } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
16050 && mv -f "$cfgfile.tmp" "$cfgfile" \
16051 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16052 test 0 -eq $? || _lt_function_replace_fail=:
16053
16054
16055 sed -e '/^func_xform ()$/,/^} # func_xform /c\
16056 func_xform ()\
16057 {\
16058 func_xform_result=${1%.*}.lo\
16059 } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
16060 && mv -f "$cfgfile.tmp" "$cfgfile" \
16061 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16062 test 0 -eq $? || _lt_function_replace_fail=:
16063
16064
16065 sed -e '/^func_arith ()$/,/^} # func_arith /c\
16066 func_arith ()\
16067 {\
16068 func_arith_result=$(( $* ))\
16069 } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
16070 && mv -f "$cfgfile.tmp" "$cfgfile" \
16071 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16072 test 0 -eq $? || _lt_function_replace_fail=:
16073
16074
16075 sed -e '/^func_len ()$/,/^} # func_len /c\
16076 func_len ()\
16077 {\
16078 func_len_result=${#1}\
16079 } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
16080 && mv -f "$cfgfile.tmp" "$cfgfile" \
16081 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16082 test 0 -eq $? || _lt_function_replace_fail=:
16083
16084 fi
16085
16086 if test x"$lt_shell_append" = xyes; then
16087 sed -e '/^func_append ()$/,/^} # func_append /c\
16088 func_append ()\
16089 {\
16090 eval "${1}+=\\${2}"\
16091 } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
16092 && mv -f "$cfgfile.tmp" "$cfgfile" \
16093 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16094 test 0 -eq $? || _lt_function_replace_fail=:
16095
16096
16097 sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
16098 func_append_quoted ()\
16099 {\
16100 \ func_quote_for_eval "${2}"\
16101 \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
16102 } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
16103 && mv -f "$cfgfile.tmp" "$cfgfile" \
16104 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16105 test 0 -eq $? || _lt_function_replace_fail=:
16106
16107
16108 # Save a `func_append' function call where possible by direct use of '+='
16109 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
16110 && mv -f "$cfgfile.tmp" "$cfgfile" \
16111 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16112 test 0 -eq $? || _lt_function_replace_fail=:
16113 else
16114 # Save a `func_append' function call even when '+=' is not available
16115 sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
16116 && mv -f "$cfgfile.tmp" "$cfgfile" \
16117 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
16118 test 0 -eq $? || _lt_function_replace_fail=:
16119 fi
16120
16121 if test x"$_lt_function_replace_fail" = x":"; then
16122 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
16123 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
16124 fi
16125
1646516126
1646616127 mv -f "$cfgfile" "$ofile" ||
1646716128 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
2929 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
3131 AC_PREREQ([2.56])
32
33 AC_INIT([getdns], [0.3.1], [stub-resolver@verisignlabs.com], [], [http://getdnsapi.net])
34 AC_SUBST(RELEASE_CANDIDATE, [])
32 AC_CONFIG_MACRO_DIRS([m4])
33 sinclude(./m4/acx_openssl.m4)
34 sinclude(./m4/ax_check_compile_flag.m4)
35 sinclude(./m4/pkg.m4)
36
37 AC_INIT([getdns], [0.3.2], [stub-resolver@verisignlabs.com], [], [https://getdnsapi.net])
38 AC_SUBST(RELEASE_CANDIDATE, [rc1])
3539
3640 # Set current date from system if not set
3741 AC_ARG_WITH([current-date],
4145 [CURRENT_DATE="`date -u +%Y-%m-%dT%H:%M:%SZ`"])
4246
4347 AC_SUBST(GETDNS_VERSION, ["AC_PACKAGE_VERSION$RELEASE_CANDIDATE"])
44 AC_SUBST(GETDNS_NUMERIC_VERSION, [0x00030000])
48 AC_SUBST(GETDNS_NUMERIC_VERSION, [0x00030101])
4549 AC_SUBST(API_VERSION, ["July 2015"])
4650 AC_SUBST(API_NUMERIC_VERSION, [0x07df0700])
4751 GETDNS_COMPILATION_COMMENT="AC_PACKAGE_NAME $GETDNS_VERSION configured on $CURRENT_DATE for the $API_VERSION version of the API"
6569 # getdns-0.1.8 had libversion 1:3:0 (but should have had 2:1:1)
6670 # getdns-0.2.0 had libversion 2:2:1
6771 # getdns-0.3.0 had libversion 3:3:2
68 # getdns-0.3.1 has libversion 3:4:2
72 # getdns-0.3.1 had libversion 3:4:2
73 # getdns-0.3.2 has libversion 3:5:2
6974 #
70 GETDNS_LIBVERSION=3:3:2
75 GETDNS_LIBVERSION=3:5:2
7176
7277 AC_SUBST(GETDNS_COMPILATION_COMMENT)
7378 AC_SUBST(GETDNS_LIBVERSION)
202207 AC_DEFINE_UNQUOTED([EDNS_COOKIE_OPCODE], [10], [The edns cookie option code.])
203208 AC_DEFINE_UNQUOTED([EDNS_COOKIE_ROLLOVER_TIME], [(24 * 60 * 60)], [How often the edns client cookie is refreshed.])
204209
210 my_with_libunbound=1
211 AC_ARG_ENABLE(stub-only, AC_HELP_STRING([--enable-stub-only], [Restricts resolution modes to STUB (which will be the default mode). Removes the libunbound dependency.]))
212 case "$enable_stub_only" in
213 yes)
214 my_with_libunbound=0
215 ;;
216 no|*)
217 ;;
218 esac
219
220 AC_ARG_WITH(getdns_query, AS_HELP_STRING([--with-getdns_query],
221 [Also compile and install the getdns_query tool]),
222 [], [withval="no"])
223 if test x_$withval = x_no; then
224 GETDNS_QUERY=""
225 INSTALL_GETDNS_QUERY=""
226 UNINSTALL_GETDNS_QUERY=""
227 else
228 GETDNS_QUERY="getdns_query"
229 INSTALL_GETDNS_QUERY="install-getdns_query"
230 UNINSTALL_GETDNS_QUERY="uninstall-getdns_query"
231 fi
232 AC_SUBST(GETDNS_QUERY)
233 AC_SUBST(INSTALL_GETDNS_QUERY)
234 AC_SUBST(UNINSTALL_GETDNS_QUERY)
235
236
205237 # search to set include and library paths right
206238 # find libidn
239 my_with_libidn=1
207240 AC_ARG_WITH(libidn, AS_HELP_STRING([--with-libidn=pathname],
208241 [path to libidn (default: search /usr/local ..)]),
209242 [], [withval="yes"])
231264 if test x_$withval != x_no; then
232265 CFLAGS="$CFLAGS -I$withval/include"
233266 LDFLAGS="$LDFLAGS -L$withval/lib"
267 else
268 my_with_libidn=0
234269 fi
235270 fi
236271
254289 fi
255290 fi
256291
257 # find libunbound
258 AC_ARG_WITH(libunbound, AS_HELP_STRING([--with-libunbound=pathname],
259 [path to libunbound (default: search /usr/local ..)]),
260 [], [withval="yes"])
261 if test x_$withval = x_yes; then
262 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
263 if test -f "$dir/include/unbound.h"; then
264 CFLAGS="$CFLAGS -I$dir/include"
265 LDFLAGS="$LDFLAGS -L$dir/lib"
266 AC_MSG_NOTICE([Found libunbound in $dir])
267 break
292 if test $my_with_libunbound = 1
293 then
294 # find libunbound
295 AC_ARG_WITH(libunbound, AS_HELP_STRING([--with-libunbound=pathname],
296 [path to libunbound (default: search /usr/local ..)]),
297 [], [withval="yes"])
298 if test x_$withval = x_yes; then
299 for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
300 if test -f "$dir/include/unbound.h"; then
301 CFLAGS="$CFLAGS -I$dir/include"
302 LDFLAGS="$LDFLAGS -L$dir/lib"
303 AC_MSG_NOTICE([Found libunbound in $dir])
304 break
305 fi
306 done
307 else
308 if test x_$withval != x_no; then
309 CFLAGS="$CFLAGS -I$withval/include"
310 LDFLAGS="$LDFLAGS -L$withval/lib"
311 else
312 AC_DEFINE_UNQUOTED([DISABLE_RESOLUTION_RECURSING], [1], [Define this to disable recursing resolution type.])
313 my_with_libunbound=0
268314 fi
269 done
270 else
271 if test x_$withval != x_no; then
272 CFLAGS="$CFLAGS -I$withval/include"
273 LDFLAGS="$LDFLAGS -L$withval/lib"
274315 fi
275316 fi
276317
278319 found_all_libs=1
279320 AC_MSG_NOTICE([Checking for dependency ldns])
280321 AC_CHECK_LIB([ldns], [ldns_dname_new_frm_str], [], [found_all_libs=0])
281 AC_MSG_NOTICE([Checking for dependency libidn])
282 AC_CHECK_LIB([idn], [idna_to_ascii_8z], [], [found_all_libs=0])
322
323 if test $my_with_libidn = 1
324 then
325 AC_MSG_NOTICE([Checking for dependency libidn])
326 AC_CHECK_LIB([idn], [idna_to_ascii_8z], [], [found_all_libs=0])
327 fi
283328
284329 AC_CHECK_MEMBER([struct ldns_struct_dnssec_zone.hashed_names],
285330 [AC_DEFINE_UNQUOTED([LDNS_DNSSEC_ZONE_HASHED_NAMES], [1], [When defined ldns_dnssec_zone contained the hashed_names member.])], [], [[#include <ldns/ldns.h>]])
286331
287 if test $found_all_libs == 0
332 if test $my_with_libunbound = 1
333 then
334 AC_MSG_NOTICE([Checking for dependency libunbound])
335 AC_CHECK_LIB([unbound], [ub_fd], [], [found_all_libs=0])
336 fi
337
338 if test $found_all_libs = 0
288339 then
289340 AC_MSG_ERROR([One more dependencies is missing])
290 fi
291
292 # break out libunbound from other libraries since we are currently using a
293 # patch to the sources
294 found_libunbound=1
295 AC_MSG_NOTICE([Checking for dependency libunbound])
296 AC_CHECK_LIB([unbound], [ub_fd], [], [found_libunbound=0])
297 if test $found_libunbound == 0
298 then
299 AC_MSG_ERROR([libunbound is missing.])
300341 fi
301342
302343 AC_PATH_PROG([DOXYGEN], [doxygen])
825866 #ifdef HAVE_BSD_STRING_H
826867 #include <bsd/string.h>
827868 #endif
869
870 #ifdef HAVE_LIBUNBOUND
871 #include <unbound.h>
872 #endif
828873 ])
829874
830875 dnl ---------------------------------------------------------------------------
3131 tarname = @PACKAGE_TARNAME@
3232 distdir = $(tarname)-$(version)
3333
34 api_version = @API_VERSION@
35
3436 prefix = @prefix@
3537 exec_prefix = @exec_prefix@
3638 bindir = @bindir@
5759
5860 .SUFFIXES: .3.in .3
5961 .3.in.3:
60 sed $(EDITS) -e "s/@date@/`date +'%B %Y'`/g" $< > $@
62 sed $(EDITS) -e "s/@date@/$(api_version)/g" $< > $@
6163
6264 # we assume that we want a separate file for each "name" specified for each man page
6365 # and consider these "alternate names" simple copies of the main man page
+2447
-4009
libtool less more
00 #! /bin/bash
1
2 # libtool - Provide generalized library-building support services.
13 # Generated automatically by config.status ()
24 # Libtool was configured on host bonobo:
35 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
4
5 # Provide generalized library-building support services.
6 # Written by Gordon Matzigkeit, 1996
7
8 # Copyright (C) 2014 Free Software Foundation, Inc.
9 # This is free software; see the source for copying conditions. There is NO
10 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
12 # GNU Libtool 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 of the License, or
15 # (at your option) any later version.
166 #
17 # As a special exception to the GNU General Public License, if you
18 # distribute this file as part of a program or library that is built
19 # using GNU Libtool, you may include this file under the same
20 # distribution terms that you use for the rest of that program.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
8 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
9 # Foundation, Inc.
10 # Written by Gordon Matzigkeit, 1996
2111 #
22 # GNU Libtool is distributed in the hope that it will be useful, but
23 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # This file is part of GNU Libtool.
13 #
14 # GNU Libtool is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation; either version 2 of
17 # the License, or (at your option) any later version.
18 #
19 # As a special exception to the GNU General Public License,
20 # if you distribute this file as part of a program or library that
21 # is built using GNU Libtool, you may include this file under the
22 # same distribution terms that you use for the rest of that program.
23 #
24 # GNU Libtool is distributed in the hope that it will be useful,
25 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2426 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2527 # GNU General Public License for more details.
2628 #
2729 # You should have received a copy of the GNU General Public License
28 # along with this program. If not, see <http://www.gnu.org/licenses/>.
30 # along with GNU Libtool; see the file COPYING. If not, a copy
31 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
32 # obtained by writing to the Free Software Foundation, Inc.,
33 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2934
3035
3136 # The names of the tagged configurations supported by this script.
32 available_tags=''
33
34 # Configured defaults for sys_lib_dlsearch_path munging.
35 : ${LT_SYS_LIBRARY_PATH=""}
37 available_tags=""
3638
3739 # ### BEGIN LIBTOOL CONFIG
3840
3941 # Which release of libtool.m4 was used?
40 macro_version=2.4.6
41 macro_revision=2.4.6
42 macro_version=2.4.2
43 macro_revision=1.3337
4244
4345 # Whether or not to build shared libraries.
4446 build_libtool_libs=yes
5153
5254 # Whether or not to optimize for fast installation.
5355 fast_install=yes
54
55 # Shared archive member basename,for filename based shared library versioning on AIX.
56 shared_archive_member_spec=
5756
5857 # Shell to use when invoking shell scripts.
5958 SHELL="/bin/bash"
170169 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
171170
172171 # Transform the output of nm in a proper C declaration.
173 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
174
175 # Transform the output of nm into a list of symbols to manually relocate.
176 global_symbol_to_import=""
172 global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
177173
178174 # Transform the output of nm in a C name address pair.
179 global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/ {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p'"
175 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
180176
181177 # Transform the output of nm in a C name address pair when lib prefix is needed.
182 global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/ {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(lib.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"lib\\1\", (void *) \\&\\1},/p'"
183
184 # The name lister interface.
185 nm_interface="BSD nm"
178 global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
186179
187180 # Specify filename containing input files for $NM.
188181 nm_file_list_spec="@"
189182
190 # The root where to search for dependent libraries,and where our libraries should be installed.
183 # The root where to search for dependent libraries,and in which our libraries should be installed.
191184 lt_sysroot=
192
193 # Command to truncate a binary pipe.
194 lt_truncate_bin="/bin/dd bs=4096 count=1"
195185
196186 # The name of the directory that contains temporary libtool files.
197187 objdir=.libs
256246
257247 # List of archive names. First name is the real one, the rest are links.
258248 # The last name is the one that the linker finds with -lNAME
259 library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
249 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
260250
261251 # The coded name of the library, if different from the real name.
262 soname_spec="\$libname\$release\$shared_ext\$major"
252 soname_spec="\${libname}\${release}\${shared_ext}\$major"
263253
264254 # Permission mode override for installation of shared libraries.
265255 install_override_mode=""
283273 # Compile-time system search path for libraries.
284274 sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.9 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "
285275
286 # Detected run-time system search path for libraries.
276 # Run-time system search path for libraries.
287277 sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/lib/i386-linux-gnu/mesa /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/mesa-egl /usr/lib/x86_64-linux-gnu/mesa /lib32 /usr/lib32 "
288
289 # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
290 configure_time_lt_sys_library_path=""
291278
292279 # Whether dlopen is supported.
293280 dlopen_support=unknown
341328 allow_libtool_libs_with_static_runtimes=no
342329
343330 # Compiler flag to allow reflexive dlopens.
344 export_dynamic_flag_spec="\$wl--export-dynamic"
331 export_dynamic_flag_spec="\${wl}--export-dynamic"
345332
346333 # Compiler flag to generate shared objects directly from archives.
347 whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
334 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
348335
349336 # Whether the compiler copes with passing no objects directly.
350337 compiler_needs_object="no"
356343 old_archive_from_expsyms_cmds=""
357344
358345 # Commands used to build a shared archive.
359 archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
346 archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
360347 archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
361 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
362 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
363 \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
348 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
349 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
350 \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
364351
365352 # Commands used to build a loadable module if different from building
366353 # a shared archive.
378365
379366 # Flag to hardcode $libdir into a binary during linking.
380367 # This must work even if $libdir does not exist
381 hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
368 hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
382369
383370 # Whether we need a single "-rpath" flag with a separated argument.
384371 hardcode_libdir_separator=""
385372
386 # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
373 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
387374 # DIR into the resulting binary.
388375 hardcode_direct=no
389376
390 # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
377 # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
391378 # DIR into the resulting binary and the resulting library dependency is
392 # "absolute",i.e impossible to change by setting $shlibpath_var if the
379 # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
393380 # library is relocated.
394381 hardcode_direct_absolute=no
395382
411398 inherit_rpath=no
412399
413400 # Whether libtool must link a program against all its dependency libraries.
414 link_all_deplibs=unknown
401 link_all_deplibs=no
415402
416403 # Set to "yes" if exported symbols are required.
417404 always_export_symbols=no
440427 # ### END LIBTOOL CONFIG
441428
442429
443 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
444
445 # func_munge_path_list VARIABLE PATH
446 # -----------------------------------
447 # VARIABLE is name of variable containing _space_ separated list of
448 # directories to be munged by the contents of PATH, which is string
449 # having a format:
450 # "DIR[:DIR]:"
451 # string "DIR[ DIR]" will be prepended to VARIABLE
452 # ":DIR[:DIR]"
453 # string "DIR[ DIR]" will be appended to VARIABLE
454 # "DIRP[:DIRP]::[DIRA:]DIRA"
455 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
456 # "DIRA[ DIRA]" will be appended to VARIABLE
457 # "DIR[:DIR]"
458 # VARIABLE will be replaced by "DIR[ DIR]"
459 func_munge_path_list ()
460 {
461 case x$2 in
462 x)
463 ;;
464 *:)
465 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
466 ;;
467 x:*)
468 eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
469 ;;
470 *::*)
471 eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
472 eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
473 ;;
474 *)
475 eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
476 ;;
477 esac
478 }
479
480
481 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
482 func_cc_basename ()
483 {
484 for cc_temp in $*""; do
485 case $cc_temp in
486 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
487 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
488 \-*) ;;
489 *) break;;
490 esac
491 done
492 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
493 }
494
495
496 # ### END FUNCTIONS SHARED WITH CONFIGURE
497
498 #! /bin/sh
499 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
500 ## by inline-source v2014-01-03.01
501
502 # libtool (GNU libtool) 2.4.6
503 # Provide generalized library-building support services.
430 # libtool (GNU libtool) 2.4.2
504431 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
505432
506 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
433 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
434 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
507435 # This is free software; see the source for copying conditions. There is NO
508436 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
509437
523451 # General Public License for more details.
524452 #
525453 # You should have received a copy of the GNU General Public License
526 # along with this program. If not, see <http://www.gnu.org/licenses/>.
527
454 # along with GNU Libtool; see the file COPYING. If not, a copy
455 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
456 # or obtained by writing to the Free Software Foundation, Inc.,
457 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
458
459 # Usage: $progname [OPTION]... [MODE-ARG]...
460 #
461 # Provide generalized library-building support services.
462 #
463 # --config show all configuration variables
464 # --debug enable verbose shell tracing
465 # -n, --dry-run display commands without modifying any files
466 # --features display basic configuration information and exit
467 # --mode=MODE use operation mode MODE
468 # --preserve-dup-deps don't remove duplicate dependency libraries
469 # --quiet, --silent don't print informational messages
470 # --no-quiet, --no-silent
471 # print informational messages (default)
472 # --no-warn don't display warning messages
473 # --tag=TAG use configuration variables from tag TAG
474 # -v, --verbose print more informational messages than default
475 # --no-verbose don't print the extra informational messages
476 # --version print version information
477 # -h, --help, --help-all print short, long, or detailed help message
478 #
479 # MODE must be one of the following:
480 #
481 # clean remove files from the build directory
482 # compile compile a source file into a libtool object
483 # execute automatically set library path, then run a program
484 # finish complete the installation of libtool libraries
485 # install install libraries or executables
486 # link create a library or an executable
487 # uninstall remove libraries from an installed directory
488 #
489 # MODE-ARGS vary depending on the MODE. When passed as first option,
490 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
491 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
492 #
493 # When reporting a bug, please describe a test case to reproduce it and
494 # include the following information:
495 #
496 # host-triplet: $host
497 # shell: $SHELL
498 # compiler: $LTCC
499 # compiler flags: $LTCFLAGS
500 # linker: $LD (gnu? $with_gnu_ld)
501 # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11
502 # automake: $automake_version
503 # autoconf: $autoconf_version
504 #
505 # Report bugs to <bug-libtool@gnu.org>.
506 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
507 # General help using GNU software: <http://www.gnu.org/gethelp/>.
528508
529509 PROGRAM=libtool
530510 PACKAGE=libtool
531 VERSION=2.4.6
532 package_revision=2.4.6
533
534
535 ## ------ ##
536 ## Usage. ##
537 ## ------ ##
538
539 # Run './libtool --help' for help with using this script from the
540 # command line.
541
542
543 ## ------------------------------- ##
544 ## User overridable command paths. ##
545 ## ------------------------------- ##
546
547 # After configure completes, it has a better idea of some of the
548 # shell tools we need than the defaults used by the functions shared
549 # with bootstrap, so set those here where they can still be over-
550 # ridden by the user, but otherwise take precedence.
551
552 : ${AUTOCONF="autoconf"}
553 : ${AUTOMAKE="automake"}
554
555
556 ## -------------------------- ##
557 ## Source external libraries. ##
558 ## -------------------------- ##
559
560 # Much of our low-level functionality needs to be sourced from external
561 # libraries, which are installed to $pkgauxdir.
562
563 # Set a version string for this script.
564 scriptversion=2015-01-20.17; # UTC
565
566 # General shell script boiler plate, and helper functions.
567 # Written by Gary V. Vaughan, 2004
568
569 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
570 # This is free software; see the source for copying conditions. There is NO
571 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
572
573 # This program is free software; you can redistribute it and/or modify
574 # it under the terms of the GNU General Public License as published by
575 # the Free Software Foundation; either version 3 of the License, or
576 # (at your option) any later version.
577
578 # As a special exception to the GNU General Public License, if you distribute
579 # this file as part of a program or library that is built using GNU Libtool,
580 # you may include this file under the same distribution terms that you use
581 # for the rest of that program.
582
583 # This program is distributed in the hope that it will be useful,
584 # but WITHOUT ANY WARRANTY; without even the implied warranty of
585 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
586 # General Public License for more details.
587
588 # You should have received a copy of the GNU General Public License
589 # along with this program. If not, see <http://www.gnu.org/licenses/>.
590
591 # Please report bugs or propose patches to gary@gnu.org.
592
593
594 ## ------ ##
595 ## Usage. ##
596 ## ------ ##
597
598 # Evaluate this file near the top of your script to gain access to
599 # the functions and variables defined here:
600 #
601 # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
602 #
603 # If you need to override any of the default environment variable
604 # settings, do that before evaluating this file.
605
606
607 ## -------------------- ##
608 ## Shell normalisation. ##
609 ## -------------------- ##
610
611 # Some shells need a little help to be as Bourne compatible as possible.
612 # Before doing anything else, make sure all that help has been provided!
613
614 DUALCASE=1; export DUALCASE # for MKS sh
615 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
511 VERSION="2.4.2 Debian-2.4.2-1.11"
512 TIMESTAMP=""
513 package_revision=1.3337
514
515 # Be Bourne compatible
516 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
616517 emulate sh
617518 NULLCMD=:
618 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
519 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
619520 # is contrary to our usage. Disable this feature.
620521 alias -g '${1+"$@"}'='"$@"'
621522 setopt NO_GLOB_SUBST
622523 else
623 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
524 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
624525 fi
625
626 # NLS nuisances: We save the old values in case they are required later.
627 _G_user_locale=
628 _G_safe_locale=
629 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
526 BIN_SH=xpg4; export BIN_SH # for Tru64
527 DUALCASE=1; export DUALCASE # for MKS sh
528
529 # A function that is used when there is no print builtin or printf.
530 func_fallback_echo ()
531 {
532 eval 'cat <<_LTECHO_EOF
533 $1
534 _LTECHO_EOF'
535 }
536
537 # NLS nuisances: We save the old values to restore during execute mode.
538 lt_user_locale=
539 lt_safe_locale=
540 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
630541 do
631 eval "if test set = \"\${$_G_var+set}\"; then
632 save_$_G_var=\$$_G_var
633 $_G_var=C
634 export $_G_var
635 _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
636 _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
542 eval "if test \"\${$lt_var+set}\" = set; then
543 save_$lt_var=\$$lt_var
544 $lt_var=C
545 export $lt_var
546 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
547 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
637548 fi"
638549 done
639
640 # CDPATH.
641 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
642
643 # Make sure IFS has a sensible default
644 sp=' '
645 nl='
646 '
647 IFS="$sp $nl"
648
649 # There are apparently some retarded systems that use ';' as a PATH separator!
650 if test "${PATH_SEPARATOR+set}" != set; then
651 PATH_SEPARATOR=:
652 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
653 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
654 PATH_SEPARATOR=';'
655 }
656 fi
657
658
659
660 ## ------------------------- ##
661 ## Locate command utilities. ##
662 ## ------------------------- ##
663
664
665 # func_executable_p FILE
666 # ----------------------
667 # Check that FILE is an executable regular file.
668 func_executable_p ()
669 {
670 test -f "$1" && test -x "$1"
671 }
672
673
674 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
675 # --------------------------------------------
676 # Search for either a program that responds to --version with output
677 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
678 # trying all the directories in PATH with each of the elements of
679 # PROGS_LIST.
680 #
681 # CHECK_FUNC should accept the path to a candidate program, and
682 # set $func_check_prog_result if it truncates its output less than
683 # $_G_path_prog_max characters.
684 func_path_progs ()
685 {
686 _G_progs_list=$1
687 _G_check_func=$2
688 _G_PATH=${3-"$PATH"}
689
690 _G_path_prog_max=0
691 _G_path_prog_found=false
692 _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
693 for _G_dir in $_G_PATH; do
694 IFS=$_G_save_IFS
695 test -z "$_G_dir" && _G_dir=.
696 for _G_prog_name in $_G_progs_list; do
697 for _exeext in '' .EXE; do
698 _G_path_prog=$_G_dir/$_G_prog_name$_exeext
699 func_executable_p "$_G_path_prog" || continue
700 case `"$_G_path_prog" --version 2>&1` in
701 *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
702 *) $_G_check_func $_G_path_prog
703 func_path_progs_result=$func_check_prog_result
704 ;;
705 esac
706 $_G_path_prog_found && break 3
707 done
708 done
709 done
710 IFS=$_G_save_IFS
711 test -z "$func_path_progs_result" && {
712 echo "no acceptable sed could be found in \$PATH" >&2
713 exit 1
714 }
715 }
716
717
718 # We want to be able to use the functions in this file before configure
719 # has figured out where the best binaries are kept, which means we have
720 # to search for them ourselves - except when the results are already set
721 # where we skip the searches.
722
723 # Unless the user overrides by setting SED, search the path for either GNU
724 # sed, or the sed that truncates its output the least.
725 test -z "$SED" && {
726 _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
727 for _G_i in 1 2 3 4 5 6 7; do
728 _G_sed_script=$_G_sed_script$nl$_G_sed_script
729 done
730 echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
731 _G_sed_script=
732
733 func_check_prog_sed ()
734 {
735 _G_path_prog=$1
736
737 _G_count=0
738 printf 0123456789 >conftest.in
739 while :
740 do
741 cat conftest.in conftest.in >conftest.tmp
742 mv conftest.tmp conftest.in
743 cp conftest.in conftest.nl
744 echo '' >> conftest.nl
745 "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
746 diff conftest.out conftest.nl >/dev/null 2>&1 || break
747 _G_count=`expr $_G_count + 1`
748 if test "$_G_count" -gt "$_G_path_prog_max"; then
749 # Best one so far, save it but keep looking for a better one
750 func_check_prog_result=$_G_path_prog
751 _G_path_prog_max=$_G_count
752 fi
753 # 10*(2^10) chars as input seems more than enough
754 test 10 -lt "$_G_count" && break
755 done
756 rm -f conftest.in conftest.tmp conftest.nl conftest.out
757 }
758
759 func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
760 rm -f conftest.sed
761 SED=$func_path_progs_result
762 }
763
764
765 # Unless the user overrides by setting GREP, search the path for either GNU
766 # grep, or the grep that truncates its output the least.
767 test -z "$GREP" && {
768 func_check_prog_grep ()
769 {
770 _G_path_prog=$1
771
772 _G_count=0
773 _G_path_prog_max=0
774 printf 0123456789 >conftest.in
775 while :
776 do
777 cat conftest.in conftest.in >conftest.tmp
778 mv conftest.tmp conftest.in
779 cp conftest.in conftest.nl
780 echo 'GREP' >> conftest.nl
781 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
782 diff conftest.out conftest.nl >/dev/null 2>&1 || break
783 _G_count=`expr $_G_count + 1`
784 if test "$_G_count" -gt "$_G_path_prog_max"; then
785 # Best one so far, save it but keep looking for a better one
786 func_check_prog_result=$_G_path_prog
787 _G_path_prog_max=$_G_count
788 fi
789 # 10*(2^10) chars as input seems more than enough
790 test 10 -lt "$_G_count" && break
791 done
792 rm -f conftest.in conftest.tmp conftest.nl conftest.out
793 }
794
795 func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
796 GREP=$func_path_progs_result
797 }
798
799
800 ## ------------------------------- ##
801 ## User overridable command paths. ##
802 ## ------------------------------- ##
803
804 # All uppercase variable names are used for environment variables. These
805 # variables can be overridden by the user before calling a script that
806 # uses them if a suitable command of that name is not already available
807 # in the command search PATH.
550 LC_ALL=C
551 LANGUAGE=C
552 export LANGUAGE LC_ALL
553
554 $lt_unset CDPATH
555
556
557 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
558 # is ksh but when the shell is invoked as "sh" and the current value of
559 # the _XPG environment variable is not equal to 1 (one), the special
560 # positional parameter $0, within a function call, is the name of the
561 # function.
562 progpath="$0"
563
564
808565
809566 : ${CP="cp -f"}
810 : ${ECHO="printf %s\n"}
811 : ${EGREP="$GREP -E"}
812 : ${FGREP="$GREP -F"}
813 : ${LN_S="ln -s"}
567 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
814568 : ${MAKE="make"}
815569 : ${MKDIR="mkdir"}
816570 : ${MV="mv -f"}
817571 : ${RM="rm -f"}
818572 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
819
820
821 ## -------------------- ##
822 ## Useful sed snippets. ##
823 ## -------------------- ##
824
825 sed_dirname='s|/[^/]*$||'
826 sed_basename='s|^.*/||'
827
828 # Sed substitution that helps us do robust quoting. It backslashifies
829 # metacharacters that are still active within double-quoted strings.
830 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
831
832 # Same as above, but do not quote variable references.
833 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
834
835 # Sed substitution that turns a string into a regex matching for the
836 # string literally.
837 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
838
839 # Sed substitution that converts a w32 file name or path
840 # that contains forward slashes, into one that contains
841 # (escaped) backslashes. A very naive implementation.
842 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
843
844 # Re-'\' parameter expansions in output of sed_double_quote_subst that
845 # were '\'-ed in input to the same. If an odd number of '\' preceded a
846 # '$' in input to sed_double_quote_subst, that '$' was protected from
847 # expansion. Since each input '\' is now two '\'s, look for any number
848 # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
849 _G_bs='\\'
850 _G_bs2='\\\\'
851 _G_bs4='\\\\\\\\'
852 _G_dollar='\$'
853 sed_double_backslash="\
854 s/$_G_bs4/&\\
855 /g
856 s/^$_G_bs2$_G_dollar/$_G_bs&/
857 s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
858 s/\n//g"
859
860
861 ## ----------------- ##
862 ## Global variables. ##
863 ## ----------------- ##
864
865 # Except for the global variables explicitly listed below, the following
866 # functions in the '^func_' namespace, and the '^require_' namespace
867 # variables initialised in the 'Resource management' section, sourcing
868 # this file will not pollute your global namespace with anything
869 # else. There's no portable way to scope variables in Bourne shell
870 # though, so actually running these functions will sometimes place
871 # results into a variable named after the function, and often use
872 # temporary variables in the '^_G_' namespace. If you are careful to
873 # avoid using those namespaces casually in your sourcing script, things
874 # should continue to work as you expect. And, of course, you can freely
875 # overwrite any of the functions or variables defined here before
876 # calling anything to customize them.
877
573 : ${Xsed="$SED -e 1s/^X//"}
574
575 # Global variables:
878576 EXIT_SUCCESS=0
879577 EXIT_FAILURE=1
880578 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
881579 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
882580
883 # Allow overriding, eg assuming that you follow the convention of
884 # putting '$debug_cmd' at the start of all your functions, you can get
885 # bash to show function call trace with:
886 #
887 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
888 debug_cmd=${debug_cmd-":"}
889 exit_cmd=:
890
891 # By convention, finish your script with:
892 #
893 # exit $exit_status
894 #
895 # so that you can set exit_status to non-zero if you want to indicate
896 # something went wrong during execution without actually bailing out at
897 # the point of failure.
898581 exit_status=$EXIT_SUCCESS
899582
900 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
901 # is ksh but when the shell is invoked as "sh" and the current value of
902 # the _XPG environment variable is not equal to 1 (one), the special
903 # positional parameter $0, within a function call, is the name of the
904 # function.
905 progpath=$0
906
907 # The name of this program.
908 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
909
910 # Make sure we have an absolute progpath for reexecution:
911 case $progpath in
912 [\\/]*|[A-Za-z]:\\*) ;;
913 *[\\/]*)
914 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
915 progdir=`cd "$progdir" && pwd`
916 progpath=$progdir/$progname
917 ;;
918 *)
919 _G_IFS=$IFS
920 IFS=${PATH_SEPARATOR-:}
921 for progdir in $PATH; do
922 IFS=$_G_IFS
923 test -x "$progdir/$progname" && break
924 done
925 IFS=$_G_IFS
926 test -n "$progdir" || progdir=`pwd`
927 progpath=$progdir/$progname
928 ;;
929 esac
930
931
932 ## ----------------- ##
933 ## Standard options. ##
934 ## ----------------- ##
935
936 # The following options affect the operation of the functions defined
937 # below, and should be set appropriately depending on run-time para-
938 # meters passed on the command line.
939
940 opt_dry_run=false
941 opt_quiet=false
942 opt_verbose=false
943
944 # Categories 'all' and 'none' are always available. Append any others
945 # you will pass as the first argument to func_warning from your own
946 # code.
947 warning_categories=
948
949 # By default, display warnings according to 'opt_warning_types'. Set
950 # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
951 # treat the next displayed warning as a fatal error.
952 warning_func=func_warn_and_continue
953
954 # Set to 'all' to display all warnings, 'none' to suppress all
955 # warnings, or a space delimited list of some subset of
956 # 'warning_categories' to display only the listed warnings.
957 opt_warning_types=all
958
959
960 ## -------------------- ##
961 ## Resource management. ##
962 ## -------------------- ##
963
964 # This section contains definitions for functions that each ensure a
965 # particular resource (a file, or a non-empty configuration variable for
966 # example) is available, and if appropriate to extract default values
967 # from pertinent package files. Call them using their associated
968 # 'require_*' variable to ensure that they are executed, at most, once.
969 #
970 # It's entirely deliberate that calling these functions can set
971 # variables that don't obey the namespace limitations obeyed by the rest
972 # of this file, in order that that they be as useful as possible to
973 # callers.
974
975
976 # require_term_colors
977 # -------------------
978 # Allow display of bold text on terminals that support it.
979 require_term_colors=func_require_term_colors
980 func_require_term_colors ()
981 {
982 $debug_cmd
983
984 test -t 1 && {
985 # COLORTERM and USE_ANSI_COLORS environment variables take
986 # precedence, because most terminfo databases neglect to describe
987 # whether color sequences are supported.
988 test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
989
990 if test 1 = "$USE_ANSI_COLORS"; then
991 # Standard ANSI escape sequences
992 tc_reset=''
993 tc_bold=''; tc_standout=''
994 tc_red=''; tc_green=''
995 tc_blue=''; tc_cyan=''
996 else
997 # Otherwise trust the terminfo database after all.
998 test -n "`tput sgr0 2>/dev/null`" && {
999 tc_reset=`tput sgr0`
1000 test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
1001 tc_standout=$tc_bold
1002 test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
1003 test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
1004 test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
1005 test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
1006 test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
1007 }
1008 fi
1009 }
1010
1011 require_term_colors=:
1012 }
1013
1014
1015 ## ----------------- ##
1016 ## Function library. ##
1017 ## ----------------- ##
1018
1019 # This section contains a variety of useful functions to call in your
1020 # scripts. Take note of the portable wrappers for features provided by
1021 # some modern shells, which will fall back to slower equivalents on
1022 # less featureful shells.
1023
1024
1025 # func_append VAR VALUE
1026 # ---------------------
1027 # Append VALUE onto the existing contents of VAR.
1028
1029 # We should try to minimise forks, especially on Windows where they are
1030 # unreasonably slow, so skip the feature probes when bash or zsh are
1031 # being used:
1032 if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
1033 : ${_G_HAVE_ARITH_OP="yes"}
1034 : ${_G_HAVE_XSI_OPS="yes"}
1035 # The += operator was introduced in bash 3.1
1036 case $BASH_VERSION in
1037 [12].* | 3.0 | 3.0*) ;;
1038 *)
1039 : ${_G_HAVE_PLUSEQ_OP="yes"}
1040 ;;
1041 esac
1042 fi
1043
1044 # _G_HAVE_PLUSEQ_OP
1045 # Can be empty, in which case the shell is probed, "yes" if += is
1046 # useable or anything else if it does not work.
1047 test -z "$_G_HAVE_PLUSEQ_OP" \
1048 && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
1049 && _G_HAVE_PLUSEQ_OP=yes
1050
1051 if test yes = "$_G_HAVE_PLUSEQ_OP"
1052 then
1053 # This is an XSI compatible shell, allowing a faster implementation...
1054 eval 'func_append ()
1055 {
1056 $debug_cmd
1057
1058 eval "$1+=\$2"
1059 }'
1060 else
1061 # ...otherwise fall back to using expr, which is often a shell builtin.
1062 func_append ()
1063 {
1064 $debug_cmd
1065
1066 eval "$1=\$$1\$2"
1067 }
1068 fi
1069
1070
1071 # func_append_quoted VAR VALUE
1072 # ----------------------------
1073 # Quote VALUE and append to the end of shell variable VAR, separated
1074 # by a space.
1075 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
1076 eval 'func_append_quoted ()
1077 {
1078 $debug_cmd
1079
1080 func_quote_for_eval "$2"
1081 eval "$1+=\\ \$func_quote_for_eval_result"
1082 }'
1083 else
1084 func_append_quoted ()
1085 {
1086 $debug_cmd
1087
1088 func_quote_for_eval "$2"
1089 eval "$1=\$$1\\ \$func_quote_for_eval_result"
1090 }
1091 fi
1092
1093
1094 # func_append_uniq VAR VALUE
1095 # --------------------------
1096 # Append unique VALUE onto the existing contents of VAR, assuming
1097 # entries are delimited by the first character of VALUE. For example:
1098 #
1099 # func_append_uniq options " --another-option option-argument"
1100 #
1101 # will only append to $options if " --another-option option-argument "
1102 # is not already present somewhere in $options already (note spaces at
1103 # each end implied by leading space in second argument).
1104 func_append_uniq ()
1105 {
1106 $debug_cmd
1107
1108 eval _G_current_value='`$ECHO $'$1'`'
1109 _G_delim=`expr "$2" : '\(.\)'`
1110
1111 case $_G_delim$_G_current_value$_G_delim in
1112 *"$2$_G_delim"*) ;;
1113 *) func_append "$@" ;;
1114 esac
1115 }
1116
1117
1118 # func_arith TERM...
1119 # ------------------
1120 # Set func_arith_result to the result of evaluating TERMs.
1121 test -z "$_G_HAVE_ARITH_OP" \
1122 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
1123 && _G_HAVE_ARITH_OP=yes
1124
1125 if test yes = "$_G_HAVE_ARITH_OP"; then
1126 eval 'func_arith ()
1127 {
1128 $debug_cmd
1129
1130 func_arith_result=$(( $* ))
1131 }'
1132 else
1133 func_arith ()
1134 {
1135 $debug_cmd
1136
1137 func_arith_result=`expr "$@"`
1138 }
1139 fi
1140
1141
1142 # func_basename FILE
1143 # ------------------
1144 # Set func_basename_result to FILE with everything up to and including
1145 # the last / stripped.
1146 if test yes = "$_G_HAVE_XSI_OPS"; then
1147 # If this shell supports suffix pattern removal, then use it to avoid
1148 # forking. Hide the definitions single quotes in case the shell chokes
1149 # on unsupported syntax...
1150 _b='func_basename_result=${1##*/}'
1151 _d='case $1 in
1152 */*) func_dirname_result=${1%/*}$2 ;;
1153 * ) func_dirname_result=$3 ;;
1154 esac'
1155
1156 else
1157 # ...otherwise fall back to using sed.
1158 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
1159 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
1160 if test "X$func_dirname_result" = "X$1"; then
1161 func_dirname_result=$3
1162 else
1163 func_append func_dirname_result "$2"
1164 fi'
1165 fi
1166
1167 eval 'func_basename ()
1168 {
1169 $debug_cmd
1170
1171 '"$_b"'
1172 }'
1173
1174
1175 # func_dirname FILE APPEND NONDIR_REPLACEMENT
1176 # -------------------------------------------
583 # Make sure IFS has a sensible default
584 lt_nl='
585 '
586 IFS=" $lt_nl"
587
588 dirname="s,/[^/]*$,,"
589 basename="s,^.*/,,"
590
591 # func_dirname file append nondir_replacement
1177592 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
1178593 # otherwise set result to NONDIR_REPLACEMENT.
1179 eval 'func_dirname ()
1180 {
1181 $debug_cmd
1182
1183 '"$_d"'
1184 }'
1185
1186
1187 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
1188 # --------------------------------------------------------
1189 # Perform func_basename and func_dirname in a single function
594 func_dirname ()
595 {
596 case ${1} in
597 */*) func_dirname_result="${1%/*}${2}" ;;
598 * ) func_dirname_result="${3}" ;;
599 esac
600 } # Extended-shell func_dirname implementation
601
602
603 # func_basename file
604 func_basename ()
605 {
606 func_basename_result="${1##*/}"
607 } # Extended-shell func_basename implementation
608
609
610 # func_dirname_and_basename file append nondir_replacement
611 # perform func_basename and func_dirname in a single function
1190612 # call:
1191613 # dirname: Compute the dirname of FILE. If nonempty,
1192614 # add APPEND to the result, otherwise set result
1194616 # value returned in "$func_dirname_result"
1195617 # basename: Compute filename of FILE.
1196618 # value retuned in "$func_basename_result"
1197 # For efficiency, we do not delegate to the functions above but instead
1198 # duplicate the functionality here.
1199 eval 'func_dirname_and_basename ()
1200 {
1201 $debug_cmd
1202
1203 '"$_b"'
1204 '"$_d"'
1205 }'
1206
1207
1208 # func_echo ARG...
1209 # ----------------
1210 # Echo program name prefixed message.
1211 func_echo ()
1212 {
1213 $debug_cmd
1214
1215 _G_message=$*
1216
1217 func_echo_IFS=$IFS
1218 IFS=$nl
1219 for _G_line in $_G_message; do
1220 IFS=$func_echo_IFS
1221 $ECHO "$progname: $_G_line"
1222 done
1223 IFS=$func_echo_IFS
1224 }
1225
1226
1227 # func_echo_all ARG...
1228 # --------------------
1229 # Invoke $ECHO with all args, space-separated.
1230 func_echo_all ()
1231 {
1232 $ECHO "$*"
1233 }
1234
1235
1236 # func_echo_infix_1 INFIX ARG...
1237 # ------------------------------
1238 # Echo program name, followed by INFIX on the first line, with any
1239 # additional lines not showing INFIX.
1240 func_echo_infix_1 ()
1241 {
1242 $debug_cmd
1243
1244 $require_term_colors
1245
1246 _G_infix=$1; shift
1247 _G_indent=$_G_infix
1248 _G_prefix="$progname: $_G_infix: "
1249 _G_message=$*
1250
1251 # Strip color escape sequences before counting printable length
1252 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
1253 do
1254 test -n "$_G_tc" && {
1255 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
1256 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
1257 }
1258 done
1259 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
1260
1261 func_echo_infix_1_IFS=$IFS
1262 IFS=$nl
1263 for _G_line in $_G_message; do
1264 IFS=$func_echo_infix_1_IFS
1265 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
1266 _G_prefix=$_G_indent
1267 done
1268 IFS=$func_echo_infix_1_IFS
1269 }
1270
1271
1272 # func_error ARG...
1273 # -----------------
1274 # Echo program name prefixed message to standard error.
1275 func_error ()
1276 {
1277 $debug_cmd
1278
1279 $require_term_colors
1280
1281 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
1282 }
1283
1284
1285 # func_fatal_error ARG...
1286 # -----------------------
1287 # Echo program name prefixed message to standard error, and exit.
1288 func_fatal_error ()
1289 {
1290 $debug_cmd
1291
1292 func_error "$*"
1293 exit $EXIT_FAILURE
1294 }
1295
1296
1297 # func_grep EXPRESSION FILENAME
1298 # -----------------------------
1299 # Check whether EXPRESSION matches any line of FILENAME, without output.
1300 func_grep ()
1301 {
1302 $debug_cmd
1303
1304 $GREP "$1" "$2" >/dev/null 2>&1
1305 }
1306
1307
1308 # func_len STRING
1309 # ---------------
1310 # Set func_len_result to the length of STRING. STRING may not
1311 # start with a hyphen.
1312 test -z "$_G_HAVE_XSI_OPS" \
1313 && (eval 'x=a/b/c;
1314 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1315 && _G_HAVE_XSI_OPS=yes
1316
1317 if test yes = "$_G_HAVE_XSI_OPS"; then
1318 eval 'func_len ()
1319 {
1320 $debug_cmd
1321
1322 func_len_result=${#1}
1323 }'
1324 else
1325 func_len ()
1326 {
1327 $debug_cmd
1328
1329 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
1330 }
1331 fi
1332
1333
1334 # func_mkdir_p DIRECTORY-PATH
1335 # ---------------------------
1336 # Make sure the entire path to DIRECTORY-PATH is available.
1337 func_mkdir_p ()
1338 {
1339 $debug_cmd
1340
1341 _G_directory_path=$1
1342 _G_dir_list=
1343
1344 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
1345
1346 # Protect directory names starting with '-'
1347 case $_G_directory_path in
1348 -*) _G_directory_path=./$_G_directory_path ;;
1349 esac
1350
1351 # While some portion of DIR does not yet exist...
1352 while test ! -d "$_G_directory_path"; do
1353 # ...make a list in topmost first order. Use a colon delimited
1354 # list incase some portion of path contains whitespace.
1355 _G_dir_list=$_G_directory_path:$_G_dir_list
1356
1357 # If the last portion added has no slash in it, the list is done
1358 case $_G_directory_path in */*) ;; *) break ;; esac
1359
1360 # ...otherwise throw away the child directory and loop
1361 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
1362 done
1363 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
1364
1365 func_mkdir_p_IFS=$IFS; IFS=:
1366 for _G_dir in $_G_dir_list; do
1367 IFS=$func_mkdir_p_IFS
1368 # mkdir can fail with a 'File exist' error if two processes
1369 # try to create one of the directories concurrently. Don't
1370 # stop in that case!
1371 $MKDIR "$_G_dir" 2>/dev/null || :
1372 done
1373 IFS=$func_mkdir_p_IFS
1374
1375 # Bail out if we (or some other process) failed to create a directory.
1376 test -d "$_G_directory_path" || \
1377 func_fatal_error "Failed to create '$1'"
1378 fi
1379 }
1380
1381
1382 # func_mktempdir [BASENAME]
1383 # -------------------------
1384 # Make a temporary directory that won't clash with other running
1385 # libtool processes, and avoids race conditions if possible. If
1386 # given, BASENAME is the basename for that directory.
1387 func_mktempdir ()
1388 {
1389 $debug_cmd
1390
1391 _G_template=${TMPDIR-/tmp}/${1-$progname}
1392
1393 if test : = "$opt_dry_run"; then
1394 # Return a directory name, but don't create it in dry-run mode
1395 _G_tmpdir=$_G_template-$$
1396 else
1397
1398 # If mktemp works, use that first and foremost
1399 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
1400
1401 if test ! -d "$_G_tmpdir"; then
1402 # Failing that, at least try and use $RANDOM to avoid a race
1403 _G_tmpdir=$_G_template-${RANDOM-0}$$
1404
1405 func_mktempdir_umask=`umask`
1406 umask 0077
1407 $MKDIR "$_G_tmpdir"
1408 umask $func_mktempdir_umask
1409 fi
1410
1411 # If we're not in dry-run mode, bomb out on failure
1412 test -d "$_G_tmpdir" || \
1413 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
1414 fi
1415
1416 $ECHO "$_G_tmpdir"
1417 }
1418
619 # Implementation must be kept synchronized with func_dirname
620 # and func_basename. For efficiency, we do not delegate to
621 # those functions but instead duplicate the functionality here.
622 func_dirname_and_basename ()
623 {
624 case ${1} in
625 */*) func_dirname_result="${1%/*}${2}" ;;
626 * ) func_dirname_result="${3}" ;;
627 esac
628 func_basename_result="${1##*/}"
629 } # Extended-shell func_dirname_and_basename implementation
630
631
632 # func_stripname prefix suffix name
633 # strip PREFIX and SUFFIX off of NAME.
634 # PREFIX and SUFFIX must not contain globbing or regex special
635 # characters, hashes, percent signs, but SUFFIX may contain a leading
636 # dot (in which case that matches only a dot).
637 # func_strip_suffix prefix name
638 func_stripname ()
639 {
640 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
641 # positional parameters, so assign one to ordinary parameter first.
642 func_stripname_result=${3}
643 func_stripname_result=${func_stripname_result#"${1}"}
644 func_stripname_result=${func_stripname_result%"${2}"}
645 } # Extended-shell func_stripname implementation
646
647
648 # These SED scripts presuppose an absolute path with a trailing slash.
649 pathcar='s,^/\([^/]*\).*$,\1,'
650 pathcdr='s,^/[^/]*,,'
651 removedotparts=':dotsl
652 s@/\./@/@g
653 t dotsl
654 s,/\.$,/,'
655 collapseslashes='s@/\{1,\}@/@g'
656 finalslash='s,/*$,/,'
1419657
1420658 # func_normal_abspath PATH
1421 # ------------------------
1422659 # Remove doubled-up and trailing slashes, "." path components,
1423660 # and cancel out any ".." path components in PATH after making
1424661 # it an absolute path.
662 # value returned in "$func_normal_abspath_result"
1425663 func_normal_abspath ()
1426664 {
1427 $debug_cmd
1428
1429 # These SED scripts presuppose an absolute path with a trailing slash.
1430 _G_pathcar='s|^/\([^/]*\).*$|\1|'
1431 _G_pathcdr='s|^/[^/]*||'
1432 _G_removedotparts=':dotsl
1433 s|/\./|/|g
1434 t dotsl
1435 s|/\.$|/|'
1436 _G_collapseslashes='s|/\{1,\}|/|g'
1437 _G_finalslash='s|/*$|/|'
1438
1439 # Start from root dir and reassemble the path.
1440 func_normal_abspath_result=
1441 func_normal_abspath_tpath=$1
1442 func_normal_abspath_altnamespace=
1443 case $func_normal_abspath_tpath in
665 # Start from root dir and reassemble the path.
666 func_normal_abspath_result=
667 func_normal_abspath_tpath=$1
668 func_normal_abspath_altnamespace=
669 case $func_normal_abspath_tpath in
670 "")
671 # Empty path, that just means $cwd.
672 func_stripname '' '/' "`pwd`"
673 func_normal_abspath_result=$func_stripname_result
674 return
675 ;;
676 # The next three entries are used to spot a run of precisely
677 # two leading slashes without using negated character classes;
678 # we take advantage of case's first-match behaviour.
679 ///*)
680 # Unusual form of absolute path, do nothing.
681 ;;
682 //*)
683 # Not necessarily an ordinary path; POSIX reserves leading '//'
684 # and for example Cygwin uses it to access remote file shares
685 # over CIFS/SMB, so we conserve a leading double slash if found.
686 func_normal_abspath_altnamespace=/
687 ;;
688 /*)
689 # Absolute path, do nothing.
690 ;;
691 *)
692 # Relative path, prepend $cwd.
693 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
694 ;;
695 esac
696 # Cancel out all the simple stuff to save iterations. We also want
697 # the path to end with a slash for ease of parsing, so make sure
698 # there is one (and only one) here.
699 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
700 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
701 while :; do
702 # Processed it all yet?
703 if test "$func_normal_abspath_tpath" = / ; then
704 # If we ascended to the root using ".." the result may be empty now.
705 if test -z "$func_normal_abspath_result" ; then
706 func_normal_abspath_result=/
707 fi
708 break
709 fi
710 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
711 -e "$pathcar"`
712 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
713 -e "$pathcdr"`
714 # Figure out what to do with it
715 case $func_normal_abspath_tcomponent in
1444716 "")
1445 # Empty path, that just means $cwd.
1446 func_stripname '' '/' "`pwd`"
1447 func_normal_abspath_result=$func_stripname_result
1448 return
717 # Trailing empty path component, ignore it.
718 ;;
719 ..)
720 # Parent dir; strip last assembled component from result.
721 func_dirname "$func_normal_abspath_result"
722 func_normal_abspath_result=$func_dirname_result
723 ;;
724 *)
725 # Actual path component, append it.
726 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
727 ;;
728 esac
729 done
730 # Restore leading double-slash if one was found on entry.
731 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
732 }
733
734 # func_relative_path SRCDIR DSTDIR
735 # generates a relative path from SRCDIR to DSTDIR, with a trailing
736 # slash if non-empty, suitable for immediately appending a filename
737 # without needing to append a separator.
738 # value returned in "$func_relative_path_result"
739 func_relative_path ()
740 {
741 func_relative_path_result=
742 func_normal_abspath "$1"
743 func_relative_path_tlibdir=$func_normal_abspath_result
744 func_normal_abspath "$2"
745 func_relative_path_tbindir=$func_normal_abspath_result
746
747 # Ascend the tree starting from libdir
748 while :; do
749 # check if we have found a prefix of bindir
750 case $func_relative_path_tbindir in
751 $func_relative_path_tlibdir)
752 # found an exact match
753 func_relative_path_tcancelled=
754 break
1449755 ;;
1450 # The next three entries are used to spot a run of precisely
1451 # two leading slashes without using negated character classes;
1452 # we take advantage of case's first-match behaviour.
1453 ///*)
1454 # Unusual form of absolute path, do nothing.
1455 ;;
1456 //*)
1457 # Not necessarily an ordinary path; POSIX reserves leading '//'
1458 # and for example Cygwin uses it to access remote file shares
1459 # over CIFS/SMB, so we conserve a leading double slash if found.
1460 func_normal_abspath_altnamespace=/
1461 ;;
1462 /*)
1463 # Absolute path, do nothing.
756 $func_relative_path_tlibdir*)
757 # found a matching prefix
758 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
759 func_relative_path_tcancelled=$func_stripname_result
760 if test -z "$func_relative_path_result"; then
761 func_relative_path_result=.
762 fi
763 break
1464764 ;;
1465765 *)
1466 # Relative path, prepend $cwd.
1467 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
766 func_dirname $func_relative_path_tlibdir
767 func_relative_path_tlibdir=${func_dirname_result}
768 if test "x$func_relative_path_tlibdir" = x ; then
769 # Have to descend all the way to the root!
770 func_relative_path_result=../$func_relative_path_result
771 func_relative_path_tcancelled=$func_relative_path_tbindir
772 break
773 fi
774 func_relative_path_result=../$func_relative_path_result
1468775 ;;
1469776 esac
1470
1471 # Cancel out all the simple stuff to save iterations. We also want
1472 # the path to end with a slash for ease of parsing, so make sure
1473 # there is one (and only one) here.
1474 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1475 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
1476 while :; do
1477 # Processed it all yet?
1478 if test / = "$func_normal_abspath_tpath"; then
1479 # If we ascended to the root using ".." the result may be empty now.
1480 if test -z "$func_normal_abspath_result"; then
1481 func_normal_abspath_result=/
1482 fi
1483 break
1484 fi
1485 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
1486 -e "$_G_pathcar"`
1487 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
1488 -e "$_G_pathcdr"`
1489 # Figure out what to do with it
1490 case $func_normal_abspath_tcomponent in
1491 "")
1492 # Trailing empty path component, ignore it.
1493 ;;
1494 ..)
1495 # Parent dir; strip last assembled component from result.
1496 func_dirname "$func_normal_abspath_result"
1497 func_normal_abspath_result=$func_dirname_result
1498 ;;
1499 *)
1500 # Actual path component, append it.
1501 func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1502 ;;
1503 esac
1504 done
1505 # Restore leading double-slash if one was found on entry.
1506 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1507 }
1508
1509
1510 # func_notquiet ARG...
1511 # --------------------
1512 # Echo program name prefixed message only when not in quiet mode.
1513 func_notquiet ()
1514 {
1515 $debug_cmd
1516
1517 $opt_quiet || func_echo ${1+"$@"}
777 done
778
779 # Now calculate path; take care to avoid doubling-up slashes.
780 func_stripname '' '/' "$func_relative_path_result"
781 func_relative_path_result=$func_stripname_result
782 func_stripname '/' '/' "$func_relative_path_tcancelled"
783 if test "x$func_stripname_result" != x ; then
784 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
785 fi
786
787 # Normalisation. If bindir is libdir, return empty string,
788 # else relative path ending with a slash; either way, target
789 # file name can be directly appended.
790 if test ! -z "$func_relative_path_result"; then
791 func_stripname './' '' "$func_relative_path_result/"
792 func_relative_path_result=$func_stripname_result
793 fi
794 }
795
796 # The name of this program:
797 func_dirname_and_basename "$progpath"
798 progname=$func_basename_result
799
800 # Make sure we have an absolute path for reexecution:
801 case $progpath in
802 [\\/]*|[A-Za-z]:\\*) ;;
803 *[\\/]*)
804 progdir=$func_dirname_result
805 progdir=`cd "$progdir" && pwd`
806 progpath="$progdir/$progname"
807 ;;
808 *)
809 save_IFS="$IFS"
810 IFS=${PATH_SEPARATOR-:}
811 for progdir in $PATH; do
812 IFS="$save_IFS"
813 test -x "$progdir/$progname" && break
814 done
815 IFS="$save_IFS"
816 test -n "$progdir" || progdir=`pwd`
817 progpath="$progdir/$progname"
818 ;;
819 esac
820
821 # Sed substitution that helps us do robust quoting. It backslashifies
822 # metacharacters that are still active within double-quoted strings.
823 Xsed="${SED}"' -e 1s/^X//'
824 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
825
826 # Same as above, but do not quote variable references.
827 double_quote_subst='s/\(["`\\]\)/\\\1/g'
828
829 # Sed substitution that turns a string into a regex matching for the
830 # string literally.
831 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
832
833 # Sed substitution that converts a w32 file name or path
834 # which contains forward slashes, into one that contains
835 # (escaped) backslashes. A very naive implementation.
836 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
837
838 # Re-`\' parameter expansions in output of double_quote_subst that were
839 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
840 # in input to double_quote_subst, that '$' was protected from expansion.
841 # Since each input `\' is now two `\'s, look for any number of runs of
842 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
843 bs='\\'
844 bs2='\\\\'
845 bs4='\\\\\\\\'
846 dollar='\$'
847 sed_double_backslash="\
848 s/$bs4/&\\
849 /g
850 s/^$bs2$dollar/$bs&/
851 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
852 s/\n//g"
853
854 # Standard options:
855 opt_dry_run=false
856 opt_help=false
857 opt_quiet=false
858 opt_verbose=false
859 opt_warning=:
860
861 # func_echo arg...
862 # Echo program name prefixed message, along with the current mode
863 # name if it has been set yet.
864 func_echo ()
865 {
866 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
867 }
868
869 # func_verbose arg...
870 # Echo program name prefixed message in verbose mode only.
871 func_verbose ()
872 {
873 $opt_verbose && func_echo ${1+"$@"}
1518874
1519875 # A bug in bash halts the script if the last line of a function
1520876 # fails when set -e is in force, so we need another command to
1522878 :
1523879 }
1524880
1525
1526 # func_relative_path SRCDIR DSTDIR
1527 # --------------------------------
1528 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1529 func_relative_path ()
1530 {
1531 $debug_cmd
1532
1533 func_relative_path_result=
1534 func_normal_abspath "$1"
1535 func_relative_path_tlibdir=$func_normal_abspath_result
1536 func_normal_abspath "$2"
1537 func_relative_path_tbindir=$func_normal_abspath_result
1538
1539 # Ascend the tree starting from libdir
1540 while :; do
1541 # check if we have found a prefix of bindir
1542 case $func_relative_path_tbindir in
1543 $func_relative_path_tlibdir)
1544 # found an exact match
1545 func_relative_path_tcancelled=
1546 break
1547 ;;
1548 $func_relative_path_tlibdir*)
1549 # found a matching prefix
1550 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1551 func_relative_path_tcancelled=$func_stripname_result
1552 if test -z "$func_relative_path_result"; then
1553 func_relative_path_result=.
1554 fi
1555 break
1556 ;;
1557 *)
1558 func_dirname $func_relative_path_tlibdir
1559 func_relative_path_tlibdir=$func_dirname_result
1560 if test -z "$func_relative_path_tlibdir"; then
1561 # Have to descend all the way to the root!
1562 func_relative_path_result=../$func_relative_path_result
1563 func_relative_path_tcancelled=$func_relative_path_tbindir
1564 break
1565 fi
1566 func_relative_path_result=../$func_relative_path_result
1567 ;;
881 # func_echo_all arg...
882 # Invoke $ECHO with all args, space-separated.
883 func_echo_all ()
884 {
885 $ECHO "$*"
886 }
887
888 # func_error arg...
889 # Echo program name prefixed message to standard error.
890 func_error ()
891 {
892 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
893 }
894
895 # func_warning arg...
896 # Echo program name prefixed warning message to standard error.
897 func_warning ()
898 {
899 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
900
901 # bash bug again:
902 :
903 }
904
905 # func_fatal_error arg...
906 # Echo program name prefixed message to standard error, and exit.
907 func_fatal_error ()
908 {
909 func_error ${1+"$@"}
910 exit $EXIT_FAILURE
911 }
912
913 # func_fatal_help arg...
914 # Echo program name prefixed message to standard error, followed by
915 # a help hint, and exit.
916 func_fatal_help ()
917 {
918 func_error ${1+"$@"}
919 func_fatal_error "$help"
920 }
921 help="Try \`$progname --help' for more information." ## default
922
923
924 # func_grep expression filename
925 # Check whether EXPRESSION matches any line of FILENAME, without output.
926 func_grep ()
927 {
928 $GREP "$1" "$2" >/dev/null 2>&1
929 }
930
931
932 # func_mkdir_p directory-path
933 # Make sure the entire path to DIRECTORY-PATH is available.
934 func_mkdir_p ()
935 {
936 my_directory_path="$1"
937 my_dir_list=
938
939 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
940
941 # Protect directory names starting with `-'
942 case $my_directory_path in
943 -*) my_directory_path="./$my_directory_path" ;;
1568944 esac
1569 done
1570
1571 # Now calculate path; take care to avoid doubling-up slashes.
1572 func_stripname '' '/' "$func_relative_path_result"
1573 func_relative_path_result=$func_stripname_result
1574 func_stripname '/' '/' "$func_relative_path_tcancelled"
1575 if test -n "$func_stripname_result"; then
1576 func_append func_relative_path_result "/$func_stripname_result"
945
946 # While some portion of DIR does not yet exist...
947 while test ! -d "$my_directory_path"; do
948 # ...make a list in topmost first order. Use a colon delimited
949 # list incase some portion of path contains whitespace.
950 my_dir_list="$my_directory_path:$my_dir_list"
951
952 # If the last portion added has no slash in it, the list is done
953 case $my_directory_path in */*) ;; *) break ;; esac
954
955 # ...otherwise throw away the child directory and loop
956 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
957 done
958 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
959
960 save_mkdir_p_IFS="$IFS"; IFS=':'
961 for my_dir in $my_dir_list; do
962 IFS="$save_mkdir_p_IFS"
963 # mkdir can fail with a `File exist' error if two processes
964 # try to create one of the directories concurrently. Don't
965 # stop in that case!
966 $MKDIR "$my_dir" 2>/dev/null || :
967 done
968 IFS="$save_mkdir_p_IFS"
969
970 # Bail out if we (or some other process) failed to create a directory.
971 test -d "$my_directory_path" || \
972 func_fatal_error "Failed to create \`$1'"
1577973 fi
1578
1579 # Normalisation. If bindir is libdir, return '.' else relative path.
1580 if test -n "$func_relative_path_result"; then
1581 func_stripname './' '' "$func_relative_path_result"
1582 func_relative_path_result=$func_stripname_result
974 }
975
976
977 # func_mktempdir [string]
978 # Make a temporary directory that won't clash with other running
979 # libtool processes, and avoids race conditions if possible. If
980 # given, STRING is the basename for that directory.
981 func_mktempdir ()
982 {
983 my_template="${TMPDIR-/tmp}/${1-$progname}"
984
985 if test "$opt_dry_run" = ":"; then
986 # Return a directory name, but don't create it in dry-run mode
987 my_tmpdir="${my_template}-$$"
988 else
989
990 # If mktemp works, use that first and foremost
991 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
992
993 if test ! -d "$my_tmpdir"; then
994 # Failing that, at least try and use $RANDOM to avoid a race
995 my_tmpdir="${my_template}-${RANDOM-0}$$"
996
997 save_mktempdir_umask=`umask`
998 umask 0077
999 $MKDIR "$my_tmpdir"
1000 umask $save_mktempdir_umask
1001 fi
1002
1003 # If we're not in dry-run mode, bomb out on failure
1004 test -d "$my_tmpdir" || \
1005 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
15831006 fi
15841007
1585 test -n "$func_relative_path_result" || func_relative_path_result=.
1586
1587 :
1588 }
1589
1590
1591 # func_quote_for_eval ARG...
1592 # --------------------------
1593 # Aesthetically quote ARGs to be evaled later.
1594 # This function returns two values:
1595 # i) func_quote_for_eval_result
1596 # double-quoted, suitable for a subsequent eval
1597 # ii) func_quote_for_eval_unquoted_result
1598 # has all characters that are still active within double
1599 # quotes backslashified.
1008 $ECHO "$my_tmpdir"
1009 }
1010
1011
1012 # func_quote_for_eval arg
1013 # Aesthetically quote ARG to be evaled later.
1014 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1015 # is double-quoted, suitable for a subsequent eval, whereas
1016 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1017 # which are still active within double quotes backslashified.
16001018 func_quote_for_eval ()
16011019 {
1602 $debug_cmd
1603
1604 func_quote_for_eval_unquoted_result=
1605 func_quote_for_eval_result=
1606 while test 0 -lt $#; do
1607 case $1 in
1608 *[\\\`\"\$]*)
1609 _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
1610 *)
1611 _G_unquoted_arg=$1 ;;
1612 esac
1613 if test -n "$func_quote_for_eval_unquoted_result"; then
1614 func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1615 else
1616 func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1617 fi
1618
1619 case $_G_unquoted_arg in
1620 # Double-quote args containing shell metacharacters to delay
1621 # word splitting, command substitution and variable expansion
1622 # for a subsequent eval.
1623 # Many Bourne shells cannot handle close brackets correctly
1624 # in scan sets, so we specify it separately.
1625 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1626 _G_quoted_arg=\"$_G_unquoted_arg\"
1627 ;;
1628 *)
1629 _G_quoted_arg=$_G_unquoted_arg
1630 ;;
1631 esac
1632
1633 if test -n "$func_quote_for_eval_result"; then
1634 func_append func_quote_for_eval_result " $_G_quoted_arg"
1635 else
1636 func_append func_quote_for_eval_result "$_G_quoted_arg"
1637 fi
1638 shift
1639 done
1640 }
1641
1642
1643 # func_quote_for_expand ARG
1644 # -------------------------
1020 case $1 in
1021 *[\\\`\"\$]*)
1022 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1023 *)
1024 func_quote_for_eval_unquoted_result="$1" ;;
1025 esac
1026
1027 case $func_quote_for_eval_unquoted_result in
1028 # Double-quote args containing shell metacharacters to delay
1029 # word splitting, command substitution and and variable
1030 # expansion for a subsequent eval.
1031 # Many Bourne shells cannot handle close brackets correctly
1032 # in scan sets, so we specify it separately.
1033 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1034 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1035 ;;
1036 *)
1037 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1038 esac
1039 }
1040
1041
1042 # func_quote_for_expand arg
16451043 # Aesthetically quote ARG to be evaled later; same as above,
16461044 # but do not quote variable references.
16471045 func_quote_for_expand ()
16481046 {
1649 $debug_cmd
1650
16511047 case $1 in
16521048 *[\\\`\"]*)
1653 _G_arg=`$ECHO "$1" | $SED \
1654 -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1049 my_arg=`$ECHO "$1" | $SED \
1050 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
16551051 *)
1656 _G_arg=$1 ;;
1052 my_arg="$1" ;;
16571053 esac
16581054
1659 case $_G_arg in
1055 case $my_arg in
16601056 # Double-quote args containing shell metacharacters to delay
16611057 # word splitting and command substitution for a subsequent eval.
16621058 # Many Bourne shells cannot handle close brackets correctly
16631059 # in scan sets, so we specify it separately.
16641060 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1665 _G_arg=\"$_G_arg\"
1061 my_arg="\"$my_arg\""
16661062 ;;
16671063 esac
16681064
1669 func_quote_for_expand_result=$_G_arg
1670 }
1671
1672
1673 # func_stripname PREFIX SUFFIX NAME
1674 # ---------------------------------
1675 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1676 # PREFIX and SUFFIX must not contain globbing or regex special
1677 # characters, hashes, percent signs, but SUFFIX may contain a leading
1678 # dot (in which case that matches only a dot).
1679 if test yes = "$_G_HAVE_XSI_OPS"; then
1680 eval 'func_stripname ()
1681 {
1682 $debug_cmd
1683
1684 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1685 # positional parameters, so assign one to ordinary variable first.
1686 func_stripname_result=$3
1687 func_stripname_result=${func_stripname_result#"$1"}
1688 func_stripname_result=${func_stripname_result%"$2"}
1689 }'
1690 else
1691 func_stripname ()
1692 {
1693 $debug_cmd
1694
1695 case $2 in
1696 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1697 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1698 esac
1699 }
1700 fi
1701
1702
1703 # func_show_eval CMD [FAIL_EXP]
1704 # -----------------------------
1705 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1065 func_quote_for_expand_result="$my_arg"
1066 }
1067
1068
1069 # func_show_eval cmd [fail_exp]
1070 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
17061071 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
17071072 # is given, then evaluate it.
17081073 func_show_eval ()
17091074 {
1710 $debug_cmd
1711
1712 _G_cmd=$1
1713 _G_fail_exp=${2-':'}
1714
1715 func_quote_for_expand "$_G_cmd"
1716 eval "func_notquiet $func_quote_for_expand_result"
1717
1718 $opt_dry_run || {
1719 eval "$_G_cmd"
1720 _G_status=$?
1721 if test 0 -ne "$_G_status"; then
1722 eval "(exit $_G_status); $_G_fail_exp"
1075 my_cmd="$1"
1076 my_fail_exp="${2-:}"
1077
1078 ${opt_silent-false} || {
1079 func_quote_for_expand "$my_cmd"
1080 eval "func_echo $func_quote_for_expand_result"
1081 }
1082
1083 if ${opt_dry_run-false}; then :; else
1084 eval "$my_cmd"
1085 my_status=$?
1086 if test "$my_status" -eq 0; then :; else
1087 eval "(exit $my_status); $my_fail_exp"
17231088 fi
1724 }
1725 }
1726
1727
1728 # func_show_eval_locale CMD [FAIL_EXP]
1729 # ------------------------------------
1730 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
1089 fi
1090 }
1091
1092
1093 # func_show_eval_locale cmd [fail_exp]
1094 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
17311095 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
17321096 # is given, then evaluate it. Use the saved locale for evaluation.
17331097 func_show_eval_locale ()
17341098 {
1735 $debug_cmd
1736
1737 _G_cmd=$1
1738 _G_fail_exp=${2-':'}
1739
1740 $opt_quiet || {
1741 func_quote_for_expand "$_G_cmd"
1099 my_cmd="$1"
1100 my_fail_exp="${2-:}"
1101
1102 ${opt_silent-false} || {
1103 func_quote_for_expand "$my_cmd"
17421104 eval "func_echo $func_quote_for_expand_result"
17431105 }
17441106
1745 $opt_dry_run || {
1746 eval "$_G_user_locale
1747 $_G_cmd"
1748 _G_status=$?
1749 eval "$_G_safe_locale"
1750 if test 0 -ne "$_G_status"; then
1751 eval "(exit $_G_status); $_G_fail_exp"
1107 if ${opt_dry_run-false}; then :; else
1108 eval "$lt_user_locale
1109 $my_cmd"
1110 my_status=$?
1111 eval "$lt_safe_locale"
1112 if test "$my_status" -eq 0; then :; else
1113 eval "(exit $my_status); $my_fail_exp"
17521114 fi
1753 }
1754 }
1755
1115 fi
1116 }
17561117
17571118 # func_tr_sh
1758 # ----------
17591119 # Turn $1 into a string suitable for a shell variable name.
17601120 # Result is stored in $func_tr_sh_result. All characters
17611121 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
17621122 # if $1 begins with a digit, a '_' is prepended as well.
17631123 func_tr_sh ()
17641124 {
1765 $debug_cmd
1766
1767 case $1 in
1768 [0-9]* | *[!a-zA-Z0-9_]*)
1769 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1770 ;;
1771 * )
1772 func_tr_sh_result=$1
1773 ;;
1774 esac
1775 }
1776
1777
1778 # func_verbose ARG...
1779 # -------------------
1780 # Echo program name prefixed message in verbose mode only.
1781 func_verbose ()
1782 {
1783 $debug_cmd
1784
1785 $opt_verbose && func_echo "$*"
1786
1787 :
1788 }
1789
1790
1791 # func_warn_and_continue ARG...
1792 # -----------------------------
1793 # Echo program name prefixed warning message to standard error.
1794 func_warn_and_continue ()
1795 {
1796 $debug_cmd
1797
1798 $require_term_colors
1799
1800 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1801 }
1802
1803
1804 # func_warning CATEGORY ARG...
1805 # ----------------------------
1806 # Echo program name prefixed warning message to standard error. Warning
1807 # messages can be filtered according to CATEGORY, where this function
1808 # elides messages where CATEGORY is not listed in the global variable
1809 # 'opt_warning_types'.
1810 func_warning ()
1811 {
1812 $debug_cmd
1813
1814 # CATEGORY must be in the warning_categories list!
1815 case " $warning_categories " in
1816 *" $1 "*) ;;
1817 *) func_internal_error "invalid warning category '$1'" ;;
1818 esac
1819
1820 _G_category=$1
1821 shift
1822
1823 case " $opt_warning_types " in
1824 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1825 esac
1826 }
1827
1828
1829 # func_sort_ver VER1 VER2
1830 # -----------------------
1831 # 'sort -V' is not generally available.
1832 # Note this deviates from the version comparison in automake
1833 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1834 # but this should suffice as we won't be specifying old
1835 # version formats or redundant trailing .0 in bootstrap.conf.
1836 # If we did want full compatibility then we should probably
1837 # use m4_version_compare from autoconf.
1838 func_sort_ver ()
1839 {
1840 $debug_cmd
1841
1842 printf '%s\n%s\n' "$1" "$2" \
1843 | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1844 }
1845
1846 # func_lt_ver PREV CURR
1847 # ---------------------
1848 # Return true if PREV and CURR are in the correct order according to
1849 # func_sort_ver, otherwise false. Use it like this:
1850 #
1851 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1852 func_lt_ver ()
1853 {
1854 $debug_cmd
1855
1856 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1857 }
1858
1859
1860 # Local variables:
1861 # mode: shell-script
1862 # sh-indentation: 2
1863 # eval: (add-hook 'before-save-hook 'time-stamp)
1864 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1865 # time-stamp-time-zone: "UTC"
1866 # End:
1867 #! /bin/sh
1868
1869 # Set a version string for this script.
1870 scriptversion=2014-01-07.03; # UTC
1871
1872 # A portable, pluggable option parser for Bourne shell.
1873 # Written by Gary V. Vaughan, 2010
1874
1875 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1876 # This is free software; see the source for copying conditions. There is NO
1877 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1878
1879 # This program is free software: you can redistribute it and/or modify
1880 # it under the terms of the GNU General Public License as published by
1881 # the Free Software Foundation, either version 3 of the License, or
1882 # (at your option) any later version.
1883
1884 # This program is distributed in the hope that it will be useful,
1885 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1886 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1887 # GNU General Public License for more details.
1888
1889 # You should have received a copy of the GNU General Public License
1890 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1891
1892 # Please report bugs or propose patches to gary@gnu.org.
1893
1894
1895 ## ------ ##
1896 ## Usage. ##
1897 ## ------ ##
1898
1899 # This file is a library for parsing options in your shell scripts along
1900 # with assorted other useful supporting features that you can make use
1901 # of too.
1902 #
1903 # For the simplest scripts you might need only:
1904 #
1905 # #!/bin/sh
1906 # . relative/path/to/funclib.sh
1907 # . relative/path/to/options-parser
1908 # scriptversion=1.0
1909 # func_options ${1+"$@"}
1910 # eval set dummy "$func_options_result"; shift
1911 # ...rest of your script...
1912 #
1913 # In order for the '--version' option to work, you will need to have a
1914 # suitably formatted comment like the one at the top of this file
1915 # starting with '# Written by ' and ending with '# warranty; '.
1916 #
1917 # For '-h' and '--help' to work, you will also need a one line
1918 # description of your script's purpose in a comment directly above the
1919 # '# Written by ' line, like the one at the top of this file.
1920 #
1921 # The default options also support '--debug', which will turn on shell
1922 # execution tracing (see the comment above debug_cmd below for another
1923 # use), and '--verbose' and the func_verbose function to allow your script
1924 # to display verbose messages only when your user has specified
1925 # '--verbose'.
1926 #
1927 # After sourcing this file, you can plug processing for additional
1928 # options by amending the variables from the 'Configuration' section
1929 # below, and following the instructions in the 'Option parsing'
1930 # section further down.
1931
1932 ## -------------- ##
1933 ## Configuration. ##
1934 ## -------------- ##
1935
1936 # You should override these variables in your script after sourcing this
1937 # file so that they reflect the customisations you have added to the
1938 # option parser.
1939
1940 # The usage line for option parsing errors and the start of '-h' and
1941 # '--help' output messages. You can embed shell variables for delayed
1942 # expansion at the time the message is displayed, but you will need to
1943 # quote other shell meta-characters carefully to prevent them being
1944 # expanded when the contents are evaled.
1945 usage='$progpath [OPTION]...'
1946
1947 # Short help message in response to '-h' and '--help'. Add to this or
1948 # override it after sourcing this library to reflect the full set of
1949 # options your script accepts.
1950 usage_message="\
1951 --debug enable verbose shell tracing
1952 -W, --warnings=CATEGORY
1953 report the warnings falling in CATEGORY [all]
1954 -v, --verbose verbosely report processing
1955 --version print version information and exit
1956 -h, --help print short or long help message and exit
1957 "
1958
1959 # Additional text appended to 'usage_message' in response to '--help'.
1960 long_help_message="
1961 Warning categories include:
1962 'all' show all warnings
1963 'none' turn off all the warnings
1964 'error' warnings are treated as fatal errors"
1965
1966 # Help message printed before fatal option parsing errors.
1967 fatal_help="Try '\$progname --help' for more information."
1968
1969
1970
1971 ## ------------------------- ##
1972 ## Hook function management. ##
1973 ## ------------------------- ##
1974
1975 # This section contains functions for adding, removing, and running hooks
1976 # to the main code. A hook is just a named list of of function, that can
1977 # be run in order later on.
1978
1979 # func_hookable FUNC_NAME
1980 # -----------------------
1981 # Declare that FUNC_NAME will run hooks added with
1982 # 'func_add_hook FUNC_NAME ...'.
1983 func_hookable ()
1984 {
1985 $debug_cmd
1986
1987 func_append hookable_fns " $1"
1988 }
1989
1990
1991 # func_add_hook FUNC_NAME HOOK_FUNC
1992 # ---------------------------------
1993 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1994 # first have been declared "hookable" by a call to 'func_hookable'.
1995 func_add_hook ()
1996 {
1997 $debug_cmd
1998
1999 case " $hookable_fns " in
2000 *" $1 "*) ;;
2001 *) func_fatal_error "'$1' does not accept hook functions." ;;
2002 esac
2003
2004 eval func_append ${1}_hooks '" $2"'
2005 }
2006
2007
2008 # func_remove_hook FUNC_NAME HOOK_FUNC
2009 # ------------------------------------
2010 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
2011 func_remove_hook ()
2012 {
2013 $debug_cmd
2014
2015 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
2016 }
2017
2018
2019 # func_run_hooks FUNC_NAME [ARG]...
2020 # ---------------------------------
2021 # Run all hook functions registered to FUNC_NAME.
2022 # It is assumed that the list of hook functions contains nothing more
2023 # than a whitespace-delimited list of legal shell function names, and
2024 # no effort is wasted trying to catch shell meta-characters or preserve
2025 # whitespace.
2026 func_run_hooks ()
2027 {
2028 $debug_cmd
2029
2030 case " $hookable_fns " in
2031 *" $1 "*) ;;
2032 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
2033 esac
2034
2035 eval _G_hook_fns=\$$1_hooks; shift
2036
2037 for _G_hook in $_G_hook_fns; do
2038 eval $_G_hook '"$@"'
2039
2040 # store returned options list back into positional
2041 # parameters for next 'cmd' execution.
2042 eval _G_hook_result=\$${_G_hook}_result
2043 eval set dummy "$_G_hook_result"; shift
2044 done
2045
2046 func_quote_for_eval ${1+"$@"}
2047 func_run_hooks_result=$func_quote_for_eval_result
2048 }
2049
2050
2051
2052 ## --------------- ##
2053 ## Option parsing. ##
2054 ## --------------- ##
2055
2056 # In order to add your own option parsing hooks, you must accept the
2057 # full positional parameter list in your hook function, remove any
2058 # options that you action, and then pass back the remaining unprocessed
2059 # options in '<hooked_function_name>_result', escaped suitably for
2060 # 'eval'. Like this:
2061 #
2062 # my_options_prep ()
2063 # {
2064 # $debug_cmd
2065 #
2066 # # Extend the existing usage message.
2067 # usage_message=$usage_message'
2068 # -s, --silent don'\''t print informational messages
2069 # '
2070 #
2071 # func_quote_for_eval ${1+"$@"}
2072 # my_options_prep_result=$func_quote_for_eval_result
2073 # }
2074 # func_add_hook func_options_prep my_options_prep
2075 #
2076 #
2077 # my_silent_option ()
2078 # {
2079 # $debug_cmd
2080 #
2081 # # Note that for efficiency, we parse as many options as we can
2082 # # recognise in a loop before passing the remainder back to the
2083 # # caller on the first unrecognised argument we encounter.
2084 # while test $# -gt 0; do
2085 # opt=$1; shift
2086 # case $opt in
2087 # --silent|-s) opt_silent=: ;;
2088 # # Separate non-argument short options:
2089 # -s*) func_split_short_opt "$_G_opt"
2090 # set dummy "$func_split_short_opt_name" \
2091 # "-$func_split_short_opt_arg" ${1+"$@"}
2092 # shift
2093 # ;;
2094 # *) set dummy "$_G_opt" "$*"; shift; break ;;
2095 # esac
2096 # done
2097 #
2098 # func_quote_for_eval ${1+"$@"}
2099 # my_silent_option_result=$func_quote_for_eval_result
2100 # }
2101 # func_add_hook func_parse_options my_silent_option
2102 #
2103 #
2104 # my_option_validation ()
2105 # {
2106 # $debug_cmd
2107 #
2108 # $opt_silent && $opt_verbose && func_fatal_help "\
2109 # '--silent' and '--verbose' options are mutually exclusive."
2110 #
2111 # func_quote_for_eval ${1+"$@"}
2112 # my_option_validation_result=$func_quote_for_eval_result
2113 # }
2114 # func_add_hook func_validate_options my_option_validation
2115 #
2116 # You'll alse need to manually amend $usage_message to reflect the extra
2117 # options you parse. It's preferable to append if you can, so that
2118 # multiple option parsing hooks can be added safely.
2119
2120
2121 # func_options [ARG]...
2122 # ---------------------
2123 # All the functions called inside func_options are hookable. See the
2124 # individual implementations for details.
2125 func_hookable func_options
2126 func_options ()
2127 {
2128 $debug_cmd
2129
2130 func_options_prep ${1+"$@"}
2131 eval func_parse_options \
2132 ${func_options_prep_result+"$func_options_prep_result"}
2133 eval func_validate_options \
2134 ${func_parse_options_result+"$func_parse_options_result"}
2135
2136 eval func_run_hooks func_options \
2137 ${func_validate_options_result+"$func_validate_options_result"}
2138
2139 # save modified positional parameters for caller
2140 func_options_result=$func_run_hooks_result
2141 }
2142
2143
2144 # func_options_prep [ARG]...
2145 # --------------------------
2146 # All initialisations required before starting the option parse loop.
2147 # Note that when calling hook functions, we pass through the list of
2148 # positional parameters. If a hook function modifies that list, and
2149 # needs to propogate that back to rest of this script, then the complete
2150 # modified list must be put in 'func_run_hooks_result' before
2151 # returning.
2152 func_hookable func_options_prep
2153 func_options_prep ()
2154 {
2155 $debug_cmd
2156
2157 # Option defaults:
2158 opt_verbose=false
2159 opt_warning_types=
2160
2161 func_run_hooks func_options_prep ${1+"$@"}
2162
2163 # save modified positional parameters for caller
2164 func_options_prep_result=$func_run_hooks_result
2165 }
2166
2167
2168 # func_parse_options [ARG]...
2169 # ---------------------------
2170 # The main option parsing loop.
2171 func_hookable func_parse_options
2172 func_parse_options ()
2173 {
2174 $debug_cmd
2175
2176 func_parse_options_result=
2177
2178 # this just eases exit handling
2179 while test $# -gt 0; do
2180 # Defer to hook functions for initial option parsing, so they
2181 # get priority in the event of reusing an option name.
2182 func_run_hooks func_parse_options ${1+"$@"}
2183
2184 # Adjust func_parse_options positional parameters to match
2185 eval set dummy "$func_run_hooks_result"; shift
2186
2187 # Break out of the loop if we already parsed every option.
2188 test $# -gt 0 || break
2189
2190 _G_opt=$1
2191 shift
2192 case $_G_opt in
2193 --debug|-x) debug_cmd='set -x'
2194 func_echo "enabling shell trace mode"
2195 $debug_cmd
2196 ;;
2197
2198 --no-warnings|--no-warning|--no-warn)
2199 set dummy --warnings none ${1+"$@"}
2200 shift
2201 ;;
2202
2203 --warnings|--warning|-W)
2204 test $# = 0 && func_missing_arg $_G_opt && break
2205 case " $warning_categories $1" in
2206 *" $1 "*)
2207 # trailing space prevents matching last $1 above
2208 func_append_uniq opt_warning_types " $1"
2209 ;;
2210 *all)
2211 opt_warning_types=$warning_categories
2212 ;;
2213 *none)
2214 opt_warning_types=none
2215 warning_func=:
2216 ;;
2217 *error)
2218 opt_warning_types=$warning_categories
2219 warning_func=func_fatal_error
2220 ;;
2221 *)
2222 func_fatal_error \
2223 "unsupported warning category: '$1'"
2224 ;;
2225 esac
2226 shift
2227 ;;
2228
2229 --verbose|-v) opt_verbose=: ;;
2230 --version) func_version ;;
2231 -\?|-h) func_usage ;;
2232 --help) func_help ;;
2233
2234 # Separate optargs to long options (plugins may need this):
2235 --*=*) func_split_equals "$_G_opt"
2236 set dummy "$func_split_equals_lhs" \
2237 "$func_split_equals_rhs" ${1+"$@"}
2238 shift
2239 ;;
2240
2241 # Separate optargs to short options:
2242 -W*)
2243 func_split_short_opt "$_G_opt"
2244 set dummy "$func_split_short_opt_name" \
2245 "$func_split_short_opt_arg" ${1+"$@"}
2246 shift
2247 ;;
2248
2249 # Separate non-argument short options:
2250 -\?*|-h*|-v*|-x*)
2251 func_split_short_opt "$_G_opt"
2252 set dummy "$func_split_short_opt_name" \
2253 "-$func_split_short_opt_arg" ${1+"$@"}
2254 shift
2255 ;;
2256
2257 --) break ;;
2258 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
2259 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2260 esac
2261 done
2262
2263 # save modified positional parameters for caller
2264 func_quote_for_eval ${1+"$@"}
2265 func_parse_options_result=$func_quote_for_eval_result
2266 }
2267
2268
2269 # func_validate_options [ARG]...
2270 # ------------------------------
2271 # Perform any sanity checks on option settings and/or unconsumed
2272 # arguments.
2273 func_hookable func_validate_options
2274 func_validate_options ()
2275 {
2276 $debug_cmd
2277
2278 # Display all warnings if -W was not given.
2279 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
2280
2281 func_run_hooks func_validate_options ${1+"$@"}
2282
2283 # Bail if the options were screwed!
2284 $exit_cmd $EXIT_FAILURE
2285
2286 # save modified positional parameters for caller
2287 func_validate_options_result=$func_run_hooks_result
2288 }
2289
2290
2291
2292 ## ----------------- ##
2293 ## Helper functions. ##
2294 ## ----------------- ##
2295
2296 # This section contains the helper functions used by the rest of the
2297 # hookable option parser framework in ascii-betical order.
2298
2299
2300 # func_fatal_help ARG...
2301 # ----------------------
2302 # Echo program name prefixed message to standard error, followed by
2303 # a help hint, and exit.
2304 func_fatal_help ()
2305 {
2306 $debug_cmd
2307
2308 eval \$ECHO \""Usage: $usage"\"
2309 eval \$ECHO \""$fatal_help"\"
2310 func_error ${1+"$@"}
2311 exit $EXIT_FAILURE
2312 }
2313
2314
2315 # func_help
2316 # ---------
2317 # Echo long help message to standard output and exit.
1125 case $1 in
1126 [0-9]* | *[!a-zA-Z0-9_]*)
1127 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1128 ;;
1129 * )
1130 func_tr_sh_result=$1
1131 ;;
1132 esac
1133 }
1134
1135
1136 # func_version
1137 # Echo version message to standard output and exit.
1138 func_version ()
1139 {
1140 $opt_debug
1141
1142 $SED -n '/(C)/!b go
1143 :more
1144 /\./!{
1145 N
1146 s/\n# / /
1147 b more
1148 }
1149 :go
1150 /^# '$PROGRAM' (GNU /,/# warranty; / {
1151 s/^# //
1152 s/^# *$//
1153 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1154 p
1155 }' < "$progpath"
1156 exit $?
1157 }
1158
1159 # func_usage
1160 # Echo short help message to standard output and exit.
1161 func_usage ()
1162 {
1163 $opt_debug
1164
1165 $SED -n '/^# Usage:/,/^# *.*--help/ {
1166 s/^# //
1167 s/^# *$//
1168 s/\$progname/'$progname'/
1169 p
1170 }' < "$progpath"
1171 echo
1172 $ECHO "run \`$progname --help | more' for full usage"
1173 exit $?
1174 }
1175
1176 # func_help [NOEXIT]
1177 # Echo long help message to standard output and exit,
1178 # unless 'noexit' is passed as argument.
23181179 func_help ()
23191180 {
2320 $debug_cmd
2321
2322 func_usage_message
2323 $ECHO "$long_help_message"
2324 exit 0
2325 }
2326
2327
2328 # func_missing_arg ARGNAME
2329 # ------------------------
1181 $opt_debug
1182
1183 $SED -n '/^# Usage:/,/# Report bugs to/ {
1184 :print
1185 s/^# //
1186 s/^# *$//
1187 s*\$progname*'$progname'*
1188 s*\$host*'"$host"'*
1189 s*\$SHELL*'"$SHELL"'*
1190 s*\$LTCC*'"$LTCC"'*
1191 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1192 s*\$LD*'"$LD"'*
1193 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1194 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
1195 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
1196 p
1197 d
1198 }
1199 /^# .* home page:/b print
1200 /^# General help using/b print
1201 ' < "$progpath"
1202 ret=$?
1203 if test -z "$1"; then
1204 exit $ret
1205 fi
1206 }
1207
1208 # func_missing_arg argname
23301209 # Echo program name prefixed message to standard error and set global
23311210 # exit_cmd.
23321211 func_missing_arg ()
23331212 {
2334 $debug_cmd
2335
2336 func_error "Missing argument for '$1'."
1213 $opt_debug
1214
1215 func_error "missing argument for $1."
23371216 exit_cmd=exit
23381217 }
23391218
23401219
2341 # func_split_equals STRING
2342 # ------------------------
2343 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
2344 # splitting STRING at the '=' sign.
2345 test -z "$_G_HAVE_XSI_OPS" \
2346 && (eval 'x=a/b/c;
2347 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
2348 && _G_HAVE_XSI_OPS=yes
2349
2350 if test yes = "$_G_HAVE_XSI_OPS"
2351 then
2352 # This is an XSI compatible shell, allowing a faster implementation...
2353 eval 'func_split_equals ()
2354 {
2355 $debug_cmd
2356
2357 func_split_equals_lhs=${1%%=*}
2358 func_split_equals_rhs=${1#*=}
2359 test "x$func_split_equals_lhs" = "x$1" \
2360 && func_split_equals_rhs=
2361 }'
2362 else
2363 # ...otherwise fall back to using expr, which is often a shell builtin.
2364 func_split_equals ()
2365 {
2366 $debug_cmd
2367
2368 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
2369 func_split_equals_rhs=
2370 test "x$func_split_equals_lhs" = "x$1" \
2371 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
2372 }
2373 fi #func_split_equals
2374
2375
2376 # func_split_short_opt SHORTOPT
2377 # -----------------------------
1220 # func_split_short_opt shortopt
23781221 # Set func_split_short_opt_name and func_split_short_opt_arg shell
23791222 # variables after splitting SHORTOPT after the 2nd character.
2380 if test yes = "$_G_HAVE_XSI_OPS"
2381 then
2382 # This is an XSI compatible shell, allowing a faster implementation...
2383 eval 'func_split_short_opt ()
2384 {
2385 $debug_cmd
2386
2387 func_split_short_opt_arg=${1#??}
2388 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
2389 }'
2390 else
2391 # ...otherwise fall back to using expr, which is often a shell builtin.
2392 func_split_short_opt ()
2393 {
2394 $debug_cmd
2395
2396 func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
2397 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
2398 }
2399 fi #func_split_short_opt
2400
2401
2402 # func_usage
2403 # ----------
2404 # Echo short help message to standard output and exit.
2405 func_usage ()
2406 {
2407 $debug_cmd
2408
2409 func_usage_message
2410 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
2411 exit 0
2412 }
2413
2414
2415 # func_usage_message
2416 # ------------------
2417 # Echo short help message to standard output.
2418 func_usage_message ()
2419 {
2420 $debug_cmd
2421
2422 eval \$ECHO \""Usage: $usage"\"
2423 echo
2424 $SED -n 's|^# ||
2425 /^Written by/{
2426 x;p;x
2427 }
2428 h
2429 /^Written by/q' < "$progpath"
2430 echo
2431 eval \$ECHO \""$usage_message"\"
2432 }
2433
2434
2435 # func_version
2436 # ------------
2437 # Echo version message to standard output and exit.
2438 func_version ()
2439 {
2440 $debug_cmd
2441
2442 printf '%s\n' "$progname $scriptversion"
2443 $SED -n '
2444 /(C)/!b go
2445 :more
2446 /\./!{
2447 N
2448 s|\n# | |
2449 b more
2450 }
2451 :go
2452 /^# Written by /,/# warranty; / {
2453 s|^# ||
2454 s|^# *$||
2455 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
2456 p
2457 }
2458 /^# Written by / {
2459 s|^# ||
2460 p
2461 }
2462 /^warranty; /q' < "$progpath"
2463
2464 exit $?
2465 }
2466
2467
2468 # Local variables:
2469 # mode: shell-script
2470 # sh-indentation: 2
2471 # eval: (add-hook 'before-save-hook 'time-stamp)
2472 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
2473 # time-stamp-time-zone: "UTC"
2474 # End:
2475
2476 # Set a version string.
2477 scriptversion='(GNU libtool) 2.4.6'
2478
2479
2480 # func_echo ARG...
2481 # ----------------
2482 # Libtool also displays the current mode in messages, so override
2483 # funclib.sh func_echo with this custom definition.
2484 func_echo ()
2485 {
2486 $debug_cmd
2487
2488 _G_message=$*
2489
2490 func_echo_IFS=$IFS
2491 IFS=$nl
2492 for _G_line in $_G_message; do
2493 IFS=$func_echo_IFS
2494 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
2495 done
2496 IFS=$func_echo_IFS
2497 }
2498
2499
2500 # func_warning ARG...
2501 # -------------------
2502 # Libtool warnings are not categorized, so override funclib.sh
2503 # func_warning with this simpler definition.
2504 func_warning ()
2505 {
2506 $debug_cmd
2507
2508 $warning_func ${1+"$@"}
2509 }
2510
2511
2512 ## ---------------- ##
2513 ## Options parsing. ##
2514 ## ---------------- ##
2515
2516 # Hook in the functions to make sure our own options are parsed during
2517 # the option parsing loop.
2518
2519 usage='$progpath [OPTION]... [MODE-ARG]...'
2520
2521 # Short help message in response to '-h'.
2522 usage_message="Options:
2523 --config show all configuration variables
2524 --debug enable verbose shell tracing
2525 -n, --dry-run display commands without modifying any files
2526 --features display basic configuration information and exit
2527 --mode=MODE use operation mode MODE
2528 --no-warnings equivalent to '-Wnone'
2529 --preserve-dup-deps don't remove duplicate dependency libraries
2530 --quiet, --silent don't print informational messages
2531 --tag=TAG use configuration variables from tag TAG
2532 -v, --verbose print more informational messages than default
2533 --version print version information
2534 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2535 -h, --help, --help-all print short, long, or detailed help message
2536 "
2537
2538 # Additional text appended to 'usage_message' in response to '--help'.
2539 func_help ()
2540 {
2541 $debug_cmd
2542
2543 func_usage_message
2544 $ECHO "$long_help_message
2545
2546 MODE must be one of the following:
2547
2548 clean remove files from the build directory
2549 compile compile a source file into a libtool object
2550 execute automatically set library path, then run a program
2551 finish complete the installation of libtool libraries
2552 install install libraries or executables
2553 link create a library or an executable
2554 uninstall remove libraries from an installed directory
2555
2556 MODE-ARGS vary depending on the MODE. When passed as first option,
2557 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2558 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2559
2560 When reporting a bug, please describe a test case to reproduce it and
2561 include the following information:
2562
2563 host-triplet: $host
2564 shell: $SHELL
2565 compiler: $LTCC
2566 compiler flags: $LTCFLAGS
2567 linker: $LD (gnu? $with_gnu_ld)
2568 version: $progname (GNU libtool) 2.4.6
2569 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2570 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2571
2572 Report bugs to <bug-libtool@gnu.org>.
2573 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2574 General help using GNU software: <http://www.gnu.org/gethelp/>."
2575 exit 0
2576 }
2577
2578
2579 # func_lo2o OBJECT-NAME
2580 # ---------------------
2581 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2582 # object suffix.
2583
2584 lo2o=s/\\.lo\$/.$objext/
2585 o2lo=s/\\.$objext\$/.lo/
2586
2587 if test yes = "$_G_HAVE_XSI_OPS"; then
2588 eval 'func_lo2o ()
2589 {
2590 case $1 in
2591 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2592 * ) func_lo2o_result=$1 ;;
1223 func_split_short_opt ()
1224 {
1225 func_split_short_opt_arg=${1#??}
1226 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1227 } # Extended-shell func_split_short_opt implementation
1228
1229
1230 # func_split_long_opt longopt
1231 # Set func_split_long_opt_name and func_split_long_opt_arg shell
1232 # variables after splitting LONGOPT at the `=' sign.
1233 func_split_long_opt ()
1234 {
1235 func_split_long_opt_name=${1%%=*}
1236 func_split_long_opt_arg=${1#*=}
1237 } # Extended-shell func_split_long_opt implementation
1238
1239 exit_cmd=:
1240
1241
1242
1243
1244
1245 magic="%%%MAGIC variable%%%"
1246 magic_exe="%%%MAGIC EXE variable%%%"
1247
1248 # Global variables.
1249 nonopt=
1250 preserve_args=
1251 lo2o="s/\\.lo\$/.${objext}/"
1252 o2lo="s/\\.${objext}\$/.lo/"
1253 extracted_archives=
1254 extracted_serial=0
1255
1256 # If this variable is set in any of the actions, the command in it
1257 # will be execed at the end. This prevents here-documents from being
1258 # left over by shells.
1259 exec_cmd=
1260
1261 # func_append var value
1262 # Append VALUE to the end of shell variable VAR.
1263 func_append ()
1264 {
1265 eval "${1}+=\${2}"
1266 } # Extended-shell func_append implementation
1267
1268 # func_append_quoted var value
1269 # Quote VALUE and append to the end of shell variable VAR, separated
1270 # by a space.
1271 func_append_quoted ()
1272 {
1273 func_quote_for_eval "${2}"
1274 eval "${1}+=\\ \$func_quote_for_eval_result"
1275 } # Extended-shell func_append_quoted implementation
1276
1277
1278 # func_arith arithmetic-term...
1279 func_arith ()
1280 {
1281 func_arith_result=$(( $* ))
1282 } # Extended-shell func_arith implementation
1283
1284
1285 # func_len string
1286 # STRING may not start with a hyphen.
1287 func_len ()
1288 {
1289 func_len_result=${#1}
1290 } # Extended-shell func_len implementation
1291
1292
1293 # func_lo2o object
1294 func_lo2o ()
1295 {
1296 case ${1} in
1297 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1298 *) func_lo2o_result=${1} ;;
25931299 esac
2594 }'
2595
2596 # func_xform LIBOBJ-OR-SOURCE
2597 # ---------------------------
2598 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2599 # suffix to a '.lo' libtool-object suffix.
2600 eval 'func_xform ()
2601 {
1300 } # Extended-shell func_lo2o implementation
1301
1302
1303 # func_xform libobj-or-source
1304 func_xform ()
1305 {
26021306 func_xform_result=${1%.*}.lo
2603 }'
2604 else
2605 # ...otherwise fall back to using sed.
2606 func_lo2o ()
2607 {
2608 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2609 }
2610
2611 func_xform ()
2612 {
2613 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2614 }
2615 fi
2616
2617
2618 # func_fatal_configuration ARG...
2619 # -------------------------------
1307 } # Extended-shell func_xform implementation
1308
1309
1310 # func_fatal_configuration arg...
26201311 # Echo program name prefixed message to standard error, followed by
26211312 # a configuration failure hint, and exit.
26221313 func_fatal_configuration ()
26231314 {
2624 func__fatal_error ${1+"$@"} \
2625 "See the $PACKAGE documentation for more information." \
2626 "Fatal configuration error."
1315 func_error ${1+"$@"}
1316 func_error "See the $PACKAGE documentation for more information."
1317 func_fatal_error "Fatal configuration error."
26271318 }
26281319
26291320
26301321 # func_config
2631 # -----------
26321322 # Display the configuration for all the tags in this script.
26331323 func_config ()
26341324 {
26461336 exit $?
26471337 }
26481338
2649
26501339 # func_features
2651 # -------------
26521340 # Display the features supported by this script.
26531341 func_features ()
26541342 {
26551343 echo "host: $host"
2656 if test yes = "$build_libtool_libs"; then
1344 if test "$build_libtool_libs" = yes; then
26571345 echo "enable shared libraries"
26581346 else
26591347 echo "disable shared libraries"
26601348 fi
2661 if test yes = "$build_old_libs"; then
1349 if test "$build_old_libs" = yes; then
26621350 echo "enable static libraries"
26631351 else
26641352 echo "disable static libraries"
26671355 exit $?
26681356 }
26691357
2670
2671 # func_enable_tag TAGNAME
2672 # -----------------------
1358 # func_enable_tag tagname
26731359 # Verify that TAGNAME is valid, and either flag an error and exit, or
26741360 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
26751361 # variable here.
26761362 func_enable_tag ()
26771363 {
2678 # Global variable:
2679 tagname=$1
2680
2681 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2682 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2683 sed_extractcf=/$re_begincf/,/$re_endcf/p
2684
2685 # Validate tagname.
2686 case $tagname in
2687 *[!-_A-Za-z0-9,/]*)
2688 func_fatal_error "invalid tag name: $tagname"
2689 ;;
2690 esac
2691
2692 # Don't test for the "default" C tag, as we know it's
2693 # there but not specially marked.
2694 case $tagname in
2695 CC) ;;
1364 # Global variable:
1365 tagname="$1"
1366
1367 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1368 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1369 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1370
1371 # Validate tagname.
1372 case $tagname in
1373 *[!-_A-Za-z0-9,/]*)
1374 func_fatal_error "invalid tag name: $tagname"
1375 ;;
1376 esac
1377
1378 # Don't test for the "default" C tag, as we know it's
1379 # there but not specially marked.
1380 case $tagname in
1381 CC) ;;
26961382 *)
2697 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2698 taglist="$taglist $tagname"
2699
2700 # Evaluate the configuration. Be careful to quote the path
2701 # and the sed script, to avoid splitting on whitespace, but
2702 # also don't use non-portable quotes within backquotes within
2703 # quotes we have to do it in 2 steps:
2704 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2705 eval "$extractedcf"
2706 else
2707 func_error "ignoring unknown tag $tagname"
2708 fi
2709 ;;
2710 esac
2711 }
2712
1383 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1384 taglist="$taglist $tagname"
1385
1386 # Evaluate the configuration. Be careful to quote the path
1387 # and the sed script, to avoid splitting on whitespace, but
1388 # also don't use non-portable quotes within backquotes within
1389 # quotes we have to do it in 2 steps:
1390 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1391 eval "$extractedcf"
1392 else
1393 func_error "ignoring unknown tag $tagname"
1394 fi
1395 ;;
1396 esac
1397 }
27131398
27141399 # func_check_version_match
2715 # ------------------------
27161400 # Ensure that we are using m4 macros, and libtool script from the same
27171401 # release of libtool.
27181402 func_check_version_match ()
27191403 {
2720 if test "$package_revision" != "$macro_revision"; then
2721 if test "$VERSION" != "$macro_version"; then
2722 if test -z "$macro_version"; then
2723 cat >&2 <<_LT_EOF
1404 if test "$package_revision" != "$macro_revision"; then
1405 if test "$VERSION" != "$macro_version"; then
1406 if test -z "$macro_version"; then
1407 cat >&2 <<_LT_EOF
27241408 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
27251409 $progname: definition of this LT_INIT comes from an older release.
27261410 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
27271411 $progname: and run autoconf again.
27281412 _LT_EOF
2729 else
2730 cat >&2 <<_LT_EOF
1413 else
1414 cat >&2 <<_LT_EOF
27311415 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
27321416 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
27331417 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
27341418 $progname: and run autoconf again.
27351419 _LT_EOF
2736 fi
2737 else
2738 cat >&2 <<_LT_EOF
1420 fi
1421 else
1422 cat >&2 <<_LT_EOF
27391423 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
27401424 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
27411425 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
27421426 $progname: of $PACKAGE $VERSION and run autoconf again.
27431427 _LT_EOF
2744 fi
2745
2746 exit $EXIT_MISMATCH
27471428 fi
2748 }
2749
2750
2751 # libtool_options_prep [ARG]...
2752 # -----------------------------
2753 # Preparation for options parsed by libtool.
2754 libtool_options_prep ()
2755 {
2756 $debug_mode
2757
2758 # Option defaults:
2759 opt_config=false
2760 opt_dlopen=
2761 opt_dry_run=false
2762 opt_help=false
2763 opt_mode=
2764 opt_preserve_dup_deps=false
2765 opt_quiet=false
2766
2767 nonopt=
2768 preserve_args=
2769
2770 # Shorthand for --mode=foo, only valid as the first argument
2771 case $1 in
2772 clean|clea|cle|cl)
2773 shift; set dummy --mode clean ${1+"$@"}; shift
1429
1430 exit $EXIT_MISMATCH
1431 fi
1432 }
1433
1434
1435 # Shorthand for --mode=foo, only valid as the first argument
1436 case $1 in
1437 clean|clea|cle|cl)
1438 shift; set dummy --mode clean ${1+"$@"}; shift
1439 ;;
1440 compile|compil|compi|comp|com|co|c)
1441 shift; set dummy --mode compile ${1+"$@"}; shift
1442 ;;
1443 execute|execut|execu|exec|exe|ex|e)
1444 shift; set dummy --mode execute ${1+"$@"}; shift
1445 ;;
1446 finish|finis|fini|fin|fi|f)
1447 shift; set dummy --mode finish ${1+"$@"}; shift
1448 ;;
1449 install|instal|insta|inst|ins|in|i)
1450 shift; set dummy --mode install ${1+"$@"}; shift
1451 ;;
1452 link|lin|li|l)
1453 shift; set dummy --mode link ${1+"$@"}; shift
1454 ;;
1455 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1456 shift; set dummy --mode uninstall ${1+"$@"}; shift
1457 ;;
1458 esac
1459
1460
1461
1462 # Option defaults:
1463 opt_debug=:
1464 opt_dry_run=false
1465 opt_config=false
1466 opt_preserve_dup_deps=false
1467 opt_features=false
1468 opt_finish=false
1469 opt_help=false
1470 opt_help_all=false
1471 opt_silent=:
1472 opt_warning=:
1473 opt_verbose=:
1474 opt_silent=false
1475 opt_verbose=false
1476
1477
1478 # Parse options once, thoroughly. This comes as soon as possible in the
1479 # script to make things like `--version' happen as quickly as we can.
1480 {
1481 # this just eases exit handling
1482 while test $# -gt 0; do
1483 opt="$1"
1484 shift
1485 case $opt in
1486 --debug|-x) opt_debug='set -x'
1487 func_echo "enabling shell trace mode"
1488 $opt_debug
1489 ;;
1490 --dry-run|--dryrun|-n)
1491 opt_dry_run=:
1492 ;;
1493 --config)
1494 opt_config=:
1495 func_config
1496 ;;
1497 --dlopen|-dlopen)
1498 optarg="$1"
1499 opt_dlopen="${opt_dlopen+$opt_dlopen
1500 }$optarg"
1501 shift
1502 ;;
1503 --preserve-dup-deps)
1504 opt_preserve_dup_deps=:
1505 ;;
1506 --features)
1507 opt_features=:
1508 func_features
1509 ;;
1510 --finish)
1511 opt_finish=:
1512 set dummy --mode finish ${1+"$@"}; shift
1513 ;;
1514 --help)
1515 opt_help=:
1516 ;;
1517 --help-all)
1518 opt_help_all=:
1519 opt_help=': help-all'
1520 ;;
1521 --mode)
1522 test $# = 0 && func_missing_arg $opt && break
1523 optarg="$1"
1524 opt_mode="$optarg"
1525 case $optarg in
1526 # Valid mode arguments:
1527 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1528
1529 # Catch anything else as an error
1530 *) func_error "invalid argument for $opt"
1531 exit_cmd=exit
1532 break
1533 ;;
1534 esac
1535 shift
1536 ;;
1537 --no-silent|--no-quiet)
1538 opt_silent=false
1539 preserve_args+=" $opt"
1540 ;;
1541 --no-warning|--no-warn)
1542 opt_warning=false
1543 preserve_args+=" $opt"
1544 ;;
1545 --no-verbose)
1546 opt_verbose=false
1547 preserve_args+=" $opt"
1548 ;;
1549 --silent|--quiet)
1550 opt_silent=:
1551 preserve_args+=" $opt"
1552 opt_verbose=false
1553 ;;
1554 --verbose|-v)
1555 opt_verbose=:
1556 preserve_args+=" $opt"
1557 opt_silent=false
1558 ;;
1559 --tag)
1560 test $# = 0 && func_missing_arg $opt && break
1561 optarg="$1"
1562 opt_tag="$optarg"
1563 preserve_args+=" $opt $optarg"
1564 func_enable_tag "$optarg"
1565 shift
1566 ;;
1567
1568 -\?|-h) func_usage ;;
1569 --help) func_help ;;
1570 --version) func_version ;;
1571
1572 # Separate optargs to long options:
1573 --*=*)
1574 func_split_long_opt "$opt"
1575 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1576 shift
1577 ;;
1578
1579 # Separate non-argument short options:
1580 -\?*|-h*|-n*|-v*)
1581 func_split_short_opt "$opt"
1582 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1583 shift
1584 ;;
1585
1586 --) break ;;
1587 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1588 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1589 esac
1590 done
1591
1592 # Validate options:
1593
1594 # save first non-option argument
1595 if test "$#" -gt 0; then
1596 nonopt="$opt"
1597 shift
1598 fi
1599
1600 # preserve --debug
1601 test "$opt_debug" = : || preserve_args+=" --debug"
1602
1603 case $host in
1604 *cygwin* | *mingw* | *pw32* | *cegcc*)
1605 # don't eliminate duplications in $postdeps and $predeps
1606 opt_duplicate_compiler_generated_deps=:
27741607 ;;
2775 compile|compil|compi|comp|com|co|c)
2776 shift; set dummy --mode compile ${1+"$@"}; shift
1608 *)
1609 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
27771610 ;;
2778 execute|execut|execu|exec|exe|ex|e)
2779 shift; set dummy --mode execute ${1+"$@"}; shift
2780 ;;
2781 finish|finis|fini|fin|fi|f)
2782 shift; set dummy --mode finish ${1+"$@"}; shift
2783 ;;
2784 install|instal|insta|inst|ins|in|i)
2785 shift; set dummy --mode install ${1+"$@"}; shift
2786 ;;
2787 link|lin|li|l)
2788 shift; set dummy --mode link ${1+"$@"}; shift
2789 ;;
2790 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2791 shift; set dummy --mode uninstall ${1+"$@"}; shift
2792 ;;
2793 esac
2794
2795 # Pass back the list of options.
2796 func_quote_for_eval ${1+"$@"}
2797 libtool_options_prep_result=$func_quote_for_eval_result
2798 }
2799 func_add_hook func_options_prep libtool_options_prep
2800
2801
2802 # libtool_parse_options [ARG]...
2803 # ---------------------------------
2804 # Provide handling for libtool specific options.
2805 libtool_parse_options ()
2806 {
2807 $debug_cmd
2808
2809 # Perform our own loop to consume as many options as possible in
2810 # each iteration.
2811 while test $# -gt 0; do
2812 _G_opt=$1
2813 shift
2814 case $_G_opt in
2815 --dry-run|--dryrun|-n)
2816 opt_dry_run=:
2817 ;;
2818
2819 --config) func_config ;;
2820
2821 --dlopen|-dlopen)
2822 opt_dlopen="${opt_dlopen+$opt_dlopen
2823 }$1"
2824 shift
2825 ;;
2826
2827 --preserve-dup-deps)
2828 opt_preserve_dup_deps=: ;;
2829
2830 --features) func_features ;;
2831
2832 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2833
2834 --help) opt_help=: ;;
2835
2836 --help-all) opt_help=': help-all' ;;
2837
2838 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2839 opt_mode=$1
2840 case $1 in
2841 # Valid mode arguments:
2842 clean|compile|execute|finish|install|link|relink|uninstall) ;;
2843
2844 # Catch anything else as an error
2845 *) func_error "invalid argument for $_G_opt"
2846 exit_cmd=exit
2847 break
2848 ;;
2849 esac
2850 shift
2851 ;;
2852
2853 --no-silent|--no-quiet)
2854 opt_quiet=false
2855 func_append preserve_args " $_G_opt"
2856 ;;
2857
2858 --no-warnings|--no-warning|--no-warn)
2859 opt_warning=false
2860 func_append preserve_args " $_G_opt"
2861 ;;
2862
2863 --no-verbose)
2864 opt_verbose=false
2865 func_append preserve_args " $_G_opt"
2866 ;;
2867
2868 --silent|--quiet)
2869 opt_quiet=:
2870 opt_verbose=false
2871 func_append preserve_args " $_G_opt"
2872 ;;
2873
2874 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2875 opt_tag=$1
2876 func_append preserve_args " $_G_opt $1"
2877 func_enable_tag "$1"
2878 shift
2879 ;;
2880
2881 --verbose|-v) opt_quiet=false
2882 opt_verbose=:
2883 func_append preserve_args " $_G_opt"
2884 ;;
2885
2886 # An option not handled by this hook function:
2887 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2888 esac
2889 done
2890
2891
2892 # save modified positional parameters for caller
2893 func_quote_for_eval ${1+"$@"}
2894 libtool_parse_options_result=$func_quote_for_eval_result
2895 }
2896 func_add_hook func_parse_options libtool_parse_options
2897
2898
2899
2900 # libtool_validate_options [ARG]...
2901 # ---------------------------------
2902 # Perform any sanity checks on option settings and/or unconsumed
2903 # arguments.
2904 libtool_validate_options ()
2905 {
2906 # save first non-option argument
2907 if test 0 -lt $#; then
2908 nonopt=$1
2909 shift
1611 esac
1612
1613 $opt_help || {
1614 # Sanity checks first:
1615 func_check_version_match
1616
1617 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1618 func_fatal_configuration "not configured to build any kind of library"
29101619 fi
29111620
2912 # preserve --debug
2913 test : = "$debug_cmd" || func_append preserve_args " --debug"
2914
2915 case $host in
2916 # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2917 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2918 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2919 # don't eliminate duplications in $postdeps and $predeps
2920 opt_duplicate_compiler_generated_deps=:
2921 ;;
2922 *)
2923 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2924 ;;
2925 esac
2926
2927 $opt_help || {
2928 # Sanity checks first:
2929 func_check_version_match
2930
2931 test yes != "$build_libtool_libs" \
2932 && test yes != "$build_old_libs" \
2933 && func_fatal_configuration "not configured to build any kind of library"
2934
2935 # Darwin sucks
2936 eval std_shrext=\"$shrext_cmds\"
2937
2938 # Only execute mode is allowed to have -dlopen flags.
2939 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2940 func_error "unrecognized option '-dlopen'"
2941 $ECHO "$help" 1>&2
2942 exit $EXIT_FAILURE
2943 fi
2944
2945 # Change the help message to a mode-specific one.
2946 generic_help=$help
2947 help="Try '$progname --help --mode=$opt_mode' for more information."
2948 }
2949
2950 # Pass back the unparsed argument list
2951 func_quote_for_eval ${1+"$@"}
2952 libtool_validate_options_result=$func_quote_for_eval_result
2953 }
2954 func_add_hook func_validate_options libtool_validate_options
2955
2956
2957 # Process options as early as possible so that --help and --version
2958 # can return quickly.
2959 func_options ${1+"$@"}
2960 eval set dummy "$func_options_result"; shift
1621 # Darwin sucks
1622 eval std_shrext=\"$shrext_cmds\"
1623
1624 # Only execute mode is allowed to have -dlopen flags.
1625 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1626 func_error "unrecognized option \`-dlopen'"
1627 $ECHO "$help" 1>&2
1628 exit $EXIT_FAILURE
1629 fi
1630
1631 # Change the help message to a mode-specific one.
1632 generic_help="$help"
1633 help="Try \`$progname --help --mode=$opt_mode' for more information."
1634 }
1635
1636
1637 # Bail if the options were screwed
1638 $exit_cmd $EXIT_FAILURE
1639 }
1640
29611641
29621642
29631643
29651645 ## Main. ##
29661646 ## ----------- ##
29671647
2968 magic='%%%MAGIC variable%%%'
2969 magic_exe='%%%MAGIC EXE variable%%%'
2970
2971 # Global variables.
2972 extracted_archives=
2973 extracted_serial=0
2974
2975 # If this variable is set in any of the actions, the command in it
2976 # will be execed at the end. This prevents here-documents from being
2977 # left over by shells.
2978 exec_cmd=
2979
2980
2981 # A function that is used when there is no print builtin or printf.
2982 func_fallback_echo ()
2983 {
2984 eval 'cat <<_LTECHO_EOF
2985 $1
2986 _LTECHO_EOF'
2987 }
2988
2989 # func_generated_by_libtool
2990 # True iff stdin has been generated by Libtool. This function is only
2991 # a basic sanity check; it will hardly flush out determined imposters.
2992 func_generated_by_libtool_p ()
2993 {
2994 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2995 }
2996
29971648 # func_lalib_p file
2998 # True iff FILE is a libtool '.la' library or '.lo' object file.
1649 # True iff FILE is a libtool `.la' library or `.lo' object file.
29991650 # This function is only a basic sanity check; it will hardly flush out
30001651 # determined imposters.
30011652 func_lalib_p ()
30021653 {
30031654 test -f "$1" &&
3004 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
1655 $SED -e 4q "$1" 2>/dev/null \
1656 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
30051657 }
30061658
30071659 # func_lalib_unsafe_p file
3008 # True iff FILE is a libtool '.la' library or '.lo' object file.
1660 # True iff FILE is a libtool `.la' library or `.lo' object file.
30091661 # This function implements the same check as func_lalib_p without
30101662 # resorting to external programs. To this end, it redirects stdin and
30111663 # closes it afterwards, without saving the original file descriptor.
30121664 # As a safety measure, use it only where a negative result would be
3013 # fatal anyway. Works if 'file' does not exist.
1665 # fatal anyway. Works if `file' does not exist.
30141666 func_lalib_unsafe_p ()
30151667 {
30161668 lalib_p=no
30181670 for lalib_p_l in 1 2 3 4
30191671 do
30201672 read lalib_p_line
3021 case $lalib_p_line in
1673 case "$lalib_p_line" in
30221674 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
30231675 esac
30241676 done
30251677 exec 0<&5 5<&-
30261678 fi
3027 test yes = "$lalib_p"
1679 test "$lalib_p" = yes
30281680 }
30291681
30301682 # func_ltwrapper_script_p file
30331685 # determined imposters.
30341686 func_ltwrapper_script_p ()
30351687 {
3036 test -f "$1" &&
3037 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
1688 func_lalib_p "$1"
30381689 }
30391690
30401691 # func_ltwrapper_executable_p file
30591710 {
30601711 func_dirname_and_basename "$1" "" "."
30611712 func_stripname '' '.exe' "$func_basename_result"
3062 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
1713 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
30631714 }
30641715
30651716 # func_ltwrapper_p file
30781729 # FAIL_CMD may read-access the current command in variable CMD!
30791730 func_execute_cmds ()
30801731 {
3081 $debug_cmd
3082
1732 $opt_debug
30831733 save_ifs=$IFS; IFS='~'
30841734 for cmd in $1; do
3085 IFS=$sp$nl
1735 IFS=$save_ifs
30861736 eval cmd=\"$cmd\"
3087 IFS=$save_ifs
30881737 func_show_eval "$cmd" "${2-:}"
30891738 done
30901739 IFS=$save_ifs
30961745 # Note that it is not necessary on cygwin/mingw to append a dot to
30971746 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
30981747 # behavior happens only for exec(3), not for open(2)! Also, sourcing
3099 # 'FILE.' does not work on cygwin managed mounts.
1748 # `FILE.' does not work on cygwin managed mounts.
31001749 func_source ()
31011750 {
3102 $debug_cmd
3103
1751 $opt_debug
31041752 case $1 in
31051753 */* | *\\*) . "$1" ;;
31061754 *) . "./$1" ;;
31271775 # store the result into func_replace_sysroot_result.
31281776 func_replace_sysroot ()
31291777 {
3130 case $lt_sysroot:$1 in
1778 case "$lt_sysroot:$1" in
31311779 ?*:"$lt_sysroot"*)
31321780 func_stripname "$lt_sysroot" '' "$1"
3133 func_replace_sysroot_result='='$func_stripname_result
1781 func_replace_sysroot_result="=$func_stripname_result"
31341782 ;;
31351783 *)
31361784 # Including no sysroot.
31471795 # arg is usually of the form 'gcc ...'
31481796 func_infer_tag ()
31491797 {
3150 $debug_cmd
3151
1798 $opt_debug
31521799 if test -n "$available_tags" && test -z "$tagname"; then
31531800 CC_quoted=
31541801 for arg in $CC; do
31671814 for z in $available_tags; do
31681815 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
31691816 # Evaluate the configuration.
3170 eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1817 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
31711818 CC_quoted=
31721819 for arg in $CC; do
31731820 # Double-quote args containing other shell metacharacters.
31921839 # line option must be used.
31931840 if test -z "$tagname"; then
31941841 func_echo "unable to infer tagged configuration"
3195 func_fatal_error "specify a tag with '--tag'"
1842 func_fatal_error "specify a tag with \`--tag'"
31961843 # else
31971844 # func_verbose "using $tagname tagged configuration"
31981845 fi
32081855 # but don't create it if we're doing a dry run.
32091856 func_write_libtool_object ()
32101857 {
3211 write_libobj=$1
3212 if test yes = "$build_libtool_libs"; then
3213 write_lobj=\'$2\'
1858 write_libobj=${1}
1859 if test "$build_libtool_libs" = yes; then
1860 write_lobj=\'${2}\'
32141861 else
32151862 write_lobj=none
32161863 fi
32171864
3218 if test yes = "$build_old_libs"; then
3219 write_oldobj=\'$3\'
1865 if test "$build_old_libs" = yes; then
1866 write_oldobj=\'${3}\'
32201867 else
32211868 write_oldobj=none
32221869 fi
32241871 $opt_dry_run || {
32251872 cat >${write_libobj}T <<EOF
32261873 # $write_libobj - a libtool object file
3227 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
1874 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
32281875 #
32291876 # Please DO NOT delete this file!
32301877 # It is necessary for linking the library.
32361883 non_pic_object=$write_oldobj
32371884
32381885 EOF
3239 $MV "${write_libobj}T" "$write_libobj"
1886 $MV "${write_libobj}T" "${write_libobj}"
32401887 }
32411888 }
32421889
32561903 # be empty on error (or when ARG is empty)
32571904 func_convert_core_file_wine_to_w32 ()
32581905 {
3259 $debug_cmd
3260
3261 func_convert_core_file_wine_to_w32_result=$1
1906 $opt_debug
1907 func_convert_core_file_wine_to_w32_result="$1"
32621908 if test -n "$1"; then
32631909 # Unfortunately, winepath does not exit with a non-zero error code, so we
32641910 # are forced to check the contents of stdout. On the other hand, if the
32661912 # *an error message* to stdout. So we must check for both error code of
32671913 # zero AND non-empty stdout, which explains the odd construction:
32681914 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
3269 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
1915 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
32701916 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
3271 $SED -e "$sed_naive_backslashify"`
1917 $SED -e "$lt_sed_naive_backslashify"`
32721918 else
32731919 func_convert_core_file_wine_to_w32_result=
32741920 fi
32891935 # are convertible, then the result may be empty.
32901936 func_convert_core_path_wine_to_w32 ()
32911937 {
3292 $debug_cmd
3293
1938 $opt_debug
32941939 # unfortunately, winepath doesn't convert paths, only file names
3295 func_convert_core_path_wine_to_w32_result=
1940 func_convert_core_path_wine_to_w32_result=""
32961941 if test -n "$1"; then
32971942 oldIFS=$IFS
32981943 IFS=:
32991944 for func_convert_core_path_wine_to_w32_f in $1; do
33001945 IFS=$oldIFS
33011946 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
3302 if test -n "$func_convert_core_file_wine_to_w32_result"; then
1947 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
33031948 if test -z "$func_convert_core_path_wine_to_w32_result"; then
3304 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
1949 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
33051950 else
33061951 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
33071952 fi
33301975 # environment variable; do not put it in $PATH.
33311976 func_cygpath ()
33321977 {
3333 $debug_cmd
3334
1978 $opt_debug
33351979 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
33361980 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
33371981 if test "$?" -ne 0; then
33401984 fi
33411985 else
33421986 func_cygpath_result=
3343 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
1987 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
33441988 fi
33451989 }
33461990 #end: func_cygpath
33511995 # result in func_convert_core_msys_to_w32_result.
33521996 func_convert_core_msys_to_w32 ()
33531997 {
3354 $debug_cmd
3355
1998 $opt_debug
33561999 # awkward: cmd appends spaces to result
33572000 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
3358 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
2001 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
33592002 }
33602003 #end: func_convert_core_msys_to_w32
33612004
33662009 # func_to_host_file_result to ARG1).
33672010 func_convert_file_check ()
33682011 {
3369 $debug_cmd
3370
3371 if test -z "$2" && test -n "$1"; then
2012 $opt_debug
2013 if test -z "$2" && test -n "$1" ; then
33722014 func_error "Could not determine host file name corresponding to"
3373 func_error " '$1'"
2015 func_error " \`$1'"
33742016 func_error "Continuing, but uninstalled executables may not work."
33752017 # Fallback:
3376 func_to_host_file_result=$1
2018 func_to_host_file_result="$1"
33772019 fi
33782020 }
33792021 # end func_convert_file_check
33852027 # func_to_host_file_result to a simplistic fallback value (see below).
33862028 func_convert_path_check ()
33872029 {
3388 $debug_cmd
3389
2030 $opt_debug
33902031 if test -z "$4" && test -n "$3"; then
33912032 func_error "Could not determine the host path corresponding to"
3392 func_error " '$3'"
2033 func_error " \`$3'"
33932034 func_error "Continuing, but uninstalled executables may not work."
33942035 # Fallback. This is a deliberately simplistic "conversion" and
33952036 # should not be "improved". See libtool.info.
33982039 func_to_host_path_result=`echo "$3" |
33992040 $SED -e "$lt_replace_pathsep_chars"`
34002041 else
3401 func_to_host_path_result=$3
2042 func_to_host_path_result="$3"
34022043 fi
34032044 fi
34042045 }
34102051 # and appending REPL if ORIG matches BACKPAT.
34112052 func_convert_path_front_back_pathsep ()
34122053 {
3413 $debug_cmd
3414
2054 $opt_debug
34152055 case $4 in
3416 $1 ) func_to_host_path_result=$3$func_to_host_path_result
2056 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
34172057 ;;
34182058 esac
34192059 case $4 in
3420 $2 ) func_append func_to_host_path_result "$3"
2060 $2 ) func_to_host_path_result+="$3"
34212061 ;;
34222062 esac
34232063 }
34272067 ##################################################
34282068 # $build to $host FILE NAME CONVERSION FUNCTIONS #
34292069 ##################################################
3430 # invoked via '$to_host_file_cmd ARG'
2070 # invoked via `$to_host_file_cmd ARG'
34312071 #
34322072 # In each case, ARG is the path to be converted from $build to $host format.
34332073 # Result will be available in $func_to_host_file_result.
34382078 # in func_to_host_file_result.
34392079 func_to_host_file ()
34402080 {
3441 $debug_cmd
3442
2081 $opt_debug
34432082 $to_host_file_cmd "$1"
34442083 }
34452084 # end func_to_host_file
34512090 # in (the comma separated) LAZY, no conversion takes place.
34522091 func_to_tool_file ()
34532092 {
3454 $debug_cmd
3455
2093 $opt_debug
34562094 case ,$2, in
34572095 *,"$to_tool_file_cmd",*)
34582096 func_to_tool_file_result=$1
34702108 # Copy ARG to func_to_host_file_result.
34712109 func_convert_file_noop ()
34722110 {
3473 func_to_host_file_result=$1
2111 func_to_host_file_result="$1"
34742112 }
34752113 # end func_convert_file_noop
34762114
34812119 # func_to_host_file_result.
34822120 func_convert_file_msys_to_w32 ()
34832121 {
3484 $debug_cmd
3485
3486 func_to_host_file_result=$1
2122 $opt_debug
2123 func_to_host_file_result="$1"
34872124 if test -n "$1"; then
34882125 func_convert_core_msys_to_w32 "$1"
3489 func_to_host_file_result=$func_convert_core_msys_to_w32_result
2126 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
34902127 fi
34912128 func_convert_file_check "$1" "$func_to_host_file_result"
34922129 }
34982135 # func_to_host_file_result.
34992136 func_convert_file_cygwin_to_w32 ()
35002137 {
3501 $debug_cmd
3502
3503 func_to_host_file_result=$1
2138 $opt_debug
2139 func_to_host_file_result="$1"
35042140 if test -n "$1"; then
35052141 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
35062142 # LT_CYGPATH in this case.
35162152 # and a working winepath. Returns result in func_to_host_file_result.
35172153 func_convert_file_nix_to_w32 ()
35182154 {
3519 $debug_cmd
3520
3521 func_to_host_file_result=$1
2155 $opt_debug
2156 func_to_host_file_result="$1"
35222157 if test -n "$1"; then
35232158 func_convert_core_file_wine_to_w32 "$1"
3524 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
2159 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
35252160 fi
35262161 func_convert_file_check "$1" "$func_to_host_file_result"
35272162 }
35332168 # Returns result in func_to_host_file_result.
35342169 func_convert_file_msys_to_cygwin ()
35352170 {
3536 $debug_cmd
3537
3538 func_to_host_file_result=$1
2171 $opt_debug
2172 func_to_host_file_result="$1"
35392173 if test -n "$1"; then
35402174 func_convert_core_msys_to_w32 "$1"
35412175 func_cygpath -u "$func_convert_core_msys_to_w32_result"
3542 func_to_host_file_result=$func_cygpath_result
2176 func_to_host_file_result="$func_cygpath_result"
35432177 fi
35442178 func_convert_file_check "$1" "$func_to_host_file_result"
35452179 }
35522186 # in func_to_host_file_result.
35532187 func_convert_file_nix_to_cygwin ()
35542188 {
3555 $debug_cmd
3556
3557 func_to_host_file_result=$1
2189 $opt_debug
2190 func_to_host_file_result="$1"
35582191 if test -n "$1"; then
35592192 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
35602193 func_convert_core_file_wine_to_w32 "$1"
35612194 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3562 func_to_host_file_result=$func_cygpath_result
2195 func_to_host_file_result="$func_cygpath_result"
35632196 fi
35642197 func_convert_file_check "$1" "$func_to_host_file_result"
35652198 }
35692202 #############################################
35702203 # $build to $host PATH CONVERSION FUNCTIONS #
35712204 #############################################
3572 # invoked via '$to_host_path_cmd ARG'
2205 # invoked via `$to_host_path_cmd ARG'
35732206 #
35742207 # In each case, ARG is the path to be converted from $build to $host format.
35752208 # The result will be available in $func_to_host_path_result.
35932226 to_host_path_cmd=
35942227 func_init_to_host_path_cmd ()
35952228 {
3596 $debug_cmd
3597
2229 $opt_debug
35982230 if test -z "$to_host_path_cmd"; then
35992231 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3600 to_host_path_cmd=func_convert_path_$func_stripname_result
2232 to_host_path_cmd="func_convert_path_${func_stripname_result}"
36012233 fi
36022234 }
36032235
36072239 # in func_to_host_path_result.
36082240 func_to_host_path ()
36092241 {
3610 $debug_cmd
3611
2242 $opt_debug
36122243 func_init_to_host_path_cmd
36132244 $to_host_path_cmd "$1"
36142245 }
36192250 # Copy ARG to func_to_host_path_result.
36202251 func_convert_path_noop ()
36212252 {
3622 func_to_host_path_result=$1
2253 func_to_host_path_result="$1"
36232254 }
36242255 # end func_convert_path_noop
36252256
36302261 # func_to_host_path_result.
36312262 func_convert_path_msys_to_w32 ()
36322263 {
3633 $debug_cmd
3634
3635 func_to_host_path_result=$1
2264 $opt_debug
2265 func_to_host_path_result="$1"
36362266 if test -n "$1"; then
36372267 # Remove leading and trailing path separator characters from ARG. MSYS
36382268 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
36402270 func_stripname : : "$1"
36412271 func_to_host_path_tmp1=$func_stripname_result
36422272 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3643 func_to_host_path_result=$func_convert_core_msys_to_w32_result
2273 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
36442274 func_convert_path_check : ";" \
36452275 "$func_to_host_path_tmp1" "$func_to_host_path_result"
36462276 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
36542284 # func_to_host_file_result.
36552285 func_convert_path_cygwin_to_w32 ()
36562286 {
3657 $debug_cmd
3658
3659 func_to_host_path_result=$1
2287 $opt_debug
2288 func_to_host_path_result="$1"
36602289 if test -n "$1"; then
36612290 # See func_convert_path_msys_to_w32:
36622291 func_stripname : : "$1"
36752304 # a working winepath. Returns result in func_to_host_file_result.
36762305 func_convert_path_nix_to_w32 ()
36772306 {
3678 $debug_cmd
3679
3680 func_to_host_path_result=$1
2307 $opt_debug
2308 func_to_host_path_result="$1"
36812309 if test -n "$1"; then
36822310 # See func_convert_path_msys_to_w32:
36832311 func_stripname : : "$1"
36842312 func_to_host_path_tmp1=$func_stripname_result
36852313 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3686 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
2314 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
36872315 func_convert_path_check : ";" \
36882316 "$func_to_host_path_tmp1" "$func_to_host_path_result"
36892317 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
36972325 # Returns result in func_to_host_file_result.
36982326 func_convert_path_msys_to_cygwin ()
36992327 {
3700 $debug_cmd
3701
3702 func_to_host_path_result=$1
2328 $opt_debug
2329 func_to_host_path_result="$1"
37032330 if test -n "$1"; then
37042331 # See func_convert_path_msys_to_w32:
37052332 func_stripname : : "$1"
37062333 func_to_host_path_tmp1=$func_stripname_result
37072334 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
37082335 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3709 func_to_host_path_result=$func_cygpath_result
2336 func_to_host_path_result="$func_cygpath_result"
37102337 func_convert_path_check : : \
37112338 "$func_to_host_path_tmp1" "$func_to_host_path_result"
37122339 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
37212348 # func_to_host_file_result.
37222349 func_convert_path_nix_to_cygwin ()
37232350 {
3724 $debug_cmd
3725
3726 func_to_host_path_result=$1
2351 $opt_debug
2352 func_to_host_path_result="$1"
37272353 if test -n "$1"; then
37282354 # Remove leading and trailing path separator characters from
37292355 # ARG. msys behavior is inconsistent here, cygpath turns them
37322358 func_to_host_path_tmp1=$func_stripname_result
37332359 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
37342360 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3735 func_to_host_path_result=$func_cygpath_result
2361 func_to_host_path_result="$func_cygpath_result"
37362362 func_convert_path_check : : \
37372363 "$func_to_host_path_tmp1" "$func_to_host_path_result"
37382364 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
37412367 # end func_convert_path_nix_to_cygwin
37422368
37432369
3744 # func_dll_def_p FILE
3745 # True iff FILE is a Windows DLL '.def' file.
3746 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3747 func_dll_def_p ()
3748 {
3749 $debug_cmd
3750
3751 func_dll_def_p_tmp=`$SED -n \
3752 -e 's/^[ ]*//' \
3753 -e '/^\(;.*\)*$/d' \
3754 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3755 -e q \
3756 "$1"`
3757 test DEF = "$func_dll_def_p_tmp"
3758 }
3759
3760
37612370 # func_mode_compile arg...
37622371 func_mode_compile ()
37632372 {
3764 $debug_cmd
3765
2373 $opt_debug
37662374 # Get the compilation command and the source file.
37672375 base_compile=
3768 srcfile=$nonopt # always keep a non-empty value in "srcfile"
2376 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
37692377 suppress_opt=yes
37702378 suppress_output=
37712379 arg_mode=normal
37782386 case $arg_mode in
37792387 arg )
37802388 # do not "continue". Instead, add this to base_compile
3781 lastarg=$arg
2389 lastarg="$arg"
37822390 arg_mode=normal
37832391 ;;
37842392
37852393 target )
3786 libobj=$arg
2394 libobj="$arg"
37872395 arg_mode=normal
37882396 continue
37892397 ;;
37932401 case $arg in
37942402 -o)
37952403 test -n "$libobj" && \
3796 func_fatal_error "you cannot specify '-o' more than once"
2404 func_fatal_error "you cannot specify \`-o' more than once"
37972405 arg_mode=target
37982406 continue
37992407 ;;
38002408
38012409 -pie | -fpie | -fPIE)
3802 func_append pie_flag " $arg"
2410 pie_flag+=" $arg"
38032411 continue
38042412 ;;
38052413
38062414 -shared | -static | -prefer-pic | -prefer-non-pic)
3807 func_append later " $arg"
2415 later+=" $arg"
38082416 continue
38092417 ;;
38102418
38222430 func_stripname '-Wc,' '' "$arg"
38232431 args=$func_stripname_result
38242432 lastarg=
3825 save_ifs=$IFS; IFS=,
2433 save_ifs="$IFS"; IFS=','
38262434 for arg in $args; do
3827 IFS=$save_ifs
2435 IFS="$save_ifs"
38282436 func_append_quoted lastarg "$arg"
38292437 done
3830 IFS=$save_ifs
2438 IFS="$save_ifs"
38312439 func_stripname ' ' '' "$lastarg"
38322440 lastarg=$func_stripname_result
38332441
38342442 # Add the arguments to base_compile.
3835 func_append base_compile " $lastarg"
2443 base_compile+=" $lastarg"
38362444 continue
38372445 ;;
38382446
38402448 # Accept the current argument as the source file.
38412449 # The previous "srcfile" becomes the current argument.
38422450 #
3843 lastarg=$srcfile
3844 srcfile=$arg
2451 lastarg="$srcfile"
2452 srcfile="$arg"
38452453 ;;
38462454 esac # case $arg
38472455 ;;
38562464 func_fatal_error "you must specify an argument for -Xcompile"
38572465 ;;
38582466 target)
3859 func_fatal_error "you must specify a target with '-o'"
2467 func_fatal_error "you must specify a target with \`-o'"
38602468 ;;
38612469 *)
38622470 # Get the name of the library object.
38632471 test -z "$libobj" && {
38642472 func_basename "$srcfile"
3865 libobj=$func_basename_result
2473 libobj="$func_basename_result"
38662474 }
38672475 ;;
38682476 esac
38822490 case $libobj in
38832491 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
38842492 *)
3885 func_fatal_error "cannot determine name of library object from '$libobj'"
2493 func_fatal_error "cannot determine name of library object from \`$libobj'"
38862494 ;;
38872495 esac
38882496
38912499 for arg in $later; do
38922500 case $arg in
38932501 -shared)
3894 test yes = "$build_libtool_libs" \
3895 || func_fatal_configuration "cannot build a shared library"
2502 test "$build_libtool_libs" != yes && \
2503 func_fatal_configuration "can not build a shared library"
38962504 build_old_libs=no
38972505 continue
38982506 ;;
39182526 func_quote_for_eval "$libobj"
39192527 test "X$libobj" != "X$func_quote_for_eval_result" \
39202528 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
3921 && func_warning "libobj name '$libobj' may not contain shell special characters."
2529 && func_warning "libobj name \`$libobj' may not contain shell special characters."
39222530 func_dirname_and_basename "$obj" "/" ""
3923 objname=$func_basename_result
3924 xdir=$func_dirname_result
3925 lobj=$xdir$objdir/$objname
2531 objname="$func_basename_result"
2532 xdir="$func_dirname_result"
2533 lobj=${xdir}$objdir/$objname
39262534
39272535 test -z "$base_compile" && \
39282536 func_fatal_help "you must specify a compilation command"
39292537
39302538 # Delete any leftover library objects.
3931 if test yes = "$build_old_libs"; then
2539 if test "$build_old_libs" = yes; then
39322540 removelist="$obj $lobj $libobj ${libobj}T"
39332541 else
39342542 removelist="$lobj $libobj ${libobj}T"
39402548 pic_mode=default
39412549 ;;
39422550 esac
3943 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
2551 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
39442552 # non-PIC code in shared libraries is not supported
39452553 pic_mode=default
39462554 fi
39472555
39482556 # Calculate the filename of the output object if compiler does
39492557 # not support -o with -c
3950 if test no = "$compiler_c_o"; then
3951 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3952 lockfile=$output_obj.lock
2558 if test "$compiler_c_o" = no; then
2559 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2560 lockfile="$output_obj.lock"
39532561 else
39542562 output_obj=
39552563 need_locks=no
39582566
39592567 # Lock this critical section if it is needed
39602568 # We use this script file to make the link, it avoids creating a new file
3961 if test yes = "$need_locks"; then
2569 if test "$need_locks" = yes; then
39622570 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
39632571 func_echo "Waiting for $lockfile to be removed"
39642572 sleep 2
39652573 done
3966 elif test warn = "$need_locks"; then
2574 elif test "$need_locks" = warn; then
39672575 if test -f "$lockfile"; then
39682576 $ECHO "\
39692577 *** ERROR, $lockfile exists and contains:
39712579
39722580 This indicates that another process is trying to use the same
39732581 temporary object file, and libtool could not work around it because
3974 your compiler does not support '-c' and '-o' together. If you
2582 your compiler does not support \`-c' and \`-o' together. If you
39752583 repeat this compilation, it may succeed, by chance, but you had better
39762584 avoid parallel builds (make -j) in this platform, or get a better
39772585 compiler."
39792587 $opt_dry_run || $RM $removelist
39802588 exit $EXIT_FAILURE
39812589 fi
3982 func_append removelist " $output_obj"
2590 removelist+=" $output_obj"
39832591 $ECHO "$srcfile" > "$lockfile"
39842592 fi
39852593
39862594 $opt_dry_run || $RM $removelist
3987 func_append removelist " $lockfile"
2595 removelist+=" $lockfile"
39882596 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
39892597
39902598 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
39932601 qsrcfile=$func_quote_for_eval_result
39942602
39952603 # Only build a PIC object if we are building libtool libraries.
3996 if test yes = "$build_libtool_libs"; then
2604 if test "$build_libtool_libs" = yes; then
39972605 # Without this assignment, base_compile gets emptied.
39982606 fbsd_hideous_sh_bug=$base_compile
39992607
4000 if test no != "$pic_mode"; then
2608 if test "$pic_mode" != no; then
40012609 command="$base_compile $qsrcfile $pic_flag"
40022610 else
40032611 # Don't build PIC code
40082616
40092617 if test -z "$output_obj"; then
40102618 # Place PIC objects in $objdir
4011 func_append command " -o $lobj"
2619 command+=" -o $lobj"
40122620 fi
40132621
40142622 func_show_eval_locale "$command" \
40152623 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
40162624
4017 if test warn = "$need_locks" &&
2625 if test "$need_locks" = warn &&
40182626 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
40192627 $ECHO "\
40202628 *** ERROR, $lockfile contains:
40252633
40262634 This indicates that another process is trying to use the same
40272635 temporary object file, and libtool could not work around it because
4028 your compiler does not support '-c' and '-o' together. If you
2636 your compiler does not support \`-c' and \`-o' together. If you
40292637 repeat this compilation, it may succeed, by chance, but you had better
40302638 avoid parallel builds (make -j) in this platform, or get a better
40312639 compiler."
40412649 fi
40422650
40432651 # Allow error messages only from the first compilation.
4044 if test yes = "$suppress_opt"; then
2652 if test "$suppress_opt" = yes; then
40452653 suppress_output=' >/dev/null 2>&1'
40462654 fi
40472655 fi
40482656
40492657 # Only build a position-dependent object if we build old libraries.
4050 if test yes = "$build_old_libs"; then
4051 if test yes != "$pic_mode"; then
2658 if test "$build_old_libs" = yes; then
2659 if test "$pic_mode" != yes; then
40522660 # Don't build PIC code
40532661 command="$base_compile $qsrcfile$pie_flag"
40542662 else
40552663 command="$base_compile $qsrcfile $pic_flag"
40562664 fi
4057 if test yes = "$compiler_c_o"; then
4058 func_append command " -o $obj"
2665 if test "$compiler_c_o" = yes; then
2666 command+=" -o $obj"
40592667 fi
40602668
40612669 # Suppress compiler output if we already did a PIC compilation.
4062 func_append command "$suppress_output"
2670 command+="$suppress_output"
40632671 func_show_eval_locale "$command" \
40642672 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
40652673
4066 if test warn = "$need_locks" &&
2674 if test "$need_locks" = warn &&
40672675 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
40682676 $ECHO "\
40692677 *** ERROR, $lockfile contains:
40742682
40752683 This indicates that another process is trying to use the same
40762684 temporary object file, and libtool could not work around it because
4077 your compiler does not support '-c' and '-o' together. If you
2685 your compiler does not support \`-c' and \`-o' together. If you
40782686 repeat this compilation, it may succeed, by chance, but you had better
40792687 avoid parallel builds (make -j) in this platform, or get a better
40802688 compiler."
40942702 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
40952703
40962704 # Unlock the critical section if it was locked
4097 if test no != "$need_locks"; then
2705 if test "$need_locks" != no; then
40982706 removelist=$lockfile
40992707 $RM "$lockfile"
41002708 fi
41042712 }
41052713
41062714 $opt_help || {
4107 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
2715 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
41082716 }
41092717
41102718 func_mode_help ()
41242732 Remove files from the build directory.
41252733
41262734 RM is the name of the program to use to delete files associated with each FILE
4127 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
2735 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
41282736 to RM.
41292737
41302738 If FILE is a libtool library, object or program, all the files associated
41432751 -no-suppress do not suppress compiler output for multiple passes
41442752 -prefer-pic try to build PIC objects only
41452753 -prefer-non-pic try to build non-PIC objects only
4146 -shared do not build a '.o' file suitable for static linking
4147 -static only build a '.o' file suitable for static linking
2754 -shared do not build a \`.o' file suitable for static linking
2755 -static only build a \`.o' file suitable for static linking
41482756 -Wc,FLAG pass FLAG directly to the compiler
41492757
4150 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
2758 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
41512759 from the given SOURCEFILE.
41522760
41532761 The output file name is determined by removing the directory component from
4154 SOURCEFILE, then substituting the C source code suffix '.c' with the
4155 library object suffix, '.lo'."
2762 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2763 library object suffix, \`.lo'."
41562764 ;;
41572765
41582766 execute)
41652773
41662774 -dlopen FILE add the directory containing FILE to the library path
41672775
4168 This mode sets the library path environment variable according to '-dlopen'
2776 This mode sets the library path environment variable according to \`-dlopen'
41692777 flags.
41702778
41712779 If any of the ARGS are libtool executable wrappers, then they are translated
41842792 Each LIBDIR is a directory that contains libtool libraries.
41852793
41862794 The commands that this mode executes may require superuser privileges. Use
4187 the '--dry-run' option if you just want to see what would be executed."
2795 the \`--dry-run' option if you just want to see what would be executed."
41882796 ;;
41892797
41902798 install)
41942802 Install executables or libraries.
41952803
41962804 INSTALL-COMMAND is the installation command. The first component should be
4197 either the 'install' or 'cp' program.
2805 either the \`install' or \`cp' program.
41982806
41992807 The following components of INSTALL-COMMAND are treated specially:
42002808
42202828 -avoid-version do not add a version suffix if possible
42212829 -bindir BINDIR specify path to binaries directory (for systems where
42222830 libraries must be found in the PATH setting at runtime)
4223 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
2831 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
42242832 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
42252833 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
42262834 -export-symbols SYMFILE
42342842 -no-install link a not-installable executable
42352843 -no-undefined declare that a library does not refer to external symbols
42362844 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4237 -objectlist FILE use a list of object files found in FILE to specify objects
4238 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
2845 -objectlist FILE Use a list of object files found in FILE to specify objects
42392846 -precious-files-regex REGEX
42402847 don't remove output files matching REGEX
42412848 -release RELEASE specify package release information
42552862 -Xlinker FLAG pass linker-specific FLAG directly to the linker
42562863 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
42572864
4258 All other options (arguments beginning with '-') are ignored.
4259
4260 Every other argument is treated as a filename. Files ending in '.la' are
2865 All other options (arguments beginning with \`-') are ignored.
2866
2867 Every other argument is treated as a filename. Files ending in \`.la' are
42612868 treated as uninstalled libtool libraries, other files are standard or library
42622869 object files.
42632870
4264 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
4265 only library objects ('.lo' files) may be specified, and '-rpath' is
2871 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2872 only library objects (\`.lo' files) may be specified, and \`-rpath' is
42662873 required, except when creating a convenience library.
42672874
4268 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
4269 using 'ar' and 'ranlib', or on Windows using 'lib'.
4270
4271 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
2875 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2876 using \`ar' and \`ranlib', or on Windows using \`lib'.
2877
2878 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
42722879 is created, otherwise an executable program is created."
42732880 ;;
42742881
42792886 Remove libraries from an installation directory.
42802887
42812888 RM is the name of the program to use to delete files associated with each FILE
4282 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
2889 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
42832890 to RM.
42842891
42852892 If FILE is a libtool library, all the files associated with it are deleted.
42872894 ;;
42882895
42892896 *)
4290 func_fatal_help "invalid operation mode '$opt_mode'"
2897 func_fatal_help "invalid operation mode \`$opt_mode'"
42912898 ;;
42922899 esac
42932900
42942901 echo
4295 $ECHO "Try '$progname --help' for more information about other modes."
2902 $ECHO "Try \`$progname --help' for more information about other modes."
42962903 }
42972904
42982905 # Now that we've collected a possible --mode arg, show help if necessary
42992906 if $opt_help; then
4300 if test : = "$opt_help"; then
2907 if test "$opt_help" = :; then
43012908 func_mode_help
43022909 else
43032910 {
43052912 for opt_mode in compile link execute install finish uninstall clean; do
43062913 func_mode_help
43072914 done
4308 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
2915 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
43092916 {
43102917 func_help noexit
43112918 for opt_mode in compile link execute install finish uninstall clean; do
43132920 func_mode_help
43142921 done
43152922 } |
4316 $SED '1d
2923 sed '1d
43172924 /^When reporting/,/^Report/{
43182925 H
43192926 d
43302937 # func_mode_execute arg...
43312938 func_mode_execute ()
43322939 {
4333 $debug_cmd
4334
2940 $opt_debug
43352941 # The first argument is the command name.
4336 cmd=$nonopt
2942 cmd="$nonopt"
43372943 test -z "$cmd" && \
43382944 func_fatal_help "you must specify a COMMAND"
43392945
43402946 # Handle -dlopen flags immediately.
43412947 for file in $opt_dlopen; do
43422948 test -f "$file" \
4343 || func_fatal_help "'$file' is not a file"
2949 || func_fatal_help "\`$file' is not a file"
43442950
43452951 dir=
43462952 case $file in
43502956
43512957 # Check to see that this really is a libtool archive.
43522958 func_lalib_unsafe_p "$file" \
4353 || func_fatal_help "'$lib' is not a valid libtool archive"
2959 || func_fatal_help "\`$lib' is not a valid libtool archive"
43542960
43552961 # Read the libtool library.
43562962 dlname=
43612967 if test -z "$dlname"; then
43622968 # Warn if it was a shared library.
43632969 test -n "$library_names" && \
4364 func_warning "'$file' was not linked with '-export-dynamic'"
2970 func_warning "\`$file' was not linked with \`-export-dynamic'"
43652971 continue
43662972 fi
43672973
43682974 func_dirname "$file" "" "."
4369 dir=$func_dirname_result
2975 dir="$func_dirname_result"
43702976
43712977 if test -f "$dir/$objdir/$dlname"; then
4372 func_append dir "/$objdir"
2978 dir+="/$objdir"
43732979 else
43742980 if test ! -f "$dir/$dlname"; then
4375 func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
2981 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
43762982 fi
43772983 fi
43782984 ;;
43802986 *.lo)
43812987 # Just add the directory containing the .lo file.
43822988 func_dirname "$file" "" "."
4383 dir=$func_dirname_result
2989 dir="$func_dirname_result"
43842990 ;;
43852991
43862992 *)
4387 func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
2993 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
43882994 continue
43892995 ;;
43902996 esac
43912997
43922998 # Get the absolute pathname.
43932999 absdir=`cd "$dir" && pwd`
4394 test -n "$absdir" && dir=$absdir
3000 test -n "$absdir" && dir="$absdir"
43953001
43963002 # Now add the directory to shlibpath_var.
43973003 if eval "test -z \"\$$shlibpath_var\""; then
44033009
44043010 # This variable tells wrapper scripts just to set shlibpath_var
44053011 # rather than running their programs.
4406 libtool_execute_magic=$magic
3012 libtool_execute_magic="$magic"
44073013
44083014 # Check if any of the arguments is a wrapper script.
44093015 args=
44163022 if func_ltwrapper_script_p "$file"; then
44173023 func_source "$file"
44183024 # Transform arg to wrapped name.
4419 file=$progdir/$program
3025 file="$progdir/$program"
44203026 elif func_ltwrapper_executable_p "$file"; then
44213027 func_ltwrapper_scriptname "$file"
44223028 func_source "$func_ltwrapper_scriptname_result"
44233029 # Transform arg to wrapped name.
4424 file=$progdir/$program
3030 file="$progdir/$program"
44253031 fi
44263032 ;;
44273033 esac
44293035 func_append_quoted args "$file"
44303036 done
44313037
4432 if $opt_dry_run; then
4433 # Display what would be done.
4434 if test -n "$shlibpath_var"; then
4435 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
4436 echo "export $shlibpath_var"
4437 fi
4438 $ECHO "$cmd$args"
4439 exit $EXIT_SUCCESS
4440 else
3038 if test "X$opt_dry_run" = Xfalse; then
44413039 if test -n "$shlibpath_var"; then
44423040 # Export the shlibpath_var.
44433041 eval "export $shlibpath_var"
44543052 done
44553053
44563054 # Now prepare to actually exec the command.
4457 exec_cmd=\$cmd$args
3055 exec_cmd="\$cmd$args"
3056 else
3057 # Display what would be done.
3058 if test -n "$shlibpath_var"; then
3059 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3060 echo "export $shlibpath_var"
3061 fi
3062 $ECHO "$cmd$args"
3063 exit $EXIT_SUCCESS
44583064 fi
44593065 }
44603066
4461 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
3067 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
44623068
44633069
44643070 # func_mode_finish arg...
44653071 func_mode_finish ()
44663072 {
4467 $debug_cmd
4468
3073 $opt_debug
44693074 libs=
44703075 libdirs=
44713076 admincmds=
44733078 for opt in "$nonopt" ${1+"$@"}
44743079 do
44753080 if test -d "$opt"; then
4476 func_append libdirs " $opt"
3081 libdirs+=" $opt"
44773082
44783083 elif test -f "$opt"; then
44793084 if func_lalib_unsafe_p "$opt"; then
4480 func_append libs " $opt"
3085 libs+=" $opt"
44813086 else
4482 func_warning "'$opt' is not a valid libtool archive"
3087 func_warning "\`$opt' is not a valid libtool archive"
44833088 fi
44843089
44853090 else
4486 func_fatal_error "invalid argument '$opt'"
3091 func_fatal_error "invalid argument \`$opt'"
44873092 fi
44883093 done
44893094
44983103 # Remove sysroot references
44993104 if $opt_dry_run; then
45003105 for lib in $libs; do
4501 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
3106 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
45023107 done
45033108 else
45043109 tmpdir=`func_mktempdir`
45053110 for lib in $libs; do
4506 $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3111 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
45073112 > $tmpdir/tmp-la
45083113 mv -f $tmpdir/tmp-la $lib
45093114 done
45213126 if test -n "$finish_eval"; then
45223127 # Do the single finish_eval.
45233128 eval cmds=\"$finish_eval\"
4524 $opt_dry_run || eval "$cmds" || func_append admincmds "
3129 $opt_dry_run || eval "$cmds" || admincmds+="
45253130 $cmds"
45263131 fi
45273132 done
45283133 fi
45293134
45303135 # Exit here if they wanted silent mode.
4531 $opt_quiet && exit $EXIT_SUCCESS
3136 $opt_silent && exit $EXIT_SUCCESS
45323137
45333138 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
45343139 echo "----------------------------------------------------------------------"
45393144 echo
45403145 echo "If you ever happen to want to link against installed libraries"
45413146 echo "in a given directory, LIBDIR, you must either use libtool, and"
4542 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
3147 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
45433148 echo "flag during linking and do at least one of the following:"
45443149 if test -n "$shlibpath_var"; then
4545 echo " - add LIBDIR to the '$shlibpath_var' environment variable"
3150 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
45463151 echo " during execution"
45473152 fi
45483153 if test -n "$runpath_var"; then
4549 echo " - add LIBDIR to the '$runpath_var' environment variable"
3154 echo " - add LIBDIR to the \`$runpath_var' environment variable"
45503155 echo " during linking"
45513156 fi
45523157 if test -n "$hardcode_libdir_flag_spec"; then
45533158 libdir=LIBDIR
45543159 eval flag=\"$hardcode_libdir_flag_spec\"
45553160
4556 $ECHO " - use the '$flag' linker flag"
3161 $ECHO " - use the \`$flag' linker flag"
45573162 fi
45583163 if test -n "$admincmds"; then
45593164 $ECHO " - have your system administrator run these commands:$admincmds"
45603165 fi
45613166 if test -f /etc/ld.so.conf; then
4562 echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
3167 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
45633168 fi
45643169 echo
45653170
45783183 exit $EXIT_SUCCESS
45793184 }
45803185
4581 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
3186 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
45823187
45833188
45843189 # func_mode_install arg...
45853190 func_mode_install ()
45863191 {
4587 $debug_cmd
4588
3192 $opt_debug
45893193 # There may be an optional sh(1) argument at the beginning of
45903194 # install_prog (especially on Windows NT).
4591 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
3195 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
45923196 # Allow the use of GNU shtool's install command.
4593 case $nonopt in *shtool*) :;; *) false;; esac
4594 then
3197 case $nonopt in *shtool*) :;; *) false;; esac; then
45953198 # Aesthetically quote it.
45963199 func_quote_for_eval "$nonopt"
45973200 install_prog="$func_quote_for_eval_result "
46053208 # The real first argument should be the name of the installation program.
46063209 # Aesthetically quote it.
46073210 func_quote_for_eval "$arg"
4608 func_append install_prog "$func_quote_for_eval_result"
3211 install_prog+="$func_quote_for_eval_result"
46093212 install_shared_prog=$install_prog
46103213 case " $install_prog " in
46113214 *[\\\ /]cp\ *) install_cp=: ;;
46183221 opts=
46193222 prev=
46203223 install_type=
4621 isdir=false
3224 isdir=no
46223225 stripme=
46233226 no_mode=:
46243227 for arg
46253228 do
46263229 arg2=
46273230 if test -n "$dest"; then
4628 func_append files " $dest"
3231 files+=" $dest"
46293232 dest=$arg
46303233 continue
46313234 fi
46323235
46333236 case $arg in
4634 -d) isdir=: ;;
3237 -d) isdir=yes ;;
46353238 -f)
46363239 if $install_cp; then :; else
46373240 prev=$arg
46493252 *)
46503253 # If the previous option needed an argument, then skip it.
46513254 if test -n "$prev"; then
4652 if test X-m = "X$prev" && test -n "$install_override_mode"; then
3255 if test "x$prev" = x-m && test -n "$install_override_mode"; then
46533256 arg2=$install_override_mode
46543257 no_mode=false
46553258 fi
46633266
46643267 # Aesthetically quote the argument.
46653268 func_quote_for_eval "$arg"
4666 func_append install_prog " $func_quote_for_eval_result"
3269 install_prog+=" $func_quote_for_eval_result"
46673270 if test -n "$arg2"; then
46683271 func_quote_for_eval "$arg2"
46693272 fi
4670 func_append install_shared_prog " $func_quote_for_eval_result"
3273 install_shared_prog+=" $func_quote_for_eval_result"
46713274 done
46723275
46733276 test -z "$install_prog" && \
46743277 func_fatal_help "you must specify an install program"
46753278
46763279 test -n "$prev" && \
4677 func_fatal_help "the '$prev' option requires an argument"
3280 func_fatal_help "the \`$prev' option requires an argument"
46783281
46793282 if test -n "$install_override_mode" && $no_mode; then
46803283 if $install_cp; then :; else
46813284 func_quote_for_eval "$install_override_mode"
4682 func_append install_shared_prog " -m $func_quote_for_eval_result"
3285 install_shared_prog+=" -m $func_quote_for_eval_result"
46833286 fi
46843287 fi
46853288
46963299 dest=$func_stripname_result
46973300
46983301 # Check to see that the destination is a directory.
4699 test -d "$dest" && isdir=:
4700 if $isdir; then
4701 destdir=$dest
3302 test -d "$dest" && isdir=yes
3303 if test "$isdir" = yes; then
3304 destdir="$dest"
47023305 destname=
47033306 else
47043307 func_dirname_and_basename "$dest" "" "."
4705 destdir=$func_dirname_result
4706 destname=$func_basename_result
3308 destdir="$func_dirname_result"
3309 destname="$func_basename_result"
47073310
47083311 # Not a directory, so check to see that there is only one file specified.
47093312 set dummy $files; shift
47103313 test "$#" -gt 1 && \
4711 func_fatal_help "'$dest' is not a directory"
3314 func_fatal_help "\`$dest' is not a directory"
47123315 fi
47133316 case $destdir in
47143317 [\\/]* | [A-Za-z]:[\\/]*) ;;
47173320 case $file in
47183321 *.lo) ;;
47193322 *)
4720 func_fatal_help "'$destdir' must be an absolute directory name"
3323 func_fatal_help "\`$destdir' must be an absolute directory name"
47213324 ;;
47223325 esac
47233326 done
47263329
47273330 # This variable tells wrapper scripts just to set variables rather
47283331 # than running their programs.
4729 libtool_install_magic=$magic
3332 libtool_install_magic="$magic"
47303333
47313334 staticlibs=
47323335 future_libdirs=
47373340 case $file in
47383341 *.$libext)
47393342 # Do the static libraries later.
4740 func_append staticlibs " $file"
3343 staticlibs+=" $file"
47413344 ;;
47423345
47433346 *.la)
47463349
47473350 # Check to see that this really is a libtool archive.
47483351 func_lalib_unsafe_p "$file" \
4749 || func_fatal_help "'$file' is not a valid libtool archive"
3352 || func_fatal_help "\`$file' is not a valid libtool archive"
47503353
47513354 library_names=
47523355 old_library=
47573360 if test "X$destdir" = "X$libdir"; then
47583361 case "$current_libdirs " in
47593362 *" $libdir "*) ;;
4760 *) func_append current_libdirs " $libdir" ;;
3363 *) current_libdirs+=" $libdir" ;;
47613364 esac
47623365 else
47633366 # Note the libdir as a future libdir.
47643367 case "$future_libdirs " in
47653368 *" $libdir "*) ;;
4766 *) func_append future_libdirs " $libdir" ;;
3369 *) future_libdirs+=" $libdir" ;;
47673370 esac
47683371 fi
47693372
47703373 func_dirname "$file" "/" ""
4771 dir=$func_dirname_result
4772 func_append dir "$objdir"
3374 dir="$func_dirname_result"
3375 dir+="$objdir"
47733376
47743377 if test -n "$relink_command"; then
47753378 # Determine the prefix the user has applied to our future dir.
47823385 # are installed into $libdir/../bin (currently, that works fine)
47833386 # but it's something to keep an eye on.
47843387 test "$inst_prefix_dir" = "$destdir" && \
4785 func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
3388 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
47863389
47873390 if test -n "$inst_prefix_dir"; then
47883391 # Stick the inst_prefix_dir data into the link command.
47913394 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
47923395 fi
47933396
4794 func_warning "relinking '$file'"
3397 func_warning "relinking \`$file'"
47953398 func_show_eval "$relink_command" \
4796 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
3399 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
47973400 fi
47983401
47993402 # See the names of the shared library.
48003403 set dummy $library_names; shift
48013404 if test -n "$1"; then
4802 realname=$1
3405 realname="$1"
48033406 shift
48043407
4805 srcname=$realname
4806 test -n "$relink_command" && srcname=${realname}T
3408 srcname="$realname"
3409 test -n "$relink_command" && srcname="$realname"T
48073410
48083411 # Install the shared library and build the symlinks.
48093412 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
48103413 'exit $?'
4811 tstripme=$stripme
3414 tstripme="$stripme"
48123415 case $host_os in
48133416 cygwin* | mingw* | pw32* | cegcc*)
48143417 case $realname in
48153418 *.dll.a)
4816 tstripme=
4817 ;;
4818 esac
4819 ;;
4820 os2*)
4821 case $realname in
4822 *_dll.a)
4823 tstripme=
3419 tstripme=""
48243420 ;;
48253421 esac
48263422 ;;
48313427
48323428 if test "$#" -gt 0; then
48333429 # Delete the old symlinks, and create new ones.
4834 # Try 'ln -sf' first, because the 'ln' binary might depend on
3430 # Try `ln -sf' first, because the `ln' binary might depend on
48353431 # the symlink we replace! Solaris /bin/ln does not understand -f,
48363432 # so we also need to try rm && ln -s.
48373433 for linkname
48423438 fi
48433439
48443440 # Do each command in the postinstall commands.
4845 lib=$destdir/$realname
3441 lib="$destdir/$realname"
48463442 func_execute_cmds "$postinstall_cmds" 'exit $?'
48473443 fi
48483444
48493445 # Install the pseudo-library for information purposes.
48503446 func_basename "$file"
4851 name=$func_basename_result
4852 instname=$dir/${name}i
3447 name="$func_basename_result"
3448 instname="$dir/$name"i
48533449 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
48543450
48553451 # Maybe install the static library, too.
4856 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3452 test -n "$old_library" && staticlibs+=" $dir/$old_library"
48573453 ;;
48583454
48593455 *.lo)
48613457
48623458 # Figure out destination file name, if it wasn't already specified.
48633459 if test -n "$destname"; then
4864 destfile=$destdir/$destname
3460 destfile="$destdir/$destname"
48653461 else
48663462 func_basename "$file"
4867 destfile=$func_basename_result
4868 destfile=$destdir/$destfile
3463 destfile="$func_basename_result"
3464 destfile="$destdir/$destfile"
48693465 fi
48703466
48713467 # Deduce the name of the destination old-style object file.
48753471 staticdest=$func_lo2o_result
48763472 ;;
48773473 *.$objext)
4878 staticdest=$destfile
3474 staticdest="$destfile"
48793475 destfile=
48803476 ;;
48813477 *)
4882 func_fatal_help "cannot copy a libtool object to '$destfile'"
3478 func_fatal_help "cannot copy a libtool object to \`$destfile'"
48833479 ;;
48843480 esac
48853481
48883484 func_show_eval "$install_prog $file $destfile" 'exit $?'
48893485
48903486 # Install the old object if enabled.
4891 if test yes = "$build_old_libs"; then
3487 if test "$build_old_libs" = yes; then
48923488 # Deduce the name of the old-style object file.
48933489 func_lo2o "$file"
48943490 staticobj=$func_lo2o_result
49003496 *)
49013497 # Figure out destination file name, if it wasn't already specified.
49023498 if test -n "$destname"; then
4903 destfile=$destdir/$destname
3499 destfile="$destdir/$destname"
49043500 else
49053501 func_basename "$file"
4906 destfile=$func_basename_result
4907 destfile=$destdir/$destfile
3502 destfile="$func_basename_result"
3503 destfile="$destdir/$destfile"
49083504 fi
49093505
49103506 # If the file is missing, and there is a .exe on the end, strip it
49113507 # because it is most likely a libtool script we actually want to
49123508 # install
4913 stripped_ext=
3509 stripped_ext=""
49143510 case $file in
49153511 *.exe)
49163512 if test ! -f "$file"; then
49173513 func_stripname '' '.exe' "$file"
49183514 file=$func_stripname_result
4919 stripped_ext=.exe
3515 stripped_ext=".exe"
49203516 fi
49213517 ;;
49223518 esac
49443540
49453541 # Check the variables that should have been set.
49463542 test -z "$generated_by_libtool_version" && \
4947 func_fatal_error "invalid libtool wrapper script '$wrapper'"
4948
4949 finalize=:
3543 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3544
3545 finalize=yes
49503546 for lib in $notinst_deplibs; do
49513547 # Check to see that each library is installed.
49523548 libdir=
49533549 if test -f "$lib"; then
49543550 func_source "$lib"
49553551 fi
4956 libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
3552 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
49573553 if test -n "$libdir" && test ! -f "$libfile"; then
4958 func_warning "'$lib' has not been installed in '$libdir'"
4959 finalize=false
3554 func_warning "\`$lib' has not been installed in \`$libdir'"
3555 finalize=no
49603556 fi
49613557 done
49623558
49643560 func_source "$wrapper"
49653561
49663562 outputname=
4967 if test no = "$fast_install" && test -n "$relink_command"; then
3563 if test "$fast_install" = no && test -n "$relink_command"; then
49683564 $opt_dry_run || {
4969 if $finalize; then
3565 if test "$finalize" = yes; then
49703566 tmpdir=`func_mktempdir`
49713567 func_basename "$file$stripped_ext"
4972 file=$func_basename_result
4973 outputname=$tmpdir/$file
3568 file="$func_basename_result"
3569 outputname="$tmpdir/$file"
49743570 # Replace the output file specification.
49753571 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
49763572
4977 $opt_quiet || {
3573 $opt_silent || {
49783574 func_quote_for_expand "$relink_command"
49793575 eval "func_echo $func_quote_for_expand_result"
49803576 }
49813577 if eval "$relink_command"; then :
49823578 else
4983 func_error "error: relink '$file' with the above command before installing it"
3579 func_error "error: relink \`$file' with the above command before installing it"
49843580 $opt_dry_run || ${RM}r "$tmpdir"
49853581 continue
49863582 fi
4987 file=$outputname
3583 file="$outputname"
49883584 else
4989 func_warning "cannot relink '$file'"
3585 func_warning "cannot relink \`$file'"
49903586 fi
49913587 }
49923588 else
50233619
50243620 for file in $staticlibs; do
50253621 func_basename "$file"
5026 name=$func_basename_result
3622 name="$func_basename_result"
50273623
50283624 # Set up the ranlib parameters.
5029 oldlib=$destdir/$name
3625 oldlib="$destdir/$name"
50303626 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
50313627 tool_oldlib=$func_to_tool_file_result
50323628
50413637 done
50423638
50433639 test -n "$future_libdirs" && \
5044 func_warning "remember to run '$progname --finish$future_libdirs'"
3640 func_warning "remember to run \`$progname --finish$future_libdirs'"
50453641
50463642 if test -n "$current_libdirs"; then
50473643 # Maybe just do a dry run.
50483644 $opt_dry_run && current_libdirs=" -n$current_libdirs"
5049 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
3645 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
50503646 else
50513647 exit $EXIT_SUCCESS
50523648 fi
50533649 }
50543650
5055 test install = "$opt_mode" && func_mode_install ${1+"$@"}
3651 test "$opt_mode" = install && func_mode_install ${1+"$@"}
50563652
50573653
50583654 # func_generate_dlsyms outputname originator pic_p
50603656 # a dlpreopen symbol table.
50613657 func_generate_dlsyms ()
50623658 {
5063 $debug_cmd
5064
5065 my_outputname=$1
5066 my_originator=$2
5067 my_pic_p=${3-false}
5068 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
3659 $opt_debug
3660 my_outputname="$1"
3661 my_originator="$2"
3662 my_pic_p="${3-no}"
3663 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
50693664 my_dlsyms=
50703665
5071 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
3666 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
50723667 if test -n "$NM" && test -n "$global_symbol_pipe"; then
5073 my_dlsyms=${my_outputname}S.c
3668 my_dlsyms="${my_outputname}S.c"
50743669 else
50753670 func_error "not configured to extract global symbols from dlpreopened files"
50763671 fi
50813676 "") ;;
50823677 *.c)
50833678 # Discover the nlist of each of the dlfiles.
5084 nlist=$output_objdir/$my_outputname.nm
3679 nlist="$output_objdir/${my_outputname}.nm"
50853680
50863681 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
50873682
50893684 func_verbose "creating $output_objdir/$my_dlsyms"
50903685
50913686 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
5092 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
5093 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
3687 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3688 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
50943689
50953690 #ifdef __cplusplus
50963691 extern \"C\" {
50973692 #endif
50983693
5099 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3694 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
51003695 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
51013696 #endif
51023697
51033698 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
5104 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
5105 /* DATA imports from DLLs on WIN32 can't be const, because runtime
3699 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3700 /* DATA imports from DLLs on WIN32 con't be const, because runtime
51063701 relocations are performed -- see ld's documentation on pseudo-relocs. */
51073702 # define LT_DLSYM_CONST
5108 #elif defined __osf__
3703 #elif defined(__osf__)
51093704 /* This system does not cope well with relocations in const data. */
51103705 # define LT_DLSYM_CONST
51113706 #else
51123707 # define LT_DLSYM_CONST const
51133708 #endif
51143709
5115 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5116
51173710 /* External symbol declarations for the compiler. */\
51183711 "
51193712
5120 if test yes = "$dlself"; then
5121 func_verbose "generating symbol list for '$output'"
3713 if test "$dlself" = yes; then
3714 func_verbose "generating symbol list for \`$output'"
51223715
51233716 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
51243717
51263719 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
51273720 for progfile in $progfiles; do
51283721 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
5129 func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
3722 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
51303723 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
51313724 done
51323725
51463739
51473740 # Prepare the list of exported symbols
51483741 if test -z "$export_symbols"; then
5149 export_symbols=$output_objdir/$outputname.exp
3742 export_symbols="$output_objdir/$outputname.exp"
51503743 $opt_dry_run || {
51513744 $RM $export_symbols
5152 eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3745 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
51533746 case $host in
51543747 *cygwin* | *mingw* | *cegcc* )
51553748 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
51593752 }
51603753 else
51613754 $opt_dry_run || {
5162 eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3755 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
51633756 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
51643757 eval '$MV "$nlist"T "$nlist"'
51653758 case $host in
51733766 fi
51743767
51753768 for dlprefile in $dlprefiles; do
5176 func_verbose "extracting global C symbols from '$dlprefile'"
3769 func_verbose "extracting global C symbols from \`$dlprefile'"
51773770 func_basename "$dlprefile"
5178 name=$func_basename_result
3771 name="$func_basename_result"
51793772 case $host in
51803773 *cygwin* | *mingw* | *cegcc* )
51813774 # if an import library, we need to obtain dlname
51823775 if func_win32_import_lib_p "$dlprefile"; then
51833776 func_tr_sh "$dlprefile"
51843777 eval "curr_lafile=\$libfile_$func_tr_sh_result"
5185 dlprefile_dlbasename=
3778 dlprefile_dlbasename=""
51863779 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
51873780 # Use subshell, to avoid clobbering current variable values
51883781 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
5189 if test -n "$dlprefile_dlname"; then
3782 if test -n "$dlprefile_dlname" ; then
51903783 func_basename "$dlprefile_dlname"
5191 dlprefile_dlbasename=$func_basename_result
3784 dlprefile_dlbasename="$func_basename_result"
51923785 else
51933786 # no lafile. user explicitly requested -dlpreopen <import library>.
51943787 $sharedlib_from_linklib_cmd "$dlprefile"
51963789 fi
51973790 fi
51983791 $opt_dry_run || {
5199 if test -n "$dlprefile_dlbasename"; then
3792 if test -n "$dlprefile_dlbasename" ; then
52003793 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
52013794 else
52023795 func_warning "Could not compute DLL name from $name"
52523845 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
52533846 fi
52543847
5255 func_show_eval '$RM "${nlist}I"'
5256 if test -n "$global_symbol_to_import"; then
5257 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
5258 fi
5259
52603848 echo >> "$output_objdir/$my_dlsyms" "\
52613849
52623850 /* The mapping between symbol names and symbols. */
52653853 void *address;
52663854 } lt_dlsymlist;
52673855 extern LT_DLSYM_CONST lt_dlsymlist
5268 lt_${my_prefix}_LTX_preloaded_symbols[];\
5269 "
5270
5271 if test -s "$nlist"I; then
5272 echo >> "$output_objdir/$my_dlsyms" "\
5273 static void lt_syminit(void)
5274 {
5275 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
5276 for (; symbol->name; ++symbol)
5277 {"
5278 $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
5279 echo >> "$output_objdir/$my_dlsyms" "\
5280 }
5281 }"
5282 fi
5283 echo >> "$output_objdir/$my_dlsyms" "\
3856 lt_${my_prefix}_LTX_preloaded_symbols[];
52843857 LT_DLSYM_CONST lt_dlsymlist
52853858 lt_${my_prefix}_LTX_preloaded_symbols[] =
5286 { {\"$my_originator\", (void *) 0},"
5287
5288 if test -s "$nlist"I; then
5289 echo >> "$output_objdir/$my_dlsyms" "\
5290 {\"@INIT@\", (void *) &lt_syminit},"
5291 fi
3859 {\
3860 { \"$my_originator\", (void *) 0 },"
52923861
52933862 case $need_lib_prefix in
52943863 no)
53303899 *-*-hpux*)
53313900 pic_flag_for_symtable=" $pic_flag" ;;
53323901 *)
5333 $my_pic_p && pic_flag_for_symtable=" $pic_flag"
3902 if test "X$my_pic_p" != Xno; then
3903 pic_flag_for_symtable=" $pic_flag"
3904 fi
53343905 ;;
53353906 esac
53363907 ;;
53393910 for arg in $LTCFLAGS; do
53403911 case $arg in
53413912 -pie | -fpie | -fPIE) ;;
5342 *) func_append symtab_cflags " $arg" ;;
3913 *) symtab_cflags+=" $arg" ;;
53433914 esac
53443915 done
53453916
53473918 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
53483919
53493920 # Clean up the generated files.
5350 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
3921 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
53513922
53523923 # Transform the symbol file into the correct name.
5353 symfileobj=$output_objdir/${my_outputname}S.$objext
3924 symfileobj="$output_objdir/${my_outputname}S.$objext"
53543925 case $host in
53553926 *cygwin* | *mingw* | *cegcc* )
53563927 if test -f "$output_objdir/$my_outputname.def"; then
53683939 esac
53693940 ;;
53703941 *)
5371 func_fatal_error "unknown suffix for '$my_dlsyms'"
3942 func_fatal_error "unknown suffix for \`$my_dlsyms'"
53723943 ;;
53733944 esac
53743945 else
53803951 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
53813952 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
53823953 fi
5383 }
5384
5385 # func_cygming_gnu_implib_p ARG
5386 # This predicate returns with zero status (TRUE) if
5387 # ARG is a GNU/binutils-style import library. Returns
5388 # with nonzero status (FALSE) otherwise.
5389 func_cygming_gnu_implib_p ()
5390 {
5391 $debug_cmd
5392
5393 func_to_tool_file "$1" func_convert_file_msys_to_w32
5394 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
5395 test -n "$func_cygming_gnu_implib_tmp"
5396 }
5397
5398 # func_cygming_ms_implib_p ARG
5399 # This predicate returns with zero status (TRUE) if
5400 # ARG is an MS-style import library. Returns
5401 # with nonzero status (FALSE) otherwise.
5402 func_cygming_ms_implib_p ()
5403 {
5404 $debug_cmd
5405
5406 func_to_tool_file "$1" func_convert_file_msys_to_w32
5407 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
5408 test -n "$func_cygming_ms_implib_tmp"
54093954 }
54103955
54113956 # func_win32_libid arg
54173962 # Despite the name, also deal with 64 bit binaries.
54183963 func_win32_libid ()
54193964 {
5420 $debug_cmd
5421
5422 win32_libid_type=unknown
3965 $opt_debug
3966 win32_libid_type="unknown"
54233967 win32_fileres=`file -L $1 2>/dev/null`
54243968 case $win32_fileres in
54253969 *ar\ archive\ import\ library*) # definitely import
54293973 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
54303974 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
54313975 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
5432 case $nm_interface in
5433 "MS dumpbin")
5434 if func_cygming_ms_implib_p "$1" ||
5435 func_cygming_gnu_implib_p "$1"
5436 then
5437 win32_nmres=import
5438 else
5439 win32_nmres=
5440 fi
5441 ;;
5442 *)
5443 func_to_tool_file "$1" func_convert_file_msys_to_w32
5444 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
5445 $SED -n -e '
3976 func_to_tool_file "$1" func_convert_file_msys_to_w32
3977 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3978 $SED -n -e '
54463979 1,100{
54473980 / I /{
5448 s|.*|import|
3981 s,.*,import,
54493982 p
54503983 q
54513984 }
54523985 }'`
5453 ;;
5454 esac
54553986 case $win32_nmres in
54563987 import*) win32_libid_type="x86 archive import";;
54573988 *) win32_libid_type="x86 archive static";;
54834014 # $sharedlib_from_linklib_result
54844015 func_cygming_dll_for_implib ()
54854016 {
5486 $debug_cmd
5487
4017 $opt_debug
54884018 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
54894019 }
54904020
55014031 # specified import library.
55024032 func_cygming_dll_for_implib_fallback_core ()
55034033 {
5504 $debug_cmd
5505
4034 $opt_debug
55064035 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
55074036 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
55084037 $SED '/^Contents of section '"$match_literal"':/{
55384067 /./p' |
55394068 # we now have a list, one entry per line, of the stringified
55404069 # contents of the appropriate section of all members of the
5541 # archive that possess that section. Heuristic: eliminate
5542 # all those that have a first or second character that is
4070 # archive which possess that section. Heuristic: eliminate
4071 # all those which have a first or second character that is
55434072 # a '.' (that is, objdump's representation of an unprintable
55444073 # character.) This should work for all archives with less than
55454074 # 0x302f exports -- but will fail for DLLs whose name actually
55484077 #
55494078 # Of those that remain, print the first one.
55504079 $SED -e '/^\./d;/^.\./d;q'
4080 }
4081
4082 # func_cygming_gnu_implib_p ARG
4083 # This predicate returns with zero status (TRUE) if
4084 # ARG is a GNU/binutils-style import library. Returns
4085 # with nonzero status (FALSE) otherwise.
4086 func_cygming_gnu_implib_p ()
4087 {
4088 $opt_debug
4089 func_to_tool_file "$1" func_convert_file_msys_to_w32
4090 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4091 test -n "$func_cygming_gnu_implib_tmp"
4092 }
4093
4094 # func_cygming_ms_implib_p ARG
4095 # This predicate returns with zero status (TRUE) if
4096 # ARG is an MS-style import library. Returns
4097 # with nonzero status (FALSE) otherwise.
4098 func_cygming_ms_implib_p ()
4099 {
4100 $opt_debug
4101 func_to_tool_file "$1" func_convert_file_msys_to_w32
4102 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4103 test -n "$func_cygming_ms_implib_tmp"
55514104 }
55524105
55534106 # func_cygming_dll_for_implib_fallback ARG
55634116 # $sharedlib_from_linklib_result
55644117 func_cygming_dll_for_implib_fallback ()
55654118 {
5566 $debug_cmd
5567
5568 if func_cygming_gnu_implib_p "$1"; then
4119 $opt_debug
4120 if func_cygming_gnu_implib_p "$1" ; then
55694121 # binutils import library
55704122 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5571 elif func_cygming_ms_implib_p "$1"; then
4123 elif func_cygming_ms_implib_p "$1" ; then
55724124 # ms-generated import library
55734125 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
55744126 else
55754127 # unknown
5576 sharedlib_from_linklib_result=
4128 sharedlib_from_linklib_result=""
55774129 fi
55784130 }
55794131
55814133 # func_extract_an_archive dir oldlib
55824134 func_extract_an_archive ()
55834135 {
5584 $debug_cmd
5585
5586 f_ex_an_ar_dir=$1; shift
5587 f_ex_an_ar_oldlib=$1
5588 if test yes = "$lock_old_archive_extraction"; then
4136 $opt_debug
4137 f_ex_an_ar_dir="$1"; shift
4138 f_ex_an_ar_oldlib="$1"
4139 if test "$lock_old_archive_extraction" = yes; then
55894140 lockfile=$f_ex_an_ar_oldlib.lock
55904141 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
55914142 func_echo "Waiting for $lockfile to be removed"
55944145 fi
55954146 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
55964147 'stat=$?; rm -f "$lockfile"; exit $stat'
5597 if test yes = "$lock_old_archive_extraction"; then
4148 if test "$lock_old_archive_extraction" = yes; then
55984149 $opt_dry_run || rm -f "$lockfile"
55994150 fi
56004151 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
56084159 # func_extract_archives gentop oldlib ...
56094160 func_extract_archives ()
56104161 {
5611 $debug_cmd
5612
5613 my_gentop=$1; shift
4162 $opt_debug
4163 my_gentop="$1"; shift
56144164 my_oldlibs=${1+"$@"}
5615 my_oldobjs=
5616 my_xlib=
5617 my_xabs=
5618 my_xdir=
4165 my_oldobjs=""
4166 my_xlib=""
4167 my_xabs=""
4168 my_xdir=""
56194169
56204170 for my_xlib in $my_oldlibs; do
56214171 # Extract the objects.
56224172 case $my_xlib in
5623 [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
4173 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
56244174 *) my_xabs=`pwd`"/$my_xlib" ;;
56254175 esac
56264176 func_basename "$my_xlib"
5627 my_xlib=$func_basename_result
4177 my_xlib="$func_basename_result"
56284178 my_xlib_u=$my_xlib
56294179 while :; do
56304180 case " $extracted_archives " in
56364186 esac
56374187 done
56384188 extracted_archives="$extracted_archives $my_xlib_u"
5639 my_xdir=$my_gentop/$my_xlib_u
4189 my_xdir="$my_gentop/$my_xlib_u"
56404190
56414191 func_mkdir_p "$my_xdir"
56424192
56494199 cd $my_xdir || exit $?
56504200 darwin_archive=$my_xabs
56514201 darwin_curdir=`pwd`
5652 func_basename "$darwin_archive"
5653 darwin_base_archive=$func_basename_result
4202 darwin_base_archive=`basename "$darwin_archive"`
56544203 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
56554204 if test -n "$darwin_arches"; then
56564205 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
56574206 darwin_arch=
56584207 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5659 for darwin_arch in $darwin_arches; do
5660 func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5661 $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5662 cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5663 func_extract_an_archive "`pwd`" "$darwin_base_archive"
4208 for darwin_arch in $darwin_arches ; do
4209 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4210 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4211 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4212 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
56644213 cd "$darwin_curdir"
5665 $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
4214 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
56664215 done # $darwin_arches
56674216 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5668 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
4217 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
56694218 darwin_file=
56704219 darwin_files=
56714220 for darwin_file in $darwin_filelist; do
56874236 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
56884237 done
56894238
5690 func_extract_archives_result=$my_oldobjs
4239 func_extract_archives_result="$my_oldobjs"
56914240 }
56924241
56934242
57024251 #
57034252 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
57044253 # variable will take. If 'yes', then the emitted script
5705 # will assume that the directory where it is stored is
4254 # will assume that the directory in which it is stored is
57064255 # the $objdir directory. This is a cygwin/mingw-specific
57074256 # behavior.
57084257 func_emit_wrapper ()
57134262 #! $SHELL
57144263
57154264 # $output - temporary wrapper script for $objdir/$outputname
5716 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4265 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
57174266 #
57184267 # The $output program cannot be directly executed until all the libtool
57194268 # libraries that it depends on are installed.
57704319
57714320 # Very basic option parsing. These options are (a) specific to
57724321 # the libtool wrapper, (b) are identical between the wrapper
5773 # /script/ and the wrapper /executable/ that is used only on
4322 # /script/ and the wrapper /executable/ which is used only on
57744323 # windows platforms, and (c) all begin with the string "--lt-"
5775 # (application programs are unlikely to have options that match
4324 # (application programs are unlikely to have options which match
57764325 # this pattern).
57774326 #
57784327 # There are only two supported options: --lt-debug and
58054354
58064355 # Print the debug banner immediately:
58074356 if test -n \"\$lt_option_debug\"; then
5808 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
4357 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
58094358 fi
58104359 }
58114360
58164365 lt_dump_args_N=1;
58174366 for lt_arg
58184367 do
5819 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
4368 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
58204369 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
58214370 done
58224371 }
58304379 *-*-mingw | *-*-os2* | *-cegcc*)
58314380 $ECHO "\
58324381 if test -n \"\$lt_option_debug\"; then
5833 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
4382 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
58344383 func_lt_dump_args \${1+\"\$@\"} 1>&2
58354384 fi
58364385 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
58404389 *)
58414390 $ECHO "\
58424391 if test -n \"\$lt_option_debug\"; then
5843 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
4392 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
58444393 func_lt_dump_args \${1+\"\$@\"} 1>&2
58454394 fi
58464395 exec \"\$progdir/\$program\" \${1+\"\$@\"}
59154464 test -n \"\$absdir\" && thisdir=\"\$absdir\"
59164465 "
59174466
5918 if test yes = "$fast_install"; then
4467 if test "$fast_install" = yes; then
59194468 $ECHO "\
59204469 program=lt-'$outputname'$exeext
59214470 progdir=\"\$thisdir/$objdir\"
59224471
59234472 if test ! -f \"\$progdir/\$program\" ||
5924 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
4473 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
59254474 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
59264475
59274476 file=\"\$\$-\$program\"
59384487 if test -n \"\$relink_command\"; then
59394488 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
59404489 else
5941 \$ECHO \"\$relink_command_output\" >&2
4490 $ECHO \"\$relink_command_output\" >&2
59424491 $RM \"\$progdir/\$file\"
59434492 exit 1
59444493 fi
59734522 fi
59744523
59754524 # Export our shlibpath_var if we have one.
5976 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4525 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
59774526 $ECHO "\
59784527 # Add our own library path to $shlibpath_var
59794528 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
59934542 fi
59944543 else
59954544 # The program doesn't exist.
5996 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
4545 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
59974546 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
59984547 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
59994548 exit 1
60124561 cat <<EOF
60134562
60144563 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
6015 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4564 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
60164565
60174566 The $output program cannot be directly executed until all the libtool
60184567 libraries that it depends on are installed.
60474596 #include <fcntl.h>
60484597 #include <sys/stat.h>
60494598
6050 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
6051
60524599 /* declarations of non-ANSI functions */
6053 #if defined __MINGW32__
4600 #if defined(__MINGW32__)
60544601 # ifdef __STRICT_ANSI__
60554602 int _putenv (const char *);
60564603 # endif
6057 #elif defined __CYGWIN__
4604 #elif defined(__CYGWIN__)
60584605 # ifdef __STRICT_ANSI__
60594606 char *realpath (const char *, char *);
60604607 int putenv (char *);
60614608 int setenv (const char *, const char *, int);
60624609 # endif
6063 /* #elif defined other_platform || defined ... */
4610 /* #elif defined (other platforms) ... */
60644611 #endif
60654612
60664613 /* portability defines, excluding path handling macros */
6067 #if defined _MSC_VER
4614 #if defined(_MSC_VER)
60684615 # define setmode _setmode
60694616 # define stat _stat
60704617 # define chmod _chmod
60714618 # define getcwd _getcwd
60724619 # define putenv _putenv
60734620 # define S_IXUSR _S_IEXEC
6074 #elif defined __MINGW32__
4621 # ifndef _INTPTR_T_DEFINED
4622 # define _INTPTR_T_DEFINED
4623 # define intptr_t int
4624 # endif
4625 #elif defined(__MINGW32__)
60754626 # define setmode _setmode
60764627 # define stat _stat
60774628 # define chmod _chmod
60784629 # define getcwd _getcwd
60794630 # define putenv _putenv
6080 #elif defined __CYGWIN__
4631 #elif defined(__CYGWIN__)
60814632 # define HAVE_SETENV
60824633 # define FOPEN_WB "wb"
6083 /* #elif defined other platforms ... */
4634 /* #elif defined (other platforms) ... */
60844635 #endif
60854636
6086 #if defined PATH_MAX
4637 #if defined(PATH_MAX)
60874638 # define LT_PATHMAX PATH_MAX
6088 #elif defined MAXPATHLEN
4639 #elif defined(MAXPATHLEN)
60894640 # define LT_PATHMAX MAXPATHLEN
60904641 #else
60914642 # define LT_PATHMAX 1024
61044655 # define PATH_SEPARATOR ':'
61054656 #endif
61064657
6107 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
6108 defined __OS2__
4658 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4659 defined (__OS2__)
61094660 # define HAVE_DOS_BASED_FILE_SYSTEM
61104661 # define FOPEN_WB "wb"
61114662 # ifndef DIR_SEPARATOR_2
61384689
61394690 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
61404691 #define XFREE(stale) do { \
6141 if (stale) { free (stale); stale = 0; } \
4692 if (stale) { free ((void *) stale); stale = 0; } \
61424693 } while (0)
61434694
6144 #if defined LT_DEBUGWRAPPER
4695 #if defined(LT_DEBUGWRAPPER)
61454696 static int lt_debug = 1;
61464697 #else
61474698 static int lt_debug = 0;
61704721 EOF
61714722
61724723 cat <<EOF
6173 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
6174 # define externally_visible volatile
6175 #else
6176 # define externally_visible __attribute__((externally_visible)) volatile
6177 #endif
6178 externally_visible const char * MAGIC_EXE = "$magic_exe";
4724 volatile const char * MAGIC_EXE = "$magic_exe";
61794725 const char * LIB_PATH_VARNAME = "$shlibpath_var";
61804726 EOF
61814727
6182 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4728 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
61834729 func_to_host_path "$temp_rpath"
61844730 cat <<EOF
61854731 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
62034749 EOF
62044750 fi
62054751
6206 if test yes = "$fast_install"; then
4752 if test "$fast_install" = yes; then
62074753 cat <<EOF
62084754 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
62094755 EOF
62324778 char *actual_cwrapper_name;
62334779 char *target_name;
62344780 char *lt_argv_zero;
6235 int rval = 127;
4781 intptr_t rval = 127;
62364782
62374783 int i;
62384784
62394785 program_name = (char *) xstrdup (base_name (argv[0]));
6240 newargz = XMALLOC (char *, (size_t) argc + 1);
4786 newargz = XMALLOC (char *, argc + 1);
62414787
62424788 /* very simple arg parsing; don't want to rely on getopt
62434789 * also, copy all non cwrapper options to newargz, except
62464792 newargc=0;
62474793 for (i = 1; i < argc; i++)
62484794 {
6249 if (STREQ (argv[i], dumpscript_opt))
4795 if (strcmp (argv[i], dumpscript_opt) == 0)
62504796 {
62514797 EOF
6252 case $host in
4798 case "$host" in
62534799 *mingw* | *cygwin* )
62544800 # make stdout use "unix" line endings
62554801 echo " setmode(1,_O_BINARY);"
62604806 lt_dump_script (stdout);
62614807 return 0;
62624808 }
6263 if (STREQ (argv[i], debug_opt))
4809 if (strcmp (argv[i], debug_opt) == 0)
62644810 {
62654811 lt_debug = 1;
62664812 continue;
62674813 }
6268 if (STREQ (argv[i], ltwrapper_option_prefix))
4814 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
62694815 {
62704816 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
62714817 namespace, but it is not one of the ones we know about and
62884834 EOF
62894835 cat <<EOF
62904836 /* The GNU banner must be the first non-error debug message */
6291 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
4837 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
62924838 EOF
62934839 cat <<"EOF"
62944840 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
63994945 cat <<"EOF"
64004946 /* execv doesn't actually work on mingw as expected on unix */
64014947 newargz = prepare_spawn (newargz);
6402 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4948 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
64034949 if (rval == -1)
64044950 {
64054951 /* failed to start process */
64444990 {
64454991 const char *base;
64464992
6447 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4993 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
64484994 /* Skip over the disk name in MSDOS pathnames. */
64494995 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
64504996 name += 2;
65035049 const char *p_next;
65045050 /* static buffer for getcwd */
65055051 char tmp[LT_PATHMAX + 1];
6506 size_t tmp_len;
5052 int tmp_len;
65075053 char *concat_name;
65085054
65095055 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
65135059 return NULL;
65145060
65155061 /* Absolute path? */
6516 #if defined HAVE_DOS_BASED_FILE_SYSTEM
5062 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
65175063 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
65185064 {
65195065 concat_name = xstrdup (wrapper);
65315077 return concat_name;
65325078 XFREE (concat_name);
65335079 }
6534 #if defined HAVE_DOS_BASED_FILE_SYSTEM
5080 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
65355081 }
65365082 #endif
65375083
65545100 for (q = p; *q; q++)
65555101 if (IS_PATH_SEPARATOR (*q))
65565102 break;
6557 p_len = (size_t) (q - p);
5103 p_len = q - p;
65585104 p_next = (*q == '\0' ? q : q + 1);
65595105 if (p_len == 0)
65605106 {
66735219 if (patlen <= len)
66745220 {
66755221 str += len - patlen;
6676 if (STREQ (str, pat))
5222 if (strcmp (str, pat) == 0)
66775223 *str = '\0';
66785224 }
66795225 return str;
67385284 char *str = xstrdup (value);
67395285 setenv (name, str, 1);
67405286 #else
6741 size_t len = strlen (name) + 1 + strlen (value) + 1;
5287 int len = strlen (name) + 1 + strlen (value) + 1;
67425288 char *str = XMALLOC (char, len);
67435289 sprintf (str, "%s=%s", name, value);
67445290 if (putenv (str) != EXIT_SUCCESS)
67555301 char *new_value;
67565302 if (orig_value && *orig_value)
67575303 {
6758 size_t orig_value_len = strlen (orig_value);
6759 size_t add_len = strlen (add);
5304 int orig_value_len = strlen (orig_value);
5305 int add_len = strlen (add);
67605306 new_value = XMALLOC (char, add_len + orig_value_len + 1);
67615307 if (to_end)
67625308 {
67875333 {
67885334 char *new_value = lt_extend_str (getenv (name), value, 0);
67895335 /* some systems can't cope with a ':'-terminated path #' */
6790 size_t len = strlen (new_value);
6791 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
5336 int len = strlen (new_value);
5337 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
67925338 {
6793 new_value[--len] = '\0';
5339 new_value[len-1] = '\0';
67945340 }
67955341 lt_setenv (name, new_value);
67965342 XFREE (new_value);
69575503 # True if ARG is an import lib, as indicated by $file_magic_cmd
69585504 func_win32_import_lib_p ()
69595505 {
6960 $debug_cmd
6961
5506 $opt_debug
69625507 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
69635508 *import*) : ;;
69645509 *) false ;;
69655510 esac
69665511 }
69675512
6968 # func_suncc_cstd_abi
6969 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6970 # Several compiler flags select an ABI that is incompatible with the
6971 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6972 func_suncc_cstd_abi ()
6973 {
6974 $debug_cmd
6975
6976 case " $compile_command " in
6977 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6978 suncc_use_cstd_abi=no
6979 ;;
6980 *)
6981 suncc_use_cstd_abi=yes
6982 ;;
6983 esac
6984 }
6985
69865513 # func_mode_link arg...
69875514 func_mode_link ()
69885515 {
6989 $debug_cmd
6990
5516 $opt_debug
69915517 case $host in
69925518 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
69935519 # It is impossible to link a dll without this setting, and
69945520 # we shouldn't force the makefile maintainer to figure out
6995 # what system we are compiling for in order to pass an extra
5521 # which system we are compiling for in order to pass an extra
69965522 # flag for every libtool invocation.
69975523 # allow_undefined=no
69985524
69995525 # FIXME: Unfortunately, there are problems with the above when trying
7000 # to make a dll that has undefined symbols, in which case not
5526 # to make a dll which has undefined symbols, in which case not
70015527 # even a static library is built. For now, we need to specify
70025528 # -no-undefined on the libtool link line when we can be certain
70035529 # that all symbols are satisfied, otherwise we get a static library.
70415567 module=no
70425568 no_install=no
70435569 objs=
7044 os2dllname=
70455570 non_pic_objects=
70465571 precious_files_regex=
70475572 prefer_static_libs=no
7048 preload=false
5573 preload=no
70495574 prev=
70505575 prevarg=
70515576 release=
70575582 vinfo=
70585583 vinfo_number=no
70595584 weak_libs=
7060 single_module=$wl-single_module
5585 single_module="${wl}-single_module"
70615586 func_infer_tag $base_compile
70625587
70635588 # We need to know -static, to get the right output filenames.
70655590 do
70665591 case $arg in
70675592 -shared)
7068 test yes != "$build_libtool_libs" \
7069 && func_fatal_configuration "cannot build a shared library"
5593 test "$build_libtool_libs" != yes && \
5594 func_fatal_configuration "can not build a shared library"
70705595 build_old_libs=no
70715596 break
70725597 ;;
70735598 -all-static | -static | -static-libtool-libs)
70745599 case $arg in
70755600 -all-static)
7076 if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
5601 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
70775602 func_warning "complete static linking is impossible in this configuration"
70785603 fi
70795604 if test -n "$link_static_flag"; then
71065631
71075632 # Go through the arguments, transforming them on the way.
71085633 while test "$#" -gt 0; do
7109 arg=$1
5634 arg="$1"
71105635 shift
71115636 func_quote_for_eval "$arg"
71125637 qarg=$func_quote_for_eval_unquoted_result
7113 func_append libtool_args " $func_quote_for_eval_result"
5638 libtool_args+=" $func_quote_for_eval_result"
71145639
71155640 # If the previous option needs an argument, assign it.
71165641 if test -n "$prev"; then
71175642 case $prev in
71185643 output)
7119 func_append compile_command " @OUTPUT@"
7120 func_append finalize_command " @OUTPUT@"
5644 compile_command+=" @OUTPUT@"
5645 finalize_command+=" @OUTPUT@"
71215646 ;;
71225647 esac
71235648
71245649 case $prev in
71255650 bindir)
7126 bindir=$arg
5651 bindir="$arg"
71275652 prev=
71285653 continue
71295654 ;;
71305655 dlfiles|dlprefiles)
7131 $preload || {
5656 if test "$preload" = no; then
71325657 # Add the symbol object into the linking commands.
7133 func_append compile_command " @SYMFILE@"
7134 func_append finalize_command " @SYMFILE@"
7135 preload=:
7136 }
5658 compile_command+=" @SYMFILE@"
5659 finalize_command+=" @SYMFILE@"
5660 preload=yes
5661 fi
71375662 case $arg in
71385663 *.la | *.lo) ;; # We handle these cases below.
71395664 force)
7140 if test no = "$dlself"; then
5665 if test "$dlself" = no; then
71415666 dlself=needless
71425667 export_dynamic=yes
71435668 fi
71455670 continue
71465671 ;;
71475672 self)
7148 if test dlprefiles = "$prev"; then
5673 if test "$prev" = dlprefiles; then
71495674 dlself=yes
7150 elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
5675 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
71515676 dlself=yes
71525677 else
71535678 dlself=needless
71575682 continue
71585683 ;;
71595684 *)
7160 if test dlfiles = "$prev"; then
7161 func_append dlfiles " $arg"
5685 if test "$prev" = dlfiles; then
5686 dlfiles+=" $arg"
71625687 else
7163 func_append dlprefiles " $arg"
5688 dlprefiles+=" $arg"
71645689 fi
71655690 prev=
71665691 continue
71685693 esac
71695694 ;;
71705695 expsyms)
7171 export_symbols=$arg
5696 export_symbols="$arg"
71725697 test -f "$arg" \
7173 || func_fatal_error "symbol file '$arg' does not exist"
5698 || func_fatal_error "symbol file \`$arg' does not exist"
71745699 prev=
71755700 continue
71765701 ;;
71775702 expsyms_regex)
7178 export_symbols_regex=$arg
5703 export_symbols_regex="$arg"
71795704 prev=
71805705 continue
71815706 ;;
71845709 *-*-darwin*)
71855710 case "$deplibs " in
71865711 *" $qarg.ltframework "*) ;;
7187 *) func_append deplibs " $qarg.ltframework" # this is fixed later
5712 *) deplibs+=" $qarg.ltframework" # this is fixed later
71885713 ;;
71895714 esac
71905715 ;;
71935718 continue
71945719 ;;
71955720 inst_prefix)
7196 inst_prefix_dir=$arg
7197 prev=
7198 continue
7199 ;;
7200 mllvm)
7201 # Clang does not use LLVM to link, so we can simply discard any
7202 # '-mllvm $arg' options when doing the link step.
5721 inst_prefix_dir="$arg"
72035722 prev=
72045723 continue
72055724 ;;
72095728 moreargs=
72105729 for fil in `cat "$save_arg"`
72115730 do
7212 # func_append moreargs " $fil"
5731 # moreargs+=" $fil"
72135732 arg=$fil
72145733 # A libtool-controlled object.
72155734
72235742
72245743 if test -z "$pic_object" ||
72255744 test -z "$non_pic_object" ||
7226 test none = "$pic_object" &&
7227 test none = "$non_pic_object"; then
7228 func_fatal_error "cannot find name of object for '$arg'"
5745 test "$pic_object" = none &&
5746 test "$non_pic_object" = none; then
5747 func_fatal_error "cannot find name of object for \`$arg'"
72295748 fi
72305749
72315750 # Extract subdirectory from the argument.
72325751 func_dirname "$arg" "/" ""
7233 xdir=$func_dirname_result
7234
7235 if test none != "$pic_object"; then
5752 xdir="$func_dirname_result"
5753
5754 if test "$pic_object" != none; then
72365755 # Prepend the subdirectory the object is found in.
7237 pic_object=$xdir$pic_object
7238
7239 if test dlfiles = "$prev"; then
7240 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7241 func_append dlfiles " $pic_object"
5756 pic_object="$xdir$pic_object"
5757
5758 if test "$prev" = dlfiles; then
5759 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5760 dlfiles+=" $pic_object"
72425761 prev=
72435762 continue
72445763 else
72485767 fi
72495768
72505769 # CHECK ME: I think I busted this. -Ossama
7251 if test dlprefiles = "$prev"; then
5770 if test "$prev" = dlprefiles; then
72525771 # Preload the old-style object.
7253 func_append dlprefiles " $pic_object"
5772 dlprefiles+=" $pic_object"
72545773 prev=
72555774 fi
72565775
72575776 # A PIC object.
7258 func_append libobjs " $pic_object"
7259 arg=$pic_object
5777 libobjs+=" $pic_object"
5778 arg="$pic_object"
72605779 fi
72615780
72625781 # Non-PIC object.
7263 if test none != "$non_pic_object"; then
5782 if test "$non_pic_object" != none; then
72645783 # Prepend the subdirectory the object is found in.
7265 non_pic_object=$xdir$non_pic_object
5784 non_pic_object="$xdir$non_pic_object"
72665785
72675786 # A standard non-PIC object
7268 func_append non_pic_objects " $non_pic_object"
7269 if test -z "$pic_object" || test none = "$pic_object"; then
7270 arg=$non_pic_object
5787 non_pic_objects+=" $non_pic_object"
5788 if test -z "$pic_object" || test "$pic_object" = none ; then
5789 arg="$non_pic_object"
72715790 fi
72725791 else
72735792 # If the PIC object exists, use it instead.
72745793 # $xdir was prepended to $pic_object above.
7275 non_pic_object=$pic_object
7276 func_append non_pic_objects " $non_pic_object"
5794 non_pic_object="$pic_object"
5795 non_pic_objects+=" $non_pic_object"
72775796 fi
72785797 else
72795798 # Only an error if not doing a dry-run.
72805799 if $opt_dry_run; then
72815800 # Extract subdirectory from the argument.
72825801 func_dirname "$arg" "/" ""
7283 xdir=$func_dirname_result
5802 xdir="$func_dirname_result"
72845803
72855804 func_lo2o "$arg"
72865805 pic_object=$xdir$objdir/$func_lo2o_result
72875806 non_pic_object=$xdir$func_lo2o_result
7288 func_append libobjs " $pic_object"
7289 func_append non_pic_objects " $non_pic_object"
5807 libobjs+=" $pic_object"
5808 non_pic_objects+=" $non_pic_object"
72905809 else
7291 func_fatal_error "'$arg' is not a valid libtool object"
5810 func_fatal_error "\`$arg' is not a valid libtool object"
72925811 fi
72935812 fi
72945813 done
72955814 else
7296 func_fatal_error "link input file '$arg' does not exist"
5815 func_fatal_error "link input file \`$arg' does not exist"
72975816 fi
72985817 arg=$save_arg
72995818 prev=
73005819 continue
73015820 ;;
7302 os2dllname)
7303 os2dllname=$arg
7304 prev=
7305 continue
7306 ;;
73075821 precious_regex)
7308 precious_files_regex=$arg
5822 precious_files_regex="$arg"
73095823 prev=
73105824 continue
73115825 ;;
73125826 release)
7313 release=-$arg
5827 release="-$arg"
73145828 prev=
73155829 continue
73165830 ;;
73225836 func_fatal_error "only absolute run-paths are allowed"
73235837 ;;
73245838 esac
7325 if test rpath = "$prev"; then
5839 if test "$prev" = rpath; then
73265840 case "$rpath " in
73275841 *" $arg "*) ;;
7328 *) func_append rpath " $arg" ;;
5842 *) rpath+=" $arg" ;;
73295843 esac
73305844 else
73315845 case "$xrpath " in
73325846 *" $arg "*) ;;
7333 *) func_append xrpath " $arg" ;;
5847 *) xrpath+=" $arg" ;;
73345848 esac
73355849 fi
73365850 prev=
73375851 continue
73385852 ;;
73395853 shrext)
7340 shrext_cmds=$arg
5854 shrext_cmds="$arg"
73415855 prev=
73425856 continue
73435857 ;;
73445858 weak)
7345 func_append weak_libs " $arg"
5859 weak_libs+=" $arg"
73465860 prev=
73475861 continue
73485862 ;;
73495863 xcclinker)
7350 func_append linker_flags " $qarg"
7351 func_append compiler_flags " $qarg"
5864 linker_flags+=" $qarg"
5865 compiler_flags+=" $qarg"
73525866 prev=
7353 func_append compile_command " $qarg"
7354 func_append finalize_command " $qarg"
5867 compile_command+=" $qarg"
5868 finalize_command+=" $qarg"
73555869 continue
73565870 ;;
73575871 xcompiler)
7358 func_append compiler_flags " $qarg"
5872 compiler_flags+=" $qarg"
73595873 prev=
7360 func_append compile_command " $qarg"
7361 func_append finalize_command " $qarg"
5874 compile_command+=" $qarg"
5875 finalize_command+=" $qarg"
73625876 continue
73635877 ;;
73645878 xlinker)
7365 func_append linker_flags " $qarg"
7366 func_append compiler_flags " $wl$qarg"
5879 linker_flags+=" $qarg"
5880 compiler_flags+=" $wl$qarg"
73675881 prev=
7368 func_append compile_command " $wl$qarg"
7369 func_append finalize_command " $wl$qarg"
5882 compile_command+=" $wl$qarg"
5883 finalize_command+=" $wl$qarg"
73705884 continue
73715885 ;;
73725886 *)
73775891 esac
73785892 fi # test -n "$prev"
73795893
7380 prevarg=$arg
5894 prevarg="$arg"
73815895
73825896 case $arg in
73835897 -all-static)
73845898 if test -n "$link_static_flag"; then
73855899 # See comment for -static flag below, for more details.
7386 func_append compile_command " $link_static_flag"
7387 func_append finalize_command " $link_static_flag"
5900 compile_command+=" $link_static_flag"
5901 finalize_command+=" $link_static_flag"
73885902 fi
73895903 continue
73905904 ;;
73915905
73925906 -allow-undefined)
73935907 # FIXME: remove this flag sometime in the future.
7394 func_fatal_error "'-allow-undefined' must not be used because it is the default"
5908 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
73955909 ;;
73965910
73975911 -avoid-version)
74235937 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
74245938 func_fatal_error "more than one -exported-symbols argument is not allowed"
74255939 fi
7426 if test X-export-symbols = "X$arg"; then
5940 if test "X$arg" = "X-export-symbols"; then
74275941 prev=expsyms
74285942 else
74295943 prev=expsyms_regex
74465960 -L[A-Z][A-Z]*:*)
74475961 case $with_gcc/$host in
74485962 no/*-*-irix* | /*-*-irix*)
7449 func_append compile_command " $arg"
7450 func_append finalize_command " $arg"
5963 compile_command+=" $arg"
5964 finalize_command+=" $arg"
74515965 ;;
74525966 esac
74535967 continue
74575971 func_stripname "-L" '' "$arg"
74585972 if test -z "$func_stripname_result"; then
74595973 if test "$#" -gt 0; then
7460 func_fatal_error "require no space between '-L' and '$1'"
5974 func_fatal_error "require no space between \`-L' and \`$1'"
74615975 else
7462 func_fatal_error "need path for '-L' option"
5976 func_fatal_error "need path for \`-L' option"
74635977 fi
74645978 fi
74655979 func_resolve_sysroot "$func_stripname_result"
74705984 *)
74715985 absdir=`cd "$dir" && pwd`
74725986 test -z "$absdir" && \
7473 func_fatal_error "cannot determine absolute directory name of '$dir'"
7474 dir=$absdir
5987 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5988 dir="$absdir"
74755989 ;;
74765990 esac
74775991 case "$deplibs " in
74815995 *)
74825996 # Preserve sysroot, but never include relative directories
74835997 case $dir in
7484 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
7485 *) func_append deplibs " -L$dir" ;;
5998 [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs+=" $arg" ;;
5999 *) deplibs+=" -L$dir" ;;
74866000 esac
7487 func_append lib_search_path " $dir"
6001 lib_search_path+=" $dir"
74886002 ;;
74896003 esac
74906004 case $host in
74936007 case :$dllsearchpath: in
74946008 *":$dir:"*) ;;
74956009 ::) dllsearchpath=$dir;;
7496 *) func_append dllsearchpath ":$dir";;
6010 *) dllsearchpath+=":$dir";;
74976011 esac
74986012 case :$dllsearchpath: in
74996013 *":$testbindir:"*) ;;
75006014 ::) dllsearchpath=$testbindir;;
7501 *) func_append dllsearchpath ":$testbindir";;
6015 *) dllsearchpath+=":$testbindir";;
75026016 esac
75036017 ;;
75046018 esac
75066020 ;;
75076021
75086022 -l*)
7509 if test X-lc = "X$arg" || test X-lm = "X$arg"; then
6023 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
75106024 case $host in
75116025 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
75126026 # These systems don't actually have a C or math library (as such)
75146028 ;;
75156029 *-*-os2*)
75166030 # These systems don't actually have a C library (as such)
7517 test X-lc = "X$arg" && continue
6031 test "X$arg" = "X-lc" && continue
75186032 ;;
7519 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
6033 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
75206034 # Do not include libc due to us having libc/libc_r.
7521 test X-lc = "X$arg" && continue
6035 test "X$arg" = "X-lc" && continue
75226036 ;;
75236037 *-*-rhapsody* | *-*-darwin1.[012])
75246038 # Rhapsody C and math libraries are in the System framework
7525 func_append deplibs " System.ltframework"
6039 deplibs+=" System.ltframework"
75266040 continue
75276041 ;;
75286042 *-*-sco3.2v5* | *-*-sco5v6*)
75296043 # Causes problems with __ctype
7530 test X-lc = "X$arg" && continue
6044 test "X$arg" = "X-lc" && continue
75316045 ;;
75326046 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
75336047 # Compiler inserts libc in the correct place for threads to work
7534 test X-lc = "X$arg" && continue
6048 test "X$arg" = "X-lc" && continue
75356049 ;;
75366050 esac
7537 elif test X-lc_r = "X$arg"; then
6051 elif test "X$arg" = "X-lc_r"; then
75386052 case $host in
7539 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
6053 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
75406054 # Do not include libc_r directly, use -pthread flag.
75416055 continue
75426056 ;;
75436057 esac
75446058 fi
7545 func_append deplibs " $arg"
7546 continue
7547 ;;
7548
7549 -mllvm)
7550 prev=mllvm
6059 deplibs+=" $arg"
75516060 continue
75526061 ;;
75536062
75606069 # classes, name mangling, and exception handling.
75616070 # Darwin uses the -arch flag to determine output architecture.
75626071 -model|-arch|-isysroot|--sysroot)
7563 func_append compiler_flags " $arg"
7564 func_append compile_command " $arg"
7565 func_append finalize_command " $arg"
6072 compiler_flags+=" $arg"
6073 compile_command+=" $arg"
6074 finalize_command+=" $arg"
75666075 prev=xcompiler
75676076 continue
75686077 ;;
75696078
75706079 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
75716080 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7572 func_append compiler_flags " $arg"
7573 func_append compile_command " $arg"
7574 func_append finalize_command " $arg"
6081 compiler_flags+=" $arg"
6082 compile_command+=" $arg"
6083 finalize_command+=" $arg"
75756084 case "$new_inherited_linker_flags " in
75766085 *" $arg "*) ;;
7577 * ) func_append new_inherited_linker_flags " $arg" ;;
6086 * ) new_inherited_linker_flags+=" $arg" ;;
75786087 esac
75796088 continue
75806089 ;;
75816090
75826091 -multi_module)
7583 single_module=$wl-multi_module
6092 single_module="${wl}-multi_module"
75846093 continue
75856094 ;;
75866095
75946103 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
75956104 # The PATH hackery in wrapper scripts is required on Windows
75966105 # and Darwin in order for the loader to find any dlls it needs.
7597 func_warning "'-no-install' is ignored for $host"
7598 func_warning "assuming '-no-fast-install' instead"
6106 func_warning "\`-no-install' is ignored for $host"
6107 func_warning "assuming \`-no-fast-install' instead"
75996108 fast_install=no
76006109 ;;
76016110 *) no_install=yes ;;
76106119
76116120 -objectlist)
76126121 prev=objectlist
7613 continue
7614 ;;
7615
7616 -os2dllname)
7617 prev=os2dllname
76186122 continue
76196123 ;;
76206124
76566160 esac
76576161 case "$xrpath " in
76586162 *" $dir "*) ;;
7659 *) func_append xrpath " $dir" ;;
6163 *) xrpath+=" $dir" ;;
76606164 esac
76616165 continue
76626166 ;;
77056209 func_stripname '-Wc,' '' "$arg"
77066210 args=$func_stripname_result
77076211 arg=
7708 save_ifs=$IFS; IFS=,
6212 save_ifs="$IFS"; IFS=','
77096213 for flag in $args; do
7710 IFS=$save_ifs
6214 IFS="$save_ifs"
77116215 func_quote_for_eval "$flag"
7712 func_append arg " $func_quote_for_eval_result"
7713 func_append compiler_flags " $func_quote_for_eval_result"
6216 arg+=" $func_quote_for_eval_result"
6217 compiler_flags+=" $func_quote_for_eval_result"
77146218 done
7715 IFS=$save_ifs
6219 IFS="$save_ifs"
77166220 func_stripname ' ' '' "$arg"
77176221 arg=$func_stripname_result
77186222 ;;
77216225 func_stripname '-Wl,' '' "$arg"
77226226 args=$func_stripname_result
77236227 arg=
7724 save_ifs=$IFS; IFS=,
6228 save_ifs="$IFS"; IFS=','
77256229 for flag in $args; do
7726 IFS=$save_ifs
6230 IFS="$save_ifs"
77276231 func_quote_for_eval "$flag"
7728 func_append arg " $wl$func_quote_for_eval_result"
7729 func_append compiler_flags " $wl$func_quote_for_eval_result"
7730 func_append linker_flags " $func_quote_for_eval_result"
6232 arg+=" $wl$func_quote_for_eval_result"
6233 compiler_flags+=" $wl$func_quote_for_eval_result"
6234 linker_flags+=" $func_quote_for_eval_result"
77316235 done
7732 IFS=$save_ifs
6236 IFS="$save_ifs"
77336237 func_stripname ' ' '' "$arg"
77346238 arg=$func_stripname_result
77356239 ;;
77526256 # -msg_* for osf cc
77536257 -msg_*)
77546258 func_quote_for_eval "$arg"
7755 arg=$func_quote_for_eval_result
6259 arg="$func_quote_for_eval_result"
77566260 ;;
77576261
77586262 # Flags to be passed through unchanged, with rationale:
77646268 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
77656269 # -F/path path to uninstalled frameworks, gcc on darwin
77666270 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7767 # -fstack-protector* stack protector flags for GCC
77686271 # @file GCC response files
77696272 # -tp=* Portland pgcc target processor selection
77706273 # --sysroot=* for sysroot support
7771 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7772 # -stdlib=* select c++ std lib with clang
6274 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
77736275 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
77746276 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7775 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
6277 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
77766278 func_quote_for_eval "$arg"
7777 arg=$func_quote_for_eval_result
7778 func_append compile_command " $arg"
7779 func_append finalize_command " $arg"
7780 func_append compiler_flags " $arg"
6279 arg="$func_quote_for_eval_result"
6280 compile_command+=" $arg"
6281 finalize_command+=" $arg"
6282 compiler_flags+=" $arg"
77816283 continue
77826284 ;;
7783
7784 -Z*)
7785 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7786 # OS/2 uses -Zxxx to specify OS/2-specific options
7787 compiler_flags="$compiler_flags $arg"
7788 func_append compile_command " $arg"
7789 func_append finalize_command " $arg"
7790 case $arg in
7791 -Zlinker | -Zstack)
7792 prev=xcompiler
7793 ;;
7794 esac
7795 continue
7796 else
7797 # Otherwise treat like 'Some other compiler flag' below
7798 func_quote_for_eval "$arg"
7799 arg=$func_quote_for_eval_result
7800 fi
7801 ;;
78026285
78036286 # Some other compiler flag.
78046287 -* | +*)
78056288 func_quote_for_eval "$arg"
7806 arg=$func_quote_for_eval_result
6289 arg="$func_quote_for_eval_result"
78076290 ;;
78086291
78096292 *.$objext)
78106293 # A standard object.
7811 func_append objs " $arg"
6294 objs+=" $arg"
78126295 ;;
78136296
78146297 *.lo)
78246307
78256308 if test -z "$pic_object" ||
78266309 test -z "$non_pic_object" ||
7827 test none = "$pic_object" &&
7828 test none = "$non_pic_object"; then
7829 func_fatal_error "cannot find name of object for '$arg'"
6310 test "$pic_object" = none &&
6311 test "$non_pic_object" = none; then
6312 func_fatal_error "cannot find name of object for \`$arg'"
78306313 fi
78316314
78326315 # Extract subdirectory from the argument.
78336316 func_dirname "$arg" "/" ""
7834 xdir=$func_dirname_result
7835
7836 test none = "$pic_object" || {
6317 xdir="$func_dirname_result"
6318
6319 if test "$pic_object" != none; then
78376320 # Prepend the subdirectory the object is found in.
7838 pic_object=$xdir$pic_object
7839
7840 if test dlfiles = "$prev"; then
7841 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
7842 func_append dlfiles " $pic_object"
6321 pic_object="$xdir$pic_object"
6322
6323 if test "$prev" = dlfiles; then
6324 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6325 dlfiles+=" $pic_object"
78436326 prev=
78446327 continue
78456328 else
78496332 fi
78506333
78516334 # CHECK ME: I think I busted this. -Ossama
7852 if test dlprefiles = "$prev"; then
6335 if test "$prev" = dlprefiles; then
78536336 # Preload the old-style object.
7854 func_append dlprefiles " $pic_object"
6337 dlprefiles+=" $pic_object"
78556338 prev=
78566339 fi
78576340
78586341 # A PIC object.
7859 func_append libobjs " $pic_object"
7860 arg=$pic_object
7861 }
6342 libobjs+=" $pic_object"
6343 arg="$pic_object"
6344 fi
78626345
78636346 # Non-PIC object.
7864 if test none != "$non_pic_object"; then
6347 if test "$non_pic_object" != none; then
78656348 # Prepend the subdirectory the object is found in.
7866 non_pic_object=$xdir$non_pic_object
6349 non_pic_object="$xdir$non_pic_object"
78676350
78686351 # A standard non-PIC object
7869 func_append non_pic_objects " $non_pic_object"
7870 if test -z "$pic_object" || test none = "$pic_object"; then
7871 arg=$non_pic_object
6352 non_pic_objects+=" $non_pic_object"
6353 if test -z "$pic_object" || test "$pic_object" = none ; then
6354 arg="$non_pic_object"
78726355 fi
78736356 else
78746357 # If the PIC object exists, use it instead.
78756358 # $xdir was prepended to $pic_object above.
7876 non_pic_object=$pic_object
7877 func_append non_pic_objects " $non_pic_object"
6359 non_pic_object="$pic_object"
6360 non_pic_objects+=" $non_pic_object"
78786361 fi
78796362 else
78806363 # Only an error if not doing a dry-run.
78816364 if $opt_dry_run; then
78826365 # Extract subdirectory from the argument.
78836366 func_dirname "$arg" "/" ""
7884 xdir=$func_dirname_result
6367 xdir="$func_dirname_result"
78856368
78866369 func_lo2o "$arg"
78876370 pic_object=$xdir$objdir/$func_lo2o_result
78886371 non_pic_object=$xdir$func_lo2o_result
7889 func_append libobjs " $pic_object"
7890 func_append non_pic_objects " $non_pic_object"
6372 libobjs+=" $pic_object"
6373 non_pic_objects+=" $non_pic_object"
78916374 else
7892 func_fatal_error "'$arg' is not a valid libtool object"
6375 func_fatal_error "\`$arg' is not a valid libtool object"
78936376 fi
78946377 fi
78956378 ;;
78966379
78976380 *.$libext)
78986381 # An archive.
7899 func_append deplibs " $arg"
7900 func_append old_deplibs " $arg"
6382 deplibs+=" $arg"
6383 old_deplibs+=" $arg"
79016384 continue
79026385 ;;
79036386
79056388 # A libtool-controlled library.
79066389
79076390 func_resolve_sysroot "$arg"
7908 if test dlfiles = "$prev"; then
6391 if test "$prev" = dlfiles; then
79096392 # This library was specified with -dlopen.
7910 func_append dlfiles " $func_resolve_sysroot_result"
6393 dlfiles+=" $func_resolve_sysroot_result"
79116394 prev=
7912 elif test dlprefiles = "$prev"; then
6395 elif test "$prev" = dlprefiles; then
79136396 # The library was specified with -dlpreopen.
7914 func_append dlprefiles " $func_resolve_sysroot_result"
6397 dlprefiles+=" $func_resolve_sysroot_result"
79156398 prev=
79166399 else
7917 func_append deplibs " $func_resolve_sysroot_result"
6400 deplibs+=" $func_resolve_sysroot_result"
79186401 fi
79196402 continue
79206403 ;;
79246407 # Unknown arguments in both finalize_command and compile_command need
79256408 # to be aesthetically quoted because they are evaled later.
79266409 func_quote_for_eval "$arg"
7927 arg=$func_quote_for_eval_result
6410 arg="$func_quote_for_eval_result"
79286411 ;;
79296412 esac # arg
79306413
79316414 # Now actually substitute the argument into the commands.
79326415 if test -n "$arg"; then
7933 func_append compile_command " $arg"
7934 func_append finalize_command " $arg"
6416 compile_command+=" $arg"
6417 finalize_command+=" $arg"
79356418 fi
79366419 done # argument parsing loop
79376420
79386421 test -n "$prev" && \
7939 func_fatal_help "the '$prevarg' option requires an argument"
7940
7941 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
6422 func_fatal_help "the \`$prevarg' option requires an argument"
6423
6424 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
79426425 eval arg=\"$export_dynamic_flag_spec\"
7943 func_append compile_command " $arg"
7944 func_append finalize_command " $arg"
6426 compile_command+=" $arg"
6427 finalize_command+=" $arg"
79456428 fi
79466429
79476430 oldlibs=
79486431 # calculate the name of the file, without its directory
79496432 func_basename "$output"
7950 outputname=$func_basename_result
7951 libobjs_save=$libobjs
6433 outputname="$func_basename_result"
6434 libobjs_save="$libobjs"
79526435
79536436 if test -n "$shlibpath_var"; then
79546437 # get the directories listed in $shlibpath_var
7955 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
6438 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
79566439 else
79576440 shlib_search_path=
79586441 fi
79596442 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
79606443 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
79616444
7962 # Definition is injected by LT_CONFIG during libtool generation.
7963 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7964
79656445 func_dirname "$output" "/" ""
7966 output_objdir=$func_dirname_result$objdir
6446 output_objdir="$func_dirname_result$objdir"
79676447 func_to_tool_file "$output_objdir/"
79686448 tool_output_objdir=$func_to_tool_file_result
79696449 # Create the object directory.
79866466 # Find all interdependent deplibs by searching for libraries
79876467 # that are linked more than once (e.g. -la -lb -la)
79886468 for deplib in $deplibs; do
7989 if $opt_preserve_dup_deps; then
6469 if $opt_preserve_dup_deps ; then
79906470 case "$libs " in
7991 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6471 *" $deplib "*) specialdeplibs+=" $deplib" ;;
79926472 esac
79936473 fi
7994 func_append libs " $deplib"
6474 libs+=" $deplib"
79956475 done
79966476
7997 if test lib = "$linkmode"; then
6477 if test "$linkmode" = lib; then
79986478 libs="$predeps $libs $compiler_lib_search_path $postdeps"
79996479
80006480 # Compute libraries that are listed more than once in $predeps
80046484 if $opt_duplicate_compiler_generated_deps; then
80056485 for pre_post_dep in $predeps $postdeps; do
80066486 case "$pre_post_deps " in
8007 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6487 *" $pre_post_dep "*) specialdeplibs+=" $pre_post_deps" ;;
80086488 esac
8009 func_append pre_post_deps " $pre_post_dep"
6489 pre_post_deps+=" $pre_post_dep"
80106490 done
80116491 fi
80126492 pre_post_deps=
80266506 case $file in
80276507 *.la) ;;
80286508 *)
8029 func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
6509 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
80306510 ;;
80316511 esac
80326512 done
80346514 prog)
80356515 compile_deplibs=
80366516 finalize_deplibs=
8037 alldeplibs=false
6517 alldeplibs=no
80386518 newdlfiles=
80396519 newdlprefiles=
80406520 passes="conv scan dlopen dlpreopen link"
80466526 for pass in $passes; do
80476527 # The preopen pass in lib mode reverses $deplibs; put it back here
80486528 # so that -L comes before libs that need it for instance...
8049 if test lib,link = "$linkmode,$pass"; then
6529 if test "$linkmode,$pass" = "lib,link"; then
80506530 ## FIXME: Find the place where the list is rebuilt in the wrong
80516531 ## order, and fix it there properly
80526532 tmp_deplibs=
80536533 for deplib in $deplibs; do
80546534 tmp_deplibs="$deplib $tmp_deplibs"
80556535 done
8056 deplibs=$tmp_deplibs
6536 deplibs="$tmp_deplibs"
80576537 fi
80586538
8059 if test lib,link = "$linkmode,$pass" ||
8060 test prog,scan = "$linkmode,$pass"; then
8061 libs=$deplibs
6539 if test "$linkmode,$pass" = "lib,link" ||
6540 test "$linkmode,$pass" = "prog,scan"; then
6541 libs="$deplibs"
80626542 deplibs=
80636543 fi
8064 if test prog = "$linkmode"; then
6544 if test "$linkmode" = prog; then
80656545 case $pass in
8066 dlopen) libs=$dlfiles ;;
8067 dlpreopen) libs=$dlprefiles ;;
8068 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6546 dlopen) libs="$dlfiles" ;;
6547 dlpreopen) libs="$dlprefiles" ;;
6548 link)
6549 libs="$deplibs %DEPLIBS%"
6550 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
6551 ;;
80696552 esac
80706553 fi
8071 if test lib,dlpreopen = "$linkmode,$pass"; then
6554 if test "$linkmode,$pass" = "lib,dlpreopen"; then
80726555 # Collect and forward deplibs of preopened libtool libs
80736556 for lib in $dlprefiles; do
80746557 # Ignore non-libtool-libs
80856568 deplib_base=$func_basename_result
80866569 case " $weak_libs " in
80876570 *" $deplib_base "*) ;;
8088 *) func_append deplibs " $deplib" ;;
6571 *) deplibs+=" $deplib" ;;
80896572 esac
80906573 done
80916574 done
8092 libs=$dlprefiles
6575 libs="$dlprefiles"
80936576 fi
8094 if test dlopen = "$pass"; then
6577 if test "$pass" = dlopen; then
80956578 # Collect dlpreopened libraries
8096 save_deplibs=$deplibs
6579 save_deplibs="$deplibs"
80976580 deplibs=
80986581 fi
80996582
81006583 for deplib in $libs; do
81016584 lib=
8102 found=false
6585 found=no
81036586 case $deplib in
81046587 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
81056588 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
8106 if test prog,link = "$linkmode,$pass"; then
6589 if test "$linkmode,$pass" = "prog,link"; then
81076590 compile_deplibs="$deplib $compile_deplibs"
81086591 finalize_deplibs="$deplib $finalize_deplibs"
81096592 else
8110 func_append compiler_flags " $deplib"
8111 if test lib = "$linkmode"; then
6593 compiler_flags+=" $deplib"
6594 if test "$linkmode" = lib ; then
81126595 case "$new_inherited_linker_flags " in
81136596 *" $deplib "*) ;;
8114 * ) func_append new_inherited_linker_flags " $deplib" ;;
6597 * ) new_inherited_linker_flags+=" $deplib" ;;
81156598 esac
81166599 fi
81176600 fi
81186601 continue
81196602 ;;
81206603 -l*)
8121 if test lib != "$linkmode" && test prog != "$linkmode"; then
8122 func_warning "'-l' is ignored for archives/objects"
6604 if test "$linkmode" != lib && test "$linkmode" != prog; then
6605 func_warning "\`-l' is ignored for archives/objects"
81236606 continue
81246607 fi
81256608 func_stripname '-l' '' "$deplib"
81266609 name=$func_stripname_result
8127 if test lib = "$linkmode"; then
6610 if test "$linkmode" = lib; then
81286611 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
81296612 else
81306613 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
81326615 for searchdir in $searchdirs; do
81336616 for search_ext in .la $std_shrext .so .a; do
81346617 # Search the libtool library
8135 lib=$searchdir/lib$name$search_ext
6618 lib="$searchdir/lib${name}${search_ext}"
81366619 if test -f "$lib"; then
8137 if test .la = "$search_ext"; then
8138 found=:
6620 if test "$search_ext" = ".la"; then
6621 found=yes
81396622 else
8140 found=false
6623 found=no
81416624 fi
81426625 break 2
81436626 fi
81446627 done
81456628 done
8146 if $found; then
8147 # deplib is a libtool library
6629 if test "$found" != yes; then
6630 # deplib doesn't seem to be a libtool library
6631 if test "$linkmode,$pass" = "prog,link"; then
6632 compile_deplibs="$deplib $compile_deplibs"
6633 finalize_deplibs="$deplib $finalize_deplibs"
6634 else
6635 deplibs="$deplib $deplibs"
6636 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6637 fi
6638 continue
6639 else # deplib is a libtool library
81486640 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
81496641 # We need to do some special things here, and not later.
8150 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6642 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
81516643 case " $predeps $postdeps " in
81526644 *" $deplib "*)
81536645 if func_lalib_p "$lib"; then
81556647 old_library=
81566648 func_source "$lib"
81576649 for l in $old_library $library_names; do
8158 ll=$l
6650 ll="$l"
81596651 done
8160 if test "X$ll" = "X$old_library"; then # only static version available
8161 found=false
6652 if test "X$ll" = "X$old_library" ; then # only static version available
6653 found=no
81626654 func_dirname "$lib" "" "."
8163 ladir=$func_dirname_result
6655 ladir="$func_dirname_result"
81646656 lib=$ladir/$old_library
8165 if test prog,link = "$linkmode,$pass"; then
6657 if test "$linkmode,$pass" = "prog,link"; then
81666658 compile_deplibs="$deplib $compile_deplibs"
81676659 finalize_deplibs="$deplib $finalize_deplibs"
81686660 else
81696661 deplibs="$deplib $deplibs"
8170 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
6662 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
81716663 fi
81726664 continue
81736665 fi
81766668 *) ;;
81776669 esac
81786670 fi
8179 else
8180 # deplib doesn't seem to be a libtool library
8181 if test prog,link = "$linkmode,$pass"; then
8182 compile_deplibs="$deplib $compile_deplibs"
8183 finalize_deplibs="$deplib $finalize_deplibs"
8184 else
8185 deplibs="$deplib $deplibs"
8186 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
8187 fi
8188 continue
81896671 fi
81906672 ;; # -l
81916673 *.ltframework)
8192 if test prog,link = "$linkmode,$pass"; then
6674 if test "$linkmode,$pass" = "prog,link"; then
81936675 compile_deplibs="$deplib $compile_deplibs"
81946676 finalize_deplibs="$deplib $finalize_deplibs"
81956677 else
81966678 deplibs="$deplib $deplibs"
8197 if test lib = "$linkmode"; then
6679 if test "$linkmode" = lib ; then
81986680 case "$new_inherited_linker_flags " in
81996681 *" $deplib "*) ;;
8200 * ) func_append new_inherited_linker_flags " $deplib" ;;
6682 * ) new_inherited_linker_flags+=" $deplib" ;;
82016683 esac
82026684 fi
82036685 fi
82076689 case $linkmode in
82086690 lib)
82096691 deplibs="$deplib $deplibs"
8210 test conv = "$pass" && continue
6692 test "$pass" = conv && continue
82116693 newdependency_libs="$deplib $newdependency_libs"
82126694 func_stripname '-L' '' "$deplib"
82136695 func_resolve_sysroot "$func_stripname_result"
8214 func_append newlib_search_path " $func_resolve_sysroot_result"
6696 newlib_search_path+=" $func_resolve_sysroot_result"
82156697 ;;
82166698 prog)
8217 if test conv = "$pass"; then
6699 if test "$pass" = conv; then
82186700 deplibs="$deplib $deplibs"
82196701 continue
82206702 fi
8221 if test scan = "$pass"; then
6703 if test "$pass" = scan; then
82226704 deplibs="$deplib $deplibs"
82236705 else
82246706 compile_deplibs="$deplib $compile_deplibs"
82266708 fi
82276709 func_stripname '-L' '' "$deplib"
82286710 func_resolve_sysroot "$func_stripname_result"
8229 func_append newlib_search_path " $func_resolve_sysroot_result"
6711 newlib_search_path+=" $func_resolve_sysroot_result"
82306712 ;;
82316713 *)
8232 func_warning "'-L' is ignored for archives/objects"
6714 func_warning "\`-L' is ignored for archives/objects"
82336715 ;;
82346716 esac # linkmode
82356717 continue
82366718 ;; # -L
82376719 -R*)
8238 if test link = "$pass"; then
6720 if test "$pass" = link; then
82396721 func_stripname '-R' '' "$deplib"
82406722 func_resolve_sysroot "$func_stripname_result"
82416723 dir=$func_resolve_sysroot_result
82426724 # Make sure the xrpath contains only unique directories.
82436725 case "$xrpath " in
82446726 *" $dir "*) ;;
8245 *) func_append xrpath " $dir" ;;
6727 *) xrpath+=" $dir" ;;
82466728 esac
82476729 fi
82486730 deplibs="$deplib $deplibs"
82536735 lib=$func_resolve_sysroot_result
82546736 ;;
82556737 *.$libext)
8256 if test conv = "$pass"; then
6738 if test "$pass" = conv; then
82576739 deplibs="$deplib $deplibs"
82586740 continue
82596741 fi
82646746 case " $dlpreconveniencelibs " in
82656747 *" $deplib "*) ;;
82666748 *)
8267 valid_a_lib=false
6749 valid_a_lib=no
82686750 case $deplibs_check_method in
82696751 match_pattern*)
82706752 set dummy $deplibs_check_method; shift
82716753 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
82726754 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
82736755 | $EGREP "$match_pattern_regex" > /dev/null; then
8274 valid_a_lib=:
6756 valid_a_lib=yes
82756757 fi
82766758 ;;
82776759 pass_all)
8278 valid_a_lib=:
6760 valid_a_lib=yes
82796761 ;;
82806762 esac
8281 if $valid_a_lib; then
8282 echo
8283 $ECHO "*** Warning: Linking the shared library $output against the"
8284 $ECHO "*** static library $deplib is not portable!"
8285 deplibs="$deplib $deplibs"
8286 else
6763 if test "$valid_a_lib" != yes; then
82876764 echo
82886765 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
82896766 echo "*** I have the capability to make that library automatically link in when"
82916768 echo "*** shared version of the library, which you do not appear to have"
82926769 echo "*** because the file extensions .$libext of this argument makes me believe"
82936770 echo "*** that it is just a static archive that I should not use here."
6771 else
6772 echo
6773 $ECHO "*** Warning: Linking the shared library $output against the"
6774 $ECHO "*** static library $deplib is not portable!"
6775 deplibs="$deplib $deplibs"
82946776 fi
82956777 ;;
82966778 esac
82976779 continue
82986780 ;;
82996781 prog)
8300 if test link != "$pass"; then
6782 if test "$pass" != link; then
83016783 deplibs="$deplib $deplibs"
83026784 else
83036785 compile_deplibs="$deplib $compile_deplibs"
83086790 esac # linkmode
83096791 ;; # *.$libext
83106792 *.lo | *.$objext)
8311 if test conv = "$pass"; then
6793 if test "$pass" = conv; then
83126794 deplibs="$deplib $deplibs"
8313 elif test prog = "$linkmode"; then
8314 if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
6795 elif test "$linkmode" = prog; then
6796 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
83156797 # If there is no dlopen support or we're linking statically,
83166798 # we need to preload.
8317 func_append newdlprefiles " $deplib"
6799 newdlprefiles+=" $deplib"
83186800 compile_deplibs="$deplib $compile_deplibs"
83196801 finalize_deplibs="$deplib $finalize_deplibs"
83206802 else
8321 func_append newdlfiles " $deplib"
6803 newdlfiles+=" $deplib"
83226804 fi
83236805 fi
83246806 continue
83256807 ;;
83266808 %DEPLIBS%)
8327 alldeplibs=:
6809 alldeplibs=yes
83286810 continue
83296811 ;;
83306812 esac # case $deplib
83316813
8332 $found || test -f "$lib" \
8333 || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
6814 if test "$found" = yes || test -f "$lib"; then :
6815 else
6816 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6817 fi
83346818
83356819 # Check to see that this really is a libtool archive.
83366820 func_lalib_unsafe_p "$lib" \
8337 || func_fatal_error "'$lib' is not a valid libtool archive"
6821 || func_fatal_error "\`$lib' is not a valid libtool archive"
83386822
83396823 func_dirname "$lib" "" "."
8340 ladir=$func_dirname_result
6824 ladir="$func_dirname_result"
83416825
83426826 dlname=
83436827 dlopen=
83626846 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
83636847 case " $new_inherited_linker_flags " in
83646848 *" $tmp_inherited_linker_flag "*) ;;
8365 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6849 *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
83666850 esac
83676851 done
83686852 fi
83696853 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8370 if test lib,link = "$linkmode,$pass" ||
8371 test prog,scan = "$linkmode,$pass" ||
8372 { test prog != "$linkmode" && test lib != "$linkmode"; }; then
8373 test -n "$dlopen" && func_append dlfiles " $dlopen"
8374 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6854 if test "$linkmode,$pass" = "lib,link" ||
6855 test "$linkmode,$pass" = "prog,scan" ||
6856 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6857 test -n "$dlopen" && dlfiles+=" $dlopen"
6858 test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
83756859 fi
83766860
8377 if test conv = "$pass"; then
6861 if test "$pass" = conv; then
83786862 # Only check for convenience libraries
83796863 deplibs="$lib $deplibs"
83806864 if test -z "$libdir"; then
83816865 if test -z "$old_library"; then
8382 func_fatal_error "cannot find name of link library for '$lib'"
6866 func_fatal_error "cannot find name of link library for \`$lib'"
83836867 fi
83846868 # It is a libtool convenience library, so add in its objects.
8385 func_append convenience " $ladir/$objdir/$old_library"
8386 func_append old_convenience " $ladir/$objdir/$old_library"
8387 elif test prog != "$linkmode" && test lib != "$linkmode"; then
8388 func_fatal_error "'$lib' is not a convenience library"
6869 convenience+=" $ladir/$objdir/$old_library"
6870 old_convenience+=" $ladir/$objdir/$old_library"
6871 tmp_libs=
6872 for deplib in $dependency_libs; do
6873 deplibs="$deplib $deplibs"
6874 if $opt_preserve_dup_deps ; then
6875 case "$tmp_libs " in
6876 *" $deplib "*) specialdeplibs+=" $deplib" ;;
6877 esac
6878 fi
6879 tmp_libs+=" $deplib"
6880 done
6881 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6882 func_fatal_error "\`$lib' is not a convenience library"
83896883 fi
8390 tmp_libs=
8391 for deplib in $dependency_libs; do
8392 deplibs="$deplib $deplibs"
8393 if $opt_preserve_dup_deps; then
8394 case "$tmp_libs " in
8395 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8396 esac
8397 fi
8398 func_append tmp_libs " $deplib"
8399 done
84006884 continue
84016885 fi # $pass = conv
84026886
84046888 # Get the name of the library we link against.
84056889 linklib=
84066890 if test -n "$old_library" &&
8407 { test yes = "$prefer_static_libs" ||
8408 test built,no = "$prefer_static_libs,$installed"; }; then
6891 { test "$prefer_static_libs" = yes ||
6892 test "$prefer_static_libs,$installed" = "built,no"; }; then
84096893 linklib=$old_library
84106894 else
84116895 for l in $old_library $library_names; do
8412 linklib=$l
6896 linklib="$l"
84136897 done
84146898 fi
84156899 if test -z "$linklib"; then
8416 func_fatal_error "cannot find name of link library for '$lib'"
6900 func_fatal_error "cannot find name of link library for \`$lib'"
84176901 fi
84186902
84196903 # This library was specified with -dlopen.
8420 if test dlopen = "$pass"; then
8421 test -z "$libdir" \
8422 && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
6904 if test "$pass" = dlopen; then
6905 if test -z "$libdir"; then
6906 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6907 fi
84236908 if test -z "$dlname" ||
8424 test yes != "$dlopen_support" ||
8425 test no = "$build_libtool_libs"
8426 then
6909 test "$dlopen_support" != yes ||
6910 test "$build_libtool_libs" = no; then
84276911 # If there is no dlname, no dlopen support or we're linking
84286912 # statically, we need to preload. We also need to preload any
84296913 # dependent libraries so libltdl's deplib preloader doesn't
84306914 # bomb out in the load deplibs phase.
8431 func_append dlprefiles " $lib $dependency_libs"
6915 dlprefiles+=" $lib $dependency_libs"
84326916 else
8433 func_append newdlfiles " $lib"
6917 newdlfiles+=" $lib"
84346918 fi
84356919 continue
84366920 fi # $pass = dlopen
84376921
84386922 # We need an absolute path.
84396923 case $ladir in
8440 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
6924 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
84416925 *)
84426926 abs_ladir=`cd "$ladir" && pwd`
84436927 if test -z "$abs_ladir"; then
8444 func_warning "cannot determine absolute directory name of '$ladir'"
6928 func_warning "cannot determine absolute directory name of \`$ladir'"
84456929 func_warning "passing it literally to the linker, although it might fail"
8446 abs_ladir=$ladir
6930 abs_ladir="$ladir"
84476931 fi
84486932 ;;
84496933 esac
84506934 func_basename "$lib"
8451 laname=$func_basename_result
6935 laname="$func_basename_result"
84526936
84536937 # Find the relevant object directory and library name.
8454 if test yes = "$installed"; then
6938 if test "X$installed" = Xyes; then
84556939 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8456 func_warning "library '$lib' was moved."
8457 dir=$ladir
8458 absdir=$abs_ladir
8459 libdir=$abs_ladir
6940 func_warning "library \`$lib' was moved."
6941 dir="$ladir"
6942 absdir="$abs_ladir"
6943 libdir="$abs_ladir"
84606944 else
8461 dir=$lt_sysroot$libdir
8462 absdir=$lt_sysroot$libdir
6945 dir="$lt_sysroot$libdir"
6946 absdir="$lt_sysroot$libdir"
84636947 fi
8464 test yes = "$hardcode_automatic" && avoidtemprpath=yes
6948 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
84656949 else
84666950 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
8467 dir=$ladir
8468 absdir=$abs_ladir
6951 dir="$ladir"
6952 absdir="$abs_ladir"
84696953 # Remove this search path later
8470 func_append notinst_path " $abs_ladir"
6954 notinst_path+=" $abs_ladir"
84716955 else
8472 dir=$ladir/$objdir
8473 absdir=$abs_ladir/$objdir
6956 dir="$ladir/$objdir"
6957 absdir="$abs_ladir/$objdir"
84746958 # Remove this search path later
8475 func_append notinst_path " $abs_ladir"
6959 notinst_path+=" $abs_ladir"
84766960 fi
84776961 fi # $installed = yes
84786962 func_stripname 'lib' '.la' "$laname"
84796963 name=$func_stripname_result
84806964
84816965 # This library was specified with -dlpreopen.
8482 if test dlpreopen = "$pass"; then
8483 if test -z "$libdir" && test prog = "$linkmode"; then
8484 func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
6966 if test "$pass" = dlpreopen; then
6967 if test -z "$libdir" && test "$linkmode" = prog; then
6968 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
84856969 fi
8486 case $host in
6970 case "$host" in
84876971 # special handling for platforms with PE-DLLs.
84886972 *cygwin* | *mingw* | *cegcc* )
84896973 # Linker will automatically link against shared library if both
84976981 if test -n "$dlname"; then
84986982 func_tr_sh "$dir/$linklib"
84996983 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
8500 func_append newdlprefiles " $dir/$linklib"
6984 newdlprefiles+=" $dir/$linklib"
85016985 else
8502 func_append newdlprefiles " $dir/$old_library"
6986 newdlprefiles+=" $dir/$old_library"
85036987 # Keep a list of preopened convenience libraries to check
85046988 # that they are being used correctly in the link pass.
85056989 test -z "$libdir" && \
8506 func_append dlpreconveniencelibs " $dir/$old_library"
6990 dlpreconveniencelibs+=" $dir/$old_library"
85076991 fi
85086992 ;;
85096993 * )
85106994 # Prefer using a static library (so that no silly _DYNAMIC symbols
85116995 # are required to link).
85126996 if test -n "$old_library"; then
8513 func_append newdlprefiles " $dir/$old_library"
6997 newdlprefiles+=" $dir/$old_library"
85146998 # Keep a list of preopened convenience libraries to check
85156999 # that they are being used correctly in the link pass.
85167000 test -z "$libdir" && \
8517 func_append dlpreconveniencelibs " $dir/$old_library"
7001 dlpreconveniencelibs+=" $dir/$old_library"
85187002 # Otherwise, use the dlname, so that lt_dlopen finds it.
85197003 elif test -n "$dlname"; then
8520 func_append newdlprefiles " $dir/$dlname"
7004 newdlprefiles+=" $dir/$dlname"
85217005 else
8522 func_append newdlprefiles " $dir/$linklib"
7006 newdlprefiles+=" $dir/$linklib"
85237007 fi
85247008 ;;
85257009 esac
85277011
85287012 if test -z "$libdir"; then
85297013 # Link the convenience library
8530 if test lib = "$linkmode"; then
7014 if test "$linkmode" = lib; then
85317015 deplibs="$dir/$old_library $deplibs"
8532 elif test prog,link = "$linkmode,$pass"; then
7016 elif test "$linkmode,$pass" = "prog,link"; then
85337017 compile_deplibs="$dir/$old_library $compile_deplibs"
85347018 finalize_deplibs="$dir/$old_library $finalize_deplibs"
85357019 else
85397023 fi
85407024
85417025
8542 if test prog = "$linkmode" && test link != "$pass"; then
8543 func_append newlib_search_path " $ladir"
7026 if test "$linkmode" = prog && test "$pass" != link; then
7027 newlib_search_path+=" $ladir"
85447028 deplibs="$lib $deplibs"
85457029
8546 linkalldeplibs=false
8547 if test no != "$link_all_deplibs" || test -z "$library_names" ||
8548 test no = "$build_libtool_libs"; then
8549 linkalldeplibs=:
7030 linkalldeplibs=no
7031 if test "$link_all_deplibs" != no || test -z "$library_names" ||
7032 test "$build_libtool_libs" = no; then
7033 linkalldeplibs=yes
85507034 fi
85517035
85527036 tmp_libs=
85547038 case $deplib in
85557039 -L*) func_stripname '-L' '' "$deplib"
85567040 func_resolve_sysroot "$func_stripname_result"
8557 func_append newlib_search_path " $func_resolve_sysroot_result"
7041 newlib_search_path+=" $func_resolve_sysroot_result"
85587042 ;;
85597043 esac
85607044 # Need to link against all dependency_libs?
8561 if $linkalldeplibs; then
7045 if test "$linkalldeplibs" = yes; then
85627046 deplibs="$deplib $deplibs"
85637047 else
85647048 # Need to hardcode shared library paths
85657049 # or/and link against static libraries
85667050 newdependency_libs="$deplib $newdependency_libs"
85677051 fi
8568 if $opt_preserve_dup_deps; then
7052 if $opt_preserve_dup_deps ; then
85697053 case "$tmp_libs " in
8570 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7054 *" $deplib "*) specialdeplibs+=" $deplib" ;;
85717055 esac
85727056 fi
8573 func_append tmp_libs " $deplib"
7057 tmp_libs+=" $deplib"
85747058 done # for deplib
85757059 continue
85767060 fi # $linkmode = prog...
85777061
8578 if test prog,link = "$linkmode,$pass"; then
7062 if test "$linkmode,$pass" = "prog,link"; then
85797063 if test -n "$library_names" &&
8580 { { test no = "$prefer_static_libs" ||
8581 test built,yes = "$prefer_static_libs,$installed"; } ||
7064 { { test "$prefer_static_libs" = no ||
7065 test "$prefer_static_libs,$installed" = "built,yes"; } ||
85827066 test -z "$old_library"; }; then
85837067 # We need to hardcode the library path
8584 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
7068 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
85857069 # Make sure the rpath contains only unique directories.
8586 case $temp_rpath: in
7070 case "$temp_rpath:" in
85877071 *"$absdir:"*) ;;
8588 *) func_append temp_rpath "$absdir:" ;;
7072 *) temp_rpath+="$absdir:" ;;
85897073 esac
85907074 fi
85917075
85977081 *)
85987082 case "$compile_rpath " in
85997083 *" $absdir "*) ;;
8600 *) func_append compile_rpath " $absdir" ;;
7084 *) compile_rpath+=" $absdir" ;;
86017085 esac
86027086 ;;
86037087 esac
86067090 *)
86077091 case "$finalize_rpath " in
86087092 *" $libdir "*) ;;
8609 *) func_append finalize_rpath " $libdir" ;;
7093 *) finalize_rpath+=" $libdir" ;;
86107094 esac
86117095 ;;
86127096 esac
86137097 fi # $linkmode,$pass = prog,link...
86147098
8615 if $alldeplibs &&
8616 { test pass_all = "$deplibs_check_method" ||
8617 { test yes = "$build_libtool_libs" &&
7099 if test "$alldeplibs" = yes &&
7100 { test "$deplibs_check_method" = pass_all ||
7101 { test "$build_libtool_libs" = yes &&
86187102 test -n "$library_names"; }; }; then
86197103 # We only need to search for static libraries
86207104 continue
86237107
86247108 link_static=no # Whether the deplib will be linked statically
86257109 use_static_libs=$prefer_static_libs
8626 if test built = "$use_static_libs" && test yes = "$installed"; then
7110 if test "$use_static_libs" = built && test "$installed" = yes; then
86277111 use_static_libs=no
86287112 fi
86297113 if test -n "$library_names" &&
8630 { test no = "$use_static_libs" || test -z "$old_library"; }; then
7114 { test "$use_static_libs" = no || test -z "$old_library"; }; then
86317115 case $host in
8632 *cygwin* | *mingw* | *cegcc* | *os2*)
7116 *cygwin* | *mingw* | *cegcc*)
86337117 # No point in relinking DLLs because paths are not encoded
8634 func_append notinst_deplibs " $lib"
7118 notinst_deplibs+=" $lib"
86357119 need_relink=no
86367120 ;;
86377121 *)
8638 if test no = "$installed"; then
8639 func_append notinst_deplibs " $lib"
7122 if test "$installed" = no; then
7123 notinst_deplibs+=" $lib"
86407124 need_relink=yes
86417125 fi
86427126 ;;
86457129
86467130 # Warn about portability, can't link against -module's on some
86477131 # systems (darwin). Don't bleat about dlopened modules though!
8648 dlopenmodule=
7132 dlopenmodule=""
86497133 for dlpremoduletest in $dlprefiles; do
86507134 if test "X$dlpremoduletest" = "X$lib"; then
8651 dlopenmodule=$dlpremoduletest
7135 dlopenmodule="$dlpremoduletest"
86527136 break
86537137 fi
86547138 done
8655 if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
7139 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
86567140 echo
8657 if test prog = "$linkmode"; then
7141 if test "$linkmode" = prog; then
86587142 $ECHO "*** Warning: Linking the executable $output against the loadable module"
86597143 else
86607144 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
86617145 fi
86627146 $ECHO "*** $linklib is not portable!"
86637147 fi
8664 if test lib = "$linkmode" &&
8665 test yes = "$hardcode_into_libs"; then
7148 if test "$linkmode" = lib &&
7149 test "$hardcode_into_libs" = yes; then
86667150 # Hardcode the library path.
86677151 # Skip directories that are in the system default run-time
86687152 # search path.
86717155 *)
86727156 case "$compile_rpath " in
86737157 *" $absdir "*) ;;
8674 *) func_append compile_rpath " $absdir" ;;
7158 *) compile_rpath+=" $absdir" ;;
86757159 esac
86767160 ;;
86777161 esac
86807164 *)
86817165 case "$finalize_rpath " in
86827166 *" $libdir "*) ;;
8683 *) func_append finalize_rpath " $libdir" ;;
7167 *) finalize_rpath+=" $libdir" ;;
86847168 esac
86857169 ;;
86867170 esac
86907174 # figure out the soname
86917175 set dummy $library_names
86927176 shift
8693 realname=$1
7177 realname="$1"
86947178 shift
86957179 libname=`eval "\\$ECHO \"$libname_spec\""`
86967180 # use dlname if we got it. it's perfectly good, no?
86977181 if test -n "$dlname"; then
8698 soname=$dlname
7182 soname="$dlname"
86997183 elif test -n "$soname_spec"; then
87007184 # bleh windows
87017185 case $host in
8702 *cygwin* | mingw* | *cegcc* | *os2*)
7186 *cygwin* | mingw* | *cegcc*)
87037187 func_arith $current - $age
87047188 major=$func_arith_result
8705 versuffix=-$major
7189 versuffix="-$major"
87067190 ;;
87077191 esac
87087192 eval soname=\"$soname_spec\"
87097193 else
8710 soname=$realname
7194 soname="$realname"
87117195 fi
87127196
87137197 # Make a new name for the extract_expsyms_cmds to use
8714 soroot=$soname
7198 soroot="$soname"
87157199 func_basename "$soroot"
8716 soname=$func_basename_result
7200 soname="$func_basename_result"
87177201 func_stripname 'lib' '.dll' "$soname"
87187202 newlib=libimp-$func_stripname_result.a
87197203
87207204 # If the library has no export list, then create one now
87217205 if test -f "$output_objdir/$soname-def"; then :
87227206 else
8723 func_verbose "extracting exported symbol list from '$soname'"
7207 func_verbose "extracting exported symbol list from \`$soname'"
87247208 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
87257209 fi
87267210
87277211 # Create $newlib
87287212 if test -f "$output_objdir/$newlib"; then :; else
8729 func_verbose "generating import library for '$soname'"
7213 func_verbose "generating import library for \`$soname'"
87307214 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
87317215 fi
87327216 # make sure the library variables are pointing to the new library
87347218 linklib=$newlib
87357219 fi # test -n "$old_archive_from_expsyms_cmds"
87367220
8737 if test prog = "$linkmode" || test relink != "$opt_mode"; then
7221 if test "$linkmode" = prog || test "$opt_mode" != relink; then
87387222 add_shlibpath=
87397223 add_dir=
87407224 add=
87417225 lib_linked=yes
87427226 case $hardcode_action in
87437227 immediate | unsupported)
8744 if test no = "$hardcode_direct"; then
8745 add=$dir/$linklib
7228 if test "$hardcode_direct" = no; then
7229 add="$dir/$linklib"
87467230 case $host in
8747 *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8748 *-*-sysv4*uw2*) add_dir=-L$dir ;;
7231 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
7232 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
87497233 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8750 *-*-unixware7*) add_dir=-L$dir ;;
7234 *-*-unixware7*) add_dir="-L$dir" ;;
87517235 *-*-darwin* )
8752 # if the lib is a (non-dlopened) module then we cannot
7236 # if the lib is a (non-dlopened) module then we can not
87537237 # link against it, someone is ignoring the earlier warnings
87547238 if /usr/bin/file -L $add 2> /dev/null |
8755 $GREP ": [^:]* bundle" >/dev/null; then
7239 $GREP ": [^:]* bundle" >/dev/null ; then
87567240 if test "X$dlopenmodule" != "X$lib"; then
87577241 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8758 if test -z "$old_library"; then
7242 if test -z "$old_library" ; then
87597243 echo
87607244 echo "*** And there doesn't seem to be a static archive available"
87617245 echo "*** The link will probably fail, sorry"
87627246 else
8763 add=$dir/$old_library
7247 add="$dir/$old_library"
87647248 fi
87657249 elif test -n "$old_library"; then
8766 add=$dir/$old_library
7250 add="$dir/$old_library"
87677251 fi
87687252 fi
87697253 esac
8770 elif test no = "$hardcode_minus_L"; then
7254 elif test "$hardcode_minus_L" = no; then
87717255 case $host in
8772 *-*-sunos*) add_shlibpath=$dir ;;
7256 *-*-sunos*) add_shlibpath="$dir" ;;
87737257 esac
8774 add_dir=-L$dir
8775 add=-l$name
8776 elif test no = "$hardcode_shlibpath_var"; then
8777 add_shlibpath=$dir
8778 add=-l$name
7258 add_dir="-L$dir"
7259 add="-l$name"
7260 elif test "$hardcode_shlibpath_var" = no; then
7261 add_shlibpath="$dir"
7262 add="-l$name"
87797263 else
87807264 lib_linked=no
87817265 fi
87827266 ;;
87837267 relink)
8784 if test yes = "$hardcode_direct" &&
8785 test no = "$hardcode_direct_absolute"; then
8786 add=$dir/$linklib
8787 elif test yes = "$hardcode_minus_L"; then
8788 add_dir=-L$absdir
7268 if test "$hardcode_direct" = yes &&
7269 test "$hardcode_direct_absolute" = no; then
7270 add="$dir/$linklib"
7271 elif test "$hardcode_minus_L" = yes; then
7272 add_dir="-L$absdir"
87897273 # Try looking first in the location we're being installed to.
87907274 if test -n "$inst_prefix_dir"; then
87917275 case $libdir in
87927276 [\\/]*)
8793 func_append add_dir " -L$inst_prefix_dir$libdir"
7277 add_dir+=" -L$inst_prefix_dir$libdir"
87947278 ;;
87957279 esac
87967280 fi
8797 add=-l$name
8798 elif test yes = "$hardcode_shlibpath_var"; then
8799 add_shlibpath=$dir
8800 add=-l$name
7281 add="-l$name"
7282 elif test "$hardcode_shlibpath_var" = yes; then
7283 add_shlibpath="$dir"
7284 add="-l$name"
88017285 else
88027286 lib_linked=no
88037287 fi
88057289 *) lib_linked=no ;;
88067290 esac
88077291
8808 if test yes != "$lib_linked"; then
7292 if test "$lib_linked" != yes; then
88097293 func_fatal_configuration "unsupported hardcode properties"
88107294 fi
88117295
88127296 if test -n "$add_shlibpath"; then
88137297 case :$compile_shlibpath: in
88147298 *":$add_shlibpath:"*) ;;
8815 *) func_append compile_shlibpath "$add_shlibpath:" ;;
7299 *) compile_shlibpath+="$add_shlibpath:" ;;
88167300 esac
88177301 fi
8818 if test prog = "$linkmode"; then
7302 if test "$linkmode" = prog; then
88197303 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
88207304 test -n "$add" && compile_deplibs="$add $compile_deplibs"
88217305 else
88227306 test -n "$add_dir" && deplibs="$add_dir $deplibs"
88237307 test -n "$add" && deplibs="$add $deplibs"
8824 if test yes != "$hardcode_direct" &&
8825 test yes != "$hardcode_minus_L" &&
8826 test yes = "$hardcode_shlibpath_var"; then
7308 if test "$hardcode_direct" != yes &&
7309 test "$hardcode_minus_L" != yes &&
7310 test "$hardcode_shlibpath_var" = yes; then
88277311 case :$finalize_shlibpath: in
88287312 *":$libdir:"*) ;;
8829 *) func_append finalize_shlibpath "$libdir:" ;;
7313 *) finalize_shlibpath+="$libdir:" ;;
88307314 esac
88317315 fi
88327316 fi
88337317 fi
88347318
8835 if test prog = "$linkmode" || test relink = "$opt_mode"; then
7319 if test "$linkmode" = prog || test "$opt_mode" = relink; then
88367320 add_shlibpath=
88377321 add_dir=
88387322 add=
88397323 # Finalize command for both is simple: just hardcode it.
8840 if test yes = "$hardcode_direct" &&
8841 test no = "$hardcode_direct_absolute"; then
8842 add=$libdir/$linklib
8843 elif test yes = "$hardcode_minus_L"; then
8844 add_dir=-L$libdir
8845 add=-l$name
8846 elif test yes = "$hardcode_shlibpath_var"; then
7324 if test "$hardcode_direct" = yes &&
7325 test "$hardcode_direct_absolute" = no; then
7326 add="$libdir/$linklib"
7327 elif test "$hardcode_minus_L" = yes; then
7328 add_dir="-L$libdir"
7329 add="-l$name"
7330 elif test "$hardcode_shlibpath_var" = yes; then
88477331 case :$finalize_shlibpath: in
88487332 *":$libdir:"*) ;;
8849 *) func_append finalize_shlibpath "$libdir:" ;;
7333 *) finalize_shlibpath+="$libdir:" ;;
88507334 esac
8851 add=-l$name
8852 elif test yes = "$hardcode_automatic"; then
7335 add="-l$name"
7336 elif test "$hardcode_automatic" = yes; then
88537337 if test -n "$inst_prefix_dir" &&
8854 test -f "$inst_prefix_dir$libdir/$linklib"; then
8855 add=$inst_prefix_dir$libdir/$linklib
7338 test -f "$inst_prefix_dir$libdir/$linklib" ; then
7339 add="$inst_prefix_dir$libdir/$linklib"
88567340 else
8857 add=$libdir/$linklib
7341 add="$libdir/$linklib"
88587342 fi
88597343 else
88607344 # We cannot seem to hardcode it, guess we'll fake it.
8861 add_dir=-L$libdir
7345 add_dir="-L$libdir"
88627346 # Try looking first in the location we're being installed to.
88637347 if test -n "$inst_prefix_dir"; then
88647348 case $libdir in
88657349 [\\/]*)
8866 func_append add_dir " -L$inst_prefix_dir$libdir"
7350 add_dir+=" -L$inst_prefix_dir$libdir"
88677351 ;;
88687352 esac
88697353 fi
8870 add=-l$name
7354 add="-l$name"
88717355 fi
88727356
8873 if test prog = "$linkmode"; then
7357 if test "$linkmode" = prog; then
88747358 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
88757359 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
88767360 else
88787362 test -n "$add" && deplibs="$add $deplibs"
88797363 fi
88807364 fi
8881 elif test prog = "$linkmode"; then
7365 elif test "$linkmode" = prog; then
88827366 # Here we assume that one of hardcode_direct or hardcode_minus_L
88837367 # is not unsupported. This is valid on all known static and
88847368 # shared platforms.
8885 if test unsupported != "$hardcode_direct"; then
8886 test -n "$old_library" && linklib=$old_library
7369 if test "$hardcode_direct" != unsupported; then
7370 test -n "$old_library" && linklib="$old_library"
88877371 compile_deplibs="$dir/$linklib $compile_deplibs"
88887372 finalize_deplibs="$dir/$linklib $finalize_deplibs"
88897373 else
88907374 compile_deplibs="-l$name -L$dir $compile_deplibs"
88917375 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
88927376 fi
8893 elif test yes = "$build_libtool_libs"; then
7377 elif test "$build_libtool_libs" = yes; then
88947378 # Not a shared library
8895 if test pass_all != "$deplibs_check_method"; then
7379 if test "$deplibs_check_method" != pass_all; then
88967380 # We're trying link a shared library against a static one
88977381 # but the system doesn't support it.
88987382
88997383 # Just print a warning and add the library to dependency_libs so
89007384 # that the program can be linked against the static library.
89017385 echo
8902 $ECHO "*** Warning: This system cannot link to static lib archive $lib."
7386 $ECHO "*** Warning: This system can not link to static lib archive $lib."
89037387 echo "*** I have the capability to make that library automatically link in when"
89047388 echo "*** you link to this library. But I can only do this if you have a"
89057389 echo "*** shared version of the library, which you do not appear to have."
8906 if test yes = "$module"; then
7390 if test "$module" = yes; then
89077391 echo "*** But as you try to build a module library, libtool will still create "
89087392 echo "*** a static module, that should work as long as the dlopening application"
89097393 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
89107394 if test -z "$global_symbol_pipe"; then
89117395 echo
89127396 echo "*** However, this would only work if libtool was able to extract symbol"
8913 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
7397 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
89147398 echo "*** not find such a program. So, this module is probably useless."
8915 echo "*** 'nm' from GNU binutils and a full rebuild may help."
7399 echo "*** \`nm' from GNU binutils and a full rebuild may help."
89167400 fi
8917 if test no = "$build_old_libs"; then
7401 if test "$build_old_libs" = no; then
89187402 build_libtool_libs=module
89197403 build_old_libs=yes
89207404 else
89277411 fi
89287412 fi # link shared/static library?
89297413
8930 if test lib = "$linkmode"; then
7414 if test "$linkmode" = lib; then
89317415 if test -n "$dependency_libs" &&
8932 { test yes != "$hardcode_into_libs" ||
8933 test yes = "$build_old_libs" ||
8934 test yes = "$link_static"; }; then
7416 { test "$hardcode_into_libs" != yes ||
7417 test "$build_old_libs" = yes ||
7418 test "$link_static" = yes; }; then
89357419 # Extract -R from dependency_libs
89367420 temp_deplibs=
89377421 for libdir in $dependency_libs; do
89407424 temp_xrpath=$func_stripname_result
89417425 case " $xrpath " in
89427426 *" $temp_xrpath "*) ;;
8943 *) func_append xrpath " $temp_xrpath";;
7427 *) xrpath+=" $temp_xrpath";;
89447428 esac;;
8945 *) func_append temp_deplibs " $libdir";;
7429 *) temp_deplibs+=" $libdir";;
89467430 esac
89477431 done
8948 dependency_libs=$temp_deplibs
7432 dependency_libs="$temp_deplibs"
89497433 fi
89507434
8951 func_append newlib_search_path " $absdir"
7435 newlib_search_path+=" $absdir"
89527436 # Link against this library
8953 test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7437 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
89547438 # ... and its dependency_libs
89557439 tmp_libs=
89567440 for deplib in $dependency_libs; do
89607444 func_resolve_sysroot "$func_stripname_result";;
89617445 *) func_resolve_sysroot "$deplib" ;;
89627446 esac
8963 if $opt_preserve_dup_deps; then
7447 if $opt_preserve_dup_deps ; then
89647448 case "$tmp_libs " in
89657449 *" $func_resolve_sysroot_result "*)
8966 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7450 specialdeplibs+=" $func_resolve_sysroot_result" ;;
89677451 esac
89687452 fi
8969 func_append tmp_libs " $func_resolve_sysroot_result"
7453 tmp_libs+=" $func_resolve_sysroot_result"
89707454 done
89717455
8972 if test no != "$link_all_deplibs"; then
7456 if test "$link_all_deplibs" != no; then
89737457 # Add the search paths of all dependency libraries
89747458 for deplib in $dependency_libs; do
89757459 path=
89767460 case $deplib in
8977 -L*) path=$deplib ;;
7461 -L*) path="$deplib" ;;
89787462 *.la)
89797463 func_resolve_sysroot "$deplib"
89807464 deplib=$func_resolve_sysroot_result
89827466 dir=$func_dirname_result
89837467 # We need an absolute path.
89847468 case $dir in
8985 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
7469 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
89867470 *)
89877471 absdir=`cd "$dir" && pwd`
89887472 if test -z "$absdir"; then
8989 func_warning "cannot determine absolute directory name of '$dir'"
8990 absdir=$dir
7473 func_warning "cannot determine absolute directory name of \`$dir'"
7474 absdir="$dir"
89917475 fi
89927476 ;;
89937477 esac
89957479 case $host in
89967480 *-*-darwin*)
89977481 depdepl=
8998 eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8999 if test -n "$deplibrary_names"; then
9000 for tmp in $deplibrary_names; do
7482 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7483 if test -n "$deplibrary_names" ; then
7484 for tmp in $deplibrary_names ; do
90017485 depdepl=$tmp
90027486 done
9003 if test -f "$absdir/$objdir/$depdepl"; then
9004 depdepl=$absdir/$objdir/$depdepl
9005 darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7487 if test -f "$absdir/$objdir/$depdepl" ; then
7488 depdepl="$absdir/$objdir/$depdepl"
7489 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
90067490 if test -z "$darwin_install_name"; then
9007 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7491 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
90087492 fi
9009 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
9010 func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
7493 compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7494 linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
90117495 path=
90127496 fi
90137497 fi
90147498 ;;
90157499 *)
9016 path=-L$absdir/$objdir
7500 path="-L$absdir/$objdir"
90177501 ;;
90187502 esac
90197503 else
9020 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7504 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
90217505 test -z "$libdir" && \
9022 func_fatal_error "'$deplib' is not a valid libtool archive"
7506 func_fatal_error "\`$deplib' is not a valid libtool archive"
90237507 test "$absdir" != "$libdir" && \
9024 func_warning "'$deplib' seems to be moved"
9025
9026 path=-L$absdir
7508 func_warning "\`$deplib' seems to be moved"
7509
7510 path="-L$absdir"
90277511 fi
90287512 ;;
90297513 esac
90357519 fi # link_all_deplibs != no
90367520 fi # linkmode = lib
90377521 done # for deplib in $libs
9038 if test link = "$pass"; then
9039 if test prog = "$linkmode"; then
7522 if test "$pass" = link; then
7523 if test "$linkmode" = "prog"; then
90407524 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
90417525 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
90427526 else
90437527 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
90447528 fi
90457529 fi
9046 dependency_libs=$newdependency_libs
9047 if test dlpreopen = "$pass"; then
7530 dependency_libs="$newdependency_libs"
7531 if test "$pass" = dlpreopen; then
90487532 # Link the dlpreopened libraries before other libraries
90497533 for deplib in $save_deplibs; do
90507534 deplibs="$deplib $deplibs"
90517535 done
90527536 fi
9053 if test dlopen != "$pass"; then
9054 test conv = "$pass" || {
7537 if test "$pass" != dlopen; then
7538 if test "$pass" != conv; then
90557539 # Make sure lib_search_path contains only unique directories.
90567540 lib_search_path=
90577541 for dir in $newlib_search_path; do
90587542 case "$lib_search_path " in
90597543 *" $dir "*) ;;
9060 *) func_append lib_search_path " $dir" ;;
7544 *) lib_search_path+=" $dir" ;;
90617545 esac
90627546 done
90637547 newlib_search_path=
9064 }
9065
9066 if test prog,link = "$linkmode,$pass"; then
7548 fi
7549
7550 if test "$linkmode,$pass" != "prog,link"; then
7551 vars="deplibs"
7552 else
90677553 vars="compile_deplibs finalize_deplibs"
9068 else
9069 vars=deplibs
90707554 fi
90717555 for var in $vars dependency_libs; do
90727556 # Add libraries to $var in reverse order
91157599 -L*)
91167600 case " $tmp_libs " in
91177601 *" $deplib "*) ;;
9118 *) func_append tmp_libs " $deplib" ;;
7602 *) tmp_libs+=" $deplib" ;;
91197603 esac
91207604 ;;
9121 *) func_append tmp_libs " $deplib" ;;
7605 *) tmp_libs+=" $deplib" ;;
91227606 esac
91237607 done
91247608 eval $var=\"$tmp_libs\"
91257609 done # for var
91267610 fi
9127
9128 # Add Sun CC postdeps if required:
9129 test CXX = "$tagname" && {
9130 case $host_os in
9131 linux*)
9132 case `$CC -V 2>&1 | sed 5q` in
9133 *Sun\ C*) # Sun C++ 5.9
9134 func_suncc_cstd_abi
9135
9136 if test no != "$suncc_use_cstd_abi"; then
9137 func_append postdeps ' -library=Cstd -library=Crun'
9138 fi
9139 ;;
9140 esac
9141 ;;
9142
9143 solaris*)
9144 func_cc_basename "$CC"
9145 case $func_cc_basename_result in
9146 CC* | sunCC*)
9147 func_suncc_cstd_abi
9148
9149 if test no != "$suncc_use_cstd_abi"; then
9150 func_append postdeps ' -library=Cstd -library=Crun'
9151 fi
9152 ;;
9153 esac
9154 ;;
9155 esac
9156 }
9157
91587611 # Last step: remove runtime libs from dependency_libs
91597612 # (they stay in deplibs)
91607613 tmp_libs=
9161 for i in $dependency_libs; do
7614 for i in $dependency_libs ; do
91627615 case " $predeps $postdeps $compiler_lib_search_path " in
91637616 *" $i "*)
9164 i=
7617 i=""
91657618 ;;
91667619 esac
9167 if test -n "$i"; then
9168 func_append tmp_libs " $i"
7620 if test -n "$i" ; then
7621 tmp_libs+=" $i"
91697622 fi
91707623 done
91717624 dependency_libs=$tmp_libs
91727625 done # for pass
9173 if test prog = "$linkmode"; then
9174 dlfiles=$newdlfiles
7626 if test "$linkmode" = prog; then
7627 dlfiles="$newdlfiles"
91757628 fi
9176 if test prog = "$linkmode" || test lib = "$linkmode"; then
9177 dlprefiles=$newdlprefiles
7629 if test "$linkmode" = prog || test "$linkmode" = lib; then
7630 dlprefiles="$newdlprefiles"
91787631 fi
91797632
91807633 case $linkmode in
91817634 oldlib)
9182 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
9183 func_warning "'-dlopen' is ignored for archives"
7635 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7636 func_warning "\`-dlopen' is ignored for archives"
91847637 fi
91857638
91867639 case " $deplibs" in
91877640 *\ -l* | *\ -L*)
9188 func_warning "'-l' and '-L' are ignored for archives" ;;
7641 func_warning "\`-l' and \`-L' are ignored for archives" ;;
91897642 esac
91907643
91917644 test -n "$rpath" && \
9192 func_warning "'-rpath' is ignored for archives"
7645 func_warning "\`-rpath' is ignored for archives"
91937646
91947647 test -n "$xrpath" && \
9195 func_warning "'-R' is ignored for archives"
7648 func_warning "\`-R' is ignored for archives"
91967649
91977650 test -n "$vinfo" && \
9198 func_warning "'-version-info/-version-number' is ignored for archives"
7651 func_warning "\`-version-info/-version-number' is ignored for archives"
91997652
92007653 test -n "$release" && \
9201 func_warning "'-release' is ignored for archives"
7654 func_warning "\`-release' is ignored for archives"
92027655
92037656 test -n "$export_symbols$export_symbols_regex" && \
9204 func_warning "'-export-symbols' is ignored for archives"
7657 func_warning "\`-export-symbols' is ignored for archives"
92057658
92067659 # Now set the variables for building old libraries.
92077660 build_libtool_libs=no
9208 oldlibs=$output
9209 func_append objs "$old_deplibs"
7661 oldlibs="$output"
7662 objs+="$old_deplibs"
92107663 ;;
92117664
92127665 lib)
9213 # Make sure we only generate libraries of the form 'libNAME.la'.
7666 # Make sure we only generate libraries of the form `libNAME.la'.
92147667 case $outputname in
92157668 lib*)
92167669 func_stripname 'lib' '.la' "$outputname"
92197672 eval libname=\"$libname_spec\"
92207673 ;;
92217674 *)
9222 test no = "$module" \
9223 && func_fatal_help "libtool library '$output' must begin with 'lib'"
9224
9225 if test no != "$need_lib_prefix"; then
7675 test "$module" = no && \
7676 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7677
7678 if test "$need_lib_prefix" != no; then
92267679 # Add the "lib" prefix for modules if required
92277680 func_stripname '' '.la' "$outputname"
92287681 name=$func_stripname_result
92367689 esac
92377690
92387691 if test -n "$objs"; then
9239 if test pass_all != "$deplibs_check_method"; then
9240 func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
7692 if test "$deplibs_check_method" != pass_all; then
7693 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
92417694 else
92427695 echo
92437696 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
92447697 $ECHO "*** objects $objs is not portable!"
9245 func_append libobjs " $objs"
7698 libobjs+=" $objs"
92467699 fi
92477700 fi
92487701
9249 test no = "$dlself" \
9250 || func_warning "'-dlopen self' is ignored for libtool libraries"
7702 test "$dlself" != no && \
7703 func_warning "\`-dlopen self' is ignored for libtool libraries"
92517704
92527705 set dummy $rpath
92537706 shift
9254 test 1 -lt "$#" \
9255 && func_warning "ignoring multiple '-rpath's for a libtool library"
9256
9257 install_libdir=$1
7707 test "$#" -gt 1 && \
7708 func_warning "ignoring multiple \`-rpath's for a libtool library"
7709
7710 install_libdir="$1"
92587711
92597712 oldlibs=
92607713 if test -z "$rpath"; then
9261 if test yes = "$build_libtool_libs"; then
7714 if test "$build_libtool_libs" = yes; then
92627715 # Building a libtool convenience library.
9263 # Some compilers have problems with a '.al' extension so
7716 # Some compilers have problems with a `.al' extension so
92647717 # convenience libraries should have the same extension an
92657718 # archive normally would.
92667719 oldlibs="$output_objdir/$libname.$libext $oldlibs"
92697722 fi
92707723
92717724 test -n "$vinfo" && \
9272 func_warning "'-version-info/-version-number' is ignored for convenience libraries"
7725 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
92737726
92747727 test -n "$release" && \
9275 func_warning "'-release' is ignored for convenience libraries"
7728 func_warning "\`-release' is ignored for convenience libraries"
92767729 else
92777730
92787731 # Parse the version information argument.
9279 save_ifs=$IFS; IFS=:
7732 save_ifs="$IFS"; IFS=':'
92807733 set dummy $vinfo 0 0 0
92817734 shift
9282 IFS=$save_ifs
7735 IFS="$save_ifs"
92837736
92847737 test -n "$7" && \
9285 func_fatal_help "too many parameters to '-version-info'"
7738 func_fatal_help "too many parameters to \`-version-info'"
92867739
92877740 # convert absolute version numbers to libtool ages
92887741 # this retains compatibility with .la files and attempts
92907743
92917744 case $vinfo_number in
92927745 yes)
9293 number_major=$1
9294 number_minor=$2
9295 number_revision=$3
7746 number_major="$1"
7747 number_minor="$2"
7748 number_revision="$3"
92967749 #
92977750 # There are really only two kinds -- those that
92987751 # use the current revision as the major version
92997752 # and those that subtract age and use age as
93007753 # a minor version. But, then there is irix
9301 # that has an extra 1 added just for fun
7754 # which has an extra 1 added just for fun
93027755 #
93037756 case $version_type in
93047757 # correct linux to gnu/linux during the next big refactor
9305 darwin|freebsd-elf|linux|osf|windows|none)
7758 darwin|linux|osf|windows|none)
93067759 func_arith $number_major + $number_minor
93077760 current=$func_arith_result
9308 age=$number_minor
9309 revision=$number_revision
7761 age="$number_minor"
7762 revision="$number_revision"
93107763 ;;
9311 freebsd-aout|qnx|sunos)
9312 current=$number_major
9313 revision=$number_minor
9314 age=0
7764 freebsd-aout|freebsd-elf|qnx|sunos)
7765 current="$number_major"
7766 revision="$number_minor"
7767 age="0"
93157768 ;;
93167769 irix|nonstopux)
93177770 func_arith $number_major + $number_minor
93187771 current=$func_arith_result
9319 age=$number_minor
9320 revision=$number_minor
7772 age="$number_minor"
7773 revision="$number_minor"
93217774 lt_irix_increment=no
7775 ;;
7776 *)
7777 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
93227778 ;;
93237779 esac
93247780 ;;
93257781 no)
9326 current=$1
9327 revision=$2
9328 age=$3
7782 current="$1"
7783 revision="$2"
7784 age="$3"
93297785 ;;
93307786 esac
93317787
93337789 case $current in
93347790 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]) ;;
93357791 *)
9336 func_error "CURRENT '$current' must be a nonnegative integer"
9337 func_fatal_error "'$vinfo' is not valid version information"
7792 func_error "CURRENT \`$current' must be a nonnegative integer"
7793 func_fatal_error "\`$vinfo' is not valid version information"
93387794 ;;
93397795 esac
93407796
93417797 case $revision in
93427798 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]) ;;
93437799 *)
9344 func_error "REVISION '$revision' must be a nonnegative integer"
9345 func_fatal_error "'$vinfo' is not valid version information"
7800 func_error "REVISION \`$revision' must be a nonnegative integer"
7801 func_fatal_error "\`$vinfo' is not valid version information"
93467802 ;;
93477803 esac
93487804
93497805 case $age in
93507806 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]) ;;
93517807 *)
9352 func_error "AGE '$age' must be a nonnegative integer"
9353 func_fatal_error "'$vinfo' is not valid version information"
7808 func_error "AGE \`$age' must be a nonnegative integer"
7809 func_fatal_error "\`$vinfo' is not valid version information"
93547810 ;;
93557811 esac
93567812
93577813 if test "$age" -gt "$current"; then
9358 func_error "AGE '$age' is greater than the current interface number '$current'"
9359 func_fatal_error "'$vinfo' is not valid version information"
7814 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7815 func_fatal_error "\`$vinfo' is not valid version information"
93607816 fi
93617817
93627818 # Calculate the version variables.
93717827 # verstring for coding it into the library header
93727828 func_arith $current - $age
93737829 major=.$func_arith_result
9374 versuffix=$major.$age.$revision
7830 versuffix="$major.$age.$revision"
93757831 # Darwin ld doesn't like 0 for these options...
93767832 func_arith $current + 1
93777833 minor_current=$func_arith_result
9378 xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
7834 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
93797835 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9380 # On Darwin other compilers
9381 case $CC in
9382 nagfor*)
9383 verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
9384 ;;
9385 *)
9386 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
9387 ;;
9388 esac
93897836 ;;
93907837
93917838 freebsd-aout)
9392 major=.$current
9393 versuffix=.$current.$revision
7839 major=".$current"
7840 versuffix=".$current.$revision";
93947841 ;;
93957842
93967843 freebsd-elf)
9397 func_arith $current - $age
9398 major=.$func_arith_result
9399 versuffix=$major.$age.$revision
7844 major=".$current"
7845 versuffix=".$current"
94007846 ;;
94017847
94027848 irix | nonstopux)
9403 if test no = "$lt_irix_increment"; then
7849 if test "X$lt_irix_increment" = "Xno"; then
94047850 func_arith $current - $age
94057851 else
94067852 func_arith $current - $age + 1
94117857 nonstopux) verstring_prefix=nonstopux ;;
94127858 *) verstring_prefix=sgi ;;
94137859 esac
9414 verstring=$verstring_prefix$major.$revision
7860 verstring="$verstring_prefix$major.$revision"
94157861
94167862 # Add in all the interfaces that we are compatible with.
94177863 loop=$revision
9418 while test 0 -ne "$loop"; do
7864 while test "$loop" -ne 0; do
94197865 func_arith $revision - $loop
94207866 iface=$func_arith_result
94217867 func_arith $loop - 1
94227868 loop=$func_arith_result
9423 verstring=$verstring_prefix$major.$iface:$verstring
7869 verstring="$verstring_prefix$major.$iface:$verstring"
94247870 done
94257871
9426 # Before this point, $major must not contain '.'.
7872 # Before this point, $major must not contain `.'.
94277873 major=.$major
9428 versuffix=$major.$revision
7874 versuffix="$major.$revision"
94297875 ;;
94307876
94317877 linux) # correct to gnu/linux during the next big refactor
94327878 func_arith $current - $age
94337879 major=.$func_arith_result
9434 versuffix=$major.$age.$revision
7880 versuffix="$major.$age.$revision"
94357881 ;;
94367882
94377883 osf)
94387884 func_arith $current - $age
94397885 major=.$func_arith_result
9440 versuffix=.$current.$age.$revision
9441 verstring=$current.$age.$revision
7886 versuffix=".$current.$age.$revision"
7887 verstring="$current.$age.$revision"
94427888
94437889 # Add in all the interfaces that we are compatible with.
94447890 loop=$age
9445 while test 0 -ne "$loop"; do
7891 while test "$loop" -ne 0; do
94467892 func_arith $current - $loop
94477893 iface=$func_arith_result
94487894 func_arith $loop - 1
94497895 loop=$func_arith_result
9450 verstring=$verstring:$iface.0
7896 verstring="$verstring:${iface}.0"
94517897 done
94527898
94537899 # Make executables depend on our current version.
9454 func_append verstring ":$current.0"
7900 verstring+=":${current}.0"
94557901 ;;
94567902
94577903 qnx)
9458 major=.$current
9459 versuffix=.$current
7904 major=".$current"
7905 versuffix=".$current"
94607906 ;;
94617907
9462 sco)
9463 major=.$current
9464 versuffix=.$current
9465 ;;
9466
94677908 sunos)
9468 major=.$current
9469 versuffix=.$current.$revision
7909 major=".$current"
7910 versuffix=".$current.$revision"
94707911 ;;
94717912
94727913 windows)
94737914 # Use '-' rather than '.', since we only want one
9474 # extension on DOS 8.3 file systems.
7915 # extension on DOS 8.3 filesystems.
94757916 func_arith $current - $age
94767917 major=$func_arith_result
9477 versuffix=-$major
7918 versuffix="-$major"
94787919 ;;
94797920
94807921 *)
9481 func_fatal_configuration "unknown library version type '$version_type'"
7922 func_fatal_configuration "unknown library version type \`$version_type'"
94827923 ;;
94837924 esac
94847925
94927933 verstring=
94937934 ;;
94947935 *)
9495 verstring=0.0
7936 verstring="0.0"
94967937 ;;
94977938 esac
9498 if test no = "$need_version"; then
7939 if test "$need_version" = no; then
94997940 versuffix=
95007941 else
9501 versuffix=.0.0
7942 versuffix=".0.0"
95027943 fi
95037944 fi
95047945
95057946 # Remove version info from name if versioning should be avoided
9506 if test yes,no = "$avoid_version,$need_version"; then
7947 if test "$avoid_version" = yes && test "$need_version" = no; then
95077948 major=
95087949 versuffix=
9509 verstring=
7950 verstring=""
95107951 fi
95117952
95127953 # Check to see if the archive will have undefined symbols.
9513 if test yes = "$allow_undefined"; then
9514 if test unsupported = "$allow_undefined_flag"; then
9515 if test yes = "$build_old_libs"; then
9516 func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9517 build_libtool_libs=no
9518 else
9519 func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9520 fi
7954 if test "$allow_undefined" = yes; then
7955 if test "$allow_undefined_flag" = unsupported; then
7956 func_warning "undefined symbols not allowed in $host shared libraries"
7957 build_libtool_libs=no
7958 build_old_libs=yes
95217959 fi
95227960 else
95237961 # Don't allow undefined symbols.
9524 allow_undefined_flag=$no_undefined_flag
7962 allow_undefined_flag="$no_undefined_flag"
95257963 fi
95267964
95277965 fi
95287966
9529 func_generate_dlsyms "$libname" "$libname" :
9530 func_append libobjs " $symfileobj"
9531 test " " = "$libobjs" && libobjs=
9532
9533 if test relink != "$opt_mode"; then
7967 func_generate_dlsyms "$libname" "$libname" "yes"
7968 libobjs+=" $symfileobj"
7969 test "X$libobjs" = "X " && libobjs=
7970
7971 if test "$opt_mode" != relink; then
95347972 # Remove our outputs, but don't remove object files since they
95357973 # may have been created when compiling PIC objects.
95367974 removelist=
95397977 case $p in
95407978 *.$objext | *.gcno)
95417979 ;;
9542 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9543 if test -n "$precious_files_regex"; then
7980 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7981 if test "X$precious_files_regex" != "X"; then
95447982 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
95457983 then
95467984 continue
95477985 fi
95487986 fi
9549 func_append removelist " $p"
7987 removelist+=" $p"
95507988 ;;
95517989 *) ;;
95527990 esac
95567994 fi
95577995
95587996 # Now set the variables for building old libraries.
9559 if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
9560 func_append oldlibs " $output_objdir/$libname.$libext"
7997 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7998 oldlibs+=" $output_objdir/$libname.$libext"
95617999
95628000 # Transform .lo files to .o files.
9563 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
8001 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
95648002 fi
95658003
95668004 # Eliminate all temporary directories.
95758013 temp_xrpath=
95768014 for libdir in $xrpath; do
95778015 func_replace_sysroot "$libdir"
9578 func_append temp_xrpath " -R$func_replace_sysroot_result"
8016 temp_xrpath+=" -R$func_replace_sysroot_result"
95798017 case "$finalize_rpath " in
95808018 *" $libdir "*) ;;
9581 *) func_append finalize_rpath " $libdir" ;;
8019 *) finalize_rpath+=" $libdir" ;;
95828020 esac
95838021 done
9584 if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
8022 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
95858023 dependency_libs="$temp_xrpath $dependency_libs"
95868024 fi
95878025 fi
95888026
95898027 # Make sure dlfiles contains only unique files that won't be dlpreopened
9590 old_dlfiles=$dlfiles
8028 old_dlfiles="$dlfiles"
95918029 dlfiles=
95928030 for lib in $old_dlfiles; do
95938031 case " $dlprefiles $dlfiles " in
95948032 *" $lib "*) ;;
9595 *) func_append dlfiles " $lib" ;;
8033 *) dlfiles+=" $lib" ;;
95968034 esac
95978035 done
95988036
95998037 # Make sure dlprefiles contains only unique files
9600 old_dlprefiles=$dlprefiles
8038 old_dlprefiles="$dlprefiles"
96018039 dlprefiles=
96028040 for lib in $old_dlprefiles; do
96038041 case "$dlprefiles " in
96048042 *" $lib "*) ;;
9605 *) func_append dlprefiles " $lib" ;;
8043 *) dlprefiles+=" $lib" ;;
96068044 esac
96078045 done
96088046
9609 if test yes = "$build_libtool_libs"; then
8047 if test "$build_libtool_libs" = yes; then
96108048 if test -n "$rpath"; then
96118049 case $host in
96128050 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
96148052 ;;
96158053 *-*-rhapsody* | *-*-darwin1.[012])
96168054 # Rhapsody C library is in the System framework
9617 func_append deplibs " System.ltframework"
8055 deplibs+=" System.ltframework"
96188056 ;;
96198057 *-*-netbsd*)
96208058 # Don't link with libc until the a.out ld.so is fixed.
96308068 ;;
96318069 *)
96328070 # Add libc to deplibs on all other systems if necessary.
9633 if test yes = "$build_libtool_need_lc"; then
9634 func_append deplibs " -lc"
8071 if test "$build_libtool_need_lc" = "yes"; then
8072 deplibs+=" -lc"
96358073 fi
96368074 ;;
96378075 esac
96468084 # I'm not sure if I'm treating the release correctly. I think
96478085 # release should show up in the -l (ie -lgmp5) so we don't want to
96488086 # add it in twice. Is that correct?
9649 release=
9650 versuffix=
9651 major=
8087 release=""
8088 versuffix=""
8089 major=""
96528090 newdeplibs=
96538091 droppeddeps=no
96548092 case $deplibs_check_method in
96778115 -l*)
96788116 func_stripname -l '' "$i"
96798117 name=$func_stripname_result
9680 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8118 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
96818119 case " $predeps $postdeps " in
96828120 *" $i "*)
9683 func_append newdeplibs " $i"
9684 i=
8121 newdeplibs+=" $i"
8122 i=""
96858123 ;;
96868124 esac
96878125 fi
9688 if test -n "$i"; then
8126 if test -n "$i" ; then
96898127 libname=`eval "\\$ECHO \"$libname_spec\""`
96908128 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
96918129 set dummy $deplib_matches; shift
96928130 deplib_match=$1
9693 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9694 func_append newdeplibs " $i"
8131 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8132 newdeplibs+=" $i"
96958133 else
96968134 droppeddeps=yes
96978135 echo
97058143 fi
97068144 ;;
97078145 *)
9708 func_append newdeplibs " $i"
8146 newdeplibs+=" $i"
97098147 ;;
97108148 esac
97118149 done
97208158 $opt_dry_run || $RM conftest
97218159 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
97228160 ldd_output=`ldd conftest`
9723 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8161 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
97248162 case " $predeps $postdeps " in
97258163 *" $i "*)
9726 func_append newdeplibs " $i"
9727 i=
8164 newdeplibs+=" $i"
8165 i=""
97288166 ;;
97298167 esac
97308168 fi
9731 if test -n "$i"; then
8169 if test -n "$i" ; then
97328170 libname=`eval "\\$ECHO \"$libname_spec\""`
97338171 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
97348172 set dummy $deplib_matches; shift
97358173 deplib_match=$1
9736 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
9737 func_append newdeplibs " $i"
8174 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8175 newdeplibs+=" $i"
97388176 else
97398177 droppeddeps=yes
97408178 echo
97568194 fi
97578195 ;;
97588196 *)
9759 func_append newdeplibs " $i"
8197 newdeplibs+=" $i"
97608198 ;;
97618199 esac
97628200 done
97708208 -l*)
97718209 func_stripname -l '' "$a_deplib"
97728210 name=$func_stripname_result
9773 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8211 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
97748212 case " $predeps $postdeps " in
97758213 *" $a_deplib "*)
9776 func_append newdeplibs " $a_deplib"
9777 a_deplib=
8214 newdeplibs+=" $a_deplib"
8215 a_deplib=""
97788216 ;;
97798217 esac
97808218 fi
9781 if test -n "$a_deplib"; then
8219 if test -n "$a_deplib" ; then
97828220 libname=`eval "\\$ECHO \"$libname_spec\""`
97838221 if test -n "$file_magic_glob"; then
97848222 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
97858223 else
97868224 libnameglob=$libname
97878225 fi
9788 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
8226 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
97898227 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9790 if test yes = "$want_nocaseglob"; then
8228 if test "$want_nocaseglob" = yes; then
97918229 shopt -s nocaseglob
97928230 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
97938231 $nocaseglob
98058243 # We might still enter an endless loop, since a link
98068244 # loop can be closed while we follow links,
98078245 # but so what?
9808 potlib=$potent_lib
8246 potlib="$potent_lib"
98098247 while test -h "$potlib" 2>/dev/null; do
9810 potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
8248 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
98118249 case $potliblink in
9812 [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9813 *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
8250 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
8251 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
98148252 esac
98158253 done
98168254 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
98178255 $SED -e 10q |
98188256 $EGREP "$file_magic_regex" > /dev/null; then
9819 func_append newdeplibs " $a_deplib"
9820 a_deplib=
8257 newdeplibs+=" $a_deplib"
8258 a_deplib=""
98218259 break 2
98228260 fi
98238261 done
98248262 done
98258263 fi
9826 if test -n "$a_deplib"; then
8264 if test -n "$a_deplib" ; then
98278265 droppeddeps=yes
98288266 echo
98298267 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
98318269 echo "*** you link to this library. But I can only do this if you have a"
98328270 echo "*** shared version of the library, which you do not appear to have"
98338271 echo "*** because I did check the linker path looking for a file starting"
9834 if test -z "$potlib"; then
8272 if test -z "$potlib" ; then
98358273 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
98368274 else
98378275 $ECHO "*** with $libname and none of the candidates passed a file format test"
98418279 ;;
98428280 *)
98438281 # Add a -L argument.
9844 func_append newdeplibs " $a_deplib"
8282 newdeplibs+=" $a_deplib"
98458283 ;;
98468284 esac
98478285 done # Gone through all deplibs.
98548292 -l*)
98558293 func_stripname -l '' "$a_deplib"
98568294 name=$func_stripname_result
9857 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
8295 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
98588296 case " $predeps $postdeps " in
98598297 *" $a_deplib "*)
9860 func_append newdeplibs " $a_deplib"
9861 a_deplib=
8298 newdeplibs+=" $a_deplib"
8299 a_deplib=""
98628300 ;;
98638301 esac
98648302 fi
9865 if test -n "$a_deplib"; then
8303 if test -n "$a_deplib" ; then
98668304 libname=`eval "\\$ECHO \"$libname_spec\""`
98678305 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
98688306 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
98698307 for potent_lib in $potential_libs; do
9870 potlib=$potent_lib # see symlink-check above in file_magic test
8308 potlib="$potent_lib" # see symlink-check above in file_magic test
98718309 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
98728310 $EGREP "$match_pattern_regex" > /dev/null; then
9873 func_append newdeplibs " $a_deplib"
9874 a_deplib=
8311 newdeplibs+=" $a_deplib"
8312 a_deplib=""
98758313 break 2
98768314 fi
98778315 done
98788316 done
98798317 fi
9880 if test -n "$a_deplib"; then
8318 if test -n "$a_deplib" ; then
98818319 droppeddeps=yes
98828320 echo
98838321 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
98858323 echo "*** you link to this library. But I can only do this if you have a"
98868324 echo "*** shared version of the library, which you do not appear to have"
98878325 echo "*** because I did check the linker path looking for a file starting"
9888 if test -z "$potlib"; then
8326 if test -z "$potlib" ; then
98898327 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
98908328 else
98918329 $ECHO "*** with $libname and none of the candidates passed a file format test"
98958333 ;;
98968334 *)
98978335 # Add a -L argument.
9898 func_append newdeplibs " $a_deplib"
8336 newdeplibs+=" $a_deplib"
98998337 ;;
99008338 esac
99018339 done # Gone through all deplibs.
99028340 ;;
99038341 none | unknown | *)
9904 newdeplibs=
8342 newdeplibs=""
99058343 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9906 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9907 for i in $predeps $postdeps; do
8344 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8345 for i in $predeps $postdeps ; do
99088346 # can't use Xsed below, because $i might contain '/'
9909 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
8347 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
99108348 done
99118349 fi
99128350 case $tmp_deplibs in
99138351 *[!\ \ ]*)
99148352 echo
9915 if test none = "$deplibs_check_method"; then
8353 if test "X$deplibs_check_method" = "Xnone"; then
99168354 echo "*** Warning: inter-library dependencies are not supported in this platform."
99178355 else
99188356 echo "*** Warning: inter-library dependencies are not known to be supported."
99368374 ;;
99378375 esac
99388376
9939 if test yes = "$droppeddeps"; then
9940 if test yes = "$module"; then
8377 if test "$droppeddeps" = yes; then
8378 if test "$module" = yes; then
99418379 echo
99428380 echo "*** Warning: libtool could not satisfy all declared inter-library"
99438381 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
99468384 if test -z "$global_symbol_pipe"; then
99478385 echo
99488386 echo "*** However, this would only work if libtool was able to extract symbol"
9949 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
8387 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
99508388 echo "*** not find such a program. So, this module is probably useless."
9951 echo "*** 'nm' from GNU binutils and a full rebuild may help."
8389 echo "*** \`nm' from GNU binutils and a full rebuild may help."
99528390 fi
9953 if test no = "$build_old_libs"; then
9954 oldlibs=$output_objdir/$libname.$libext
8391 if test "$build_old_libs" = no; then
8392 oldlibs="$output_objdir/$libname.$libext"
99558393 build_libtool_libs=module
99568394 build_old_libs=yes
99578395 else
99628400 echo "*** automatically added whenever a program is linked with this library"
99638401 echo "*** or is declared to -dlopen it."
99648402
9965 if test no = "$allow_undefined"; then
8403 if test "$allow_undefined" = no; then
99668404 echo
99678405 echo "*** Since this library must not contain undefined symbols,"
99688406 echo "*** because either the platform does not support them or"
99698407 echo "*** it was explicitly requested with -no-undefined,"
99708408 echo "*** libtool will only create a static version of it."
9971 if test no = "$build_old_libs"; then
9972 oldlibs=$output_objdir/$libname.$libext
8409 if test "$build_old_libs" = no; then
8410 oldlibs="$output_objdir/$libname.$libext"
99738411 build_libtool_libs=module
99748412 build_old_libs=yes
99758413 else
99998437 *)
100008438 case " $deplibs " in
100018439 *" -L$path/$objdir "*)
10002 func_append new_libs " -L$path/$objdir" ;;
8440 new_libs+=" -L$path/$objdir" ;;
100038441 esac
100048442 ;;
100058443 esac
100098447 -L*)
100108448 case " $new_libs " in
100118449 *" $deplib "*) ;;
10012 *) func_append new_libs " $deplib" ;;
8450 *) new_libs+=" $deplib" ;;
100138451 esac
100148452 ;;
10015 *) func_append new_libs " $deplib" ;;
8453 *) new_libs+=" $deplib" ;;
100168454 esac
100178455 done
10018 deplibs=$new_libs
8456 deplibs="$new_libs"
100198457
100208458 # All the library-specific variables (install_libdir is set above).
100218459 library_names=
100238461 dlname=
100248462
100258463 # Test again, we may have decided not to build it any more
10026 if test yes = "$build_libtool_libs"; then
10027 # Remove $wl instances when linking with ld.
8464 if test "$build_libtool_libs" = yes; then
8465 # Remove ${wl} instances when linking with ld.
100288466 # FIXME: should test the right _cmds variable.
100298467 case $archive_cmds in
100308468 *\$LD\ *) wl= ;;
100318469 esac
10032 if test yes = "$hardcode_into_libs"; then
8470 if test "$hardcode_into_libs" = yes; then
100338471 # Hardcode the library paths
100348472 hardcode_libdirs=
100358473 dep_rpath=
10036 rpath=$finalize_rpath
10037 test relink = "$opt_mode" || rpath=$compile_rpath$rpath
8474 rpath="$finalize_rpath"
8475 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
100388476 for libdir in $rpath; do
100398477 if test -n "$hardcode_libdir_flag_spec"; then
100408478 if test -n "$hardcode_libdir_separator"; then
100418479 func_replace_sysroot "$libdir"
100428480 libdir=$func_replace_sysroot_result
100438481 if test -z "$hardcode_libdirs"; then
10044 hardcode_libdirs=$libdir
8482 hardcode_libdirs="$libdir"
100458483 else
100468484 # Just accumulate the unique libdirs.
100478485 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
100488486 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
100498487 ;;
100508488 *)
10051 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8489 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
100528490 ;;
100538491 esac
100548492 fi
100558493 else
100568494 eval flag=\"$hardcode_libdir_flag_spec\"
10057 func_append dep_rpath " $flag"
8495 dep_rpath+=" $flag"
100588496 fi
100598497 elif test -n "$runpath_var"; then
100608498 case "$perm_rpath " in
100618499 *" $libdir "*) ;;
10062 *) func_append perm_rpath " $libdir" ;;
8500 *) perm_rpath+=" $libdir" ;;
100638501 esac
100648502 fi
100658503 done
100668504 # Substitute the hardcoded libdirs into the rpath.
100678505 if test -n "$hardcode_libdir_separator" &&
100688506 test -n "$hardcode_libdirs"; then
10069 libdir=$hardcode_libdirs
8507 libdir="$hardcode_libdirs"
100708508 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
100718509 fi
100728510 if test -n "$runpath_var" && test -n "$perm_rpath"; then
100738511 # We should set the runpath_var.
100748512 rpath=
100758513 for dir in $perm_rpath; do
10076 func_append rpath "$dir:"
8514 rpath+="$dir:"
100778515 done
100788516 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
100798517 fi
100808518 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
100818519 fi
100828520
10083 shlibpath=$finalize_shlibpath
10084 test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
8521 shlibpath="$finalize_shlibpath"
8522 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
100858523 if test -n "$shlibpath"; then
100868524 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
100878525 fi
100918529 eval library_names=\"$library_names_spec\"
100928530 set dummy $library_names
100938531 shift
10094 realname=$1
8532 realname="$1"
100958533 shift
100968534
100978535 if test -n "$soname_spec"; then
100988536 eval soname=\"$soname_spec\"
100998537 else
10100 soname=$realname
8538 soname="$realname"
101018539 fi
101028540 if test -z "$dlname"; then
101038541 dlname=$soname
101048542 fi
101058543
10106 lib=$output_objdir/$realname
8544 lib="$output_objdir/$realname"
101078545 linknames=
101088546 for link
101098547 do
10110 func_append linknames " $link"
8548 linknames+=" $link"
101118549 done
101128550
101138551 # Use standard objects if they are pic
101178555 delfiles=
101188556 if test -n "$export_symbols" && test -n "$include_expsyms"; then
101198557 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
10120 export_symbols=$output_objdir/$libname.uexp
10121 func_append delfiles " $export_symbols"
8558 export_symbols="$output_objdir/$libname.uexp"
8559 delfiles+=" $export_symbols"
101228560 fi
101238561
101248562 orig_export_symbols=
101268564 cygwin* | mingw* | cegcc*)
101278565 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
101288566 # exporting using user supplied symfile
10129 func_dll_def_p "$export_symbols" || {
8567 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
101308568 # and it's NOT already a .def file. Must figure out
101318569 # which of the given symbols are data symbols and tag
101328570 # them as such. So, trigger use of export_symbols_cmds.
101338571 # export_symbols gets reassigned inside the "prepare
101348572 # the list of exported symbols" if statement, so the
101358573 # include_expsyms logic still works.
10136 orig_export_symbols=$export_symbols
8574 orig_export_symbols="$export_symbols"
101378575 export_symbols=
101388576 always_export_symbols=yes
10139 }
8577 fi
101408578 fi
101418579 ;;
101428580 esac
101438581
101448582 # Prepare the list of exported symbols
101458583 if test -z "$export_symbols"; then
10146 if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
10147 func_verbose "generating symbol list for '$libname.la'"
10148 export_symbols=$output_objdir/$libname.exp
8584 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8585 func_verbose "generating symbol list for \`$libname.la'"
8586 export_symbols="$output_objdir/$libname.exp"
101498587 $opt_dry_run || $RM $export_symbols
101508588 cmds=$export_symbols_cmds
10151 save_ifs=$IFS; IFS='~'
8589 save_ifs="$IFS"; IFS='~'
101528590 for cmd1 in $cmds; do
10153 IFS=$save_ifs
8591 IFS="$save_ifs"
101548592 # Take the normal branch if the nm_file_list_spec branch
101558593 # doesn't work or if tool conversion is not needed.
101568594 case $nm_file_list_spec~$to_tool_file_cmd in
101648602 try_normal_branch=no
101658603 ;;
101668604 esac
10167 if test yes = "$try_normal_branch" \
8605 if test "$try_normal_branch" = yes \
101688606 && { test "$len" -lt "$max_cmd_len" \
101698607 || test "$max_cmd_len" -le -1; }
101708608 then
101758613 output_la=$func_basename_result
101768614 save_libobjs=$libobjs
101778615 save_output=$output
10178 output=$output_objdir/$output_la.nm
8616 output=${output_objdir}/${output_la}.nm
101798617 func_to_tool_file "$output"
101808618 libobjs=$nm_file_list_spec$func_to_tool_file_result
10181 func_append delfiles " $output"
8619 delfiles+=" $output"
101828620 func_verbose "creating $NM input file list: $output"
101838621 for obj in $save_libobjs; do
101848622 func_to_tool_file "$obj"
101988636 break
101998637 fi
102008638 done
10201 IFS=$save_ifs
10202 if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
8639 IFS="$save_ifs"
8640 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
102038641 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
102048642 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
102058643 fi
102078645 fi
102088646
102098647 if test -n "$export_symbols" && test -n "$include_expsyms"; then
10210 tmp_export_symbols=$export_symbols
10211 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8648 tmp_export_symbols="$export_symbols"
8649 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
102128650 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
102138651 fi
102148652
10215 if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
8653 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
102168654 # The given exports_symbols file has to be filtered, so filter it.
10217 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8655 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
102188656 # FIXME: $output_objdir/$libname.filter potentially contains lots of
10219 # 's' commands, which not all seds can handle. GNU sed should be fine
8657 # 's' commands which not all seds can handle. GNU sed should be fine
102208658 # though. Also, the filter scales superlinearly with the number of
102218659 # global variables. join(1) would be nice here, but unfortunately
102228660 # isn't a blessed tool.
102238661 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10224 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8662 delfiles+=" $export_symbols $output_objdir/$libname.filter"
102258663 export_symbols=$output_objdir/$libname.def
102268664 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
102278665 fi
102318669 case " $convenience " in
102328670 *" $test_deplib "*) ;;
102338671 *)
10234 func_append tmp_deplibs " $test_deplib"
8672 tmp_deplibs+=" $test_deplib"
102358673 ;;
102368674 esac
102378675 done
10238 deplibs=$tmp_deplibs
8676 deplibs="$tmp_deplibs"
102398677
102408678 if test -n "$convenience"; then
102418679 if test -n "$whole_archive_flag_spec" &&
10242 test yes = "$compiler_needs_object" &&
8680 test "$compiler_needs_object" = yes &&
102438681 test -z "$libobjs"; then
102448682 # extract the archives, so we have objects to list.
102458683 # TODO: could optimize this to just extract one archive.
102508688 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
102518689 test "X$libobjs" = "X " && libobjs=
102528690 else
10253 gentop=$output_objdir/${outputname}x
10254 func_append generated " $gentop"
8691 gentop="$output_objdir/${outputname}x"
8692 generated+=" $gentop"
102558693
102568694 func_extract_archives $gentop $convenience
10257 func_append libobjs " $func_extract_archives_result"
8695 libobjs+=" $func_extract_archives_result"
102588696 test "X$libobjs" = "X " && libobjs=
102598697 fi
102608698 fi
102618699
10262 if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
8700 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
102638701 eval flag=\"$thread_safe_flag_spec\"
10264 func_append linker_flags " $flag"
8702 linker_flags+=" $flag"
102658703 fi
102668704
102678705 # Make a backup of the uninstalled library when relinking
10268 if test relink = "$opt_mode"; then
8706 if test "$opt_mode" = relink; then
102698707 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
102708708 fi
102718709
102728710 # Do each of the archive commands.
10273 if test yes = "$module" && test -n "$module_cmds"; then
8711 if test "$module" = yes && test -n "$module_cmds" ; then
102748712 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
102758713 eval test_cmds=\"$module_expsym_cmds\"
102768714 cmds=$module_expsym_cmds
102888726 fi
102898727 fi
102908728
10291 if test : != "$skipped_export" &&
8729 if test "X$skipped_export" != "X:" &&
102928730 func_len " $test_cmds" &&
102938731 len=$func_len_result &&
102948732 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
103218759 last_robj=
103228760 k=1
103238761
10324 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
10325 output=$output_objdir/$output_la.lnkscript
8762 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8763 output=${output_objdir}/${output_la}.lnkscript
103268764 func_verbose "creating GNU ld script: $output"
103278765 echo 'INPUT (' > $output
103288766 for obj in $save_libobjs
103318769 $ECHO "$func_to_tool_file_result" >> $output
103328770 done
103338771 echo ')' >> $output
10334 func_append delfiles " $output"
8772 delfiles+=" $output"
103358773 func_to_tool_file "$output"
103368774 output=$func_to_tool_file_result
10337 elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
10338 output=$output_objdir/$output_la.lnk
8775 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8776 output=${output_objdir}/${output_la}.lnk
103398777 func_verbose "creating linker input file list: $output"
103408778 : > $output
103418779 set x $save_libobjs
103428780 shift
103438781 firstobj=
10344 if test yes = "$compiler_needs_object"; then
8782 if test "$compiler_needs_object" = yes; then
103458783 firstobj="$1 "
103468784 shift
103478785 fi
103508788 func_to_tool_file "$obj"
103518789 $ECHO "$func_to_tool_file_result" >> $output
103528790 done
10353 func_append delfiles " $output"
8791 delfiles+=" $output"
103548792 func_to_tool_file "$output"
103558793 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
103568794 else
103578795 if test -n "$save_libobjs"; then
103588796 func_verbose "creating reloadable object files..."
10359 output=$output_objdir/$output_la-$k.$objext
8797 output=$output_objdir/$output_la-${k}.$objext
103608798 eval test_cmds=\"$reload_cmds\"
103618799 func_len " $test_cmds"
103628800 len0=$func_len_result
103688806 func_len " $obj"
103698807 func_arith $len + $func_len_result
103708808 len=$func_arith_result
10371 if test -z "$objlist" ||
8809 if test "X$objlist" = X ||
103728810 test "$len" -lt "$max_cmd_len"; then
10373 func_append objlist " $obj"
8811 objlist+=" $obj"
103748812 else
103758813 # The command $test_cmds is almost too long, add a
103768814 # command to the queue.
10377 if test 1 -eq "$k"; then
8815 if test "$k" -eq 1 ; then
103788816 # The first file doesn't have a previous command to add.
103798817 reload_objs=$objlist
103808818 eval concat_cmds=\"$reload_cmds\"
103848822 reload_objs="$objlist $last_robj"
103858823 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
103868824 fi
10387 last_robj=$output_objdir/$output_la-$k.$objext
8825 last_robj=$output_objdir/$output_la-${k}.$objext
103888826 func_arith $k + 1
103898827 k=$func_arith_result
10390 output=$output_objdir/$output_la-$k.$objext
8828 output=$output_objdir/$output_la-${k}.$objext
103918829 objlist=" $obj"
103928830 func_len " $last_robj"
103938831 func_arith $len0 + $func_len_result
103998837 # files will link in the last one created.
104008838 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
104018839 reload_objs="$objlist $last_robj"
10402 eval concat_cmds=\"\$concat_cmds$reload_cmds\"
8840 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
104038841 if test -n "$last_robj"; then
10404 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8842 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
104058843 fi
10406 func_append delfiles " $output"
8844 delfiles+=" $output"
104078845
104088846 else
104098847 output=
104108848 fi
104118849
10412 ${skipped_export-false} && {
10413 func_verbose "generating symbol list for '$libname.la'"
10414 export_symbols=$output_objdir/$libname.exp
8850 if ${skipped_export-false}; then
8851 func_verbose "generating symbol list for \`$libname.la'"
8852 export_symbols="$output_objdir/$libname.exp"
104158853 $opt_dry_run || $RM $export_symbols
104168854 libobjs=$output
104178855 # Append the command to create the export file.
104208858 if test -n "$last_robj"; then
104218859 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
104228860 fi
10423 }
8861 fi
104248862
104258863 test -n "$save_libobjs" &&
104268864 func_verbose "creating a temporary reloadable object file: $output"
104278865
104288866 # Loop through the commands generated above and execute them.
10429 save_ifs=$IFS; IFS='~'
8867 save_ifs="$IFS"; IFS='~'
104308868 for cmd in $concat_cmds; do
10431 IFS=$save_ifs
10432 $opt_quiet || {
8869 IFS="$save_ifs"
8870 $opt_silent || {
104338871 func_quote_for_expand "$cmd"
104348872 eval "func_echo $func_quote_for_expand_result"
104358873 }
104378875 lt_exit=$?
104388876
104398877 # Restore the uninstalled library and exit
10440 if test relink = "$opt_mode"; then
8878 if test "$opt_mode" = relink; then
104418879 ( cd "$output_objdir" && \
104428880 $RM "${realname}T" && \
104438881 $MV "${realname}U" "$realname" )
104468884 exit $lt_exit
104478885 }
104488886 done
10449 IFS=$save_ifs
8887 IFS="$save_ifs"
104508888
104518889 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
104528890 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
104548892 fi
104558893 fi
104568894
10457 ${skipped_export-false} && {
8895 if ${skipped_export-false}; then
104588896 if test -n "$export_symbols" && test -n "$include_expsyms"; then
10459 tmp_export_symbols=$export_symbols
10460 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8897 tmp_export_symbols="$export_symbols"
8898 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
104618899 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
104628900 fi
104638901
104648902 if test -n "$orig_export_symbols"; then
104658903 # The given exports_symbols file has to be filtered, so filter it.
10466 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8904 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
104678905 # FIXME: $output_objdir/$libname.filter potentially contains lots of
10468 # 's' commands, which not all seds can handle. GNU sed should be fine
8906 # 's' commands which not all seds can handle. GNU sed should be fine
104698907 # though. Also, the filter scales superlinearly with the number of
104708908 # global variables. join(1) would be nice here, but unfortunately
104718909 # isn't a blessed tool.
104728910 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
10473 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8911 delfiles+=" $export_symbols $output_objdir/$libname.filter"
104748912 export_symbols=$output_objdir/$libname.def
104758913 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
104768914 fi
10477 }
8915 fi
104788916
104798917 libobjs=$output
104808918 # Restore the value of output.
104888926 # value of $libobjs for piecewise linking.
104898927
104908928 # Do each of the archive commands.
10491 if test yes = "$module" && test -n "$module_cmds"; then
8929 if test "$module" = yes && test -n "$module_cmds" ; then
104928930 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
104938931 cmds=$module_expsym_cmds
104948932 else
105108948
105118949 # Add any objects from preloaded convenience libraries
105128950 if test -n "$dlprefiles"; then
10513 gentop=$output_objdir/${outputname}x
10514 func_append generated " $gentop"
8951 gentop="$output_objdir/${outputname}x"
8952 generated+=" $gentop"
105158953
105168954 func_extract_archives $gentop $dlprefiles
10517 func_append libobjs " $func_extract_archives_result"
8955 libobjs+=" $func_extract_archives_result"
105188956 test "X$libobjs" = "X " && libobjs=
105198957 fi
105208958
10521 save_ifs=$IFS; IFS='~'
8959 save_ifs="$IFS"; IFS='~'
105228960 for cmd in $cmds; do
10523 IFS=$sp$nl
8961 IFS="$save_ifs"
105248962 eval cmd=\"$cmd\"
10525 IFS=$save_ifs
10526 $opt_quiet || {
8963 $opt_silent || {
105278964 func_quote_for_expand "$cmd"
105288965 eval "func_echo $func_quote_for_expand_result"
105298966 }
105318968 lt_exit=$?
105328969
105338970 # Restore the uninstalled library and exit
10534 if test relink = "$opt_mode"; then
8971 if test "$opt_mode" = relink; then
105358972 ( cd "$output_objdir" && \
105368973 $RM "${realname}T" && \
105378974 $MV "${realname}U" "$realname" )
105408977 exit $lt_exit
105418978 }
105428979 done
10543 IFS=$save_ifs
8980 IFS="$save_ifs"
105448981
105458982 # Restore the uninstalled library and exit
10546 if test relink = "$opt_mode"; then
8983 if test "$opt_mode" = relink; then
105478984 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
105488985
105498986 if test -n "$convenience"; then
105639000 done
105649001
105659002 # If -module or -export-dynamic was specified, set the dlname.
10566 if test yes = "$module" || test yes = "$export_dynamic"; then
9003 if test "$module" = yes || test "$export_dynamic" = yes; then
105679004 # On all known operating systems, these are identical.
10568 dlname=$soname
9005 dlname="$soname"
105699006 fi
105709007 fi
105719008 ;;
105729009
105739010 obj)
10574 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10575 func_warning "'-dlopen' is ignored for objects"
9011 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9012 func_warning "\`-dlopen' is ignored for objects"
105769013 fi
105779014
105789015 case " $deplibs" in
105799016 *\ -l* | *\ -L*)
10580 func_warning "'-l' and '-L' are ignored for objects" ;;
9017 func_warning "\`-l' and \`-L' are ignored for objects" ;;
105819018 esac
105829019
105839020 test -n "$rpath" && \
10584 func_warning "'-rpath' is ignored for objects"
9021 func_warning "\`-rpath' is ignored for objects"
105859022
105869023 test -n "$xrpath" && \
10587 func_warning "'-R' is ignored for objects"
9024 func_warning "\`-R' is ignored for objects"
105889025
105899026 test -n "$vinfo" && \
10590 func_warning "'-version-info' is ignored for objects"
9027 func_warning "\`-version-info' is ignored for objects"
105919028
105929029 test -n "$release" && \
10593 func_warning "'-release' is ignored for objects"
9030 func_warning "\`-release' is ignored for objects"
105949031
105959032 case $output in
105969033 *.lo)
105979034 test -n "$objs$old_deplibs" && \
10598 func_fatal_error "cannot build library object '$output' from non-libtool objects"
9035 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
105999036
106009037 libobj=$output
106019038 func_lo2o "$libobj"
106039040 ;;
106049041 *)
106059042 libobj=
10606 obj=$output
9043 obj="$output"
106079044 ;;
106089045 esac
106099046
106169053 # the extraction.
106179054 reload_conv_objs=
106189055 gentop=
10619 # if reload_cmds runs $LD directly, get rid of -Wl from
10620 # whole_archive_flag_spec and hope we can get by with turning comma
10621 # into space.
10622 case $reload_cmds in
10623 *\$LD[\ \$]*) wl= ;;
10624 esac
9056 # reload_cmds runs $LD directly, so let us get rid of
9057 # -Wl from whole_archive_flag_spec and hope we can get by with
9058 # turning comma into space..
9059 wl=
9060
106259061 if test -n "$convenience"; then
106269062 if test -n "$whole_archive_flag_spec"; then
106279063 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10628 test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10629 reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
9064 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
106309065 else
10631 gentop=$output_objdir/${obj}x
10632 func_append generated " $gentop"
9066 gentop="$output_objdir/${obj}x"
9067 generated+=" $gentop"
106339068
106349069 func_extract_archives $gentop $convenience
106359070 reload_conv_objs="$reload_objs $func_extract_archives_result"
106379072 fi
106389073
106399074 # If we're not building shared, we need to use non_pic_objs
10640 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
9075 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
106419076
106429077 # Create the old-style object.
10643 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10644
10645 output=$obj
9078 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
9079
9080 output="$obj"
106469081 func_execute_cmds "$reload_cmds" 'exit $?'
106479082
106489083 # Exit if we aren't doing a library object file.
106549089 exit $EXIT_SUCCESS
106559090 fi
106569091
10657 test yes = "$build_libtool_libs" || {
9092 if test "$build_libtool_libs" != yes; then
106589093 if test -n "$gentop"; then
106599094 func_show_eval '${RM}r "$gentop"'
106609095 fi
106649099 # $show "echo timestamp > $libobj"
106659100 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
106669101 exit $EXIT_SUCCESS
10667 }
10668
10669 if test -n "$pic_flag" || test default != "$pic_mode"; then
9102 fi
9103
9104 if test -n "$pic_flag" || test "$pic_mode" != default; then
106709105 # Only do commands if we really have different PIC objects.
106719106 reload_objs="$libobjs $reload_conv_objs"
10672 output=$libobj
9107 output="$libobj"
106739108 func_execute_cmds "$reload_cmds" 'exit $?'
106749109 fi
106759110
106869121 output=$func_stripname_result.exe;;
106879122 esac
106889123 test -n "$vinfo" && \
10689 func_warning "'-version-info' is ignored for programs"
9124 func_warning "\`-version-info' is ignored for programs"
106909125
106919126 test -n "$release" && \
10692 func_warning "'-release' is ignored for programs"
10693
10694 $preload \
10695 && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10696 && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
9127 func_warning "\`-release' is ignored for programs"
9128
9129 test "$preload" = yes \
9130 && test "$dlopen_support" = unknown \
9131 && test "$dlopen_self" = unknown \
9132 && test "$dlopen_self_static" = unknown && \
9133 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
106979134
106989135 case $host in
106999136 *-*-rhapsody* | *-*-darwin1.[012])
107079144 *-*-darwin*)
107089145 # Don't allow lazy linking, it breaks C++ global constructors
107099146 # But is supposedly fixed on 10.4 or later (yay!).
10710 if test CXX = "$tagname"; then
9147 if test "$tagname" = CXX ; then
107119148 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
107129149 10.[0123])
10713 func_append compile_command " $wl-bind_at_load"
10714 func_append finalize_command " $wl-bind_at_load"
9150 compile_command+=" ${wl}-bind_at_load"
9151 finalize_command+=" ${wl}-bind_at_load"
107159152 ;;
107169153 esac
107179154 fi
107319168 *)
107329169 case " $compile_deplibs " in
107339170 *" -L$path/$objdir "*)
10734 func_append new_libs " -L$path/$objdir" ;;
9171 new_libs+=" -L$path/$objdir" ;;
107359172 esac
107369173 ;;
107379174 esac
107419178 -L*)
107429179 case " $new_libs " in
107439180 *" $deplib "*) ;;
10744 *) func_append new_libs " $deplib" ;;
9181 *) new_libs+=" $deplib" ;;
107459182 esac
107469183 ;;
10747 *) func_append new_libs " $deplib" ;;
9184 *) new_libs+=" $deplib" ;;
107489185 esac
107499186 done
10750 compile_deplibs=$new_libs
10751
10752
10753 func_append compile_command " $compile_deplibs"
10754 func_append finalize_command " $finalize_deplibs"
9187 compile_deplibs="$new_libs"
9188
9189
9190 compile_command+=" $compile_deplibs"
9191 finalize_command+=" $finalize_deplibs"
107559192
107569193 if test -n "$rpath$xrpath"; then
107579194 # If the user specified any rpath flags, then add them.
107599196 # This is the magic to use -rpath.
107609197 case "$finalize_rpath " in
107619198 *" $libdir "*) ;;
10762 *) func_append finalize_rpath " $libdir" ;;
9199 *) finalize_rpath+=" $libdir" ;;
107639200 esac
107649201 done
107659202 fi
107719208 if test -n "$hardcode_libdir_flag_spec"; then
107729209 if test -n "$hardcode_libdir_separator"; then
107739210 if test -z "$hardcode_libdirs"; then
10774 hardcode_libdirs=$libdir
9211 hardcode_libdirs="$libdir"
107759212 else
107769213 # Just accumulate the unique libdirs.
107779214 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
107789215 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
107799216 ;;
107809217 *)
10781 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9218 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
107829219 ;;
107839220 esac
107849221 fi
107859222 else
107869223 eval flag=\"$hardcode_libdir_flag_spec\"
10787 func_append rpath " $flag"
9224 rpath+=" $flag"
107889225 fi
107899226 elif test -n "$runpath_var"; then
107909227 case "$perm_rpath " in
107919228 *" $libdir "*) ;;
10792 *) func_append perm_rpath " $libdir" ;;
9229 *) perm_rpath+=" $libdir" ;;
107939230 esac
107949231 fi
107959232 case $host in
107969233 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10797 testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
9234 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
107989235 case :$dllsearchpath: in
107999236 *":$libdir:"*) ;;
108009237 ::) dllsearchpath=$libdir;;
10801 *) func_append dllsearchpath ":$libdir";;
9238 *) dllsearchpath+=":$libdir";;
108029239 esac
108039240 case :$dllsearchpath: in
108049241 *":$testbindir:"*) ;;
108059242 ::) dllsearchpath=$testbindir;;
10806 *) func_append dllsearchpath ":$testbindir";;
9243 *) dllsearchpath+=":$testbindir";;
108079244 esac
108089245 ;;
108099246 esac
108119248 # Substitute the hardcoded libdirs into the rpath.
108129249 if test -n "$hardcode_libdir_separator" &&
108139250 test -n "$hardcode_libdirs"; then
10814 libdir=$hardcode_libdirs
9251 libdir="$hardcode_libdirs"
108159252 eval rpath=\" $hardcode_libdir_flag_spec\"
108169253 fi
10817 compile_rpath=$rpath
9254 compile_rpath="$rpath"
108189255
108199256 rpath=
108209257 hardcode_libdirs=
108229259 if test -n "$hardcode_libdir_flag_spec"; then
108239260 if test -n "$hardcode_libdir_separator"; then
108249261 if test -z "$hardcode_libdirs"; then
10825 hardcode_libdirs=$libdir
9262 hardcode_libdirs="$libdir"
108269263 else
108279264 # Just accumulate the unique libdirs.
108289265 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
108299266 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
108309267 ;;
108319268 *)
10832 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
9269 hardcode_libdirs+="$hardcode_libdir_separator$libdir"
108339270 ;;
108349271 esac
108359272 fi
108369273 else
108379274 eval flag=\"$hardcode_libdir_flag_spec\"
10838 func_append rpath " $flag"
9275 rpath+=" $flag"
108399276 fi
108409277 elif test -n "$runpath_var"; then
108419278 case "$finalize_perm_rpath " in
108429279 *" $libdir "*) ;;
10843 *) func_append finalize_perm_rpath " $libdir" ;;
9280 *) finalize_perm_rpath+=" $libdir" ;;
108449281 esac
108459282 fi
108469283 done
108479284 # Substitute the hardcoded libdirs into the rpath.
108489285 if test -n "$hardcode_libdir_separator" &&
108499286 test -n "$hardcode_libdirs"; then
10850 libdir=$hardcode_libdirs
9287 libdir="$hardcode_libdirs"
108519288 eval rpath=\" $hardcode_libdir_flag_spec\"
108529289 fi
10853 finalize_rpath=$rpath
10854
10855 if test -n "$libobjs" && test yes = "$build_old_libs"; then
9290 finalize_rpath="$rpath"
9291
9292 if test -n "$libobjs" && test "$build_old_libs" = yes; then
108569293 # Transform all the library objects into standard objects.
108579294 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
108589295 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
108599296 fi
108609297
10861 func_generate_dlsyms "$outputname" "@PROGRAM@" false
9298 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
108629299
108639300 # template prelinking step
108649301 if test -n "$prelink_cmds"; then
108659302 func_execute_cmds "$prelink_cmds" 'exit $?'
108669303 fi
108679304
10868 wrappers_required=:
9305 wrappers_required=yes
108699306 case $host in
108709307 *cegcc* | *mingw32ce*)
108719308 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10872 wrappers_required=false
9309 wrappers_required=no
108739310 ;;
108749311 *cygwin* | *mingw* )
10875 test yes = "$build_libtool_libs" || wrappers_required=false
9312 if test "$build_libtool_libs" != yes; then
9313 wrappers_required=no
9314 fi
108769315 ;;
108779316 *)
10878 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10879 wrappers_required=false
9317 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
9318 wrappers_required=no
108809319 fi
108819320 ;;
108829321 esac
10883 $wrappers_required || {
9322 if test "$wrappers_required" = no; then
108849323 # Replace the output file specification.
108859324 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10886 link_command=$compile_command$compile_rpath
9325 link_command="$compile_command$compile_rpath"
108879326
108889327 # We have no uninstalled library dependencies, so finalize right now.
108899328 exit_status=0
108969335 fi
108979336
108989337 # Delete the generated files.
10899 if test -f "$output_objdir/${outputname}S.$objext"; then
10900 func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
9338 if test -f "$output_objdir/${outputname}S.${objext}"; then
9339 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
109019340 fi
109029341
109039342 exit $exit_status
10904 }
9343 fi
109059344
109069345 if test -n "$compile_shlibpath$finalize_shlibpath"; then
109079346 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
109179356 # We should set the runpath_var.
109189357 rpath=
109199358 for dir in $perm_rpath; do
10920 func_append rpath "$dir:"
9359 rpath+="$dir:"
109219360 done
109229361 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
109239362 fi
109259364 # We should set the runpath_var.
109269365 rpath=
109279366 for dir in $finalize_perm_rpath; do
10928 func_append rpath "$dir:"
9367 rpath+="$dir:"
109299368 done
109309369 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
109319370 fi
109329371 fi
109339372
10934 if test yes = "$no_install"; then
9373 if test "$no_install" = yes; then
109359374 # We don't need to create a wrapper script.
10936 link_command=$compile_var$compile_command$compile_rpath
9375 link_command="$compile_var$compile_command$compile_rpath"
109379376 # Replace the output file specification.
109389377 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
109399378 # Delete the old output file.
109509389 exit $EXIT_SUCCESS
109519390 fi
109529391
10953 case $hardcode_action,$fast_install in
10954 relink,*)
10955 # Fast installation is not supported
10956 link_command=$compile_var$compile_command$compile_rpath
10957 relink_command=$finalize_var$finalize_command$finalize_rpath
10958
10959 func_warning "this platform does not like uninstalled shared libraries"
10960 func_warning "'$output' will be relinked during installation"
10961 ;;
10962 *,yes)
10963 link_command=$finalize_var$compile_command$finalize_rpath
10964 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10965 ;;
10966 *,no)
10967 link_command=$compile_var$compile_command$compile_rpath
10968 relink_command=$finalize_var$finalize_command$finalize_rpath
10969 ;;
10970 *,needless)
10971 link_command=$finalize_var$compile_command$finalize_rpath
10972 relink_command=
10973 ;;
10974 esac
9392 if test "$hardcode_action" = relink; then
9393 # Fast installation is not supported
9394 link_command="$compile_var$compile_command$compile_rpath"
9395 relink_command="$finalize_var$finalize_command$finalize_rpath"
9396
9397 func_warning "this platform does not like uninstalled shared libraries"
9398 func_warning "\`$output' will be relinked during installation"
9399 else
9400 if test "$fast_install" != no; then
9401 link_command="$finalize_var$compile_command$finalize_rpath"
9402 if test "$fast_install" = yes; then
9403 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
9404 else
9405 # fast_install is set to needless
9406 relink_command=
9407 fi
9408 else
9409 link_command="$compile_var$compile_command$compile_rpath"
9410 relink_command="$finalize_var$finalize_command$finalize_rpath"
9411 fi
9412 fi
109759413
109769414 # Replace the output file specification.
109779415 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
110289466 func_dirname_and_basename "$output" "" "."
110299467 output_name=$func_basename_result
110309468 output_path=$func_dirname_result
11031 cwrappersource=$output_path/$objdir/lt-$output_name.c
11032 cwrapper=$output_path/$output_name.exe
9469 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9470 cwrapper="$output_path/$output_name.exe"
110339471 $RM $cwrappersource $cwrapper
110349472 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
110359473
110509488 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
110519489 $opt_dry_run || {
110529490 # note: this script will not be executed, so do not chmod.
11053 if test "x$build" = "x$host"; then
9491 if test "x$build" = "x$host" ; then
110549492 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
110559493 else
110569494 func_emit_wrapper no > $func_ltwrapper_scriptname_result
110739511 # See if we need to build an old-fashioned archive.
110749512 for oldlib in $oldlibs; do
110759513
11076 case $build_libtool_libs in
11077 convenience)
11078 oldobjs="$libobjs_save $symfileobj"
11079 addlibs=$convenience
9514 if test "$build_libtool_libs" = convenience; then
9515 oldobjs="$libobjs_save $symfileobj"
9516 addlibs="$convenience"
9517 build_libtool_libs=no
9518 else
9519 if test "$build_libtool_libs" = module; then
9520 oldobjs="$libobjs_save"
110809521 build_libtool_libs=no
11081 ;;
11082 module)
11083 oldobjs=$libobjs_save
11084 addlibs=$old_convenience
11085 build_libtool_libs=no
11086 ;;
11087 *)
9522 else
110889523 oldobjs="$old_deplibs $non_pic_objects"
11089 $preload && test -f "$symfileobj" \
11090 && func_append oldobjs " $symfileobj"
11091 addlibs=$old_convenience
11092 ;;
11093 esac
9524 if test "$preload" = yes && test -f "$symfileobj"; then
9525 oldobjs+=" $symfileobj"
9526 fi
9527 fi
9528 addlibs="$old_convenience"
9529 fi
110949530
110959531 if test -n "$addlibs"; then
11096 gentop=$output_objdir/${outputname}x
11097 func_append generated " $gentop"
9532 gentop="$output_objdir/${outputname}x"
9533 generated+=" $gentop"
110989534
110999535 func_extract_archives $gentop $addlibs
11100 func_append oldobjs " $func_extract_archives_result"
9536 oldobjs+=" $func_extract_archives_result"
111019537 fi
111029538
111039539 # Do each command in the archive commands.
11104 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
9540 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
111059541 cmds=$old_archive_from_new_cmds
111069542 else
111079543
111089544 # Add any objects from preloaded convenience libraries
111099545 if test -n "$dlprefiles"; then
11110 gentop=$output_objdir/${outputname}x
11111 func_append generated " $gentop"
9546 gentop="$output_objdir/${outputname}x"
9547 generated+=" $gentop"
111129548
111139549 func_extract_archives $gentop $dlprefiles
11114 func_append oldobjs " $func_extract_archives_result"
9550 oldobjs+=" $func_extract_archives_result"
111159551 fi
111169552
111179553 # POSIX demands no paths to be encoded in archives. We have
111289564 :
111299565 else
111309566 echo "copying selected object files to avoid basename conflicts..."
11131 gentop=$output_objdir/${outputname}x
11132 func_append generated " $gentop"
9567 gentop="$output_objdir/${outputname}x"
9568 generated+=" $gentop"
111339569 func_mkdir_p "$gentop"
111349570 save_oldobjs=$oldobjs
111359571 oldobjs=
111379573 for obj in $save_oldobjs
111389574 do
111399575 func_basename "$obj"
11140 objbase=$func_basename_result
9576 objbase="$func_basename_result"
111419577 case " $oldobjs " in
111429578 " ") oldobjs=$obj ;;
111439579 *[\ /]"$objbase "*)
111539589 esac
111549590 done
111559591 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
11156 func_append oldobjs " $gentop/$newobj"
9592 oldobjs+=" $gentop/$newobj"
111579593 ;;
11158 *) func_append oldobjs " $obj" ;;
9594 *) oldobjs+=" $obj" ;;
111599595 esac
111609596 done
111619597 fi
112009636 func_len " $obj"
112019637 func_arith $len + $func_len_result
112029638 len=$func_arith_result
11203 func_append objlist " $obj"
9639 objlist+=" $obj"
112049640 if test "$len" -lt "$max_cmd_len"; then
112059641 :
112069642 else
112079643 # the above command should be used before it gets too long
112089644 oldobjs=$objlist
11209 if test "$obj" = "$last_oldobj"; then
9645 if test "$obj" = "$last_oldobj" ; then
112109646 RANLIB=$save_RANLIB
112119647 fi
112129648 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
11213 eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
9649 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
112149650 objlist=
112159651 len=$len0
112169652 fi
112179653 done
112189654 RANLIB=$save_RANLIB
112199655 oldobjs=$objlist
11220 if test -z "$oldobjs"; then
9656 if test "X$oldobjs" = "X" ; then
112219657 eval cmds=\"\$concat_cmds\"
112229658 else
112239659 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
112349670 case $output in
112359671 *.la)
112369672 old_library=
11237 test yes = "$build_old_libs" && old_library=$libname.$libext
9673 test "$build_old_libs" = yes && old_library="$libname.$libext"
112389674 func_verbose "creating $output"
112399675
112409676 # Preserve any variables that may affect compiler behavior
112499685 fi
112509686 done
112519687 # Quote the link command for shipping.
11252 relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9688 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
112539689 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
11254 if test yes = "$hardcode_automatic"; then
9690 if test "$hardcode_automatic" = yes ; then
112559691 relink_command=
112569692 fi
112579693
112589694 # Only create the output if not a dry run.
112599695 $opt_dry_run || {
112609696 for installed in no yes; do
11261 if test yes = "$installed"; then
9697 if test "$installed" = yes; then
112629698 if test -z "$install_libdir"; then
112639699 break
112649700 fi
11265 output=$output_objdir/${outputname}i
9701 output="$output_objdir/$outputname"i
112669702 # Replace all uninstalled libtool libraries with the installed ones
112679703 newdependency_libs=
112689704 for deplib in $dependency_libs; do
112699705 case $deplib in
112709706 *.la)
112719707 func_basename "$deplib"
11272 name=$func_basename_result
9708 name="$func_basename_result"
112739709 func_resolve_sysroot "$deplib"
11274 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9710 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
112759711 test -z "$libdir" && \
11276 func_fatal_error "'$deplib' is not a valid libtool archive"
11277 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9712 func_fatal_error "\`$deplib' is not a valid libtool archive"
9713 newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
112789714 ;;
112799715 -L*)
112809716 func_stripname -L '' "$deplib"
112819717 func_replace_sysroot "$func_stripname_result"
11282 func_append newdependency_libs " -L$func_replace_sysroot_result"
9718 newdependency_libs+=" -L$func_replace_sysroot_result"
112839719 ;;
112849720 -R*)
112859721 func_stripname -R '' "$deplib"
112869722 func_replace_sysroot "$func_stripname_result"
11287 func_append newdependency_libs " -R$func_replace_sysroot_result"
9723 newdependency_libs+=" -R$func_replace_sysroot_result"
112889724 ;;
11289 *) func_append newdependency_libs " $deplib" ;;
9725 *) newdependency_libs+=" $deplib" ;;
112909726 esac
112919727 done
11292 dependency_libs=$newdependency_libs
9728 dependency_libs="$newdependency_libs"
112939729 newdlfiles=
112949730
112959731 for lib in $dlfiles; do
112969732 case $lib in
112979733 *.la)
112989734 func_basename "$lib"
11299 name=$func_basename_result
11300 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9735 name="$func_basename_result"
9736 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
113019737 test -z "$libdir" && \
11302 func_fatal_error "'$lib' is not a valid libtool archive"
11303 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9738 func_fatal_error "\`$lib' is not a valid libtool archive"
9739 newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
113049740 ;;
11305 *) func_append newdlfiles " $lib" ;;
9741 *) newdlfiles+=" $lib" ;;
113069742 esac
113079743 done
11308 dlfiles=$newdlfiles
9744 dlfiles="$newdlfiles"
113099745 newdlprefiles=
113109746 for lib in $dlprefiles; do
113119747 case $lib in
113159751 # didn't already link the preopened objects directly into
113169752 # the library:
113179753 func_basename "$lib"
11318 name=$func_basename_result
11319 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9754 name="$func_basename_result"
9755 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
113209756 test -z "$libdir" && \
11321 func_fatal_error "'$lib' is not a valid libtool archive"
11322 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9757 func_fatal_error "\`$lib' is not a valid libtool archive"
9758 newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
113239759 ;;
113249760 esac
113259761 done
11326 dlprefiles=$newdlprefiles
9762 dlprefiles="$newdlprefiles"
113279763 else
113289764 newdlfiles=
113299765 for lib in $dlfiles; do
113309766 case $lib in
11331 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9767 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
113329768 *) abs=`pwd`"/$lib" ;;
113339769 esac
11334 func_append newdlfiles " $abs"
9770 newdlfiles+=" $abs"
113359771 done
11336 dlfiles=$newdlfiles
9772 dlfiles="$newdlfiles"
113379773 newdlprefiles=
113389774 for lib in $dlprefiles; do
113399775 case $lib in
11340 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9776 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
113419777 *) abs=`pwd`"/$lib" ;;
113429778 esac
11343 func_append newdlprefiles " $abs"
9779 newdlprefiles+=" $abs"
113449780 done
11345 dlprefiles=$newdlprefiles
9781 dlprefiles="$newdlprefiles"
113469782 fi
113479783 $RM $output
113489784 # place dlname in correct position for cygwin
113589794 case $host,$output,$installed,$module,$dlname in
113599795 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
113609796 # If a -bindir argument was supplied, place the dll there.
11361 if test -n "$bindir"; then
9797 if test "x$bindir" != x ;
9798 then
113629799 func_relative_path "$install_libdir" "$bindir"
11363 tdlname=$func_relative_path_result/$dlname
9800 tdlname=$func_relative_path_result$dlname
113649801 else
113659802 # Otherwise fall back on heuristic.
113669803 tdlname=../bin/$dlname
113699806 esac
113709807 $ECHO > $output "\
113719808 # $outputname - a libtool library file
11372 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
9809 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
113739810 #
113749811 # Please DO NOT delete this file!
113759812 # It is necessary for linking the library.
113839820 # The name of the static archive.
113849821 old_library='$old_library'
113859822
11386 # Linker flags that cannot go in dependency_libs.
9823 # Linker flags that can not go in dependency_libs.
113879824 inherited_linker_flags='$new_inherited_linker_flags'
113889825
113899826 # Libraries that this one depends upon.
114099846
114109847 # Directory that this library needs to be installed in:
114119848 libdir='$install_libdir'"
11412 if test no,yes = "$installed,$need_relink"; then
9849 if test "$installed" = no && test "$need_relink" = yes; then
114139850 $ECHO >> $output "\
114149851 relink_command=\"$relink_command\""
114159852 fi
114249861 exit $EXIT_SUCCESS
114259862 }
114269863
11427 if test link = "$opt_mode" || test relink = "$opt_mode"; then
11428 func_mode_link ${1+"$@"}
11429 fi
9864 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9865 func_mode_link ${1+"$@"}
114309866
114319867
114329868 # func_mode_uninstall arg...
114339869 func_mode_uninstall ()
114349870 {
11435 $debug_cmd
11436
11437 RM=$nonopt
9871 $opt_debug
9872 RM="$nonopt"
114389873 files=
11439 rmforce=false
9874 rmforce=
114409875 exit_status=0
114419876
114429877 # This variable tells wrapper scripts just to set variables rather
114439878 # than running their programs.
11444 libtool_install_magic=$magic
9879 libtool_install_magic="$magic"
114459880
114469881 for arg
114479882 do
114489883 case $arg in
11449 -f) func_append RM " $arg"; rmforce=: ;;
11450 -*) func_append RM " $arg" ;;
11451 *) func_append files " $arg" ;;
9884 -f) RM+=" $arg"; rmforce=yes ;;
9885 -*) RM+=" $arg" ;;
9886 *) files+=" $arg" ;;
114529887 esac
114539888 done
114549889
114599894
114609895 for file in $files; do
114619896 func_dirname "$file" "" "."
11462 dir=$func_dirname_result
11463 if test . = "$dir"; then
11464 odir=$objdir
9897 dir="$func_dirname_result"
9898 if test "X$dir" = X.; then
9899 odir="$objdir"
114659900 else
11466 odir=$dir/$objdir
9901 odir="$dir/$objdir"
114679902 fi
114689903 func_basename "$file"
11469 name=$func_basename_result
11470 test uninstall = "$opt_mode" && odir=$dir
9904 name="$func_basename_result"
9905 test "$opt_mode" = uninstall && odir="$dir"
114719906
114729907 # Remember odir for removal later, being careful to avoid duplicates
11473 if test clean = "$opt_mode"; then
9908 if test "$opt_mode" = clean; then
114749909 case " $rmdirs " in
114759910 *" $odir "*) ;;
11476 *) func_append rmdirs " $odir" ;;
9911 *) rmdirs+=" $odir" ;;
114779912 esac
114789913 fi
114799914
114859920 elif test -d "$file"; then
114869921 exit_status=1
114879922 continue
11488 elif $rmforce; then
9923 elif test "$rmforce" = yes; then
114899924 continue
114909925 fi
114919926
11492 rmfiles=$file
9927 rmfiles="$file"
114939928
114949929 case $name in
114959930 *.la)
114999934
115009935 # Delete the libtool libraries and symlinks.
115019936 for n in $library_names; do
11502 func_append rmfiles " $odir/$n"
9937 rmfiles+=" $odir/$n"
115039938 done
11504 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
11505
11506 case $opt_mode in
9939 test -n "$old_library" && rmfiles+=" $odir/$old_library"
9940
9941 case "$opt_mode" in
115079942 clean)
115089943 case " $library_names " in
115099944 *" $dlname "*) ;;
11510 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9945 *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
115119946 esac
11512 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9947 test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
115139948 ;;
115149949 uninstall)
115159950 if test -n "$library_names"; then
115169951 # Do each command in the postuninstall commands.
11517 func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
9952 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
115189953 fi
115199954
115209955 if test -n "$old_library"; then
115219956 # Do each command in the old_postuninstall commands.
11522 func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
9957 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
115239958 fi
115249959 # FIXME: should reinstall the best remaining shared library.
115259960 ;;
115359970 func_source $dir/$name
115369971
115379972 # Add PIC object to the list of files to remove.
11538 if test -n "$pic_object" && test none != "$pic_object"; then
11539 func_append rmfiles " $dir/$pic_object"
9973 if test -n "$pic_object" &&
9974 test "$pic_object" != none; then
9975 rmfiles+=" $dir/$pic_object"
115409976 fi
115419977
115429978 # Add non-PIC object to the list of files to remove.
11543 if test -n "$non_pic_object" && test none != "$non_pic_object"; then
11544 func_append rmfiles " $dir/$non_pic_object"
9979 if test -n "$non_pic_object" &&
9980 test "$non_pic_object" != none; then
9981 rmfiles+=" $dir/$non_pic_object"
115459982 fi
115469983 fi
115479984 ;;
115489985
115499986 *)
11550 if test clean = "$opt_mode"; then
9987 if test "$opt_mode" = clean ; then
115519988 noexename=$name
115529989 case $file in
115539990 *.exe)
115579994 noexename=$func_stripname_result
115589995 # $file with .exe has already been added to rmfiles,
115599996 # add $file without .exe
11560 func_append rmfiles " $file"
9997 rmfiles+=" $file"
115619998 ;;
115629999 esac
1156310000 # Do a test to see if this is a libtool program.
1156610003 func_ltwrapper_scriptname "$file"
1156710004 relink_command=
1156810005 func_source $func_ltwrapper_scriptname_result
11569 func_append rmfiles " $func_ltwrapper_scriptname_result"
10006 rmfiles+=" $func_ltwrapper_scriptname_result"
1157010007 else
1157110008 relink_command=
1157210009 func_source $dir/$noexename
1157410011
1157510012 # note $name still contains .exe if it was in $file originally
1157610013 # as does the version of $file that was added into $rmfiles
11577 func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11578 if test yes = "$fast_install" && test -n "$relink_command"; then
11579 func_append rmfiles " $odir/lt-$name"
10014 rmfiles+=" $odir/$name $odir/${name}S.${objext}"
10015 if test "$fast_install" = yes && test -n "$relink_command"; then
10016 rmfiles+=" $odir/lt-$name"
1158010017 fi
11581 if test "X$noexename" != "X$name"; then
11582 func_append rmfiles " $odir/lt-$noexename.c"
10018 if test "X$noexename" != "X$name" ; then
10019 rmfiles+=" $odir/lt-${noexename}.c"
1158310020 fi
1158410021 fi
1158510022 fi
1158810025 func_show_eval "$RM $rmfiles" 'exit_status=1'
1158910026 done
1159010027
11591 # Try to remove the $objdir's in the directories where we deleted files
10028 # Try to remove the ${objdir}s in the directories where we deleted files
1159210029 for dir in $rmdirs; do
1159310030 if test -d "$dir"; then
1159410031 func_show_eval "rmdir $dir >/dev/null 2>&1"
1159810035 exit $exit_status
1159910036 }
1160010037
11601 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11602 func_mode_uninstall ${1+"$@"}
11603 fi
10038 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
10039 func_mode_uninstall ${1+"$@"}
1160410040
1160510041 test -z "$opt_mode" && {
11606 help=$generic_help
10042 help="$generic_help"
1160710043 func_fatal_help "you must specify a MODE"
1160810044 }
1160910045
1161010046 test -z "$exec_cmd" && \
11611 func_fatal_help "invalid operation mode '$opt_mode'"
10047 func_fatal_help "invalid operation mode \`$opt_mode'"
1161210048
1161310049 if test -n "$exec_cmd"; then
1161410050 eval exec "$exec_cmd"
1161910055
1162010056
1162110057 # The TAGs below are defined such that we never get into a situation
11622 # where we disable both kinds of libraries. Given conflicting
10058 # in which we disable both kinds of libraries. Given conflicting
1162310059 # choices, we go for a static library, that is the most portable,
1162410060 # since we can't tell whether shared libraries were disabled because
1162510061 # the user asked for that or because the platform doesn't support
1164210078 # mode:shell-script
1164310079 # sh-indentation:2
1164410080 # End:
10081 # vi:sw=2
10082
+2165
-3651
ltmain.sh less more
0 #! /bin/sh
1 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
2 ## by inline-source v2014-01-03.01
3
4 # libtool (GNU libtool) 2.4.6
5 # Provide generalized library-building support services.
0
1 # libtool (GNU libtool) 2.4.2
62 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
73
8 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
5 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
96 # This is free software; see the source for copying conditions. There is NO
107 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
118
2522 # General Public License for more details.
2623 #
2724 # You should have received a copy of the GNU General Public License
28 # along with this program. If not, see <http://www.gnu.org/licenses/>.
29
25 # along with GNU Libtool; see the file COPYING. If not, a copy
26 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
27 # or obtained by writing to the Free Software Foundation, Inc.,
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
30 # Usage: $progname [OPTION]... [MODE-ARG]...
31 #
32 # Provide generalized library-building support services.
33 #
34 # --config show all configuration variables
35 # --debug enable verbose shell tracing
36 # -n, --dry-run display commands without modifying any files
37 # --features display basic configuration information and exit
38 # --mode=MODE use operation mode MODE
39 # --preserve-dup-deps don't remove duplicate dependency libraries
40 # --quiet, --silent don't print informational messages
41 # --no-quiet, --no-silent
42 # print informational messages (default)
43 # --no-warn don't display warning messages
44 # --tag=TAG use configuration variables from tag TAG
45 # -v, --verbose print more informational messages than default
46 # --no-verbose don't print the extra informational messages
47 # --version print version information
48 # -h, --help, --help-all print short, long, or detailed help message
49 #
50 # MODE must be one of the following:
51 #
52 # clean remove files from the build directory
53 # compile compile a source file into a libtool object
54 # execute automatically set library path, then run a program
55 # finish complete the installation of libtool libraries
56 # install install libraries or executables
57 # link create a library or an executable
58 # uninstall remove libraries from an installed directory
59 #
60 # MODE-ARGS vary depending on the MODE. When passed as first option,
61 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
62 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
63 #
64 # When reporting a bug, please describe a test case to reproduce it and
65 # include the following information:
66 #
67 # host-triplet: $host
68 # shell: $SHELL
69 # compiler: $LTCC
70 # compiler flags: $LTCFLAGS
71 # linker: $LD (gnu? $with_gnu_ld)
72 # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11
73 # automake: $automake_version
74 # autoconf: $autoconf_version
75 #
76 # Report bugs to <bug-libtool@gnu.org>.
77 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
78 # General help using GNU software: <http://www.gnu.org/gethelp/>.
3079
3180 PROGRAM=libtool
3281 PACKAGE=libtool
33 VERSION=2.4.6
34 package_revision=2.4.6
35
36
37 ## ------ ##
38 ## Usage. ##
39 ## ------ ##
40
41 # Run './libtool --help' for help with using this script from the
42 # command line.
43
44
45 ## ------------------------------- ##
46 ## User overridable command paths. ##
47 ## ------------------------------- ##
48
49 # After configure completes, it has a better idea of some of the
50 # shell tools we need than the defaults used by the functions shared
51 # with bootstrap, so set those here where they can still be over-
52 # ridden by the user, but otherwise take precedence.
53
54 : ${AUTOCONF="autoconf"}
55 : ${AUTOMAKE="automake"}
56
57
58 ## -------------------------- ##
59 ## Source external libraries. ##
60 ## -------------------------- ##
61
62 # Much of our low-level functionality needs to be sourced from external
63 # libraries, which are installed to $pkgauxdir.
64
65 # Set a version string for this script.
66 scriptversion=2015-01-20.17; # UTC
67
68 # General shell script boiler plate, and helper functions.
69 # Written by Gary V. Vaughan, 2004
70
71 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
72 # This is free software; see the source for copying conditions. There is NO
73 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
74
75 # This program is free software; you can redistribute it and/or modify
76 # it under the terms of the GNU General Public License as published by
77 # the Free Software Foundation; either version 3 of the License, or
78 # (at your option) any later version.
79
80 # As a special exception to the GNU General Public License, if you distribute
81 # this file as part of a program or library that is built using GNU Libtool,
82 # you may include this file under the same distribution terms that you use
83 # for the rest of that program.
84
85 # This program is distributed in the hope that it will be useful,
86 # but WITHOUT ANY WARRANTY; without even the implied warranty of
87 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
88 # General Public License for more details.
89
90 # You should have received a copy of the GNU General Public License
91 # along with this program. If not, see <http://www.gnu.org/licenses/>.
92
93 # Please report bugs or propose patches to gary@gnu.org.
94
95
96 ## ------ ##
97 ## Usage. ##
98 ## ------ ##
99
100 # Evaluate this file near the top of your script to gain access to
101 # the functions and variables defined here:
102 #
103 # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
104 #
105 # If you need to override any of the default environment variable
106 # settings, do that before evaluating this file.
107
108
109 ## -------------------- ##
110 ## Shell normalisation. ##
111 ## -------------------- ##
112
113 # Some shells need a little help to be as Bourne compatible as possible.
114 # Before doing anything else, make sure all that help has been provided!
115
116 DUALCASE=1; export DUALCASE # for MKS sh
117 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
82 VERSION="2.4.2 Debian-2.4.2-1.11"
83 TIMESTAMP=""
84 package_revision=1.3337
85
86 # Be Bourne compatible
87 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
11888 emulate sh
11989 NULLCMD=:
120 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
90 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
12191 # is contrary to our usage. Disable this feature.
12292 alias -g '${1+"$@"}'='"$@"'
12393 setopt NO_GLOB_SUBST
12494 else
125 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
95 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
12696 fi
127
128 # NLS nuisances: We save the old values in case they are required later.
129 _G_user_locale=
130 _G_safe_locale=
131 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
97 BIN_SH=xpg4; export BIN_SH # for Tru64
98 DUALCASE=1; export DUALCASE # for MKS sh
99
100 # A function that is used when there is no print builtin or printf.
101 func_fallback_echo ()
102 {
103 eval 'cat <<_LTECHO_EOF
104 $1
105 _LTECHO_EOF'
106 }
107
108 # NLS nuisances: We save the old values to restore during execute mode.
109 lt_user_locale=
110 lt_safe_locale=
111 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
132112 do
133 eval "if test set = \"\${$_G_var+set}\"; then
134 save_$_G_var=\$$_G_var
135 $_G_var=C
136 export $_G_var
137 _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
138 _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
113 eval "if test \"\${$lt_var+set}\" = set; then
114 save_$lt_var=\$$lt_var
115 $lt_var=C
116 export $lt_var
117 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
118 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
139119 fi"
140120 done
141
142 # CDPATH.
143 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
144
145 # Make sure IFS has a sensible default
146 sp=' '
147 nl='
148 '
149 IFS="$sp $nl"
150
151 # There are apparently some retarded systems that use ';' as a PATH separator!
152 if test "${PATH_SEPARATOR+set}" != set; then
153 PATH_SEPARATOR=:
154 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
155 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
156 PATH_SEPARATOR=';'
157 }
158 fi
159
160
161
162 ## ------------------------- ##
163 ## Locate command utilities. ##
164 ## ------------------------- ##
165
166
167 # func_executable_p FILE
168 # ----------------------
169 # Check that FILE is an executable regular file.
170 func_executable_p ()
171 {
172 test -f "$1" && test -x "$1"
173 }
174
175
176 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
177 # --------------------------------------------
178 # Search for either a program that responds to --version with output
179 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
180 # trying all the directories in PATH with each of the elements of
181 # PROGS_LIST.
182 #
183 # CHECK_FUNC should accept the path to a candidate program, and
184 # set $func_check_prog_result if it truncates its output less than
185 # $_G_path_prog_max characters.
186 func_path_progs ()
187 {
188 _G_progs_list=$1
189 _G_check_func=$2
190 _G_PATH=${3-"$PATH"}
191
192 _G_path_prog_max=0
193 _G_path_prog_found=false
194 _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
195 for _G_dir in $_G_PATH; do
196 IFS=$_G_save_IFS
197 test -z "$_G_dir" && _G_dir=.
198 for _G_prog_name in $_G_progs_list; do
199 for _exeext in '' .EXE; do
200 _G_path_prog=$_G_dir/$_G_prog_name$_exeext
201 func_executable_p "$_G_path_prog" || continue
202 case `"$_G_path_prog" --version 2>&1` in
203 *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
204 *) $_G_check_func $_G_path_prog
205 func_path_progs_result=$func_check_prog_result
206 ;;
207 esac
208 $_G_path_prog_found && break 3
209 done
210 done
211 done
212 IFS=$_G_save_IFS
213 test -z "$func_path_progs_result" && {
214 echo "no acceptable sed could be found in \$PATH" >&2
215 exit 1
216 }
217 }
218
219
220 # We want to be able to use the functions in this file before configure
221 # has figured out where the best binaries are kept, which means we have
222 # to search for them ourselves - except when the results are already set
223 # where we skip the searches.
224
225 # Unless the user overrides by setting SED, search the path for either GNU
226 # sed, or the sed that truncates its output the least.
227 test -z "$SED" && {
228 _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
229 for _G_i in 1 2 3 4 5 6 7; do
230 _G_sed_script=$_G_sed_script$nl$_G_sed_script
231 done
232 echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
233 _G_sed_script=
234
235 func_check_prog_sed ()
236 {
237 _G_path_prog=$1
238
239 _G_count=0
240 printf 0123456789 >conftest.in
241 while :
242 do
243 cat conftest.in conftest.in >conftest.tmp
244 mv conftest.tmp conftest.in
245 cp conftest.in conftest.nl
246 echo '' >> conftest.nl
247 "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
248 diff conftest.out conftest.nl >/dev/null 2>&1 || break
249 _G_count=`expr $_G_count + 1`
250 if test "$_G_count" -gt "$_G_path_prog_max"; then
251 # Best one so far, save it but keep looking for a better one
252 func_check_prog_result=$_G_path_prog
253 _G_path_prog_max=$_G_count
254 fi
255 # 10*(2^10) chars as input seems more than enough
256 test 10 -lt "$_G_count" && break
257 done
258 rm -f conftest.in conftest.tmp conftest.nl conftest.out
259 }
260
261 func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
262 rm -f conftest.sed
263 SED=$func_path_progs_result
264 }
265
266
267 # Unless the user overrides by setting GREP, search the path for either GNU
268 # grep, or the grep that truncates its output the least.
269 test -z "$GREP" && {
270 func_check_prog_grep ()
271 {
272 _G_path_prog=$1
273
274 _G_count=0
275 _G_path_prog_max=0
276 printf 0123456789 >conftest.in
277 while :
278 do
279 cat conftest.in conftest.in >conftest.tmp
280 mv conftest.tmp conftest.in
281 cp conftest.in conftest.nl
282 echo 'GREP' >> conftest.nl
283 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
284 diff conftest.out conftest.nl >/dev/null 2>&1 || break
285 _G_count=`expr $_G_count + 1`
286 if test "$_G_count" -gt "$_G_path_prog_max"; then
287 # Best one so far, save it but keep looking for a better one
288 func_check_prog_result=$_G_path_prog
289 _G_path_prog_max=$_G_count
290 fi
291 # 10*(2^10) chars as input seems more than enough
292 test 10 -lt "$_G_count" && break
293 done
294 rm -f conftest.in conftest.tmp conftest.nl conftest.out
295 }
296
297 func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
298 GREP=$func_path_progs_result
299 }
300
301
302 ## ------------------------------- ##
303 ## User overridable command paths. ##
304 ## ------------------------------- ##
305
306 # All uppercase variable names are used for environment variables. These
307 # variables can be overridden by the user before calling a script that
308 # uses them if a suitable command of that name is not already available
309 # in the command search PATH.
121 LC_ALL=C
122 LANGUAGE=C
123 export LANGUAGE LC_ALL
124
125 $lt_unset CDPATH
126
127
128 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
129 # is ksh but when the shell is invoked as "sh" and the current value of
130 # the _XPG environment variable is not equal to 1 (one), the special
131 # positional parameter $0, within a function call, is the name of the
132 # function.
133 progpath="$0"
134
135
310136
311137 : ${CP="cp -f"}
312 : ${ECHO="printf %s\n"}
313 : ${EGREP="$GREP -E"}
314 : ${FGREP="$GREP -F"}
315 : ${LN_S="ln -s"}
138 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
316139 : ${MAKE="make"}
317140 : ${MKDIR="mkdir"}
318141 : ${MV="mv -f"}
319142 : ${RM="rm -f"}
320143 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
321
322
323 ## -------------------- ##
324 ## Useful sed snippets. ##
325 ## -------------------- ##
326
327 sed_dirname='s|/[^/]*$||'
328 sed_basename='s|^.*/||'
329
330 # Sed substitution that helps us do robust quoting. It backslashifies
331 # metacharacters that are still active within double-quoted strings.
332 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
333
334 # Same as above, but do not quote variable references.
335 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
336
337 # Sed substitution that turns a string into a regex matching for the
338 # string literally.
339 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
340
341 # Sed substitution that converts a w32 file name or path
342 # that contains forward slashes, into one that contains
343 # (escaped) backslashes. A very naive implementation.
344 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
345
346 # Re-'\' parameter expansions in output of sed_double_quote_subst that
347 # were '\'-ed in input to the same. If an odd number of '\' preceded a
348 # '$' in input to sed_double_quote_subst, that '$' was protected from
349 # expansion. Since each input '\' is now two '\'s, look for any number
350 # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
351 _G_bs='\\'
352 _G_bs2='\\\\'
353 _G_bs4='\\\\\\\\'
354 _G_dollar='\$'
355 sed_double_backslash="\
356 s/$_G_bs4/&\\
357 /g
358 s/^$_G_bs2$_G_dollar/$_G_bs&/
359 s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
360 s/\n//g"
361
362
363 ## ----------------- ##
364 ## Global variables. ##
365 ## ----------------- ##
366
367 # Except for the global variables explicitly listed below, the following
368 # functions in the '^func_' namespace, and the '^require_' namespace
369 # variables initialised in the 'Resource management' section, sourcing
370 # this file will not pollute your global namespace with anything
371 # else. There's no portable way to scope variables in Bourne shell
372 # though, so actually running these functions will sometimes place
373 # results into a variable named after the function, and often use
374 # temporary variables in the '^_G_' namespace. If you are careful to
375 # avoid using those namespaces casually in your sourcing script, things
376 # should continue to work as you expect. And, of course, you can freely
377 # overwrite any of the functions or variables defined here before
378 # calling anything to customize them.
379
144 : ${Xsed="$SED -e 1s/^X//"}
145
146 # Global variables:
380147 EXIT_SUCCESS=0
381148 EXIT_FAILURE=1
382149 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
383150 EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
384151
385 # Allow overriding, eg assuming that you follow the convention of
386 # putting '$debug_cmd' at the start of all your functions, you can get
387 # bash to show function call trace with:
388 #
389 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
390 debug_cmd=${debug_cmd-":"}
391 exit_cmd=:
392
393 # By convention, finish your script with:
394 #
395 # exit $exit_status
396 #
397 # so that you can set exit_status to non-zero if you want to indicate
398 # something went wrong during execution without actually bailing out at
399 # the point of failure.
400152 exit_status=$EXIT_SUCCESS
401153
402 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
403 # is ksh but when the shell is invoked as "sh" and the current value of
404 # the _XPG environment variable is not equal to 1 (one), the special
405 # positional parameter $0, within a function call, is the name of the
406 # function.
407 progpath=$0
408
409 # The name of this program.
410 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
411
412 # Make sure we have an absolute progpath for reexecution:
413 case $progpath in
414 [\\/]*|[A-Za-z]:\\*) ;;
415 *[\\/]*)
416 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
417 progdir=`cd "$progdir" && pwd`
418 progpath=$progdir/$progname
419 ;;
420 *)
421 _G_IFS=$IFS
422 IFS=${PATH_SEPARATOR-:}
423 for progdir in $PATH; do
424 IFS=$_G_IFS
425 test -x "$progdir/$progname" && break
426 done
427 IFS=$_G_IFS
428 test -n "$progdir" || progdir=`pwd`
429 progpath=$progdir/$progname
430 ;;
431 esac
432
433
434 ## ----------------- ##
435 ## Standard options. ##
436 ## ----------------- ##
437
438 # The following options affect the operation of the functions defined
439 # below, and should be set appropriately depending on run-time para-
440 # meters passed on the command line.
441
442 opt_dry_run=false
443 opt_quiet=false
444 opt_verbose=false
445
446 # Categories 'all' and 'none' are always available. Append any others
447 # you will pass as the first argument to func_warning from your own
448 # code.
449 warning_categories=
450
451 # By default, display warnings according to 'opt_warning_types'. Set
452 # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
453 # treat the next displayed warning as a fatal error.
454 warning_func=func_warn_and_continue
455
456 # Set to 'all' to display all warnings, 'none' to suppress all
457 # warnings, or a space delimited list of some subset of
458 # 'warning_categories' to display only the listed warnings.
459 opt_warning_types=all
460
461
462 ## -------------------- ##
463 ## Resource management. ##
464 ## -------------------- ##
465
466 # This section contains definitions for functions that each ensure a
467 # particular resource (a file, or a non-empty configuration variable for
468 # example) is available, and if appropriate to extract default values
469 # from pertinent package files. Call them using their associated
470 # 'require_*' variable to ensure that they are executed, at most, once.
471 #
472 # It's entirely deliberate that calling these functions can set
473 # variables that don't obey the namespace limitations obeyed by the rest
474 # of this file, in order that that they be as useful as possible to
475 # callers.
476
477
478 # require_term_colors
479 # -------------------
480 # Allow display of bold text on terminals that support it.
481 require_term_colors=func_require_term_colors
482 func_require_term_colors ()
483 {
484 $debug_cmd
485
486 test -t 1 && {
487 # COLORTERM and USE_ANSI_COLORS environment variables take
488 # precedence, because most terminfo databases neglect to describe
489 # whether color sequences are supported.
490 test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
491
492 if test 1 = "$USE_ANSI_COLORS"; then
493 # Standard ANSI escape sequences
494 tc_reset=''
495 tc_bold=''; tc_standout=''
496 tc_red=''; tc_green=''
497 tc_blue=''; tc_cyan=''
498 else
499 # Otherwise trust the terminfo database after all.
500 test -n "`tput sgr0 2>/dev/null`" && {
501 tc_reset=`tput sgr0`
502 test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
503 tc_standout=$tc_bold
504 test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
505 test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
506 test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
507 test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
508 test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
509 }
510 fi
511 }
512
513 require_term_colors=:
514 }
515
516
517 ## ----------------- ##
518 ## Function library. ##
519 ## ----------------- ##
520
521 # This section contains a variety of useful functions to call in your
522 # scripts. Take note of the portable wrappers for features provided by
523 # some modern shells, which will fall back to slower equivalents on
524 # less featureful shells.
525
526
527 # func_append VAR VALUE
528 # ---------------------
529 # Append VALUE onto the existing contents of VAR.
530
531 # We should try to minimise forks, especially on Windows where they are
532 # unreasonably slow, so skip the feature probes when bash or zsh are
533 # being used:
534 if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
535 : ${_G_HAVE_ARITH_OP="yes"}
536 : ${_G_HAVE_XSI_OPS="yes"}
537 # The += operator was introduced in bash 3.1
538 case $BASH_VERSION in
539 [12].* | 3.0 | 3.0*) ;;
540 *)
541 : ${_G_HAVE_PLUSEQ_OP="yes"}
542 ;;
543 esac
544 fi
545
546 # _G_HAVE_PLUSEQ_OP
547 # Can be empty, in which case the shell is probed, "yes" if += is
548 # useable or anything else if it does not work.
549 test -z "$_G_HAVE_PLUSEQ_OP" \
550 && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
551 && _G_HAVE_PLUSEQ_OP=yes
552
553 if test yes = "$_G_HAVE_PLUSEQ_OP"
554 then
555 # This is an XSI compatible shell, allowing a faster implementation...
556 eval 'func_append ()
557 {
558 $debug_cmd
559
560 eval "$1+=\$2"
561 }'
562 else
563 # ...otherwise fall back to using expr, which is often a shell builtin.
564 func_append ()
565 {
566 $debug_cmd
567
568 eval "$1=\$$1\$2"
569 }
570 fi
571
572
573 # func_append_quoted VAR VALUE
574 # ----------------------------
575 # Quote VALUE and append to the end of shell variable VAR, separated
576 # by a space.
577 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
578 eval 'func_append_quoted ()
579 {
580 $debug_cmd
581
582 func_quote_for_eval "$2"
583 eval "$1+=\\ \$func_quote_for_eval_result"
584 }'
585 else
586 func_append_quoted ()
587 {
588 $debug_cmd
589
590 func_quote_for_eval "$2"
591 eval "$1=\$$1\\ \$func_quote_for_eval_result"
592 }
593 fi
594
595
596 # func_append_uniq VAR VALUE
597 # --------------------------
598 # Append unique VALUE onto the existing contents of VAR, assuming
599 # entries are delimited by the first character of VALUE. For example:
600 #
601 # func_append_uniq options " --another-option option-argument"
602 #
603 # will only append to $options if " --another-option option-argument "
604 # is not already present somewhere in $options already (note spaces at
605 # each end implied by leading space in second argument).
606 func_append_uniq ()
607 {
608 $debug_cmd
609
610 eval _G_current_value='`$ECHO $'$1'`'
611 _G_delim=`expr "$2" : '\(.\)'`
612
613 case $_G_delim$_G_current_value$_G_delim in
614 *"$2$_G_delim"*) ;;
615 *) func_append "$@" ;;
616 esac
617 }
618
619
620 # func_arith TERM...
621 # ------------------
622 # Set func_arith_result to the result of evaluating TERMs.
623 test -z "$_G_HAVE_ARITH_OP" \
624 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
625 && _G_HAVE_ARITH_OP=yes
626
627 if test yes = "$_G_HAVE_ARITH_OP"; then
628 eval 'func_arith ()
629 {
630 $debug_cmd
631
632 func_arith_result=$(( $* ))
633 }'
634 else
635 func_arith ()
636 {
637 $debug_cmd
638
639 func_arith_result=`expr "$@"`
640 }
641 fi
642
643
644 # func_basename FILE
645 # ------------------
646 # Set func_basename_result to FILE with everything up to and including
647 # the last / stripped.
648 if test yes = "$_G_HAVE_XSI_OPS"; then
649 # If this shell supports suffix pattern removal, then use it to avoid
650 # forking. Hide the definitions single quotes in case the shell chokes
651 # on unsupported syntax...
652 _b='func_basename_result=${1##*/}'
653 _d='case $1 in
654 */*) func_dirname_result=${1%/*}$2 ;;
655 * ) func_dirname_result=$3 ;;
656 esac'
657
658 else
659 # ...otherwise fall back to using sed.
660 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
661 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
662 if test "X$func_dirname_result" = "X$1"; then
663 func_dirname_result=$3
664 else
665 func_append func_dirname_result "$2"
666 fi'
667 fi
668
669 eval 'func_basename ()
670 {
671 $debug_cmd
672
673 '"$_b"'
674 }'
675
676
677 # func_dirname FILE APPEND NONDIR_REPLACEMENT
678 # -------------------------------------------
154 # Make sure IFS has a sensible default
155 lt_nl='
156 '
157 IFS=" $lt_nl"
158
159 dirname="s,/[^/]*$,,"
160 basename="s,^.*/,,"
161
162 # func_dirname file append nondir_replacement
679163 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
680164 # otherwise set result to NONDIR_REPLACEMENT.
681 eval 'func_dirname ()
682 {
683 $debug_cmd
684
685 '"$_d"'
686 }'
687
688
689 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
690 # --------------------------------------------------------
691 # Perform func_basename and func_dirname in a single function
165 func_dirname ()
166 {
167 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
168 if test "X$func_dirname_result" = "X${1}"; then
169 func_dirname_result="${3}"
170 else
171 func_dirname_result="$func_dirname_result${2}"
172 fi
173 } # func_dirname may be replaced by extended shell implementation
174
175
176 # func_basename file
177 func_basename ()
178 {
179 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
180 } # func_basename may be replaced by extended shell implementation
181
182
183 # func_dirname_and_basename file append nondir_replacement
184 # perform func_basename and func_dirname in a single function
692185 # call:
693186 # dirname: Compute the dirname of FILE. If nonempty,
694187 # add APPEND to the result, otherwise set result
696189 # value returned in "$func_dirname_result"
697190 # basename: Compute filename of FILE.
698191 # value retuned in "$func_basename_result"
699 # For efficiency, we do not delegate to the functions above but instead
700 # duplicate the functionality here.
701 eval 'func_dirname_and_basename ()
702 {
703 $debug_cmd
704
705 '"$_b"'
706 '"$_d"'
707 }'
708
709
710 # func_echo ARG...
711 # ----------------
712 # Echo program name prefixed message.
713 func_echo ()
714 {
715 $debug_cmd
716
717 _G_message=$*
718
719 func_echo_IFS=$IFS
720 IFS=$nl
721 for _G_line in $_G_message; do
722 IFS=$func_echo_IFS
723 $ECHO "$progname: $_G_line"
724 done
725 IFS=$func_echo_IFS
726 }
727
728
729 # func_echo_all ARG...
730 # --------------------
731 # Invoke $ECHO with all args, space-separated.
732 func_echo_all ()
733 {
734 $ECHO "$*"
735 }
736
737
738 # func_echo_infix_1 INFIX ARG...
739 # ------------------------------
740 # Echo program name, followed by INFIX on the first line, with any
741 # additional lines not showing INFIX.
742 func_echo_infix_1 ()
743 {
744 $debug_cmd
745
746 $require_term_colors
747
748 _G_infix=$1; shift
749 _G_indent=$_G_infix
750 _G_prefix="$progname: $_G_infix: "
751 _G_message=$*
752
753 # Strip color escape sequences before counting printable length
754 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
755 do
756 test -n "$_G_tc" && {
757 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
758 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
759 }
760 done
761 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
762
763 func_echo_infix_1_IFS=$IFS
764 IFS=$nl
765 for _G_line in $_G_message; do
766 IFS=$func_echo_infix_1_IFS
767 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
768 _G_prefix=$_G_indent
769 done
770 IFS=$func_echo_infix_1_IFS
771 }
772
773
774 # func_error ARG...
775 # -----------------
776 # Echo program name prefixed message to standard error.
777 func_error ()
778 {
779 $debug_cmd
780
781 $require_term_colors
782
783 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
784 }
785
786
787 # func_fatal_error ARG...
788 # -----------------------
789 # Echo program name prefixed message to standard error, and exit.
790 func_fatal_error ()
791 {
792 $debug_cmd
793
794 func_error "$*"
795 exit $EXIT_FAILURE
796 }
797
798
799 # func_grep EXPRESSION FILENAME
800 # -----------------------------
801 # Check whether EXPRESSION matches any line of FILENAME, without output.
802 func_grep ()
803 {
804 $debug_cmd
805
806 $GREP "$1" "$2" >/dev/null 2>&1
807 }
808
809
810 # func_len STRING
811 # ---------------
812 # Set func_len_result to the length of STRING. STRING may not
813 # start with a hyphen.
814 test -z "$_G_HAVE_XSI_OPS" \
815 && (eval 'x=a/b/c;
816 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
817 && _G_HAVE_XSI_OPS=yes
818
819 if test yes = "$_G_HAVE_XSI_OPS"; then
820 eval 'func_len ()
821 {
822 $debug_cmd
823
824 func_len_result=${#1}
825 }'
826 else
827 func_len ()
828 {
829 $debug_cmd
830
831 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
832 }
833 fi
834
835
836 # func_mkdir_p DIRECTORY-PATH
837 # ---------------------------
838 # Make sure the entire path to DIRECTORY-PATH is available.
839 func_mkdir_p ()
840 {
841 $debug_cmd
842
843 _G_directory_path=$1
844 _G_dir_list=
845
846 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
847
848 # Protect directory names starting with '-'
849 case $_G_directory_path in
850 -*) _G_directory_path=./$_G_directory_path ;;
851 esac
852
853 # While some portion of DIR does not yet exist...
854 while test ! -d "$_G_directory_path"; do
855 # ...make a list in topmost first order. Use a colon delimited
856 # list incase some portion of path contains whitespace.
857 _G_dir_list=$_G_directory_path:$_G_dir_list
858
859 # If the last portion added has no slash in it, the list is done
860 case $_G_directory_path in */*) ;; *) break ;; esac
861
862 # ...otherwise throw away the child directory and loop
863 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
864 done
865 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
866
867 func_mkdir_p_IFS=$IFS; IFS=:
868 for _G_dir in $_G_dir_list; do
869 IFS=$func_mkdir_p_IFS
870 # mkdir can fail with a 'File exist' error if two processes
871 # try to create one of the directories concurrently. Don't
872 # stop in that case!
873 $MKDIR "$_G_dir" 2>/dev/null || :
874 done
875 IFS=$func_mkdir_p_IFS
876
877 # Bail out if we (or some other process) failed to create a directory.
878 test -d "$_G_directory_path" || \
879 func_fatal_error "Failed to create '$1'"
192 # Implementation must be kept synchronized with func_dirname
193 # and func_basename. For efficiency, we do not delegate to
194 # those functions but instead duplicate the functionality here.
195 func_dirname_and_basename ()
196 {
197 # Extract subdirectory from the argument.
198 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
199 if test "X$func_dirname_result" = "X${1}"; then
200 func_dirname_result="${3}"
201 else
202 func_dirname_result="$func_dirname_result${2}"
880203 fi
881 }
882
883
884 # func_mktempdir [BASENAME]
885 # -------------------------
886 # Make a temporary directory that won't clash with other running
887 # libtool processes, and avoids race conditions if possible. If
888 # given, BASENAME is the basename for that directory.
889 func_mktempdir ()
890 {
891 $debug_cmd
892
893 _G_template=${TMPDIR-/tmp}/${1-$progname}
894
895 if test : = "$opt_dry_run"; then
896 # Return a directory name, but don't create it in dry-run mode
897 _G_tmpdir=$_G_template-$$
898 else
899
900 # If mktemp works, use that first and foremost
901 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
902
903 if test ! -d "$_G_tmpdir"; then
904 # Failing that, at least try and use $RANDOM to avoid a race
905 _G_tmpdir=$_G_template-${RANDOM-0}$$
906
907 func_mktempdir_umask=`umask`
908 umask 0077
909 $MKDIR "$_G_tmpdir"
910 umask $func_mktempdir_umask
911 fi
912
913 # If we're not in dry-run mode, bomb out on failure
914 test -d "$_G_tmpdir" || \
915 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
916 fi
917
918 $ECHO "$_G_tmpdir"
919 }
920
204 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
205 } # func_dirname_and_basename may be replaced by extended shell implementation
206
207
208 # func_stripname prefix suffix name
209 # strip PREFIX and SUFFIX off of NAME.
210 # PREFIX and SUFFIX must not contain globbing or regex special
211 # characters, hashes, percent signs, but SUFFIX may contain a leading
212 # dot (in which case that matches only a dot).
213 # func_strip_suffix prefix name
214 func_stripname ()
215 {
216 case ${2} in
217 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
218 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
219 esac
220 } # func_stripname may be replaced by extended shell implementation
221
222
223 # These SED scripts presuppose an absolute path with a trailing slash.
224 pathcar='s,^/\([^/]*\).*$,\1,'
225 pathcdr='s,^/[^/]*,,'
226 removedotparts=':dotsl
227 s@/\./@/@g
228 t dotsl
229 s,/\.$,/,'
230 collapseslashes='s@/\{1,\}@/@g'
231 finalslash='s,/*$,/,'
921232
922233 # func_normal_abspath PATH
923 # ------------------------
924234 # Remove doubled-up and trailing slashes, "." path components,
925235 # and cancel out any ".." path components in PATH after making
926236 # it an absolute path.
237 # value returned in "$func_normal_abspath_result"
927238 func_normal_abspath ()
928239 {
929 $debug_cmd
930
931 # These SED scripts presuppose an absolute path with a trailing slash.
932 _G_pathcar='s|^/\([^/]*\).*$|\1|'
933 _G_pathcdr='s|^/[^/]*||'
934 _G_removedotparts=':dotsl
935 s|/\./|/|g
936 t dotsl
937 s|/\.$|/|'
938 _G_collapseslashes='s|/\{1,\}|/|g'
939 _G_finalslash='s|/*$|/|'
940
941 # Start from root dir and reassemble the path.
942 func_normal_abspath_result=
943 func_normal_abspath_tpath=$1
944 func_normal_abspath_altnamespace=
945 case $func_normal_abspath_tpath in
240 # Start from root dir and reassemble the path.
241 func_normal_abspath_result=
242 func_normal_abspath_tpath=$1
243 func_normal_abspath_altnamespace=
244 case $func_normal_abspath_tpath in
245 "")
246 # Empty path, that just means $cwd.
247 func_stripname '' '/' "`pwd`"
248 func_normal_abspath_result=$func_stripname_result
249 return
250 ;;
251 # The next three entries are used to spot a run of precisely
252 # two leading slashes without using negated character classes;
253 # we take advantage of case's first-match behaviour.
254 ///*)
255 # Unusual form of absolute path, do nothing.
256 ;;
257 //*)
258 # Not necessarily an ordinary path; POSIX reserves leading '//'
259 # and for example Cygwin uses it to access remote file shares
260 # over CIFS/SMB, so we conserve a leading double slash if found.
261 func_normal_abspath_altnamespace=/
262 ;;
263 /*)
264 # Absolute path, do nothing.
265 ;;
266 *)
267 # Relative path, prepend $cwd.
268 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
269 ;;
270 esac
271 # Cancel out all the simple stuff to save iterations. We also want
272 # the path to end with a slash for ease of parsing, so make sure
273 # there is one (and only one) here.
274 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
275 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
276 while :; do
277 # Processed it all yet?
278 if test "$func_normal_abspath_tpath" = / ; then
279 # If we ascended to the root using ".." the result may be empty now.
280 if test -z "$func_normal_abspath_result" ; then
281 func_normal_abspath_result=/
282 fi
283 break
284 fi
285 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
286 -e "$pathcar"`
287 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
288 -e "$pathcdr"`
289 # Figure out what to do with it
290 case $func_normal_abspath_tcomponent in
946291 "")
947 # Empty path, that just means $cwd.
948 func_stripname '' '/' "`pwd`"
949 func_normal_abspath_result=$func_stripname_result
950 return
292 # Trailing empty path component, ignore it.
293 ;;
294 ..)
295 # Parent dir; strip last assembled component from result.
296 func_dirname "$func_normal_abspath_result"
297 func_normal_abspath_result=$func_dirname_result
298 ;;
299 *)
300 # Actual path component, append it.
301 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
302 ;;
303 esac
304 done
305 # Restore leading double-slash if one was found on entry.
306 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
307 }
308
309 # func_relative_path SRCDIR DSTDIR
310 # generates a relative path from SRCDIR to DSTDIR, with a trailing
311 # slash if non-empty, suitable for immediately appending a filename
312 # without needing to append a separator.
313 # value returned in "$func_relative_path_result"
314 func_relative_path ()
315 {
316 func_relative_path_result=
317 func_normal_abspath "$1"
318 func_relative_path_tlibdir=$func_normal_abspath_result
319 func_normal_abspath "$2"
320 func_relative_path_tbindir=$func_normal_abspath_result
321
322 # Ascend the tree starting from libdir
323 while :; do
324 # check if we have found a prefix of bindir
325 case $func_relative_path_tbindir in
326 $func_relative_path_tlibdir)
327 # found an exact match
328 func_relative_path_tcancelled=
329 break
951330 ;;
952 # The next three entries are used to spot a run of precisely
953 # two leading slashes without using negated character classes;
954 # we take advantage of case's first-match behaviour.
955 ///*)
956 # Unusual form of absolute path, do nothing.
957 ;;
958 //*)
959 # Not necessarily an ordinary path; POSIX reserves leading '//'
960 # and for example Cygwin uses it to access remote file shares
961 # over CIFS/SMB, so we conserve a leading double slash if found.
962 func_normal_abspath_altnamespace=/
963 ;;
964 /*)
965 # Absolute path, do nothing.
331 $func_relative_path_tlibdir*)
332 # found a matching prefix
333 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
334 func_relative_path_tcancelled=$func_stripname_result
335 if test -z "$func_relative_path_result"; then
336 func_relative_path_result=.
337 fi
338 break
966339 ;;
967340 *)
968 # Relative path, prepend $cwd.
969 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
341 func_dirname $func_relative_path_tlibdir
342 func_relative_path_tlibdir=${func_dirname_result}
343 if test "x$func_relative_path_tlibdir" = x ; then
344 # Have to descend all the way to the root!
345 func_relative_path_result=../$func_relative_path_result
346 func_relative_path_tcancelled=$func_relative_path_tbindir
347 break
348 fi
349 func_relative_path_result=../$func_relative_path_result
970350 ;;
971351 esac
972
973 # Cancel out all the simple stuff to save iterations. We also want
974 # the path to end with a slash for ease of parsing, so make sure
975 # there is one (and only one) here.
976 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
977 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
978 while :; do
979 # Processed it all yet?
980 if test / = "$func_normal_abspath_tpath"; then
981 # If we ascended to the root using ".." the result may be empty now.
982 if test -z "$func_normal_abspath_result"; then
983 func_normal_abspath_result=/
984 fi
985 break
986 fi
987 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
988 -e "$_G_pathcar"`
989 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
990 -e "$_G_pathcdr"`
991 # Figure out what to do with it
992 case $func_normal_abspath_tcomponent in
993 "")
994 # Trailing empty path component, ignore it.
995 ;;
996 ..)
997 # Parent dir; strip last assembled component from result.
998 func_dirname "$func_normal_abspath_result"
999 func_normal_abspath_result=$func_dirname_result
1000 ;;
1001 *)
1002 # Actual path component, append it.
1003 func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
1004 ;;
1005 esac
1006 done
1007 # Restore leading double-slash if one was found on entry.
1008 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
1009 }
1010
1011
1012 # func_notquiet ARG...
1013 # --------------------
1014 # Echo program name prefixed message only when not in quiet mode.
1015 func_notquiet ()
1016 {
1017 $debug_cmd
1018
1019 $opt_quiet || func_echo ${1+"$@"}
352 done
353
354 # Now calculate path; take care to avoid doubling-up slashes.
355 func_stripname '' '/' "$func_relative_path_result"
356 func_relative_path_result=$func_stripname_result
357 func_stripname '/' '/' "$func_relative_path_tcancelled"
358 if test "x$func_stripname_result" != x ; then
359 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
360 fi
361
362 # Normalisation. If bindir is libdir, return empty string,
363 # else relative path ending with a slash; either way, target
364 # file name can be directly appended.
365 if test ! -z "$func_relative_path_result"; then
366 func_stripname './' '' "$func_relative_path_result/"
367 func_relative_path_result=$func_stripname_result
368 fi
369 }
370
371 # The name of this program:
372 func_dirname_and_basename "$progpath"
373 progname=$func_basename_result
374
375 # Make sure we have an absolute path for reexecution:
376 case $progpath in
377 [\\/]*|[A-Za-z]:\\*) ;;
378 *[\\/]*)
379 progdir=$func_dirname_result
380 progdir=`cd "$progdir" && pwd`
381 progpath="$progdir/$progname"
382 ;;
383 *)
384 save_IFS="$IFS"
385 IFS=${PATH_SEPARATOR-:}
386 for progdir in $PATH; do
387 IFS="$save_IFS"
388 test -x "$progdir/$progname" && break
389 done
390 IFS="$save_IFS"
391 test -n "$progdir" || progdir=`pwd`
392 progpath="$progdir/$progname"
393 ;;
394 esac
395
396 # Sed substitution that helps us do robust quoting. It backslashifies
397 # metacharacters that are still active within double-quoted strings.
398 Xsed="${SED}"' -e 1s/^X//'
399 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
400
401 # Same as above, but do not quote variable references.
402 double_quote_subst='s/\(["`\\]\)/\\\1/g'
403
404 # Sed substitution that turns a string into a regex matching for the
405 # string literally.
406 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
407
408 # Sed substitution that converts a w32 file name or path
409 # which contains forward slashes, into one that contains
410 # (escaped) backslashes. A very naive implementation.
411 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
412
413 # Re-`\' parameter expansions in output of double_quote_subst that were
414 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
415 # in input to double_quote_subst, that '$' was protected from expansion.
416 # Since each input `\' is now two `\'s, look for any number of runs of
417 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
418 bs='\\'
419 bs2='\\\\'
420 bs4='\\\\\\\\'
421 dollar='\$'
422 sed_double_backslash="\
423 s/$bs4/&\\
424 /g
425 s/^$bs2$dollar/$bs&/
426 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
427 s/\n//g"
428
429 # Standard options:
430 opt_dry_run=false
431 opt_help=false
432 opt_quiet=false
433 opt_verbose=false
434 opt_warning=:
435
436 # func_echo arg...
437 # Echo program name prefixed message, along with the current mode
438 # name if it has been set yet.
439 func_echo ()
440 {
441 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
442 }
443
444 # func_verbose arg...
445 # Echo program name prefixed message in verbose mode only.
446 func_verbose ()
447 {
448 $opt_verbose && func_echo ${1+"$@"}
1020449
1021450 # A bug in bash halts the script if the last line of a function
1022451 # fails when set -e is in force, so we need another command to
1024453 :
1025454 }
1026455
1027
1028 # func_relative_path SRCDIR DSTDIR
1029 # --------------------------------
1030 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
1031 func_relative_path ()
1032 {
1033 $debug_cmd
1034
1035 func_relative_path_result=
1036 func_normal_abspath "$1"
1037 func_relative_path_tlibdir=$func_normal_abspath_result
1038 func_normal_abspath "$2"
1039 func_relative_path_tbindir=$func_normal_abspath_result
1040
1041 # Ascend the tree starting from libdir
1042 while :; do
1043 # check if we have found a prefix of bindir
1044 case $func_relative_path_tbindir in
1045 $func_relative_path_tlibdir)
1046 # found an exact match
1047 func_relative_path_tcancelled=
1048 break
1049 ;;
1050 $func_relative_path_tlibdir*)
1051 # found a matching prefix
1052 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
1053 func_relative_path_tcancelled=$func_stripname_result
1054 if test -z "$func_relative_path_result"; then
1055 func_relative_path_result=.
1056 fi
1057 break
1058 ;;
1059 *)
1060 func_dirname $func_relative_path_tlibdir
1061 func_relative_path_tlibdir=$func_dirname_result
1062 if test -z "$func_relative_path_tlibdir"; then
1063 # Have to descend all the way to the root!
1064 func_relative_path_result=../$func_relative_path_result
1065 func_relative_path_tcancelled=$func_relative_path_tbindir
1066 break
1067 fi
1068 func_relative_path_result=../$func_relative_path_result
1069 ;;
456 # func_echo_all arg...
457 # Invoke $ECHO with all args, space-separated.
458 func_echo_all ()
459 {
460 $ECHO "$*"
461 }
462
463 # func_error arg...
464 # Echo program name prefixed message to standard error.
465 func_error ()
466 {
467 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
468 }
469
470 # func_warning arg...
471 # Echo program name prefixed warning message to standard error.
472 func_warning ()
473 {
474 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
475
476 # bash bug again:
477 :
478 }
479
480 # func_fatal_error arg...
481 # Echo program name prefixed message to standard error, and exit.
482 func_fatal_error ()
483 {
484 func_error ${1+"$@"}
485 exit $EXIT_FAILURE
486 }
487
488 # func_fatal_help arg...
489 # Echo program name prefixed message to standard error, followed by
490 # a help hint, and exit.
491 func_fatal_help ()
492 {
493 func_error ${1+"$@"}
494 func_fatal_error "$help"
495 }
496 help="Try \`$progname --help' for more information." ## default
497
498
499 # func_grep expression filename
500 # Check whether EXPRESSION matches any line of FILENAME, without output.
501 func_grep ()
502 {
503 $GREP "$1" "$2" >/dev/null 2>&1
504 }
505
506
507 # func_mkdir_p directory-path
508 # Make sure the entire path to DIRECTORY-PATH is available.
509 func_mkdir_p ()
510 {
511 my_directory_path="$1"
512 my_dir_list=
513
514 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
515
516 # Protect directory names starting with `-'
517 case $my_directory_path in
518 -*) my_directory_path="./$my_directory_path" ;;
1070519 esac
1071 done
1072
1073 # Now calculate path; take care to avoid doubling-up slashes.
1074 func_stripname '' '/' "$func_relative_path_result"
1075 func_relative_path_result=$func_stripname_result
1076 func_stripname '/' '/' "$func_relative_path_tcancelled"
1077 if test -n "$func_stripname_result"; then
1078 func_append func_relative_path_result "/$func_stripname_result"
520
521 # While some portion of DIR does not yet exist...
522 while test ! -d "$my_directory_path"; do
523 # ...make a list in topmost first order. Use a colon delimited
524 # list incase some portion of path contains whitespace.
525 my_dir_list="$my_directory_path:$my_dir_list"
526
527 # If the last portion added has no slash in it, the list is done
528 case $my_directory_path in */*) ;; *) break ;; esac
529
530 # ...otherwise throw away the child directory and loop
531 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
532 done
533 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
534
535 save_mkdir_p_IFS="$IFS"; IFS=':'
536 for my_dir in $my_dir_list; do
537 IFS="$save_mkdir_p_IFS"
538 # mkdir can fail with a `File exist' error if two processes
539 # try to create one of the directories concurrently. Don't
540 # stop in that case!
541 $MKDIR "$my_dir" 2>/dev/null || :
542 done
543 IFS="$save_mkdir_p_IFS"
544
545 # Bail out if we (or some other process) failed to create a directory.
546 test -d "$my_directory_path" || \
547 func_fatal_error "Failed to create \`$1'"
1079548 fi
1080
1081 # Normalisation. If bindir is libdir, return '.' else relative path.
1082 if test -n "$func_relative_path_result"; then
1083 func_stripname './' '' "$func_relative_path_result"
1084 func_relative_path_result=$func_stripname_result
549 }
550
551
552 # func_mktempdir [string]
553 # Make a temporary directory that won't clash with other running
554 # libtool processes, and avoids race conditions if possible. If
555 # given, STRING is the basename for that directory.
556 func_mktempdir ()
557 {
558 my_template="${TMPDIR-/tmp}/${1-$progname}"
559
560 if test "$opt_dry_run" = ":"; then
561 # Return a directory name, but don't create it in dry-run mode
562 my_tmpdir="${my_template}-$$"
563 else
564
565 # If mktemp works, use that first and foremost
566 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
567
568 if test ! -d "$my_tmpdir"; then
569 # Failing that, at least try and use $RANDOM to avoid a race
570 my_tmpdir="${my_template}-${RANDOM-0}$$"
571
572 save_mktempdir_umask=`umask`
573 umask 0077
574 $MKDIR "$my_tmpdir"
575 umask $save_mktempdir_umask
576 fi
577
578 # If we're not in dry-run mode, bomb out on failure
579 test -d "$my_tmpdir" || \
580 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1085581 fi
1086582
1087 test -n "$func_relative_path_result" || func_relative_path_result=.
1088
1089 :
1090 }
1091
1092
1093 # func_quote_for_eval ARG...
1094 # --------------------------
1095 # Aesthetically quote ARGs to be evaled later.
1096 # This function returns two values:
1097 # i) func_quote_for_eval_result
1098 # double-quoted, suitable for a subsequent eval
1099 # ii) func_quote_for_eval_unquoted_result
1100 # has all characters that are still active within double
1101 # quotes backslashified.
583 $ECHO "$my_tmpdir"
584 }
585
586
587 # func_quote_for_eval arg
588 # Aesthetically quote ARG to be evaled later.
589 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
590 # is double-quoted, suitable for a subsequent eval, whereas
591 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
592 # which are still active within double quotes backslashified.
1102593 func_quote_for_eval ()
1103594 {
1104 $debug_cmd
1105
1106 func_quote_for_eval_unquoted_result=
1107 func_quote_for_eval_result=
1108 while test 0 -lt $#; do
1109 case $1 in
1110 *[\\\`\"\$]*)
1111 _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
1112 *)
1113 _G_unquoted_arg=$1 ;;
1114 esac
1115 if test -n "$func_quote_for_eval_unquoted_result"; then
1116 func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
1117 else
1118 func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
1119 fi
1120
1121 case $_G_unquoted_arg in
1122 # Double-quote args containing shell metacharacters to delay
1123 # word splitting, command substitution and variable expansion
1124 # for a subsequent eval.
1125 # Many Bourne shells cannot handle close brackets correctly
1126 # in scan sets, so we specify it separately.
1127 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1128 _G_quoted_arg=\"$_G_unquoted_arg\"
1129 ;;
1130 *)
1131 _G_quoted_arg=$_G_unquoted_arg
1132 ;;
1133 esac
1134
1135 if test -n "$func_quote_for_eval_result"; then
1136 func_append func_quote_for_eval_result " $_G_quoted_arg"
1137 else
1138 func_append func_quote_for_eval_result "$_G_quoted_arg"
1139 fi
1140 shift
1141 done
1142 }
1143
1144
1145 # func_quote_for_expand ARG
1146 # -------------------------
595 case $1 in
596 *[\\\`\"\$]*)
597 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
598 *)
599 func_quote_for_eval_unquoted_result="$1" ;;
600 esac
601
602 case $func_quote_for_eval_unquoted_result in
603 # Double-quote args containing shell metacharacters to delay
604 # word splitting, command substitution and and variable
605 # expansion for a subsequent eval.
606 # Many Bourne shells cannot handle close brackets correctly
607 # in scan sets, so we specify it separately.
608 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
609 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
610 ;;
611 *)
612 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
613 esac
614 }
615
616
617 # func_quote_for_expand arg
1147618 # Aesthetically quote ARG to be evaled later; same as above,
1148619 # but do not quote variable references.
1149620 func_quote_for_expand ()
1150621 {
1151 $debug_cmd
1152
1153622 case $1 in
1154623 *[\\\`\"]*)
1155 _G_arg=`$ECHO "$1" | $SED \
1156 -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
624 my_arg=`$ECHO "$1" | $SED \
625 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1157626 *)
1158 _G_arg=$1 ;;
627 my_arg="$1" ;;
1159628 esac
1160629
1161 case $_G_arg in
630 case $my_arg in
1162631 # Double-quote args containing shell metacharacters to delay
1163632 # word splitting and command substitution for a subsequent eval.
1164633 # Many Bourne shells cannot handle close brackets correctly
1165634 # in scan sets, so we specify it separately.
1166635 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1167 _G_arg=\"$_G_arg\"
636 my_arg="\"$my_arg\""
1168637 ;;
1169638 esac
1170639
1171 func_quote_for_expand_result=$_G_arg
1172 }
1173
1174
1175 # func_stripname PREFIX SUFFIX NAME
1176 # ---------------------------------
1177 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1178 # PREFIX and SUFFIX must not contain globbing or regex special
1179 # characters, hashes, percent signs, but SUFFIX may contain a leading
1180 # dot (in which case that matches only a dot).
1181 if test yes = "$_G_HAVE_XSI_OPS"; then
1182 eval 'func_stripname ()
1183 {
1184 $debug_cmd
1185
1186 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1187 # positional parameters, so assign one to ordinary variable first.
1188 func_stripname_result=$3
1189 func_stripname_result=${func_stripname_result#"$1"}
1190 func_stripname_result=${func_stripname_result%"$2"}
1191 }'
1192 else
1193 func_stripname ()
1194 {
1195 $debug_cmd
1196
1197 case $2 in
1198 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
1199 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1200 esac
1201 }
1202 fi
1203
1204
1205 # func_show_eval CMD [FAIL_EXP]
1206 # -----------------------------
1207 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
640 func_quote_for_expand_result="$my_arg"
641 }
642
643
644 # func_show_eval cmd [fail_exp]
645 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1208646 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1209647 # is given, then evaluate it.
1210648 func_show_eval ()
1211649 {
1212 $debug_cmd
1213
1214 _G_cmd=$1
1215 _G_fail_exp=${2-':'}
1216
1217 func_quote_for_expand "$_G_cmd"
1218 eval "func_notquiet $func_quote_for_expand_result"
1219
1220 $opt_dry_run || {
1221 eval "$_G_cmd"
1222 _G_status=$?
1223 if test 0 -ne "$_G_status"; then
1224 eval "(exit $_G_status); $_G_fail_exp"
650 my_cmd="$1"
651 my_fail_exp="${2-:}"
652
653 ${opt_silent-false} || {
654 func_quote_for_expand "$my_cmd"
655 eval "func_echo $func_quote_for_expand_result"
656 }
657
658 if ${opt_dry_run-false}; then :; else
659 eval "$my_cmd"
660 my_status=$?
661 if test "$my_status" -eq 0; then :; else
662 eval "(exit $my_status); $my_fail_exp"
1225663 fi
1226 }
1227 }
1228
1229
1230 # func_show_eval_locale CMD [FAIL_EXP]
1231 # ------------------------------------
1232 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
664 fi
665 }
666
667
668 # func_show_eval_locale cmd [fail_exp]
669 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1233670 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1234671 # is given, then evaluate it. Use the saved locale for evaluation.
1235672 func_show_eval_locale ()
1236673 {
1237 $debug_cmd
1238
1239 _G_cmd=$1
1240 _G_fail_exp=${2-':'}
1241
1242 $opt_quiet || {
1243 func_quote_for_expand "$_G_cmd"
674 my_cmd="$1"
675 my_fail_exp="${2-:}"
676
677 ${opt_silent-false} || {
678 func_quote_for_expand "$my_cmd"
1244679 eval "func_echo $func_quote_for_expand_result"
1245680 }
1246681
1247 $opt_dry_run || {
1248 eval "$_G_user_locale
1249 $_G_cmd"
1250 _G_status=$?
1251 eval "$_G_safe_locale"
1252 if test 0 -ne "$_G_status"; then
1253 eval "(exit $_G_status); $_G_fail_exp"
682 if ${opt_dry_run-false}; then :; else
683 eval "$lt_user_locale
684 $my_cmd"
685 my_status=$?
686 eval "$lt_safe_locale"
687 if test "$my_status" -eq 0; then :; else
688 eval "(exit $my_status); $my_fail_exp"
1254689 fi
1255 }
1256 }
1257
690 fi
691 }
1258692
1259693 # func_tr_sh
1260 # ----------
1261694 # Turn $1 into a string suitable for a shell variable name.
1262695 # Result is stored in $func_tr_sh_result. All characters
1263696 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1264697 # if $1 begins with a digit, a '_' is prepended as well.
1265698 func_tr_sh ()
1266699 {
1267 $debug_cmd
1268
1269 case $1 in
1270 [0-9]* | *[!a-zA-Z0-9_]*)
1271 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
1272 ;;
1273 * )
1274 func_tr_sh_result=$1
1275 ;;
1276 esac
1277 }
1278
1279
1280 # func_verbose ARG...
1281 # -------------------
1282 # Echo program name prefixed message in verbose mode only.
1283 func_verbose ()
1284 {
1285 $debug_cmd
1286
1287 $opt_verbose && func_echo "$*"
1288
1289 :
1290 }
1291
1292
1293 # func_warn_and_continue ARG...
1294 # -----------------------------
1295 # Echo program name prefixed warning message to standard error.
1296 func_warn_and_continue ()
1297 {
1298 $debug_cmd
1299
1300 $require_term_colors
1301
1302 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
1303 }
1304
1305
1306 # func_warning CATEGORY ARG...
1307 # ----------------------------
1308 # Echo program name prefixed warning message to standard error. Warning
1309 # messages can be filtered according to CATEGORY, where this function
1310 # elides messages where CATEGORY is not listed in the global variable
1311 # 'opt_warning_types'.
1312 func_warning ()
1313 {
1314 $debug_cmd
1315
1316 # CATEGORY must be in the warning_categories list!
1317 case " $warning_categories " in
1318 *" $1 "*) ;;
1319 *) func_internal_error "invalid warning category '$1'" ;;
1320 esac
1321
1322 _G_category=$1
1323 shift
1324
1325 case " $opt_warning_types " in
1326 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1327 esac
1328 }
1329
1330
1331 # func_sort_ver VER1 VER2
1332 # -----------------------
1333 # 'sort -V' is not generally available.
1334 # Note this deviates from the version comparison in automake
1335 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1336 # but this should suffice as we won't be specifying old
1337 # version formats or redundant trailing .0 in bootstrap.conf.
1338 # If we did want full compatibility then we should probably
1339 # use m4_version_compare from autoconf.
1340 func_sort_ver ()
1341 {
1342 $debug_cmd
1343
1344 printf '%s\n%s\n' "$1" "$2" \
1345 | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1346 }
1347
1348 # func_lt_ver PREV CURR
1349 # ---------------------
1350 # Return true if PREV and CURR are in the correct order according to
1351 # func_sort_ver, otherwise false. Use it like this:
1352 #
1353 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1354 func_lt_ver ()
1355 {
1356 $debug_cmd
1357
1358 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1359 }
1360
1361
1362 # Local variables:
1363 # mode: shell-script
1364 # sh-indentation: 2
1365 # eval: (add-hook 'before-save-hook 'time-stamp)
1366 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1367 # time-stamp-time-zone: "UTC"
1368 # End:
1369 #! /bin/sh
1370
1371 # Set a version string for this script.
1372 scriptversion=2014-01-07.03; # UTC
1373
1374 # A portable, pluggable option parser for Bourne shell.
1375 # Written by Gary V. Vaughan, 2010
1376
1377 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1378 # This is free software; see the source for copying conditions. There is NO
1379 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1380
1381 # This program is free software: you can redistribute it and/or modify
1382 # it under the terms of the GNU General Public License as published by
1383 # the Free Software Foundation, either version 3 of the License, or
1384 # (at your option) any later version.
1385
1386 # This program is distributed in the hope that it will be useful,
1387 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1388 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1389 # GNU General Public License for more details.
1390
1391 # You should have received a copy of the GNU General Public License
1392 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1393
1394 # Please report bugs or propose patches to gary@gnu.org.
1395
1396
1397 ## ------ ##
1398 ## Usage. ##
1399 ## ------ ##
1400
1401 # This file is a library for parsing options in your shell scripts along
1402 # with assorted other useful supporting features that you can make use
1403 # of too.
1404 #
1405 # For the simplest scripts you might need only:
1406 #
1407 # #!/bin/sh
1408 # . relative/path/to/funclib.sh
1409 # . relative/path/to/options-parser
1410 # scriptversion=1.0
1411 # func_options ${1+"$@"}
1412 # eval set dummy "$func_options_result"; shift
1413 # ...rest of your script...
1414 #
1415 # In order for the '--version' option to work, you will need to have a
1416 # suitably formatted comment like the one at the top of this file
1417 # starting with '# Written by ' and ending with '# warranty; '.
1418 #
1419 # For '-h' and '--help' to work, you will also need a one line
1420 # description of your script's purpose in a comment directly above the
1421 # '# Written by ' line, like the one at the top of this file.
1422 #
1423 # The default options also support '--debug', which will turn on shell
1424 # execution tracing (see the comment above debug_cmd below for another
1425 # use), and '--verbose' and the func_verbose function to allow your script
1426 # to display verbose messages only when your user has specified
1427 # '--verbose'.
1428 #
1429 # After sourcing this file, you can plug processing for additional
1430 # options by amending the variables from the 'Configuration' section
1431 # below, and following the instructions in the 'Option parsing'
1432 # section further down.
1433
1434 ## -------------- ##
1435 ## Configuration. ##
1436 ## -------------- ##
1437
1438 # You should override these variables in your script after sourcing this
1439 # file so that they reflect the customisations you have added to the
1440 # option parser.
1441
1442 # The usage line for option parsing errors and the start of '-h' and
1443 # '--help' output messages. You can embed shell variables for delayed
1444 # expansion at the time the message is displayed, but you will need to
1445 # quote other shell meta-characters carefully to prevent them being
1446 # expanded when the contents are evaled.
1447 usage='$progpath [OPTION]...'
1448
1449 # Short help message in response to '-h' and '--help'. Add to this or
1450 # override it after sourcing this library to reflect the full set of
1451 # options your script accepts.
1452 usage_message="\
1453 --debug enable verbose shell tracing
1454 -W, --warnings=CATEGORY
1455 report the warnings falling in CATEGORY [all]
1456 -v, --verbose verbosely report processing
1457 --version print version information and exit
1458 -h, --help print short or long help message and exit
1459 "
1460
1461 # Additional text appended to 'usage_message' in response to '--help'.
1462 long_help_message="
1463 Warning categories include:
1464 'all' show all warnings
1465 'none' turn off all the warnings
1466 'error' warnings are treated as fatal errors"
1467
1468 # Help message printed before fatal option parsing errors.
1469 fatal_help="Try '\$progname --help' for more information."
1470
1471
1472
1473 ## ------------------------- ##
1474 ## Hook function management. ##
1475 ## ------------------------- ##
1476
1477 # This section contains functions for adding, removing, and running hooks
1478 # to the main code. A hook is just a named list of of function, that can
1479 # be run in order later on.
1480
1481 # func_hookable FUNC_NAME
1482 # -----------------------
1483 # Declare that FUNC_NAME will run hooks added with
1484 # 'func_add_hook FUNC_NAME ...'.
1485 func_hookable ()
1486 {
1487 $debug_cmd
1488
1489 func_append hookable_fns " $1"
1490 }
1491
1492
1493 # func_add_hook FUNC_NAME HOOK_FUNC
1494 # ---------------------------------
1495 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1496 # first have been declared "hookable" by a call to 'func_hookable'.
1497 func_add_hook ()
1498 {
1499 $debug_cmd
1500
1501 case " $hookable_fns " in
1502 *" $1 "*) ;;
1503 *) func_fatal_error "'$1' does not accept hook functions." ;;
1504 esac
1505
1506 eval func_append ${1}_hooks '" $2"'
1507 }
1508
1509
1510 # func_remove_hook FUNC_NAME HOOK_FUNC
1511 # ------------------------------------
1512 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1513 func_remove_hook ()
1514 {
1515 $debug_cmd
1516
1517 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1518 }
1519
1520
1521 # func_run_hooks FUNC_NAME [ARG]...
1522 # ---------------------------------
1523 # Run all hook functions registered to FUNC_NAME.
1524 # It is assumed that the list of hook functions contains nothing more
1525 # than a whitespace-delimited list of legal shell function names, and
1526 # no effort is wasted trying to catch shell meta-characters or preserve
1527 # whitespace.
1528 func_run_hooks ()
1529 {
1530 $debug_cmd
1531
1532 case " $hookable_fns " in
1533 *" $1 "*) ;;
1534 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1535 esac
1536
1537 eval _G_hook_fns=\$$1_hooks; shift
1538
1539 for _G_hook in $_G_hook_fns; do
1540 eval $_G_hook '"$@"'
1541
1542 # store returned options list back into positional
1543 # parameters for next 'cmd' execution.
1544 eval _G_hook_result=\$${_G_hook}_result
1545 eval set dummy "$_G_hook_result"; shift
1546 done
1547
1548 func_quote_for_eval ${1+"$@"}
1549 func_run_hooks_result=$func_quote_for_eval_result
1550 }
1551
1552
1553
1554 ## --------------- ##
1555 ## Option parsing. ##
1556 ## --------------- ##
1557
1558 # In order to add your own option parsing hooks, you must accept the
1559 # full positional parameter list in your hook function, remove any
1560 # options that you action, and then pass back the remaining unprocessed
1561 # options in '<hooked_function_name>_result', escaped suitably for
1562 # 'eval'. Like this:
1563 #
1564 # my_options_prep ()
1565 # {
1566 # $debug_cmd
1567 #
1568 # # Extend the existing usage message.
1569 # usage_message=$usage_message'
1570 # -s, --silent don'\''t print informational messages
1571 # '
1572 #
1573 # func_quote_for_eval ${1+"$@"}
1574 # my_options_prep_result=$func_quote_for_eval_result
1575 # }
1576 # func_add_hook func_options_prep my_options_prep
1577 #
1578 #
1579 # my_silent_option ()
1580 # {
1581 # $debug_cmd
1582 #
1583 # # Note that for efficiency, we parse as many options as we can
1584 # # recognise in a loop before passing the remainder back to the
1585 # # caller on the first unrecognised argument we encounter.
1586 # while test $# -gt 0; do
1587 # opt=$1; shift
1588 # case $opt in
1589 # --silent|-s) opt_silent=: ;;
1590 # # Separate non-argument short options:
1591 # -s*) func_split_short_opt "$_G_opt"
1592 # set dummy "$func_split_short_opt_name" \
1593 # "-$func_split_short_opt_arg" ${1+"$@"}
1594 # shift
1595 # ;;
1596 # *) set dummy "$_G_opt" "$*"; shift; break ;;
1597 # esac
1598 # done
1599 #
1600 # func_quote_for_eval ${1+"$@"}
1601 # my_silent_option_result=$func_quote_for_eval_result
1602 # }
1603 # func_add_hook func_parse_options my_silent_option
1604 #
1605 #
1606 # my_option_validation ()
1607 # {
1608 # $debug_cmd
1609 #
1610 # $opt_silent && $opt_verbose && func_fatal_help "\
1611 # '--silent' and '--verbose' options are mutually exclusive."
1612 #
1613 # func_quote_for_eval ${1+"$@"}
1614 # my_option_validation_result=$func_quote_for_eval_result
1615 # }
1616 # func_add_hook func_validate_options my_option_validation
1617 #
1618 # You'll alse need to manually amend $usage_message to reflect the extra
1619 # options you parse. It's preferable to append if you can, so that
1620 # multiple option parsing hooks can be added safely.
1621
1622
1623 # func_options [ARG]...
1624 # ---------------------
1625 # All the functions called inside func_options are hookable. See the
1626 # individual implementations for details.
1627 func_hookable func_options
1628 func_options ()
1629 {
1630 $debug_cmd
1631
1632 func_options_prep ${1+"$@"}
1633 eval func_parse_options \
1634 ${func_options_prep_result+"$func_options_prep_result"}
1635 eval func_validate_options \
1636 ${func_parse_options_result+"$func_parse_options_result"}
1637
1638 eval func_run_hooks func_options \
1639 ${func_validate_options_result+"$func_validate_options_result"}
1640
1641 # save modified positional parameters for caller
1642 func_options_result=$func_run_hooks_result
1643 }
1644
1645
1646 # func_options_prep [ARG]...
1647 # --------------------------
1648 # All initialisations required before starting the option parse loop.
1649 # Note that when calling hook functions, we pass through the list of
1650 # positional parameters. If a hook function modifies that list, and
1651 # needs to propogate that back to rest of this script, then the complete
1652 # modified list must be put in 'func_run_hooks_result' before
1653 # returning.
1654 func_hookable func_options_prep
1655 func_options_prep ()
1656 {
1657 $debug_cmd
1658
1659 # Option defaults:
1660 opt_verbose=false
1661 opt_warning_types=
1662
1663 func_run_hooks func_options_prep ${1+"$@"}
1664
1665 # save modified positional parameters for caller
1666 func_options_prep_result=$func_run_hooks_result
1667 }
1668
1669
1670 # func_parse_options [ARG]...
1671 # ---------------------------
1672 # The main option parsing loop.
1673 func_hookable func_parse_options
1674 func_parse_options ()
1675 {
1676 $debug_cmd
1677
1678 func_parse_options_result=
1679
1680 # this just eases exit handling
1681 while test $# -gt 0; do
1682 # Defer to hook functions for initial option parsing, so they
1683 # get priority in the event of reusing an option name.
1684 func_run_hooks func_parse_options ${1+"$@"}
1685
1686 # Adjust func_parse_options positional parameters to match
1687 eval set dummy "$func_run_hooks_result"; shift
1688
1689 # Break out of the loop if we already parsed every option.
1690 test $# -gt 0 || break
1691
1692 _G_opt=$1
1693 shift
1694 case $_G_opt in
1695 --debug|-x) debug_cmd='set -x'
1696 func_echo "enabling shell trace mode"
1697 $debug_cmd
1698 ;;
1699
1700 --no-warnings|--no-warning|--no-warn)
1701 set dummy --warnings none ${1+"$@"}
1702 shift
1703 ;;
1704
1705 --warnings|--warning|-W)
1706 test $# = 0 && func_missing_arg $_G_opt && break
1707 case " $warning_categories $1" in
1708 *" $1 "*)
1709 # trailing space prevents matching last $1 above
1710 func_append_uniq opt_warning_types " $1"
1711 ;;
1712 *all)
1713 opt_warning_types=$warning_categories
1714 ;;
1715 *none)
1716 opt_warning_types=none
1717 warning_func=:
1718 ;;
1719 *error)
1720 opt_warning_types=$warning_categories
1721 warning_func=func_fatal_error
1722 ;;
1723 *)
1724 func_fatal_error \
1725 "unsupported warning category: '$1'"
1726 ;;
1727 esac
1728 shift
1729 ;;
1730
1731 --verbose|-v) opt_verbose=: ;;
1732 --version) func_version ;;
1733 -\?|-h) func_usage ;;
1734 --help) func_help ;;
1735
1736 # Separate optargs to long options (plugins may need this):
1737 --*=*) func_split_equals "$_G_opt"
1738 set dummy "$func_split_equals_lhs" \
1739 "$func_split_equals_rhs" ${1+"$@"}
1740 shift
1741 ;;
1742
1743 # Separate optargs to short options:
1744 -W*)
1745 func_split_short_opt "$_G_opt"
1746 set dummy "$func_split_short_opt_name" \
1747 "$func_split_short_opt_arg" ${1+"$@"}
1748 shift
1749 ;;
1750
1751 # Separate non-argument short options:
1752 -\?*|-h*|-v*|-x*)
1753 func_split_short_opt "$_G_opt"
1754 set dummy "$func_split_short_opt_name" \
1755 "-$func_split_short_opt_arg" ${1+"$@"}
1756 shift
1757 ;;
1758
1759 --) break ;;
1760 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1761 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1762 esac
1763 done
1764
1765 # save modified positional parameters for caller
1766 func_quote_for_eval ${1+"$@"}
1767 func_parse_options_result=$func_quote_for_eval_result
1768 }
1769
1770
1771 # func_validate_options [ARG]...
1772 # ------------------------------
1773 # Perform any sanity checks on option settings and/or unconsumed
1774 # arguments.
1775 func_hookable func_validate_options
1776 func_validate_options ()
1777 {
1778 $debug_cmd
1779
1780 # Display all warnings if -W was not given.
1781 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
1782
1783 func_run_hooks func_validate_options ${1+"$@"}
1784
1785 # Bail if the options were screwed!
1786 $exit_cmd $EXIT_FAILURE
1787
1788 # save modified positional parameters for caller
1789 func_validate_options_result=$func_run_hooks_result
1790 }
1791
1792
1793
1794 ## ----------------- ##
1795 ## Helper functions. ##
1796 ## ----------------- ##
1797
1798 # This section contains the helper functions used by the rest of the
1799 # hookable option parser framework in ascii-betical order.
1800
1801
1802 # func_fatal_help ARG...
1803 # ----------------------
1804 # Echo program name prefixed message to standard error, followed by
1805 # a help hint, and exit.
1806 func_fatal_help ()
1807 {
1808 $debug_cmd
1809
1810 eval \$ECHO \""Usage: $usage"\"
1811 eval \$ECHO \""$fatal_help"\"
1812 func_error ${1+"$@"}
1813 exit $EXIT_FAILURE
1814 }
1815
1816
1817 # func_help
1818 # ---------
1819 # Echo long help message to standard output and exit.
700 case $1 in
701 [0-9]* | *[!a-zA-Z0-9_]*)
702 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
703 ;;
704 * )
705 func_tr_sh_result=$1
706 ;;
707 esac
708 }
709
710
711 # func_version
712 # Echo version message to standard output and exit.
713 func_version ()
714 {
715 $opt_debug
716
717 $SED -n '/(C)/!b go
718 :more
719 /\./!{
720 N
721 s/\n# / /
722 b more
723 }
724 :go
725 /^# '$PROGRAM' (GNU /,/# warranty; / {
726 s/^# //
727 s/^# *$//
728 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
729 p
730 }' < "$progpath"
731 exit $?
732 }
733
734 # func_usage
735 # Echo short help message to standard output and exit.
736 func_usage ()
737 {
738 $opt_debug
739
740 $SED -n '/^# Usage:/,/^# *.*--help/ {
741 s/^# //
742 s/^# *$//
743 s/\$progname/'$progname'/
744 p
745 }' < "$progpath"
746 echo
747 $ECHO "run \`$progname --help | more' for full usage"
748 exit $?
749 }
750
751 # func_help [NOEXIT]
752 # Echo long help message to standard output and exit,
753 # unless 'noexit' is passed as argument.
1820754 func_help ()
1821755 {
1822 $debug_cmd
1823
1824 func_usage_message
1825 $ECHO "$long_help_message"
1826 exit 0
1827 }
1828
1829
1830 # func_missing_arg ARGNAME
1831 # ------------------------
756 $opt_debug
757
758 $SED -n '/^# Usage:/,/# Report bugs to/ {
759 :print
760 s/^# //
761 s/^# *$//
762 s*\$progname*'$progname'*
763 s*\$host*'"$host"'*
764 s*\$SHELL*'"$SHELL"'*
765 s*\$LTCC*'"$LTCC"'*
766 s*\$LTCFLAGS*'"$LTCFLAGS"'*
767 s*\$LD*'"$LD"'*
768 s/\$with_gnu_ld/'"$with_gnu_ld"'/
769 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
770 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
771 p
772 d
773 }
774 /^# .* home page:/b print
775 /^# General help using/b print
776 ' < "$progpath"
777 ret=$?
778 if test -z "$1"; then
779 exit $ret
780 fi
781 }
782
783 # func_missing_arg argname
1832784 # Echo program name prefixed message to standard error and set global
1833785 # exit_cmd.
1834786 func_missing_arg ()
1835787 {
1836 $debug_cmd
1837
1838 func_error "Missing argument for '$1'."
788 $opt_debug
789
790 func_error "missing argument for $1."
1839791 exit_cmd=exit
1840792 }
1841793
1842794
1843 # func_split_equals STRING
1844 # ------------------------
1845 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1846 # splitting STRING at the '=' sign.
1847 test -z "$_G_HAVE_XSI_OPS" \
1848 && (eval 'x=a/b/c;
1849 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1850 && _G_HAVE_XSI_OPS=yes
1851
1852 if test yes = "$_G_HAVE_XSI_OPS"
1853 then
1854 # This is an XSI compatible shell, allowing a faster implementation...
1855 eval 'func_split_equals ()
1856 {
1857 $debug_cmd
1858
1859 func_split_equals_lhs=${1%%=*}
1860 func_split_equals_rhs=${1#*=}
1861 test "x$func_split_equals_lhs" = "x$1" \
1862 && func_split_equals_rhs=
1863 }'
1864 else
1865 # ...otherwise fall back to using expr, which is often a shell builtin.
1866 func_split_equals ()
1867 {
1868 $debug_cmd
1869
1870 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
1871 func_split_equals_rhs=
1872 test "x$func_split_equals_lhs" = "x$1" \
1873 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
1874 }
1875 fi #func_split_equals
1876
1877
1878 # func_split_short_opt SHORTOPT
1879 # -----------------------------
795 # func_split_short_opt shortopt
1880796 # Set func_split_short_opt_name and func_split_short_opt_arg shell
1881797 # variables after splitting SHORTOPT after the 2nd character.
1882 if test yes = "$_G_HAVE_XSI_OPS"
1883 then
1884 # This is an XSI compatible shell, allowing a faster implementation...
1885 eval 'func_split_short_opt ()
1886 {
1887 $debug_cmd
1888
1889 func_split_short_opt_arg=${1#??}
1890 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1891 }'
1892 else
1893 # ...otherwise fall back to using expr, which is often a shell builtin.
1894 func_split_short_opt ()
1895 {
1896 $debug_cmd
1897
1898 func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
1899 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
1900 }
1901 fi #func_split_short_opt
1902
1903
1904 # func_usage
1905 # ----------
1906 # Echo short help message to standard output and exit.
1907 func_usage ()
1908 {
1909 $debug_cmd
1910
1911 func_usage_message
1912 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
1913 exit 0
1914 }
1915
1916
1917 # func_usage_message
1918 # ------------------
1919 # Echo short help message to standard output.
1920 func_usage_message ()
1921 {
1922 $debug_cmd
1923
1924 eval \$ECHO \""Usage: $usage"\"
1925 echo
1926 $SED -n 's|^# ||
1927 /^Written by/{
1928 x;p;x
1929 }
1930 h
1931 /^Written by/q' < "$progpath"
1932 echo
1933 eval \$ECHO \""$usage_message"\"
1934 }
1935
1936
1937 # func_version
1938 # ------------
1939 # Echo version message to standard output and exit.
1940 func_version ()
1941 {
1942 $debug_cmd
1943
1944 printf '%s\n' "$progname $scriptversion"
1945 $SED -n '
1946 /(C)/!b go
1947 :more
1948 /\./!{
1949 N
1950 s|\n# | |
1951 b more
1952 }
1953 :go
1954 /^# Written by /,/# warranty; / {
1955 s|^# ||
1956 s|^# *$||
1957 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
1958 p
1959 }
1960 /^# Written by / {
1961 s|^# ||
1962 p
1963 }
1964 /^warranty; /q' < "$progpath"
1965
1966 exit $?
1967 }
1968
1969
1970 # Local variables:
1971 # mode: shell-script
1972 # sh-indentation: 2
1973 # eval: (add-hook 'before-save-hook 'time-stamp)
1974 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1975 # time-stamp-time-zone: "UTC"
1976 # End:
1977
1978 # Set a version string.
1979 scriptversion='(GNU libtool) 2.4.6'
1980
1981
1982 # func_echo ARG...
1983 # ----------------
1984 # Libtool also displays the current mode in messages, so override
1985 # funclib.sh func_echo with this custom definition.
1986 func_echo ()
1987 {
1988 $debug_cmd
1989
1990 _G_message=$*
1991
1992 func_echo_IFS=$IFS
1993 IFS=$nl
1994 for _G_line in $_G_message; do
1995 IFS=$func_echo_IFS
1996 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
1997 done
1998 IFS=$func_echo_IFS
1999 }
2000
2001
2002 # func_warning ARG...
2003 # -------------------
2004 # Libtool warnings are not categorized, so override funclib.sh
2005 # func_warning with this simpler definition.
2006 func_warning ()
2007 {
2008 $debug_cmd
2009
2010 $warning_func ${1+"$@"}
2011 }
2012
2013
2014 ## ---------------- ##
2015 ## Options parsing. ##
2016 ## ---------------- ##
2017
2018 # Hook in the functions to make sure our own options are parsed during
2019 # the option parsing loop.
2020
2021 usage='$progpath [OPTION]... [MODE-ARG]...'
2022
2023 # Short help message in response to '-h'.
2024 usage_message="Options:
2025 --config show all configuration variables
2026 --debug enable verbose shell tracing
2027 -n, --dry-run display commands without modifying any files
2028 --features display basic configuration information and exit
2029 --mode=MODE use operation mode MODE
2030 --no-warnings equivalent to '-Wnone'
2031 --preserve-dup-deps don't remove duplicate dependency libraries
2032 --quiet, --silent don't print informational messages
2033 --tag=TAG use configuration variables from tag TAG
2034 -v, --verbose print more informational messages than default
2035 --version print version information
2036 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2037 -h, --help, --help-all print short, long, or detailed help message
2038 "
2039
2040 # Additional text appended to 'usage_message' in response to '--help'.
2041 func_help ()
2042 {
2043 $debug_cmd
2044
2045 func_usage_message
2046 $ECHO "$long_help_message
2047
2048 MODE must be one of the following:
2049
2050 clean remove files from the build directory
2051 compile compile a source file into a libtool object
2052 execute automatically set library path, then run a program
2053 finish complete the installation of libtool libraries
2054 install install libraries or executables
2055 link create a library or an executable
2056 uninstall remove libraries from an installed directory
2057
2058 MODE-ARGS vary depending on the MODE. When passed as first option,
2059 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2060 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2061
2062 When reporting a bug, please describe a test case to reproduce it and
2063 include the following information:
2064
2065 host-triplet: $host
2066 shell: $SHELL
2067 compiler: $LTCC
2068 compiler flags: $LTCFLAGS
2069 linker: $LD (gnu? $with_gnu_ld)
2070 version: $progname (GNU libtool) 2.4.6
2071 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2072 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2073
2074 Report bugs to <bug-libtool@gnu.org>.
2075 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2076 General help using GNU software: <http://www.gnu.org/gethelp/>."
2077 exit 0
2078 }
2079
2080
2081 # func_lo2o OBJECT-NAME
2082 # ---------------------
2083 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2084 # object suffix.
2085
2086 lo2o=s/\\.lo\$/.$objext/
2087 o2lo=s/\\.$objext\$/.lo/
2088
2089 if test yes = "$_G_HAVE_XSI_OPS"; then
2090 eval 'func_lo2o ()
2091 {
2092 case $1 in
2093 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2094 * ) func_lo2o_result=$1 ;;
2095 esac
2096 }'
2097
2098 # func_xform LIBOBJ-OR-SOURCE
2099 # ---------------------------
2100 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2101 # suffix to a '.lo' libtool-object suffix.
2102 eval 'func_xform ()
2103 {
2104 func_xform_result=${1%.*}.lo
2105 }'
2106 else
2107 # ...otherwise fall back to using sed.
2108 func_lo2o ()
2109 {
2110 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2111 }
2112
2113 func_xform ()
2114 {
2115 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2116 }
2117 fi
2118
2119
2120 # func_fatal_configuration ARG...
2121 # -------------------------------
798 func_split_short_opt ()
799 {
800 my_sed_short_opt='1s/^\(..\).*$/\1/;q'
801 my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
802
803 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
804 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
805 } # func_split_short_opt may be replaced by extended shell implementation
806
807
808 # func_split_long_opt longopt
809 # Set func_split_long_opt_name and func_split_long_opt_arg shell
810 # variables after splitting LONGOPT at the `=' sign.
811 func_split_long_opt ()
812 {
813 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
814 my_sed_long_arg='1s/^--[^=]*=//'
815
816 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
817 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
818 } # func_split_long_opt may be replaced by extended shell implementation
819
820 exit_cmd=:
821
822
823
824
825
826 magic="%%%MAGIC variable%%%"
827 magic_exe="%%%MAGIC EXE variable%%%"
828
829 # Global variables.
830 nonopt=
831 preserve_args=
832 lo2o="s/\\.lo\$/.${objext}/"
833 o2lo="s/\\.${objext}\$/.lo/"
834 extracted_archives=
835 extracted_serial=0
836
837 # If this variable is set in any of the actions, the command in it
838 # will be execed at the end. This prevents here-documents from being
839 # left over by shells.
840 exec_cmd=
841
842 # func_append var value
843 # Append VALUE to the end of shell variable VAR.
844 func_append ()
845 {
846 eval "${1}=\$${1}\${2}"
847 } # func_append may be replaced by extended shell implementation
848
849 # func_append_quoted var value
850 # Quote VALUE and append to the end of shell variable VAR, separated
851 # by a space.
852 func_append_quoted ()
853 {
854 func_quote_for_eval "${2}"
855 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
856 } # func_append_quoted may be replaced by extended shell implementation
857
858
859 # func_arith arithmetic-term...
860 func_arith ()
861 {
862 func_arith_result=`expr "${@}"`
863 } # func_arith may be replaced by extended shell implementation
864
865
866 # func_len string
867 # STRING may not start with a hyphen.
868 func_len ()
869 {
870 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
871 } # func_len may be replaced by extended shell implementation
872
873
874 # func_lo2o object
875 func_lo2o ()
876 {
877 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
878 } # func_lo2o may be replaced by extended shell implementation
879
880
881 # func_xform libobj-or-source
882 func_xform ()
883 {
884 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
885 } # func_xform may be replaced by extended shell implementation
886
887
888 # func_fatal_configuration arg...
2122889 # Echo program name prefixed message to standard error, followed by
2123890 # a configuration failure hint, and exit.
2124891 func_fatal_configuration ()
2125892 {
2126 func__fatal_error ${1+"$@"} \
2127 "See the $PACKAGE documentation for more information." \
2128 "Fatal configuration error."
893 func_error ${1+"$@"}
894 func_error "See the $PACKAGE documentation for more information."
895 func_fatal_error "Fatal configuration error."
2129896 }
2130897
2131898
2132899 # func_config
2133 # -----------
2134900 # Display the configuration for all the tags in this script.
2135901 func_config ()
2136902 {
2148914 exit $?
2149915 }
2150916
2151
2152917 # func_features
2153 # -------------
2154918 # Display the features supported by this script.
2155919 func_features ()
2156920 {
2157921 echo "host: $host"
2158 if test yes = "$build_libtool_libs"; then
922 if test "$build_libtool_libs" = yes; then
2159923 echo "enable shared libraries"
2160924 else
2161925 echo "disable shared libraries"
2162926 fi
2163 if test yes = "$build_old_libs"; then
927 if test "$build_old_libs" = yes; then
2164928 echo "enable static libraries"
2165929 else
2166930 echo "disable static libraries"
2169933 exit $?
2170934 }
2171935
2172
2173 # func_enable_tag TAGNAME
2174 # -----------------------
936 # func_enable_tag tagname
2175937 # Verify that TAGNAME is valid, and either flag an error and exit, or
2176938 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
2177939 # variable here.
2178940 func_enable_tag ()
2179941 {
2180 # Global variable:
2181 tagname=$1
2182
2183 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2184 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2185 sed_extractcf=/$re_begincf/,/$re_endcf/p
2186
2187 # Validate tagname.
2188 case $tagname in
2189 *[!-_A-Za-z0-9,/]*)
2190 func_fatal_error "invalid tag name: $tagname"
2191 ;;
2192 esac
2193
2194 # Don't test for the "default" C tag, as we know it's
2195 # there but not specially marked.
2196 case $tagname in
2197 CC) ;;
942 # Global variable:
943 tagname="$1"
944
945 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
946 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
947 sed_extractcf="/$re_begincf/,/$re_endcf/p"
948
949 # Validate tagname.
950 case $tagname in
951 *[!-_A-Za-z0-9,/]*)
952 func_fatal_error "invalid tag name: $tagname"
953 ;;
954 esac
955
956 # Don't test for the "default" C tag, as we know it's
957 # there but not specially marked.
958 case $tagname in
959 CC) ;;
2198960 *)
2199 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2200 taglist="$taglist $tagname"
2201
2202 # Evaluate the configuration. Be careful to quote the path
2203 # and the sed script, to avoid splitting on whitespace, but
2204 # also don't use non-portable quotes within backquotes within
2205 # quotes we have to do it in 2 steps:
2206 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2207 eval "$extractedcf"
2208 else
2209 func_error "ignoring unknown tag $tagname"
2210 fi
2211 ;;
2212 esac
2213 }
2214
961 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
962 taglist="$taglist $tagname"
963
964 # Evaluate the configuration. Be careful to quote the path
965 # and the sed script, to avoid splitting on whitespace, but
966 # also don't use non-portable quotes within backquotes within
967 # quotes we have to do it in 2 steps:
968 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
969 eval "$extractedcf"
970 else
971 func_error "ignoring unknown tag $tagname"
972 fi
973 ;;
974 esac
975 }
2215976
2216977 # func_check_version_match
2217 # ------------------------
2218978 # Ensure that we are using m4 macros, and libtool script from the same
2219979 # release of libtool.
2220980 func_check_version_match ()
2221981 {
2222 if test "$package_revision" != "$macro_revision"; then
2223 if test "$VERSION" != "$macro_version"; then
2224 if test -z "$macro_version"; then
2225 cat >&2 <<_LT_EOF
982 if test "$package_revision" != "$macro_revision"; then
983 if test "$VERSION" != "$macro_version"; then
984 if test -z "$macro_version"; then
985 cat >&2 <<_LT_EOF
2226986 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2227987 $progname: definition of this LT_INIT comes from an older release.
2228988 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2229989 $progname: and run autoconf again.
2230990 _LT_EOF
2231 else
2232 cat >&2 <<_LT_EOF
991 else
992 cat >&2 <<_LT_EOF
2233993 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
2234994 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2235995 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2236996 $progname: and run autoconf again.
2237997 _LT_EOF
2238 fi
2239 else
2240 cat >&2 <<_LT_EOF
998 fi
999 else
1000 cat >&2 <<_LT_EOF
22411001 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
22421002 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
22431003 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
22441004 $progname: of $PACKAGE $VERSION and run autoconf again.
22451005 _LT_EOF
2246 fi
2247
2248 exit $EXIT_MISMATCH
22491006 fi
2250 }
2251
2252
2253 # libtool_options_prep [ARG]...
2254 # -----------------------------
2255 # Preparation for options parsed by libtool.
2256 libtool_options_prep ()
2257 {
2258 $debug_mode
2259
2260 # Option defaults:
2261 opt_config=false
2262 opt_dlopen=
2263 opt_dry_run=false
2264 opt_help=false
2265 opt_mode=
2266 opt_preserve_dup_deps=false
2267 opt_quiet=false
2268
2269 nonopt=
2270 preserve_args=
2271
2272 # Shorthand for --mode=foo, only valid as the first argument
2273 case $1 in
2274 clean|clea|cle|cl)
2275 shift; set dummy --mode clean ${1+"$@"}; shift
1007
1008 exit $EXIT_MISMATCH
1009 fi
1010 }
1011
1012
1013 # Shorthand for --mode=foo, only valid as the first argument
1014 case $1 in
1015 clean|clea|cle|cl)
1016 shift; set dummy --mode clean ${1+"$@"}; shift
1017 ;;
1018 compile|compil|compi|comp|com|co|c)
1019 shift; set dummy --mode compile ${1+"$@"}; shift
1020 ;;
1021 execute|execut|execu|exec|exe|ex|e)
1022 shift; set dummy --mode execute ${1+"$@"}; shift
1023 ;;
1024 finish|finis|fini|fin|fi|f)
1025 shift; set dummy --mode finish ${1+"$@"}; shift
1026 ;;
1027 install|instal|insta|inst|ins|in|i)
1028 shift; set dummy --mode install ${1+"$@"}; shift
1029 ;;
1030 link|lin|li|l)
1031 shift; set dummy --mode link ${1+"$@"}; shift
1032 ;;
1033 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1034 shift; set dummy --mode uninstall ${1+"$@"}; shift
1035 ;;
1036 esac
1037
1038
1039
1040 # Option defaults:
1041 opt_debug=:
1042 opt_dry_run=false
1043 opt_config=false
1044 opt_preserve_dup_deps=false
1045 opt_features=false
1046 opt_finish=false
1047 opt_help=false
1048 opt_help_all=false
1049 opt_silent=:
1050 opt_warning=:
1051 opt_verbose=:
1052 opt_silent=false
1053 opt_verbose=false
1054
1055
1056 # Parse options once, thoroughly. This comes as soon as possible in the
1057 # script to make things like `--version' happen as quickly as we can.
1058 {
1059 # this just eases exit handling
1060 while test $# -gt 0; do
1061 opt="$1"
1062 shift
1063 case $opt in
1064 --debug|-x) opt_debug='set -x'
1065 func_echo "enabling shell trace mode"
1066 $opt_debug
1067 ;;
1068 --dry-run|--dryrun|-n)
1069 opt_dry_run=:
1070 ;;
1071 --config)
1072 opt_config=:
1073 func_config
1074 ;;
1075 --dlopen|-dlopen)
1076 optarg="$1"
1077 opt_dlopen="${opt_dlopen+$opt_dlopen
1078 }$optarg"
1079 shift
1080 ;;
1081 --preserve-dup-deps)
1082 opt_preserve_dup_deps=:
1083 ;;
1084 --features)
1085 opt_features=:
1086 func_features
1087 ;;
1088 --finish)
1089 opt_finish=:
1090 set dummy --mode finish ${1+"$@"}; shift
1091 ;;
1092 --help)
1093 opt_help=:
1094 ;;
1095 --help-all)
1096 opt_help_all=:
1097 opt_help=': help-all'
1098 ;;
1099 --mode)
1100 test $# = 0 && func_missing_arg $opt && break
1101 optarg="$1"
1102 opt_mode="$optarg"
1103 case $optarg in
1104 # Valid mode arguments:
1105 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1106
1107 # Catch anything else as an error
1108 *) func_error "invalid argument for $opt"
1109 exit_cmd=exit
1110 break
1111 ;;
1112 esac
1113 shift
1114 ;;
1115 --no-silent|--no-quiet)
1116 opt_silent=false
1117 func_append preserve_args " $opt"
1118 ;;
1119 --no-warning|--no-warn)
1120 opt_warning=false
1121 func_append preserve_args " $opt"
1122 ;;
1123 --no-verbose)
1124 opt_verbose=false
1125 func_append preserve_args " $opt"
1126 ;;
1127 --silent|--quiet)
1128 opt_silent=:
1129 func_append preserve_args " $opt"
1130 opt_verbose=false
1131 ;;
1132 --verbose|-v)
1133 opt_verbose=:
1134 func_append preserve_args " $opt"
1135 opt_silent=false
1136 ;;
1137 --tag)
1138 test $# = 0 && func_missing_arg $opt && break
1139 optarg="$1"
1140 opt_tag="$optarg"
1141 func_append preserve_args " $opt $optarg"
1142 func_enable_tag "$optarg"
1143 shift
1144 ;;
1145
1146 -\?|-h) func_usage ;;
1147 --help) func_help ;;
1148 --version) func_version ;;
1149
1150 # Separate optargs to long options:
1151 --*=*)
1152 func_split_long_opt "$opt"
1153 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1154 shift
1155 ;;
1156
1157 # Separate non-argument short options:
1158 -\?*|-h*|-n*|-v*)
1159 func_split_short_opt "$opt"
1160 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1161 shift
1162 ;;
1163
1164 --) break ;;
1165 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1166 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1167 esac
1168 done
1169
1170 # Validate options:
1171
1172 # save first non-option argument
1173 if test "$#" -gt 0; then
1174 nonopt="$opt"
1175 shift
1176 fi
1177
1178 # preserve --debug
1179 test "$opt_debug" = : || func_append preserve_args " --debug"
1180
1181 case $host in
1182 *cygwin* | *mingw* | *pw32* | *cegcc*)
1183 # don't eliminate duplications in $postdeps and $predeps
1184 opt_duplicate_compiler_generated_deps=:
22761185 ;;
2277 compile|compil|compi|comp|com|co|c)
2278 shift; set dummy --mode compile ${1+"$@"}; shift
1186 *)
1187 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
22791188 ;;
2280 execute|execut|execu|exec|exe|ex|e)
2281 shift; set dummy --mode execute ${1+"$@"}; shift
2282 ;;
2283 finish|finis|fini|fin|fi|f)
2284 shift; set dummy --mode finish ${1+"$@"}; shift
2285 ;;
2286 install|instal|insta|inst|ins|in|i)
2287 shift; set dummy --mode install ${1+"$@"}; shift
2288 ;;
2289 link|lin|li|l)
2290 shift; set dummy --mode link ${1+"$@"}; shift
2291 ;;
2292 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
2293 shift; set dummy --mode uninstall ${1+"$@"}; shift
2294 ;;
2295 esac
2296
2297 # Pass back the list of options.
2298 func_quote_for_eval ${1+"$@"}
2299 libtool_options_prep_result=$func_quote_for_eval_result
2300 }
2301 func_add_hook func_options_prep libtool_options_prep
2302
2303
2304 # libtool_parse_options [ARG]...
2305 # ---------------------------------
2306 # Provide handling for libtool specific options.
2307 libtool_parse_options ()
2308 {
2309 $debug_cmd
2310
2311 # Perform our own loop to consume as many options as possible in
2312 # each iteration.
2313 while test $# -gt 0; do
2314 _G_opt=$1
2315 shift
2316 case $_G_opt in
2317 --dry-run|--dryrun|-n)
2318 opt_dry_run=:
2319 ;;
2320
2321 --config) func_config ;;
2322
2323 --dlopen|-dlopen)
2324 opt_dlopen="${opt_dlopen+$opt_dlopen
2325 }$1"
2326 shift
2327 ;;
2328
2329 --preserve-dup-deps)
2330 opt_preserve_dup_deps=: ;;
2331
2332 --features) func_features ;;
2333
2334 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2335
2336 --help) opt_help=: ;;
2337
2338 --help-all) opt_help=': help-all' ;;
2339
2340 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2341 opt_mode=$1
2342 case $1 in
2343 # Valid mode arguments:
2344 clean|compile|execute|finish|install|link|relink|uninstall) ;;
2345
2346 # Catch anything else as an error
2347 *) func_error "invalid argument for $_G_opt"
2348 exit_cmd=exit
2349 break
2350 ;;
2351 esac
2352 shift
2353 ;;
2354
2355 --no-silent|--no-quiet)
2356 opt_quiet=false
2357 func_append preserve_args " $_G_opt"
2358 ;;
2359
2360 --no-warnings|--no-warning|--no-warn)
2361 opt_warning=false
2362 func_append preserve_args " $_G_opt"
2363 ;;
2364
2365 --no-verbose)
2366 opt_verbose=false
2367 func_append preserve_args " $_G_opt"
2368 ;;
2369
2370 --silent|--quiet)
2371 opt_quiet=:
2372 opt_verbose=false
2373 func_append preserve_args " $_G_opt"
2374 ;;
2375
2376 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2377 opt_tag=$1
2378 func_append preserve_args " $_G_opt $1"
2379 func_enable_tag "$1"
2380 shift
2381 ;;
2382
2383 --verbose|-v) opt_quiet=false
2384 opt_verbose=:
2385 func_append preserve_args " $_G_opt"
2386 ;;
2387
2388 # An option not handled by this hook function:
2389 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
2390 esac
2391 done
2392
2393
2394 # save modified positional parameters for caller
2395 func_quote_for_eval ${1+"$@"}
2396 libtool_parse_options_result=$func_quote_for_eval_result
2397 }
2398 func_add_hook func_parse_options libtool_parse_options
2399
2400
2401
2402 # libtool_validate_options [ARG]...
2403 # ---------------------------------
2404 # Perform any sanity checks on option settings and/or unconsumed
2405 # arguments.
2406 libtool_validate_options ()
2407 {
2408 # save first non-option argument
2409 if test 0 -lt $#; then
2410 nonopt=$1
2411 shift
1189 esac
1190
1191 $opt_help || {
1192 # Sanity checks first:
1193 func_check_version_match
1194
1195 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1196 func_fatal_configuration "not configured to build any kind of library"
24121197 fi
24131198
2414 # preserve --debug
2415 test : = "$debug_cmd" || func_append preserve_args " --debug"
2416
2417 case $host in
2418 # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2419 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2420 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
2421 # don't eliminate duplications in $postdeps and $predeps
2422 opt_duplicate_compiler_generated_deps=:
2423 ;;
2424 *)
2425 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2426 ;;
2427 esac
2428
2429 $opt_help || {
2430 # Sanity checks first:
2431 func_check_version_match
2432
2433 test yes != "$build_libtool_libs" \
2434 && test yes != "$build_old_libs" \
2435 && func_fatal_configuration "not configured to build any kind of library"
2436
2437 # Darwin sucks
2438 eval std_shrext=\"$shrext_cmds\"
2439
2440 # Only execute mode is allowed to have -dlopen flags.
2441 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2442 func_error "unrecognized option '-dlopen'"
2443 $ECHO "$help" 1>&2
2444 exit $EXIT_FAILURE
2445 fi
2446
2447 # Change the help message to a mode-specific one.
2448 generic_help=$help
2449 help="Try '$progname --help --mode=$opt_mode' for more information."
2450 }
2451
2452 # Pass back the unparsed argument list
2453 func_quote_for_eval ${1+"$@"}
2454 libtool_validate_options_result=$func_quote_for_eval_result
2455 }
2456 func_add_hook func_validate_options libtool_validate_options
2457
2458
2459 # Process options as early as possible so that --help and --version
2460 # can return quickly.
2461 func_options ${1+"$@"}
2462 eval set dummy "$func_options_result"; shift
1199 # Darwin sucks
1200 eval std_shrext=\"$shrext_cmds\"
1201
1202 # Only execute mode is allowed to have -dlopen flags.
1203 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1204 func_error "unrecognized option \`-dlopen'"
1205 $ECHO "$help" 1>&2
1206 exit $EXIT_FAILURE
1207 fi
1208
1209 # Change the help message to a mode-specific one.
1210 generic_help="$help"
1211 help="Try \`$progname --help --mode=$opt_mode' for more information."
1212 }
1213
1214
1215 # Bail if the options were screwed
1216 $exit_cmd $EXIT_FAILURE
1217 }
1218
24631219
24641220
24651221
24671223 ## Main. ##
24681224 ## ----------- ##
24691225
2470 magic='%%%MAGIC variable%%%'
2471 magic_exe='%%%MAGIC EXE variable%%%'
2472
2473 # Global variables.
2474 extracted_archives=
2475 extracted_serial=0
2476
2477 # If this variable is set in any of the actions, the command in it
2478 # will be execed at the end. This prevents here-documents from being
2479 # left over by shells.
2480 exec_cmd=
2481
2482
2483 # A function that is used when there is no print builtin or printf.
2484 func_fallback_echo ()
2485 {
2486 eval 'cat <<_LTECHO_EOF
2487 $1
2488 _LTECHO_EOF'
2489 }
2490
2491 # func_generated_by_libtool
2492 # True iff stdin has been generated by Libtool. This function is only
2493 # a basic sanity check; it will hardly flush out determined imposters.
2494 func_generated_by_libtool_p ()
2495 {
2496 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2497 }
2498
24991226 # func_lalib_p file
2500 # True iff FILE is a libtool '.la' library or '.lo' object file.
1227 # True iff FILE is a libtool `.la' library or `.lo' object file.
25011228 # This function is only a basic sanity check; it will hardly flush out
25021229 # determined imposters.
25031230 func_lalib_p ()
25041231 {
25051232 test -f "$1" &&
2506 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
1233 $SED -e 4q "$1" 2>/dev/null \
1234 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
25071235 }
25081236
25091237 # func_lalib_unsafe_p file
2510 # True iff FILE is a libtool '.la' library or '.lo' object file.
1238 # True iff FILE is a libtool `.la' library or `.lo' object file.
25111239 # This function implements the same check as func_lalib_p without
25121240 # resorting to external programs. To this end, it redirects stdin and
25131241 # closes it afterwards, without saving the original file descriptor.
25141242 # As a safety measure, use it only where a negative result would be
2515 # fatal anyway. Works if 'file' does not exist.
1243 # fatal anyway. Works if `file' does not exist.
25161244 func_lalib_unsafe_p ()
25171245 {
25181246 lalib_p=no
25201248 for lalib_p_l in 1 2 3 4
25211249 do
25221250 read lalib_p_line
2523 case $lalib_p_line in
1251 case "$lalib_p_line" in
25241252 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
25251253 esac
25261254 done
25271255 exec 0<&5 5<&-
25281256 fi
2529 test yes = "$lalib_p"
1257 test "$lalib_p" = yes
25301258 }
25311259
25321260 # func_ltwrapper_script_p file
25351263 # determined imposters.
25361264 func_ltwrapper_script_p ()
25371265 {
2538 test -f "$1" &&
2539 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
1266 func_lalib_p "$1"
25401267 }
25411268
25421269 # func_ltwrapper_executable_p file
25611288 {
25621289 func_dirname_and_basename "$1" "" "."
25631290 func_stripname '' '.exe' "$func_basename_result"
2564 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
1291 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
25651292 }
25661293
25671294 # func_ltwrapper_p file
25801307 # FAIL_CMD may read-access the current command in variable CMD!
25811308 func_execute_cmds ()
25821309 {
2583 $debug_cmd
2584
1310 $opt_debug
25851311 save_ifs=$IFS; IFS='~'
25861312 for cmd in $1; do
2587 IFS=$sp$nl
1313 IFS=$save_ifs
25881314 eval cmd=\"$cmd\"
2589 IFS=$save_ifs
25901315 func_show_eval "$cmd" "${2-:}"
25911316 done
25921317 IFS=$save_ifs
25981323 # Note that it is not necessary on cygwin/mingw to append a dot to
25991324 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
26001325 # behavior happens only for exec(3), not for open(2)! Also, sourcing
2601 # 'FILE.' does not work on cygwin managed mounts.
1326 # `FILE.' does not work on cygwin managed mounts.
26021327 func_source ()
26031328 {
2604 $debug_cmd
2605
1329 $opt_debug
26061330 case $1 in
26071331 */* | *\\*) . "$1" ;;
26081332 *) . "./$1" ;;
26291353 # store the result into func_replace_sysroot_result.
26301354 func_replace_sysroot ()
26311355 {
2632 case $lt_sysroot:$1 in
1356 case "$lt_sysroot:$1" in
26331357 ?*:"$lt_sysroot"*)
26341358 func_stripname "$lt_sysroot" '' "$1"
2635 func_replace_sysroot_result='='$func_stripname_result
1359 func_replace_sysroot_result="=$func_stripname_result"
26361360 ;;
26371361 *)
26381362 # Including no sysroot.
26491373 # arg is usually of the form 'gcc ...'
26501374 func_infer_tag ()
26511375 {
2652 $debug_cmd
2653
1376 $opt_debug
26541377 if test -n "$available_tags" && test -z "$tagname"; then
26551378 CC_quoted=
26561379 for arg in $CC; do
26691392 for z in $available_tags; do
26701393 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
26711394 # Evaluate the configuration.
2672 eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1395 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
26731396 CC_quoted=
26741397 for arg in $CC; do
26751398 # Double-quote args containing other shell metacharacters.
26941417 # line option must be used.
26951418 if test -z "$tagname"; then
26961419 func_echo "unable to infer tagged configuration"
2697 func_fatal_error "specify a tag with '--tag'"
1420 func_fatal_error "specify a tag with \`--tag'"
26981421 # else
26991422 # func_verbose "using $tagname tagged configuration"
27001423 fi
27101433 # but don't create it if we're doing a dry run.
27111434 func_write_libtool_object ()
27121435 {
2713 write_libobj=$1
2714 if test yes = "$build_libtool_libs"; then
2715 write_lobj=\'$2\'
1436 write_libobj=${1}
1437 if test "$build_libtool_libs" = yes; then
1438 write_lobj=\'${2}\'
27161439 else
27171440 write_lobj=none
27181441 fi
27191442
2720 if test yes = "$build_old_libs"; then
2721 write_oldobj=\'$3\'
1443 if test "$build_old_libs" = yes; then
1444 write_oldobj=\'${3}\'
27221445 else
27231446 write_oldobj=none
27241447 fi
27261449 $opt_dry_run || {
27271450 cat >${write_libobj}T <<EOF
27281451 # $write_libobj - a libtool object file
2729 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
1452 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
27301453 #
27311454 # Please DO NOT delete this file!
27321455 # It is necessary for linking the library.
27381461 non_pic_object=$write_oldobj
27391462
27401463 EOF
2741 $MV "${write_libobj}T" "$write_libobj"
1464 $MV "${write_libobj}T" "${write_libobj}"
27421465 }
27431466 }
27441467
27581481 # be empty on error (or when ARG is empty)
27591482 func_convert_core_file_wine_to_w32 ()
27601483 {
2761 $debug_cmd
2762
2763 func_convert_core_file_wine_to_w32_result=$1
1484 $opt_debug
1485 func_convert_core_file_wine_to_w32_result="$1"
27641486 if test -n "$1"; then
27651487 # Unfortunately, winepath does not exit with a non-zero error code, so we
27661488 # are forced to check the contents of stdout. On the other hand, if the
27681490 # *an error message* to stdout. So we must check for both error code of
27691491 # zero AND non-empty stdout, which explains the odd construction:
27701492 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
2771 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
1493 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
27721494 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
2773 $SED -e "$sed_naive_backslashify"`
1495 $SED -e "$lt_sed_naive_backslashify"`
27741496 else
27751497 func_convert_core_file_wine_to_w32_result=
27761498 fi
27911513 # are convertible, then the result may be empty.
27921514 func_convert_core_path_wine_to_w32 ()
27931515 {
2794 $debug_cmd
2795
1516 $opt_debug
27961517 # unfortunately, winepath doesn't convert paths, only file names
2797 func_convert_core_path_wine_to_w32_result=
1518 func_convert_core_path_wine_to_w32_result=""
27981519 if test -n "$1"; then
27991520 oldIFS=$IFS
28001521 IFS=:
28011522 for func_convert_core_path_wine_to_w32_f in $1; do
28021523 IFS=$oldIFS
28031524 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
2804 if test -n "$func_convert_core_file_wine_to_w32_result"; then
1525 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
28051526 if test -z "$func_convert_core_path_wine_to_w32_result"; then
2806 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
1527 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
28071528 else
28081529 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
28091530 fi
28321553 # environment variable; do not put it in $PATH.
28331554 func_cygpath ()
28341555 {
2835 $debug_cmd
2836
1556 $opt_debug
28371557 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
28381558 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
28391559 if test "$?" -ne 0; then
28421562 fi
28431563 else
28441564 func_cygpath_result=
2845 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
1565 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
28461566 fi
28471567 }
28481568 #end: func_cygpath
28531573 # result in func_convert_core_msys_to_w32_result.
28541574 func_convert_core_msys_to_w32 ()
28551575 {
2856 $debug_cmd
2857
1576 $opt_debug
28581577 # awkward: cmd appends spaces to result
28591578 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2860 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
1579 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
28611580 }
28621581 #end: func_convert_core_msys_to_w32
28631582
28681587 # func_to_host_file_result to ARG1).
28691588 func_convert_file_check ()
28701589 {
2871 $debug_cmd
2872
2873 if test -z "$2" && test -n "$1"; then
1590 $opt_debug
1591 if test -z "$2" && test -n "$1" ; then
28741592 func_error "Could not determine host file name corresponding to"
2875 func_error " '$1'"
1593 func_error " \`$1'"
28761594 func_error "Continuing, but uninstalled executables may not work."
28771595 # Fallback:
2878 func_to_host_file_result=$1
1596 func_to_host_file_result="$1"
28791597 fi
28801598 }
28811599 # end func_convert_file_check
28871605 # func_to_host_file_result to a simplistic fallback value (see below).
28881606 func_convert_path_check ()
28891607 {
2890 $debug_cmd
2891
1608 $opt_debug
28921609 if test -z "$4" && test -n "$3"; then
28931610 func_error "Could not determine the host path corresponding to"
2894 func_error " '$3'"
1611 func_error " \`$3'"
28951612 func_error "Continuing, but uninstalled executables may not work."
28961613 # Fallback. This is a deliberately simplistic "conversion" and
28971614 # should not be "improved". See libtool.info.
29001617 func_to_host_path_result=`echo "$3" |
29011618 $SED -e "$lt_replace_pathsep_chars"`
29021619 else
2903 func_to_host_path_result=$3
1620 func_to_host_path_result="$3"
29041621 fi
29051622 fi
29061623 }
29121629 # and appending REPL if ORIG matches BACKPAT.
29131630 func_convert_path_front_back_pathsep ()
29141631 {
2915 $debug_cmd
2916
1632 $opt_debug
29171633 case $4 in
2918 $1 ) func_to_host_path_result=$3$func_to_host_path_result
1634 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
29191635 ;;
29201636 esac
29211637 case $4 in
29291645 ##################################################
29301646 # $build to $host FILE NAME CONVERSION FUNCTIONS #
29311647 ##################################################
2932 # invoked via '$to_host_file_cmd ARG'
1648 # invoked via `$to_host_file_cmd ARG'
29331649 #
29341650 # In each case, ARG is the path to be converted from $build to $host format.
29351651 # Result will be available in $func_to_host_file_result.
29401656 # in func_to_host_file_result.
29411657 func_to_host_file ()
29421658 {
2943 $debug_cmd
2944
1659 $opt_debug
29451660 $to_host_file_cmd "$1"
29461661 }
29471662 # end func_to_host_file
29531668 # in (the comma separated) LAZY, no conversion takes place.
29541669 func_to_tool_file ()
29551670 {
2956 $debug_cmd
2957
1671 $opt_debug
29581672 case ,$2, in
29591673 *,"$to_tool_file_cmd",*)
29601674 func_to_tool_file_result=$1
29721686 # Copy ARG to func_to_host_file_result.
29731687 func_convert_file_noop ()
29741688 {
2975 func_to_host_file_result=$1
1689 func_to_host_file_result="$1"
29761690 }
29771691 # end func_convert_file_noop
29781692
29831697 # func_to_host_file_result.
29841698 func_convert_file_msys_to_w32 ()
29851699 {
2986 $debug_cmd
2987
2988 func_to_host_file_result=$1
1700 $opt_debug
1701 func_to_host_file_result="$1"
29891702 if test -n "$1"; then
29901703 func_convert_core_msys_to_w32 "$1"
2991 func_to_host_file_result=$func_convert_core_msys_to_w32_result
1704 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
29921705 fi
29931706 func_convert_file_check "$1" "$func_to_host_file_result"
29941707 }
30001713 # func_to_host_file_result.
30011714 func_convert_file_cygwin_to_w32 ()
30021715 {
3003 $debug_cmd
3004
3005 func_to_host_file_result=$1
1716 $opt_debug
1717 func_to_host_file_result="$1"
30061718 if test -n "$1"; then
30071719 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
30081720 # LT_CYGPATH in this case.
30181730 # and a working winepath. Returns result in func_to_host_file_result.
30191731 func_convert_file_nix_to_w32 ()
30201732 {
3021 $debug_cmd
3022
3023 func_to_host_file_result=$1
1733 $opt_debug
1734 func_to_host_file_result="$1"
30241735 if test -n "$1"; then
30251736 func_convert_core_file_wine_to_w32 "$1"
3026 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
1737 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
30271738 fi
30281739 func_convert_file_check "$1" "$func_to_host_file_result"
30291740 }
30351746 # Returns result in func_to_host_file_result.
30361747 func_convert_file_msys_to_cygwin ()
30371748 {
3038 $debug_cmd
3039
3040 func_to_host_file_result=$1
1749 $opt_debug
1750 func_to_host_file_result="$1"
30411751 if test -n "$1"; then
30421752 func_convert_core_msys_to_w32 "$1"
30431753 func_cygpath -u "$func_convert_core_msys_to_w32_result"
3044 func_to_host_file_result=$func_cygpath_result
1754 func_to_host_file_result="$func_cygpath_result"
30451755 fi
30461756 func_convert_file_check "$1" "$func_to_host_file_result"
30471757 }
30541764 # in func_to_host_file_result.
30551765 func_convert_file_nix_to_cygwin ()
30561766 {
3057 $debug_cmd
3058
3059 func_to_host_file_result=$1
1767 $opt_debug
1768 func_to_host_file_result="$1"
30601769 if test -n "$1"; then
30611770 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
30621771 func_convert_core_file_wine_to_w32 "$1"
30631772 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3064 func_to_host_file_result=$func_cygpath_result
1773 func_to_host_file_result="$func_cygpath_result"
30651774 fi
30661775 func_convert_file_check "$1" "$func_to_host_file_result"
30671776 }
30711780 #############################################
30721781 # $build to $host PATH CONVERSION FUNCTIONS #
30731782 #############################################
3074 # invoked via '$to_host_path_cmd ARG'
1783 # invoked via `$to_host_path_cmd ARG'
30751784 #
30761785 # In each case, ARG is the path to be converted from $build to $host format.
30771786 # The result will be available in $func_to_host_path_result.
30951804 to_host_path_cmd=
30961805 func_init_to_host_path_cmd ()
30971806 {
3098 $debug_cmd
3099
1807 $opt_debug
31001808 if test -z "$to_host_path_cmd"; then
31011809 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3102 to_host_path_cmd=func_convert_path_$func_stripname_result
1810 to_host_path_cmd="func_convert_path_${func_stripname_result}"
31031811 fi
31041812 }
31051813
31091817 # in func_to_host_path_result.
31101818 func_to_host_path ()
31111819 {
3112 $debug_cmd
3113
1820 $opt_debug
31141821 func_init_to_host_path_cmd
31151822 $to_host_path_cmd "$1"
31161823 }
31211828 # Copy ARG to func_to_host_path_result.
31221829 func_convert_path_noop ()
31231830 {
3124 func_to_host_path_result=$1
1831 func_to_host_path_result="$1"
31251832 }
31261833 # end func_convert_path_noop
31271834
31321839 # func_to_host_path_result.
31331840 func_convert_path_msys_to_w32 ()
31341841 {
3135 $debug_cmd
3136
3137 func_to_host_path_result=$1
1842 $opt_debug
1843 func_to_host_path_result="$1"
31381844 if test -n "$1"; then
31391845 # Remove leading and trailing path separator characters from ARG. MSYS
31401846 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
31421848 func_stripname : : "$1"
31431849 func_to_host_path_tmp1=$func_stripname_result
31441850 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3145 func_to_host_path_result=$func_convert_core_msys_to_w32_result
1851 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
31461852 func_convert_path_check : ";" \
31471853 "$func_to_host_path_tmp1" "$func_to_host_path_result"
31481854 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
31561862 # func_to_host_file_result.
31571863 func_convert_path_cygwin_to_w32 ()
31581864 {
3159 $debug_cmd
3160
3161 func_to_host_path_result=$1
1865 $opt_debug
1866 func_to_host_path_result="$1"
31621867 if test -n "$1"; then
31631868 # See func_convert_path_msys_to_w32:
31641869 func_stripname : : "$1"
31771882 # a working winepath. Returns result in func_to_host_file_result.
31781883 func_convert_path_nix_to_w32 ()
31791884 {
3180 $debug_cmd
3181
3182 func_to_host_path_result=$1
1885 $opt_debug
1886 func_to_host_path_result="$1"
31831887 if test -n "$1"; then
31841888 # See func_convert_path_msys_to_w32:
31851889 func_stripname : : "$1"
31861890 func_to_host_path_tmp1=$func_stripname_result
31871891 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3188 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
1892 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
31891893 func_convert_path_check : ";" \
31901894 "$func_to_host_path_tmp1" "$func_to_host_path_result"
31911895 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
31991903 # Returns result in func_to_host_file_result.
32001904 func_convert_path_msys_to_cygwin ()
32011905 {
3202 $debug_cmd
3203
3204 func_to_host_path_result=$1
1906 $opt_debug
1907 func_to_host_path_result="$1"
32051908 if test -n "$1"; then
32061909 # See func_convert_path_msys_to_w32:
32071910 func_stripname : : "$1"
32081911 func_to_host_path_tmp1=$func_stripname_result
32091912 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
32101913 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3211 func_to_host_path_result=$func_cygpath_result
1914 func_to_host_path_result="$func_cygpath_result"
32121915 func_convert_path_check : : \
32131916 "$func_to_host_path_tmp1" "$func_to_host_path_result"
32141917 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
32231926 # func_to_host_file_result.
32241927 func_convert_path_nix_to_cygwin ()
32251928 {
3226 $debug_cmd
3227
3228 func_to_host_path_result=$1
1929 $opt_debug
1930 func_to_host_path_result="$1"
32291931 if test -n "$1"; then
32301932 # Remove leading and trailing path separator characters from
32311933 # ARG. msys behavior is inconsistent here, cygpath turns them
32341936 func_to_host_path_tmp1=$func_stripname_result
32351937 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
32361938 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3237 func_to_host_path_result=$func_cygpath_result
1939 func_to_host_path_result="$func_cygpath_result"
32381940 func_convert_path_check : : \
32391941 "$func_to_host_path_tmp1" "$func_to_host_path_result"
32401942 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
32431945 # end func_convert_path_nix_to_cygwin
32441946
32451947
3246 # func_dll_def_p FILE
3247 # True iff FILE is a Windows DLL '.def' file.
3248 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3249 func_dll_def_p ()
3250 {
3251 $debug_cmd
3252
3253 func_dll_def_p_tmp=`$SED -n \
3254 -e 's/^[ ]*//' \
3255 -e '/^\(;.*\)*$/d' \
3256 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3257 -e q \
3258 "$1"`
3259 test DEF = "$func_dll_def_p_tmp"
3260 }
3261
3262
32631948 # func_mode_compile arg...
32641949 func_mode_compile ()
32651950 {
3266 $debug_cmd
3267
1951 $opt_debug
32681952 # Get the compilation command and the source file.
32691953 base_compile=
3270 srcfile=$nonopt # always keep a non-empty value in "srcfile"
1954 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
32711955 suppress_opt=yes
32721956 suppress_output=
32731957 arg_mode=normal
32801964 case $arg_mode in
32811965 arg )
32821966 # do not "continue". Instead, add this to base_compile
3283 lastarg=$arg
1967 lastarg="$arg"
32841968 arg_mode=normal
32851969 ;;
32861970
32871971 target )
3288 libobj=$arg
1972 libobj="$arg"
32891973 arg_mode=normal
32901974 continue
32911975 ;;
32951979 case $arg in
32961980 -o)
32971981 test -n "$libobj" && \
3298 func_fatal_error "you cannot specify '-o' more than once"
1982 func_fatal_error "you cannot specify \`-o' more than once"
32991983 arg_mode=target
33001984 continue
33011985 ;;
33242008 func_stripname '-Wc,' '' "$arg"
33252009 args=$func_stripname_result
33262010 lastarg=
3327 save_ifs=$IFS; IFS=,
2011 save_ifs="$IFS"; IFS=','
33282012 for arg in $args; do
3329 IFS=$save_ifs
2013 IFS="$save_ifs"
33302014 func_append_quoted lastarg "$arg"
33312015 done
3332 IFS=$save_ifs
2016 IFS="$save_ifs"
33332017 func_stripname ' ' '' "$lastarg"
33342018 lastarg=$func_stripname_result
33352019
33422026 # Accept the current argument as the source file.
33432027 # The previous "srcfile" becomes the current argument.
33442028 #
3345 lastarg=$srcfile
3346 srcfile=$arg
2029 lastarg="$srcfile"
2030 srcfile="$arg"
33472031 ;;
33482032 esac # case $arg
33492033 ;;
33582042 func_fatal_error "you must specify an argument for -Xcompile"
33592043 ;;
33602044 target)
3361 func_fatal_error "you must specify a target with '-o'"
2045 func_fatal_error "you must specify a target with \`-o'"
33622046 ;;
33632047 *)
33642048 # Get the name of the library object.
33652049 test -z "$libobj" && {
33662050 func_basename "$srcfile"
3367 libobj=$func_basename_result
2051 libobj="$func_basename_result"
33682052 }
33692053 ;;
33702054 esac
33842068 case $libobj in
33852069 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
33862070 *)
3387 func_fatal_error "cannot determine name of library object from '$libobj'"
2071 func_fatal_error "cannot determine name of library object from \`$libobj'"
33882072 ;;
33892073 esac
33902074
33932077 for arg in $later; do
33942078 case $arg in
33952079 -shared)
3396 test yes = "$build_libtool_libs" \
3397 || func_fatal_configuration "cannot build a shared library"
2080 test "$build_libtool_libs" != yes && \
2081 func_fatal_configuration "can not build a shared library"
33982082 build_old_libs=no
33992083 continue
34002084 ;;
34202104 func_quote_for_eval "$libobj"
34212105 test "X$libobj" != "X$func_quote_for_eval_result" \
34222106 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
3423 && func_warning "libobj name '$libobj' may not contain shell special characters."
2107 && func_warning "libobj name \`$libobj' may not contain shell special characters."
34242108 func_dirname_and_basename "$obj" "/" ""
3425 objname=$func_basename_result
3426 xdir=$func_dirname_result
3427 lobj=$xdir$objdir/$objname
2109 objname="$func_basename_result"
2110 xdir="$func_dirname_result"
2111 lobj=${xdir}$objdir/$objname
34282112
34292113 test -z "$base_compile" && \
34302114 func_fatal_help "you must specify a compilation command"
34312115
34322116 # Delete any leftover library objects.
3433 if test yes = "$build_old_libs"; then
2117 if test "$build_old_libs" = yes; then
34342118 removelist="$obj $lobj $libobj ${libobj}T"
34352119 else
34362120 removelist="$lobj $libobj ${libobj}T"
34422126 pic_mode=default
34432127 ;;
34442128 esac
3445 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
2129 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
34462130 # non-PIC code in shared libraries is not supported
34472131 pic_mode=default
34482132 fi
34492133
34502134 # Calculate the filename of the output object if compiler does
34512135 # not support -o with -c
3452 if test no = "$compiler_c_o"; then
3453 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
3454 lockfile=$output_obj.lock
2136 if test "$compiler_c_o" = no; then
2137 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2138 lockfile="$output_obj.lock"
34552139 else
34562140 output_obj=
34572141 need_locks=no
34602144
34612145 # Lock this critical section if it is needed
34622146 # We use this script file to make the link, it avoids creating a new file
3463 if test yes = "$need_locks"; then
2147 if test "$need_locks" = yes; then
34642148 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
34652149 func_echo "Waiting for $lockfile to be removed"
34662150 sleep 2
34672151 done
3468 elif test warn = "$need_locks"; then
2152 elif test "$need_locks" = warn; then
34692153 if test -f "$lockfile"; then
34702154 $ECHO "\
34712155 *** ERROR, $lockfile exists and contains:
34732157
34742158 This indicates that another process is trying to use the same
34752159 temporary object file, and libtool could not work around it because
3476 your compiler does not support '-c' and '-o' together. If you
2160 your compiler does not support \`-c' and \`-o' together. If you
34772161 repeat this compilation, it may succeed, by chance, but you had better
34782162 avoid parallel builds (make -j) in this platform, or get a better
34792163 compiler."
34952179 qsrcfile=$func_quote_for_eval_result
34962180
34972181 # Only build a PIC object if we are building libtool libraries.
3498 if test yes = "$build_libtool_libs"; then
2182 if test "$build_libtool_libs" = yes; then
34992183 # Without this assignment, base_compile gets emptied.
35002184 fbsd_hideous_sh_bug=$base_compile
35012185
3502 if test no != "$pic_mode"; then
2186 if test "$pic_mode" != no; then
35032187 command="$base_compile $qsrcfile $pic_flag"
35042188 else
35052189 # Don't build PIC code
35162200 func_show_eval_locale "$command" \
35172201 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
35182202
3519 if test warn = "$need_locks" &&
2203 if test "$need_locks" = warn &&
35202204 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
35212205 $ECHO "\
35222206 *** ERROR, $lockfile contains:
35272211
35282212 This indicates that another process is trying to use the same
35292213 temporary object file, and libtool could not work around it because
3530 your compiler does not support '-c' and '-o' together. If you
2214 your compiler does not support \`-c' and \`-o' together. If you
35312215 repeat this compilation, it may succeed, by chance, but you had better
35322216 avoid parallel builds (make -j) in this platform, or get a better
35332217 compiler."
35432227 fi
35442228
35452229 # Allow error messages only from the first compilation.
3546 if test yes = "$suppress_opt"; then
2230 if test "$suppress_opt" = yes; then
35472231 suppress_output=' >/dev/null 2>&1'
35482232 fi
35492233 fi
35502234
35512235 # Only build a position-dependent object if we build old libraries.
3552 if test yes = "$build_old_libs"; then
3553 if test yes != "$pic_mode"; then
2236 if test "$build_old_libs" = yes; then
2237 if test "$pic_mode" != yes; then
35542238 # Don't build PIC code
35552239 command="$base_compile $qsrcfile$pie_flag"
35562240 else
35572241 command="$base_compile $qsrcfile $pic_flag"
35582242 fi
3559 if test yes = "$compiler_c_o"; then
2243 if test "$compiler_c_o" = yes; then
35602244 func_append command " -o $obj"
35612245 fi
35622246
35652249 func_show_eval_locale "$command" \
35662250 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
35672251
3568 if test warn = "$need_locks" &&
2252 if test "$need_locks" = warn &&
35692253 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
35702254 $ECHO "\
35712255 *** ERROR, $lockfile contains:
35762260
35772261 This indicates that another process is trying to use the same
35782262 temporary object file, and libtool could not work around it because
3579 your compiler does not support '-c' and '-o' together. If you
2263 your compiler does not support \`-c' and \`-o' together. If you
35802264 repeat this compilation, it may succeed, by chance, but you had better
35812265 avoid parallel builds (make -j) in this platform, or get a better
35822266 compiler."
35962280 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
35972281
35982282 # Unlock the critical section if it was locked
3599 if test no != "$need_locks"; then
2283 if test "$need_locks" != no; then
36002284 removelist=$lockfile
36012285 $RM "$lockfile"
36022286 fi
36062290 }
36072291
36082292 $opt_help || {
3609 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
2293 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
36102294 }
36112295
36122296 func_mode_help ()
36262310 Remove files from the build directory.
36272311
36282312 RM is the name of the program to use to delete files associated with each FILE
3629 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
2313 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
36302314 to RM.
36312315
36322316 If FILE is a libtool library, object or program, all the files associated
36452329 -no-suppress do not suppress compiler output for multiple passes
36462330 -prefer-pic try to build PIC objects only
36472331 -prefer-non-pic try to build non-PIC objects only
3648 -shared do not build a '.o' file suitable for static linking
3649 -static only build a '.o' file suitable for static linking
2332 -shared do not build a \`.o' file suitable for static linking
2333 -static only build a \`.o' file suitable for static linking
36502334 -Wc,FLAG pass FLAG directly to the compiler
36512335
3652 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
2336 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
36532337 from the given SOURCEFILE.
36542338
36552339 The output file name is determined by removing the directory component from
3656 SOURCEFILE, then substituting the C source code suffix '.c' with the
3657 library object suffix, '.lo'."
2340 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2341 library object suffix, \`.lo'."
36582342 ;;
36592343
36602344 execute)
36672351
36682352 -dlopen FILE add the directory containing FILE to the library path
36692353
3670 This mode sets the library path environment variable according to '-dlopen'
2354 This mode sets the library path environment variable according to \`-dlopen'
36712355 flags.
36722356
36732357 If any of the ARGS are libtool executable wrappers, then they are translated
36862370 Each LIBDIR is a directory that contains libtool libraries.
36872371
36882372 The commands that this mode executes may require superuser privileges. Use
3689 the '--dry-run' option if you just want to see what would be executed."
2373 the \`--dry-run' option if you just want to see what would be executed."
36902374 ;;
36912375
36922376 install)
36962380 Install executables or libraries.
36972381
36982382 INSTALL-COMMAND is the installation command. The first component should be
3699 either the 'install' or 'cp' program.
2383 either the \`install' or \`cp' program.
37002384
37012385 The following components of INSTALL-COMMAND are treated specially:
37022386
37222406 -avoid-version do not add a version suffix if possible
37232407 -bindir BINDIR specify path to binaries directory (for systems where
37242408 libraries must be found in the PATH setting at runtime)
3725 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
2409 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
37262410 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
37272411 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
37282412 -export-symbols SYMFILE
37362420 -no-install link a not-installable executable
37372421 -no-undefined declare that a library does not refer to external symbols
37382422 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3739 -objectlist FILE use a list of object files found in FILE to specify objects
3740 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
2423 -objectlist FILE Use a list of object files found in FILE to specify objects
37412424 -precious-files-regex REGEX
37422425 don't remove output files matching REGEX
37432426 -release RELEASE specify package release information
37572440 -Xlinker FLAG pass linker-specific FLAG directly to the linker
37582441 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
37592442
3760 All other options (arguments beginning with '-') are ignored.
3761
3762 Every other argument is treated as a filename. Files ending in '.la' are
2443 All other options (arguments beginning with \`-') are ignored.
2444
2445 Every other argument is treated as a filename. Files ending in \`.la' are
37632446 treated as uninstalled libtool libraries, other files are standard or library
37642447 object files.
37652448
3766 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
3767 only library objects ('.lo' files) may be specified, and '-rpath' is
2449 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2450 only library objects (\`.lo' files) may be specified, and \`-rpath' is
37682451 required, except when creating a convenience library.
37692452
3770 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
3771 using 'ar' and 'ranlib', or on Windows using 'lib'.
3772
3773 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
2453 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2454 using \`ar' and \`ranlib', or on Windows using \`lib'.
2455
2456 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
37742457 is created, otherwise an executable program is created."
37752458 ;;
37762459
37812464 Remove libraries from an installation directory.
37822465
37832466 RM is the name of the program to use to delete files associated with each FILE
3784 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
2467 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
37852468 to RM.
37862469
37872470 If FILE is a libtool library, all the files associated with it are deleted.
37892472 ;;
37902473
37912474 *)
3792 func_fatal_help "invalid operation mode '$opt_mode'"
2475 func_fatal_help "invalid operation mode \`$opt_mode'"
37932476 ;;
37942477 esac
37952478
37962479 echo
3797 $ECHO "Try '$progname --help' for more information about other modes."
2480 $ECHO "Try \`$progname --help' for more information about other modes."
37982481 }
37992482
38002483 # Now that we've collected a possible --mode arg, show help if necessary
38012484 if $opt_help; then
3802 if test : = "$opt_help"; then
2485 if test "$opt_help" = :; then
38032486 func_mode_help
38042487 else
38052488 {
38072490 for opt_mode in compile link execute install finish uninstall clean; do
38082491 func_mode_help
38092492 done
3810 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
2493 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
38112494 {
38122495 func_help noexit
38132496 for opt_mode in compile link execute install finish uninstall clean; do
38152498 func_mode_help
38162499 done
38172500 } |
3818 $SED '1d
2501 sed '1d
38192502 /^When reporting/,/^Report/{
38202503 H
38212504 d
38322515 # func_mode_execute arg...
38332516 func_mode_execute ()
38342517 {
3835 $debug_cmd
3836
2518 $opt_debug
38372519 # The first argument is the command name.
3838 cmd=$nonopt
2520 cmd="$nonopt"
38392521 test -z "$cmd" && \
38402522 func_fatal_help "you must specify a COMMAND"
38412523
38422524 # Handle -dlopen flags immediately.
38432525 for file in $opt_dlopen; do
38442526 test -f "$file" \
3845 || func_fatal_help "'$file' is not a file"
2527 || func_fatal_help "\`$file' is not a file"
38462528
38472529 dir=
38482530 case $file in
38522534
38532535 # Check to see that this really is a libtool archive.
38542536 func_lalib_unsafe_p "$file" \
3855 || func_fatal_help "'$lib' is not a valid libtool archive"
2537 || func_fatal_help "\`$lib' is not a valid libtool archive"
38562538
38572539 # Read the libtool library.
38582540 dlname=
38632545 if test -z "$dlname"; then
38642546 # Warn if it was a shared library.
38652547 test -n "$library_names" && \
3866 func_warning "'$file' was not linked with '-export-dynamic'"
2548 func_warning "\`$file' was not linked with \`-export-dynamic'"
38672549 continue
38682550 fi
38692551
38702552 func_dirname "$file" "" "."
3871 dir=$func_dirname_result
2553 dir="$func_dirname_result"
38722554
38732555 if test -f "$dir/$objdir/$dlname"; then
38742556 func_append dir "/$objdir"
38752557 else
38762558 if test ! -f "$dir/$dlname"; then
3877 func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
2559 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
38782560 fi
38792561 fi
38802562 ;;
38822564 *.lo)
38832565 # Just add the directory containing the .lo file.
38842566 func_dirname "$file" "" "."
3885 dir=$func_dirname_result
2567 dir="$func_dirname_result"
38862568 ;;
38872569
38882570 *)
3889 func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
2571 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
38902572 continue
38912573 ;;
38922574 esac
38932575
38942576 # Get the absolute pathname.
38952577 absdir=`cd "$dir" && pwd`
3896 test -n "$absdir" && dir=$absdir
2578 test -n "$absdir" && dir="$absdir"
38972579
38982580 # Now add the directory to shlibpath_var.
38992581 if eval "test -z \"\$$shlibpath_var\""; then
39052587
39062588 # This variable tells wrapper scripts just to set shlibpath_var
39072589 # rather than running their programs.
3908 libtool_execute_magic=$magic
2590 libtool_execute_magic="$magic"
39092591
39102592 # Check if any of the arguments is a wrapper script.
39112593 args=
39182600 if func_ltwrapper_script_p "$file"; then
39192601 func_source "$file"
39202602 # Transform arg to wrapped name.
3921 file=$progdir/$program
2603 file="$progdir/$program"
39222604 elif func_ltwrapper_executable_p "$file"; then
39232605 func_ltwrapper_scriptname "$file"
39242606 func_source "$func_ltwrapper_scriptname_result"
39252607 # Transform arg to wrapped name.
3926 file=$progdir/$program
2608 file="$progdir/$program"
39272609 fi
39282610 ;;
39292611 esac
39312613 func_append_quoted args "$file"
39322614 done
39332615
3934 if $opt_dry_run; then
3935 # Display what would be done.
3936 if test -n "$shlibpath_var"; then
3937 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3938 echo "export $shlibpath_var"
3939 fi
3940 $ECHO "$cmd$args"
3941 exit $EXIT_SUCCESS
3942 else
2616 if test "X$opt_dry_run" = Xfalse; then
39432617 if test -n "$shlibpath_var"; then
39442618 # Export the shlibpath_var.
39452619 eval "export $shlibpath_var"
39562630 done
39572631
39582632 # Now prepare to actually exec the command.
3959 exec_cmd=\$cmd$args
2633 exec_cmd="\$cmd$args"
2634 else
2635 # Display what would be done.
2636 if test -n "$shlibpath_var"; then
2637 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2638 echo "export $shlibpath_var"
2639 fi
2640 $ECHO "$cmd$args"
2641 exit $EXIT_SUCCESS
39602642 fi
39612643 }
39622644
3963 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
2645 test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
39642646
39652647
39662648 # func_mode_finish arg...
39672649 func_mode_finish ()
39682650 {
3969 $debug_cmd
3970
2651 $opt_debug
39712652 libs=
39722653 libdirs=
39732654 admincmds=
39812662 if func_lalib_unsafe_p "$opt"; then
39822663 func_append libs " $opt"
39832664 else
3984 func_warning "'$opt' is not a valid libtool archive"
2665 func_warning "\`$opt' is not a valid libtool archive"
39852666 fi
39862667
39872668 else
3988 func_fatal_error "invalid argument '$opt'"
2669 func_fatal_error "invalid argument \`$opt'"
39892670 fi
39902671 done
39912672
40002681 # Remove sysroot references
40012682 if $opt_dry_run; then
40022683 for lib in $libs; do
4003 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
2684 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
40042685 done
40052686 else
40062687 tmpdir=`func_mktempdir`
40072688 for lib in $libs; do
4008 $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2689 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
40092690 > $tmpdir/tmp-la
40102691 mv -f $tmpdir/tmp-la $lib
40112692 done
40302711 fi
40312712
40322713 # Exit here if they wanted silent mode.
4033 $opt_quiet && exit $EXIT_SUCCESS
2714 $opt_silent && exit $EXIT_SUCCESS
40342715
40352716 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
40362717 echo "----------------------------------------------------------------------"
40412722 echo
40422723 echo "If you ever happen to want to link against installed libraries"
40432724 echo "in a given directory, LIBDIR, you must either use libtool, and"
4044 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
2725 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
40452726 echo "flag during linking and do at least one of the following:"
40462727 if test -n "$shlibpath_var"; then
4047 echo " - add LIBDIR to the '$shlibpath_var' environment variable"
2728 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
40482729 echo " during execution"
40492730 fi
40502731 if test -n "$runpath_var"; then
4051 echo " - add LIBDIR to the '$runpath_var' environment variable"
2732 echo " - add LIBDIR to the \`$runpath_var' environment variable"
40522733 echo " during linking"
40532734 fi
40542735 if test -n "$hardcode_libdir_flag_spec"; then
40552736 libdir=LIBDIR
40562737 eval flag=\"$hardcode_libdir_flag_spec\"
40572738
4058 $ECHO " - use the '$flag' linker flag"
2739 $ECHO " - use the \`$flag' linker flag"
40592740 fi
40602741 if test -n "$admincmds"; then
40612742 $ECHO " - have your system administrator run these commands:$admincmds"
40622743 fi
40632744 if test -f /etc/ld.so.conf; then
4064 echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
2745 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
40652746 fi
40662747 echo
40672748
40802761 exit $EXIT_SUCCESS
40812762 }
40822763
4083 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
2764 test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
40842765
40852766
40862767 # func_mode_install arg...
40872768 func_mode_install ()
40882769 {
4089 $debug_cmd
4090
2770 $opt_debug
40912771 # There may be an optional sh(1) argument at the beginning of
40922772 # install_prog (especially on Windows NT).
4093 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
2773 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
40942774 # Allow the use of GNU shtool's install command.
4095 case $nonopt in *shtool*) :;; *) false;; esac
4096 then
2775 case $nonopt in *shtool*) :;; *) false;; esac; then
40972776 # Aesthetically quote it.
40982777 func_quote_for_eval "$nonopt"
40992778 install_prog="$func_quote_for_eval_result "
41202799 opts=
41212800 prev=
41222801 install_type=
4123 isdir=false
2802 isdir=no
41242803 stripme=
41252804 no_mode=:
41262805 for arg
41332812 fi
41342813
41352814 case $arg in
4136 -d) isdir=: ;;
2815 -d) isdir=yes ;;
41372816 -f)
41382817 if $install_cp; then :; else
41392818 prev=$arg
41512830 *)
41522831 # If the previous option needed an argument, then skip it.
41532832 if test -n "$prev"; then
4154 if test X-m = "X$prev" && test -n "$install_override_mode"; then
2833 if test "x$prev" = x-m && test -n "$install_override_mode"; then
41552834 arg2=$install_override_mode
41562835 no_mode=false
41572836 fi
41762855 func_fatal_help "you must specify an install program"
41772856
41782857 test -n "$prev" && \
4179 func_fatal_help "the '$prev' option requires an argument"
2858 func_fatal_help "the \`$prev' option requires an argument"
41802859
41812860 if test -n "$install_override_mode" && $no_mode; then
41822861 if $install_cp; then :; else
41982877 dest=$func_stripname_result
41992878
42002879 # Check to see that the destination is a directory.
4201 test -d "$dest" && isdir=:
4202 if $isdir; then
4203 destdir=$dest
2880 test -d "$dest" && isdir=yes
2881 if test "$isdir" = yes; then
2882 destdir="$dest"
42042883 destname=
42052884 else
42062885 func_dirname_and_basename "$dest" "" "."
4207 destdir=$func_dirname_result
4208 destname=$func_basename_result
2886 destdir="$func_dirname_result"
2887 destname="$func_basename_result"
42092888
42102889 # Not a directory, so check to see that there is only one file specified.
42112890 set dummy $files; shift
42122891 test "$#" -gt 1 && \
4213 func_fatal_help "'$dest' is not a directory"
2892 func_fatal_help "\`$dest' is not a directory"
42142893 fi
42152894 case $destdir in
42162895 [\\/]* | [A-Za-z]:[\\/]*) ;;
42192898 case $file in
42202899 *.lo) ;;
42212900 *)
4222 func_fatal_help "'$destdir' must be an absolute directory name"
2901 func_fatal_help "\`$destdir' must be an absolute directory name"
42232902 ;;
42242903 esac
42252904 done
42282907
42292908 # This variable tells wrapper scripts just to set variables rather
42302909 # than running their programs.
4231 libtool_install_magic=$magic
2910 libtool_install_magic="$magic"
42322911
42332912 staticlibs=
42342913 future_libdirs=
42482927
42492928 # Check to see that this really is a libtool archive.
42502929 func_lalib_unsafe_p "$file" \
4251 || func_fatal_help "'$file' is not a valid libtool archive"
2930 || func_fatal_help "\`$file' is not a valid libtool archive"
42522931
42532932 library_names=
42542933 old_library=
42702949 fi
42712950
42722951 func_dirname "$file" "/" ""
4273 dir=$func_dirname_result
2952 dir="$func_dirname_result"
42742953 func_append dir "$objdir"
42752954
42762955 if test -n "$relink_command"; then
42842963 # are installed into $libdir/../bin (currently, that works fine)
42852964 # but it's something to keep an eye on.
42862965 test "$inst_prefix_dir" = "$destdir" && \
4287 func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
2966 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
42882967
42892968 if test -n "$inst_prefix_dir"; then
42902969 # Stick the inst_prefix_dir data into the link command.
42932972 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
42942973 fi
42952974
4296 func_warning "relinking '$file'"
2975 func_warning "relinking \`$file'"
42972976 func_show_eval "$relink_command" \
4298 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
2977 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
42992978 fi
43002979
43012980 # See the names of the shared library.
43022981 set dummy $library_names; shift
43032982 if test -n "$1"; then
4304 realname=$1
2983 realname="$1"
43052984 shift
43062985
4307 srcname=$realname
4308 test -n "$relink_command" && srcname=${realname}T
2986 srcname="$realname"
2987 test -n "$relink_command" && srcname="$realname"T
43092988
43102989 # Install the shared library and build the symlinks.
43112990 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
43122991 'exit $?'
4313 tstripme=$stripme
2992 tstripme="$stripme"
43142993 case $host_os in
43152994 cygwin* | mingw* | pw32* | cegcc*)
43162995 case $realname in
43172996 *.dll.a)
4318 tstripme=
4319 ;;
4320 esac
4321 ;;
4322 os2*)
4323 case $realname in
4324 *_dll.a)
4325 tstripme=
2997 tstripme=""
43262998 ;;
43272999 esac
43283000 ;;
43333005
43343006 if test "$#" -gt 0; then
43353007 # Delete the old symlinks, and create new ones.
4336 # Try 'ln -sf' first, because the 'ln' binary might depend on
3008 # Try `ln -sf' first, because the `ln' binary might depend on
43373009 # the symlink we replace! Solaris /bin/ln does not understand -f,
43383010 # so we also need to try rm && ln -s.
43393011 for linkname
43443016 fi
43453017
43463018 # Do each command in the postinstall commands.
4347 lib=$destdir/$realname
3019 lib="$destdir/$realname"
43483020 func_execute_cmds "$postinstall_cmds" 'exit $?'
43493021 fi
43503022
43513023 # Install the pseudo-library for information purposes.
43523024 func_basename "$file"
4353 name=$func_basename_result
4354 instname=$dir/${name}i
3025 name="$func_basename_result"
3026 instname="$dir/$name"i
43553027 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
43563028
43573029 # Maybe install the static library, too.
43633035
43643036 # Figure out destination file name, if it wasn't already specified.
43653037 if test -n "$destname"; then
4366 destfile=$destdir/$destname
3038 destfile="$destdir/$destname"
43673039 else
43683040 func_basename "$file"
4369 destfile=$func_basename_result
4370 destfile=$destdir/$destfile
3041 destfile="$func_basename_result"
3042 destfile="$destdir/$destfile"
43713043 fi
43723044
43733045 # Deduce the name of the destination old-style object file.
43773049 staticdest=$func_lo2o_result
43783050 ;;
43793051 *.$objext)
4380 staticdest=$destfile
3052 staticdest="$destfile"
43813053 destfile=
43823054 ;;
43833055 *)
4384 func_fatal_help "cannot copy a libtool object to '$destfile'"
3056 func_fatal_help "cannot copy a libtool object to \`$destfile'"
43853057 ;;
43863058 esac
43873059
43903062 func_show_eval "$install_prog $file $destfile" 'exit $?'
43913063
43923064 # Install the old object if enabled.
4393 if test yes = "$build_old_libs"; then
3065 if test "$build_old_libs" = yes; then
43943066 # Deduce the name of the old-style object file.
43953067 func_lo2o "$file"
43963068 staticobj=$func_lo2o_result
44023074 *)
44033075 # Figure out destination file name, if it wasn't already specified.
44043076 if test -n "$destname"; then
4405 destfile=$destdir/$destname
3077 destfile="$destdir/$destname"
44063078 else
44073079 func_basename "$file"
4408 destfile=$func_basename_result
4409 destfile=$destdir/$destfile
3080 destfile="$func_basename_result"
3081 destfile="$destdir/$destfile"
44103082 fi
44113083
44123084 # If the file is missing, and there is a .exe on the end, strip it
44133085 # because it is most likely a libtool script we actually want to
44143086 # install
4415 stripped_ext=
3087 stripped_ext=""
44163088 case $file in
44173089 *.exe)
44183090 if test ! -f "$file"; then
44193091 func_stripname '' '.exe' "$file"
44203092 file=$func_stripname_result
4421 stripped_ext=.exe
3093 stripped_ext=".exe"
44223094 fi
44233095 ;;
44243096 esac
44463118
44473119 # Check the variables that should have been set.
44483120 test -z "$generated_by_libtool_version" && \
4449 func_fatal_error "invalid libtool wrapper script '$wrapper'"
4450
4451 finalize=:
3121 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3122
3123 finalize=yes
44523124 for lib in $notinst_deplibs; do
44533125 # Check to see that each library is installed.
44543126 libdir=
44553127 if test -f "$lib"; then
44563128 func_source "$lib"
44573129 fi
4458 libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
3130 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
44593131 if test -n "$libdir" && test ! -f "$libfile"; then
4460 func_warning "'$lib' has not been installed in '$libdir'"
4461 finalize=false
3132 func_warning "\`$lib' has not been installed in \`$libdir'"
3133 finalize=no
44623134 fi
44633135 done
44643136
44663138 func_source "$wrapper"
44673139
44683140 outputname=
4469 if test no = "$fast_install" && test -n "$relink_command"; then
3141 if test "$fast_install" = no && test -n "$relink_command"; then
44703142 $opt_dry_run || {
4471 if $finalize; then
3143 if test "$finalize" = yes; then
44723144 tmpdir=`func_mktempdir`
44733145 func_basename "$file$stripped_ext"
4474 file=$func_basename_result
4475 outputname=$tmpdir/$file
3146 file="$func_basename_result"
3147 outputname="$tmpdir/$file"
44763148 # Replace the output file specification.
44773149 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
44783150
4479 $opt_quiet || {
3151 $opt_silent || {
44803152 func_quote_for_expand "$relink_command"
44813153 eval "func_echo $func_quote_for_expand_result"
44823154 }
44833155 if eval "$relink_command"; then :
44843156 else
4485 func_error "error: relink '$file' with the above command before installing it"
3157 func_error "error: relink \`$file' with the above command before installing it"
44863158 $opt_dry_run || ${RM}r "$tmpdir"
44873159 continue
44883160 fi
4489 file=$outputname
3161 file="$outputname"
44903162 else
4491 func_warning "cannot relink '$file'"
3163 func_warning "cannot relink \`$file'"
44923164 fi
44933165 }
44943166 else
45253197
45263198 for file in $staticlibs; do
45273199 func_basename "$file"
4528 name=$func_basename_result
3200 name="$func_basename_result"
45293201
45303202 # Set up the ranlib parameters.
4531 oldlib=$destdir/$name
3203 oldlib="$destdir/$name"
45323204 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
45333205 tool_oldlib=$func_to_tool_file_result
45343206
45433215 done
45443216
45453217 test -n "$future_libdirs" && \
4546 func_warning "remember to run '$progname --finish$future_libdirs'"
3218 func_warning "remember to run \`$progname --finish$future_libdirs'"
45473219
45483220 if test -n "$current_libdirs"; then
45493221 # Maybe just do a dry run.
45503222 $opt_dry_run && current_libdirs=" -n$current_libdirs"
4551 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
3223 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
45523224 else
45533225 exit $EXIT_SUCCESS
45543226 fi
45553227 }
45563228
4557 test install = "$opt_mode" && func_mode_install ${1+"$@"}
3229 test "$opt_mode" = install && func_mode_install ${1+"$@"}
45583230
45593231
45603232 # func_generate_dlsyms outputname originator pic_p
45623234 # a dlpreopen symbol table.
45633235 func_generate_dlsyms ()
45643236 {
4565 $debug_cmd
4566
4567 my_outputname=$1
4568 my_originator=$2
4569 my_pic_p=${3-false}
4570 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
3237 $opt_debug
3238 my_outputname="$1"
3239 my_originator="$2"
3240 my_pic_p="${3-no}"
3241 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
45713242 my_dlsyms=
45723243
4573 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
3244 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
45743245 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4575 my_dlsyms=${my_outputname}S.c
3246 my_dlsyms="${my_outputname}S.c"
45763247 else
45773248 func_error "not configured to extract global symbols from dlpreopened files"
45783249 fi
45833254 "") ;;
45843255 *.c)
45853256 # Discover the nlist of each of the dlfiles.
4586 nlist=$output_objdir/$my_outputname.nm
3257 nlist="$output_objdir/${my_outputname}.nm"
45873258
45883259 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
45893260
45913262 func_verbose "creating $output_objdir/$my_dlsyms"
45923263
45933264 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4594 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
4595 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
3265 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3266 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
45963267
45973268 #ifdef __cplusplus
45983269 extern \"C\" {
45993270 #endif
46003271
4601 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3272 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
46023273 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
46033274 #endif
46043275
46053276 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4606 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4607 /* DATA imports from DLLs on WIN32 can't be const, because runtime
3277 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3278 /* DATA imports from DLLs on WIN32 con't be const, because runtime
46083279 relocations are performed -- see ld's documentation on pseudo-relocs. */
46093280 # define LT_DLSYM_CONST
4610 #elif defined __osf__
3281 #elif defined(__osf__)
46113282 /* This system does not cope well with relocations in const data. */
46123283 # define LT_DLSYM_CONST
46133284 #else
46143285 # define LT_DLSYM_CONST const
46153286 #endif
46163287
4617 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4618
46193288 /* External symbol declarations for the compiler. */\
46203289 "
46213290
4622 if test yes = "$dlself"; then
4623 func_verbose "generating symbol list for '$output'"
3291 if test "$dlself" = yes; then
3292 func_verbose "generating symbol list for \`$output'"
46243293
46253294 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
46263295
46283297 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
46293298 for progfile in $progfiles; do
46303299 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
4631 func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
3300 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
46323301 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
46333302 done
46343303
46483317
46493318 # Prepare the list of exported symbols
46503319 if test -z "$export_symbols"; then
4651 export_symbols=$output_objdir/$outputname.exp
3320 export_symbols="$output_objdir/$outputname.exp"
46523321 $opt_dry_run || {
46533322 $RM $export_symbols
4654 eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3323 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
46553324 case $host in
46563325 *cygwin* | *mingw* | *cegcc* )
46573326 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
46613330 }
46623331 else
46633332 $opt_dry_run || {
4664 eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3333 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
46653334 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
46663335 eval '$MV "$nlist"T "$nlist"'
46673336 case $host in
46753344 fi
46763345
46773346 for dlprefile in $dlprefiles; do
4678 func_verbose "extracting global C symbols from '$dlprefile'"
3347 func_verbose "extracting global C symbols from \`$dlprefile'"
46793348 func_basename "$dlprefile"
4680 name=$func_basename_result
3349 name="$func_basename_result"
46813350 case $host in
46823351 *cygwin* | *mingw* | *cegcc* )
46833352 # if an import library, we need to obtain dlname
46843353 if func_win32_import_lib_p "$dlprefile"; then
46853354 func_tr_sh "$dlprefile"
46863355 eval "curr_lafile=\$libfile_$func_tr_sh_result"
4687 dlprefile_dlbasename=
3356 dlprefile_dlbasename=""
46883357 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
46893358 # Use subshell, to avoid clobbering current variable values
46903359 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
4691 if test -n "$dlprefile_dlname"; then
3360 if test -n "$dlprefile_dlname" ; then
46923361 func_basename "$dlprefile_dlname"
4693 dlprefile_dlbasename=$func_basename_result
3362 dlprefile_dlbasename="$func_basename_result"
46943363 else
46953364 # no lafile. user explicitly requested -dlpreopen <import library>.
46963365 $sharedlib_from_linklib_cmd "$dlprefile"
46983367 fi
46993368 fi
47003369 $opt_dry_run || {
4701 if test -n "$dlprefile_dlbasename"; then
3370 if test -n "$dlprefile_dlbasename" ; then
47023371 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
47033372 else
47043373 func_warning "Could not compute DLL name from $name"
47543423 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
47553424 fi
47563425
4757 func_show_eval '$RM "${nlist}I"'
4758 if test -n "$global_symbol_to_import"; then
4759 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
4760 fi
4761
47623426 echo >> "$output_objdir/$my_dlsyms" "\
47633427
47643428 /* The mapping between symbol names and symbols. */
47673431 void *address;
47683432 } lt_dlsymlist;
47693433 extern LT_DLSYM_CONST lt_dlsymlist
4770 lt_${my_prefix}_LTX_preloaded_symbols[];\
4771 "
4772
4773 if test -s "$nlist"I; then
4774 echo >> "$output_objdir/$my_dlsyms" "\
4775 static void lt_syminit(void)
4776 {
4777 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
4778 for (; symbol->name; ++symbol)
4779 {"
4780 $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
4781 echo >> "$output_objdir/$my_dlsyms" "\
4782 }
4783 }"
4784 fi
4785 echo >> "$output_objdir/$my_dlsyms" "\
3434 lt_${my_prefix}_LTX_preloaded_symbols[];
47863435 LT_DLSYM_CONST lt_dlsymlist
47873436 lt_${my_prefix}_LTX_preloaded_symbols[] =
4788 { {\"$my_originator\", (void *) 0},"
4789
4790 if test -s "$nlist"I; then
4791 echo >> "$output_objdir/$my_dlsyms" "\
4792 {\"@INIT@\", (void *) &lt_syminit},"
4793 fi
3437 {\
3438 { \"$my_originator\", (void *) 0 },"
47943439
47953440 case $need_lib_prefix in
47963441 no)
48323477 *-*-hpux*)
48333478 pic_flag_for_symtable=" $pic_flag" ;;
48343479 *)
4835 $my_pic_p && pic_flag_for_symtable=" $pic_flag"
3480 if test "X$my_pic_p" != Xno; then
3481 pic_flag_for_symtable=" $pic_flag"
3482 fi
48363483 ;;
48373484 esac
48383485 ;;
48493496 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
48503497
48513498 # Clean up the generated files.
4852 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
3499 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
48533500
48543501 # Transform the symbol file into the correct name.
4855 symfileobj=$output_objdir/${my_outputname}S.$objext
3502 symfileobj="$output_objdir/${my_outputname}S.$objext"
48563503 case $host in
48573504 *cygwin* | *mingw* | *cegcc* )
48583505 if test -f "$output_objdir/$my_outputname.def"; then
48703517 esac
48713518 ;;
48723519 *)
4873 func_fatal_error "unknown suffix for '$my_dlsyms'"
3520 func_fatal_error "unknown suffix for \`$my_dlsyms'"
48743521 ;;
48753522 esac
48763523 else
48823529 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
48833530 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
48843531 fi
4885 }
4886
4887 # func_cygming_gnu_implib_p ARG
4888 # This predicate returns with zero status (TRUE) if
4889 # ARG is a GNU/binutils-style import library. Returns
4890 # with nonzero status (FALSE) otherwise.
4891 func_cygming_gnu_implib_p ()
4892 {
4893 $debug_cmd
4894
4895 func_to_tool_file "$1" func_convert_file_msys_to_w32
4896 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
4897 test -n "$func_cygming_gnu_implib_tmp"
4898 }
4899
4900 # func_cygming_ms_implib_p ARG
4901 # This predicate returns with zero status (TRUE) if
4902 # ARG is an MS-style import library. Returns
4903 # with nonzero status (FALSE) otherwise.
4904 func_cygming_ms_implib_p ()
4905 {
4906 $debug_cmd
4907
4908 func_to_tool_file "$1" func_convert_file_msys_to_w32
4909 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4910 test -n "$func_cygming_ms_implib_tmp"
49113532 }
49123533
49133534 # func_win32_libid arg
49193540 # Despite the name, also deal with 64 bit binaries.
49203541 func_win32_libid ()
49213542 {
4922 $debug_cmd
4923
4924 win32_libid_type=unknown
3543 $opt_debug
3544 win32_libid_type="unknown"
49253545 win32_fileres=`file -L $1 2>/dev/null`
49263546 case $win32_fileres in
49273547 *ar\ archive\ import\ library*) # definitely import
49313551 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
49323552 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
49333553 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
4934 case $nm_interface in
4935 "MS dumpbin")
4936 if func_cygming_ms_implib_p "$1" ||
4937 func_cygming_gnu_implib_p "$1"
4938 then
4939 win32_nmres=import
4940 else
4941 win32_nmres=
4942 fi
4943 ;;
4944 *)
4945 func_to_tool_file "$1" func_convert_file_msys_to_w32
4946 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4947 $SED -n -e '
3554 func_to_tool_file "$1" func_convert_file_msys_to_w32
3555 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3556 $SED -n -e '
49483557 1,100{
49493558 / I /{
4950 s|.*|import|
3559 s,.*,import,
49513560 p
49523561 q
49533562 }
49543563 }'`
4955 ;;
4956 esac
49573564 case $win32_nmres in
49583565 import*) win32_libid_type="x86 archive import";;
49593566 *) win32_libid_type="x86 archive static";;
49853592 # $sharedlib_from_linklib_result
49863593 func_cygming_dll_for_implib ()
49873594 {
4988 $debug_cmd
4989
3595 $opt_debug
49903596 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
49913597 }
49923598
50033609 # specified import library.
50043610 func_cygming_dll_for_implib_fallback_core ()
50053611 {
5006 $debug_cmd
5007
3612 $opt_debug
50083613 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
50093614 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
50103615 $SED '/^Contents of section '"$match_literal"':/{
50403645 /./p' |
50413646 # we now have a list, one entry per line, of the stringified
50423647 # contents of the appropriate section of all members of the
5043 # archive that possess that section. Heuristic: eliminate
5044 # all those that have a first or second character that is
3648 # archive which possess that section. Heuristic: eliminate
3649 # all those which have a first or second character that is
50453650 # a '.' (that is, objdump's representation of an unprintable
50463651 # character.) This should work for all archives with less than
50473652 # 0x302f exports -- but will fail for DLLs whose name actually
50503655 #
50513656 # Of those that remain, print the first one.
50523657 $SED -e '/^\./d;/^.\./d;q'
3658 }
3659
3660 # func_cygming_gnu_implib_p ARG
3661 # This predicate returns with zero status (TRUE) if
3662 # ARG is a GNU/binutils-style import library. Returns
3663 # with nonzero status (FALSE) otherwise.
3664 func_cygming_gnu_implib_p ()
3665 {
3666 $opt_debug
3667 func_to_tool_file "$1" func_convert_file_msys_to_w32
3668 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3669 test -n "$func_cygming_gnu_implib_tmp"
3670 }
3671
3672 # func_cygming_ms_implib_p ARG
3673 # This predicate returns with zero status (TRUE) if
3674 # ARG is an MS-style import library. Returns
3675 # with nonzero status (FALSE) otherwise.
3676 func_cygming_ms_implib_p ()
3677 {
3678 $opt_debug
3679 func_to_tool_file "$1" func_convert_file_msys_to_w32
3680 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3681 test -n "$func_cygming_ms_implib_tmp"
50533682 }
50543683
50553684 # func_cygming_dll_for_implib_fallback ARG
50653694 # $sharedlib_from_linklib_result
50663695 func_cygming_dll_for_implib_fallback ()
50673696 {
5068 $debug_cmd
5069
5070 if func_cygming_gnu_implib_p "$1"; then
3697 $opt_debug
3698 if func_cygming_gnu_implib_p "$1" ; then
50713699 # binutils import library
50723700 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5073 elif func_cygming_ms_implib_p "$1"; then
3701 elif func_cygming_ms_implib_p "$1" ; then
50743702 # ms-generated import library
50753703 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
50763704 else
50773705 # unknown
5078 sharedlib_from_linklib_result=
3706 sharedlib_from_linklib_result=""
50793707 fi
50803708 }
50813709
50833711 # func_extract_an_archive dir oldlib
50843712 func_extract_an_archive ()
50853713 {
5086 $debug_cmd
5087
5088 f_ex_an_ar_dir=$1; shift
5089 f_ex_an_ar_oldlib=$1
5090 if test yes = "$lock_old_archive_extraction"; then
3714 $opt_debug
3715 f_ex_an_ar_dir="$1"; shift
3716 f_ex_an_ar_oldlib="$1"
3717 if test "$lock_old_archive_extraction" = yes; then
50913718 lockfile=$f_ex_an_ar_oldlib.lock
50923719 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
50933720 func_echo "Waiting for $lockfile to be removed"
50963723 fi
50973724 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
50983725 'stat=$?; rm -f "$lockfile"; exit $stat'
5099 if test yes = "$lock_old_archive_extraction"; then
3726 if test "$lock_old_archive_extraction" = yes; then
51003727 $opt_dry_run || rm -f "$lockfile"
51013728 fi
51023729 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
51103737 # func_extract_archives gentop oldlib ...
51113738 func_extract_archives ()
51123739 {
5113 $debug_cmd
5114
5115 my_gentop=$1; shift
3740 $opt_debug
3741 my_gentop="$1"; shift
51163742 my_oldlibs=${1+"$@"}
5117 my_oldobjs=
5118 my_xlib=
5119 my_xabs=
5120 my_xdir=
3743 my_oldobjs=""
3744 my_xlib=""
3745 my_xabs=""
3746 my_xdir=""
51213747
51223748 for my_xlib in $my_oldlibs; do
51233749 # Extract the objects.
51243750 case $my_xlib in
5125 [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
3751 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
51263752 *) my_xabs=`pwd`"/$my_xlib" ;;
51273753 esac
51283754 func_basename "$my_xlib"
5129 my_xlib=$func_basename_result
3755 my_xlib="$func_basename_result"
51303756 my_xlib_u=$my_xlib
51313757 while :; do
51323758 case " $extracted_archives " in
51383764 esac
51393765 done
51403766 extracted_archives="$extracted_archives $my_xlib_u"
5141 my_xdir=$my_gentop/$my_xlib_u
3767 my_xdir="$my_gentop/$my_xlib_u"
51423768
51433769 func_mkdir_p "$my_xdir"
51443770
51513777 cd $my_xdir || exit $?
51523778 darwin_archive=$my_xabs
51533779 darwin_curdir=`pwd`
5154 func_basename "$darwin_archive"
5155 darwin_base_archive=$func_basename_result
3780 darwin_base_archive=`basename "$darwin_archive"`
51563781 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
51573782 if test -n "$darwin_arches"; then
51583783 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
51593784 darwin_arch=
51603785 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5161 for darwin_arch in $darwin_arches; do
5162 func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
5163 $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
5164 cd "unfat-$$/$darwin_base_archive-$darwin_arch"
5165 func_extract_an_archive "`pwd`" "$darwin_base_archive"
3786 for darwin_arch in $darwin_arches ; do
3787 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3788 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3789 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3790 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
51663791 cd "$darwin_curdir"
5167 $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
3792 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
51683793 done # $darwin_arches
51693794 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5170 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
3795 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
51713796 darwin_file=
51723797 darwin_files=
51733798 for darwin_file in $darwin_filelist; do
51893814 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
51903815 done
51913816
5192 func_extract_archives_result=$my_oldobjs
3817 func_extract_archives_result="$my_oldobjs"
51933818 }
51943819
51953820
52043829 #
52053830 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
52063831 # variable will take. If 'yes', then the emitted script
5207 # will assume that the directory where it is stored is
3832 # will assume that the directory in which it is stored is
52083833 # the $objdir directory. This is a cygwin/mingw-specific
52093834 # behavior.
52103835 func_emit_wrapper ()
52153840 #! $SHELL
52163841
52173842 # $output - temporary wrapper script for $objdir/$outputname
5218 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
3843 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
52193844 #
52203845 # The $output program cannot be directly executed until all the libtool
52213846 # libraries that it depends on are installed.
52723897
52733898 # Very basic option parsing. These options are (a) specific to
52743899 # the libtool wrapper, (b) are identical between the wrapper
5275 # /script/ and the wrapper /executable/ that is used only on
3900 # /script/ and the wrapper /executable/ which is used only on
52763901 # windows platforms, and (c) all begin with the string "--lt-"
5277 # (application programs are unlikely to have options that match
3902 # (application programs are unlikely to have options which match
52783903 # this pattern).
52793904 #
52803905 # There are only two supported options: --lt-debug and
53073932
53083933 # Print the debug banner immediately:
53093934 if test -n \"\$lt_option_debug\"; then
5310 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
3935 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
53113936 fi
53123937 }
53133938
53183943 lt_dump_args_N=1;
53193944 for lt_arg
53203945 do
5321 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
3946 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
53223947 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
53233948 done
53243949 }
53323957 *-*-mingw | *-*-os2* | *-cegcc*)
53333958 $ECHO "\
53343959 if test -n \"\$lt_option_debug\"; then
5335 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
3960 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
53363961 func_lt_dump_args \${1+\"\$@\"} 1>&2
53373962 fi
53383963 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
53423967 *)
53433968 $ECHO "\
53443969 if test -n \"\$lt_option_debug\"; then
5345 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
3970 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
53463971 func_lt_dump_args \${1+\"\$@\"} 1>&2
53473972 fi
53483973 exec \"\$progdir/\$program\" \${1+\"\$@\"}
54174042 test -n \"\$absdir\" && thisdir=\"\$absdir\"
54184043 "
54194044
5420 if test yes = "$fast_install"; then
4045 if test "$fast_install" = yes; then
54214046 $ECHO "\
54224047 program=lt-'$outputname'$exeext
54234048 progdir=\"\$thisdir/$objdir\"
54244049
54254050 if test ! -f \"\$progdir/\$program\" ||
5426 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
4051 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
54274052 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
54284053
54294054 file=\"\$\$-\$program\"
54404065 if test -n \"\$relink_command\"; then
54414066 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
54424067 else
5443 \$ECHO \"\$relink_command_output\" >&2
4068 $ECHO \"\$relink_command_output\" >&2
54444069 $RM \"\$progdir/\$file\"
54454070 exit 1
54464071 fi
54754100 fi
54764101
54774102 # Export our shlibpath_var if we have one.
5478 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4103 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
54794104 $ECHO "\
54804105 # Add our own library path to $shlibpath_var
54814106 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
54954120 fi
54964121 else
54974122 # The program doesn't exist.
5498 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
4123 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
54994124 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
55004125 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
55014126 exit 1
55144139 cat <<EOF
55154140
55164141 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5517 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4142 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
55184143
55194144 The $output program cannot be directly executed until all the libtool
55204145 libraries that it depends on are installed.
55494174 #include <fcntl.h>
55504175 #include <sys/stat.h>
55514176
5552 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5553
55544177 /* declarations of non-ANSI functions */
5555 #if defined __MINGW32__
4178 #if defined(__MINGW32__)
55564179 # ifdef __STRICT_ANSI__
55574180 int _putenv (const char *);
55584181 # endif
5559 #elif defined __CYGWIN__
4182 #elif defined(__CYGWIN__)
55604183 # ifdef __STRICT_ANSI__
55614184 char *realpath (const char *, char *);
55624185 int putenv (char *);
55634186 int setenv (const char *, const char *, int);
55644187 # endif
5565 /* #elif defined other_platform || defined ... */
4188 /* #elif defined (other platforms) ... */
55664189 #endif
55674190
55684191 /* portability defines, excluding path handling macros */
5569 #if defined _MSC_VER
4192 #if defined(_MSC_VER)
55704193 # define setmode _setmode
55714194 # define stat _stat
55724195 # define chmod _chmod
55734196 # define getcwd _getcwd
55744197 # define putenv _putenv
55754198 # define S_IXUSR _S_IEXEC
5576 #elif defined __MINGW32__
4199 # ifndef _INTPTR_T_DEFINED
4200 # define _INTPTR_T_DEFINED
4201 # define intptr_t int
4202 # endif
4203 #elif defined(__MINGW32__)
55774204 # define setmode _setmode
55784205 # define stat _stat
55794206 # define chmod _chmod
55804207 # define getcwd _getcwd
55814208 # define putenv _putenv
5582 #elif defined __CYGWIN__
4209 #elif defined(__CYGWIN__)
55834210 # define HAVE_SETENV
55844211 # define FOPEN_WB "wb"
5585 /* #elif defined other platforms ... */
4212 /* #elif defined (other platforms) ... */
55864213 #endif
55874214
5588 #if defined PATH_MAX
4215 #if defined(PATH_MAX)
55894216 # define LT_PATHMAX PATH_MAX
5590 #elif defined MAXPATHLEN
4217 #elif defined(MAXPATHLEN)
55914218 # define LT_PATHMAX MAXPATHLEN
55924219 #else
55934220 # define LT_PATHMAX 1024
56064233 # define PATH_SEPARATOR ':'
56074234 #endif
56084235
5609 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
5610 defined __OS2__
4236 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4237 defined (__OS2__)
56114238 # define HAVE_DOS_BASED_FILE_SYSTEM
56124239 # define FOPEN_WB "wb"
56134240 # ifndef DIR_SEPARATOR_2
56404267
56414268 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
56424269 #define XFREE(stale) do { \
5643 if (stale) { free (stale); stale = 0; } \
4270 if (stale) { free ((void *) stale); stale = 0; } \
56444271 } while (0)
56454272
5646 #if defined LT_DEBUGWRAPPER
4273 #if defined(LT_DEBUGWRAPPER)
56474274 static int lt_debug = 1;
56484275 #else
56494276 static int lt_debug = 0;
56724299 EOF
56734300
56744301 cat <<EOF
5675 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5676 # define externally_visible volatile
5677 #else
5678 # define externally_visible __attribute__((externally_visible)) volatile
5679 #endif
5680 externally_visible const char * MAGIC_EXE = "$magic_exe";
4302 volatile const char * MAGIC_EXE = "$magic_exe";
56814303 const char * LIB_PATH_VARNAME = "$shlibpath_var";
56824304 EOF
56834305
5684 if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4306 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
56854307 func_to_host_path "$temp_rpath"
56864308 cat <<EOF
56874309 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
57054327 EOF
57064328 fi
57074329
5708 if test yes = "$fast_install"; then
4330 if test "$fast_install" = yes; then
57094331 cat <<EOF
57104332 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
57114333 EOF
57344356 char *actual_cwrapper_name;
57354357 char *target_name;
57364358 char *lt_argv_zero;
5737 int rval = 127;
4359 intptr_t rval = 127;
57384360
57394361 int i;
57404362
57414363 program_name = (char *) xstrdup (base_name (argv[0]));
5742 newargz = XMALLOC (char *, (size_t) argc + 1);
4364 newargz = XMALLOC (char *, argc + 1);
57434365
57444366 /* very simple arg parsing; don't want to rely on getopt
57454367 * also, copy all non cwrapper options to newargz, except
57484370 newargc=0;
57494371 for (i = 1; i < argc; i++)
57504372 {
5751 if (STREQ (argv[i], dumpscript_opt))
4373 if (strcmp (argv[i], dumpscript_opt) == 0)
57524374 {
57534375 EOF
5754 case $host in
4376 case "$host" in
57554377 *mingw* | *cygwin* )
57564378 # make stdout use "unix" line endings
57574379 echo " setmode(1,_O_BINARY);"
57624384 lt_dump_script (stdout);
57634385 return 0;
57644386 }
5765 if (STREQ (argv[i], debug_opt))
4387 if (strcmp (argv[i], debug_opt) == 0)
57664388 {
57674389 lt_debug = 1;
57684390 continue;
57694391 }
5770 if (STREQ (argv[i], ltwrapper_option_prefix))
4392 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
57714393 {
57724394 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
57734395 namespace, but it is not one of the ones we know about and
57904412 EOF
57914413 cat <<EOF
57924414 /* The GNU banner must be the first non-error debug message */
5793 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
4415 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
57944416 EOF
57954417 cat <<"EOF"
57964418 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
59014523 cat <<"EOF"
59024524 /* execv doesn't actually work on mingw as expected on unix */
59034525 newargz = prepare_spawn (newargz);
5904 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4526 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
59054527 if (rval == -1)
59064528 {
59074529 /* failed to start process */
59464568 {
59474569 const char *base;
59484570
5949 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4571 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
59504572 /* Skip over the disk name in MSDOS pathnames. */
59514573 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
59524574 name += 2;
60054627 const char *p_next;
60064628 /* static buffer for getcwd */
60074629 char tmp[LT_PATHMAX + 1];
6008 size_t tmp_len;
4630 int tmp_len;
60094631 char *concat_name;
60104632
60114633 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
60154637 return NULL;
60164638
60174639 /* Absolute path? */
6018 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4640 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
60194641 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
60204642 {
60214643 concat_name = xstrdup (wrapper);
60334655 return concat_name;
60344656 XFREE (concat_name);
60354657 }
6036 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4658 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
60374659 }
60384660 #endif
60394661
60564678 for (q = p; *q; q++)
60574679 if (IS_PATH_SEPARATOR (*q))
60584680 break;
6059 p_len = (size_t) (q - p);
4681 p_len = q - p;
60604682 p_next = (*q == '\0' ? q : q + 1);
60614683 if (p_len == 0)
60624684 {
61754797 if (patlen <= len)
61764798 {
61774799 str += len - patlen;
6178 if (STREQ (str, pat))
4800 if (strcmp (str, pat) == 0)
61794801 *str = '\0';
61804802 }
61814803 return str;
62404862 char *str = xstrdup (value);
62414863 setenv (name, str, 1);
62424864 #else
6243 size_t len = strlen (name) + 1 + strlen (value) + 1;
4865 int len = strlen (name) + 1 + strlen (value) + 1;
62444866 char *str = XMALLOC (char, len);
62454867 sprintf (str, "%s=%s", name, value);
62464868 if (putenv (str) != EXIT_SUCCESS)
62574879 char *new_value;
62584880 if (orig_value && *orig_value)
62594881 {
6260 size_t orig_value_len = strlen (orig_value);
6261 size_t add_len = strlen (add);
4882 int orig_value_len = strlen (orig_value);
4883 int add_len = strlen (add);
62624884 new_value = XMALLOC (char, add_len + orig_value_len + 1);
62634885 if (to_end)
62644886 {
62894911 {
62904912 char *new_value = lt_extend_str (getenv (name), value, 0);
62914913 /* some systems can't cope with a ':'-terminated path #' */
6292 size_t len = strlen (new_value);
6293 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4914 int len = strlen (new_value);
4915 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
62944916 {
6295 new_value[--len] = '\0';
4917 new_value[len-1] = '\0';
62964918 }
62974919 lt_setenv (name, new_value);
62984920 XFREE (new_value);
64595081 # True if ARG is an import lib, as indicated by $file_magic_cmd
64605082 func_win32_import_lib_p ()
64615083 {
6462 $debug_cmd
6463
5084 $opt_debug
64645085 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
64655086 *import*) : ;;
64665087 *) false ;;
64675088 esac
64685089 }
64695090
6470 # func_suncc_cstd_abi
6471 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6472 # Several compiler flags select an ABI that is incompatible with the
6473 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6474 func_suncc_cstd_abi ()
6475 {
6476 $debug_cmd
6477
6478 case " $compile_command " in
6479 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
6480 suncc_use_cstd_abi=no
6481 ;;
6482 *)
6483 suncc_use_cstd_abi=yes
6484 ;;
6485 esac
6486 }
6487
64885091 # func_mode_link arg...
64895092 func_mode_link ()
64905093 {
6491 $debug_cmd
6492
5094 $opt_debug
64935095 case $host in
64945096 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
64955097 # It is impossible to link a dll without this setting, and
64965098 # we shouldn't force the makefile maintainer to figure out
6497 # what system we are compiling for in order to pass an extra
5099 # which system we are compiling for in order to pass an extra
64985100 # flag for every libtool invocation.
64995101 # allow_undefined=no
65005102
65015103 # FIXME: Unfortunately, there are problems with the above when trying
6502 # to make a dll that has undefined symbols, in which case not
5104 # to make a dll which has undefined symbols, in which case not
65035105 # even a static library is built. For now, we need to specify
65045106 # -no-undefined on the libtool link line when we can be certain
65055107 # that all symbols are satisfied, otherwise we get a static library.
65435145 module=no
65445146 no_install=no
65455147 objs=
6546 os2dllname=
65475148 non_pic_objects=
65485149 precious_files_regex=
65495150 prefer_static_libs=no
6550 preload=false
5151 preload=no
65515152 prev=
65525153 prevarg=
65535154 release=
65595160 vinfo=
65605161 vinfo_number=no
65615162 weak_libs=
6562 single_module=$wl-single_module
5163 single_module="${wl}-single_module"
65635164 func_infer_tag $base_compile
65645165
65655166 # We need to know -static, to get the right output filenames.
65675168 do
65685169 case $arg in
65695170 -shared)
6570 test yes != "$build_libtool_libs" \
6571 && func_fatal_configuration "cannot build a shared library"
5171 test "$build_libtool_libs" != yes && \
5172 func_fatal_configuration "can not build a shared library"
65725173 build_old_libs=no
65735174 break
65745175 ;;
65755176 -all-static | -static | -static-libtool-libs)
65765177 case $arg in
65775178 -all-static)
6578 if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
5179 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
65795180 func_warning "complete static linking is impossible in this configuration"
65805181 fi
65815182 if test -n "$link_static_flag"; then
66085209
66095210 # Go through the arguments, transforming them on the way.
66105211 while test "$#" -gt 0; do
6611 arg=$1
5212 arg="$1"
66125213 shift
66135214 func_quote_for_eval "$arg"
66145215 qarg=$func_quote_for_eval_unquoted_result
66255226
66265227 case $prev in
66275228 bindir)
6628 bindir=$arg
5229 bindir="$arg"
66295230 prev=
66305231 continue
66315232 ;;
66325233 dlfiles|dlprefiles)
6633 $preload || {
5234 if test "$preload" = no; then
66345235 # Add the symbol object into the linking commands.
66355236 func_append compile_command " @SYMFILE@"
66365237 func_append finalize_command " @SYMFILE@"
6637 preload=:
6638 }
5238 preload=yes
5239 fi
66395240 case $arg in
66405241 *.la | *.lo) ;; # We handle these cases below.
66415242 force)
6642 if test no = "$dlself"; then
5243 if test "$dlself" = no; then
66435244 dlself=needless
66445245 export_dynamic=yes
66455246 fi
66475248 continue
66485249 ;;
66495250 self)
6650 if test dlprefiles = "$prev"; then
5251 if test "$prev" = dlprefiles; then
66515252 dlself=yes
6652 elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
5253 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
66535254 dlself=yes
66545255 else
66555256 dlself=needless
66595260 continue
66605261 ;;
66615262 *)
6662 if test dlfiles = "$prev"; then
5263 if test "$prev" = dlfiles; then
66635264 func_append dlfiles " $arg"
66645265 else
66655266 func_append dlprefiles " $arg"
66705271 esac
66715272 ;;
66725273 expsyms)
6673 export_symbols=$arg
5274 export_symbols="$arg"
66745275 test -f "$arg" \
6675 || func_fatal_error "symbol file '$arg' does not exist"
5276 || func_fatal_error "symbol file \`$arg' does not exist"
66765277 prev=
66775278 continue
66785279 ;;
66795280 expsyms_regex)
6680 export_symbols_regex=$arg
5281 export_symbols_regex="$arg"
66815282 prev=
66825283 continue
66835284 ;;
66955296 continue
66965297 ;;
66975298 inst_prefix)
6698 inst_prefix_dir=$arg
6699 prev=
6700 continue
6701 ;;
6702 mllvm)
6703 # Clang does not use LLVM to link, so we can simply discard any
6704 # '-mllvm $arg' options when doing the link step.
5299 inst_prefix_dir="$arg"
67055300 prev=
67065301 continue
67075302 ;;
67255320
67265321 if test -z "$pic_object" ||
67275322 test -z "$non_pic_object" ||
6728 test none = "$pic_object" &&
6729 test none = "$non_pic_object"; then
6730 func_fatal_error "cannot find name of object for '$arg'"
5323 test "$pic_object" = none &&
5324 test "$non_pic_object" = none; then
5325 func_fatal_error "cannot find name of object for \`$arg'"
67315326 fi
67325327
67335328 # Extract subdirectory from the argument.
67345329 func_dirname "$arg" "/" ""
6735 xdir=$func_dirname_result
6736
6737 if test none != "$pic_object"; then
5330 xdir="$func_dirname_result"
5331
5332 if test "$pic_object" != none; then
67385333 # Prepend the subdirectory the object is found in.
6739 pic_object=$xdir$pic_object
6740
6741 if test dlfiles = "$prev"; then
6742 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
5334 pic_object="$xdir$pic_object"
5335
5336 if test "$prev" = dlfiles; then
5337 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
67435338 func_append dlfiles " $pic_object"
67445339 prev=
67455340 continue
67505345 fi
67515346
67525347 # CHECK ME: I think I busted this. -Ossama
6753 if test dlprefiles = "$prev"; then
5348 if test "$prev" = dlprefiles; then
67545349 # Preload the old-style object.
67555350 func_append dlprefiles " $pic_object"
67565351 prev=
67585353
67595354 # A PIC object.
67605355 func_append libobjs " $pic_object"
6761 arg=$pic_object
5356 arg="$pic_object"
67625357 fi
67635358
67645359 # Non-PIC object.
6765 if test none != "$non_pic_object"; then
5360 if test "$non_pic_object" != none; then
67665361 # Prepend the subdirectory the object is found in.
6767 non_pic_object=$xdir$non_pic_object
5362 non_pic_object="$xdir$non_pic_object"
67685363
67695364 # A standard non-PIC object
67705365 func_append non_pic_objects " $non_pic_object"
6771 if test -z "$pic_object" || test none = "$pic_object"; then
6772 arg=$non_pic_object
5366 if test -z "$pic_object" || test "$pic_object" = none ; then
5367 arg="$non_pic_object"
67735368 fi
67745369 else
67755370 # If the PIC object exists, use it instead.
67765371 # $xdir was prepended to $pic_object above.
6777 non_pic_object=$pic_object
5372 non_pic_object="$pic_object"
67785373 func_append non_pic_objects " $non_pic_object"
67795374 fi
67805375 else
67825377 if $opt_dry_run; then
67835378 # Extract subdirectory from the argument.
67845379 func_dirname "$arg" "/" ""
6785 xdir=$func_dirname_result
5380 xdir="$func_dirname_result"
67865381
67875382 func_lo2o "$arg"
67885383 pic_object=$xdir$objdir/$func_lo2o_result
67905385 func_append libobjs " $pic_object"
67915386 func_append non_pic_objects " $non_pic_object"
67925387 else
6793 func_fatal_error "'$arg' is not a valid libtool object"
5388 func_fatal_error "\`$arg' is not a valid libtool object"
67945389 fi
67955390 fi
67965391 done
67975392 else
6798 func_fatal_error "link input file '$arg' does not exist"
5393 func_fatal_error "link input file \`$arg' does not exist"
67995394 fi
68005395 arg=$save_arg
68015396 prev=
68025397 continue
68035398 ;;
6804 os2dllname)
6805 os2dllname=$arg
6806 prev=
6807 continue
6808 ;;
68095399 precious_regex)
6810 precious_files_regex=$arg
5400 precious_files_regex="$arg"
68115401 prev=
68125402 continue
68135403 ;;
68145404 release)
6815 release=-$arg
5405 release="-$arg"
68165406 prev=
68175407 continue
68185408 ;;
68245414 func_fatal_error "only absolute run-paths are allowed"
68255415 ;;
68265416 esac
6827 if test rpath = "$prev"; then
5417 if test "$prev" = rpath; then
68285418 case "$rpath " in
68295419 *" $arg "*) ;;
68305420 *) func_append rpath " $arg" ;;
68395429 continue
68405430 ;;
68415431 shrext)
6842 shrext_cmds=$arg
5432 shrext_cmds="$arg"
68435433 prev=
68445434 continue
68455435 ;;
68795469 esac
68805470 fi # test -n "$prev"
68815471
6882 prevarg=$arg
5472 prevarg="$arg"
68835473
68845474 case $arg in
68855475 -all-static)
68935483
68945484 -allow-undefined)
68955485 # FIXME: remove this flag sometime in the future.
6896 func_fatal_error "'-allow-undefined' must not be used because it is the default"
5486 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
68975487 ;;
68985488
68995489 -avoid-version)
69255515 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
69265516 func_fatal_error "more than one -exported-symbols argument is not allowed"
69275517 fi
6928 if test X-export-symbols = "X$arg"; then
5518 if test "X$arg" = "X-export-symbols"; then
69295519 prev=expsyms
69305520 else
69315521 prev=expsyms_regex
69595549 func_stripname "-L" '' "$arg"
69605550 if test -z "$func_stripname_result"; then
69615551 if test "$#" -gt 0; then
6962 func_fatal_error "require no space between '-L' and '$1'"
5552 func_fatal_error "require no space between \`-L' and \`$1'"
69635553 else
6964 func_fatal_error "need path for '-L' option"
5554 func_fatal_error "need path for \`-L' option"
69655555 fi
69665556 fi
69675557 func_resolve_sysroot "$func_stripname_result"
69725562 *)
69735563 absdir=`cd "$dir" && pwd`
69745564 test -z "$absdir" && \
6975 func_fatal_error "cannot determine absolute directory name of '$dir'"
6976 dir=$absdir
5565 func_fatal_error "cannot determine absolute directory name of \`$dir'"
5566 dir="$absdir"
69775567 ;;
69785568 esac
69795569 case "$deplibs " in
70085598 ;;
70095599
70105600 -l*)
7011 if test X-lc = "X$arg" || test X-lm = "X$arg"; then
5601 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
70125602 case $host in
70135603 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
70145604 # These systems don't actually have a C or math library (as such)
70165606 ;;
70175607 *-*-os2*)
70185608 # These systems don't actually have a C library (as such)
7019 test X-lc = "X$arg" && continue
5609 test "X$arg" = "X-lc" && continue
70205610 ;;
7021 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
5611 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
70225612 # Do not include libc due to us having libc/libc_r.
7023 test X-lc = "X$arg" && continue
5613 test "X$arg" = "X-lc" && continue
70245614 ;;
70255615 *-*-rhapsody* | *-*-darwin1.[012])
70265616 # Rhapsody C and math libraries are in the System framework
70295619 ;;
70305620 *-*-sco3.2v5* | *-*-sco5v6*)
70315621 # Causes problems with __ctype
7032 test X-lc = "X$arg" && continue
5622 test "X$arg" = "X-lc" && continue
70335623 ;;
70345624 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
70355625 # Compiler inserts libc in the correct place for threads to work
7036 test X-lc = "X$arg" && continue
5626 test "X$arg" = "X-lc" && continue
70375627 ;;
70385628 esac
7039 elif test X-lc_r = "X$arg"; then
5629 elif test "X$arg" = "X-lc_r"; then
70405630 case $host in
7041 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
5631 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
70425632 # Do not include libc_r directly, use -pthread flag.
70435633 continue
70445634 ;;
70455635 esac
70465636 fi
70475637 func_append deplibs " $arg"
7048 continue
7049 ;;
7050
7051 -mllvm)
7052 prev=mllvm
70535638 continue
70545639 ;;
70555640
70825667 ;;
70835668
70845669 -multi_module)
7085 single_module=$wl-multi_module
5670 single_module="${wl}-multi_module"
70865671 continue
70875672 ;;
70885673
70965681 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
70975682 # The PATH hackery in wrapper scripts is required on Windows
70985683 # and Darwin in order for the loader to find any dlls it needs.
7099 func_warning "'-no-install' is ignored for $host"
7100 func_warning "assuming '-no-fast-install' instead"
5684 func_warning "\`-no-install' is ignored for $host"
5685 func_warning "assuming \`-no-fast-install' instead"
71015686 fast_install=no
71025687 ;;
71035688 *) no_install=yes ;;
71125697
71135698 -objectlist)
71145699 prev=objectlist
7115 continue
7116 ;;
7117
7118 -os2dllname)
7119 prev=os2dllname
71205700 continue
71215701 ;;
71225702
72075787 func_stripname '-Wc,' '' "$arg"
72085788 args=$func_stripname_result
72095789 arg=
7210 save_ifs=$IFS; IFS=,
5790 save_ifs="$IFS"; IFS=','
72115791 for flag in $args; do
7212 IFS=$save_ifs
5792 IFS="$save_ifs"
72135793 func_quote_for_eval "$flag"
72145794 func_append arg " $func_quote_for_eval_result"
72155795 func_append compiler_flags " $func_quote_for_eval_result"
72165796 done
7217 IFS=$save_ifs
5797 IFS="$save_ifs"
72185798 func_stripname ' ' '' "$arg"
72195799 arg=$func_stripname_result
72205800 ;;
72235803 func_stripname '-Wl,' '' "$arg"
72245804 args=$func_stripname_result
72255805 arg=
7226 save_ifs=$IFS; IFS=,
5806 save_ifs="$IFS"; IFS=','
72275807 for flag in $args; do
7228 IFS=$save_ifs
5808 IFS="$save_ifs"
72295809 func_quote_for_eval "$flag"
72305810 func_append arg " $wl$func_quote_for_eval_result"
72315811 func_append compiler_flags " $wl$func_quote_for_eval_result"
72325812 func_append linker_flags " $func_quote_for_eval_result"
72335813 done
7234 IFS=$save_ifs
5814 IFS="$save_ifs"
72355815 func_stripname ' ' '' "$arg"
72365816 arg=$func_stripname_result
72375817 ;;
72545834 # -msg_* for osf cc
72555835 -msg_*)
72565836 func_quote_for_eval "$arg"
7257 arg=$func_quote_for_eval_result
5837 arg="$func_quote_for_eval_result"
72585838 ;;
72595839
72605840 # Flags to be passed through unchanged, with rationale:
72665846 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
72675847 # -F/path path to uninstalled frameworks, gcc on darwin
72685848 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7269 # -fstack-protector* stack protector flags for GCC
72705849 # @file GCC response files
72715850 # -tp=* Portland pgcc target processor selection
72725851 # --sysroot=* for sysroot support
7273 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7274 # -stdlib=* select c++ std lib with clang
5852 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
72755853 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
72765854 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7277 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
5855 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
72785856 func_quote_for_eval "$arg"
7279 arg=$func_quote_for_eval_result
5857 arg="$func_quote_for_eval_result"
72805858 func_append compile_command " $arg"
72815859 func_append finalize_command " $arg"
72825860 func_append compiler_flags " $arg"
72835861 continue
72845862 ;;
72855863
7286 -Z*)
7287 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7288 # OS/2 uses -Zxxx to specify OS/2-specific options
7289 compiler_flags="$compiler_flags $arg"
7290 func_append compile_command " $arg"
7291 func_append finalize_command " $arg"
7292 case $arg in
7293 -Zlinker | -Zstack)
7294 prev=xcompiler
7295 ;;
7296 esac
7297 continue
7298 else
7299 # Otherwise treat like 'Some other compiler flag' below
7300 func_quote_for_eval "$arg"
7301 arg=$func_quote_for_eval_result
7302 fi
7303 ;;
7304
73055864 # Some other compiler flag.
73065865 -* | +*)
73075866 func_quote_for_eval "$arg"
7308 arg=$func_quote_for_eval_result
5867 arg="$func_quote_for_eval_result"
73095868 ;;
73105869
73115870 *.$objext)
73265885
73275886 if test -z "$pic_object" ||
73285887 test -z "$non_pic_object" ||
7329 test none = "$pic_object" &&
7330 test none = "$non_pic_object"; then
7331 func_fatal_error "cannot find name of object for '$arg'"
5888 test "$pic_object" = none &&
5889 test "$non_pic_object" = none; then
5890 func_fatal_error "cannot find name of object for \`$arg'"
73325891 fi
73335892
73345893 # Extract subdirectory from the argument.
73355894 func_dirname "$arg" "/" ""
7336 xdir=$func_dirname_result
7337
7338 test none = "$pic_object" || {
5895 xdir="$func_dirname_result"
5896
5897 if test "$pic_object" != none; then
73395898 # Prepend the subdirectory the object is found in.
7340 pic_object=$xdir$pic_object
7341
7342 if test dlfiles = "$prev"; then
7343 if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
5899 pic_object="$xdir$pic_object"
5900
5901 if test "$prev" = dlfiles; then
5902 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
73445903 func_append dlfiles " $pic_object"
73455904 prev=
73465905 continue
73515910 fi
73525911
73535912 # CHECK ME: I think I busted this. -Ossama
7354 if test dlprefiles = "$prev"; then
5913 if test "$prev" = dlprefiles; then
73555914 # Preload the old-style object.
73565915 func_append dlprefiles " $pic_object"
73575916 prev=
73595918
73605919 # A PIC object.
73615920 func_append libobjs " $pic_object"
7362 arg=$pic_object
7363 }
5921 arg="$pic_object"
5922 fi
73645923
73655924 # Non-PIC object.
7366 if test none != "$non_pic_object"; then
5925 if test "$non_pic_object" != none; then
73675926 # Prepend the subdirectory the object is found in.
7368 non_pic_object=$xdir$non_pic_object
5927 non_pic_object="$xdir$non_pic_object"
73695928
73705929 # A standard non-PIC object
73715930 func_append non_pic_objects " $non_pic_object"
7372 if test -z "$pic_object" || test none = "$pic_object"; then
7373 arg=$non_pic_object
5931 if test -z "$pic_object" || test "$pic_object" = none ; then
5932 arg="$non_pic_object"
73745933 fi
73755934 else
73765935 # If the PIC object exists, use it instead.
73775936 # $xdir was prepended to $pic_object above.
7378 non_pic_object=$pic_object
5937 non_pic_object="$pic_object"
73795938 func_append non_pic_objects " $non_pic_object"
73805939 fi
73815940 else
73835942 if $opt_dry_run; then
73845943 # Extract subdirectory from the argument.
73855944 func_dirname "$arg" "/" ""
7386 xdir=$func_dirname_result
5945 xdir="$func_dirname_result"
73875946
73885947 func_lo2o "$arg"
73895948 pic_object=$xdir$objdir/$func_lo2o_result
73915950 func_append libobjs " $pic_object"
73925951 func_append non_pic_objects " $non_pic_object"
73935952 else
7394 func_fatal_error "'$arg' is not a valid libtool object"
5953 func_fatal_error "\`$arg' is not a valid libtool object"
73955954 fi
73965955 fi
73975956 ;;
74075966 # A libtool-controlled library.
74085967
74095968 func_resolve_sysroot "$arg"
7410 if test dlfiles = "$prev"; then
5969 if test "$prev" = dlfiles; then
74115970 # This library was specified with -dlopen.
74125971 func_append dlfiles " $func_resolve_sysroot_result"
74135972 prev=
7414 elif test dlprefiles = "$prev"; then
5973 elif test "$prev" = dlprefiles; then
74155974 # The library was specified with -dlpreopen.
74165975 func_append dlprefiles " $func_resolve_sysroot_result"
74175976 prev=
74265985 # Unknown arguments in both finalize_command and compile_command need
74275986 # to be aesthetically quoted because they are evaled later.
74285987 func_quote_for_eval "$arg"
7429 arg=$func_quote_for_eval_result
5988 arg="$func_quote_for_eval_result"
74305989 ;;
74315990 esac # arg
74325991
74385997 done # argument parsing loop
74395998
74405999 test -n "$prev" && \
7441 func_fatal_help "the '$prevarg' option requires an argument"
7442
7443 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
6000 func_fatal_help "the \`$prevarg' option requires an argument"
6001
6002 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
74446003 eval arg=\"$export_dynamic_flag_spec\"
74456004 func_append compile_command " $arg"
74466005 func_append finalize_command " $arg"
74496008 oldlibs=
74506009 # calculate the name of the file, without its directory
74516010 func_basename "$output"
7452 outputname=$func_basename_result
7453 libobjs_save=$libobjs
6011 outputname="$func_basename_result"
6012 libobjs_save="$libobjs"
74546013
74556014 if test -n "$shlibpath_var"; then
74566015 # get the directories listed in $shlibpath_var
7457 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
6016 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
74586017 else
74596018 shlib_search_path=
74606019 fi
74616020 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
74626021 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
74636022
7464 # Definition is injected by LT_CONFIG during libtool generation.
7465 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7466
74676023 func_dirname "$output" "/" ""
7468 output_objdir=$func_dirname_result$objdir
6024 output_objdir="$func_dirname_result$objdir"
74696025 func_to_tool_file "$output_objdir/"
74706026 tool_output_objdir=$func_to_tool_file_result
74716027 # Create the object directory.
74886044 # Find all interdependent deplibs by searching for libraries
74896045 # that are linked more than once (e.g. -la -lb -la)
74906046 for deplib in $deplibs; do
7491 if $opt_preserve_dup_deps; then
6047 if $opt_preserve_dup_deps ; then
74926048 case "$libs " in
74936049 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
74946050 esac
74966052 func_append libs " $deplib"
74976053 done
74986054
7499 if test lib = "$linkmode"; then
6055 if test "$linkmode" = lib; then
75006056 libs="$predeps $libs $compiler_lib_search_path $postdeps"
75016057
75026058 # Compute libraries that are listed more than once in $predeps
75286084 case $file in
75296085 *.la) ;;
75306086 *)
7531 func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
6087 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
75326088 ;;
75336089 esac
75346090 done
75366092 prog)
75376093 compile_deplibs=
75386094 finalize_deplibs=
7539 alldeplibs=false
6095 alldeplibs=no
75406096 newdlfiles=
75416097 newdlprefiles=
75426098 passes="conv scan dlopen dlpreopen link"
75486104 for pass in $passes; do
75496105 # The preopen pass in lib mode reverses $deplibs; put it back here
75506106 # so that -L comes before libs that need it for instance...
7551 if test lib,link = "$linkmode,$pass"; then
6107 if test "$linkmode,$pass" = "lib,link"; then
75526108 ## FIXME: Find the place where the list is rebuilt in the wrong
75536109 ## order, and fix it there properly
75546110 tmp_deplibs=
75556111 for deplib in $deplibs; do
75566112 tmp_deplibs="$deplib $tmp_deplibs"
75576113 done
7558 deplibs=$tmp_deplibs
6114 deplibs="$tmp_deplibs"
75596115 fi
75606116
7561 if test lib,link = "$linkmode,$pass" ||
7562 test prog,scan = "$linkmode,$pass"; then
7563 libs=$deplibs
6117 if test "$linkmode,$pass" = "lib,link" ||
6118 test "$linkmode,$pass" = "prog,scan"; then
6119 libs="$deplibs"
75646120 deplibs=
75656121 fi
7566 if test prog = "$linkmode"; then
6122 if test "$linkmode" = prog; then
75676123 case $pass in
7568 dlopen) libs=$dlfiles ;;
7569 dlpreopen) libs=$dlprefiles ;;
7570 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6124 dlopen) libs="$dlfiles" ;;
6125 dlpreopen) libs="$dlprefiles" ;;
6126 link)
6127 libs="$deplibs %DEPLIBS%"
6128 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
6129 ;;
75716130 esac
75726131 fi
7573 if test lib,dlpreopen = "$linkmode,$pass"; then
6132 if test "$linkmode,$pass" = "lib,dlpreopen"; then
75746133 # Collect and forward deplibs of preopened libtool libs
75756134 for lib in $dlprefiles; do
75766135 # Ignore non-libtool-libs
75916150 esac
75926151 done
75936152 done
7594 libs=$dlprefiles
6153 libs="$dlprefiles"
75956154 fi
7596 if test dlopen = "$pass"; then
6155 if test "$pass" = dlopen; then
75976156 # Collect dlpreopened libraries
7598 save_deplibs=$deplibs
6157 save_deplibs="$deplibs"
75996158 deplibs=
76006159 fi
76016160
76026161 for deplib in $libs; do
76036162 lib=
7604 found=false
6163 found=no
76056164 case $deplib in
76066165 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
76076166 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7608 if test prog,link = "$linkmode,$pass"; then
6167 if test "$linkmode,$pass" = "prog,link"; then
76096168 compile_deplibs="$deplib $compile_deplibs"
76106169 finalize_deplibs="$deplib $finalize_deplibs"
76116170 else
76126171 func_append compiler_flags " $deplib"
7613 if test lib = "$linkmode"; then
6172 if test "$linkmode" = lib ; then
76146173 case "$new_inherited_linker_flags " in
76156174 *" $deplib "*) ;;
76166175 * ) func_append new_inherited_linker_flags " $deplib" ;;
76206179 continue
76216180 ;;
76226181 -l*)
7623 if test lib != "$linkmode" && test prog != "$linkmode"; then
7624 func_warning "'-l' is ignored for archives/objects"
6182 if test "$linkmode" != lib && test "$linkmode" != prog; then
6183 func_warning "\`-l' is ignored for archives/objects"
76256184 continue
76266185 fi
76276186 func_stripname '-l' '' "$deplib"
76286187 name=$func_stripname_result
7629 if test lib = "$linkmode"; then
6188 if test "$linkmode" = lib; then
76306189 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
76316190 else
76326191 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
76346193 for searchdir in $searchdirs; do
76356194 for search_ext in .la $std_shrext .so .a; do
76366195 # Search the libtool library
7637 lib=$searchdir/lib$name$search_ext
6196 lib="$searchdir/lib${name}${search_ext}"
76386197 if test -f "$lib"; then
7639 if test .la = "$search_ext"; then
7640 found=:
6198 if test "$search_ext" = ".la"; then
6199 found=yes
76416200 else
7642 found=false
6201 found=no
76436202 fi
76446203 break 2
76456204 fi
76466205 done
76476206 done
7648 if $found; then
7649 # deplib is a libtool library
6207 if test "$found" != yes; then
6208 # deplib doesn't seem to be a libtool library
6209 if test "$linkmode,$pass" = "prog,link"; then
6210 compile_deplibs="$deplib $compile_deplibs"
6211 finalize_deplibs="$deplib $finalize_deplibs"
6212 else
6213 deplibs="$deplib $deplibs"
6214 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6215 fi
6216 continue
6217 else # deplib is a libtool library
76506218 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
76516219 # We need to do some special things here, and not later.
7652 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6220 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
76536221 case " $predeps $postdeps " in
76546222 *" $deplib "*)
76556223 if func_lalib_p "$lib"; then
76576225 old_library=
76586226 func_source "$lib"
76596227 for l in $old_library $library_names; do
7660 ll=$l
6228 ll="$l"
76616229 done
7662 if test "X$ll" = "X$old_library"; then # only static version available
7663 found=false
6230 if test "X$ll" = "X$old_library" ; then # only static version available
6231 found=no
76646232 func_dirname "$lib" "" "."
7665 ladir=$func_dirname_result
6233 ladir="$func_dirname_result"
76666234 lib=$ladir/$old_library
7667 if test prog,link = "$linkmode,$pass"; then
6235 if test "$linkmode,$pass" = "prog,link"; then
76686236 compile_deplibs="$deplib $compile_deplibs"
76696237 finalize_deplibs="$deplib $finalize_deplibs"
76706238 else
76716239 deplibs="$deplib $deplibs"
7672 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
6240 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
76736241 fi
76746242 continue
76756243 fi
76786246 *) ;;
76796247 esac
76806248 fi
7681 else
7682 # deplib doesn't seem to be a libtool library
7683 if test prog,link = "$linkmode,$pass"; then
7684 compile_deplibs="$deplib $compile_deplibs"
7685 finalize_deplibs="$deplib $finalize_deplibs"
7686 else
7687 deplibs="$deplib $deplibs"
7688 test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7689 fi
7690 continue
76916249 fi
76926250 ;; # -l
76936251 *.ltframework)
7694 if test prog,link = "$linkmode,$pass"; then
6252 if test "$linkmode,$pass" = "prog,link"; then
76956253 compile_deplibs="$deplib $compile_deplibs"
76966254 finalize_deplibs="$deplib $finalize_deplibs"
76976255 else
76986256 deplibs="$deplib $deplibs"
7699 if test lib = "$linkmode"; then
6257 if test "$linkmode" = lib ; then
77006258 case "$new_inherited_linker_flags " in
77016259 *" $deplib "*) ;;
77026260 * ) func_append new_inherited_linker_flags " $deplib" ;;
77096267 case $linkmode in
77106268 lib)
77116269 deplibs="$deplib $deplibs"
7712 test conv = "$pass" && continue
6270 test "$pass" = conv && continue
77136271 newdependency_libs="$deplib $newdependency_libs"
77146272 func_stripname '-L' '' "$deplib"
77156273 func_resolve_sysroot "$func_stripname_result"
77166274 func_append newlib_search_path " $func_resolve_sysroot_result"
77176275 ;;
77186276 prog)
7719 if test conv = "$pass"; then
6277 if test "$pass" = conv; then
77206278 deplibs="$deplib $deplibs"
77216279 continue
77226280 fi
7723 if test scan = "$pass"; then
6281 if test "$pass" = scan; then
77246282 deplibs="$deplib $deplibs"
77256283 else
77266284 compile_deplibs="$deplib $compile_deplibs"
77316289 func_append newlib_search_path " $func_resolve_sysroot_result"
77326290 ;;
77336291 *)
7734 func_warning "'-L' is ignored for archives/objects"
6292 func_warning "\`-L' is ignored for archives/objects"
77356293 ;;
77366294 esac # linkmode
77376295 continue
77386296 ;; # -L
77396297 -R*)
7740 if test link = "$pass"; then
6298 if test "$pass" = link; then
77416299 func_stripname '-R' '' "$deplib"
77426300 func_resolve_sysroot "$func_stripname_result"
77436301 dir=$func_resolve_sysroot_result
77556313 lib=$func_resolve_sysroot_result
77566314 ;;
77576315 *.$libext)
7758 if test conv = "$pass"; then
6316 if test "$pass" = conv; then
77596317 deplibs="$deplib $deplibs"
77606318 continue
77616319 fi
77666324 case " $dlpreconveniencelibs " in
77676325 *" $deplib "*) ;;
77686326 *)
7769 valid_a_lib=false
6327 valid_a_lib=no
77706328 case $deplibs_check_method in
77716329 match_pattern*)
77726330 set dummy $deplibs_check_method; shift
77736331 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
77746332 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
77756333 | $EGREP "$match_pattern_regex" > /dev/null; then
7776 valid_a_lib=:
6334 valid_a_lib=yes
77776335 fi
77786336 ;;
77796337 pass_all)
7780 valid_a_lib=:
6338 valid_a_lib=yes
77816339 ;;
77826340 esac
7783 if $valid_a_lib; then
7784 echo
7785 $ECHO "*** Warning: Linking the shared library $output against the"
7786 $ECHO "*** static library $deplib is not portable!"
7787 deplibs="$deplib $deplibs"
7788 else
6341 if test "$valid_a_lib" != yes; then
77896342 echo
77906343 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
77916344 echo "*** I have the capability to make that library automatically link in when"
77936346 echo "*** shared version of the library, which you do not appear to have"
77946347 echo "*** because the file extensions .$libext of this argument makes me believe"
77956348 echo "*** that it is just a static archive that I should not use here."
6349 else
6350 echo
6351 $ECHO "*** Warning: Linking the shared library $output against the"
6352 $ECHO "*** static library $deplib is not portable!"
6353 deplibs="$deplib $deplibs"
77966354 fi
77976355 ;;
77986356 esac
77996357 continue
78006358 ;;
78016359 prog)
7802 if test link != "$pass"; then
6360 if test "$pass" != link; then
78036361 deplibs="$deplib $deplibs"
78046362 else
78056363 compile_deplibs="$deplib $compile_deplibs"
78106368 esac # linkmode
78116369 ;; # *.$libext
78126370 *.lo | *.$objext)
7813 if test conv = "$pass"; then
6371 if test "$pass" = conv; then
78146372 deplibs="$deplib $deplibs"
7815 elif test prog = "$linkmode"; then
7816 if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
6373 elif test "$linkmode" = prog; then
6374 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
78176375 # If there is no dlopen support or we're linking statically,
78186376 # we need to preload.
78196377 func_append newdlprefiles " $deplib"
78266384 continue
78276385 ;;
78286386 %DEPLIBS%)
7829 alldeplibs=:
6387 alldeplibs=yes
78306388 continue
78316389 ;;
78326390 esac # case $deplib
78336391
7834 $found || test -f "$lib" \
7835 || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
6392 if test "$found" = yes || test -f "$lib"; then :
6393 else
6394 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6395 fi
78366396
78376397 # Check to see that this really is a libtool archive.
78386398 func_lalib_unsafe_p "$lib" \
7839 || func_fatal_error "'$lib' is not a valid libtool archive"
6399 || func_fatal_error "\`$lib' is not a valid libtool archive"
78406400
78416401 func_dirname "$lib" "" "."
7842 ladir=$func_dirname_result
6402 ladir="$func_dirname_result"
78436403
78446404 dlname=
78456405 dlopen=
78696429 done
78706430 fi
78716431 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7872 if test lib,link = "$linkmode,$pass" ||
7873 test prog,scan = "$linkmode,$pass" ||
7874 { test prog != "$linkmode" && test lib != "$linkmode"; }; then
6432 if test "$linkmode,$pass" = "lib,link" ||
6433 test "$linkmode,$pass" = "prog,scan" ||
6434 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
78756435 test -n "$dlopen" && func_append dlfiles " $dlopen"
78766436 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
78776437 fi
78786438
7879 if test conv = "$pass"; then
6439 if test "$pass" = conv; then
78806440 # Only check for convenience libraries
78816441 deplibs="$lib $deplibs"
78826442 if test -z "$libdir"; then
78836443 if test -z "$old_library"; then
7884 func_fatal_error "cannot find name of link library for '$lib'"
6444 func_fatal_error "cannot find name of link library for \`$lib'"
78856445 fi
78866446 # It is a libtool convenience library, so add in its objects.
78876447 func_append convenience " $ladir/$objdir/$old_library"
78886448 func_append old_convenience " $ladir/$objdir/$old_library"
7889 elif test prog != "$linkmode" && test lib != "$linkmode"; then
7890 func_fatal_error "'$lib' is not a convenience library"
6449 tmp_libs=
6450 for deplib in $dependency_libs; do
6451 deplibs="$deplib $deplibs"
6452 if $opt_preserve_dup_deps ; then
6453 case "$tmp_libs " in
6454 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6455 esac
6456 fi
6457 func_append tmp_libs " $deplib"
6458 done
6459 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6460 func_fatal_error "\`$lib' is not a convenience library"
78916461 fi
7892 tmp_libs=
7893 for deplib in $dependency_libs; do
7894 deplibs="$deplib $deplibs"
7895 if $opt_preserve_dup_deps; then
7896 case "$tmp_libs " in
7897 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7898 esac
7899 fi
7900 func_append tmp_libs " $deplib"
7901 done
79026462 continue
79036463 fi # $pass = conv
79046464
79066466 # Get the name of the library we link against.
79076467 linklib=
79086468 if test -n "$old_library" &&
7909 { test yes = "$prefer_static_libs" ||
7910 test built,no = "$prefer_static_libs,$installed"; }; then
6469 { test "$prefer_static_libs" = yes ||
6470 test "$prefer_static_libs,$installed" = "built,no"; }; then
79116471 linklib=$old_library
79126472 else
79136473 for l in $old_library $library_names; do
7914 linklib=$l
6474 linklib="$l"
79156475 done
79166476 fi
79176477 if test -z "$linklib"; then
7918 func_fatal_error "cannot find name of link library for '$lib'"
6478 func_fatal_error "cannot find name of link library for \`$lib'"
79196479 fi
79206480
79216481 # This library was specified with -dlopen.
7922 if test dlopen = "$pass"; then
7923 test -z "$libdir" \
7924 && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
6482 if test "$pass" = dlopen; then
6483 if test -z "$libdir"; then
6484 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6485 fi
79256486 if test -z "$dlname" ||
7926 test yes != "$dlopen_support" ||
7927 test no = "$build_libtool_libs"
7928 then
6487 test "$dlopen_support" != yes ||
6488 test "$build_libtool_libs" = no; then
79296489 # If there is no dlname, no dlopen support or we're linking
79306490 # statically, we need to preload. We also need to preload any
79316491 # dependent libraries so libltdl's deplib preloader doesn't
79396499
79406500 # We need an absolute path.
79416501 case $ladir in
7942 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
6502 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
79436503 *)
79446504 abs_ladir=`cd "$ladir" && pwd`
79456505 if test -z "$abs_ladir"; then
7946 func_warning "cannot determine absolute directory name of '$ladir'"
6506 func_warning "cannot determine absolute directory name of \`$ladir'"
79476507 func_warning "passing it literally to the linker, although it might fail"
7948 abs_ladir=$ladir
6508 abs_ladir="$ladir"
79496509 fi
79506510 ;;
79516511 esac
79526512 func_basename "$lib"
7953 laname=$func_basename_result
6513 laname="$func_basename_result"
79546514
79556515 # Find the relevant object directory and library name.
7956 if test yes = "$installed"; then
6516 if test "X$installed" = Xyes; then
79576517 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7958 func_warning "library '$lib' was moved."
7959 dir=$ladir
7960 absdir=$abs_ladir
7961 libdir=$abs_ladir
6518 func_warning "library \`$lib' was moved."
6519 dir="$ladir"
6520 absdir="$abs_ladir"
6521 libdir="$abs_ladir"
79626522 else
7963 dir=$lt_sysroot$libdir
7964 absdir=$lt_sysroot$libdir
6523 dir="$lt_sysroot$libdir"
6524 absdir="$lt_sysroot$libdir"
79656525 fi
7966 test yes = "$hardcode_automatic" && avoidtemprpath=yes
6526 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
79676527 else
79686528 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7969 dir=$ladir
7970 absdir=$abs_ladir
6529 dir="$ladir"
6530 absdir="$abs_ladir"
79716531 # Remove this search path later
79726532 func_append notinst_path " $abs_ladir"
79736533 else
7974 dir=$ladir/$objdir
7975 absdir=$abs_ladir/$objdir
6534 dir="$ladir/$objdir"
6535 absdir="$abs_ladir/$objdir"
79766536 # Remove this search path later
79776537 func_append notinst_path " $abs_ladir"
79786538 fi
79816541 name=$func_stripname_result
79826542
79836543 # This library was specified with -dlpreopen.
7984 if test dlpreopen = "$pass"; then
7985 if test -z "$libdir" && test prog = "$linkmode"; then
7986 func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
6544 if test "$pass" = dlpreopen; then
6545 if test -z "$libdir" && test "$linkmode" = prog; then
6546 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
79876547 fi
7988 case $host in
6548 case "$host" in
79896549 # special handling for platforms with PE-DLLs.
79906550 *cygwin* | *mingw* | *cegcc* )
79916551 # Linker will automatically link against shared library if both
80296589
80306590 if test -z "$libdir"; then
80316591 # Link the convenience library
8032 if test lib = "$linkmode"; then
6592 if test "$linkmode" = lib; then
80336593 deplibs="$dir/$old_library $deplibs"
8034 elif test prog,link = "$linkmode,$pass"; then
6594 elif test "$linkmode,$pass" = "prog,link"; then
80356595 compile_deplibs="$dir/$old_library $compile_deplibs"
80366596 finalize_deplibs="$dir/$old_library $finalize_deplibs"
80376597 else
80416601 fi
80426602
80436603
8044 if test prog = "$linkmode" && test link != "$pass"; then
6604 if test "$linkmode" = prog && test "$pass" != link; then
80456605 func_append newlib_search_path " $ladir"
80466606 deplibs="$lib $deplibs"
80476607
8048 linkalldeplibs=false
8049 if test no != "$link_all_deplibs" || test -z "$library_names" ||
8050 test no = "$build_libtool_libs"; then
8051 linkalldeplibs=:
6608 linkalldeplibs=no
6609 if test "$link_all_deplibs" != no || test -z "$library_names" ||
6610 test "$build_libtool_libs" = no; then
6611 linkalldeplibs=yes
80526612 fi
80536613
80546614 tmp_libs=
80606620 ;;
80616621 esac
80626622 # Need to link against all dependency_libs?
8063 if $linkalldeplibs; then
6623 if test "$linkalldeplibs" = yes; then
80646624 deplibs="$deplib $deplibs"
80656625 else
80666626 # Need to hardcode shared library paths
80676627 # or/and link against static libraries
80686628 newdependency_libs="$deplib $newdependency_libs"
80696629 fi
8070 if $opt_preserve_dup_deps; then
6630 if $opt_preserve_dup_deps ; then
80716631 case "$tmp_libs " in
80726632 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
80736633 esac
80776637 continue
80786638 fi # $linkmode = prog...
80796639
8080 if test prog,link = "$linkmode,$pass"; then
6640 if test "$linkmode,$pass" = "prog,link"; then
80816641 if test -n "$library_names" &&
8082 { { test no = "$prefer_static_libs" ||
8083 test built,yes = "$prefer_static_libs,$installed"; } ||
6642 { { test "$prefer_static_libs" = no ||
6643 test "$prefer_static_libs,$installed" = "built,yes"; } ||
80846644 test -z "$old_library"; }; then
80856645 # We need to hardcode the library path
8086 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
6646 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
80876647 # Make sure the rpath contains only unique directories.
8088 case $temp_rpath: in
6648 case "$temp_rpath:" in
80896649 *"$absdir:"*) ;;
80906650 *) func_append temp_rpath "$absdir:" ;;
80916651 esac
81146674 esac
81156675 fi # $linkmode,$pass = prog,link...
81166676
8117 if $alldeplibs &&
8118 { test pass_all = "$deplibs_check_method" ||
8119 { test yes = "$build_libtool_libs" &&
6677 if test "$alldeplibs" = yes &&
6678 { test "$deplibs_check_method" = pass_all ||
6679 { test "$build_libtool_libs" = yes &&
81206680 test -n "$library_names"; }; }; then
81216681 # We only need to search for static libraries
81226682 continue
81256685
81266686 link_static=no # Whether the deplib will be linked statically
81276687 use_static_libs=$prefer_static_libs
8128 if test built = "$use_static_libs" && test yes = "$installed"; then
6688 if test "$use_static_libs" = built && test "$installed" = yes; then
81296689 use_static_libs=no
81306690 fi
81316691 if test -n "$library_names" &&
8132 { test no = "$use_static_libs" || test -z "$old_library"; }; then
6692 { test "$use_static_libs" = no || test -z "$old_library"; }; then
81336693 case $host in
8134 *cygwin* | *mingw* | *cegcc* | *os2*)
6694 *cygwin* | *mingw* | *cegcc*)
81356695 # No point in relinking DLLs because paths are not encoded
81366696 func_append notinst_deplibs " $lib"
81376697 need_relink=no
81386698 ;;
81396699 *)
8140 if test no = "$installed"; then
6700 if test "$installed" = no; then
81416701 func_append notinst_deplibs " $lib"
81426702 need_relink=yes
81436703 fi
81476707
81486708 # Warn about portability, can't link against -module's on some
81496709 # systems (darwin). Don't bleat about dlopened modules though!
8150 dlopenmodule=
6710 dlopenmodule=""
81516711 for dlpremoduletest in $dlprefiles; do
81526712 if test "X$dlpremoduletest" = "X$lib"; then
8153 dlopenmodule=$dlpremoduletest
6713 dlopenmodule="$dlpremoduletest"
81546714 break
81556715 fi
81566716 done
8157 if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
6717 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
81586718 echo
8159 if test prog = "$linkmode"; then
6719 if test "$linkmode" = prog; then
81606720 $ECHO "*** Warning: Linking the executable $output against the loadable module"
81616721 else
81626722 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
81636723 fi
81646724 $ECHO "*** $linklib is not portable!"
81656725 fi
8166 if test lib = "$linkmode" &&
8167 test yes = "$hardcode_into_libs"; then
6726 if test "$linkmode" = lib &&
6727 test "$hardcode_into_libs" = yes; then
81686728 # Hardcode the library path.
81696729 # Skip directories that are in the system default run-time
81706730 # search path.
81926752 # figure out the soname
81936753 set dummy $library_names
81946754 shift
8195 realname=$1
6755 realname="$1"
81966756 shift
81976757 libname=`eval "\\$ECHO \"$libname_spec\""`
81986758 # use dlname if we got it. it's perfectly good, no?
81996759 if test -n "$dlname"; then
8200 soname=$dlname
6760 soname="$dlname"
82016761 elif test -n "$soname_spec"; then
82026762 # bleh windows
82036763 case $host in
8204 *cygwin* | mingw* | *cegcc* | *os2*)
6764 *cygwin* | mingw* | *cegcc*)
82056765 func_arith $current - $age
82066766 major=$func_arith_result
8207 versuffix=-$major
6767 versuffix="-$major"
82086768 ;;
82096769 esac
82106770 eval soname=\"$soname_spec\"
82116771 else
8212 soname=$realname
6772 soname="$realname"
82136773 fi
82146774
82156775 # Make a new name for the extract_expsyms_cmds to use
8216 soroot=$soname
6776 soroot="$soname"
82176777 func_basename "$soroot"
8218 soname=$func_basename_result
6778 soname="$func_basename_result"
82196779 func_stripname 'lib' '.dll' "$soname"
82206780 newlib=libimp-$func_stripname_result.a
82216781
82226782 # If the library has no export list, then create one now
82236783 if test -f "$output_objdir/$soname-def"; then :
82246784 else
8225 func_verbose "extracting exported symbol list from '$soname'"
6785 func_verbose "extracting exported symbol list from \`$soname'"
82266786 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
82276787 fi
82286788
82296789 # Create $newlib
82306790 if test -f "$output_objdir/$newlib"; then :; else
8231 func_verbose "generating import library for '$soname'"
6791 func_verbose "generating import library for \`$soname'"
82326792 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
82336793 fi
82346794 # make sure the library variables are pointing to the new library
82366796 linklib=$newlib
82376797 fi # test -n "$old_archive_from_expsyms_cmds"
82386798
8239 if test prog = "$linkmode" || test relink != "$opt_mode"; then
6799 if test "$linkmode" = prog || test "$opt_mode" != relink; then
82406800 add_shlibpath=
82416801 add_dir=
82426802 add=
82436803 lib_linked=yes
82446804 case $hardcode_action in
82456805 immediate | unsupported)
8246 if test no = "$hardcode_direct"; then
8247 add=$dir/$linklib
6806 if test "$hardcode_direct" = no; then
6807 add="$dir/$linklib"
82486808 case $host in
8249 *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
8250 *-*-sysv4*uw2*) add_dir=-L$dir ;;
6809 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6810 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
82516811 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8252 *-*-unixware7*) add_dir=-L$dir ;;
6812 *-*-unixware7*) add_dir="-L$dir" ;;
82536813 *-*-darwin* )
8254 # if the lib is a (non-dlopened) module then we cannot
6814 # if the lib is a (non-dlopened) module then we can not
82556815 # link against it, someone is ignoring the earlier warnings
82566816 if /usr/bin/file -L $add 2> /dev/null |
8257 $GREP ": [^:]* bundle" >/dev/null; then
6817 $GREP ": [^:]* bundle" >/dev/null ; then
82586818 if test "X$dlopenmodule" != "X$lib"; then
82596819 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
8260 if test -z "$old_library"; then
6820 if test -z "$old_library" ; then
82616821 echo
82626822 echo "*** And there doesn't seem to be a static archive available"
82636823 echo "*** The link will probably fail, sorry"
82646824 else
8265 add=$dir/$old_library
6825 add="$dir/$old_library"
82666826 fi
82676827 elif test -n "$old_library"; then
8268 add=$dir/$old_library
6828 add="$dir/$old_library"
82696829 fi
82706830 fi
82716831 esac
8272 elif test no = "$hardcode_minus_L"; then
6832 elif test "$hardcode_minus_L" = no; then
82736833 case $host in
8274 *-*-sunos*) add_shlibpath=$dir ;;
6834 *-*-sunos*) add_shlibpath="$dir" ;;
82756835 esac
8276 add_dir=-L$dir
8277 add=-l$name
8278 elif test no = "$hardcode_shlibpath_var"; then
8279 add_shlibpath=$dir
8280 add=-l$name
6836 add_dir="-L$dir"
6837 add="-l$name"
6838 elif test "$hardcode_shlibpath_var" = no; then
6839 add_shlibpath="$dir"
6840 add="-l$name"
82816841 else
82826842 lib_linked=no
82836843 fi
82846844 ;;
82856845 relink)
8286 if test yes = "$hardcode_direct" &&
8287 test no = "$hardcode_direct_absolute"; then
8288 add=$dir/$linklib
8289 elif test yes = "$hardcode_minus_L"; then
8290 add_dir=-L$absdir
6846 if test "$hardcode_direct" = yes &&
6847 test "$hardcode_direct_absolute" = no; then
6848 add="$dir/$linklib"
6849 elif test "$hardcode_minus_L" = yes; then
6850 add_dir="-L$absdir"
82916851 # Try looking first in the location we're being installed to.
82926852 if test -n "$inst_prefix_dir"; then
82936853 case $libdir in
82966856 ;;
82976857 esac
82986858 fi
8299 add=-l$name
8300 elif test yes = "$hardcode_shlibpath_var"; then
8301 add_shlibpath=$dir
8302 add=-l$name
6859 add="-l$name"
6860 elif test "$hardcode_shlibpath_var" = yes; then
6861 add_shlibpath="$dir"
6862 add="-l$name"
83036863 else
83046864 lib_linked=no
83056865 fi
83076867 *) lib_linked=no ;;
83086868 esac
83096869
8310 if test yes != "$lib_linked"; then
6870 if test "$lib_linked" != yes; then
83116871 func_fatal_configuration "unsupported hardcode properties"
83126872 fi
83136873
83176877 *) func_append compile_shlibpath "$add_shlibpath:" ;;
83186878 esac
83196879 fi
8320 if test prog = "$linkmode"; then
6880 if test "$linkmode" = prog; then
83216881 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
83226882 test -n "$add" && compile_deplibs="$add $compile_deplibs"
83236883 else
83246884 test -n "$add_dir" && deplibs="$add_dir $deplibs"
83256885 test -n "$add" && deplibs="$add $deplibs"
8326 if test yes != "$hardcode_direct" &&
8327 test yes != "$hardcode_minus_L" &&
8328 test yes = "$hardcode_shlibpath_var"; then
6886 if test "$hardcode_direct" != yes &&
6887 test "$hardcode_minus_L" != yes &&
6888 test "$hardcode_shlibpath_var" = yes; then
83296889 case :$finalize_shlibpath: in
83306890 *":$libdir:"*) ;;
83316891 *) func_append finalize_shlibpath "$libdir:" ;;
83346894 fi
83356895 fi
83366896
8337 if test prog = "$linkmode" || test relink = "$opt_mode"; then
6897 if test "$linkmode" = prog || test "$opt_mode" = relink; then
83386898 add_shlibpath=
83396899 add_dir=
83406900 add=
83416901 # Finalize command for both is simple: just hardcode it.
8342 if test yes = "$hardcode_direct" &&
8343 test no = "$hardcode_direct_absolute"; then
8344 add=$libdir/$linklib
8345 elif test yes = "$hardcode_minus_L"; then
8346 add_dir=-L$libdir
8347 add=-l$name
8348 elif test yes = "$hardcode_shlibpath_var"; then
6902 if test "$hardcode_direct" = yes &&
6903 test "$hardcode_direct_absolute" = no; then
6904 add="$libdir/$linklib"
6905 elif test "$hardcode_minus_L" = yes; then
6906 add_dir="-L$libdir"
6907 add="-l$name"
6908 elif test "$hardcode_shlibpath_var" = yes; then
83496909 case :$finalize_shlibpath: in
83506910 *":$libdir:"*) ;;
83516911 *) func_append finalize_shlibpath "$libdir:" ;;
83526912 esac
8353 add=-l$name
8354 elif test yes = "$hardcode_automatic"; then
6913 add="-l$name"
6914 elif test "$hardcode_automatic" = yes; then
83556915 if test -n "$inst_prefix_dir" &&
8356 test -f "$inst_prefix_dir$libdir/$linklib"; then
8357 add=$inst_prefix_dir$libdir/$linklib
6916 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6917 add="$inst_prefix_dir$libdir/$linklib"
83586918 else
8359 add=$libdir/$linklib
6919 add="$libdir/$linklib"
83606920 fi
83616921 else
83626922 # We cannot seem to hardcode it, guess we'll fake it.
8363 add_dir=-L$libdir
6923 add_dir="-L$libdir"
83646924 # Try looking first in the location we're being installed to.
83656925 if test -n "$inst_prefix_dir"; then
83666926 case $libdir in
83696929 ;;
83706930 esac
83716931 fi
8372 add=-l$name
6932 add="-l$name"
83736933 fi
83746934
8375 if test prog = "$linkmode"; then
6935 if test "$linkmode" = prog; then
83766936 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
83776937 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
83786938 else
83806940 test -n "$add" && deplibs="$add $deplibs"
83816941 fi
83826942 fi
8383 elif test prog = "$linkmode"; then
6943 elif test "$linkmode" = prog; then
83846944 # Here we assume that one of hardcode_direct or hardcode_minus_L
83856945 # is not unsupported. This is valid on all known static and
83866946 # shared platforms.
8387 if test unsupported != "$hardcode_direct"; then
8388 test -n "$old_library" && linklib=$old_library
6947 if test "$hardcode_direct" != unsupported; then
6948 test -n "$old_library" && linklib="$old_library"
83896949 compile_deplibs="$dir/$linklib $compile_deplibs"
83906950 finalize_deplibs="$dir/$linklib $finalize_deplibs"
83916951 else
83926952 compile_deplibs="-l$name -L$dir $compile_deplibs"
83936953 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
83946954 fi
8395 elif test yes = "$build_libtool_libs"; then
6955 elif test "$build_libtool_libs" = yes; then
83966956 # Not a shared library
8397 if test pass_all != "$deplibs_check_method"; then
6957 if test "$deplibs_check_method" != pass_all; then
83986958 # We're trying link a shared library against a static one
83996959 # but the system doesn't support it.
84006960
84016961 # Just print a warning and add the library to dependency_libs so
84026962 # that the program can be linked against the static library.
84036963 echo
8404 $ECHO "*** Warning: This system cannot link to static lib archive $lib."
6964 $ECHO "*** Warning: This system can not link to static lib archive $lib."
84056965 echo "*** I have the capability to make that library automatically link in when"
84066966 echo "*** you link to this library. But I can only do this if you have a"
84076967 echo "*** shared version of the library, which you do not appear to have."
8408 if test yes = "$module"; then
6968 if test "$module" = yes; then
84096969 echo "*** But as you try to build a module library, libtool will still create "
84106970 echo "*** a static module, that should work as long as the dlopening application"
84116971 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
84126972 if test -z "$global_symbol_pipe"; then
84136973 echo
84146974 echo "*** However, this would only work if libtool was able to extract symbol"
8415 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
6975 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
84166976 echo "*** not find such a program. So, this module is probably useless."
8417 echo "*** 'nm' from GNU binutils and a full rebuild may help."
6977 echo "*** \`nm' from GNU binutils and a full rebuild may help."
84186978 fi
8419 if test no = "$build_old_libs"; then
6979 if test "$build_old_libs" = no; then
84206980 build_libtool_libs=module
84216981 build_old_libs=yes
84226982 else
84296989 fi
84306990 fi # link shared/static library?
84316991
8432 if test lib = "$linkmode"; then
6992 if test "$linkmode" = lib; then
84336993 if test -n "$dependency_libs" &&
8434 { test yes != "$hardcode_into_libs" ||
8435 test yes = "$build_old_libs" ||
8436 test yes = "$link_static"; }; then
6994 { test "$hardcode_into_libs" != yes ||
6995 test "$build_old_libs" = yes ||
6996 test "$link_static" = yes; }; then
84376997 # Extract -R from dependency_libs
84386998 temp_deplibs=
84396999 for libdir in $dependency_libs; do
84477007 *) func_append temp_deplibs " $libdir";;
84487008 esac
84497009 done
8450 dependency_libs=$temp_deplibs
7010 dependency_libs="$temp_deplibs"
84517011 fi
84527012
84537013 func_append newlib_search_path " $absdir"
84547014 # Link against this library
8455 test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7015 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
84567016 # ... and its dependency_libs
84577017 tmp_libs=
84587018 for deplib in $dependency_libs; do
84627022 func_resolve_sysroot "$func_stripname_result";;
84637023 *) func_resolve_sysroot "$deplib" ;;
84647024 esac
8465 if $opt_preserve_dup_deps; then
7025 if $opt_preserve_dup_deps ; then
84667026 case "$tmp_libs " in
84677027 *" $func_resolve_sysroot_result "*)
84687028 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
84717031 func_append tmp_libs " $func_resolve_sysroot_result"
84727032 done
84737033
8474 if test no != "$link_all_deplibs"; then
7034 if test "$link_all_deplibs" != no; then
84757035 # Add the search paths of all dependency libraries
84767036 for deplib in $dependency_libs; do
84777037 path=
84787038 case $deplib in
8479 -L*) path=$deplib ;;
7039 -L*) path="$deplib" ;;
84807040 *.la)
84817041 func_resolve_sysroot "$deplib"
84827042 deplib=$func_resolve_sysroot_result
84847044 dir=$func_dirname_result
84857045 # We need an absolute path.
84867046 case $dir in
8487 [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
7047 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
84887048 *)
84897049 absdir=`cd "$dir" && pwd`
84907050 if test -z "$absdir"; then
8491 func_warning "cannot determine absolute directory name of '$dir'"
8492 absdir=$dir
7051 func_warning "cannot determine absolute directory name of \`$dir'"
7052 absdir="$dir"
84937053 fi
84947054 ;;
84957055 esac
84977057 case $host in
84987058 *-*-darwin*)
84997059 depdepl=
8500 eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8501 if test -n "$deplibrary_names"; then
8502 for tmp in $deplibrary_names; do
7060 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7061 if test -n "$deplibrary_names" ; then
7062 for tmp in $deplibrary_names ; do
85037063 depdepl=$tmp
85047064 done
8505 if test -f "$absdir/$objdir/$depdepl"; then
8506 depdepl=$absdir/$objdir/$depdepl
8507 darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7065 if test -f "$absdir/$objdir/$depdepl" ; then
7066 depdepl="$absdir/$objdir/$depdepl"
7067 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
85087068 if test -z "$darwin_install_name"; then
8509 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7069 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
85107070 fi
8511 func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
8512 func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
7071 func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7072 func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
85137073 path=
85147074 fi
85157075 fi
85167076 ;;
85177077 *)
8518 path=-L$absdir/$objdir
7078 path="-L$absdir/$objdir"
85197079 ;;
85207080 esac
85217081 else
8522 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7082 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
85237083 test -z "$libdir" && \
8524 func_fatal_error "'$deplib' is not a valid libtool archive"
7084 func_fatal_error "\`$deplib' is not a valid libtool archive"
85257085 test "$absdir" != "$libdir" && \
8526 func_warning "'$deplib' seems to be moved"
8527
8528 path=-L$absdir
7086 func_warning "\`$deplib' seems to be moved"
7087
7088 path="-L$absdir"
85297089 fi
85307090 ;;
85317091 esac
85377097 fi # link_all_deplibs != no
85387098 fi # linkmode = lib
85397099 done # for deplib in $libs
8540 if test link = "$pass"; then
8541 if test prog = "$linkmode"; then
7100 if test "$pass" = link; then
7101 if test "$linkmode" = "prog"; then
85427102 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
85437103 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
85447104 else
85457105 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
85467106 fi
85477107 fi
8548 dependency_libs=$newdependency_libs
8549 if test dlpreopen = "$pass"; then
7108 dependency_libs="$newdependency_libs"
7109 if test "$pass" = dlpreopen; then
85507110 # Link the dlpreopened libraries before other libraries
85517111 for deplib in $save_deplibs; do
85527112 deplibs="$deplib $deplibs"
85537113 done
85547114 fi
8555 if test dlopen != "$pass"; then
8556 test conv = "$pass" || {
7115 if test "$pass" != dlopen; then
7116 if test "$pass" != conv; then
85577117 # Make sure lib_search_path contains only unique directories.
85587118 lib_search_path=
85597119 for dir in $newlib_search_path; do
85637123 esac
85647124 done
85657125 newlib_search_path=
8566 }
8567
8568 if test prog,link = "$linkmode,$pass"; then
7126 fi
7127
7128 if test "$linkmode,$pass" != "prog,link"; then
7129 vars="deplibs"
7130 else
85697131 vars="compile_deplibs finalize_deplibs"
8570 else
8571 vars=deplibs
85727132 fi
85737133 for var in $vars dependency_libs; do
85747134 # Add libraries to $var in reverse order
86267186 eval $var=\"$tmp_libs\"
86277187 done # for var
86287188 fi
8629
8630 # Add Sun CC postdeps if required:
8631 test CXX = "$tagname" && {
8632 case $host_os in
8633 linux*)
8634 case `$CC -V 2>&1 | sed 5q` in
8635 *Sun\ C*) # Sun C++ 5.9
8636 func_suncc_cstd_abi
8637
8638 if test no != "$suncc_use_cstd_abi"; then
8639 func_append postdeps ' -library=Cstd -library=Crun'
8640 fi
8641 ;;
8642 esac
8643 ;;
8644
8645 solaris*)
8646 func_cc_basename "$CC"
8647 case $func_cc_basename_result in
8648 CC* | sunCC*)
8649 func_suncc_cstd_abi
8650
8651 if test no != "$suncc_use_cstd_abi"; then
8652 func_append postdeps ' -library=Cstd -library=Crun'
8653 fi
8654 ;;
8655 esac
8656 ;;
8657 esac
8658 }
8659
86607189 # Last step: remove runtime libs from dependency_libs
86617190 # (they stay in deplibs)
86627191 tmp_libs=
8663 for i in $dependency_libs; do
7192 for i in $dependency_libs ; do
86647193 case " $predeps $postdeps $compiler_lib_search_path " in
86657194 *" $i "*)
8666 i=
7195 i=""
86677196 ;;
86687197 esac
8669 if test -n "$i"; then
7198 if test -n "$i" ; then
86707199 func_append tmp_libs " $i"
86717200 fi
86727201 done
86737202 dependency_libs=$tmp_libs
86747203 done # for pass
8675 if test prog = "$linkmode"; then
8676 dlfiles=$newdlfiles
7204 if test "$linkmode" = prog; then
7205 dlfiles="$newdlfiles"
86777206 fi
8678 if test prog = "$linkmode" || test lib = "$linkmode"; then
8679 dlprefiles=$newdlprefiles
7207 if test "$linkmode" = prog || test "$linkmode" = lib; then
7208 dlprefiles="$newdlprefiles"
86807209 fi
86817210
86827211 case $linkmode in
86837212 oldlib)
8684 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8685 func_warning "'-dlopen' is ignored for archives"
7213 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7214 func_warning "\`-dlopen' is ignored for archives"
86867215 fi
86877216
86887217 case " $deplibs" in
86897218 *\ -l* | *\ -L*)
8690 func_warning "'-l' and '-L' are ignored for archives" ;;
7219 func_warning "\`-l' and \`-L' are ignored for archives" ;;
86917220 esac
86927221
86937222 test -n "$rpath" && \
8694 func_warning "'-rpath' is ignored for archives"
7223 func_warning "\`-rpath' is ignored for archives"
86957224
86967225 test -n "$xrpath" && \
8697 func_warning "'-R' is ignored for archives"
7226 func_warning "\`-R' is ignored for archives"
86987227
86997228 test -n "$vinfo" && \
8700 func_warning "'-version-info/-version-number' is ignored for archives"
7229 func_warning "\`-version-info/-version-number' is ignored for archives"
87017230
87027231 test -n "$release" && \
8703 func_warning "'-release' is ignored for archives"
7232 func_warning "\`-release' is ignored for archives"
87047233
87057234 test -n "$export_symbols$export_symbols_regex" && \
8706 func_warning "'-export-symbols' is ignored for archives"
7235 func_warning "\`-export-symbols' is ignored for archives"
87077236
87087237 # Now set the variables for building old libraries.
87097238 build_libtool_libs=no
8710 oldlibs=$output
7239 oldlibs="$output"
87117240 func_append objs "$old_deplibs"
87127241 ;;
87137242
87147243 lib)
8715 # Make sure we only generate libraries of the form 'libNAME.la'.
7244 # Make sure we only generate libraries of the form `libNAME.la'.
87167245 case $outputname in
87177246 lib*)
87187247 func_stripname 'lib' '.la' "$outputname"
87217250 eval libname=\"$libname_spec\"
87227251 ;;
87237252 *)
8724 test no = "$module" \
8725 && func_fatal_help "libtool library '$output' must begin with 'lib'"
8726
8727 if test no != "$need_lib_prefix"; then
7253 test "$module" = no && \
7254 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7255
7256 if test "$need_lib_prefix" != no; then
87287257 # Add the "lib" prefix for modules if required
87297258 func_stripname '' '.la' "$outputname"
87307259 name=$func_stripname_result
87387267 esac
87397268
87407269 if test -n "$objs"; then
8741 if test pass_all != "$deplibs_check_method"; then
8742 func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
7270 if test "$deplibs_check_method" != pass_all; then
7271 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
87437272 else
87447273 echo
87457274 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
87487277 fi
87497278 fi
87507279
8751 test no = "$dlself" \
8752 || func_warning "'-dlopen self' is ignored for libtool libraries"
7280 test "$dlself" != no && \
7281 func_warning "\`-dlopen self' is ignored for libtool libraries"
87537282
87547283 set dummy $rpath
87557284 shift
8756 test 1 -lt "$#" \
8757 && func_warning "ignoring multiple '-rpath's for a libtool library"
8758
8759 install_libdir=$1
7285 test "$#" -gt 1 && \
7286 func_warning "ignoring multiple \`-rpath's for a libtool library"
7287
7288 install_libdir="$1"
87607289
87617290 oldlibs=
87627291 if test -z "$rpath"; then
8763 if test yes = "$build_libtool_libs"; then
7292 if test "$build_libtool_libs" = yes; then
87647293 # Building a libtool convenience library.
8765 # Some compilers have problems with a '.al' extension so
7294 # Some compilers have problems with a `.al' extension so
87667295 # convenience libraries should have the same extension an
87677296 # archive normally would.
87687297 oldlibs="$output_objdir/$libname.$libext $oldlibs"
87717300 fi
87727301
87737302 test -n "$vinfo" && \
8774 func_warning "'-version-info/-version-number' is ignored for convenience libraries"
7303 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
87757304
87767305 test -n "$release" && \
8777 func_warning "'-release' is ignored for convenience libraries"
7306 func_warning "\`-release' is ignored for convenience libraries"
87787307 else
87797308
87807309 # Parse the version information argument.
8781 save_ifs=$IFS; IFS=:
7310 save_ifs="$IFS"; IFS=':'
87827311 set dummy $vinfo 0 0 0
87837312 shift
8784 IFS=$save_ifs
7313 IFS="$save_ifs"
87857314
87867315 test -n "$7" && \
8787 func_fatal_help "too many parameters to '-version-info'"
7316 func_fatal_help "too many parameters to \`-version-info'"
87887317
87897318 # convert absolute version numbers to libtool ages
87907319 # this retains compatibility with .la files and attempts
87927321
87937322 case $vinfo_number in
87947323 yes)
8795 number_major=$1
8796 number_minor=$2
8797 number_revision=$3
7324 number_major="$1"
7325 number_minor="$2"
7326 number_revision="$3"
87987327 #
87997328 # There are really only two kinds -- those that
88007329 # use the current revision as the major version
88017330 # and those that subtract age and use age as
88027331 # a minor version. But, then there is irix
8803 # that has an extra 1 added just for fun
7332 # which has an extra 1 added just for fun
88047333 #
88057334 case $version_type in
88067335 # correct linux to gnu/linux during the next big refactor
8807 darwin|freebsd-elf|linux|osf|windows|none)
7336 darwin|linux|osf|windows|none)
88087337 func_arith $number_major + $number_minor
88097338 current=$func_arith_result
8810 age=$number_minor
8811 revision=$number_revision
7339 age="$number_minor"
7340 revision="$number_revision"
88127341 ;;
8813 freebsd-aout|qnx|sunos)
8814 current=$number_major
8815 revision=$number_minor
8816 age=0
7342 freebsd-aout|freebsd-elf|qnx|sunos)
7343 current="$number_major"
7344 revision="$number_minor"
7345 age="0"
88177346 ;;
88187347 irix|nonstopux)
88197348 func_arith $number_major + $number_minor
88207349 current=$func_arith_result
8821 age=$number_minor
8822 revision=$number_minor
7350 age="$number_minor"
7351 revision="$number_minor"
88237352 lt_irix_increment=no
7353 ;;
7354 *)
7355 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
88247356 ;;
88257357 esac
88267358 ;;
88277359 no)
8828 current=$1
8829 revision=$2
8830 age=$3
7360 current="$1"
7361 revision="$2"
7362 age="$3"
88317363 ;;
88327364 esac
88337365
88357367 case $current in
88367368 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]) ;;
88377369 *)
8838 func_error "CURRENT '$current' must be a nonnegative integer"
8839 func_fatal_error "'$vinfo' is not valid version information"
7370 func_error "CURRENT \`$current' must be a nonnegative integer"
7371 func_fatal_error "\`$vinfo' is not valid version information"
88407372 ;;
88417373 esac
88427374
88437375 case $revision in
88447376 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]) ;;
88457377 *)
8846 func_error "REVISION '$revision' must be a nonnegative integer"
8847 func_fatal_error "'$vinfo' is not valid version information"
7378 func_error "REVISION \`$revision' must be a nonnegative integer"
7379 func_fatal_error "\`$vinfo' is not valid version information"
88487380 ;;
88497381 esac
88507382
88517383 case $age in
88527384 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]) ;;
88537385 *)
8854 func_error "AGE '$age' must be a nonnegative integer"
8855 func_fatal_error "'$vinfo' is not valid version information"
7386 func_error "AGE \`$age' must be a nonnegative integer"
7387 func_fatal_error "\`$vinfo' is not valid version information"
88567388 ;;
88577389 esac
88587390
88597391 if test "$age" -gt "$current"; then
8860 func_error "AGE '$age' is greater than the current interface number '$current'"
8861 func_fatal_error "'$vinfo' is not valid version information"
7392 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7393 func_fatal_error "\`$vinfo' is not valid version information"
88627394 fi
88637395
88647396 # Calculate the version variables.
88737405 # verstring for coding it into the library header
88747406 func_arith $current - $age
88757407 major=.$func_arith_result
8876 versuffix=$major.$age.$revision
7408 versuffix="$major.$age.$revision"
88777409 # Darwin ld doesn't like 0 for these options...
88787410 func_arith $current + 1
88797411 minor_current=$func_arith_result
8880 xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
7412 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
88817413 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8882 # On Darwin other compilers
8883 case $CC in
8884 nagfor*)
8885 verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
8886 ;;
8887 *)
8888 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8889 ;;
8890 esac
88917414 ;;
88927415
88937416 freebsd-aout)
8894 major=.$current
8895 versuffix=.$current.$revision
7417 major=".$current"
7418 versuffix=".$current.$revision";
88967419 ;;
88977420
88987421 freebsd-elf)
8899 func_arith $current - $age
8900 major=.$func_arith_result
8901 versuffix=$major.$age.$revision
7422 major=".$current"
7423 versuffix=".$current"
89027424 ;;
89037425
89047426 irix | nonstopux)
8905 if test no = "$lt_irix_increment"; then
7427 if test "X$lt_irix_increment" = "Xno"; then
89067428 func_arith $current - $age
89077429 else
89087430 func_arith $current - $age + 1
89137435 nonstopux) verstring_prefix=nonstopux ;;
89147436 *) verstring_prefix=sgi ;;
89157437 esac
8916 verstring=$verstring_prefix$major.$revision
7438 verstring="$verstring_prefix$major.$revision"
89177439
89187440 # Add in all the interfaces that we are compatible with.
89197441 loop=$revision
8920 while test 0 -ne "$loop"; do
7442 while test "$loop" -ne 0; do
89217443 func_arith $revision - $loop
89227444 iface=$func_arith_result
89237445 func_arith $loop - 1
89247446 loop=$func_arith_result
8925 verstring=$verstring_prefix$major.$iface:$verstring
7447 verstring="$verstring_prefix$major.$iface:$verstring"
89267448 done
89277449
8928 # Before this point, $major must not contain '.'.
7450 # Before this point, $major must not contain `.'.
89297451 major=.$major
8930 versuffix=$major.$revision
7452 versuffix="$major.$revision"
89317453 ;;
89327454
89337455 linux) # correct to gnu/linux during the next big refactor
89347456 func_arith $current - $age
89357457 major=.$func_arith_result
8936 versuffix=$major.$age.$revision
7458 versuffix="$major.$age.$revision"
89377459 ;;
89387460
89397461 osf)
89407462 func_arith $current - $age
89417463 major=.$func_arith_result
8942 versuffix=.$current.$age.$revision
8943 verstring=$current.$age.$revision
7464 versuffix=".$current.$age.$revision"
7465 verstring="$current.$age.$revision"
89447466
89457467 # Add in all the interfaces that we are compatible with.
89467468 loop=$age
8947 while test 0 -ne "$loop"; do
7469 while test "$loop" -ne 0; do
89487470 func_arith $current - $loop
89497471 iface=$func_arith_result
89507472 func_arith $loop - 1
89517473 loop=$func_arith_result
8952 verstring=$verstring:$iface.0
7474 verstring="$verstring:${iface}.0"
89537475 done
89547476
89557477 # Make executables depend on our current version.
8956 func_append verstring ":$current.0"
7478 func_append verstring ":${current}.0"
89577479 ;;
89587480
89597481 qnx)
8960 major=.$current
8961 versuffix=.$current
7482 major=".$current"
7483 versuffix=".$current"
89627484 ;;
89637485
8964 sco)
8965 major=.$current
8966 versuffix=.$current
8967 ;;
8968
89697486 sunos)
8970 major=.$current
8971 versuffix=.$current.$revision
7487 major=".$current"
7488 versuffix=".$current.$revision"
89727489 ;;
89737490
89747491 windows)
89757492 # Use '-' rather than '.', since we only want one
8976 # extension on DOS 8.3 file systems.
7493 # extension on DOS 8.3 filesystems.
89777494 func_arith $current - $age
89787495 major=$func_arith_result
8979 versuffix=-$major
7496 versuffix="-$major"
89807497 ;;
89817498
89827499 *)
8983 func_fatal_configuration "unknown library version type '$version_type'"
7500 func_fatal_configuration "unknown library version type \`$version_type'"
89847501 ;;
89857502 esac
89867503
89947511 verstring=
89957512 ;;
89967513 *)
8997 verstring=0.0
7514 verstring="0.0"
89987515 ;;
89997516 esac
9000 if test no = "$need_version"; then
7517 if test "$need_version" = no; then
90017518 versuffix=
90027519 else
9003 versuffix=.0.0
7520 versuffix=".0.0"
90047521 fi
90057522 fi
90067523
90077524 # Remove version info from name if versioning should be avoided
9008 if test yes,no = "$avoid_version,$need_version"; then
7525 if test "$avoid_version" = yes && test "$need_version" = no; then
90097526 major=
90107527 versuffix=
9011 verstring=
7528 verstring=""
90127529 fi
90137530
90147531 # Check to see if the archive will have undefined symbols.
9015 if test yes = "$allow_undefined"; then
9016 if test unsupported = "$allow_undefined_flag"; then
9017 if test yes = "$build_old_libs"; then
9018 func_warning "undefined symbols not allowed in $host shared libraries; building static only"
9019 build_libtool_libs=no
9020 else
9021 func_fatal_error "can't build $host shared library unless -no-undefined is specified"
9022 fi
7532 if test "$allow_undefined" = yes; then
7533 if test "$allow_undefined_flag" = unsupported; then
7534 func_warning "undefined symbols not allowed in $host shared libraries"
7535 build_libtool_libs=no
7536 build_old_libs=yes
90237537 fi
90247538 else
90257539 # Don't allow undefined symbols.
9026 allow_undefined_flag=$no_undefined_flag
7540 allow_undefined_flag="$no_undefined_flag"
90277541 fi
90287542
90297543 fi
90307544
9031 func_generate_dlsyms "$libname" "$libname" :
7545 func_generate_dlsyms "$libname" "$libname" "yes"
90327546 func_append libobjs " $symfileobj"
9033 test " " = "$libobjs" && libobjs=
9034
9035 if test relink != "$opt_mode"; then
7547 test "X$libobjs" = "X " && libobjs=
7548
7549 if test "$opt_mode" != relink; then
90367550 # Remove our outputs, but don't remove object files since they
90377551 # may have been created when compiling PIC objects.
90387552 removelist=
90417555 case $p in
90427556 *.$objext | *.gcno)
90437557 ;;
9044 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
9045 if test -n "$precious_files_regex"; then
7558 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7559 if test "X$precious_files_regex" != "X"; then
90467560 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
90477561 then
90487562 continue
90587572 fi
90597573
90607574 # Now set the variables for building old libraries.
9061 if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
7575 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
90627576 func_append oldlibs " $output_objdir/$libname.$libext"
90637577
90647578 # Transform .lo files to .o files.
9065 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
7579 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
90667580 fi
90677581
90687582 # Eliminate all temporary directories.
90837597 *) func_append finalize_rpath " $libdir" ;;
90847598 esac
90857599 done
9086 if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
7600 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
90877601 dependency_libs="$temp_xrpath $dependency_libs"
90887602 fi
90897603 fi
90907604
90917605 # Make sure dlfiles contains only unique files that won't be dlpreopened
9092 old_dlfiles=$dlfiles
7606 old_dlfiles="$dlfiles"
90937607 dlfiles=
90947608 for lib in $old_dlfiles; do
90957609 case " $dlprefiles $dlfiles " in
90997613 done
91007614
91017615 # Make sure dlprefiles contains only unique files
9102 old_dlprefiles=$dlprefiles
7616 old_dlprefiles="$dlprefiles"
91037617 dlprefiles=
91047618 for lib in $old_dlprefiles; do
91057619 case "$dlprefiles " in
91087622 esac
91097623 done
91107624
9111 if test yes = "$build_libtool_libs"; then
7625 if test "$build_libtool_libs" = yes; then
91127626 if test -n "$rpath"; then
91137627 case $host in
91147628 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
91327646 ;;
91337647 *)
91347648 # Add libc to deplibs on all other systems if necessary.
9135 if test yes = "$build_libtool_need_lc"; then
7649 if test "$build_libtool_need_lc" = "yes"; then
91367650 func_append deplibs " -lc"
91377651 fi
91387652 ;;
91487662 # I'm not sure if I'm treating the release correctly. I think
91497663 # release should show up in the -l (ie -lgmp5) so we don't want to
91507664 # add it in twice. Is that correct?
9151 release=
9152 versuffix=
9153 major=
7665 release=""
7666 versuffix=""
7667 major=""
91547668 newdeplibs=
91557669 droppeddeps=no
91567670 case $deplibs_check_method in
91797693 -l*)
91807694 func_stripname -l '' "$i"
91817695 name=$func_stripname_result
9182 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7696 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
91837697 case " $predeps $postdeps " in
91847698 *" $i "*)
91857699 func_append newdeplibs " $i"
9186 i=
7700 i=""
91877701 ;;
91887702 esac
91897703 fi
9190 if test -n "$i"; then
7704 if test -n "$i" ; then
91917705 libname=`eval "\\$ECHO \"$libname_spec\""`
91927706 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
91937707 set dummy $deplib_matches; shift
91947708 deplib_match=$1
9195 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
7709 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
91967710 func_append newdeplibs " $i"
91977711 else
91987712 droppeddeps=yes
92227736 $opt_dry_run || $RM conftest
92237737 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
92247738 ldd_output=`ldd conftest`
9225 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7739 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
92267740 case " $predeps $postdeps " in
92277741 *" $i "*)
92287742 func_append newdeplibs " $i"
9229 i=
7743 i=""
92307744 ;;
92317745 esac
92327746 fi
9233 if test -n "$i"; then
7747 if test -n "$i" ; then
92347748 libname=`eval "\\$ECHO \"$libname_spec\""`
92357749 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
92367750 set dummy $deplib_matches; shift
92377751 deplib_match=$1
9238 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
7752 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
92397753 func_append newdeplibs " $i"
92407754 else
92417755 droppeddeps=yes
92727786 -l*)
92737787 func_stripname -l '' "$a_deplib"
92747788 name=$func_stripname_result
9275 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7789 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
92767790 case " $predeps $postdeps " in
92777791 *" $a_deplib "*)
92787792 func_append newdeplibs " $a_deplib"
9279 a_deplib=
7793 a_deplib=""
92807794 ;;
92817795 esac
92827796 fi
9283 if test -n "$a_deplib"; then
7797 if test -n "$a_deplib" ; then
92847798 libname=`eval "\\$ECHO \"$libname_spec\""`
92857799 if test -n "$file_magic_glob"; then
92867800 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
92877801 else
92887802 libnameglob=$libname
92897803 fi
9290 test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
7804 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
92917805 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9292 if test yes = "$want_nocaseglob"; then
7806 if test "$want_nocaseglob" = yes; then
92937807 shopt -s nocaseglob
92947808 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
92957809 $nocaseglob
93077821 # We might still enter an endless loop, since a link
93087822 # loop can be closed while we follow links,
93097823 # but so what?
9310 potlib=$potent_lib
7824 potlib="$potent_lib"
93117825 while test -h "$potlib" 2>/dev/null; do
9312 potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
7826 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
93137827 case $potliblink in
9314 [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
9315 *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
7828 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7829 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
93167830 esac
93177831 done
93187832 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
93197833 $SED -e 10q |
93207834 $EGREP "$file_magic_regex" > /dev/null; then
93217835 func_append newdeplibs " $a_deplib"
9322 a_deplib=
7836 a_deplib=""
93237837 break 2
93247838 fi
93257839 done
93267840 done
93277841 fi
9328 if test -n "$a_deplib"; then
7842 if test -n "$a_deplib" ; then
93297843 droppeddeps=yes
93307844 echo
93317845 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
93337847 echo "*** you link to this library. But I can only do this if you have a"
93347848 echo "*** shared version of the library, which you do not appear to have"
93357849 echo "*** because I did check the linker path looking for a file starting"
9336 if test -z "$potlib"; then
7850 if test -z "$potlib" ; then
93377851 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
93387852 else
93397853 $ECHO "*** with $libname and none of the candidates passed a file format test"
93567870 -l*)
93577871 func_stripname -l '' "$a_deplib"
93587872 name=$func_stripname_result
9359 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7873 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
93607874 case " $predeps $postdeps " in
93617875 *" $a_deplib "*)
93627876 func_append newdeplibs " $a_deplib"
9363 a_deplib=
7877 a_deplib=""
93647878 ;;
93657879 esac
93667880 fi
9367 if test -n "$a_deplib"; then
7881 if test -n "$a_deplib" ; then
93687882 libname=`eval "\\$ECHO \"$libname_spec\""`
93697883 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
93707884 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
93717885 for potent_lib in $potential_libs; do
9372 potlib=$potent_lib # see symlink-check above in file_magic test
7886 potlib="$potent_lib" # see symlink-check above in file_magic test
93737887 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
93747888 $EGREP "$match_pattern_regex" > /dev/null; then
93757889 func_append newdeplibs " $a_deplib"
9376 a_deplib=
7890 a_deplib=""
93777891 break 2
93787892 fi
93797893 done
93807894 done
93817895 fi
9382 if test -n "$a_deplib"; then
7896 if test -n "$a_deplib" ; then
93837897 droppeddeps=yes
93847898 echo
93857899 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
93877901 echo "*** you link to this library. But I can only do this if you have a"
93887902 echo "*** shared version of the library, which you do not appear to have"
93897903 echo "*** because I did check the linker path looking for a file starting"
9390 if test -z "$potlib"; then
7904 if test -z "$potlib" ; then
93917905 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
93927906 else
93937907 $ECHO "*** with $libname and none of the candidates passed a file format test"
94037917 done # Gone through all deplibs.
94047918 ;;
94057919 none | unknown | *)
9406 newdeplibs=
7920 newdeplibs=""
94077921 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9408 if test yes = "$allow_libtool_libs_with_static_runtimes"; then
9409 for i in $predeps $postdeps; do
7922 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7923 for i in $predeps $postdeps ; do
94107924 # can't use Xsed below, because $i might contain '/'
9411 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
7925 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
94127926 done
94137927 fi
94147928 case $tmp_deplibs in
94157929 *[!\ \ ]*)
94167930 echo
9417 if test none = "$deplibs_check_method"; then
7931 if test "X$deplibs_check_method" = "Xnone"; then
94187932 echo "*** Warning: inter-library dependencies are not supported in this platform."
94197933 else
94207934 echo "*** Warning: inter-library dependencies are not known to be supported."
94387952 ;;
94397953 esac
94407954
9441 if test yes = "$droppeddeps"; then
9442 if test yes = "$module"; then
7955 if test "$droppeddeps" = yes; then
7956 if test "$module" = yes; then
94437957 echo
94447958 echo "*** Warning: libtool could not satisfy all declared inter-library"
94457959 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
94487962 if test -z "$global_symbol_pipe"; then
94497963 echo
94507964 echo "*** However, this would only work if libtool was able to extract symbol"
9451 echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
7965 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
94527966 echo "*** not find such a program. So, this module is probably useless."
9453 echo "*** 'nm' from GNU binutils and a full rebuild may help."
7967 echo "*** \`nm' from GNU binutils and a full rebuild may help."
94547968 fi
9455 if test no = "$build_old_libs"; then
9456 oldlibs=$output_objdir/$libname.$libext
7969 if test "$build_old_libs" = no; then
7970 oldlibs="$output_objdir/$libname.$libext"
94577971 build_libtool_libs=module
94587972 build_old_libs=yes
94597973 else
94647978 echo "*** automatically added whenever a program is linked with this library"
94657979 echo "*** or is declared to -dlopen it."
94667980
9467 if test no = "$allow_undefined"; then
7981 if test "$allow_undefined" = no; then
94687982 echo
94697983 echo "*** Since this library must not contain undefined symbols,"
94707984 echo "*** because either the platform does not support them or"
94717985 echo "*** it was explicitly requested with -no-undefined,"
94727986 echo "*** libtool will only create a static version of it."
9473 if test no = "$build_old_libs"; then
9474 oldlibs=$output_objdir/$libname.$libext
7987 if test "$build_old_libs" = no; then
7988 oldlibs="$output_objdir/$libname.$libext"
94757989 build_libtool_libs=module
94767990 build_old_libs=yes
94777991 else
95178031 *) func_append new_libs " $deplib" ;;
95188032 esac
95198033 done
9520 deplibs=$new_libs
8034 deplibs="$new_libs"
95218035
95228036 # All the library-specific variables (install_libdir is set above).
95238037 library_names=
95258039 dlname=
95268040
95278041 # Test again, we may have decided not to build it any more
9528 if test yes = "$build_libtool_libs"; then
9529 # Remove $wl instances when linking with ld.
8042 if test "$build_libtool_libs" = yes; then
8043 # Remove ${wl} instances when linking with ld.
95308044 # FIXME: should test the right _cmds variable.
95318045 case $archive_cmds in
95328046 *\$LD\ *) wl= ;;
95338047 esac
9534 if test yes = "$hardcode_into_libs"; then
8048 if test "$hardcode_into_libs" = yes; then
95358049 # Hardcode the library paths
95368050 hardcode_libdirs=
95378051 dep_rpath=
9538 rpath=$finalize_rpath
9539 test relink = "$opt_mode" || rpath=$compile_rpath$rpath
8052 rpath="$finalize_rpath"
8053 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
95408054 for libdir in $rpath; do
95418055 if test -n "$hardcode_libdir_flag_spec"; then
95428056 if test -n "$hardcode_libdir_separator"; then
95438057 func_replace_sysroot "$libdir"
95448058 libdir=$func_replace_sysroot_result
95458059 if test -z "$hardcode_libdirs"; then
9546 hardcode_libdirs=$libdir
8060 hardcode_libdirs="$libdir"
95478061 else
95488062 # Just accumulate the unique libdirs.
95498063 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
95688082 # Substitute the hardcoded libdirs into the rpath.
95698083 if test -n "$hardcode_libdir_separator" &&
95708084 test -n "$hardcode_libdirs"; then
9571 libdir=$hardcode_libdirs
8085 libdir="$hardcode_libdirs"
95728086 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
95738087 fi
95748088 if test -n "$runpath_var" && test -n "$perm_rpath"; then
95828096 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
95838097 fi
95848098
9585 shlibpath=$finalize_shlibpath
9586 test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
8099 shlibpath="$finalize_shlibpath"
8100 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
95878101 if test -n "$shlibpath"; then
95888102 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
95898103 fi
95938107 eval library_names=\"$library_names_spec\"
95948108 set dummy $library_names
95958109 shift
9596 realname=$1
8110 realname="$1"
95978111 shift
95988112
95998113 if test -n "$soname_spec"; then
96008114 eval soname=\"$soname_spec\"
96018115 else
9602 soname=$realname
8116 soname="$realname"
96038117 fi
96048118 if test -z "$dlname"; then
96058119 dlname=$soname
96068120 fi
96078121
9608 lib=$output_objdir/$realname
8122 lib="$output_objdir/$realname"
96098123 linknames=
96108124 for link
96118125 do
96198133 delfiles=
96208134 if test -n "$export_symbols" && test -n "$include_expsyms"; then
96218135 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9622 export_symbols=$output_objdir/$libname.uexp
8136 export_symbols="$output_objdir/$libname.uexp"
96238137 func_append delfiles " $export_symbols"
96248138 fi
96258139
96288142 cygwin* | mingw* | cegcc*)
96298143 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
96308144 # exporting using user supplied symfile
9631 func_dll_def_p "$export_symbols" || {
8145 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
96328146 # and it's NOT already a .def file. Must figure out
96338147 # which of the given symbols are data symbols and tag
96348148 # them as such. So, trigger use of export_symbols_cmds.
96358149 # export_symbols gets reassigned inside the "prepare
96368150 # the list of exported symbols" if statement, so the
96378151 # include_expsyms logic still works.
9638 orig_export_symbols=$export_symbols
8152 orig_export_symbols="$export_symbols"
96398153 export_symbols=
96408154 always_export_symbols=yes
9641 }
8155 fi
96428156 fi
96438157 ;;
96448158 esac
96458159
96468160 # Prepare the list of exported symbols
96478161 if test -z "$export_symbols"; then
9648 if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
9649 func_verbose "generating symbol list for '$libname.la'"
9650 export_symbols=$output_objdir/$libname.exp
8162 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8163 func_verbose "generating symbol list for \`$libname.la'"
8164 export_symbols="$output_objdir/$libname.exp"
96518165 $opt_dry_run || $RM $export_symbols
96528166 cmds=$export_symbols_cmds
9653 save_ifs=$IFS; IFS='~'
8167 save_ifs="$IFS"; IFS='~'
96548168 for cmd1 in $cmds; do
9655 IFS=$save_ifs
8169 IFS="$save_ifs"
96568170 # Take the normal branch if the nm_file_list_spec branch
96578171 # doesn't work or if tool conversion is not needed.
96588172 case $nm_file_list_spec~$to_tool_file_cmd in
96668180 try_normal_branch=no
96678181 ;;
96688182 esac
9669 if test yes = "$try_normal_branch" \
8183 if test "$try_normal_branch" = yes \
96708184 && { test "$len" -lt "$max_cmd_len" \
96718185 || test "$max_cmd_len" -le -1; }
96728186 then
96778191 output_la=$func_basename_result
96788192 save_libobjs=$libobjs
96798193 save_output=$output
9680 output=$output_objdir/$output_la.nm
8194 output=${output_objdir}/${output_la}.nm
96818195 func_to_tool_file "$output"
96828196 libobjs=$nm_file_list_spec$func_to_tool_file_result
96838197 func_append delfiles " $output"
97008214 break
97018215 fi
97028216 done
9703 IFS=$save_ifs
9704 if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
8217 IFS="$save_ifs"
8218 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
97058219 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
97068220 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
97078221 fi
97098223 fi
97108224
97118225 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9712 tmp_export_symbols=$export_symbols
9713 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8226 tmp_export_symbols="$export_symbols"
8227 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
97148228 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
97158229 fi
97168230
9717 if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
8231 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
97188232 # The given exports_symbols file has to be filtered, so filter it.
9719 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8233 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
97208234 # FIXME: $output_objdir/$libname.filter potentially contains lots of
9721 # 's' commands, which not all seds can handle. GNU sed should be fine
8235 # 's' commands which not all seds can handle. GNU sed should be fine
97228236 # though. Also, the filter scales superlinearly with the number of
97238237 # global variables. join(1) would be nice here, but unfortunately
97248238 # isn't a blessed tool.
97378251 ;;
97388252 esac
97398253 done
9740 deplibs=$tmp_deplibs
8254 deplibs="$tmp_deplibs"
97418255
97428256 if test -n "$convenience"; then
97438257 if test -n "$whole_archive_flag_spec" &&
9744 test yes = "$compiler_needs_object" &&
8258 test "$compiler_needs_object" = yes &&
97458259 test -z "$libobjs"; then
97468260 # extract the archives, so we have objects to list.
97478261 # TODO: could optimize this to just extract one archive.
97528266 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
97538267 test "X$libobjs" = "X " && libobjs=
97548268 else
9755 gentop=$output_objdir/${outputname}x
8269 gentop="$output_objdir/${outputname}x"
97568270 func_append generated " $gentop"
97578271
97588272 func_extract_archives $gentop $convenience
97618275 fi
97628276 fi
97638277
9764 if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
8278 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
97658279 eval flag=\"$thread_safe_flag_spec\"
97668280 func_append linker_flags " $flag"
97678281 fi
97688282
97698283 # Make a backup of the uninstalled library when relinking
9770 if test relink = "$opt_mode"; then
8284 if test "$opt_mode" = relink; then
97718285 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
97728286 fi
97738287
97748288 # Do each of the archive commands.
9775 if test yes = "$module" && test -n "$module_cmds"; then
8289 if test "$module" = yes && test -n "$module_cmds" ; then
97768290 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
97778291 eval test_cmds=\"$module_expsym_cmds\"
97788292 cmds=$module_expsym_cmds
97908304 fi
97918305 fi
97928306
9793 if test : != "$skipped_export" &&
8307 if test "X$skipped_export" != "X:" &&
97948308 func_len " $test_cmds" &&
97958309 len=$func_len_result &&
97968310 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
98238337 last_robj=
98248338 k=1
98258339
9826 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
9827 output=$output_objdir/$output_la.lnkscript
8340 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8341 output=${output_objdir}/${output_la}.lnkscript
98288342 func_verbose "creating GNU ld script: $output"
98298343 echo 'INPUT (' > $output
98308344 for obj in $save_libobjs
98368350 func_append delfiles " $output"
98378351 func_to_tool_file "$output"
98388352 output=$func_to_tool_file_result
9839 elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
9840 output=$output_objdir/$output_la.lnk
8353 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8354 output=${output_objdir}/${output_la}.lnk
98418355 func_verbose "creating linker input file list: $output"
98428356 : > $output
98438357 set x $save_libobjs
98448358 shift
98458359 firstobj=
9846 if test yes = "$compiler_needs_object"; then
8360 if test "$compiler_needs_object" = yes; then
98478361 firstobj="$1 "
98488362 shift
98498363 fi
98588372 else
98598373 if test -n "$save_libobjs"; then
98608374 func_verbose "creating reloadable object files..."
9861 output=$output_objdir/$output_la-$k.$objext
8375 output=$output_objdir/$output_la-${k}.$objext
98628376 eval test_cmds=\"$reload_cmds\"
98638377 func_len " $test_cmds"
98648378 len0=$func_len_result
98708384 func_len " $obj"
98718385 func_arith $len + $func_len_result
98728386 len=$func_arith_result
9873 if test -z "$objlist" ||
8387 if test "X$objlist" = X ||
98748388 test "$len" -lt "$max_cmd_len"; then
98758389 func_append objlist " $obj"
98768390 else
98778391 # The command $test_cmds is almost too long, add a
98788392 # command to the queue.
9879 if test 1 -eq "$k"; then
8393 if test "$k" -eq 1 ; then
98808394 # The first file doesn't have a previous command to add.
98818395 reload_objs=$objlist
98828396 eval concat_cmds=\"$reload_cmds\"
98868400 reload_objs="$objlist $last_robj"
98878401 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
98888402 fi
9889 last_robj=$output_objdir/$output_la-$k.$objext
8403 last_robj=$output_objdir/$output_la-${k}.$objext
98908404 func_arith $k + 1
98918405 k=$func_arith_result
9892 output=$output_objdir/$output_la-$k.$objext
8406 output=$output_objdir/$output_la-${k}.$objext
98938407 objlist=" $obj"
98948408 func_len " $last_robj"
98958409 func_arith $len0 + $func_len_result
99018415 # files will link in the last one created.
99028416 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
99038417 reload_objs="$objlist $last_robj"
9904 eval concat_cmds=\"\$concat_cmds$reload_cmds\"
8418 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
99058419 if test -n "$last_robj"; then
9906 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8420 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
99078421 fi
99088422 func_append delfiles " $output"
99098423
99118425 output=
99128426 fi
99138427
9914 ${skipped_export-false} && {
9915 func_verbose "generating symbol list for '$libname.la'"
9916 export_symbols=$output_objdir/$libname.exp
8428 if ${skipped_export-false}; then
8429 func_verbose "generating symbol list for \`$libname.la'"
8430 export_symbols="$output_objdir/$libname.exp"
99178431 $opt_dry_run || $RM $export_symbols
99188432 libobjs=$output
99198433 # Append the command to create the export file.
99228436 if test -n "$last_robj"; then
99238437 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
99248438 fi
9925 }
8439 fi
99268440
99278441 test -n "$save_libobjs" &&
99288442 func_verbose "creating a temporary reloadable object file: $output"
99298443
99308444 # Loop through the commands generated above and execute them.
9931 save_ifs=$IFS; IFS='~'
8445 save_ifs="$IFS"; IFS='~'
99328446 for cmd in $concat_cmds; do
9933 IFS=$save_ifs
9934 $opt_quiet || {
8447 IFS="$save_ifs"
8448 $opt_silent || {
99358449 func_quote_for_expand "$cmd"
99368450 eval "func_echo $func_quote_for_expand_result"
99378451 }
99398453 lt_exit=$?
99408454
99418455 # Restore the uninstalled library and exit
9942 if test relink = "$opt_mode"; then
8456 if test "$opt_mode" = relink; then
99438457 ( cd "$output_objdir" && \
99448458 $RM "${realname}T" && \
99458459 $MV "${realname}U" "$realname" )
99488462 exit $lt_exit
99498463 }
99508464 done
9951 IFS=$save_ifs
8465 IFS="$save_ifs"
99528466
99538467 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
99548468 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
99568470 fi
99578471 fi
99588472
9959 ${skipped_export-false} && {
8473 if ${skipped_export-false}; then
99608474 if test -n "$export_symbols" && test -n "$include_expsyms"; then
9961 tmp_export_symbols=$export_symbols
9962 test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8475 tmp_export_symbols="$export_symbols"
8476 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
99638477 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
99648478 fi
99658479
99668480 if test -n "$orig_export_symbols"; then
99678481 # The given exports_symbols file has to be filtered, so filter it.
9968 func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8482 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
99698483 # FIXME: $output_objdir/$libname.filter potentially contains lots of
9970 # 's' commands, which not all seds can handle. GNU sed should be fine
8484 # 's' commands which not all seds can handle. GNU sed should be fine
99718485 # though. Also, the filter scales superlinearly with the number of
99728486 # global variables. join(1) would be nice here, but unfortunately
99738487 # isn't a blessed tool.
99768490 export_symbols=$output_objdir/$libname.def
99778491 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
99788492 fi
9979 }
8493 fi
99808494
99818495 libobjs=$output
99828496 # Restore the value of output.
99908504 # value of $libobjs for piecewise linking.
99918505
99928506 # Do each of the archive commands.
9993 if test yes = "$module" && test -n "$module_cmds"; then
8507 if test "$module" = yes && test -n "$module_cmds" ; then
99948508 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
99958509 cmds=$module_expsym_cmds
99968510 else
100128526
100138527 # Add any objects from preloaded convenience libraries
100148528 if test -n "$dlprefiles"; then
10015 gentop=$output_objdir/${outputname}x
8529 gentop="$output_objdir/${outputname}x"
100168530 func_append generated " $gentop"
100178531
100188532 func_extract_archives $gentop $dlprefiles
100208534 test "X$libobjs" = "X " && libobjs=
100218535 fi
100228536
10023 save_ifs=$IFS; IFS='~'
8537 save_ifs="$IFS"; IFS='~'
100248538 for cmd in $cmds; do
10025 IFS=$sp$nl
8539 IFS="$save_ifs"
100268540 eval cmd=\"$cmd\"
10027 IFS=$save_ifs
10028 $opt_quiet || {
8541 $opt_silent || {
100298542 func_quote_for_expand "$cmd"
100308543 eval "func_echo $func_quote_for_expand_result"
100318544 }
100338546 lt_exit=$?
100348547
100358548 # Restore the uninstalled library and exit
10036 if test relink = "$opt_mode"; then
8549 if test "$opt_mode" = relink; then
100378550 ( cd "$output_objdir" && \
100388551 $RM "${realname}T" && \
100398552 $MV "${realname}U" "$realname" )
100428555 exit $lt_exit
100438556 }
100448557 done
10045 IFS=$save_ifs
8558 IFS="$save_ifs"
100468559
100478560 # Restore the uninstalled library and exit
10048 if test relink = "$opt_mode"; then
8561 if test "$opt_mode" = relink; then
100498562 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
100508563
100518564 if test -n "$convenience"; then
100658578 done
100668579
100678580 # If -module or -export-dynamic was specified, set the dlname.
10068 if test yes = "$module" || test yes = "$export_dynamic"; then
8581 if test "$module" = yes || test "$export_dynamic" = yes; then
100698582 # On all known operating systems, these are identical.
10070 dlname=$soname
8583 dlname="$soname"
100718584 fi
100728585 fi
100738586 ;;
100748587
100758588 obj)
10076 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
10077 func_warning "'-dlopen' is ignored for objects"
8589 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8590 func_warning "\`-dlopen' is ignored for objects"
100788591 fi
100798592
100808593 case " $deplibs" in
100818594 *\ -l* | *\ -L*)
10082 func_warning "'-l' and '-L' are ignored for objects" ;;
8595 func_warning "\`-l' and \`-L' are ignored for objects" ;;
100838596 esac
100848597
100858598 test -n "$rpath" && \
10086 func_warning "'-rpath' is ignored for objects"
8599 func_warning "\`-rpath' is ignored for objects"
100878600
100888601 test -n "$xrpath" && \
10089 func_warning "'-R' is ignored for objects"
8602 func_warning "\`-R' is ignored for objects"
100908603
100918604 test -n "$vinfo" && \
10092 func_warning "'-version-info' is ignored for objects"
8605 func_warning "\`-version-info' is ignored for objects"
100938606
100948607 test -n "$release" && \
10095 func_warning "'-release' is ignored for objects"
8608 func_warning "\`-release' is ignored for objects"
100968609
100978610 case $output in
100988611 *.lo)
100998612 test -n "$objs$old_deplibs" && \
10100 func_fatal_error "cannot build library object '$output' from non-libtool objects"
8613 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
101018614
101028615 libobj=$output
101038616 func_lo2o "$libobj"
101058618 ;;
101068619 *)
101078620 libobj=
10108 obj=$output
8621 obj="$output"
101098622 ;;
101108623 esac
101118624
101188631 # the extraction.
101198632 reload_conv_objs=
101208633 gentop=
10121 # if reload_cmds runs $LD directly, get rid of -Wl from
10122 # whole_archive_flag_spec and hope we can get by with turning comma
10123 # into space.
10124 case $reload_cmds in
10125 *\$LD[\ \$]*) wl= ;;
10126 esac
8634 # reload_cmds runs $LD directly, so let us get rid of
8635 # -Wl from whole_archive_flag_spec and hope we can get by with
8636 # turning comma into space..
8637 wl=
8638
101278639 if test -n "$convenience"; then
101288640 if test -n "$whole_archive_flag_spec"; then
101298641 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10130 test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10131 reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
8642 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
101328643 else
10133 gentop=$output_objdir/${obj}x
8644 gentop="$output_objdir/${obj}x"
101348645 func_append generated " $gentop"
101358646
101368647 func_extract_archives $gentop $convenience
101398650 fi
101408651
101418652 # If we're not building shared, we need to use non_pic_objs
10142 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
8653 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
101438654
101448655 # Create the old-style object.
10145 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
10146
10147 output=$obj
8656 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8657
8658 output="$obj"
101488659 func_execute_cmds "$reload_cmds" 'exit $?'
101498660
101508661 # Exit if we aren't doing a library object file.
101568667 exit $EXIT_SUCCESS
101578668 fi
101588669
10159 test yes = "$build_libtool_libs" || {
8670 if test "$build_libtool_libs" != yes; then
101608671 if test -n "$gentop"; then
101618672 func_show_eval '${RM}r "$gentop"'
101628673 fi
101668677 # $show "echo timestamp > $libobj"
101678678 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
101688679 exit $EXIT_SUCCESS
10169 }
10170
10171 if test -n "$pic_flag" || test default != "$pic_mode"; then
8680 fi
8681
8682 if test -n "$pic_flag" || test "$pic_mode" != default; then
101728683 # Only do commands if we really have different PIC objects.
101738684 reload_objs="$libobjs $reload_conv_objs"
10174 output=$libobj
8685 output="$libobj"
101758686 func_execute_cmds "$reload_cmds" 'exit $?'
101768687 fi
101778688
101888699 output=$func_stripname_result.exe;;
101898700 esac
101908701 test -n "$vinfo" && \
10191 func_warning "'-version-info' is ignored for programs"
8702 func_warning "\`-version-info' is ignored for programs"
101928703
101938704 test -n "$release" && \
10194 func_warning "'-release' is ignored for programs"
10195
10196 $preload \
10197 && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
10198 && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
8705 func_warning "\`-release' is ignored for programs"
8706
8707 test "$preload" = yes \
8708 && test "$dlopen_support" = unknown \
8709 && test "$dlopen_self" = unknown \
8710 && test "$dlopen_self_static" = unknown && \
8711 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
101998712
102008713 case $host in
102018714 *-*-rhapsody* | *-*-darwin1.[012])
102098722 *-*-darwin*)
102108723 # Don't allow lazy linking, it breaks C++ global constructors
102118724 # But is supposedly fixed on 10.4 or later (yay!).
10212 if test CXX = "$tagname"; then
8725 if test "$tagname" = CXX ; then
102138726 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
102148727 10.[0123])
10215 func_append compile_command " $wl-bind_at_load"
10216 func_append finalize_command " $wl-bind_at_load"
8728 func_append compile_command " ${wl}-bind_at_load"
8729 func_append finalize_command " ${wl}-bind_at_load"
102178730 ;;
102188731 esac
102198732 fi
102498762 *) func_append new_libs " $deplib" ;;
102508763 esac
102518764 done
10252 compile_deplibs=$new_libs
8765 compile_deplibs="$new_libs"
102538766
102548767
102558768 func_append compile_command " $compile_deplibs"
102738786 if test -n "$hardcode_libdir_flag_spec"; then
102748787 if test -n "$hardcode_libdir_separator"; then
102758788 if test -z "$hardcode_libdirs"; then
10276 hardcode_libdirs=$libdir
8789 hardcode_libdirs="$libdir"
102778790 else
102788791 # Just accumulate the unique libdirs.
102798792 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
102968809 fi
102978810 case $host in
102988811 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10299 testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
8812 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
103008813 case :$dllsearchpath: in
103018814 *":$libdir:"*) ;;
103028815 ::) dllsearchpath=$libdir;;
103138826 # Substitute the hardcoded libdirs into the rpath.
103148827 if test -n "$hardcode_libdir_separator" &&
103158828 test -n "$hardcode_libdirs"; then
10316 libdir=$hardcode_libdirs
8829 libdir="$hardcode_libdirs"
103178830 eval rpath=\" $hardcode_libdir_flag_spec\"
103188831 fi
10319 compile_rpath=$rpath
8832 compile_rpath="$rpath"
103208833
103218834 rpath=
103228835 hardcode_libdirs=
103248837 if test -n "$hardcode_libdir_flag_spec"; then
103258838 if test -n "$hardcode_libdir_separator"; then
103268839 if test -z "$hardcode_libdirs"; then
10327 hardcode_libdirs=$libdir
8840 hardcode_libdirs="$libdir"
103288841 else
103298842 # Just accumulate the unique libdirs.
103308843 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
103498862 # Substitute the hardcoded libdirs into the rpath.
103508863 if test -n "$hardcode_libdir_separator" &&
103518864 test -n "$hardcode_libdirs"; then
10352 libdir=$hardcode_libdirs
8865 libdir="$hardcode_libdirs"
103538866 eval rpath=\" $hardcode_libdir_flag_spec\"
103548867 fi
10355 finalize_rpath=$rpath
10356
10357 if test -n "$libobjs" && test yes = "$build_old_libs"; then
8868 finalize_rpath="$rpath"
8869
8870 if test -n "$libobjs" && test "$build_old_libs" = yes; then
103588871 # Transform all the library objects into standard objects.
103598872 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
103608873 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
103618874 fi
103628875
10363 func_generate_dlsyms "$outputname" "@PROGRAM@" false
8876 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
103648877
103658878 # template prelinking step
103668879 if test -n "$prelink_cmds"; then
103678880 func_execute_cmds "$prelink_cmds" 'exit $?'
103688881 fi
103698882
10370 wrappers_required=:
8883 wrappers_required=yes
103718884 case $host in
103728885 *cegcc* | *mingw32ce*)
103738886 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10374 wrappers_required=false
8887 wrappers_required=no
103758888 ;;
103768889 *cygwin* | *mingw* )
10377 test yes = "$build_libtool_libs" || wrappers_required=false
8890 if test "$build_libtool_libs" != yes; then
8891 wrappers_required=no
8892 fi
103788893 ;;
103798894 *)
10380 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
10381 wrappers_required=false
8895 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8896 wrappers_required=no
103828897 fi
103838898 ;;
103848899 esac
10385 $wrappers_required || {
8900 if test "$wrappers_required" = no; then
103868901 # Replace the output file specification.
103878902 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10388 link_command=$compile_command$compile_rpath
8903 link_command="$compile_command$compile_rpath"
103898904
103908905 # We have no uninstalled library dependencies, so finalize right now.
103918906 exit_status=0
103988913 fi
103998914
104008915 # Delete the generated files.
10401 if test -f "$output_objdir/${outputname}S.$objext"; then
10402 func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
8916 if test -f "$output_objdir/${outputname}S.${objext}"; then
8917 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
104038918 fi
104048919
104058920 exit $exit_status
10406 }
8921 fi
104078922
104088923 if test -n "$compile_shlibpath$finalize_shlibpath"; then
104098924 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
104338948 fi
104348949 fi
104358950
10436 if test yes = "$no_install"; then
8951 if test "$no_install" = yes; then
104378952 # We don't need to create a wrapper script.
10438 link_command=$compile_var$compile_command$compile_rpath
8953 link_command="$compile_var$compile_command$compile_rpath"
104398954 # Replace the output file specification.
104408955 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
104418956 # Delete the old output file.
104528967 exit $EXIT_SUCCESS
104538968 fi
104548969
10455 case $hardcode_action,$fast_install in
10456 relink,*)
10457 # Fast installation is not supported
10458 link_command=$compile_var$compile_command$compile_rpath
10459 relink_command=$finalize_var$finalize_command$finalize_rpath
10460
10461 func_warning "this platform does not like uninstalled shared libraries"
10462 func_warning "'$output' will be relinked during installation"
10463 ;;
10464 *,yes)
10465 link_command=$finalize_var$compile_command$finalize_rpath
10466 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10467 ;;
10468 *,no)
10469 link_command=$compile_var$compile_command$compile_rpath
10470 relink_command=$finalize_var$finalize_command$finalize_rpath
10471 ;;
10472 *,needless)
10473 link_command=$finalize_var$compile_command$finalize_rpath
10474 relink_command=
10475 ;;
10476 esac
8970 if test "$hardcode_action" = relink; then
8971 # Fast installation is not supported
8972 link_command="$compile_var$compile_command$compile_rpath"
8973 relink_command="$finalize_var$finalize_command$finalize_rpath"
8974
8975 func_warning "this platform does not like uninstalled shared libraries"
8976 func_warning "\`$output' will be relinked during installation"
8977 else
8978 if test "$fast_install" != no; then
8979 link_command="$finalize_var$compile_command$finalize_rpath"
8980 if test "$fast_install" = yes; then
8981 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8982 else
8983 # fast_install is set to needless
8984 relink_command=
8985 fi
8986 else
8987 link_command="$compile_var$compile_command$compile_rpath"
8988 relink_command="$finalize_var$finalize_command$finalize_rpath"
8989 fi
8990 fi
104778991
104788992 # Replace the output file specification.
104798993 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
105309044 func_dirname_and_basename "$output" "" "."
105319045 output_name=$func_basename_result
105329046 output_path=$func_dirname_result
10533 cwrappersource=$output_path/$objdir/lt-$output_name.c
10534 cwrapper=$output_path/$output_name.exe
9047 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9048 cwrapper="$output_path/$output_name.exe"
105359049 $RM $cwrappersource $cwrapper
105369050 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
105379051
105529066 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
105539067 $opt_dry_run || {
105549068 # note: this script will not be executed, so do not chmod.
10555 if test "x$build" = "x$host"; then
9069 if test "x$build" = "x$host" ; then
105569070 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
105579071 else
105589072 func_emit_wrapper no > $func_ltwrapper_scriptname_result
105759089 # See if we need to build an old-fashioned archive.
105769090 for oldlib in $oldlibs; do
105779091
10578 case $build_libtool_libs in
10579 convenience)
10580 oldobjs="$libobjs_save $symfileobj"
10581 addlibs=$convenience
9092 if test "$build_libtool_libs" = convenience; then
9093 oldobjs="$libobjs_save $symfileobj"
9094 addlibs="$convenience"
9095 build_libtool_libs=no
9096 else
9097 if test "$build_libtool_libs" = module; then
9098 oldobjs="$libobjs_save"
105829099 build_libtool_libs=no
10583 ;;
10584 module)
10585 oldobjs=$libobjs_save
10586 addlibs=$old_convenience
10587 build_libtool_libs=no
10588 ;;
10589 *)
9100 else
105909101 oldobjs="$old_deplibs $non_pic_objects"
10591 $preload && test -f "$symfileobj" \
10592 && func_append oldobjs " $symfileobj"
10593 addlibs=$old_convenience
10594 ;;
10595 esac
9102 if test "$preload" = yes && test -f "$symfileobj"; then
9103 func_append oldobjs " $symfileobj"
9104 fi
9105 fi
9106 addlibs="$old_convenience"
9107 fi
105969108
105979109 if test -n "$addlibs"; then
10598 gentop=$output_objdir/${outputname}x
9110 gentop="$output_objdir/${outputname}x"
105999111 func_append generated " $gentop"
106009112
106019113 func_extract_archives $gentop $addlibs
106039115 fi
106049116
106059117 # Do each command in the archive commands.
10606 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
9118 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
106079119 cmds=$old_archive_from_new_cmds
106089120 else
106099121
106109122 # Add any objects from preloaded convenience libraries
106119123 if test -n "$dlprefiles"; then
10612 gentop=$output_objdir/${outputname}x
9124 gentop="$output_objdir/${outputname}x"
106139125 func_append generated " $gentop"
106149126
106159127 func_extract_archives $gentop $dlprefiles
106309142 :
106319143 else
106329144 echo "copying selected object files to avoid basename conflicts..."
10633 gentop=$output_objdir/${outputname}x
9145 gentop="$output_objdir/${outputname}x"
106349146 func_append generated " $gentop"
106359147 func_mkdir_p "$gentop"
106369148 save_oldobjs=$oldobjs
106399151 for obj in $save_oldobjs
106409152 do
106419153 func_basename "$obj"
10642 objbase=$func_basename_result
9154 objbase="$func_basename_result"
106439155 case " $oldobjs " in
106449156 " ") oldobjs=$obj ;;
106459157 *[\ /]"$objbase "*)
107089220 else
107099221 # the above command should be used before it gets too long
107109222 oldobjs=$objlist
10711 if test "$obj" = "$last_oldobj"; then
9223 if test "$obj" = "$last_oldobj" ; then
107129224 RANLIB=$save_RANLIB
107139225 fi
107149226 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10715 eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
9227 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
107169228 objlist=
107179229 len=$len0
107189230 fi
107199231 done
107209232 RANLIB=$save_RANLIB
107219233 oldobjs=$objlist
10722 if test -z "$oldobjs"; then
9234 if test "X$oldobjs" = "X" ; then
107239235 eval cmds=\"\$concat_cmds\"
107249236 else
107259237 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
107369248 case $output in
107379249 *.la)
107389250 old_library=
10739 test yes = "$build_old_libs" && old_library=$libname.$libext
9251 test "$build_old_libs" = yes && old_library="$libname.$libext"
107409252 func_verbose "creating $output"
107419253
107429254 # Preserve any variables that may affect compiler behavior
107519263 fi
107529264 done
107539265 # Quote the link command for shipping.
10754 relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9266 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
107559267 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
10756 if test yes = "$hardcode_automatic"; then
9268 if test "$hardcode_automatic" = yes ; then
107579269 relink_command=
107589270 fi
107599271
107609272 # Only create the output if not a dry run.
107619273 $opt_dry_run || {
107629274 for installed in no yes; do
10763 if test yes = "$installed"; then
9275 if test "$installed" = yes; then
107649276 if test -z "$install_libdir"; then
107659277 break
107669278 fi
10767 output=$output_objdir/${outputname}i
9279 output="$output_objdir/$outputname"i
107689280 # Replace all uninstalled libtool libraries with the installed ones
107699281 newdependency_libs=
107709282 for deplib in $dependency_libs; do
107719283 case $deplib in
107729284 *.la)
107739285 func_basename "$deplib"
10774 name=$func_basename_result
9286 name="$func_basename_result"
107759287 func_resolve_sysroot "$deplib"
10776 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9288 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
107779289 test -z "$libdir" && \
10778 func_fatal_error "'$deplib' is not a valid libtool archive"
9290 func_fatal_error "\`$deplib' is not a valid libtool archive"
107799291 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
107809292 ;;
107819293 -L*)
107919303 *) func_append newdependency_libs " $deplib" ;;
107929304 esac
107939305 done
10794 dependency_libs=$newdependency_libs
9306 dependency_libs="$newdependency_libs"
107959307 newdlfiles=
107969308
107979309 for lib in $dlfiles; do
107989310 case $lib in
107999311 *.la)
108009312 func_basename "$lib"
10801 name=$func_basename_result
10802 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9313 name="$func_basename_result"
9314 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
108039315 test -z "$libdir" && \
10804 func_fatal_error "'$lib' is not a valid libtool archive"
9316 func_fatal_error "\`$lib' is not a valid libtool archive"
108059317 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
108069318 ;;
108079319 *) func_append newdlfiles " $lib" ;;
108089320 esac
108099321 done
10810 dlfiles=$newdlfiles
9322 dlfiles="$newdlfiles"
108119323 newdlprefiles=
108129324 for lib in $dlprefiles; do
108139325 case $lib in
108179329 # didn't already link the preopened objects directly into
108189330 # the library:
108199331 func_basename "$lib"
10820 name=$func_basename_result
10821 eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9332 name="$func_basename_result"
9333 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
108229334 test -z "$libdir" && \
10823 func_fatal_error "'$lib' is not a valid libtool archive"
9335 func_fatal_error "\`$lib' is not a valid libtool archive"
108249336 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
108259337 ;;
108269338 esac
108279339 done
10828 dlprefiles=$newdlprefiles
9340 dlprefiles="$newdlprefiles"
108299341 else
108309342 newdlfiles=
108319343 for lib in $dlfiles; do
108329344 case $lib in
10833 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9345 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
108349346 *) abs=`pwd`"/$lib" ;;
108359347 esac
108369348 func_append newdlfiles " $abs"
108379349 done
10838 dlfiles=$newdlfiles
9350 dlfiles="$newdlfiles"
108399351 newdlprefiles=
108409352 for lib in $dlprefiles; do
108419353 case $lib in
10842 [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9354 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
108439355 *) abs=`pwd`"/$lib" ;;
108449356 esac
108459357 func_append newdlprefiles " $abs"
108469358 done
10847 dlprefiles=$newdlprefiles
9359 dlprefiles="$newdlprefiles"
108489360 fi
108499361 $RM $output
108509362 # place dlname in correct position for cygwin
108609372 case $host,$output,$installed,$module,$dlname in
108619373 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
108629374 # If a -bindir argument was supplied, place the dll there.
10863 if test -n "$bindir"; then
9375 if test "x$bindir" != x ;
9376 then
108649377 func_relative_path "$install_libdir" "$bindir"
10865 tdlname=$func_relative_path_result/$dlname
9378 tdlname=$func_relative_path_result$dlname
108669379 else
108679380 # Otherwise fall back on heuristic.
108689381 tdlname=../bin/$dlname
108719384 esac
108729385 $ECHO > $output "\
108739386 # $outputname - a libtool library file
10874 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
9387 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
108759388 #
108769389 # Please DO NOT delete this file!
108779390 # It is necessary for linking the library.
108859398 # The name of the static archive.
108869399 old_library='$old_library'
108879400
10888 # Linker flags that cannot go in dependency_libs.
9401 # Linker flags that can not go in dependency_libs.
108899402 inherited_linker_flags='$new_inherited_linker_flags'
108909403
108919404 # Libraries that this one depends upon.
109119424
109129425 # Directory that this library needs to be installed in:
109139426 libdir='$install_libdir'"
10914 if test no,yes = "$installed,$need_relink"; then
9427 if test "$installed" = no && test "$need_relink" = yes; then
109159428 $ECHO >> $output "\
109169429 relink_command=\"$relink_command\""
109179430 fi
109269439 exit $EXIT_SUCCESS
109279440 }
109289441
10929 if test link = "$opt_mode" || test relink = "$opt_mode"; then
10930 func_mode_link ${1+"$@"}
10931 fi
9442 { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9443 func_mode_link ${1+"$@"}
109329444
109339445
109349446 # func_mode_uninstall arg...
109359447 func_mode_uninstall ()
109369448 {
10937 $debug_cmd
10938
10939 RM=$nonopt
9449 $opt_debug
9450 RM="$nonopt"
109409451 files=
10941 rmforce=false
9452 rmforce=
109429453 exit_status=0
109439454
109449455 # This variable tells wrapper scripts just to set variables rather
109459456 # than running their programs.
10946 libtool_install_magic=$magic
9457 libtool_install_magic="$magic"
109479458
109489459 for arg
109499460 do
109509461 case $arg in
10951 -f) func_append RM " $arg"; rmforce=: ;;
9462 -f) func_append RM " $arg"; rmforce=yes ;;
109529463 -*) func_append RM " $arg" ;;
109539464 *) func_append files " $arg" ;;
109549465 esac
109619472
109629473 for file in $files; do
109639474 func_dirname "$file" "" "."
10964 dir=$func_dirname_result
10965 if test . = "$dir"; then
10966 odir=$objdir
9475 dir="$func_dirname_result"
9476 if test "X$dir" = X.; then
9477 odir="$objdir"
109679478 else
10968 odir=$dir/$objdir
9479 odir="$dir/$objdir"
109699480 fi
109709481 func_basename "$file"
10971 name=$func_basename_result
10972 test uninstall = "$opt_mode" && odir=$dir
9482 name="$func_basename_result"
9483 test "$opt_mode" = uninstall && odir="$dir"
109739484
109749485 # Remember odir for removal later, being careful to avoid duplicates
10975 if test clean = "$opt_mode"; then
9486 if test "$opt_mode" = clean; then
109769487 case " $rmdirs " in
109779488 *" $odir "*) ;;
109789489 *) func_append rmdirs " $odir" ;;
109879498 elif test -d "$file"; then
109889499 exit_status=1
109899500 continue
10990 elif $rmforce; then
9501 elif test "$rmforce" = yes; then
109919502 continue
109929503 fi
109939504
10994 rmfiles=$file
9505 rmfiles="$file"
109959506
109969507 case $name in
109979508 *.la)
110059516 done
110069517 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
110079518
11008 case $opt_mode in
9519 case "$opt_mode" in
110099520 clean)
110109521 case " $library_names " in
110119522 *" $dlname "*) ;;
110169527 uninstall)
110179528 if test -n "$library_names"; then
110189529 # Do each command in the postuninstall commands.
11019 func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
9530 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
110209531 fi
110219532
110229533 if test -n "$old_library"; then
110239534 # Do each command in the old_postuninstall commands.
11024 func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
9535 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
110259536 fi
110269537 # FIXME: should reinstall the best remaining shared library.
110279538 ;;
110379548 func_source $dir/$name
110389549
110399550 # Add PIC object to the list of files to remove.
11040 if test -n "$pic_object" && test none != "$pic_object"; then
9551 if test -n "$pic_object" &&
9552 test "$pic_object" != none; then
110419553 func_append rmfiles " $dir/$pic_object"
110429554 fi
110439555
110449556 # Add non-PIC object to the list of files to remove.
11045 if test -n "$non_pic_object" && test none != "$non_pic_object"; then
9557 if test -n "$non_pic_object" &&
9558 test "$non_pic_object" != none; then
110469559 func_append rmfiles " $dir/$non_pic_object"
110479560 fi
110489561 fi
110499562 ;;
110509563
110519564 *)
11052 if test clean = "$opt_mode"; then
9565 if test "$opt_mode" = clean ; then
110539566 noexename=$name
110549567 case $file in
110559568 *.exe)
110769589
110779590 # note $name still contains .exe if it was in $file originally
110789591 # as does the version of $file that was added into $rmfiles
11079 func_append rmfiles " $odir/$name $odir/${name}S.$objext"
11080 if test yes = "$fast_install" && test -n "$relink_command"; then
9592 func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
9593 if test "$fast_install" = yes && test -n "$relink_command"; then
110819594 func_append rmfiles " $odir/lt-$name"
110829595 fi
11083 if test "X$noexename" != "X$name"; then
11084 func_append rmfiles " $odir/lt-$noexename.c"
9596 if test "X$noexename" != "X$name" ; then
9597 func_append rmfiles " $odir/lt-${noexename}.c"
110859598 fi
110869599 fi
110879600 fi
110909603 func_show_eval "$RM $rmfiles" 'exit_status=1'
110919604 done
110929605
11093 # Try to remove the $objdir's in the directories where we deleted files
9606 # Try to remove the ${objdir}s in the directories where we deleted files
110949607 for dir in $rmdirs; do
110959608 if test -d "$dir"; then
110969609 func_show_eval "rmdir $dir >/dev/null 2>&1"
111009613 exit $exit_status
111019614 }
111029615
11103 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
11104 func_mode_uninstall ${1+"$@"}
11105 fi
9616 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
9617 func_mode_uninstall ${1+"$@"}
111069618
111079619 test -z "$opt_mode" && {
11108 help=$generic_help
9620 help="$generic_help"
111099621 func_fatal_help "you must specify a MODE"
111109622 }
111119623
111129624 test -z "$exec_cmd" && \
11113 func_fatal_help "invalid operation mode '$opt_mode'"
9625 func_fatal_help "invalid operation mode \`$opt_mode'"
111149626
111159627 if test -n "$exec_cmd"; then
111169628 eval exec "$exec_cmd"
111219633
111229634
111239635 # The TAGs below are defined such that we never get into a situation
11124 # where we disable both kinds of libraries. Given conflicting
9636 # in which we disable both kinds of libraries. Given conflicting
111259637 # choices, we go for a static library, that is the most portable,
111269638 # since we can't tell whether shared libraries were disabled because
111279639 # the user asked for that or because the platform doesn't support
111449656 # mode:shell-script
111459657 # sh-indentation:2
111469658 # End:
9659 # vi:sw=2
9660
00 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
11 #
2 # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
2 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
3 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
4 # Foundation, Inc.
35 # Written by Gordon Matzigkeit, 1996
46 #
57 # This file is free software; the Free Software Foundation gives
79 # modifications, as long as this notice is preserved.
810
911 m4_define([_LT_COPYING], [dnl
10 # Copyright (C) 2014 Free Software Foundation, Inc.
11 # This is free software; see the source for copying conditions. There is NO
12 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
14 # GNU Libtool is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of of the License, or
17 # (at your option) any later version.
12 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
13 # 2006, 2007, 2008, 2009, 2010, 2011 Free Software
14 # Foundation, Inc.
15 # Written by Gordon Matzigkeit, 1996
1816 #
19 # As a special exception to the GNU General Public License, if you
20 # distribute this file as part of a program or library that is built
21 # using GNU Libtool, you may include this file under the same
22 # distribution terms that you use for the rest of that program.
17 # This file is part of GNU Libtool.
2318 #
24 # GNU Libtool is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # GNU Libtool is free software; you can redistribute it and/or
20 # modify it under the terms of the GNU General Public License as
21 # published by the Free Software Foundation; either version 2 of
22 # the License, or (at your option) any later version.
23 #
24 # As a special exception to the GNU General Public License,
25 # if you distribute this file as part of a program or library that
26 # is built using GNU Libtool, you may include this file under the
27 # same distribution terms that you use for the rest of that program.
28 #
29 # GNU Libtool is distributed in the hope that it will be useful,
30 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2631 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2732 # GNU General Public License for more details.
2833 #
2934 # You should have received a copy of the GNU General Public License
30 # along with this program. If not, see <http://www.gnu.org/licenses/>.
35 # along with GNU Libtool; see the file COPYING. If not, a copy
36 # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
37 # obtained by writing to the Free Software Foundation, Inc.,
38 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3139 ])
3240
33 # serial 58 LT_INIT
41 # serial 57 LT_INIT
3442
3543
3644 # LT_PREREQ(VERSION)
5866 # LT_INIT([OPTIONS])
5967 # ------------------
6068 AC_DEFUN([LT_INIT],
61 [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
69 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
6270 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
6371 AC_BEFORE([$0], [LT_LANG])dnl
6472 AC_BEFORE([$0], [LT_OUTPUT])dnl
8290 _LT_SET_OPTIONS([$0], [$1])
8391
8492 # This can be used to rebuild libtool when needed
85 LIBTOOL_DEPS=$ltmain
93 LIBTOOL_DEPS="$ltmain"
8694
8795 # Always use our own libtool.
8896 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
102110 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
103111
104112
105 # _LT_PREPARE_CC_BASENAME
106 # -----------------------
107 m4_defun([_LT_PREPARE_CC_BASENAME], [
108 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
109 func_cc_basename ()
110 {
111 for cc_temp in @S|@*""; do
112 case $cc_temp in
113 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
114 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
115 \-*) ;;
116 *) break;;
117 esac
118 done
119 func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
120 }
121 ])# _LT_PREPARE_CC_BASENAME
122
123
124113 # _LT_CC_BASENAME(CC)
125114 # -------------------
126 # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
127 # but that macro is also expanded into generated libtool script, which
128 # arranges for $SED and $ECHO to be set by different means.
115 # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
129116 m4_defun([_LT_CC_BASENAME],
130 [m4_require([_LT_PREPARE_CC_BASENAME])dnl
131 AC_REQUIRE([_LT_DECL_SED])dnl
132 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
133 func_cc_basename $1
134 cc_basename=$func_cc_basename_result
117 [for cc_temp in $1""; do
118 case $cc_temp in
119 compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
120 distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
121 \-*) ;;
122 *) break;;
123 esac
124 done
125 cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
135126 ])
136127
137128
138129 # _LT_FILEUTILS_DEFAULTS
139130 # ----------------------
140131 # It is okay to use these file commands and assume they have been set
141 # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
132 # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
142133 m4_defun([_LT_FILEUTILS_DEFAULTS],
143134 [: ${CP="cp -f"}
144135 : ${MV="mv -f"}
185176 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
186177 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
187178 m4_require([_LT_WITH_SYSROOT])dnl
188 m4_require([_LT_CMD_TRUNCATE])dnl
189179
190180 _LT_CONFIG_LIBTOOL_INIT([
191 # See if we are running on zsh, and set the options that allow our
181 # See if we are running on zsh, and set the options which allow our
192182 # commands through without removal of \ escapes INIT.
193 if test -n "\${ZSH_VERSION+set}"; then
183 if test -n "\${ZSH_VERSION+set}" ; then
194184 setopt NO_GLOB_SUBST
195185 fi
196186 ])
197 if test -n "${ZSH_VERSION+set}"; then
187 if test -n "${ZSH_VERSION+set}" ; then
198188 setopt NO_GLOB_SUBST
199189 fi
200190
207197 # AIX sometimes has problems with the GCC collect2 program. For some
208198 # reason, if we set the COLLECT_NAMES environment variable, the problems
209199 # vanish in a puff of smoke.
210 if test set != "${COLLECT_NAMES+set}"; then
200 if test "X${COLLECT_NAMES+set}" != Xset; then
211201 COLLECT_NAMES=
212202 export COLLECT_NAMES
213203 fi
218208 ofile=libtool
219209 can_build_shared=yes
220210
221 # All known linkers require a '.a' archive for static linking (except MSVC,
211 # All known linkers require a `.a' archive for static linking (except MSVC,
222212 # which needs '.lib').
223213 libext=a
224214
225 with_gnu_ld=$lt_cv_prog_gnu_ld
226
227 old_CC=$CC
228 old_CFLAGS=$CFLAGS
215 with_gnu_ld="$lt_cv_prog_gnu_ld"
216
217 old_CC="$CC"
218 old_CFLAGS="$CFLAGS"
229219
230220 # Set sane defaults for various variables
231221 test -z "$CC" && CC=cc
278268
279269 # _LT_PROG_LTMAIN
280270 # ---------------
281 # Note that this code is called both from 'configure', and 'config.status'
271 # Note that this code is called both from `configure', and `config.status'
282272 # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
283 # 'config.status' has no value for ac_aux_dir unless we are using Automake,
273 # `config.status' has no value for ac_aux_dir unless we are using Automake,
284274 # so we pass a copy along to make sure it has a sensible value anyway.
285275 m4_defun([_LT_PROG_LTMAIN],
286276 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
287277 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
288 ltmain=$ac_aux_dir/ltmain.sh
278 ltmain="$ac_aux_dir/ltmain.sh"
289279 ])# _LT_PROG_LTMAIN
290280
291281
295285
296286 # So that we can recreate a full libtool script including additional
297287 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
298 # in macros and then make a single call at the end using the 'libtool'
288 # in macros and then make a single call at the end using the `libtool'
299289 # label.
300290
301291
430420
431421 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
432422 # ------------------------------------
433 # Quote a variable value, and forward it to 'config.status' so that its
434 # declaration there will have the same value as in 'configure'. VARNAME
423 # Quote a variable value, and forward it to `config.status' so that its
424 # declaration there will have the same value as in `configure'. VARNAME
435425 # must have a single quote delimited value for this to work.
436426 m4_define([_LT_CONFIG_STATUS_DECLARE],
437427 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455445 # Output comment and list of tags supported by the script
456446 m4_defun([_LT_LIBTOOL_TAGS],
457447 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
458 available_tags='_LT_TAGS'dnl
448 available_tags="_LT_TAGS"dnl
459449 ])
460450
461451
483473 # _LT_LIBTOOL_CONFIG_VARS
484474 # -----------------------
485475 # Produce commented declarations of non-tagged libtool config variables
486 # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
476 # suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
487477 # script. Tagged libtool config variables (even for the LIBTOOL CONFIG
488478 # section) are produced by _LT_LIBTOOL_TAG_VARS.
489479 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
509499 # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
510500 # variables for single and double quote escaping we saved from calls
511501 # to _LT_DECL, we can put quote escaped variables declarations
512 # into 'config.status', and then the shell code to quote escape them in
513 # for loops in 'config.status'. Finally, any additional code accumulated
502 # into `config.status', and then the shell code to quote escape them in
503 # for loops in `config.status'. Finally, any additional code accumulated
514504 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
515505 m4_defun([_LT_CONFIG_COMMANDS],
516506 [AC_PROVIDE_IFELSE([LT_OUTPUT],
556546 ]], lt_decl_quote_varnames); do
557547 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
558548 *[[\\\\\\\`\\"\\\$]]*)
559 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
549 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
560550 ;;
561551 *)
562552 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
569559 ]], lt_decl_dquote_varnames); do
570560 case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
571561 *[[\\\\\\\`\\"\\\$]]*)
572 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
562 eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
573563 ;;
574564 *)
575565 eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
585575 # Generate a child script FILE with all initialization necessary to
586576 # reuse the environment learned by the parent script, and make the
587577 # file executable. If COMMENT is supplied, it is inserted after the
588 # '#!' sequence but before initialization text begins. After this
578 # `#!' sequence but before initialization text begins. After this
589579 # macro, additional text can be appended to FILE to form the body of
590580 # the child script. The macro ends with non-zero status if the
591581 # file could not be fully written (such as if the disk is full).
607597 _AS_PREPARE
608598 exec AS_MESSAGE_FD>&1
609599 _ASEOF
610 test 0 = "$lt_write_fail" && chmod +x $1[]dnl
600 test $lt_write_fail = 0 && chmod +x $1[]dnl
611601 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
612602
613603 # LT_OUTPUT
630620 } >&AS_MESSAGE_LOG_FD
631621
632622 lt_cl_help="\
633 '$as_me' creates a local libtool stub from the current configuration,
623 \`$as_me' creates a local libtool stub from the current configuration,
634624 for use in further configure time tests before the real libtool is
635625 generated.
636626
652642 This config.lt script is free software; the Free Software Foundation
653643 gives unlimited permision to copy, distribute and modify it."
654644
655 while test 0 != $[#]
645 while test $[#] != 0
656646 do
657647 case $[1] in
658648 --version | --v* | -V )
665655 lt_cl_silent=: ;;
666656
667657 -*) AC_MSG_ERROR([unrecognized option: $[1]
668 Try '$[0] --help' for more information.]) ;;
658 Try \`$[0] --help' for more information.]) ;;
669659
670660 *) AC_MSG_ERROR([unrecognized argument: $[1]
671 Try '$[0] --help' for more information.]) ;;
661 Try \`$[0] --help' for more information.]) ;;
672662 esac
673663 shift
674664 done
694684 # open by configure. Here we exec the FD to /dev/null, effectively closing
695685 # config.log, so it can be properly (re)opened and appended to by config.lt.
696686 lt_cl_success=:
697 test yes = "$silent" &&
687 test "$silent" = yes &&
698688 lt_config_lt_args="$lt_config_lt_args --quiet"
699689 exec AS_MESSAGE_LOG_FD>/dev/null
700690 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
714704 _LT_CONFIG_SAVE_COMMANDS([
715705 m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
716706 m4_if(_LT_TAG, [C], [
717 # See if we are running on zsh, and set the options that allow our
707 # See if we are running on zsh, and set the options which allow our
718708 # commands through without removal of \ escapes.
719 if test -n "${ZSH_VERSION+set}"; then
709 if test -n "${ZSH_VERSION+set}" ; then
720710 setopt NO_GLOB_SUBST
721711 fi
722712
723 cfgfile=${ofile}T
713 cfgfile="${ofile}T"
724714 trap "$RM \"$cfgfile\"; exit 1" 1 2 15
725715 $RM "$cfgfile"
726716
727717 cat <<_LT_EOF >> "$cfgfile"
728718 #! $SHELL
729 # Generated automatically by $as_me ($PACKAGE) $VERSION
719
720 # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
721 # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
730722 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
731723 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
732
733 # Provide generalized library-building support services.
734 # Written by Gordon Matzigkeit, 1996
735
724 #
736725 _LT_COPYING
737726 _LT_LIBTOOL_TAGS
738
739 # Configured defaults for sys_lib_dlsearch_path munging.
740 : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
741727
742728 # ### BEGIN LIBTOOL CONFIG
743729 _LT_LIBTOOL_CONFIG_VARS
744730 _LT_LIBTOOL_TAG_VARS
745731 # ### END LIBTOOL CONFIG
746
747 _LT_EOF
748
749 cat <<'_LT_EOF' >> "$cfgfile"
750
751 # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
752
753 _LT_PREPARE_MUNGE_PATH_LIST
754 _LT_PREPARE_CC_BASENAME
755
756 # ### END FUNCTIONS SHARED WITH CONFIGURE
757732
758733 _LT_EOF
759734
763738 # AIX sometimes has problems with the GCC collect2 program. For some
764739 # reason, if we set the COLLECT_NAMES environment variable, the problems
765740 # vanish in a puff of smoke.
766 if test set != "${COLLECT_NAMES+set}"; then
741 if test "X${COLLECT_NAMES+set}" != Xset; then
767742 COLLECT_NAMES=
768743 export COLLECT_NAMES
769744 fi
779754 # is reportedly fixed, but why not run on old versions too?
780755 sed '$q' "$ltmain" >> "$cfgfile" \
781756 || (rm -f "$cfgfile"; exit 1)
757
758 _LT_PROG_REPLACE_SHELLFNS
782759
783760 mv -f "$cfgfile" "$ofile" ||
784761 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
797774 [m4_if([$1], [], [
798775 PACKAGE='$PACKAGE'
799776 VERSION='$VERSION'
777 TIMESTAMP='$TIMESTAMP'
800778 RM='$RM'
801779 ofile='$ofile'], [])
802780 ])dnl /_LT_CONFIG_SAVE_COMMANDS
995973
996974 AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
997975 [lt_cv_apple_cc_single_mod=no
998 if test -z "$LT_MULTI_MODULE"; then
976 if test -z "${LT_MULTI_MODULE}"; then
999977 # By default we will add the -single_module flag. You can override
1000978 # by either setting the environment variable LT_MULTI_MODULE
1001979 # non-empty at configure time, or by adding -multi_module to the
1013991 cat conftest.err >&AS_MESSAGE_LOG_FD
1014992 # Otherwise, if the output was created with a 0 exit code from
1015993 # the compiler, it worked.
1016 elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
994 elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1017995 lt_cv_apple_cc_single_mod=yes
1018996 else
1019997 cat conftest.err >&AS_MESSAGE_LOG_FD
10311009 AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
10321010 [lt_cv_ld_exported_symbols_list=yes],
10331011 [lt_cv_ld_exported_symbols_list=no])
1034 LDFLAGS=$save_LDFLAGS
1012 LDFLAGS="$save_LDFLAGS"
10351013 ])
10361014
10371015 AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10531031 _lt_result=$?
10541032 if test -s conftest.err && $GREP force_load conftest.err; then
10551033 cat conftest.err >&AS_MESSAGE_LOG_FD
1056 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1034 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
10571035 lt_cv_ld_force_load=yes
10581036 else
10591037 cat conftest.err >&AS_MESSAGE_LOG_FD
10631041 ])
10641042 case $host_os in
10651043 rhapsody* | darwin1.[[012]])
1066 _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1044 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
10671045 darwin1.*)
1068 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1046 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10691047 darwin*) # darwin 5.x on
10701048 # if running on 10.5 or later, the deployment target defaults
10711049 # to the OS version, if on x86, and 10.4, the deployment
10721050 # target defaults to 10.4. Don't you love it?
10731051 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10741052 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1075 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1076 10.[[012]][[,.]]*)
1077 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1053 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1054 10.[[012]]*)
1055 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10781056 10.*)
1079 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1057 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10801058 esac
10811059 ;;
10821060 esac
1083 if test yes = "$lt_cv_apple_cc_single_mod"; then
1061 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
10841062 _lt_dar_single_mod='$single_module'
10851063 fi
1086 if test yes = "$lt_cv_ld_exported_symbols_list"; then
1087 _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1064 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1065 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
10881066 else
1089 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1067 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
10901068 fi
1091 if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1069 if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
10921070 _lt_dsymutil='~$DSYMUTIL $lib || :'
10931071 else
10941072 _lt_dsymutil=
11081086 _LT_TAGVAR(hardcode_direct, $1)=no
11091087 _LT_TAGVAR(hardcode_automatic, $1)=yes
11101088 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1111 if test yes = "$lt_cv_ld_force_load"; then
1112 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1089 if test "$lt_cv_ld_force_load" = "yes"; then
1090 _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
11131091 m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11141092 [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11151093 else
11161094 _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11171095 fi
11181096 _LT_TAGVAR(link_all_deplibs, $1)=yes
1119 _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1097 _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
11201098 case $cc_basename in
1121 ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1099 ifort*) _lt_dar_can_shared=yes ;;
11221100 *) _lt_dar_can_shared=$GCC ;;
11231101 esac
1124 if test yes = "$_lt_dar_can_shared"; then
1102 if test "$_lt_dar_can_shared" = "yes"; then
11251103 output_verbose_link_cmd=func_echo_all
1126 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
1127 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1128 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
1129 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
1104 _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
1105 _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1106 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
1107 _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
11301108 m4_if([$1], [CXX],
1131 [ if test yes != "$lt_cv_apple_cc_single_mod"; then
1132 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
1133 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
1109 [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1110 _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
1111 _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
11341112 fi
11351113 ],[])
11361114 else
11501128 # Allow to override them for all tags through lt_cv_aix_libpath.
11511129 m4_defun([_LT_SYS_MODULE_PATH_AIX],
11521130 [m4_require([_LT_DECL_SED])dnl
1153 if test set = "${lt_cv_aix_libpath+set}"; then
1131 if test "${lt_cv_aix_libpath+set}" = set; then
11541132 aix_libpath=$lt_cv_aix_libpath
11551133 else
11561134 AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11681146 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11691147 fi],[])
11701148 if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1171 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1149 _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
11721150 fi
11731151 ])
11741152 aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
11881166 # -----------------------
11891167 # Find how we can fake an echo command that does not interpret backslash.
11901168 # In particular, with Autoconf 2.60 or later we add some code to the start
1191 # of the generated configure script that will find a shell with a builtin
1192 # printf (that we can use as an echo command).
1169 # of the generated configure script which will find a shell with a builtin
1170 # printf (which we can use as an echo command).
11931171 m4_defun([_LT_PROG_ECHO_BACKSLASH],
11941172 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11951173 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12171195 # Invoke $ECHO with all args, space-separated.
12181196 func_echo_all ()
12191197 {
1220 $ECHO "$*"
1198 $ECHO "$*"
12211199 }
12221200
1223 case $ECHO in
1201 case "$ECHO" in
12241202 printf*) AC_MSG_RESULT([printf]) ;;
12251203 print*) AC_MSG_RESULT([print -r]) ;;
12261204 *) AC_MSG_RESULT([cat]) ;;
12461224 AC_DEFUN([_LT_WITH_SYSROOT],
12471225 [AC_MSG_CHECKING([for sysroot])
12481226 AC_ARG_WITH([sysroot],
1249 [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1250 [Search for dependent libraries within DIR (or the compiler's sysroot
1251 if not specified).])],
1227 [ --with-sysroot[=DIR] Search for dependent libraries within DIR
1228 (or the compiler's sysroot if not specified).],
12521229 [], [with_sysroot=no])
12531230
12541231 dnl lt_sysroot will always be passed unquoted. We quote it here
12551232 dnl in case the user passed a directory name.
12561233 lt_sysroot=
1257 case $with_sysroot in #(
1234 case ${with_sysroot} in #(
12581235 yes)
1259 if test yes = "$GCC"; then
1236 if test "$GCC" = yes; then
12601237 lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12611238 fi
12621239 ;; #(
12661243 no|'')
12671244 ;; #(
12681245 *)
1269 AC_MSG_RESULT([$with_sysroot])
1246 AC_MSG_RESULT([${with_sysroot}])
12701247 AC_MSG_ERROR([The sysroot must be an absolute path.])
12711248 ;;
12721249 esac
12731250
12741251 AC_MSG_RESULT([${lt_sysroot:-no}])
12751252 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1276 [dependent libraries, and where our libraries should be installed.])])
1253 [dependent libraries, and in which our libraries should be installed.])])
12771254
12781255 # _LT_ENABLE_LOCK
12791256 # ---------------
12811258 [AC_ARG_ENABLE([libtool-lock],
12821259 [AS_HELP_STRING([--disable-libtool-lock],
12831260 [avoid locking (might break parallel builds)])])
1284 test no = "$enable_libtool_lock" || enable_libtool_lock=yes
1261 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
12851262
12861263 # Some flags need to be propagated to the compiler or linker for good
12871264 # libtool support.
12881265 case $host in
12891266 ia64-*-hpux*)
1290 # Find out what ABI is being produced by ac_compile, and set mode
1291 # options accordingly.
1267 # Find out which ABI we are using.
12921268 echo 'int i;' > conftest.$ac_ext
12931269 if AC_TRY_EVAL(ac_compile); then
12941270 case `/usr/bin/file conftest.$ac_objext` in
12951271 *ELF-32*)
1296 HPUX_IA64_MODE=32
1272 HPUX_IA64_MODE="32"
12971273 ;;
12981274 *ELF-64*)
1299 HPUX_IA64_MODE=64
1275 HPUX_IA64_MODE="64"
13001276 ;;
13011277 esac
13021278 fi
13031279 rm -rf conftest*
13041280 ;;
13051281 *-*-irix6*)
1306 # Find out what ABI is being produced by ac_compile, and set linker
1307 # options accordingly.
1282 # Find out which ABI we are using.
13081283 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
13091284 if AC_TRY_EVAL(ac_compile); then
1310 if test yes = "$lt_cv_prog_gnu_ld"; then
1285 if test "$lt_cv_prog_gnu_ld" = yes; then
13111286 case `/usr/bin/file conftest.$ac_objext` in
13121287 *32-bit*)
13131288 LD="${LD-ld} -melf32bsmip"
13361311 rm -rf conftest*
13371312 ;;
13381313
1339 mips64*-*linux*)
1340 # Find out what ABI is being produced by ac_compile, and set linker
1341 # options accordingly.
1342 echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1343 if AC_TRY_EVAL(ac_compile); then
1344 emul=elf
1345 case `/usr/bin/file conftest.$ac_objext` in
1346 *32-bit*)
1347 emul="${emul}32"
1348 ;;
1349 *64-bit*)
1350 emul="${emul}64"
1351 ;;
1352 esac
1353 case `/usr/bin/file conftest.$ac_objext` in
1354 *MSB*)
1355 emul="${emul}btsmip"
1356 ;;
1357 *LSB*)
1358 emul="${emul}ltsmip"
1359 ;;
1360 esac
1361 case `/usr/bin/file conftest.$ac_objext` in
1362 *N32*)
1363 emul="${emul}n32"
1364 ;;
1365 esac
1366 LD="${LD-ld} -m $emul"
1367 fi
1368 rm -rf conftest*
1369 ;;
1370
13711314 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
13721315 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1373 # Find out what ABI is being produced by ac_compile, and set linker
1374 # options accordingly. Note that the listed cases only cover the
1375 # situations where additional linker options are needed (such as when
1376 # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1377 # vice versa); the common cases where no linker options are needed do
1378 # not appear in the list.
1316 # Find out which ABI we are using.
13791317 echo 'int i;' > conftest.$ac_ext
13801318 if AC_TRY_EVAL(ac_compile); then
13811319 case `/usr/bin/file conftest.o` in
13941332 ;;
13951333 esac
13961334 ;;
1397 powerpc64le-*linux*)
1335 powerpc64le-*)
13981336 LD="${LD-ld} -m elf32lppclinux"
13991337 ;;
1400 powerpc64-*linux*)
1338 powerpc64-*)
14011339 LD="${LD-ld} -m elf32ppclinux"
14021340 ;;
14031341 s390x-*linux*)
14161354 x86_64-*linux*)
14171355 LD="${LD-ld} -m elf_x86_64"
14181356 ;;
1419 powerpcle-*linux*)
1357 powerpcle-*)
14201358 LD="${LD-ld} -m elf64lppc"
14211359 ;;
1422 powerpc-*linux*)
1360 powerpc-*)
14231361 LD="${LD-ld} -m elf64ppc"
14241362 ;;
14251363 s390*-*linux*|s390*-*tpf*)
14371375
14381376 *-*-sco3.2v5*)
14391377 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1440 SAVE_CFLAGS=$CFLAGS
1378 SAVE_CFLAGS="$CFLAGS"
14411379 CFLAGS="$CFLAGS -belf"
14421380 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
14431381 [AC_LANG_PUSH(C)
14441382 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
14451383 AC_LANG_POP])
1446 if test yes != "$lt_cv_cc_needs_belf"; then
1384 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
14471385 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1448 CFLAGS=$SAVE_CFLAGS
1386 CFLAGS="$SAVE_CFLAGS"
14491387 fi
14501388 ;;
14511389 *-*solaris*)
1452 # Find out what ABI is being produced by ac_compile, and set linker
1453 # options accordingly.
1390 # Find out which ABI we are using.
14541391 echo 'int i;' > conftest.$ac_ext
14551392 if AC_TRY_EVAL(ac_compile); then
14561393 case `/usr/bin/file conftest.o` in
14581395 case $lt_cv_prog_gnu_ld in
14591396 yes*)
14601397 case $host in
1461 i?86-*-solaris*|x86_64-*-solaris*)
1398 i?86-*-solaris*)
14621399 LD="${LD-ld} -m elf_x86_64"
14631400 ;;
14641401 sparc*-*-solaris*)
14671404 esac
14681405 # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
14691406 if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1470 LD=${LD-ld}_sol2
1407 LD="${LD-ld}_sol2"
14711408 fi
14721409 ;;
14731410 *)
14831420 ;;
14841421 esac
14851422
1486 need_locks=$enable_libtool_lock
1423 need_locks="$enable_libtool_lock"
14871424 ])# _LT_ENABLE_LOCK
14881425
14891426
15021439 [echo conftest.$ac_objext > conftest.lst
15031440 lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
15041441 AC_TRY_EVAL([lt_ar_try])
1505 if test 0 -eq "$ac_status"; then
1442 if test "$ac_status" -eq 0; then
15061443 # Ensure the archiver fails upon bogus file names.
15071444 rm -f conftest.$ac_objext libconftest.a
15081445 AC_TRY_EVAL([lt_ar_try])
1509 if test 0 -ne "$ac_status"; then
1446 if test "$ac_status" -ne 0; then
15101447 lt_cv_ar_at_file=@
15111448 fi
15121449 fi
15141451 ])
15151452 ])
15161453
1517 if test no = "$lt_cv_ar_at_file"; then
1454 if test "x$lt_cv_ar_at_file" = xno; then
15181455 archiver_list_spec=
15191456 else
15201457 archiver_list_spec=$lt_cv_ar_at_file
15451482
15461483 if test -n "$RANLIB"; then
15471484 case $host_os in
1548 bitrig* | openbsd*)
1485 openbsd*)
15491486 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
15501487 ;;
15511488 *)
15811518 [$2=no
15821519 m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
15831520 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1584 lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
1521 lt_compiler_flag="$3"
15851522 # Insert the option either (1) after the last *FLAGS variable, or
15861523 # (2) before a word containing "conftest.", or (3) at the end.
15871524 # Note that $ac_compile itself does not contain backslashes and begins
16081545 $RM conftest*
16091546 ])
16101547
1611 if test yes = "[$]$2"; then
1548 if test x"[$]$2" = xyes; then
16121549 m4_if([$5], , :, [$5])
16131550 else
16141551 m4_if([$6], , :, [$6])
16301567 m4_require([_LT_DECL_SED])dnl
16311568 AC_CACHE_CHECK([$1], [$2],
16321569 [$2=no
1633 save_LDFLAGS=$LDFLAGS
1570 save_LDFLAGS="$LDFLAGS"
16341571 LDFLAGS="$LDFLAGS $3"
16351572 echo "$lt_simple_link_test_code" > conftest.$ac_ext
16361573 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
16491586 fi
16501587 fi
16511588 $RM -r conftest*
1652 LDFLAGS=$save_LDFLAGS
1589 LDFLAGS="$save_LDFLAGS"
16531590 ])
16541591
1655 if test yes = "[$]$2"; then
1592 if test x"[$]$2" = xyes; then
16561593 m4_if([$4], , :, [$4])
16571594 else
16581595 m4_if([$5], , :, [$5])
16731610 AC_MSG_CHECKING([the maximum length of command line arguments])
16741611 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
16751612 i=0
1676 teststring=ABCD
1613 teststring="ABCD"
16771614
16781615 case $build_os in
16791616 msdosdjgpp*)
17131650 lt_cv_sys_max_cmd_len=8192;
17141651 ;;
17151652
1716 bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1653 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
17171654 # This has been around since 386BSD, at least. Likely further.
17181655 if test -x /sbin/sysctl; then
17191656 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
17641701 *)
17651702 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
17661703 if test -n "$lt_cv_sys_max_cmd_len" && \
1767 test undefined != "$lt_cv_sys_max_cmd_len"; then
1704 test undefined != "$lt_cv_sys_max_cmd_len"; then
17681705 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
17691706 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
17701707 else
17711708 # Make teststring a little bigger before we do anything with it.
17721709 # a 1K string should be a reasonable start.
1773 for i in 1 2 3 4 5 6 7 8; do
1710 for i in 1 2 3 4 5 6 7 8 ; do
17741711 teststring=$teststring$teststring
17751712 done
17761713 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
17771714 # If test is not a shell built-in, we'll probably end up computing a
17781715 # maximum length that is only half of the actual maximum length, but
17791716 # we can't tell.
1780 while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1717 while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17811718 = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1782 test 17 != "$i" # 1/2 MB should be enough
1719 test $i != 17 # 1/2 MB should be enough
17831720 do
17841721 i=`expr $i + 1`
17851722 teststring=$teststring$teststring
17951732 ;;
17961733 esac
17971734 ])
1798 if test -n "$lt_cv_sys_max_cmd_len"; then
1735 if test -n $lt_cv_sys_max_cmd_len ; then
17991736 AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
18001737 else
18011738 AC_MSG_RESULT(none)
18231760 # ----------------------------------------------------------------
18241761 m4_defun([_LT_TRY_DLOPEN_SELF],
18251762 [m4_require([_LT_HEADER_DLFCN])dnl
1826 if test yes = "$cross_compiling"; then :
1763 if test "$cross_compiling" = yes; then :
18271764 [$4]
18281765 else
18291766 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
18701807 # endif
18711808 #endif
18721809
1873 /* When -fvisibility=hidden is used, assume the code has been annotated
1810 /* When -fvisbility=hidden is used, assume the code has been annotated
18741811 correspondingly for the symbols needed. */
1875 #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1812 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18761813 int fnord () __attribute__((visibility("default")));
18771814 #endif
18781815
18981835 return status;
18991836 }]
19001837 _LT_EOF
1901 if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1838 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
19021839 (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
19031840 lt_status=$?
19041841 case x$lt_status in
19191856 # ------------------
19201857 AC_DEFUN([LT_SYS_DLOPEN_SELF],
19211858 [m4_require([_LT_HEADER_DLFCN])dnl
1922 if test yes != "$enable_dlopen"; then
1859 if test "x$enable_dlopen" != xyes; then
19231860 enable_dlopen=unknown
19241861 enable_dlopen_self=unknown
19251862 enable_dlopen_self_static=unknown
19291866
19301867 case $host_os in
19311868 beos*)
1932 lt_cv_dlopen=load_add_on
1869 lt_cv_dlopen="load_add_on"
19331870 lt_cv_dlopen_libs=
19341871 lt_cv_dlopen_self=yes
19351872 ;;
19361873
19371874 mingw* | pw32* | cegcc*)
1938 lt_cv_dlopen=LoadLibrary
1875 lt_cv_dlopen="LoadLibrary"
19391876 lt_cv_dlopen_libs=
19401877 ;;
19411878
19421879 cygwin*)
1943 lt_cv_dlopen=dlopen
1880 lt_cv_dlopen="dlopen"
19441881 lt_cv_dlopen_libs=
19451882 ;;
19461883
19471884 darwin*)
1948 # if libdl is installed we need to link against it
1885 # if libdl is installed we need to link against it
19491886 AC_CHECK_LIB([dl], [dlopen],
1950 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1951 lt_cv_dlopen=dyld
1887 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1888 lt_cv_dlopen="dyld"
19521889 lt_cv_dlopen_libs=
19531890 lt_cv_dlopen_self=yes
19541891 ])
19551892 ;;
19561893
1957 tpf*)
1958 # Don't try to run any link tests for TPF. We know it's impossible
1959 # because TPF is a cross-compiler, and we know how we open DSOs.
1960 lt_cv_dlopen=dlopen
1961 lt_cv_dlopen_libs=
1962 lt_cv_dlopen_self=no
1963 ;;
1964
19651894 *)
19661895 AC_CHECK_FUNC([shl_load],
1967 [lt_cv_dlopen=shl_load],
1896 [lt_cv_dlopen="shl_load"],
19681897 [AC_CHECK_LIB([dld], [shl_load],
1969 [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1898 [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
19701899 [AC_CHECK_FUNC([dlopen],
1971 [lt_cv_dlopen=dlopen],
1900 [lt_cv_dlopen="dlopen"],
19721901 [AC_CHECK_LIB([dl], [dlopen],
1973 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1902 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
19741903 [AC_CHECK_LIB([svld], [dlopen],
1975 [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1904 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
19761905 [AC_CHECK_LIB([dld], [dld_link],
1977 [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1906 [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
19781907 ])
19791908 ])
19801909 ])
19831912 ;;
19841913 esac
19851914
1986 if test no = "$lt_cv_dlopen"; then
1915 if test "x$lt_cv_dlopen" != xno; then
1916 enable_dlopen=yes
1917 else
19871918 enable_dlopen=no
1988 else
1989 enable_dlopen=yes
19901919 fi
19911920
19921921 case $lt_cv_dlopen in
19931922 dlopen)
1994 save_CPPFLAGS=$CPPFLAGS
1995 test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1996
1997 save_LDFLAGS=$LDFLAGS
1923 save_CPPFLAGS="$CPPFLAGS"
1924 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1925
1926 save_LDFLAGS="$LDFLAGS"
19981927 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
19991928
2000 save_LIBS=$LIBS
1929 save_LIBS="$LIBS"
20011930 LIBS="$lt_cv_dlopen_libs $LIBS"
20021931
20031932 AC_CACHE_CHECK([whether a program can dlopen itself],
20071936 lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
20081937 ])
20091938
2010 if test yes = "$lt_cv_dlopen_self"; then
1939 if test "x$lt_cv_dlopen_self" = xyes; then
20111940 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
20121941 AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
20131942 lt_cv_dlopen_self_static, [dnl
20171946 ])
20181947 fi
20191948
2020 CPPFLAGS=$save_CPPFLAGS
2021 LDFLAGS=$save_LDFLAGS
2022 LIBS=$save_LIBS
1949 CPPFLAGS="$save_CPPFLAGS"
1950 LDFLAGS="$save_LDFLAGS"
1951 LIBS="$save_LIBS"
20231952 ;;
20241953 esac
20251954
21112040 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
21122041 _LT_COMPILER_C_O([$1])
21132042
2114 hard_links=nottested
2115 if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2043 hard_links="nottested"
2044 if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
21162045 # do not overwrite the value of need_locks provided by the user
21172046 AC_MSG_CHECKING([if we can lock with hard links])
21182047 hard_links=yes
21222051 ln conftest.a conftest.b 2>&5 || hard_links=no
21232052 ln conftest.a conftest.b 2>/dev/null && hard_links=no
21242053 AC_MSG_RESULT([$hard_links])
2125 if test no = "$hard_links"; then
2126 AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2054 if test "$hard_links" = no; then
2055 AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
21272056 need_locks=warn
21282057 fi
21292058 else
21502079 _LT_DECL([], [objdir], [0],
21512080 [The name of the directory that contains temporary libtool files])dnl
21522081 m4_pattern_allow([LT_OBJDIR])dnl
2153 AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2154 [Define to the sub-directory where libtool stores uninstalled libraries.])
2082 AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2083 [Define to the sub-directory in which libtool stores uninstalled libraries.])
21552084 ])# _LT_CHECK_OBJDIR
21562085
21572086
21632092 _LT_TAGVAR(hardcode_action, $1)=
21642093 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
21652094 test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2166 test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2095 test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
21672096
21682097 # We can hardcode non-existent directories.
2169 if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2098 if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
21702099 # If the only mechanism to avoid hardcoding is shlibpath_var, we
21712100 # have to relink, otherwise we might link with an installed library
21722101 # when we should be linking with a yet-to-be-installed one
2173 ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2174 test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2102 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2103 test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
21752104 # Linking always hardcodes the temporary library directory.
21762105 _LT_TAGVAR(hardcode_action, $1)=relink
21772106 else
21852114 fi
21862115 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
21872116
2188 if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2189 test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2117 if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2118 test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
21902119 # Fast installation is not supported
21912120 enable_fast_install=no
2192 elif test yes = "$shlibpath_overrides_runpath" ||
2193 test no = "$enable_shared"; then
2121 elif test "$shlibpath_overrides_runpath" = yes ||
2122 test "$enable_shared" = no; then
21942123 # Fast installation is not necessary
21952124 enable_fast_install=needless
21962125 fi
22142143 # FIXME - insert some real tests, host_os isn't really good enough
22152144 case $host_os in
22162145 darwin*)
2217 if test -n "$STRIP"; then
2146 if test -n "$STRIP" ; then
22182147 striplib="$STRIP -x"
22192148 old_striplib="$STRIP -S"
22202149 AC_MSG_RESULT([yes])
22322161 ])# _LT_CMD_STRIPLIB
22332162
22342163
2235 # _LT_PREPARE_MUNGE_PATH_LIST
2236 # ---------------------------
2237 # Make sure func_munge_path_list() is defined correctly.
2238 m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2239 [[# func_munge_path_list VARIABLE PATH
2240 # -----------------------------------
2241 # VARIABLE is name of variable containing _space_ separated list of
2242 # directories to be munged by the contents of PATH, which is string
2243 # having a format:
2244 # "DIR[:DIR]:"
2245 # string "DIR[ DIR]" will be prepended to VARIABLE
2246 # ":DIR[:DIR]"
2247 # string "DIR[ DIR]" will be appended to VARIABLE
2248 # "DIRP[:DIRP]::[DIRA:]DIRA"
2249 # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2250 # "DIRA[ DIRA]" will be appended to VARIABLE
2251 # "DIR[:DIR]"
2252 # VARIABLE will be replaced by "DIR[ DIR]"
2253 func_munge_path_list ()
2254 {
2255 case x@S|@2 in
2256 x)
2257 ;;
2258 *:)
2259 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2260 ;;
2261 x:*)
2262 eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2263 ;;
2264 *::*)
2265 eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2266 eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2267 ;;
2268 *)
2269 eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2270 ;;
2271 esac
2272 }
2273 ]])# _LT_PREPARE_PATH_LIST
2274
2275
22762164 # _LT_SYS_DYNAMIC_LINKER([TAG])
22772165 # -----------------------------
22782166 # PORTME Fill in your ld.so characteristics
22832171 m4_require([_LT_DECL_OBJDUMP])dnl
22842172 m4_require([_LT_DECL_SED])dnl
22852173 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
2286 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
22872174 AC_MSG_CHECKING([dynamic linker characteristics])
22882175 m4_if([$1],
22892176 [], [
2290 if test yes = "$GCC"; then
2177 if test "$GCC" = yes; then
22912178 case $host_os in
2292 darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2293 *) lt_awk_arg='/^libraries:/' ;;
2179 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2180 *) lt_awk_arg="/^libraries:/" ;;
22942181 esac
22952182 case $host_os in
2296 mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2297 *) lt_sed_strip_eq='s|=/|/|g' ;;
2183 mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2184 *) lt_sed_strip_eq="s,=/,/,g" ;;
22982185 esac
22992186 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
23002187 case $lt_search_path_spec in
23102197 ;;
23112198 esac
23122199 # Ok, now we have the path, separated by spaces, we can step through it
2313 # and add multilib dir if necessary...
2200 # and add multilib dir if necessary.
23142201 lt_tmp_lt_search_path_spec=
2315 lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2316 # ...but if some path component already ends with the multilib dir we assume
2317 # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2318 case "$lt_multi_os_dir; $lt_search_path_spec " in
2319 "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2320 lt_multi_os_dir=
2321 ;;
2322 esac
2202 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
23232203 for lt_sys_path in $lt_search_path_spec; do
2324 if test -d "$lt_sys_path$lt_multi_os_dir"; then
2325 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2326 elif test -n "$lt_multi_os_dir"; then
2204 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2205 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2206 else
23272207 test -d "$lt_sys_path" && \
23282208 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
23292209 fi
23302210 done
23312211 lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2332 BEGIN {RS = " "; FS = "/|\n";} {
2333 lt_foo = "";
2334 lt_count = 0;
2212 BEGIN {RS=" "; FS="/|\n";} {
2213 lt_foo="";
2214 lt_count=0;
23352215 for (lt_i = NF; lt_i > 0; lt_i--) {
23362216 if ($lt_i != "" && $lt_i != ".") {
23372217 if ($lt_i == "..") {
23382218 lt_count++;
23392219 } else {
23402220 if (lt_count == 0) {
2341 lt_foo = "/" $lt_i lt_foo;
2221 lt_foo="/" $lt_i lt_foo;
23422222 } else {
23432223 lt_count--;
23442224 }
23522232 # for these hosts.
23532233 case $host_os in
23542234 mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2355 $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2235 $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
23562236 esac
23572237 sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
23582238 else
23612241 library_names_spec=
23622242 libname_spec='lib$name'
23632243 soname_spec=
2364 shrext_cmds=.so
2244 shrext_cmds=".so"
23652245 postinstall_cmds=
23662246 postuninstall_cmds=
23672247 finish_cmds=
23782258 # flags to be left without arguments
23792259 need_version=unknown
23802260
2381 AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2382 [User-defined run-time library search path.])
2383
23842261 case $host_os in
23852262 aix3*)
23862263 version_type=linux # correct to gnu/linux during the next big refactor
2387 library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2264 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
23882265 shlibpath_var=LIBPATH
23892266
23902267 # AIX 3 has no versioning support, so we append a major version to the name.
2391 soname_spec='$libname$release$shared_ext$major'
2268 soname_spec='${libname}${release}${shared_ext}$major'
23922269 ;;
23932270
23942271 aix[[4-9]]*)
23962273 need_lib_prefix=no
23972274 need_version=no
23982275 hardcode_into_libs=yes
2399 if test ia64 = "$host_cpu"; then
2276 if test "$host_cpu" = ia64; then
24002277 # AIX 5 supports IA64
2401 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2278 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
24022279 shlibpath_var=LD_LIBRARY_PATH
24032280 else
24042281 # With GCC up to 2.95.x, collect2 would create an import file
24052282 # for dependence libraries. The import file would start with
2406 # the line '#! .'. This would cause the generated library to
2407 # depend on '.', always an invalid library. This was fixed in
2283 # the line `#! .'. This would cause the generated library to
2284 # depend on `.', always an invalid library. This was fixed in
24082285 # development snapshots of GCC prior to 3.0.
24092286 case $host_os in
24102287 aix4 | aix4.[[01]] | aix4.[[01]].*)
24112288 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
24122289 echo ' yes '
2413 echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2290 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
24142291 :
24152292 else
24162293 can_build_shared=no
24172294 fi
24182295 ;;
24192296 esac
2420 # Using Import Files as archive members, it is possible to support
2421 # filename-based versioning of shared library archives on AIX. While
2422 # this would work for both with and without runtime linking, it will
2423 # prevent static linking of such archives. So we do filename-based
2424 # shared library versioning with .so extension only, which is used
2425 # when both runtime linking and shared linking is enabled.
2426 # Unfortunately, runtime linking may impact performance, so we do
2427 # not want this to be the default eventually. Also, we use the
2428 # versioned .so libs for executables only if there is the -brtl
2429 # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2430 # To allow for filename-based versioning support, we need to create
2431 # libNAME.so.V as an archive file, containing:
2432 # *) an Import File, referring to the versioned filename of the
2433 # archive as well as the shared archive member, telling the
2434 # bitwidth (32 or 64) of that shared object, and providing the
2435 # list of exported symbols of that shared object, eventually
2436 # decorated with the 'weak' keyword
2437 # *) the shared object with the F_LOADONLY flag set, to really avoid
2438 # it being seen by the linker.
2439 # At run time we better use the real file rather than another symlink,
2440 # but for link time we create the symlink libNAME.so -> libNAME.so.V
2441
2442 case $with_aix_soname,$aix_use_runtimelinking in
2443 # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2297 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
24442298 # soname into executable. Probably we can add versioning support to
24452299 # collect2, so additional links can be useful in future.
2446 aix,yes) # traditional libtool
2447 dynamic_linker='AIX unversionable lib.so'
2300 if test "$aix_use_runtimelinking" = yes; then
24482301 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
24492302 # instead of lib<name>.a to let people know that these are not
24502303 # typical AIX shared libraries.
2451 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2452 ;;
2453 aix,no) # traditional AIX only
2454 dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2304 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2305 else
24552306 # We preserve .a as extension for shared libraries through AIX4.2
24562307 # and later when we are not doing run time linking.
2457 library_names_spec='$libname$release.a $libname.a'
2458 soname_spec='$libname$release$shared_ext$major'
2459 ;;
2460 svr4,*) # full svr4 only
2461 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2462 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2463 # We do not specify a path in Import Files, so LIBPATH fires.
2464 shlibpath_overrides_runpath=yes
2465 ;;
2466 *,yes) # both, prefer svr4
2467 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2468 library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2469 # unpreferred sharedlib libNAME.a needs extra handling
2470 postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2471 postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2472 # We do not specify a path in Import Files, so LIBPATH fires.
2473 shlibpath_overrides_runpath=yes
2474 ;;
2475 *,no) # both, prefer aix
2476 dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2477 library_names_spec='$libname$release.a $libname.a'
2478 soname_spec='$libname$release$shared_ext$major'
2479 # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2480 postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2481 postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2482 ;;
2483 esac
2308 library_names_spec='${libname}${release}.a $libname.a'
2309 soname_spec='${libname}${release}${shared_ext}$major'
2310 fi
24842311 shlibpath_var=LIBPATH
24852312 fi
24862313 ;;
24902317 powerpc)
24912318 # Since July 2007 AmigaOS4 officially supports .so libraries.
24922319 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2493 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2320 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
24942321 ;;
24952322 m68k)
24962323 library_names_spec='$libname.ixlibrary $libname.a'
24972324 # Create ${libname}_ixlibrary.a entries in /sys/libs.
2498 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2325 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
24992326 ;;
25002327 esac
25012328 ;;
25022329
25032330 beos*)
2504 library_names_spec='$libname$shared_ext'
2331 library_names_spec='${libname}${shared_ext}'
25052332 dynamic_linker="$host_os ld.so"
25062333 shlibpath_var=LIBRARY_PATH
25072334 ;;
25092336 bsdi[[45]]*)
25102337 version_type=linux # correct to gnu/linux during the next big refactor
25112338 need_version=no
2512 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2513 soname_spec='$libname$release$shared_ext$major'
2339 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2340 soname_spec='${libname}${release}${shared_ext}$major'
25142341 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
25152342 shlibpath_var=LD_LIBRARY_PATH
25162343 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
25222349
25232350 cygwin* | mingw* | pw32* | cegcc*)
25242351 version_type=windows
2525 shrext_cmds=.dll
2352 shrext_cmds=".dll"
25262353 need_version=no
25272354 need_lib_prefix=no
25282355
25312358 # gcc
25322359 library_names_spec='$libname.dll.a'
25332360 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2534 postinstall_cmds='base_file=`basename \$file`~
2535 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2361 postinstall_cmds='base_file=`basename \${file}`~
2362 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
25362363 dldir=$destdir/`dirname \$dlpath`~
25372364 test -d \$dldir || mkdir -p \$dldir~
25382365 $install_prog $dir/$dlname \$dldir/$dlname~
25482375 case $host_os in
25492376 cygwin*)
25502377 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2551 soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2378 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
25522379 m4_if([$1], [],[
25532380 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
25542381 ;;
25552382 mingw* | cegcc*)
25562383 # MinGW DLLs use traditional 'lib' prefix
2557 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2384 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
25582385 ;;
25592386 pw32*)
25602387 # pw32 DLLs use 'pw' prefix rather than 'lib'
2561 library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2388 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
25622389 ;;
25632390 esac
25642391 dynamic_linker='Win32 ld.exe'
25672394 *,cl*)
25682395 # Native MSVC
25692396 libname_spec='$name'
2570 soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2571 library_names_spec='$libname.dll.lib'
2397 soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2398 library_names_spec='${libname}.dll.lib'
25722399
25732400 case $build_os in
25742401 mingw*)
25952422 sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
25962423 ;;
25972424 *)
2598 sys_lib_search_path_spec=$LIB
2425 sys_lib_search_path_spec="$LIB"
25992426 if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
26002427 # It is most probably a Windows format PATH.
26012428 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
26082435 esac
26092436
26102437 # DLL is installed to $(libdir)/../bin by postinstall_cmds
2611 postinstall_cmds='base_file=`basename \$file`~
2612 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2438 postinstall_cmds='base_file=`basename \${file}`~
2439 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
26132440 dldir=$destdir/`dirname \$dlpath`~
26142441 test -d \$dldir || mkdir -p \$dldir~
26152442 $install_prog $dir/$dlname \$dldir/$dlname'
26222449
26232450 *)
26242451 # Assume MSVC wrapper
2625 library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2452 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
26262453 dynamic_linker='Win32 ld.exe'
26272454 ;;
26282455 esac
26352462 version_type=darwin
26362463 need_lib_prefix=no
26372464 need_version=no
2638 library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2639 soname_spec='$libname$release$major$shared_ext'
2465 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2466 soname_spec='${libname}${release}${major}$shared_ext'
26402467 shlibpath_overrides_runpath=yes
26412468 shlibpath_var=DYLD_LIBRARY_PATH
26422469 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
26492476 version_type=linux # correct to gnu/linux during the next big refactor
26502477 need_lib_prefix=no
26512478 need_version=no
2652 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2653 soname_spec='$libname$release$shared_ext$major'
2479 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2480 soname_spec='${libname}${release}${shared_ext}$major'
26542481 shlibpath_var=LD_LIBRARY_PATH
26552482 ;;
26562483
26682495 version_type=freebsd-$objformat
26692496 case $version_type in
26702497 freebsd-elf*)
2671 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2672 soname_spec='$libname$release$shared_ext$major'
2498 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
26732499 need_version=no
26742500 need_lib_prefix=no
26752501 ;;
26762502 freebsd-*)
2677 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2503 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
26782504 need_version=yes
26792505 ;;
26802506 esac
27042530 need_lib_prefix=no
27052531 need_version=no
27062532 dynamic_linker="$host_os runtime_loader"
2707 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2708 soname_spec='$libname$release$shared_ext$major'
2533 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2534 soname_spec='${libname}${release}${shared_ext}$major'
27092535 shlibpath_var=LIBRARY_PATH
2710 shlibpath_overrides_runpath=no
2536 shlibpath_overrides_runpath=yes
27112537 sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
27122538 hardcode_into_libs=yes
27132539 ;;
27252551 dynamic_linker="$host_os dld.so"
27262552 shlibpath_var=LD_LIBRARY_PATH
27272553 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2728 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2729 soname_spec='$libname$release$shared_ext$major'
2730 if test 32 = "$HPUX_IA64_MODE"; then
2554 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2555 soname_spec='${libname}${release}${shared_ext}$major'
2556 if test "X$HPUX_IA64_MODE" = X32; then
27312557 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2732 sys_lib_dlsearch_path_spec=/usr/lib/hpux32
27332558 else
27342559 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2735 sys_lib_dlsearch_path_spec=/usr/lib/hpux64
27362560 fi
2561 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27372562 ;;
27382563 hppa*64*)
27392564 shrext_cmds='.sl'
27412566 dynamic_linker="$host_os dld.sl"
27422567 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
27432568 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2744 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2745 soname_spec='$libname$release$shared_ext$major'
2569 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2570 soname_spec='${libname}${release}${shared_ext}$major'
27462571 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
27472572 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
27482573 ;;
27512576 dynamic_linker="$host_os dld.sl"
27522577 shlibpath_var=SHLIB_PATH
27532578 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2754 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2755 soname_spec='$libname$release$shared_ext$major'
2579 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2580 soname_spec='${libname}${release}${shared_ext}$major'
27562581 ;;
27572582 esac
27582583 # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
27652590 version_type=linux # correct to gnu/linux during the next big refactor
27662591 need_lib_prefix=no
27672592 need_version=no
2768 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2769 soname_spec='$libname$release$shared_ext$major'
2593 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2594 soname_spec='${libname}${release}${shared_ext}$major'
27702595 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
27712596 shlibpath_var=LD_LIBRARY_PATH
27722597 shlibpath_overrides_runpath=no
27772602 case $host_os in
27782603 nonstopux*) version_type=nonstopux ;;
27792604 *)
2780 if test yes = "$lt_cv_prog_gnu_ld"; then
2605 if test "$lt_cv_prog_gnu_ld" = yes; then
27812606 version_type=linux # correct to gnu/linux during the next big refactor
27822607 else
27832608 version_type=irix
27852610 esac
27862611 need_lib_prefix=no
27872612 need_version=no
2788 soname_spec='$libname$release$shared_ext$major'
2789 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2613 soname_spec='${libname}${release}${shared_ext}$major'
2614 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
27902615 case $host_os in
27912616 irix5* | nonstopux*)
27922617 libsuff= shlibsuff=
28052630 esac
28062631 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
28072632 shlibpath_overrides_runpath=no
2808 sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2809 sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2633 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2634 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
28102635 hardcode_into_libs=yes
28112636 ;;
28122637
28132638 # No shared lib support for Linux oldld, aout, or coff.
28142639 linux*oldld* | linux*aout* | linux*coff*)
28152640 dynamic_linker=no
2816 ;;
2817
2818 linux*android*)
2819 version_type=none # Android doesn't support versioned libraries.
2820 need_lib_prefix=no
2821 need_version=no
2822 library_names_spec='$libname$release$shared_ext'
2823 soname_spec='$libname$release$shared_ext'
2824 finish_cmds=
2825 shlibpath_var=LD_LIBRARY_PATH
2826 shlibpath_overrides_runpath=yes
2827
2828 # This implies no fast_install, which is unacceptable.
2829 # Some rework will be needed to allow for fast_install
2830 # before this can be enabled.
2831 hardcode_into_libs=yes
2832
2833 dynamic_linker='Android linker'
2834 # Don't embed -rpath directories since the linker doesn't support them.
2835 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
28362641 ;;
28372642
28382643 # This must be glibc/ELF.
28402645 version_type=linux # correct to gnu/linux during the next big refactor
28412646 need_lib_prefix=no
28422647 need_version=no
2843 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2844 soname_spec='$libname$release$shared_ext$major'
2648 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2649 soname_spec='${libname}${release}${shared_ext}$major'
28452650 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
28462651 shlibpath_var=LD_LIBRARY_PATH
28472652 shlibpath_overrides_runpath=no
28662671 # before this can be enabled.
28672672 hardcode_into_libs=yes
28682673
2869 # Ideally, we could use ldconfig to report *all* directores which are
2870 # searched for libraries, however this is still not possible. Aside from not
2871 # being certain /sbin/ldconfig is available, command
2872 # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2873 # even though it is searched at run-time. Try to do the best guess by
2874 # appending ld.so.conf contents (and includes) to the search path.
2674 # Append ld.so.conf contents to the search path
28752675 if test -f /etc/ld.so.conf; then
28762676 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
28772677 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
28862686 dynamic_linker='GNU/Linux ld.so'
28872687 ;;
28882688
2689 netbsdelf*-gnu)
2690 version_type=linux
2691 need_lib_prefix=no
2692 need_version=no
2693 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2694 soname_spec='${libname}${release}${shared_ext}$major'
2695 shlibpath_var=LD_LIBRARY_PATH
2696 shlibpath_overrides_runpath=no
2697 hardcode_into_libs=yes
2698 dynamic_linker='NetBSD ld.elf_so'
2699 ;;
2700
28892701 netbsd*)
28902702 version_type=sunos
28912703 need_lib_prefix=no
28922704 need_version=no
28932705 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2894 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2706 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
28952707 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
28962708 dynamic_linker='NetBSD (a.out) ld.so'
28972709 else
2898 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2899 soname_spec='$libname$release$shared_ext$major'
2710 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2711 soname_spec='${libname}${release}${shared_ext}$major'
29002712 dynamic_linker='NetBSD ld.elf_so'
29012713 fi
29022714 shlibpath_var=LD_LIBRARY_PATH
29062718
29072719 newsos6)
29082720 version_type=linux # correct to gnu/linux during the next big refactor
2909 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2721 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
29102722 shlibpath_var=LD_LIBRARY_PATH
29112723 shlibpath_overrides_runpath=yes
29122724 ;;
29152727 version_type=qnx
29162728 need_lib_prefix=no
29172729 need_version=no
2918 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2919 soname_spec='$libname$release$shared_ext$major'
2730 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2731 soname_spec='${libname}${release}${shared_ext}$major'
29202732 shlibpath_var=LD_LIBRARY_PATH
29212733 shlibpath_overrides_runpath=no
29222734 hardcode_into_libs=yes
29232735 dynamic_linker='ldqnx.so'
29242736 ;;
29252737
2926 openbsd* | bitrig*)
2738 openbsd*)
29272739 version_type=sunos
2928 sys_lib_dlsearch_path_spec=/usr/lib
2740 sys_lib_dlsearch_path_spec="/usr/lib"
29292741 need_lib_prefix=no
2930 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2931 need_version=no
2932 else
2933 need_version=yes
2934 fi
2935 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2742 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2743 case $host_os in
2744 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
2745 *) need_version=no ;;
2746 esac
2747 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
29362748 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
29372749 shlibpath_var=LD_LIBRARY_PATH
2938 shlibpath_overrides_runpath=yes
2750 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2751 case $host_os in
2752 openbsd2.[[89]] | openbsd2.[[89]].*)
2753 shlibpath_overrides_runpath=no
2754 ;;
2755 *)
2756 shlibpath_overrides_runpath=yes
2757 ;;
2758 esac
2759 else
2760 shlibpath_overrides_runpath=yes
2761 fi
29392762 ;;
29402763
29412764 os2*)
29422765 libname_spec='$name'
2943 version_type=windows
2944 shrext_cmds=.dll
2945 need_version=no
2766 shrext_cmds=".dll"
29462767 need_lib_prefix=no
2947 # OS/2 can only load a DLL with a base name of 8 characters or less.
2948 soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2949 v=$($ECHO $release$versuffix | tr -d .-);
2950 n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2951 $ECHO $n$v`$shared_ext'
2952 library_names_spec='${libname}_dll.$libext'
2768 library_names_spec='$libname${shared_ext} $libname.a'
29532769 dynamic_linker='OS/2 ld.exe'
2954 shlibpath_var=BEGINLIBPATH
2955 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2956 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2957 postinstall_cmds='base_file=`basename \$file`~
2958 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2959 dldir=$destdir/`dirname \$dlpath`~
2960 test -d \$dldir || mkdir -p \$dldir~
2961 $install_prog $dir/$dlname \$dldir/$dlname~
2962 chmod a+x \$dldir/$dlname~
2963 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2964 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2965 fi'
2966 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2967 dlpath=$dir/\$dldll~
2968 $RM \$dlpath'
2770 shlibpath_var=LIBPATH
29692771 ;;
29702772
29712773 osf3* | osf4* | osf5*)
29722774 version_type=osf
29732775 need_lib_prefix=no
29742776 need_version=no
2975 soname_spec='$libname$release$shared_ext$major'
2976 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2777 soname_spec='${libname}${release}${shared_ext}$major'
2778 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
29772779 shlibpath_var=LD_LIBRARY_PATH
29782780 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2979 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2781 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
29802782 ;;
29812783
29822784 rdos*)
29872789 version_type=linux # correct to gnu/linux during the next big refactor
29882790 need_lib_prefix=no
29892791 need_version=no
2990 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2991 soname_spec='$libname$release$shared_ext$major'
2792 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2793 soname_spec='${libname}${release}${shared_ext}$major'
29922794 shlibpath_var=LD_LIBRARY_PATH
29932795 shlibpath_overrides_runpath=yes
29942796 hardcode_into_libs=yes
29982800
29992801 sunos4*)
30002802 version_type=sunos
3001 library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2803 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
30022804 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
30032805 shlibpath_var=LD_LIBRARY_PATH
30042806 shlibpath_overrides_runpath=yes
3005 if test yes = "$with_gnu_ld"; then
2807 if test "$with_gnu_ld" = yes; then
30062808 need_lib_prefix=no
30072809 fi
30082810 need_version=yes
30102812
30112813 sysv4 | sysv4.3*)
30122814 version_type=linux # correct to gnu/linux during the next big refactor
3013 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3014 soname_spec='$libname$release$shared_ext$major'
2815 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2816 soname_spec='${libname}${release}${shared_ext}$major'
30152817 shlibpath_var=LD_LIBRARY_PATH
30162818 case $host_vendor in
30172819 sni)
30322834 ;;
30332835
30342836 sysv4*MP*)
3035 if test -d /usr/nec; then
2837 if test -d /usr/nec ;then
30362838 version_type=linux # correct to gnu/linux during the next big refactor
3037 library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3038 soname_spec='$libname$shared_ext.$major'
2839 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2840 soname_spec='$libname${shared_ext}.$major'
30392841 shlibpath_var=LD_LIBRARY_PATH
30402842 fi
30412843 ;;
30422844
30432845 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3044 version_type=sco
2846 version_type=freebsd-elf
30452847 need_lib_prefix=no
30462848 need_version=no
3047 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3048 soname_spec='$libname$release$shared_ext$major'
2849 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2850 soname_spec='${libname}${release}${shared_ext}$major'
30492851 shlibpath_var=LD_LIBRARY_PATH
30502852 shlibpath_overrides_runpath=yes
30512853 hardcode_into_libs=yes
3052 if test yes = "$with_gnu_ld"; then
2854 if test "$with_gnu_ld" = yes; then
30532855 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
30542856 else
30552857 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
30672869 version_type=linux # correct to gnu/linux during the next big refactor
30682870 need_lib_prefix=no
30692871 need_version=no
3070 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2872 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
30712873 shlibpath_var=LD_LIBRARY_PATH
30722874 shlibpath_overrides_runpath=no
30732875 hardcode_into_libs=yes
30752877
30762878 uts4*)
30772879 version_type=linux # correct to gnu/linux during the next big refactor
3078 library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3079 soname_spec='$libname$release$shared_ext$major'
2880 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2881 soname_spec='${libname}${release}${shared_ext}$major'
30802882 shlibpath_var=LD_LIBRARY_PATH
30812883 ;;
30822884
30852887 ;;
30862888 esac
30872889 AC_MSG_RESULT([$dynamic_linker])
3088 test no = "$dynamic_linker" && can_build_shared=no
2890 test "$dynamic_linker" = no && can_build_shared=no
30892891
30902892 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3091 if test yes = "$GCC"; then
2893 if test "$GCC" = yes; then
30922894 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
30932895 fi
30942896
3095 if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3096 sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
2897 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2898 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
30972899 fi
3098
3099 if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3100 sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
2900 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2901 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
31012902 fi
3102
3103 # remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3104 configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3105
3106 # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3107 func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3108
3109 # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3110 configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
31112903
31122904 _LT_DECL([], [variables_saved_for_relink], [1],
31132905 [Variables whose values should be saved in libtool wrapper scripts and
31412933 [Whether we should hardcode library paths into libraries])
31422934 _LT_DECL([], [sys_lib_search_path_spec], [2],
31432935 [Compile-time system search path for libraries])
3144 _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3145 [Detected run-time system search path for libraries])
3146 _LT_DECL([], [configure_time_lt_sys_library_path], [2],
3147 [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
2936 _LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2937 [Run-time system search path for libraries])
31482938 ])# _LT_SYS_DYNAMIC_LINKER
31492939
31502940
31512941 # _LT_PATH_TOOL_PREFIX(TOOL)
31522942 # --------------------------
3153 # find a file program that can recognize shared library
2943 # find a file program which can recognize shared library
31542944 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
31552945 [m4_require([_LT_DECL_EGREP])dnl
31562946 AC_MSG_CHECKING([for $1])
31572947 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
31582948 [case $MAGIC_CMD in
31592949 [[\\/*] | ?:[\\/]*])
3160 lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
2950 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
31612951 ;;
31622952 *)
3163 lt_save_MAGIC_CMD=$MAGIC_CMD
3164 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
2953 lt_save_MAGIC_CMD="$MAGIC_CMD"
2954 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
31652955 dnl $ac_dummy forces splitting on constant user-supplied paths.
31662956 dnl POSIX.2 word splitting is done only on the output of word expansions,
31672957 dnl not every word. This closes a longstanding sh security hole.
31682958 ac_dummy="m4_if([$2], , $PATH, [$2])"
31692959 for ac_dir in $ac_dummy; do
3170 IFS=$lt_save_ifs
2960 IFS="$lt_save_ifs"
31712961 test -z "$ac_dir" && ac_dir=.
3172 if test -f "$ac_dir/$1"; then
3173 lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
2962 if test -f $ac_dir/$1; then
2963 lt_cv_path_MAGIC_CMD="$ac_dir/$1"
31742964 if test -n "$file_magic_test_file"; then
31752965 case $deplibs_check_method in
31762966 "file_magic "*)
31772967 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3178 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
2968 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
31792969 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
31802970 $EGREP "$file_magic_regex" > /dev/null; then
31812971 :
31982988 break
31992989 fi
32002990 done
3201 IFS=$lt_save_ifs
3202 MAGIC_CMD=$lt_save_MAGIC_CMD
2991 IFS="$lt_save_ifs"
2992 MAGIC_CMD="$lt_save_MAGIC_CMD"
32032993 ;;
32042994 esac])
3205 MAGIC_CMD=$lt_cv_path_MAGIC_CMD
2995 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
32062996 if test -n "$MAGIC_CMD"; then
32072997 AC_MSG_RESULT($MAGIC_CMD)
32082998 else
32203010
32213011 # _LT_PATH_MAGIC
32223012 # --------------
3223 # find a file program that can recognize a shared library
3013 # find a file program which can recognize a shared library
32243014 m4_defun([_LT_PATH_MAGIC],
32253015 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
32263016 if test -z "$lt_cv_path_MAGIC_CMD"; then
32473037 AC_ARG_WITH([gnu-ld],
32483038 [AS_HELP_STRING([--with-gnu-ld],
32493039 [assume the C compiler uses GNU ld @<:@default=no@:>@])],
3250 [test no = "$withval" || with_gnu_ld=yes],
3040 [test "$withval" = no || with_gnu_ld=yes],
32513041 [with_gnu_ld=no])dnl
32523042
32533043 ac_prog=ld
3254 if test yes = "$GCC"; then
3044 if test "$GCC" = yes; then
32553045 # Check if gcc -print-prog-name=ld gives a path.
32563046 AC_MSG_CHECKING([for ld used by $CC])
32573047 case $host in
32583048 *-*-mingw*)
3259 # gcc leaves a trailing carriage return, which upsets mingw
3049 # gcc leaves a trailing carriage return which upsets mingw
32603050 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
32613051 *)
32623052 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
32703060 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
32713061 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
32723062 done
3273 test -z "$LD" && LD=$ac_prog
3063 test -z "$LD" && LD="$ac_prog"
32743064 ;;
32753065 "")
32763066 # If it fails, then pretend we aren't using GCC.
32813071 with_gnu_ld=unknown
32823072 ;;
32833073 esac
3284 elif test yes = "$with_gnu_ld"; then
3074 elif test "$with_gnu_ld" = yes; then
32853075 AC_MSG_CHECKING([for GNU ld])
32863076 else
32873077 AC_MSG_CHECKING([for non-GNU ld])
32883078 fi
32893079 AC_CACHE_VAL(lt_cv_path_LD,
32903080 [if test -z "$LD"; then
3291 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3081 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
32923082 for ac_dir in $PATH; do
3293 IFS=$lt_save_ifs
3083 IFS="$lt_save_ifs"
32943084 test -z "$ac_dir" && ac_dir=.
32953085 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3296 lt_cv_path_LD=$ac_dir/$ac_prog
3086 lt_cv_path_LD="$ac_dir/$ac_prog"
32973087 # Check to see if the program is GNU ld. I'd rather use --version,
32983088 # but apparently some variants of GNU ld only accept -v.
32993089 # Break only if it was the GNU/non-GNU ld that we prefer.
33003090 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
33013091 *GNU* | *'with BFD'*)
3302 test no != "$with_gnu_ld" && break
3092 test "$with_gnu_ld" != no && break
33033093 ;;
33043094 *)
3305 test yes != "$with_gnu_ld" && break
3095 test "$with_gnu_ld" != yes && break
33063096 ;;
33073097 esac
33083098 fi
33093099 done
3310 IFS=$lt_save_ifs
3100 IFS="$lt_save_ifs"
33113101 else
3312 lt_cv_path_LD=$LD # Let the user override the test with a path.
3102 lt_cv_path_LD="$LD" # Let the user override the test with a path.
33133103 fi])
3314 LD=$lt_cv_path_LD
3104 LD="$lt_cv_path_LD"
33153105 if test -n "$LD"; then
33163106 AC_MSG_RESULT($LD)
33173107 else
33653155 reload_cmds='$LD$reload_flag -o $output$reload_objs'
33663156 case $host_os in
33673157 cygwin* | mingw* | pw32* | cegcc*)
3368 if test yes != "$GCC"; then
3158 if test "$GCC" != yes; then
33693159 reload_cmds=false
33703160 fi
33713161 ;;
33723162 darwin*)
3373 if test yes = "$GCC"; then
3374 reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3163 if test "$GCC" = yes; then
3164 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
33753165 else
33763166 reload_cmds='$LD$reload_flag -o $output$reload_objs'
33773167 fi
33803170 _LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
33813171 _LT_TAGDECL([], [reload_cmds], [2])dnl
33823172 ])# _LT_CMD_RELOAD
3383
3384
3385 # _LT_PATH_DD
3386 # -----------
3387 # find a working dd
3388 m4_defun([_LT_PATH_DD],
3389 [AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3390 [printf 0123456789abcdef0123456789abcdef >conftest.i
3391 cat conftest.i conftest.i >conftest2.i
3392 : ${lt_DD:=$DD}
3393 AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3394 [if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3395 cmp -s conftest.i conftest.out \
3396 && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3397 fi])
3398 rm -f conftest.i conftest2.i conftest.out])
3399 ])# _LT_PATH_DD
3400
3401
3402 # _LT_CMD_TRUNCATE
3403 # ----------------
3404 # find command to truncate a binary pipe
3405 m4_defun([_LT_CMD_TRUNCATE],
3406 [m4_require([_LT_PATH_DD])
3407 AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3408 [printf 0123456789abcdef0123456789abcdef >conftest.i
3409 cat conftest.i conftest.i >conftest2.i
3410 lt_cv_truncate_bin=
3411 if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3412 cmp -s conftest.i conftest.out \
3413 && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3414 fi
3415 rm -f conftest.i conftest2.i conftest.out
3416 test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3417 _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3418 [Command to truncate a binary pipe])
3419 ])# _LT_CMD_TRUNCATE
34203173
34213174
34223175 # _LT_CHECK_MAGIC_METHOD
34343187 # Need to set the preceding variable on all platforms that support
34353188 # interlibrary dependencies.
34363189 # 'none' -- dependencies not supported.
3437 # 'unknown' -- same as none, but documents that we really don't know.
3190 # `unknown' -- same as none, but documents that we really don't know.
34383191 # 'pass_all' -- all dependencies passed with no checks.
34393192 # 'test_compile' -- check by making test program.
34403193 # 'file_magic [[regex]]' -- check by looking for files in library path
3441 # that responds to the $file_magic_cmd with a given extended regex.
3442 # If you have 'file' or equivalent on your system and you're not sure
3443 # whether 'pass_all' will *always* work, you probably want this one.
3194 # which responds to the $file_magic_cmd with a given extended regex.
3195 # If you have `file' or equivalent on your system and you're not sure
3196 # whether `pass_all' will *always* work, you probably want this one.
34443197
34453198 case $host_os in
34463199 aix[[4-9]]*)
34673220 # Base MSYS/MinGW do not provide the 'file' command needed by
34683221 # func_win32_libid shell function, so use a weaker test based on 'objdump',
34693222 # unless we find 'file', for example because we are cross-compiling.
3470 if ( file / ) >/dev/null 2>&1; then
3223 # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3224 if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
34713225 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
34723226 lt_cv_file_magic_cmd='func_win32_libid'
34733227 else
35453299 lt_cv_deplibs_check_method=pass_all
35463300 ;;
35473301
3548 netbsd*)
3302 netbsd* | netbsdelf*-gnu)
35493303 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
35503304 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
35513305 else
35633317 lt_cv_deplibs_check_method=pass_all
35643318 ;;
35653319
3566 openbsd* | bitrig*)
3567 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3320 openbsd*)
3321 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
35683322 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
35693323 else
35703324 lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
36173371 tpf*)
36183372 lt_cv_deplibs_check_method=pass_all
36193373 ;;
3620 os2*)
3621 lt_cv_deplibs_check_method=pass_all
3622 ;;
36233374 esac
36243375 ])
36253376
36603411 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
36613412 [if test -n "$NM"; then
36623413 # Let the user override the test.
3663 lt_cv_path_NM=$NM
3414 lt_cv_path_NM="$NM"
36643415 else
3665 lt_nm_to_check=${ac_tool_prefix}nm
3416 lt_nm_to_check="${ac_tool_prefix}nm"
36663417 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
36673418 lt_nm_to_check="$lt_nm_to_check nm"
36683419 fi
36693420 for lt_tmp_nm in $lt_nm_to_check; do
3670 lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3421 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
36713422 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3672 IFS=$lt_save_ifs
3423 IFS="$lt_save_ifs"
36733424 test -z "$ac_dir" && ac_dir=.
3674 tmp_nm=$ac_dir/$lt_tmp_nm
3675 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3425 tmp_nm="$ac_dir/$lt_tmp_nm"
3426 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
36763427 # Check to see if the nm accepts a BSD-compat flag.
3677 # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3428 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
36783429 # nm: unknown option "B" ignored
36793430 # Tru64's nm complains that /dev/null is an invalid object file
3680 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3681 case $build_os in
3682 mingw*) lt_bad_file=conftest.nm/nofile ;;
3683 *) lt_bad_file=/dev/null ;;
3684 esac
3685 case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3686 *$lt_bad_file* | *'Invalid file or object type'*)
3431 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3432 */dev/null* | *'Invalid file or object type'*)
36873433 lt_cv_path_NM="$tmp_nm -B"
3688 break 2
3434 break
36893435 ;;
36903436 *)
36913437 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
36923438 */dev/null*)
36933439 lt_cv_path_NM="$tmp_nm -p"
3694 break 2
3440 break
36953441 ;;
36963442 *)
36973443 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
37023448 esac
37033449 fi
37043450 done
3705 IFS=$lt_save_ifs
3451 IFS="$lt_save_ifs"
37063452 done
37073453 : ${lt_cv_path_NM=no}
37083454 fi])
3709 if test no != "$lt_cv_path_NM"; then
3710 NM=$lt_cv_path_NM
3455 if test "$lt_cv_path_NM" != "no"; then
3456 NM="$lt_cv_path_NM"
37113457 else
37123458 # Didn't find any BSD compatible name lister, look for dumpbin.
37133459 if test -n "$DUMPBIN"; then :
37143460 # Let the user override the test.
37153461 else
37163462 AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3717 case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3463 case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
37183464 *COFF*)
3719 DUMPBIN="$DUMPBIN -symbols -headers"
3465 DUMPBIN="$DUMPBIN -symbols"
37203466 ;;
37213467 *)
37223468 DUMPBIN=:
37243470 esac
37253471 fi
37263472 AC_SUBST([DUMPBIN])
3727 if test : != "$DUMPBIN"; then
3728 NM=$DUMPBIN
3473 if test "$DUMPBIN" != ":"; then
3474 NM="$DUMPBIN"
37293475 fi
37303476 fi
37313477 test -z "$NM" && NM=nm
37713517
37723518 case $host_os in
37733519 cygwin* | mingw* | pw32* | cegcc*)
3774 # two different shell functions defined in ltmain.sh;
3775 # decide which one to use based on capabilities of $DLLTOOL
3520 # two different shell functions defined in ltmain.sh
3521 # decide which to use based on capabilities of $DLLTOOL
37763522 case `$DLLTOOL --help 2>&1` in
37773523 *--identify-strict*)
37783524 lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
37843530 ;;
37853531 *)
37863532 # fallback: assume linklib IS sharedlib
3787 lt_cv_sharedlib_from_linklib_cmd=$ECHO
3533 lt_cv_sharedlib_from_linklib_cmd="$ECHO"
37883534 ;;
37893535 esac
37903536 ])
38113557 lt_cv_path_mainfest_tool=yes
38123558 fi
38133559 rm -f conftest*])
3814 if test yes != "$lt_cv_path_mainfest_tool"; then
3560 if test "x$lt_cv_path_mainfest_tool" != xyes; then
38153561 MANIFEST_TOOL=:
38163562 fi
38173563 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
38183564 ])# _LT_PATH_MANIFEST_TOOL
3819
3820
3821 # _LT_DLL_DEF_P([FILE])
3822 # ---------------------
3823 # True iff FILE is a Windows DLL '.def' file.
3824 # Keep in sync with func_dll_def_p in the libtool script
3825 AC_DEFUN([_LT_DLL_DEF_P],
3826 [dnl
3827 test DEF = "`$SED -n dnl
3828 -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
3829 -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
3830 -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
3831 -e q dnl Only consider the first "real" line
3832 $1`" dnl
3833 ])# _LT_DLL_DEF_P
38343565
38353566
38363567 # LT_LIB_M
38443575 # These system don't have libm, or don't need it
38453576 ;;
38463577 *-ncr-sysv4.3*)
3847 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3578 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
38483579 AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
38493580 ;;
38503581 *)
3851 AC_CHECK_LIB(m, cos, LIBM=-lm)
3582 AC_CHECK_LIB(m, cos, LIBM="-lm")
38523583 ;;
38533584 esac
38543585 AC_SUBST([LIBM])
38673598
38683599 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
38693600
3870 if test yes = "$GCC"; then
3601 if test "$GCC" = yes; then
38713602 case $cc_basename in
38723603 nvcc*)
38733604 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
39193650 symcode='[[ABCDGISTW]]'
39203651 ;;
39213652 hpux*)
3922 if test ia64 = "$host_cpu"; then
3653 if test "$host_cpu" = ia64; then
39233654 symcode='[[ABCDEGRST]]'
39243655 fi
39253656 ;;
39523683 symcode='[[ABCDGIRSTW]]' ;;
39533684 esac
39543685
3955 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3956 # Gets list of data symbols to import.
3957 lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3958 # Adjust the below global symbol transforms to fixup imported variables.
3959 lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3960 lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
3961 lt_c_name_lib_hook="\
3962 -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
3963 -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
3964 else
3965 # Disable hooks by default.
3966 lt_cv_sys_global_symbol_to_import=
3967 lt_cdecl_hook=
3968 lt_c_name_hook=
3969 lt_c_name_lib_hook=
3970 fi
3971
39723686 # Transform an extracted symbol line into a proper C declaration.
39733687 # Some systems (esp. on ia64) link data and code symbols differently,
39743688 # so use this general approach.
3975 lt_cv_sys_global_symbol_to_cdecl="sed -n"\
3976 $lt_cdecl_hook\
3977 " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3978 " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3689 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
39793690
39803691 # Transform an extracted symbol line into symbol name and symbol address
3981 lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
3982 $lt_c_name_hook\
3983 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
3984 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
3985
3986 # Transform an extracted symbol line into symbol name with lib prefix and
3987 # symbol address.
3988 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
3989 $lt_c_name_lib_hook\
3990 " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
3991 " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
3992 " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
3692 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
3693 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
39933694
39943695 # Handle CRLF in mingw tool chain
39953696 opt_cr=
40073708
40083709 # Write the raw and C identifiers.
40093710 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4010 # Fake it for dumpbin and say T for any non-static function,
4011 # D for any global variable and I for any imported variable.
3711 # Fake it for dumpbin and say T for any non-static function
3712 # and D for any global variable.
40123713 # Also find C++ and __fastcall symbols from MSVC++,
40133714 # which start with @ or ?.
40143715 lt_cv_sys_global_symbol_pipe="$AWK ['"\
40153716 " {last_section=section; section=\$ 3};"\
40163717 " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
40173718 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4018 " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4019 " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4020 " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
40213719 " \$ 0!~/External *\|/{next};"\
40223720 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
40233721 " {if(hide[section]) next};"\
4024 " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4025 " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4026 " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4027 " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
3722 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3723 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3724 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
3725 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
40283726 " ' prfx=^$ac_symprfx]"
40293727 else
40303728 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
40643762 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
40653763 cat <<_LT_EOF > conftest.$ac_ext
40663764 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
4067 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4068 /* DATA imports from DLLs on WIN32 can't be const, because runtime
3765 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3766 /* DATA imports from DLLs on WIN32 con't be const, because runtime
40693767 relocations are performed -- see ld's documentation on pseudo-relocs. */
40703768 # define LT@&t@_DLSYM_CONST
4071 #elif defined __osf__
3769 #elif defined(__osf__)
40723770 /* This system does not cope well with relocations in const data. */
40733771 # define LT@&t@_DLSYM_CONST
40743772 #else
40943792 {
40953793 { "@PROGRAM@", (void *) 0 },
40963794 _LT_EOF
4097 $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3795 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
40983796 cat <<\_LT_EOF >> conftest.$ac_ext
40993797 {0, (void *) 0}
41003798 };
41143812 mv conftest.$ac_objext conftstm.$ac_objext
41153813 lt_globsym_save_LIBS=$LIBS
41163814 lt_globsym_save_CFLAGS=$CFLAGS
4117 LIBS=conftstm.$ac_objext
3815 LIBS="conftstm.$ac_objext"
41183816 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4119 if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
3817 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
41203818 pipe_works=yes
41213819 fi
41223820 LIBS=$lt_globsym_save_LIBS
41373835 rm -rf conftest* conftst*
41383836
41393837 # Do not use the global_symbol_pipe unless it works.
4140 if test yes = "$pipe_works"; then
3838 if test "$pipe_works" = yes; then
41413839 break
41423840 else
41433841 lt_cv_sys_global_symbol_pipe=
41643862 [Take the output of nm and produce a listing of raw symbols and C names])
41653863 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
41663864 [Transform the output of nm in a proper C declaration])
4167 _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4168 [Transform the output of nm into a list of symbols to manually relocate])
41693865 _LT_DECL([global_symbol_to_c_name_address],
41703866 [lt_cv_sys_global_symbol_to_c_name_address], [1],
41713867 [Transform the output of nm in a C name address pair])
41723868 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
41733869 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
41743870 [Transform the output of nm in a C name address pair when lib prefix is needed])
4175 _LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4176 [The name lister interface])
41773871 _LT_DECL([], [nm_file_list_spec], [1],
41783872 [Specify filename containing input files for $NM])
41793873 ]) # _LT_CMD_GLOBAL_SYMBOLS
41893883
41903884 m4_if([$1], [CXX], [
41913885 # C++ specific cases for pic, static, wl, etc.
4192 if test yes = "$GXX"; then
3886 if test "$GXX" = yes; then
41933887 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
41943888 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
41953889
41963890 case $host_os in
41973891 aix*)
41983892 # All AIX code is PIC.
4199 if test ia64 = "$host_cpu"; then
3893 if test "$host_cpu" = ia64; then
42003894 # AIX 5 now supports IA64 processor
42013895 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42023896 fi
4203 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
42043897 ;;
42053898
42063899 amigaos*)
42113904 ;;
42123905 m68k)
42133906 # FIXME: we need at least 68020 code to build shared libraries, but
4214 # adding the '-m68020' flag to GCC prevents building anything better,
4215 # like '-m68040'.
3907 # adding the `-m68020' flag to GCC prevents building anything better,
3908 # like `-m68040'.
42163909 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
42173910 ;;
42183911 esac
42283921 # (--disable-auto-import) libraries
42293922 m4_if([$1], [GCJ], [],
42303923 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4231 case $host_os in
4232 os2*)
4233 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4234 ;;
4235 esac
42363924 ;;
42373925 darwin* | rhapsody*)
42383926 # PIC is the default on this platform
42823970 case $host_os in
42833971 aix[[4-9]]*)
42843972 # All AIX code is PIC.
4285 if test ia64 = "$host_cpu"; then
3973 if test "$host_cpu" = ia64; then
42863974 # AIX 5 now supports IA64 processor
42873975 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
42883976 else
43234011 case $cc_basename in
43244012 CC*)
43254013 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4326 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4327 if test ia64 != "$host_cpu"; then
4014 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4015 if test "$host_cpu" != ia64; then
43284016 _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
43294017 fi
43304018 ;;
43314019 aCC*)
43324020 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4333 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4021 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
43344022 case $host_cpu in
43354023 hppa*64*|ia64*)
43364024 # +Z the default
43674055 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
43684056 ;;
43694057 ecpc* )
4370 # old Intel C++ for x86_64, which still supported -KPIC.
4058 # old Intel C++ for x86_64 which still supported -KPIC.
43714059 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
43724060 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
43734061 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44234111 ;;
44244112 esac
44254113 ;;
4426 netbsd*)
4114 netbsd* | netbsdelf*-gnu)
44274115 ;;
44284116 *qnx* | *nto*)
44294117 # QNX uses GNU C++, but need to define -shared option too, otherwise
45124200 fi
45134201 ],
45144202 [
4515 if test yes = "$GCC"; then
4203 if test "$GCC" = yes; then
45164204 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
45174205 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
45184206
45194207 case $host_os in
45204208 aix*)
45214209 # All AIX code is PIC.
4522 if test ia64 = "$host_cpu"; then
4210 if test "$host_cpu" = ia64; then
45234211 # AIX 5 now supports IA64 processor
45244212 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45254213 fi
4526 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45274214 ;;
45284215
45294216 amigaos*)
45344221 ;;
45354222 m68k)
45364223 # FIXME: we need at least 68020 code to build shared libraries, but
4537 # adding the '-m68020' flag to GCC prevents building anything better,
4538 # like '-m68040'.
4224 # adding the `-m68020' flag to GCC prevents building anything better,
4225 # like `-m68040'.
45394226 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
45404227 ;;
45414228 esac
45524239 # (--disable-auto-import) libraries
45534240 m4_if([$1], [GCJ], [],
45544241 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4555 case $host_os in
4556 os2*)
4557 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4558 ;;
4559 esac
45604242 ;;
45614243
45624244 darwin* | rhapsody*)
46274309 case $host_os in
46284310 aix*)
46294311 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4630 if test ia64 = "$host_cpu"; then
4312 if test "$host_cpu" = ia64; then
46314313 # AIX 5 now supports IA64 processor
46324314 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46334315 else
46354317 fi
46364318 ;;
46374319
4638 darwin* | rhapsody*)
4639 # PIC is the default on this platform
4640 # Common symbols not allowed in MH_DYLIB files
4641 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4642 case $cc_basename in
4643 nagfor*)
4644 # NAG Fortran compiler
4645 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4646 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4647 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4648 ;;
4649 esac
4650 ;;
4651
46524320 mingw* | cygwin* | pw32* | os2* | cegcc*)
46534321 # This hack is so that the source file can tell whether it is being
46544322 # built for inclusion in a dll (and should export symbols for example).
46554323 m4_if([$1], [GCJ], [],
46564324 [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4657 case $host_os in
4658 os2*)
4659 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4660 ;;
4661 esac
46624325 ;;
46634326
46644327 hpux9* | hpux10* | hpux11*)
46744337 ;;
46754338 esac
46764339 # Is there a better lt_prog_compiler_static that works with the bundled CC?
4677 _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4340 _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
46784341 ;;
46794342
46804343 irix5* | irix6* | nonstopux*)
46854348
46864349 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
46874350 case $cc_basename in
4688 # old Intel for x86_64, which still supported -KPIC.
4351 # old Intel for x86_64 which still supported -KPIC.
46894352 ecc*)
46904353 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46914354 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47094372 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
47104373 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
47114374 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4712 ;;
4713 tcc*)
4714 # Fabrice Bellard et al's Tiny C Compiler
4715 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4716 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4717 _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47184375 ;;
47194376 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
47204377 # Portland Group compilers (*not* the Pentium gcc compiler,
48134470 ;;
48144471
48154472 sysv4*MP*)
4816 if test -d /usr/nec; then
4473 if test -d /usr/nec ;then
48174474 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
48184475 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
48194476 fi
48424499 fi
48434500 ])
48444501 case $host_os in
4845 # For platforms that do not support PIC, -DPIC is meaningless:
4502 # For platforms which do not support PIC, -DPIC is meaningless:
48464503 *djgpp*)
48474504 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
48484505 ;;
49084565 case $host_os in
49094566 aix[[4-9]]*)
49104567 # If we're using GNU nm, then we don't want the "-C" option.
4911 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4912 # Without the "-l" option, or with the "-B" option, AIX nm treats
4913 # weak defined symbols like other global defined symbols, whereas
4914 # GNU nm marks them as "W".
4915 # While the 'weak' keyword is ignored in the Export File, we need
4916 # it in the Import File for the 'aix-soname' feature, so we have
4917 # to replace the "-B" option with "-P" for AIX nm.
4568 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4569 # Also, AIX nm treats weak defined symbols like other global defined
4570 # symbols, whereas GNU nm marks them as "W".
49184571 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4919 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4572 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
49204573 else
4921 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4574 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
49224575 fi
49234576 ;;
49244577 pw32*)
4925 _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4578 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
49264579 ;;
49274580 cygwin* | mingw* | cegcc*)
49284581 case $cc_basename in
49344587 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
49354588 ;;
49364589 esac
4590 ;;
4591 linux* | k*bsd*-gnu | gnu*)
4592 _LT_TAGVAR(link_all_deplibs, $1)=no
49374593 ;;
49384594 *)
49394595 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49684624 # included in the symbol list
49694625 _LT_TAGVAR(include_expsyms, $1)=
49704626 # exclude_expsyms can be an extended regexp of symbols to exclude
4971 # it will be wrapped by ' (' and ')$', so one must not match beginning or
4972 # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4973 # as well as any symbol that contains 'd'.
4627 # it will be wrapped by ` (' and `)$', so one must not match beginning or
4628 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4629 # as well as any symbol that contains `d'.
49744630 _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
49754631 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
49764632 # platforms (ab)use it in PIC code, but their linkers get confused if
49864642 # FIXME: the MSVC++ port hasn't been tested in a loooong time
49874643 # When not using gcc, we currently assume that we are using
49884644 # Microsoft Visual C++.
4989 if test yes != "$GCC"; then
4645 if test "$GCC" != yes; then
49904646 with_gnu_ld=no
49914647 fi
49924648 ;;
49944650 # we just hope/assume this is gcc and not c89 (= MSVC++)
49954651 with_gnu_ld=yes
49964652 ;;
4997 openbsd* | bitrig*)
4653 openbsd*)
49984654 with_gnu_ld=no
4655 ;;
4656 linux* | k*bsd*-gnu | gnu*)
4657 _LT_TAGVAR(link_all_deplibs, $1)=no
49994658 ;;
50004659 esac
50014660
50044663 # On some targets, GNU ld is compatible enough with the native linker
50054664 # that we're better off using the native interface for both.
50064665 lt_use_gnu_ld_interface=no
5007 if test yes = "$with_gnu_ld"; then
4666 if test "$with_gnu_ld" = yes; then
50084667 case $host_os in
50094668 aix*)
50104669 # The AIX port of GNU ld has always aspired to compatibility
50264685 esac
50274686 fi
50284687
5029 if test yes = "$lt_use_gnu_ld_interface"; then
4688 if test "$lt_use_gnu_ld_interface" = yes; then
50304689 # If archive_cmds runs LD, not CC, wlarc should be empty
5031 wlarc='$wl'
4690 wlarc='${wl}'
50324691
50334692 # Set some defaults for GNU ld with shared library support. These
50344693 # are reset later if shared libraries are not supported. Putting them
50354694 # here allows them to be overridden if necessary.
50364695 runpath_var=LD_RUN_PATH
5037 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5038 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
4696 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4697 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
50394698 # ancient GNU ld didn't support --whole-archive et. al.
50404699 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5041 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
4700 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
50424701 else
50434702 _LT_TAGVAR(whole_archive_flag_spec, $1)=
50444703 fi
50454704 supports_anon_versioning=no
5046 case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
4705 case `$LD -v 2>&1` in
50474706 *GNU\ gold*) supports_anon_versioning=yes ;;
50484707 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
50494708 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
50564715 case $host_os in
50574716 aix[[3-9]]*)
50584717 # On AIX/PPC, the GNU linker is very broken
5059 if test ia64 != "$host_cpu"; then
4718 if test "$host_cpu" != ia64; then
50604719 _LT_TAGVAR(ld_shlibs, $1)=no
50614720 cat <<_LT_EOF 1>&2
50624721
50754734 case $host_cpu in
50764735 powerpc)
50774736 # see comment about AmigaOS4 .so support
5078 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
4737 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
50794738 _LT_TAGVAR(archive_expsym_cmds, $1)=''
50804739 ;;
50814740 m68k)
50914750 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
50924751 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
50934752 # support --undefined. This deserves some investigation. FIXME
5094 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
4753 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
50954754 else
50964755 _LT_TAGVAR(ld_shlibs, $1)=no
50974756 fi
51014760 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
51024761 # as there is no search path for DLLs.
51034762 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5104 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
4763 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
51054764 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51064765 _LT_TAGVAR(always_export_symbols, $1)=no
51074766 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51094768 _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
51104769
51114770 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5112 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5113 # If the export-symbols file already is a .def file, use it as
5114 # is; otherwise, prepend EXPORTS...
5115 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5116 cp $export_symbols $output_objdir/$soname.def;
5117 else
5118 echo EXPORTS > $output_objdir/$soname.def;
5119 cat $export_symbols >> $output_objdir/$soname.def;
5120 fi~
5121 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4771 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4772 # If the export-symbols file already is a .def file (1st line
4773 # is EXPORTS), use it as is; otherwise, prepend...
4774 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4775 cp $export_symbols $output_objdir/$soname.def;
4776 else
4777 echo EXPORTS > $output_objdir/$soname.def;
4778 cat $export_symbols >> $output_objdir/$soname.def;
4779 fi~
4780 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
51224781 else
51234782 _LT_TAGVAR(ld_shlibs, $1)=no
51244783 fi
51254784 ;;
51264785
51274786 haiku*)
5128 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
4787 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
51294788 _LT_TAGVAR(link_all_deplibs, $1)=yes
5130 ;;
5131
5132 os2*)
5133 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5134 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5135 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5136 shrext_cmds=.dll
5137 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5138 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5139 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5140 $ECHO EXPORTS >> $output_objdir/$libname.def~
5141 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5142 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5143 emximp -o $lib $output_objdir/$libname.def'
5144 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5145 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5146 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5147 $ECHO EXPORTS >> $output_objdir/$libname.def~
5148 prefix_cmds="$SED"~
5149 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5150 prefix_cmds="$prefix_cmds -e 1d";
5151 fi~
5152 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5153 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5154 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5155 emximp -o $lib $output_objdir/$libname.def'
5156 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5157 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51584789 ;;
51594790
51604791 interix[[3-9]]*)
51614792 _LT_TAGVAR(hardcode_direct, $1)=no
51624793 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5163 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5164 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
4794 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4795 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
51654796 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
51664797 # Instead, shared libraries are loaded at an image base (0x10000000 by
51674798 # default) and relocated if they conflict, which is a slow very memory
51684799 # consuming and fragmenting process. To avoid this, we pick a random,
51694800 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
51704801 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
5171 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5172 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4802 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
4803 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
51734804 ;;
51744805
51754806 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
51764807 tmp_diet=no
5177 if test linux-dietlibc = "$host_os"; then
4808 if test "$host_os" = linux-dietlibc; then
51784809 case $cc_basename in
51794810 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
51804811 esac
51814812 fi
51824813 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5183 && test no = "$tmp_diet"
4814 && test "$tmp_diet" = no
51844815 then
51854816 tmp_addflag=' $pic_flag'
51864817 tmp_sharedflag='-shared'
51874818 case $cc_basename,$host_cpu in
51884819 pgcc*) # Portland Group C compiler
5189 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
4820 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
51904821 tmp_addflag=' $pic_flag'
51914822 ;;
51924823 pgf77* | pgf90* | pgf95* | pgfortran*)
51934824 # Portland Group f77 and f90 compilers
5194 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
4825 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
51954826 tmp_addflag=' $pic_flag -Mnomain' ;;
51964827 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
51974828 tmp_addflag=' -i_dynamic' ;;
52024833 lf95*) # Lahey Fortran 8.1
52034834 _LT_TAGVAR(whole_archive_flag_spec, $1)=
52044835 tmp_sharedflag='--shared' ;;
5205 nagfor*) # NAGFOR 5.3
5206 tmp_sharedflag='-Wl,-shared' ;;
52074836 xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
52084837 tmp_sharedflag='-qmkshrobj'
52094838 tmp_addflag= ;;
52104839 nvcc*) # Cuda Compiler Driver 2.2
5211 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
4840 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
52124841 _LT_TAGVAR(compiler_needs_object, $1)=yes
52134842 ;;
52144843 esac
52154844 case `$CC -V 2>&1 | sed 5q` in
52164845 *Sun\ C*) # Sun C 5.9
5217 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
4846 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
52184847 _LT_TAGVAR(compiler_needs_object, $1)=yes
52194848 tmp_sharedflag='-G' ;;
52204849 *Sun\ F*) # Sun Fortran 8.3
52214850 tmp_sharedflag='-G' ;;
52224851 esac
5223 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5224
5225 if test yes = "$supports_anon_versioning"; then
4852 _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4853
4854 if test "x$supports_anon_versioning" = xyes; then
52264855 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5227 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5228 echo "local: *; };" >> $output_objdir/$libname.ver~
5229 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
4856 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4857 echo "local: *; };" >> $output_objdir/$libname.ver~
4858 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
52304859 fi
52314860
52324861 case $cc_basename in
5233 tcc*)
5234 _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5235 ;;
52364862 xlf* | bgf* | bgxlf* | mpixlf*)
52374863 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
52384864 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5239 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
4865 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
52404866 _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5241 if test yes = "$supports_anon_versioning"; then
4867 if test "x$supports_anon_versioning" = xyes; then
52424868 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5243 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5244 echo "local: *; };" >> $output_objdir/$libname.ver~
5245 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4869 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4870 echo "local: *; };" >> $output_objdir/$libname.ver~
4871 $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
52464872 fi
52474873 ;;
52484874 esac
52514877 fi
52524878 ;;
52534879
5254 netbsd*)
4880 netbsd* | netbsdelf*-gnu)
52554881 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
52564882 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
52574883 wlarc=
52584884 else
5259 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5260 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
4885 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4886 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
52614887 fi
52624888 ;;
52634889
52754901
52764902 _LT_EOF
52774903 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5278 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5279 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
4904 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4905 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
52804906 else
52814907 _LT_TAGVAR(ld_shlibs, $1)=no
52824908 fi
52884914 _LT_TAGVAR(ld_shlibs, $1)=no
52894915 cat <<_LT_EOF 1>&2
52904916
5291 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
4917 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
52924918 *** reliably create shared libraries on SCO systems. Therefore, libtool
52934919 *** is disabling shared libraries support. We urge you to upgrade GNU
52944920 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
53034929 # DT_RUNPATH tag from executables and libraries. But doing so
53044930 # requires that you compile everything twice, which is a pain.
53054931 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5306 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5307 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5308 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
4932 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4933 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4934 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
53094935 else
53104936 _LT_TAGVAR(ld_shlibs, $1)=no
53114937 fi
53224948
53234949 *)
53244950 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5325 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5326 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
4951 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4952 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
53274953 else
53284954 _LT_TAGVAR(ld_shlibs, $1)=no
53294955 fi
53304956 ;;
53314957 esac
53324958
5333 if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
4959 if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
53344960 runpath_var=
53354961 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
53364962 _LT_TAGVAR(export_dynamic_flag_spec, $1)=
53464972 # Note: this linker hardcodes the directories in LIBPATH if there
53474973 # are no directories specified by -L.
53484974 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5349 if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
4975 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
53504976 # Neither direct hardcoding nor static linking is supported with a
53514977 # broken collect2.
53524978 _LT_TAGVAR(hardcode_direct, $1)=unsupported
53544980 ;;
53554981
53564982 aix[[4-9]]*)
5357 if test ia64 = "$host_cpu"; then
4983 if test "$host_cpu" = ia64; then
53584984 # On IA64, the linker does run time linking by default, so we don't
53594985 # have to do anything special.
53604986 aix_use_runtimelinking=no
53614987 exp_sym_flag='-Bexport'
5362 no_entry_flag=
4988 no_entry_flag=""
53634989 else
53644990 # If we're using GNU nm, then we don't want the "-C" option.
5365 # -C means demangle to GNU nm, but means don't demangle to AIX nm.
5366 # Without the "-l" option, or with the "-B" option, AIX nm treats
5367 # weak defined symbols like other global defined symbols, whereas
5368 # GNU nm marks them as "W".
5369 # While the 'weak' keyword is ignored in the Export File, we need
5370 # it in the Import File for the 'aix-soname' feature, so we have
5371 # to replace the "-B" option with "-P" for AIX nm.
4991 # -C means demangle to AIX nm, but means don't demangle with GNU nm
4992 # Also, AIX nm treats weak defined symbols like other global
4993 # defined symbols, whereas GNU nm marks them as "W".
53724994 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5373 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4995 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
53744996 else
5375 _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4997 _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
53764998 fi
53774999 aix_use_runtimelinking=no
53785000
53795001 # Test if we are trying to use run time linking or normal
53805002 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5381 # have runtime linking enabled, and use it for executables.
5382 # For shared libraries, we enable/disable runtime linking
5383 # depending on the kind of the shared library created -
5384 # when "with_aix_soname,aix_use_runtimelinking" is:
5385 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
5386 # "aix,yes" lib.so shared, rtl:yes, for executables
5387 # lib.a static archive
5388 # "both,no" lib.so.V(shr.o) shared, rtl:yes
5389 # lib.a(lib.so.V) shared, rtl:no, for executables
5390 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5391 # lib.a(lib.so.V) shared, rtl:no
5392 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
5393 # lib.a static archive
5003 # need to do runtime linking.
53945004 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
53955005 for ld_flag in $LDFLAGS; do
5396 if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5006 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
53975007 aix_use_runtimelinking=yes
53985008 break
53995009 fi
54005010 done
5401 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5402 # With aix-soname=svr4, we create the lib.so.V shared archives only,
5403 # so we don't have lib.a shared libs to link our executables.
5404 # We have to force runtime linking in this case.
5405 aix_use_runtimelinking=yes
5406 LDFLAGS="$LDFLAGS -Wl,-brtl"
5407 fi
54085011 ;;
54095012 esac
54105013
54235026 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
54245027 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
54255028 _LT_TAGVAR(link_all_deplibs, $1)=yes
5426 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5427 case $with_aix_soname,$aix_use_runtimelinking in
5428 aix,*) ;; # traditional, no import file
5429 svr4,* | *,yes) # use import file
5430 # The Import File defines what to hardcode.
5431 _LT_TAGVAR(hardcode_direct, $1)=no
5432 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
5433 ;;
5434 esac
5435
5436 if test yes = "$GCC"; then
5029 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5030
5031 if test "$GCC" = yes; then
54375032 case $host_os in aix4.[[012]]|aix4.[[012]].*)
54385033 # We only want to do this on AIX 4.2 and lower, the check
54395034 # below for broken collect2 doesn't work under 4.3+
5440 collect2name=`$CC -print-prog-name=collect2`
5035 collect2name=`${CC} -print-prog-name=collect2`
54415036 if test -f "$collect2name" &&
54425037 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
54435038 then
54565051 ;;
54575052 esac
54585053 shared_flag='-shared'
5459 if test yes = "$aix_use_runtimelinking"; then
5460 shared_flag="$shared_flag "'$wl-G'
5054 if test "$aix_use_runtimelinking" = yes; then
5055 shared_flag="$shared_flag "'${wl}-G'
54615056 fi
5462 # Need to ensure runtime linking is disabled for the traditional
5463 # shared library, or the linker may eventually find shared libraries
5464 # /with/ Import File - we do not want to mix them.
5465 shared_flag_aix='-shared'
5466 shared_flag_svr4='-shared $wl-G'
5057 _LT_TAGVAR(link_all_deplibs, $1)=no
54675058 else
54685059 # not using gcc
5469 if test ia64 = "$host_cpu"; then
5060 if test "$host_cpu" = ia64; then
54705061 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
54715062 # chokes on -Wl,-G. The following line is correct:
54725063 shared_flag='-G'
54735064 else
5474 if test yes = "$aix_use_runtimelinking"; then
5475 shared_flag='$wl-G'
5065 if test "$aix_use_runtimelinking" = yes; then
5066 shared_flag='${wl}-G'
54765067 else
5477 shared_flag='$wl-bM:SRE'
5068 shared_flag='${wl}-bM:SRE'
54785069 fi
5479 shared_flag_aix='$wl-bM:SRE'
5480 shared_flag_svr4='$wl-G'
54815070 fi
54825071 fi
54835072
5484 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5073 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
54855074 # It seems that -bexpall does not export symbols beginning with
54865075 # underscore (_), so it is better to generate a list of symbols to export.
54875076 _LT_TAGVAR(always_export_symbols, $1)=yes
5488 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5077 if test "$aix_use_runtimelinking" = yes; then
54895078 # Warning - without using the other runtime loading flags (-brtl),
54905079 # -berok will link without error, but may produce a broken library.
54915080 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
54925081 # Determine the default libpath from the value encoded in an
54935082 # empty executable.
54945083 _LT_SYS_MODULE_PATH_AIX([$1])
5495 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5496 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5084 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5085 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
54975086 else
5498 if test ia64 = "$host_cpu"; then
5499 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5087 if test "$host_cpu" = ia64; then
5088 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
55005089 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5501 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
5090 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
55025091 else
55035092 # Determine the default libpath from the value encoded in an
55045093 # empty executable.
55055094 _LT_SYS_MODULE_PATH_AIX([$1])
5506 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5095 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
55075096 # Warning - without using the other run time loading flags,
55085097 # -berok will link without error, but may produce a broken library.
5509 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5510 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5511 if test yes = "$with_gnu_ld"; then
5098 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5099 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5100 if test "$with_gnu_ld" = yes; then
55125101 # We only use this code for GNU lds that support --whole-archive.
5513 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5102 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
55145103 else
55155104 # Exported symbols can be pulled into shared objects from archives
55165105 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
55175106 fi
55185107 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5519 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5520 # -brtl affects multiple linker settings, -berok does not and is overridden later
5521 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5522 if test svr4 != "$with_aix_soname"; then
5523 # This is similar to how AIX traditionally builds its shared libraries.
5524 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5525 fi
5526 if test aix != "$with_aix_soname"; then
5527 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5528 else
5529 # used by -dlpreopen to get the symbols
5530 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
5531 fi
5532 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5108 # This is similar to how AIX traditionally builds its shared libraries.
5109 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
55335110 fi
55345111 fi
55355112 ;;
55385115 case $host_cpu in
55395116 powerpc)
55405117 # see comment about AmigaOS4 .so support
5541 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5118 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
55425119 _LT_TAGVAR(archive_expsym_cmds, $1)=''
55435120 ;;
55445121 m68k)
55685145 # Tell ltmain to make .lib files, not .a files.
55695146 libext=lib
55705147 # Tell ltmain to make .dll files, not .so files.
5571 shrext_cmds=.dll
5148 shrext_cmds=".dll"
55725149 # FIXME: Setting linknames here is a bad hack.
5573 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5574 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5575 cp "$export_symbols" "$output_objdir/$soname.def";
5576 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5577 else
5578 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5579 fi~
5580 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5581 linknames='
5150 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5151 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5152 sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5153 else
5154 sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5155 fi~
5156 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5157 linknames='
55825158 # The linker will not automatically build a static lib if we build a DLL.
55835159 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
55845160 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
55875163 # Don't use ranlib
55885164 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
55895165 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5590 lt_tool_outputfile="@TOOL_OUTPUT@"~
5591 case $lt_outputfile in
5592 *.exe|*.EXE) ;;
5593 *)
5594 lt_outputfile=$lt_outputfile.exe
5595 lt_tool_outputfile=$lt_tool_outputfile.exe
5596 ;;
5597 esac~
5598 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5599 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5600 $RM "$lt_outputfile.manifest";
5601 fi'
5166 lt_tool_outputfile="@TOOL_OUTPUT@"~
5167 case $lt_outputfile in
5168 *.exe|*.EXE) ;;
5169 *)
5170 lt_outputfile="$lt_outputfile.exe"
5171 lt_tool_outputfile="$lt_tool_outputfile.exe"
5172 ;;
5173 esac~
5174 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5175 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5176 $RM "$lt_outputfile.manifest";
5177 fi'
56025178 ;;
56035179 *)
56045180 # Assume MSVC wrapper
56075183 # Tell ltmain to make .lib files, not .a files.
56085184 libext=lib
56095185 # Tell ltmain to make .dll files, not .so files.
5610 shrext_cmds=.dll
5186 shrext_cmds=".dll"
56115187 # FIXME: Setting linknames here is a bad hack.
56125188 _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
56135189 # The linker will automatically build a .lib file if we build a DLL.
56575233 ;;
56585234
56595235 hpux9*)
5660 if test yes = "$GCC"; then
5661 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5236 if test "$GCC" = yes; then
5237 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
56625238 else
5663 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5239 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
56645240 fi
5665 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5241 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
56665242 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56675243 _LT_TAGVAR(hardcode_direct, $1)=yes
56685244
56695245 # hardcode_minus_L: Not really in the search PATH,
56705246 # but as the default location of the library.
56715247 _LT_TAGVAR(hardcode_minus_L, $1)=yes
5672 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5248 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
56735249 ;;
56745250
56755251 hpux10*)
5676 if test yes,no = "$GCC,$with_gnu_ld"; then
5677 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5252 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5253 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
56785254 else
56795255 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
56805256 fi
5681 if test no = "$with_gnu_ld"; then
5682 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5257 if test "$with_gnu_ld" = no; then
5258 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
56835259 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56845260 _LT_TAGVAR(hardcode_direct, $1)=yes
56855261 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5686 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5262 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
56875263 # hardcode_minus_L: Not really in the search PATH,
56885264 # but as the default location of the library.
56895265 _LT_TAGVAR(hardcode_minus_L, $1)=yes
56915267 ;;
56925268
56935269 hpux11*)
5694 if test yes,no = "$GCC,$with_gnu_ld"; then
5270 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
56955271 case $host_cpu in
56965272 hppa*64*)
5697 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5273 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
56985274 ;;
56995275 ia64*)
5700 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5276 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57015277 ;;
57025278 *)
5703 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5279 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57045280 ;;
57055281 esac
57065282 else
57075283 case $host_cpu in
57085284 hppa*64*)
5709 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5285 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
57105286 ;;
57115287 ia64*)
5712 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5288 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57135289 ;;
57145290 *)
57155291 m4_if($1, [], [
57175293 # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
57185294 _LT_LINKER_OPTION([if $CC understands -b],
57195295 _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5720 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5296 [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
57215297 [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5722 [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5298 [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
57235299 ;;
57245300 esac
57255301 fi
5726 if test no = "$with_gnu_ld"; then
5727 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5302 if test "$with_gnu_ld" = no; then
5303 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
57285304 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57295305
57305306 case $host_cpu in
57355311 *)
57365312 _LT_TAGVAR(hardcode_direct, $1)=yes
57375313 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5738 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5314 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
57395315
57405316 # hardcode_minus_L: Not really in the search PATH,
57415317 # but as the default location of the library.
57465322 ;;
57475323
57485324 irix5* | irix6* | nonstopux*)
5749 if test yes = "$GCC"; then
5750 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5325 if test "$GCC" = yes; then
5326 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
57515327 # Try to use the -exported_symbol ld option, if it does not
57525328 # work, assume that -exports_file does not work either and
57535329 # implicitly export all symbols.
57545330 # This should be the same for all languages, so no per-tag cache variable.
57555331 AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
57565332 [lt_cv_irix_exported_symbol],
5757 [save_LDFLAGS=$LDFLAGS
5758 LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5333 [save_LDFLAGS="$LDFLAGS"
5334 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
57595335 AC_LINK_IFELSE(
57605336 [AC_LANG_SOURCE(
57615337 [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
57685344 end]])])],
57695345 [lt_cv_irix_exported_symbol=yes],
57705346 [lt_cv_irix_exported_symbol=no])
5771 LDFLAGS=$save_LDFLAGS])
5772 if test yes = "$lt_cv_irix_exported_symbol"; then
5773 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
5347 LDFLAGS="$save_LDFLAGS"])
5348 if test "$lt_cv_irix_exported_symbol" = yes; then
5349 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
57745350 fi
57755351 else
5776 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5777 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
5352 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5353 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
57785354 fi
57795355 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5780 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5356 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
57815357 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
57825358 _LT_TAGVAR(inherit_rpath, $1)=yes
57835359 _LT_TAGVAR(link_all_deplibs, $1)=yes
57845360 ;;
57855361
5786 linux*)
5787 case $cc_basename in
5788 tcc*)
5789 # Fabrice Bellard et al's Tiny C Compiler
5790 _LT_TAGVAR(ld_shlibs, $1)=yes
5791 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5792 ;;
5793 esac
5794 ;;
5795
5796 netbsd*)
5362 netbsd* | netbsdelf*-gnu)
57975363 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
57985364 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
57995365 else
58075373 newsos6)
58085374 _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58095375 _LT_TAGVAR(hardcode_direct, $1)=yes
5810 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5376 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58115377 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58125378 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58135379 ;;
58155381 *nto* | *qnx*)
58165382 ;;
58175383
5818 openbsd* | bitrig*)
5384 openbsd*)
58195385 if test -f /usr/libexec/ld.so; then
58205386 _LT_TAGVAR(hardcode_direct, $1)=yes
58215387 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58225388 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5823 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5389 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
58245390 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5825 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5826 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5827 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5391 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5392 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5393 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
58285394 else
5829 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5830 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5395 case $host_os in
5396 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5397 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5398 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5399 ;;
5400 *)
5401 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5402 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5403 ;;
5404 esac
58315405 fi
58325406 else
58335407 _LT_TAGVAR(ld_shlibs, $1)=no
58385412 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58395413 _LT_TAGVAR(hardcode_minus_L, $1)=yes
58405414 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5841 shrext_cmds=.dll
5842 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5843 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5844 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5845 $ECHO EXPORTS >> $output_objdir/$libname.def~
5846 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5847 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5848 emximp -o $lib $output_objdir/$libname.def'
5849 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5850 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5851 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5852 $ECHO EXPORTS >> $output_objdir/$libname.def~
5853 prefix_cmds="$SED"~
5854 if test EXPORTS = "`$SED 1q $export_symbols`"; then
5855 prefix_cmds="$prefix_cmds -e 1d";
5856 fi~
5857 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5858 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5859 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5860 emximp -o $lib $output_objdir/$libname.def'
5861 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5862 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5415 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5416 _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
58635417 ;;
58645418
58655419 osf3*)
5866 if test yes = "$GCC"; then
5867 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5868 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5420 if test "$GCC" = yes; then
5421 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5422 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
58695423 else
58705424 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5871 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5425 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
58725426 fi
58735427 _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5874 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5428 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58755429 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58765430 ;;
58775431
58785432 osf4* | osf5*) # as osf3* with the addition of -msym flag
5879 if test yes = "$GCC"; then
5880 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5881 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5882 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5433 if test "$GCC" = yes; then
5434 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5435 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5436 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
58835437 else
58845438 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5885 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5439 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
58865440 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5887 $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
5441 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
58885442
58895443 # Both c and cxx compiler support -rpath directly
58905444 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
58955449
58965450 solaris*)
58975451 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5898 if test yes = "$GCC"; then
5899 wlarc='$wl'
5900 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5452 if test "$GCC" = yes; then
5453 wlarc='${wl}'
5454 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
59015455 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5902 $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5456 $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59035457 else
59045458 case `$CC -V 2>&1` in
59055459 *"Compilers 5.0"*)
59065460 wlarc=''
5907 _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5461 _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
59085462 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5909 $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5463 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
59105464 ;;
59115465 *)
5912 wlarc='$wl'
5913 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5466 wlarc='${wl}'
5467 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
59145468 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5915 $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5469 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59165470 ;;
59175471 esac
59185472 fi
59225476 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
59235477 *)
59245478 # The compiler driver will combine and reorder linker options,
5925 # but understands '-z linker_flag'. GCC discards it without '$wl',
5479 # but understands `-z linker_flag'. GCC discards it without `$wl',
59265480 # but is careful enough not to reorder.
59275481 # Supported since Solaris 2.6 (maybe 2.5.1?)
5928 if test yes = "$GCC"; then
5929 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5482 if test "$GCC" = yes; then
5483 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
59305484 else
59315485 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
59325486 fi
59365490 ;;
59375491
59385492 sunos4*)
5939 if test sequent = "$host_vendor"; then
5493 if test "x$host_vendor" = xsequent; then
59405494 # Use $CC to link under sequent, because it throws in some extra .o
59415495 # files that make .init and .fini sections work.
5942 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5496 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
59435497 else
59445498 _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
59455499 fi
59885542 ;;
59895543
59905544 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5991 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
5545 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
59925546 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
59935547 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59945548 runpath_var='LD_RUN_PATH'
59955549
5996 if test yes = "$GCC"; then
5997 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5998 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5550 if test "$GCC" = yes; then
5551 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5552 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
59995553 else
6000 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6001 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5554 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5555 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60025556 fi
60035557 ;;
60045558
60055559 sysv5* | sco3.2v5* | sco5v6*)
6006 # Note: We CANNOT use -z defs as we might desire, because we do not
5560 # Note: We can NOT use -z defs as we might desire, because we do not
60075561 # link with -lc, and that would cause any symbols used from libc to
60085562 # always be unresolved, which means just about no library would
60095563 # ever link correctly. If we're not using GNU ld we use -z text
60105564 # though, which does catch some bad symbols but isn't as heavy-handed
60115565 # as -z defs.
6012 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6013 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
5566 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5567 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
60145568 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60155569 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6016 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
5570 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
60175571 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60185572 _LT_TAGVAR(link_all_deplibs, $1)=yes
6019 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
5573 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
60205574 runpath_var='LD_RUN_PATH'
60215575
6022 if test yes = "$GCC"; then
6023 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6024 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5576 if test "$GCC" = yes; then
5577 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5578 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60255579 else
6026 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6027 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5580 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5581 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60285582 fi
60295583 ;;
60305584
60395593 ;;
60405594 esac
60415595
6042 if test sni = "$host_vendor"; then
5596 if test x$host_vendor = xsni; then
60435597 case $host in
60445598 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6045 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
5599 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
60465600 ;;
60475601 esac
60485602 fi
60495603 fi
60505604 ])
60515605 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6052 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
5606 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
60535607
60545608 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
60555609
60665620 # Assume -lc should be added
60675621 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60685622
6069 if test yes,yes = "$GCC,$enable_shared"; then
5623 if test "$enable_shared" = yes && test "$GCC" = yes; then
60705624 case $_LT_TAGVAR(archive_cmds, $1) in
60715625 *'~'*)
60725626 # FIXME: we may have to deal with multi-command sequences.
61465700 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
61475701 [Whether we need a single "-rpath" flag with a separated argument])
61485702 _LT_TAGDECL([], [hardcode_direct], [0],
6149 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
5703 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
61505704 DIR into the resulting binary])
61515705 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
6152 [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
5706 [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
61535707 DIR into the resulting binary and the resulting library dependency is
6154 "absolute", i.e impossible to change by setting $shlibpath_var if the
5708 "absolute", i.e impossible to change by setting ${shlibpath_var} if the
61555709 library is relocated])
61565710 _LT_TAGDECL([], [hardcode_minus_L], [0],
61575711 [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
61925746 # ------------------------
61935747 # Ensure that the configuration variables for a C compiler are suitably
61945748 # defined. These variables are subsequently used by _LT_CONFIG to write
6195 # the compiler configuration to 'libtool'.
5749 # the compiler configuration to `libtool'.
61965750 m4_defun([_LT_LANG_C_CONFIG],
61975751 [m4_require([_LT_DECL_EGREP])dnl
6198 lt_save_CC=$CC
5752 lt_save_CC="$CC"
61995753 AC_LANG_PUSH(C)
62005754
62015755 # Source file extension for C test sources.
62355789 LT_SYS_DLOPEN_SELF
62365790 _LT_CMD_STRIPLIB
62375791
6238 # Report what library types will actually be built
5792 # Report which library types will actually be built
62395793 AC_MSG_CHECKING([if libtool supports shared libraries])
62405794 AC_MSG_RESULT([$can_build_shared])
62415795
62425796 AC_MSG_CHECKING([whether to build shared libraries])
6243 test no = "$can_build_shared" && enable_shared=no
5797 test "$can_build_shared" = "no" && enable_shared=no
62445798
62455799 # On AIX, shared libraries and static libraries use the same namespace, and
62465800 # are all built from PIC.
62475801 case $host_os in
62485802 aix3*)
6249 test yes = "$enable_shared" && enable_static=no
5803 test "$enable_shared" = yes && enable_static=no
62505804 if test -n "$RANLIB"; then
62515805 archive_cmds="$archive_cmds~\$RANLIB \$lib"
62525806 postinstall_cmds='$RANLIB $lib'
62545808 ;;
62555809
62565810 aix[[4-9]]*)
6257 if test ia64 != "$host_cpu"; then
6258 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6259 yes,aix,yes) ;; # shared object as lib.so file only
6260 yes,svr4,*) ;; # shared object as lib.so archive member only
6261 yes,*) enable_static=no ;; # shared object in lib.a archive as well
6262 esac
5811 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5812 test "$enable_shared" = yes && enable_static=no
62635813 fi
62645814 ;;
62655815 esac
62675817
62685818 AC_MSG_CHECKING([whether to build static libraries])
62695819 # Make sure either enable_shared or enable_static is yes.
6270 test yes = "$enable_shared" || enable_static=yes
5820 test "$enable_shared" = yes || enable_static=yes
62715821 AC_MSG_RESULT([$enable_static])
62725822
62735823 _LT_CONFIG($1)
62745824 fi
62755825 AC_LANG_POP
6276 CC=$lt_save_CC
5826 CC="$lt_save_CC"
62775827 ])# _LT_LANG_C_CONFIG
62785828
62795829
62815831 # --------------------------
62825832 # Ensure that the configuration variables for a C++ compiler are suitably
62835833 # defined. These variables are subsequently used by _LT_CONFIG to write
6284 # the compiler configuration to 'libtool'.
5834 # the compiler configuration to `libtool'.
62855835 m4_defun([_LT_LANG_CXX_CONFIG],
62865836 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
62875837 m4_require([_LT_DECL_EGREP])dnl
62885838 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
6289 if test -n "$CXX" && ( test no != "$CXX" &&
6290 ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6291 (test g++ != "$CXX"))); then
5839 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5840 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5841 (test "X$CXX" != "Xg++"))) ; then
62925842 AC_PROG_CXXCPP
62935843 else
62945844 _lt_caught_CXX_error=yes
63305880 # the CXX compiler isn't working. Some variables (like enable_shared)
63315881 # are currently assumed to apply to all compilers on this platform,
63325882 # and will be corrupted by setting them based on a non-working compiler.
6333 if test yes != "$_lt_caught_CXX_error"; then
5883 if test "$_lt_caught_CXX_error" != yes; then
63345884 # Code to be used in simple compile tests
63355885 lt_simple_compile_test_code="int some_variable = 0;"
63365886
63725922 if test -n "$compiler"; then
63735923 # We don't want -fno-exception when compiling C++ code, so set the
63745924 # no_builtin_flag separately
6375 if test yes = "$GXX"; then
5925 if test "$GXX" = yes; then
63765926 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
63775927 else
63785928 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
63795929 fi
63805930
6381 if test yes = "$GXX"; then
5931 if test "$GXX" = yes; then
63825932 # Set up default GNU C++ configuration
63835933
63845934 LT_PATH_LD
63855935
63865936 # Check if GNU C++ uses GNU ld as the underlying linker, since the
63875937 # archiving commands below assume that GNU ld is being used.
6388 if test yes = "$with_gnu_ld"; then
6389 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6390 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6391
6392 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6393 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5938 if test "$with_gnu_ld" = yes; then
5939 _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5940 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5941
5942 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5943 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
63945944
63955945 # If archive_cmds runs LD, not CC, wlarc should be empty
63965946 # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
63975947 # investigate it a little bit more. (MM)
6398 wlarc='$wl'
5948 wlarc='${wl}'
63995949
64005950 # ancient GNU ld didn't support --whole-archive et. al.
64015951 if eval "`$CC -print-prog-name=ld` --help 2>&1" |
64025952 $GREP 'no-whole-archive' > /dev/null; then
6403 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5953 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
64045954 else
64055955 _LT_TAGVAR(whole_archive_flag_spec, $1)=
64065956 fi
64365986 _LT_TAGVAR(ld_shlibs, $1)=no
64375987 ;;
64385988 aix[[4-9]]*)
6439 if test ia64 = "$host_cpu"; then
5989 if test "$host_cpu" = ia64; then
64405990 # On IA64, the linker does run time linking by default, so we don't
64415991 # have to do anything special.
64425992 aix_use_runtimelinking=no
64435993 exp_sym_flag='-Bexport'
6444 no_entry_flag=
5994 no_entry_flag=""
64455995 else
64465996 aix_use_runtimelinking=no
64475997
64485998 # Test if we are trying to use run time linking or normal
64495999 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6450 # have runtime linking enabled, and use it for executables.
6451 # For shared libraries, we enable/disable runtime linking
6452 # depending on the kind of the shared library created -
6453 # when "with_aix_soname,aix_use_runtimelinking" is:
6454 # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
6455 # "aix,yes" lib.so shared, rtl:yes, for executables
6456 # lib.a static archive
6457 # "both,no" lib.so.V(shr.o) shared, rtl:yes
6458 # lib.a(lib.so.V) shared, rtl:no, for executables
6459 # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6460 # lib.a(lib.so.V) shared, rtl:no
6461 # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
6462 # lib.a static archive
6000 # need to do runtime linking.
64636001 case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
64646002 for ld_flag in $LDFLAGS; do
64656003 case $ld_flag in
64696007 ;;
64706008 esac
64716009 done
6472 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6473 # With aix-soname=svr4, we create the lib.so.V shared archives only,
6474 # so we don't have lib.a shared libs to link our executables.
6475 # We have to force runtime linking in this case.
6476 aix_use_runtimelinking=yes
6477 LDFLAGS="$LDFLAGS -Wl,-brtl"
6478 fi
64796010 ;;
64806011 esac
64816012
64946025 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
64956026 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
64966027 _LT_TAGVAR(link_all_deplibs, $1)=yes
6497 _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6498 case $with_aix_soname,$aix_use_runtimelinking in
6499 aix,*) ;; # no import file
6500 svr4,* | *,yes) # use import file
6501 # The Import File defines what to hardcode.
6502 _LT_TAGVAR(hardcode_direct, $1)=no
6503 _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6504 ;;
6505 esac
6506
6507 if test yes = "$GXX"; then
6028 _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6029
6030 if test "$GXX" = yes; then
65086031 case $host_os in aix4.[[012]]|aix4.[[012]].*)
65096032 # We only want to do this on AIX 4.2 and lower, the check
65106033 # below for broken collect2 doesn't work under 4.3+
6511 collect2name=`$CC -print-prog-name=collect2`
6034 collect2name=`${CC} -print-prog-name=collect2`
65126035 if test -f "$collect2name" &&
65136036 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
65146037 then
65266049 fi
65276050 esac
65286051 shared_flag='-shared'
6529 if test yes = "$aix_use_runtimelinking"; then
6530 shared_flag=$shared_flag' $wl-G'
6052 if test "$aix_use_runtimelinking" = yes; then
6053 shared_flag="$shared_flag "'${wl}-G'
65316054 fi
6532 # Need to ensure runtime linking is disabled for the traditional
6533 # shared library, or the linker may eventually find shared libraries
6534 # /with/ Import File - we do not want to mix them.
6535 shared_flag_aix='-shared'
6536 shared_flag_svr4='-shared $wl-G'
65376055 else
65386056 # not using gcc
6539 if test ia64 = "$host_cpu"; then
6057 if test "$host_cpu" = ia64; then
65406058 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
65416059 # chokes on -Wl,-G. The following line is correct:
65426060 shared_flag='-G'
65436061 else
6544 if test yes = "$aix_use_runtimelinking"; then
6545 shared_flag='$wl-G'
6062 if test "$aix_use_runtimelinking" = yes; then
6063 shared_flag='${wl}-G'
65466064 else
6547 shared_flag='$wl-bM:SRE'
6065 shared_flag='${wl}-bM:SRE'
65486066 fi
6549 shared_flag_aix='$wl-bM:SRE'
6550 shared_flag_svr4='$wl-G'
65516067 fi
65526068 fi
65536069
6554 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6070 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
65556071 # It seems that -bexpall does not export symbols beginning with
65566072 # underscore (_), so it is better to generate a list of symbols to
65576073 # export.
65586074 _LT_TAGVAR(always_export_symbols, $1)=yes
6559 if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6075 if test "$aix_use_runtimelinking" = yes; then
65606076 # Warning - without using the other runtime loading flags (-brtl),
65616077 # -berok will link without error, but may produce a broken library.
6562 # The "-G" linker flag allows undefined symbols.
6563 _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6078 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
65646079 # Determine the default libpath from the value encoded in an empty
65656080 # executable.
65666081 _LT_SYS_MODULE_PATH_AIX([$1])
6567 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6568
6569 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6082 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6083
6084 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
65706085 else
6571 if test ia64 = "$host_cpu"; then
6572 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6086 if test "$host_cpu" = ia64; then
6087 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
65736088 _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6574 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
6089 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
65756090 else
65766091 # Determine the default libpath from the value encoded in an
65776092 # empty executable.
65786093 _LT_SYS_MODULE_PATH_AIX([$1])
6579 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6094 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
65806095 # Warning - without using the other run time loading flags,
65816096 # -berok will link without error, but may produce a broken library.
6582 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6583 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6584 if test yes = "$with_gnu_ld"; then
6097 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6098 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6099 if test "$with_gnu_ld" = yes; then
65856100 # We only use this code for GNU lds that support --whole-archive.
6586 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6101 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
65876102 else
65886103 # Exported symbols can be pulled into shared objects from archives
65896104 _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
65906105 fi
65916106 _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6592 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6593 # -brtl affects multiple linker settings, -berok does not and is overridden later
6594 compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6595 if test svr4 != "$with_aix_soname"; then
6596 # This is similar to how AIX traditionally builds its shared
6597 # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6598 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6599 fi
6600 if test aix != "$with_aix_soname"; then
6601 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6602 else
6603 # used by -dlpreopen to get the symbols
6604 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
6605 fi
6606 _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6107 # This is similar to how AIX traditionally builds its shared
6108 # libraries.
6109 _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
66076110 fi
66086111 fi
66096112 ;;
66136116 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66146117 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
66156118 # support --undefined. This deserves some investigation. FIXME
6616 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6119 _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
66176120 else
66186121 _LT_TAGVAR(ld_shlibs, $1)=no
66196122 fi
66416144 # Tell ltmain to make .lib files, not .a files.
66426145 libext=lib
66436146 # Tell ltmain to make .dll files, not .so files.
6644 shrext_cmds=.dll
6147 shrext_cmds=".dll"
66456148 # FIXME: Setting linknames here is a bad hack.
6646 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6647 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6648 cp "$export_symbols" "$output_objdir/$soname.def";
6649 echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6650 else
6651 $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6652 fi~
6653 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6654 linknames='
6149 _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6150 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6151 $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6152 else
6153 $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6154 fi~
6155 $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6156 linknames='
66556157 # The linker will not automatically build a static lib if we build a DLL.
66566158 # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
66576159 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66586160 # Don't use ranlib
66596161 _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
66606162 _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6661 lt_tool_outputfile="@TOOL_OUTPUT@"~
6662 case $lt_outputfile in
6663 *.exe|*.EXE) ;;
6664 *)
6665 lt_outputfile=$lt_outputfile.exe
6666 lt_tool_outputfile=$lt_tool_outputfile.exe
6667 ;;
6668 esac~
6669 func_to_tool_file "$lt_outputfile"~
6670 if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6671 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6672 $RM "$lt_outputfile.manifest";
6673 fi'
6163 lt_tool_outputfile="@TOOL_OUTPUT@"~
6164 case $lt_outputfile in
6165 *.exe|*.EXE) ;;
6166 *)
6167 lt_outputfile="$lt_outputfile.exe"
6168 lt_tool_outputfile="$lt_tool_outputfile.exe"
6169 ;;
6170 esac~
6171 func_to_tool_file "$lt_outputfile"~
6172 if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6173 $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6174 $RM "$lt_outputfile.manifest";
6175 fi'
66746176 ;;
66756177 *)
66766178 # g++
66776179 # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
66786180 # as there is no search path for DLLs.
66796181 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6680 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6182 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
66816183 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66826184 _LT_TAGVAR(always_export_symbols, $1)=no
66836185 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66846186
66856187 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6686 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6687 # If the export-symbols file already is a .def file, use it as
6688 # is; otherwise, prepend EXPORTS...
6689 _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6690 cp $export_symbols $output_objdir/$soname.def;
6691 else
6692 echo EXPORTS > $output_objdir/$soname.def;
6693 cat $export_symbols >> $output_objdir/$soname.def;
6694 fi~
6695 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6188 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6189 # If the export-symbols file already is a .def file (1st line
6190 # is EXPORTS), use it as is; otherwise, prepend...
6191 _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6192 cp $export_symbols $output_objdir/$soname.def;
6193 else
6194 echo EXPORTS > $output_objdir/$soname.def;
6195 cat $export_symbols >> $output_objdir/$soname.def;
6196 fi~
6197 $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
66966198 else
66976199 _LT_TAGVAR(ld_shlibs, $1)=no
66986200 fi
67016203 ;;
67026204 darwin* | rhapsody*)
67036205 _LT_DARWIN_LINKER_FEATURES($1)
6704 ;;
6705
6706 os2*)
6707 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6708 _LT_TAGVAR(hardcode_minus_L, $1)=yes
6709 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6710 shrext_cmds=.dll
6711 _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6712 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6713 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6714 $ECHO EXPORTS >> $output_objdir/$libname.def~
6715 emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6716 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6717 emximp -o $lib $output_objdir/$libname.def'
6718 _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6719 $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6720 $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6721 $ECHO EXPORTS >> $output_objdir/$libname.def~
6722 prefix_cmds="$SED"~
6723 if test EXPORTS = "`$SED 1q $export_symbols`"; then
6724 prefix_cmds="$prefix_cmds -e 1d";
6725 fi~
6726 prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6727 cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6728 $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6729 emximp -o $lib $output_objdir/$libname.def'
6730 _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6731 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
67326206 ;;
67336207
67346208 dgux*)
67666240 ;;
67676241
67686242 haiku*)
6769 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6243 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
67706244 _LT_TAGVAR(link_all_deplibs, $1)=yes
67716245 ;;
67726246
67736247 hpux9*)
6774 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6248 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
67756249 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6776 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6250 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
67776251 _LT_TAGVAR(hardcode_direct, $1)=yes
67786252 _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
67796253 # but as the default
67856259 _LT_TAGVAR(ld_shlibs, $1)=no
67866260 ;;
67876261 aCC*)
6788 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6262 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
67896263 # Commands to make compiler produce verbose output that lists
67906264 # what "hidden" libraries, object files and flags are used when
67916265 # linking a shared library.
67946268 # explicitly linking system object files so we need to strip them
67956269 # from the output so that they don't get included in the library
67966270 # dependencies.
6797 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6271 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
67986272 ;;
67996273 *)
6800 if test yes = "$GXX"; then
6801 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6274 if test "$GXX" = yes; then
6275 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
68026276 else
68036277 # FIXME: insert proper C++ library support
68046278 _LT_TAGVAR(ld_shlibs, $1)=no
68086282 ;;
68096283
68106284 hpux10*|hpux11*)
6811 if test no = "$with_gnu_ld"; then
6812 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6285 if test $with_gnu_ld = no; then
6286 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
68136287 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68146288
68156289 case $host_cpu in
68166290 hppa*64*|ia64*)
68176291 ;;
68186292 *)
6819 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6293 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
68206294 ;;
68216295 esac
68226296 fi
68426316 aCC*)
68436317 case $host_cpu in
68446318 hppa*64*)
6845 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6319 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68466320 ;;
68476321 ia64*)
6848 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6322 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68496323 ;;
68506324 *)
6851 _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6325 _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68526326 ;;
68536327 esac
68546328 # Commands to make compiler produce verbose output that lists
68596333 # explicitly linking system object files so we need to strip them
68606334 # from the output so that they don't get included in the library
68616335 # dependencies.
6862 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6336 output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
68636337 ;;
68646338 *)
6865 if test yes = "$GXX"; then
6866 if test no = "$with_gnu_ld"; then
6339 if test "$GXX" = yes; then
6340 if test $with_gnu_ld = no; then
68676341 case $host_cpu in
68686342 hppa*64*)
6869 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6343 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68706344 ;;
68716345 ia64*)
6872 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6346 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68736347 ;;
68746348 *)
6875 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6349 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68766350 ;;
68776351 esac
68786352 fi
68876361 interix[[3-9]]*)
68886362 _LT_TAGVAR(hardcode_direct, $1)=no
68896363 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6890 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6891 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6364 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6365 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
68926366 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
68936367 # Instead, shared libraries are loaded at an image base (0x10000000 by
68946368 # default) and relocated if they conflict, which is a slow very memory
68956369 # consuming and fragmenting process. To avoid this, we pick a random,
68966370 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
68976371 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
6898 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6899 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6372 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6373 _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
69006374 ;;
69016375 irix5* | irix6*)
69026376 case $cc_basename in
69036377 CC*)
69046378 # SGI C++
6905 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
6379 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
69066380
69076381 # Archives containing C++ object files must be created using
69086382 # "CC -ar", where "CC" is the IRIX C++ compiler. This is
69116385 _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
69126386 ;;
69136387 *)
6914 if test yes = "$GXX"; then
6915 if test no = "$with_gnu_ld"; then
6916 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6388 if test "$GXX" = yes; then
6389 if test "$with_gnu_ld" = no; then
6390 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
69176391 else
6918 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
6392 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
69196393 fi
69206394 fi
69216395 _LT_TAGVAR(link_all_deplibs, $1)=yes
69226396 ;;
69236397 esac
6924 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6398 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
69256399 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
69266400 _LT_TAGVAR(inherit_rpath, $1)=yes
69276401 ;;
69346408 # KCC will only create a shared library if the output file
69356409 # ends with ".so" (or ".sl" for HP-UX), so rename the library
69366410 # to its proper name (with version) after linking.
6937 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6938 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
6411 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6412 _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
69396413 # Commands to make compiler produce verbose output that lists
69406414 # what "hidden" libraries, object files and flags are used when
69416415 # linking a shared library.
69446418 # explicitly linking system object files so we need to strip them
69456419 # from the output so that they don't get included in the library
69466420 # dependencies.
6947 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6948
6949 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6950 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6421 output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6422
6423 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6424 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
69516425
69526426 # Archives containing C++ object files must be created using
69536427 # "CC -Bstatic", where "CC" is the KAI C++ compiler.
69616435 # earlier do not add the objects themselves.
69626436 case `$CC -V 2>&1` in
69636437 *"Version 7."*)
6964 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6965 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6438 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6439 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
69666440 ;;
69676441 *) # Version 8.0 or newer
69686442 tmp_idyn=
69696443 case $host_cpu in
69706444 ia64*) tmp_idyn=' -i_dynamic';;
69716445 esac
6972 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6973 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6446 _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6447 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
69746448 ;;
69756449 esac
69766450 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6977 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6978 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6979 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6451 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6452 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6453 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
69806454 ;;
69816455 pgCC* | pgcpp*)
69826456 # Portland Group C++ compiler
69836457 case `$CC -V` in
69846458 *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
69856459 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6986 rm -rf $tpldir~
6987 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6988 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6460 rm -rf $tpldir~
6461 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6462 compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
69896463 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6990 rm -rf $tpldir~
6991 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6992 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6993 $RANLIB $oldlib'
6464 rm -rf $tpldir~
6465 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6466 $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6467 $RANLIB $oldlib'
69946468 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6995 rm -rf $tpldir~
6996 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6997 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6469 rm -rf $tpldir~
6470 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6471 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
69986472 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6999 rm -rf $tpldir~
7000 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7001 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6473 rm -rf $tpldir~
6474 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6475 $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
70026476 ;;
70036477 *) # Version 6 and above use weak symbols
7004 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7005 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6478 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6479 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
70066480 ;;
70076481 esac
70086482
7009 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7010 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7011 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
6483 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6484 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6485 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
70126486 ;;
70136487 cxx*)
70146488 # Compaq C++
7015 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7016 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
6489 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6490 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
70176491
70186492 runpath_var=LD_RUN_PATH
70196493 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
70276501 # explicitly linking system object files so we need to strip them
70286502 # from the output so that they don't get included in the library
70296503 # dependencies.
7030 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
6504 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
70316505 ;;
70326506 xl* | mpixl* | bgxl*)
70336507 # IBM XL 8.0 on PPC, with GNU ld
7034 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7035 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7036 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7037 if test yes = "$supports_anon_versioning"; then
6508 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6509 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6510 _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6511 if test "x$supports_anon_versioning" = xyes; then
70386512 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7039 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7040 echo "local: *; };" >> $output_objdir/$libname.ver~
7041 $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
6513 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6514 echo "local: *; };" >> $output_objdir/$libname.ver~
6515 $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
70426516 fi
70436517 ;;
70446518 *)
70466520 *Sun\ C*)
70476521 # Sun C++ 5.9
70486522 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7049 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7050 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
6523 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6524 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
70516525 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7052 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
6526 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
70536527 _LT_TAGVAR(compiler_needs_object, $1)=yes
70546528
70556529 # Not sure whether something based on
71076581 _LT_TAGVAR(ld_shlibs, $1)=yes
71086582 ;;
71096583
7110 openbsd* | bitrig*)
6584 openbsd2*)
6585 # C++ shared libraries are fairly broken
6586 _LT_TAGVAR(ld_shlibs, $1)=no
6587 ;;
6588
6589 openbsd*)
71116590 if test -f /usr/libexec/ld.so; then
71126591 _LT_TAGVAR(hardcode_direct, $1)=yes
71136592 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71146593 _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71156594 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7116 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7117 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7118 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
7119 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7120 _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6595 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6596 if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6597 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
6598 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6599 _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
71216600 fi
71226601 output_verbose_link_cmd=func_echo_all
71236602 else
71336612 # KCC will only create a shared library if the output file
71346613 # ends with ".so" (or ".sl" for HP-UX), so rename the library
71356614 # to its proper name (with version) after linking.
7136 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7137
7138 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6615 _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6616
6617 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
71396618 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71406619
71416620 # Archives containing C++ object files must be created using
71536632 cxx*)
71546633 case $host in
71556634 osf3*)
7156 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7157 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7158 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6635 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6636 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6637 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
71596638 ;;
71606639 *)
71616640 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7162 _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
6641 _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
71636642 _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7164 echo "-hidden">> $lib.exp~
7165 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
7166 $RM $lib.exp'
6643 echo "-hidden">> $lib.exp~
6644 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
6645 $RM $lib.exp'
71676646 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
71686647 ;;
71696648 esac
71786657 # explicitly linking system object files so we need to strip them
71796658 # from the output so that they don't get included in the library
71806659 # dependencies.
7181 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6660 output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
71826661 ;;
71836662 *)
7184 if test yes,no = "$GXX,$with_gnu_ld"; then
7185 _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
6663 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6664 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
71866665 case $host in
71876666 osf3*)
7188 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6667 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
71896668 ;;
71906669 *)
7191 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6670 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
71926671 ;;
71936672 esac
71946673
7195 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6674 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
71966675 _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71976676
71986677 # Commands to make compiler produce verbose output that lists
72386717 # Sun C++ 4.2, 5.x and Centerline C++
72396718 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
72406719 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7241 _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6720 _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
72426721 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7243 $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6722 $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
72446723
72456724 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
72466725 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
72486727 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
72496728 *)
72506729 # The compiler driver will combine and reorder linker options,
7251 # but understands '-z linker_flag'.
6730 # but understands `-z linker_flag'.
72526731 # Supported since Solaris 2.6 (maybe 2.5.1?)
72536732 _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
72546733 ;;
72656744 ;;
72666745 gcx*)
72676746 # Green Hills C++ Compiler
7268 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
6747 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
72696748
72706749 # The C++ compiler must be used to create the archive.
72716750 _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
72726751 ;;
72736752 *)
72746753 # GNU C++ compiler with Solaris linker
7275 if test yes,no = "$GXX,$with_gnu_ld"; then
7276 _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
6754 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6755 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
72776756 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7278 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
6757 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
72796758 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7280 $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6759 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
72816760
72826761 # Commands to make compiler produce verbose output that lists
72836762 # what "hidden" libraries, object files and flags are used when
72846763 # linking a shared library.
72856764 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72866765 else
7287 # g++ 2.7 appears to require '-G' NOT '-shared' on this
6766 # g++ 2.7 appears to require `-G' NOT `-shared' on this
72886767 # platform.
7289 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
6768 _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
72906769 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7291 $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6770 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
72926771
72936772 # Commands to make compiler produce verbose output that lists
72946773 # what "hidden" libraries, object files and flags are used when
72966775 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72976776 fi
72986777
7299 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
6778 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
73006779 case $host_os in
73016780 solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
73026781 *)
7303 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
6782 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
73046783 ;;
73056784 esac
73066785 fi
73096788 ;;
73106789
73116790 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7312 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6791 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
73136792 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73146793 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
73156794 runpath_var='LD_RUN_PATH'
73166795
73176796 case $cc_basename in
73186797 CC*)
7319 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7320 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6798 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6799 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73216800 ;;
73226801 *)
7323 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7324 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6802 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6803 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73256804 ;;
73266805 esac
73276806 ;;
73286807
73296808 sysv5* | sco3.2v5* | sco5v6*)
7330 # Note: We CANNOT use -z defs as we might desire, because we do not
6809 # Note: We can NOT use -z defs as we might desire, because we do not
73316810 # link with -lc, and that would cause any symbols used from libc to
73326811 # always be unresolved, which means just about no library would
73336812 # ever link correctly. If we're not using GNU ld we use -z text
73346813 # though, which does catch some bad symbols but isn't as heavy-handed
73356814 # as -z defs.
7336 _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7337 _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6815 _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6816 _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
73386817 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
73396818 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7340 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6819 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
73416820 _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
73426821 _LT_TAGVAR(link_all_deplibs, $1)=yes
7343 _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6822 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
73446823 runpath_var='LD_RUN_PATH'
73456824
73466825 case $cc_basename in
73476826 CC*)
7348 _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7349 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6827 _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6828 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73506829 _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7351 '"$_LT_TAGVAR(old_archive_cmds, $1)"
6830 '"$_LT_TAGVAR(old_archive_cmds, $1)"
73526831 _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7353 '"$_LT_TAGVAR(reload_cmds, $1)"
6832 '"$_LT_TAGVAR(reload_cmds, $1)"
73546833 ;;
73556834 *)
7356 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7357 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6835 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6836 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73586837 ;;
73596838 esac
73606839 ;;
73856864 esac
73866865
73876866 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7388 test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7389
7390 _LT_TAGVAR(GCC, $1)=$GXX
7391 _LT_TAGVAR(LD, $1)=$LD
6867 test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6868
6869 _LT_TAGVAR(GCC, $1)="$GXX"
6870 _LT_TAGVAR(LD, $1)="$LD"
73926871
73936872 ## CAVEAT EMPTOR:
73946873 ## There is no encapsulation within the following macros, do not change
74156894 lt_cv_path_LD=$lt_save_path_LD
74166895 lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
74176896 lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7418 fi # test yes != "$_lt_caught_CXX_error"
6897 fi # test "$_lt_caught_CXX_error" != yes
74196898
74206899 AC_LANG_POP
74216900 ])# _LT_LANG_CXX_CONFIG
74376916 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
74386917 func_stripname_cnf ()
74396918 {
7440 case @S|@2 in
7441 .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7442 *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
6919 case ${2} in
6920 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6921 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
74436922 esac
74446923 } # func_stripname_cnf
74456924 ])# _LT_FUNC_STRIPNAME_CNF
7446
74476925
74486926 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
74496927 # ---------------------------------
75287006 pre_test_object_deps_done=no
75297007
75307008 for p in `eval "$output_verbose_link_cmd"`; do
7531 case $prev$p in
7009 case ${prev}${p} in
75327010
75337011 -L* | -R* | -l*)
75347012 # Some compilers place space between "-{L,R}" and the path.
75357013 # Remove the space.
7536 if test x-L = "$p" ||
7537 test x-R = "$p"; then
7014 if test $p = "-L" ||
7015 test $p = "-R"; then
75387016 prev=$p
75397017 continue
75407018 fi
75507028 case $p in
75517029 =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
75527030 esac
7553 if test no = "$pre_test_object_deps_done"; then
7554 case $prev in
7031 if test "$pre_test_object_deps_done" = no; then
7032 case ${prev} in
75557033 -L | -R)
75567034 # Internal compiler library paths should come after those
75577035 # provided the user. The postdeps already come after the
75587036 # user supplied libs so there is no need to process them.
75597037 if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7560 _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7038 _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
75617039 else
7562 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7040 _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
75637041 fi
75647042 ;;
75657043 # The "-l" case would never come before the object being
75677045 esac
75687046 else
75697047 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7570 _LT_TAGVAR(postdeps, $1)=$prev$p
7048 _LT_TAGVAR(postdeps, $1)="${prev}${p}"
75717049 else
7572 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7050 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
75737051 fi
75747052 fi
75757053 prev=
75847062 continue
75857063 fi
75867064
7587 if test no = "$pre_test_object_deps_done"; then
7065 if test "$pre_test_object_deps_done" = no; then
75887066 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7589 _LT_TAGVAR(predep_objects, $1)=$p
7067 _LT_TAGVAR(predep_objects, $1)="$p"
75907068 else
75917069 _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
75927070 fi
75937071 else
75947072 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7595 _LT_TAGVAR(postdep_objects, $1)=$p
7073 _LT_TAGVAR(postdep_objects, $1)="$p"
75967074 else
75977075 _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
75987076 fi
76237101 _LT_TAGVAR(postdep_objects,$1)=
76247102 _LT_TAGVAR(postdeps,$1)=
76257103 ;;
7104
7105 linux*)
7106 case `$CC -V 2>&1 | sed 5q` in
7107 *Sun\ C*)
7108 # Sun C++ 5.9
7109
7110 # The more standards-conforming stlport4 library is
7111 # incompatible with the Cstd library. Avoid specifying
7112 # it if it's in CXXFLAGS. Ignore libCrun as
7113 # -library=stlport4 depends on it.
7114 case " $CXX $CXXFLAGS " in
7115 *" -library=stlport4 "*)
7116 solaris_use_stlport4=yes
7117 ;;
7118 esac
7119
7120 if test "$solaris_use_stlport4" != yes; then
7121 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7122 fi
7123 ;;
7124 esac
7125 ;;
7126
7127 solaris*)
7128 case $cc_basename in
7129 CC* | sunCC*)
7130 # The more standards-conforming stlport4 library is
7131 # incompatible with the Cstd library. Avoid specifying
7132 # it if it's in CXXFLAGS. Ignore libCrun as
7133 # -library=stlport4 depends on it.
7134 case " $CXX $CXXFLAGS " in
7135 *" -library=stlport4 "*)
7136 solaris_use_stlport4=yes
7137 ;;
7138 esac
7139
7140 # Adding this requires a known-good setup of shared libraries for
7141 # Sun compiler versions before 5.6, else PIC objects from an old
7142 # archive will be linked into the output, leading to subtle bugs.
7143 if test "$solaris_use_stlport4" != yes; then
7144 _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7145 fi
7146 ;;
7147 esac
7148 ;;
76267149 esac
76277150 ])
76287151
76317154 esac
76327155 _LT_TAGVAR(compiler_lib_search_dirs, $1)=
76337156 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7634 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7157 _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
76357158 fi
76367159 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
76377160 [The directories searched by this compiler when creating a shared library])
76517174 # --------------------------
76527175 # Ensure that the configuration variables for a Fortran 77 compiler are
76537176 # suitably defined. These variables are subsequently used by _LT_CONFIG
7654 # to write the compiler configuration to 'libtool'.
7177 # to write the compiler configuration to `libtool'.
76557178 m4_defun([_LT_LANG_F77_CONFIG],
76567179 [AC_LANG_PUSH(Fortran 77)
7657 if test -z "$F77" || test no = "$F77"; then
7180 if test -z "$F77" || test "X$F77" = "Xno"; then
76587181 _lt_disable_F77=yes
76597182 fi
76607183
76917214 # the F77 compiler isn't working. Some variables (like enable_shared)
76927215 # are currently assumed to apply to all compilers on this platform,
76937216 # and will be corrupted by setting them based on a non-working compiler.
7694 if test yes != "$_lt_disable_F77"; then
7217 if test "$_lt_disable_F77" != yes; then
76957218 # Code to be used in simple compile tests
76967219 lt_simple_compile_test_code="\
76977220 subroutine t
77137236 _LT_LINKER_BOILERPLATE
77147237
77157238 # Allow CC to be a program name with arguments.
7716 lt_save_CC=$CC
7239 lt_save_CC="$CC"
77177240 lt_save_GCC=$GCC
77187241 lt_save_CFLAGS=$CFLAGS
77197242 CC=${F77-"f77"}
77277250 AC_MSG_RESULT([$can_build_shared])
77287251
77297252 AC_MSG_CHECKING([whether to build shared libraries])
7730 test no = "$can_build_shared" && enable_shared=no
7253 test "$can_build_shared" = "no" && enable_shared=no
77317254
77327255 # On AIX, shared libraries and static libraries use the same namespace, and
77337256 # are all built from PIC.
77347257 case $host_os in
77357258 aix3*)
7736 test yes = "$enable_shared" && enable_static=no
7259 test "$enable_shared" = yes && enable_static=no
77377260 if test -n "$RANLIB"; then
77387261 archive_cmds="$archive_cmds~\$RANLIB \$lib"
77397262 postinstall_cmds='$RANLIB $lib'
77407263 fi
77417264 ;;
77427265 aix[[4-9]]*)
7743 if test ia64 != "$host_cpu"; then
7744 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7745 yes,aix,yes) ;; # shared object as lib.so file only
7746 yes,svr4,*) ;; # shared object as lib.so archive member only
7747 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7748 esac
7266 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7267 test "$enable_shared" = yes && enable_static=no
77497268 fi
77507269 ;;
77517270 esac
77537272
77547273 AC_MSG_CHECKING([whether to build static libraries])
77557274 # Make sure either enable_shared or enable_static is yes.
7756 test yes = "$enable_shared" || enable_static=yes
7275 test "$enable_shared" = yes || enable_static=yes
77577276 AC_MSG_RESULT([$enable_static])
77587277
7759 _LT_TAGVAR(GCC, $1)=$G77
7760 _LT_TAGVAR(LD, $1)=$LD
7278 _LT_TAGVAR(GCC, $1)="$G77"
7279 _LT_TAGVAR(LD, $1)="$LD"
77617280
77627281 ## CAVEAT EMPTOR:
77637282 ## There is no encapsulation within the following macros, do not change
77747293 fi # test -n "$compiler"
77757294
77767295 GCC=$lt_save_GCC
7777 CC=$lt_save_CC
7778 CFLAGS=$lt_save_CFLAGS
7779 fi # test yes != "$_lt_disable_F77"
7296 CC="$lt_save_CC"
7297 CFLAGS="$lt_save_CFLAGS"
7298 fi # test "$_lt_disable_F77" != yes
77807299
77817300 AC_LANG_POP
77827301 ])# _LT_LANG_F77_CONFIG
77867305 # -------------------------
77877306 # Ensure that the configuration variables for a Fortran compiler are
77887307 # suitably defined. These variables are subsequently used by _LT_CONFIG
7789 # to write the compiler configuration to 'libtool'.
7308 # to write the compiler configuration to `libtool'.
77907309 m4_defun([_LT_LANG_FC_CONFIG],
77917310 [AC_LANG_PUSH(Fortran)
77927311
7793 if test -z "$FC" || test no = "$FC"; then
7312 if test -z "$FC" || test "X$FC" = "Xno"; then
77947313 _lt_disable_FC=yes
77957314 fi
77967315
78277346 # the FC compiler isn't working. Some variables (like enable_shared)
78287347 # are currently assumed to apply to all compilers on this platform,
78297348 # and will be corrupted by setting them based on a non-working compiler.
7830 if test yes != "$_lt_disable_FC"; then
7349 if test "$_lt_disable_FC" != yes; then
78317350 # Code to be used in simple compile tests
78327351 lt_simple_compile_test_code="\
78337352 subroutine t
78497368 _LT_LINKER_BOILERPLATE
78507369
78517370 # Allow CC to be a program name with arguments.
7852 lt_save_CC=$CC
7371 lt_save_CC="$CC"
78537372 lt_save_GCC=$GCC
78547373 lt_save_CFLAGS=$CFLAGS
78557374 CC=${FC-"f95"}
78657384 AC_MSG_RESULT([$can_build_shared])
78667385
78677386 AC_MSG_CHECKING([whether to build shared libraries])
7868 test no = "$can_build_shared" && enable_shared=no
7387 test "$can_build_shared" = "no" && enable_shared=no
78697388
78707389 # On AIX, shared libraries and static libraries use the same namespace, and
78717390 # are all built from PIC.
78727391 case $host_os in
78737392 aix3*)
7874 test yes = "$enable_shared" && enable_static=no
7393 test "$enable_shared" = yes && enable_static=no
78757394 if test -n "$RANLIB"; then
78767395 archive_cmds="$archive_cmds~\$RANLIB \$lib"
78777396 postinstall_cmds='$RANLIB $lib'
78787397 fi
78797398 ;;
78807399 aix[[4-9]]*)
7881 if test ia64 != "$host_cpu"; then
7882 case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7883 yes,aix,yes) ;; # shared object as lib.so file only
7884 yes,svr4,*) ;; # shared object as lib.so archive member only
7885 yes,*) enable_static=no ;; # shared object in lib.a archive as well
7886 esac
7400 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7401 test "$enable_shared" = yes && enable_static=no
78877402 fi
78887403 ;;
78897404 esac
78917406
78927407 AC_MSG_CHECKING([whether to build static libraries])
78937408 # Make sure either enable_shared or enable_static is yes.
7894 test yes = "$enable_shared" || enable_static=yes
7409 test "$enable_shared" = yes || enable_static=yes
78957410 AC_MSG_RESULT([$enable_static])
78967411
7897 _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7898 _LT_TAGVAR(LD, $1)=$LD
7412 _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7413 _LT_TAGVAR(LD, $1)="$LD"
78997414
79007415 ## CAVEAT EMPTOR:
79017416 ## There is no encapsulation within the following macros, do not change
79157430 GCC=$lt_save_GCC
79167431 CC=$lt_save_CC
79177432 CFLAGS=$lt_save_CFLAGS
7918 fi # test yes != "$_lt_disable_FC"
7433 fi # test "$_lt_disable_FC" != yes
79197434
79207435 AC_LANG_POP
79217436 ])# _LT_LANG_FC_CONFIG
79257440 # --------------------------
79267441 # Ensure that the configuration variables for the GNU Java Compiler compiler
79277442 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7928 # to write the compiler configuration to 'libtool'.
7443 # to write the compiler configuration to `libtool'.
79297444 m4_defun([_LT_LANG_GCJ_CONFIG],
79307445 [AC_REQUIRE([LT_PROG_GCJ])dnl
79317446 AC_LANG_SAVE
79597474 CFLAGS=$GCJFLAGS
79607475 compiler=$CC
79617476 _LT_TAGVAR(compiler, $1)=$CC
7962 _LT_TAGVAR(LD, $1)=$LD
7477 _LT_TAGVAR(LD, $1)="$LD"
79637478 _LT_CC_BASENAME([$compiler])
79647479
79657480 # GCJ did not exist at the time GCC didn't implicitly link libc in.
79967511 # --------------------------
79977512 # Ensure that the configuration variables for the GNU Go compiler
79987513 # are suitably defined. These variables are subsequently used by _LT_CONFIG
7999 # to write the compiler configuration to 'libtool'.
7514 # to write the compiler configuration to `libtool'.
80007515 m4_defun([_LT_LANG_GO_CONFIG],
80017516 [AC_REQUIRE([LT_PROG_GO])dnl
80027517 AC_LANG_SAVE
80307545 CFLAGS=$GOFLAGS
80317546 compiler=$CC
80327547 _LT_TAGVAR(compiler, $1)=$CC
8033 _LT_TAGVAR(LD, $1)=$LD
7548 _LT_TAGVAR(LD, $1)="$LD"
80347549 _LT_CC_BASENAME([$compiler])
80357550
80367551 # Go did not exist at the time GCC didn't implicitly link libc in.
80677582 # -------------------------
80687583 # Ensure that the configuration variables for the Windows resource compiler
80697584 # are suitably defined. These variables are subsequently used by _LT_CONFIG
8070 # to write the compiler configuration to 'libtool'.
7585 # to write the compiler configuration to `libtool'.
80717586 m4_defun([_LT_LANG_RC_CONFIG],
80727587 [AC_REQUIRE([LT_PROG_RC])dnl
80737588 AC_LANG_SAVE
80837598 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
80847599
80857600 # Code to be used in simple link tests
8086 lt_simple_link_test_code=$lt_simple_compile_test_code
7601 lt_simple_link_test_code="$lt_simple_compile_test_code"
80877602
80887603 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
80897604 _LT_TAG_COMPILER
80937608 _LT_LINKER_BOILERPLATE
80947609
80957610 # Allow CC to be a program name with arguments.
8096 lt_save_CC=$CC
7611 lt_save_CC="$CC"
80977612 lt_save_CFLAGS=$CFLAGS
80987613 lt_save_GCC=$GCC
80997614 GCC=
81227637 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
81237638 [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
81247639 [AC_CHECK_TOOL(GCJ, gcj,)
8125 test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
7640 test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
81267641 AC_SUBST(GCJFLAGS)])])[]dnl
81277642 ])
81287643
82337748 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
82347749 # along with /bin/sed that truncates output.
82357750 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8236 test ! -f "$lt_ac_sed" && continue
7751 test ! -f $lt_ac_sed && continue
82377752 cat /dev/null > conftest.in
82387753 lt_ac_count=0
82397754 echo $ECHO_N "0123456789$ECHO_C" >conftest.in
82507765 $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
82517766 cmp -s conftest.out conftest.nl || break
82527767 # 10000 chars as input seems more than enough
8253 test 10 -lt "$lt_ac_count" && break
7768 test $lt_ac_count -gt 10 && break
82547769 lt_ac_count=`expr $lt_ac_count + 1`
8255 if test "$lt_ac_count" -gt "$lt_ac_max"; then
7770 if test $lt_ac_count -gt $lt_ac_max; then
82567771 lt_ac_max=$lt_ac_count
82577772 lt_cv_path_SED=$lt_ac_sed
82587773 fi
82767791 # Find out whether the shell is Bourne or XSI compatible,
82777792 # or has some other useful features.
82787793 m4_defun([_LT_CHECK_SHELL_FEATURES],
8279 [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7794 [AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7795 # Try some XSI features
7796 xsi_shell=no
7797 ( _lt_dummy="a/b/c"
7798 test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7799 = c,a/b,b/c, \
7800 && eval 'test $(( 1 + 1 )) -eq 2 \
7801 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7802 && xsi_shell=yes
7803 AC_MSG_RESULT([$xsi_shell])
7804 _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7805
7806 AC_MSG_CHECKING([whether the shell understands "+="])
7807 lt_shell_append=no
7808 ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7809 >/dev/null 2>&1 \
7810 && lt_shell_append=yes
7811 AC_MSG_RESULT([$lt_shell_append])
7812 _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7813
7814 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82807815 lt_unset=unset
82817816 else
82827817 lt_unset=false
83007835 ])# _LT_CHECK_SHELL_FEATURES
83017836
83027837
7838 # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7839 # ------------------------------------------------------
7840 # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7841 # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7842 m4_defun([_LT_PROG_FUNCTION_REPLACE],
7843 [dnl {
7844 sed -e '/^$1 ()$/,/^} # $1 /c\
7845 $1 ()\
7846 {\
7847 m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
7848 } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7849 && mv -f "$cfgfile.tmp" "$cfgfile" \
7850 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7851 test 0 -eq $? || _lt_function_replace_fail=:
7852 ])
7853
7854
7855 # _LT_PROG_REPLACE_SHELLFNS
7856 # -------------------------
7857 # Replace existing portable implementations of several shell functions with
7858 # equivalent extended shell implementations where those features are available..
7859 m4_defun([_LT_PROG_REPLACE_SHELLFNS],
7860 [if test x"$xsi_shell" = xyes; then
7861 _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7862 case ${1} in
7863 */*) func_dirname_result="${1%/*}${2}" ;;
7864 * ) func_dirname_result="${3}" ;;
7865 esac])
7866
7867 _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7868 func_basename_result="${1##*/}"])
7869
7870 _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7871 case ${1} in
7872 */*) func_dirname_result="${1%/*}${2}" ;;
7873 * ) func_dirname_result="${3}" ;;
7874 esac
7875 func_basename_result="${1##*/}"])
7876
7877 _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7878 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7879 # positional parameters, so assign one to ordinary parameter first.
7880 func_stripname_result=${3}
7881 func_stripname_result=${func_stripname_result#"${1}"}
7882 func_stripname_result=${func_stripname_result%"${2}"}])
7883
7884 _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7885 func_split_long_opt_name=${1%%=*}
7886 func_split_long_opt_arg=${1#*=}])
7887
7888 _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7889 func_split_short_opt_arg=${1#??}
7890 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7891
7892 _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7893 case ${1} in
7894 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7895 *) func_lo2o_result=${1} ;;
7896 esac])
7897
7898 _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
7899
7900 _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
7901
7902 _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
7903 fi
7904
7905 if test x"$lt_shell_append" = xyes; then
7906 _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
7907
7908 _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7909 func_quote_for_eval "${2}"
7910 dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7911 eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7912
7913 # Save a `func_append' function call where possible by direct use of '+='
7914 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7915 && mv -f "$cfgfile.tmp" "$cfgfile" \
7916 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7917 test 0 -eq $? || _lt_function_replace_fail=:
7918 else
7919 # Save a `func_append' function call even when '+=' is not available
7920 sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7921 && mv -f "$cfgfile.tmp" "$cfgfile" \
7922 || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7923 test 0 -eq $? || _lt_function_replace_fail=:
7924 fi
7925
7926 if test x"$_lt_function_replace_fail" = x":"; then
7927 AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7928 fi
7929 ])
7930
83037931 # _LT_PATH_CONVERSION_FUNCTIONS
83047932 # -----------------------------
8305 # Determine what file name conversion functions should be used by
7933 # Determine which file name conversion functions should be used by
83067934 # func_to_host_file (and, implicitly, by func_to_host_path). These are needed
83077935 # for certain cross-compile configurations and native mingw.
83087936 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
00 # Helper functions for option handling. -*- Autoconf -*-
11 #
2 # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
3 # Foundation, Inc.
2 # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
3 # Inc.
44 # Written by Gary V. Vaughan, 2004
55 #
66 # This file is free software; the Free Software Foundation gives
77 # unlimited permission to copy and/or distribute it, with or without
88 # modifications, as long as this notice is preserved.
99
10 # serial 8 ltoptions.m4
10 # serial 7 ltoptions.m4
1111
1212 # This is to help aclocal find these macros, as it can't see m4_define.
1313 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
2828 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
2929 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
3030 _LT_MANGLE_DEFUN([$1], [$2]),
31 [m4_warning([Unknown $1 option '$2'])])[]dnl
31 [m4_warning([Unknown $1 option `$2'])])[]dnl
3232 ])
3333
3434
7474 dnl
7575 dnl If no reference was made to various pairs of opposing options, then
7676 dnl we run the default mode handler for the pair. For example, if neither
77 dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
77 dnl `shared' nor `disable-shared' was passed, we enable building of shared
7878 dnl archives by default:
7979 _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8080 _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8181 _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8282 _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
83 [_LT_ENABLE_FAST_INSTALL])
84 _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
85 [_LT_WITH_AIX_SONAME([aix])])
83 [_LT_ENABLE_FAST_INSTALL])
8684 ])
8785 ])# _LT_SET_OPTIONS
8886
113111 [_LT_SET_OPTION([LT_INIT], [dlopen])
114112 AC_DIAGNOSE([obsolete],
115113 [$0: Remove this warning and the call to _LT_SET_OPTION when you
116 put the 'dlopen' option into LT_INIT's first parameter.])
114 put the `dlopen' option into LT_INIT's first parameter.])
117115 ])
118116
119117 dnl aclocal-1.4 backwards compatibility:
149147 _LT_SET_OPTION([LT_INIT], [win32-dll])
150148 AC_DIAGNOSE([obsolete],
151149 [$0: Remove this warning and the call to _LT_SET_OPTION when you
152 put the 'win32-dll' option into LT_INIT's first parameter.])
150 put the `win32-dll' option into LT_INIT's first parameter.])
153151 ])
154152
155153 dnl aclocal-1.4 backwards compatibility:
158156
159157 # _LT_ENABLE_SHARED([DEFAULT])
160158 # ----------------------------
161 # implement the --enable-shared flag, and supports the 'shared' and
162 # 'disable-shared' LT_INIT options.
163 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
159 # implement the --enable-shared flag, and supports the `shared' and
160 # `disable-shared' LT_INIT options.
161 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
164162 m4_define([_LT_ENABLE_SHARED],
165163 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
166164 AC_ARG_ENABLE([shared],
173171 *)
174172 enable_shared=no
175173 # Look at the argument we got. We use all the common list separators.
176 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
174 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
177175 for pkg in $enableval; do
178 IFS=$lt_save_ifs
176 IFS="$lt_save_ifs"
179177 if test "X$pkg" = "X$p"; then
180178 enable_shared=yes
181179 fi
182180 done
183 IFS=$lt_save_ifs
181 IFS="$lt_save_ifs"
184182 ;;
185183 esac],
186184 [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
212210
213211 # _LT_ENABLE_STATIC([DEFAULT])
214212 # ----------------------------
215 # implement the --enable-static flag, and support the 'static' and
216 # 'disable-static' LT_INIT options.
217 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
213 # implement the --enable-static flag, and support the `static' and
214 # `disable-static' LT_INIT options.
215 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
218216 m4_define([_LT_ENABLE_STATIC],
219217 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
220218 AC_ARG_ENABLE([static],
227225 *)
228226 enable_static=no
229227 # Look at the argument we got. We use all the common list separators.
230 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
228 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
231229 for pkg in $enableval; do
232 IFS=$lt_save_ifs
230 IFS="$lt_save_ifs"
233231 if test "X$pkg" = "X$p"; then
234232 enable_static=yes
235233 fi
236234 done
237 IFS=$lt_save_ifs
235 IFS="$lt_save_ifs"
238236 ;;
239237 esac],
240238 [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
266264
267265 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
268266 # ----------------------------------
269 # implement the --enable-fast-install flag, and support the 'fast-install'
270 # and 'disable-fast-install' LT_INIT options.
271 # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
267 # implement the --enable-fast-install flag, and support the `fast-install'
268 # and `disable-fast-install' LT_INIT options.
269 # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
272270 m4_define([_LT_ENABLE_FAST_INSTALL],
273271 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
274272 AC_ARG_ENABLE([fast-install],
281279 *)
282280 enable_fast_install=no
283281 # Look at the argument we got. We use all the common list separators.
284 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
282 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
285283 for pkg in $enableval; do
286 IFS=$lt_save_ifs
284 IFS="$lt_save_ifs"
287285 if test "X$pkg" = "X$p"; then
288286 enable_fast_install=yes
289287 fi
290288 done
291 IFS=$lt_save_ifs
289 IFS="$lt_save_ifs"
292290 ;;
293291 esac],
294292 [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
305303 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
306304 AC_DIAGNOSE([obsolete],
307305 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
308 the 'fast-install' option into LT_INIT's first parameter.])
306 the `fast-install' option into LT_INIT's first parameter.])
309307 ])
310308
311309 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
312310 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
313311 AC_DIAGNOSE([obsolete],
314312 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
315 the 'disable-fast-install' option into LT_INIT's first parameter.])
313 the `disable-fast-install' option into LT_INIT's first parameter.])
316314 ])
317315
318316 dnl aclocal-1.4 backwards compatibility:
320318 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
321319
322320
323 # _LT_WITH_AIX_SONAME([DEFAULT])
324 # ----------------------------------
325 # implement the --with-aix-soname flag, and support the `aix-soname=aix'
326 # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
327 # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
328 m4_define([_LT_WITH_AIX_SONAME],
329 [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
330 shared_archive_member_spec=
331 case $host,$enable_shared in
332 power*-*-aix[[5-9]]*,yes)
333 AC_MSG_CHECKING([which variant of shared library versioning to provide])
334 AC_ARG_WITH([aix-soname],
335 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
336 [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
337 [case $withval in
338 aix|svr4|both)
339 ;;
340 *)
341 AC_MSG_ERROR([Unknown argument to --with-aix-soname])
342 ;;
343 esac
344 lt_cv_with_aix_soname=$with_aix_soname],
345 [AC_CACHE_VAL([lt_cv_with_aix_soname],
346 [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
347 with_aix_soname=$lt_cv_with_aix_soname])
348 AC_MSG_RESULT([$with_aix_soname])
349 if test aix != "$with_aix_soname"; then
350 # For the AIX way of multilib, we name the shared archive member
351 # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
352 # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
353 # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
354 # the AIX toolchain works better with OBJECT_MODE set (default 32).
355 if test 64 = "${OBJECT_MODE-32}"; then
356 shared_archive_member_spec=shr_64
357 else
358 shared_archive_member_spec=shr
359 fi
360 fi
361 ;;
362 *)
363 with_aix_soname=aix
364 ;;
365 esac
366
367 _LT_DECL([], [shared_archive_member_spec], [0],
368 [Shared archive member basename, for filename based shared library versioning on AIX])dnl
369 ])# _LT_WITH_AIX_SONAME
370
371 LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
372 LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
373 LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
374
375
376321 # _LT_WITH_PIC([MODE])
377322 # --------------------
378 # implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
323 # implement the --with-pic flag, and support the `pic-only' and `no-pic'
379324 # LT_INIT options.
380 # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
325 # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
381326 m4_define([_LT_WITH_PIC],
382327 [AC_ARG_WITH([pic],
383328 [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
388333 *)
389334 pic_mode=default
390335 # Look at the argument we got. We use all the common list separators.
391 lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
336 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
392337 for lt_pkg in $withval; do
393 IFS=$lt_save_ifs
338 IFS="$lt_save_ifs"
394339 if test "X$lt_pkg" = "X$lt_p"; then
395340 pic_mode=yes
396341 fi
397342 done
398 IFS=$lt_save_ifs
343 IFS="$lt_save_ifs"
399344 ;;
400345 esac],
401 [pic_mode=m4_default([$1], [default])])
346 [pic_mode=default])
347
348 test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
402349
403350 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
404351 ])# _LT_WITH_PIC
411358 [_LT_SET_OPTION([LT_INIT], [pic-only])
412359 AC_DIAGNOSE([obsolete],
413360 [$0: Remove this warning and the call to _LT_SET_OPTION when you
414 put the 'pic-only' option into LT_INIT's first parameter.])
361 put the `pic-only' option into LT_INIT's first parameter.])
415362 ])
416363
417364 dnl aclocal-1.4 backwards compatibility:
00 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
11 #
2 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
3 # Foundation, Inc.
2 # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
43 # Written by Gary V. Vaughan, 2004
54 #
65 # This file is free software; the Free Software Foundation gives
3332 # ------------
3433 # Manipulate m4 lists.
3534 # These macros are necessary as long as will still need to support
36 # Autoconf-2.59, which quotes differently.
35 # Autoconf-2.59 which quotes differently.
3736 m4_define([lt_car], [[$1]])
3837 m4_define([lt_cdr],
3938 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
4443
4544 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
4645 # ------------------------------------------
47 # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
46 # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
4847 # Note that neither SEPARATOR nor STRING are expanded; they are appended
4948 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
5049 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
00 # ltversion.m4 -- version numbers -*- Autoconf -*-
11 #
2 # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
2 # Copyright (C) 2004 Free Software Foundation, Inc.
33 # Written by Scott James Remnant, 2004
44 #
55 # This file is free software; the Free Software Foundation gives
88
99 # @configure_input@
1010
11 # serial 4179 ltversion.m4
11 # serial 3337 ltversion.m4
1212 # This file is part of GNU Libtool
1313
14 m4_define([LT_PACKAGE_VERSION], [2.4.6])
15 m4_define([LT_PACKAGE_REVISION], [2.4.6])
14 m4_define([LT_PACKAGE_VERSION], [2.4.2])
15 m4_define([LT_PACKAGE_REVISION], [1.3337])
1616
1717 AC_DEFUN([LTVERSION_VERSION],
18 [macro_version='2.4.6'
19 macro_revision='2.4.6'
18 [macro_version='2.4.2'
19 macro_revision='1.3337'
2020 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
2121 _LT_DECL(, macro_revision, 0)
2222 ])
00 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
11 #
2 # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
3 # Foundation, Inc.
2 # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
43 # Written by Scott James Remnant, 2004.
54 #
65 # This file is free software; the Free Software Foundation gives
1110
1211 # These exist entirely to fool aclocal when bootstrapping libtool.
1312 #
14 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
13 # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
1514 # which have later been changed to m4_define as they aren't part of the
1615 # exported API, or moved to Autoconf or Automake where they belong.
1716 #
2524 # included after everything else. This provides aclocal with the
2625 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
2726 # because those macros already exist, or will be overwritten later.
28 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
27 # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
2928 #
3029 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
3130 # Yes, that means every name once taken will need to remain here until
4747 LIBTOOL = ../libtool
4848
4949 CC=@CC@
50 CFLAGS=-I$(srcdir) -I. @CFLAGS@
50 CFLAGS=-I$(srcdir) -I. @CFLAGS@ @CPPFLAGS@
5151 LDFLAGS=@LDFLAGS@ @LIBS@
5252
5353 EXTENSION_LIBEVENT_LIB=@EXTENSION_LIBEVENT_LIB@
6464
6565 GETDNS_OBJ=const-info.lo convert.lo dict.lo dnssec.lo general.lo \
6666 list.lo request-internal.lo rr-dict.lo rr-iter.lo stub.lo sync.lo \
67 util-internal.lo version.lo
67 util-internal.lo
6868
6969 GLDNS_OBJ=keyraw.lo gbuffer.lo wire2str.lo parse.lo parseutil.lo rrdef.lo \
7070 str2wire.lo
143143 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libev.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEV_LDFLAGS) $(EXTENSION_LIBEV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libev.symbols
144144
145145
146 libgetdns.la: $(GETDNS_OBJ) context.lo libmini_event.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ)
147 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(GETDNS_OBJ) context.lo libmini_event.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(LDFLAGS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/libgetdns.symbols
146 libgetdns.la: $(GETDNS_OBJ) version.lo context.lo libmini_event.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ)
147 $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(GETDNS_OBJ) version.lo context.lo libmini_event.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(LDFLAGS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/libgetdns.symbols
148148
149149
150150 test: FORCE
204204 -e 's?extension/?$$(srcdir)/extension/?g' \
205205 -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
206206 -e 's? \$$(srcdir)/config\.h? config.h?g' \
207 -e 's? getdns/getdns_extra\.h? $$(srcdir)/getdns/getdns_extra.h?g' \
207 -e 's? \$$(srcdir)/getdns/getdns_extra\.h? getdns/getdns_extra.h?g' \
208 -e 's? \$$(srcdir)/version\.c? version.c?g' \
208209 -e 's? getdns/getdns_ext_libevent\.h? $$(srcdir)/getdns/getdns_ext_libevent.h?g' \
209210 -e 's? getdns/getdns_ext_libev\.h? $$(srcdir)/getdns/getdns_ext_libev.h?g' \
210211 -e 's? getdns/getdns_ext_libuv\.h? $$(srcdir)/getdns/getdns_ext_libuv.h?g' \
211212 -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
212213 (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
213214 || mv Makefile.in.new Makefile.in )
215 cd test && $(MAKE) $@
214216
215217 .PHONY: clean test
216218 FORCE:
218220 # Dependencies for gldns, utils, the extensions and compat functions
219221 const-info.lo const-info.o: $(srcdir)/const-info.c getdns/getdns.h $(srcdir)/const-info.h
220222 context.lo context.o: $(srcdir)/context.c config.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h \
221 $(srcdir)/gldns/wire2str.h $(srcdir)/context.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
223 $(srcdir)/gldns/wire2str.h $(srcdir)/context.h getdns/getdns.h getdns/getdns_extra.h \
222224 getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h \
223225 config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h \
224226 $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \
225227 $(srcdir)/dnssec.h $(srcdir)/stub.h $(srcdir)/list.h
226 convert.lo convert.o: $(srcdir)/convert.c getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
227 getdns/getdns.h $(srcdir)/util-internal.h config.h $(srcdir)/context.h $(srcdir)/types-internal.h \
228 $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \
229 $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
230 $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h
231 dict.lo dict.o: $(srcdir)/dict.c $(srcdir)/types-internal.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
228 convert.lo convert.o: $(srcdir)/convert.c config.h getdns/getdns.h getdns/getdns_extra.h \
229 getdns/getdns.h $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
230 $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
231 $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \
232 $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h
233 dict.lo dict.o: $(srcdir)/dict.c $(srcdir)/types-internal.h getdns/getdns.h getdns/getdns_extra.h \
232234 getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h config.h $(srcdir)/context.h \
233235 $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
234236 $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \
235237 $(srcdir)/dict.h $(srcdir)/const-info.h $(srcdir)/gldns/wire2str.h
236238 dnssec.lo dnssec.o: $(srcdir)/dnssec.c getdns/getdns.h config.h $(srcdir)/context.h \
237 $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
239 getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
238240 $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
239241 $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
240242 $(srcdir)/gldns/pkthdr.h $(srcdir)/dnssec.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h \
241243 $(srcdir)/gldns/keyraw.h $(srcdir)/gldns/parseutil.h $(srcdir)/general.h $(srcdir)/dict.h $(srcdir)/list.h
242244 general.lo general.o: $(srcdir)/general.c config.h $(srcdir)/gldns/wire2str.h $(srcdir)/context.h getdns/getdns.h \
243 $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
245 getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
244246 $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
245247 $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
246248 $(srcdir)/gldns/pkthdr.h $(srcdir)/dnssec.h $(srcdir)/stub.h
247 list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
249 list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h getdns/getdns.h getdns/getdns_extra.h \
248250 getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h config.h $(srcdir)/context.h \
249251 $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
250252 $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \
251253 $(srcdir)/list.h
252254 request-internal.lo request-internal.o: $(srcdir)/request-internal.c config.h $(srcdir)/types-internal.h \
253 getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \
255 getdns/getdns.h getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \
254256 $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h \
255257 $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
256258 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h \
257259 $(srcdir)/gldns/rrdef.h $(srcdir)/dict.h
258260 rr-dict.lo rr-dict.o: $(srcdir)/rr-dict.c $(srcdir)/rr-dict.h config.h getdns/getdns.h $(srcdir)/gldns/gbuffer.h \
259 $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h \
261 $(srcdir)/util-internal.h $(srcdir)/context.h getdns/getdns_extra.h getdns/getdns.h \
260262 $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h config.h \
261263 $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h \
262264 $(srcdir)/gldns/pkthdr.h $(srcdir)/dict.h
263265 rr-iter.lo rr-iter.o: $(srcdir)/rr-iter.c $(srcdir)/rr-iter.h getdns/getdns.h $(srcdir)/rr-dict.h config.h \
264266 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h
265267 stub.lo stub.o: $(srcdir)/stub.c config.h $(srcdir)/stub.h getdns/getdns.h $(srcdir)/types-internal.h \
266 $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/gldns/gbuffer.h \
268 getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/gldns/gbuffer.h \
267269 $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/rr-iter.h \
268270 $(srcdir)/rr-dict.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \
269271 $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/general.h
270 sync.lo sync.o: $(srcdir)/sync.c getdns/getdns.h config.h $(srcdir)/context.h $(srcdir)/getdns/getdns_extra.h \
272 sync.lo sync.o: $(srcdir)/sync.c getdns/getdns.h config.h $(srcdir)/context.h getdns/getdns_extra.h \
271273 getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h \
272274 config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/general.h \
273275 $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \
274276 $(srcdir)/dnssec.h $(srcdir)/stub.h $(srcdir)/gldns/wire2str.h
275277 util-internal.lo util-internal.o: $(srcdir)/util-internal.c getdns/getdns.h $(srcdir)/dict.h $(srcdir)/util/rbtree.h \
276 $(srcdir)/types-internal.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/list.h \
278 $(srcdir)/types-internal.h getdns/getdns_extra.h getdns/getdns.h $(srcdir)/list.h \
277279 $(srcdir)/util-internal.h config.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h \
278280 $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
279281 $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h
280 version.lo version.o: $(srcdir)/version.c
282 version.lo version.o: version.c
281283 gbuffer.lo gbuffer.o: $(srcdir)/gldns/gbuffer.c config.h $(srcdir)/gldns/gbuffer.h
282284 keyraw.lo keyraw.o: $(srcdir)/gldns/keyraw.c config.h $(srcdir)/gldns/keyraw.h $(srcdir)/gldns/rrdef.h
283285 parse.lo parse.o: $(srcdir)/gldns/parse.c config.h $(srcdir)/gldns/parse.h $(srcdir)/gldns/parseutil.h \
304306 rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \
305307 $(srcdir)/util/rbtree.h
306308 libev.lo libev.o: $(srcdir)/extension/libev.c $(srcdir)/getdns/getdns_ext_libev.h getdns/getdns.h \
307 $(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \
308 $(srcdir)/getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h
309 getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \
310 getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h
309311 libevent.lo libevent.o: $(srcdir)/extension/libevent.c $(srcdir)/getdns/getdns_ext_libevent.h \
310 getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \
311 $(srcdir)/getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h
312 getdns/getdns.h getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \
313 getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h
312314 libmini_event.lo libmini_event.o: $(srcdir)/extension/libmini_event.c $(srcdir)/extension/libmini_event.h \
313315 config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h \
314 getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \
316 getdns/getdns.h getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \
315317 $(srcdir)/context.h config.h $(srcdir)/types-internal.h $(srcdir)/extension/libmini_event.h \
316318 $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h \
317319 $(srcdir)/gldns/pkthdr.h
318320 libuv.lo libuv.o: $(srcdir)/extension/libuv.c config.h $(srcdir)/getdns/getdns_ext_libuv.h \
319 getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/util-internal.h config.h $(srcdir)/context.h \
320 getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
321 getdns/getdns.h getdns/getdns_extra.h $(srcdir)/util-internal.h config.h $(srcdir)/context.h \
322 getdns/getdns.h getdns/getdns_extra.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
321323 $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
322324 $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h
00 /* src/config.h.in. Generated from configure.ac by autoheader. */
1
2 /* Define this to disable recursing resolution type. */
3 #undef DISABLE_RESOLUTION_RECURSING
14
25 /* Define this to enable the experimental draft edns cookies. */
36 #undef EDNS_COOKIES
164167 /* When defined ldns_dnssec_zone contained the hashed_names member. */
165168 #undef LDNS_DNSSEC_ZONE_HASHED_NAMES
166169
167 /* Define to the sub-directory where libtool stores uninstalled libraries. */
170 /* Define to the sub-directory in which libtool stores uninstalled libraries.
171 */
168172 #undef LT_OBJDIR
169173
170174 /* Define to the address where bug reports for this package should be sent. */
372376 #include <bsd/string.h>
373377 #endif
374378
379 #ifdef HAVE_LIBUNBOUND
380 #include <unbound.h>
381 #endif
382
9090 return ((struct const_info *) a)->code - ((struct const_info *) b)->code;
9191 }
9292 struct const_info *
93 priv_getdns_get_const_info(int value)
93 _getdns_get_const_info(int value)
9494 {
9595 struct const_info key = { value, "", "" };
9696 struct const_info *i = bsearch(&key, consts_info,
00 /**
11 *
2 * /brief priv_getdns_consts table with values, names and descriptions of the
2 * /brief _getdns_consts table with values, names and descriptions of the
33 * constants in getdns
44 *
5 * The priv_getdns_get_validation_chain function is called after an answer
5 * The _getdns_get_validation_chain function is called after an answer
66 * has been fetched when the dnssec_return_validation_chain extension is set.
77 * It fetches DNSKEYs, DSes and their signatures for all RRSIGs found in the
88 * answer.
4444 const char *text;
4545 };
4646
47 struct const_info *priv_getdns_get_const_info(int value);
47 struct const_info *_getdns_get_const_info(int value);
4848
4949 #endif
5050
3939 #include <stdlib.h>
4040 #include <sys/stat.h>
4141 #include <sys/time.h>
42 #include <unbound.h>
4342 #include <assert.h>
4443 #include <netdb.h>
4544 #include <ctype.h>
6463 void *plain_mem_funcs_user_arg = MF_PLAIN;
6564
6665 typedef struct host_name_addrs {
67 getdns_rbnode_t node;
66 _getdns_rbnode_t node;
6867 getdns_list *ipv4addrs;
6968 getdns_list *ipv6addrs;
7069 uint8_t host_name[];
9291 };
9392
9493 /* Private functions */
95 getdns_return_t create_default_namespaces(struct getdns_context *context);
96 getdns_return_t create_default_dns_transports(struct getdns_context *context);
94 static getdns_return_t create_default_namespaces(struct getdns_context *context);
95 static getdns_return_t create_default_dns_transports(struct getdns_context *context);
9796 static struct getdns_list *create_default_root_servers(void);
9897 static getdns_return_t set_os_defaults(struct getdns_context *);
9998 static int transaction_id_cmp(const void *, const void *);
102101 static void cancel_outstanding_requests(struct getdns_context*, int);
103102
104103 /* unbound helpers */
104 #ifdef HAVE_LIBUNBOUND
105105 static getdns_return_t rebuild_ub_ctx(struct getdns_context* context);
106106 static void set_ub_string_opt(struct getdns_context *, char *, char *);
107107 static void set_ub_number_opt(struct getdns_context *, char *, uint16_t);
111111 static void set_ub_dnssec_allowed_skew(struct getdns_context*, uint32_t);
112112 static void set_ub_edns_maximum_udp_payload_size(struct getdns_context*,
113113 int);
114 #endif
114115
115116 /* Stuff to make it compile pedantically */
116117 #define RETURN_IF_NULL(ptr, code) if(ptr == NULL) return code;
117118
118 static void destroy_local_host(getdns_rbnode_t * node, void *arg)
119 static void destroy_local_host(_getdns_rbnode_t * node, void *arg)
119120 {
120121 getdns_context *context = (getdns_context *)arg;
121122 host_name_addrs *hnas = (host_name_addrs *)node;
128129 * Helper to get default lookup namespaces.
129130 * TODO: Determine from OS
130131 */
131 getdns_return_t
132 static getdns_return_t
132133 create_default_namespaces(struct getdns_context *context)
133134 {
134135 context->namespaces = GETDNS_XMALLOC(context->my_mf, getdns_namespace_t, 2);
145146 /**
146147 * Helper to get default transports.
147148 */
148 getdns_return_t
149 static getdns_return_t
149150 create_default_dns_transports(struct getdns_context *context)
150151 {
151152 context->dns_transports = GETDNS_XMALLOC(context->my_mf, getdns_transport_list_t, 2);
229230
230231 canonicalize_dname(host_name);
231232
232 if (!(hnas = (host_name_addrs *)getdns_rbtree_search(
233 if (!(hnas = (host_name_addrs *)_getdns_rbtree_search(
233234 &context->local_hosts, host_name))) {
234235
235236 if (!(hnas = (host_name_addrs *)GETDNS_XMALLOC(context->mf,
258259 if (!hnas_found) GETDNS_FREE(context->mf, hnas);
259260 return;
260261 }
261 if (getdns_list_append_dict(*addrs, address) && !hnas_found) {
262 if (_getdns_list_append_dict(*addrs, address) && !hnas_found) {
262263 getdns_list_destroy(*addrs);
263264 GETDNS_FREE(context->mf, hnas);
264265
265266 } else if (!hnas_found)
266 (void)getdns_rbtree_insert(&context->local_hosts, &hnas->node);
267 (void)_getdns_rbtree_insert(&context->local_hosts, &hnas->node);
267268 }
268269
269270 static getdns_dict *
455456 * @returns GETDNS_FCHG_ERRORS if problems (see fchg->errors for details)
456457 */
457458 int
458 filechg_check(struct getdns_context *context, struct filechg *fchg)
459 _getdns_filechg_check(struct getdns_context *context, struct filechg *fchg)
459460 {
460461 struct stat *finfo;
461462
521522 }
522523
523524 void
524 priv_getdns_upstreams_dereference(getdns_upstreams *upstreams)
525 _getdns_upstreams_dereference(getdns_upstreams *upstreams)
525526 {
526527 getdns_upstream *upstream;
527528
552553 }
553554
554555 void
555 priv_getdns_upstream_shutdown(getdns_upstream *upstream)
556 _getdns_upstream_shutdown(getdns_upstream *upstream)
556557 {
557558 /*There is a race condition with a new request being scheduled
558559 while this happens so take ownership of the fd asap*/
618619 upstream->has_server_cookie = 0;
619620
620621 /* Tracking of network requests on this socket */
621 getdns_rbtree_init(&upstream->netreq_by_query_id,
622 _getdns_rbtree_init(&upstream->netreq_by_query_id,
622623 net_req_query_id_cmp);
623624 }
624625
645646 context->fchg_resolvconf->changes = GETDNS_FCHG_NOCHANGES;
646647 context->fchg_resolvconf->errors = GETDNS_FCHG_NOERROR;
647648 }
648 filechg_check(context, context->fchg_resolvconf);
649 _getdns_filechg_check(context, context->fchg_resolvconf);
649650
650651 context->suffix = getdns_list_create_with_context(context);
651652 context->upstreams = upstreams_create(context, upstreams_limit);
819820
820821 result->resolution_type_set = 0;
821822
822 getdns_rbtree_init(&result->outbound_requests, transaction_id_cmp);
823 getdns_rbtree_init(&result->local_hosts, local_host_cmp);
824
823 _getdns_rbtree_init(&result->outbound_requests, transaction_id_cmp);
824 _getdns_rbtree_init(&result->local_hosts, local_host_cmp);
825
826 #ifdef HAVE_LIBUNBOUND
825827 result->resolution_type = GETDNS_RESOLUTION_RECURSING;
828 #else
829 result->resolution_type = GETDNS_RESOLUTION_STUB;
830 #endif
826831 if ((r = create_default_namespaces(result)))
827832 goto error;
828833
865870 result-> tls_ctx = NULL;
866871
867872 result->extension = &result->mini_event.loop;
868 if ((r = getdns_mini_event_init(result, &result->mini_event)))
873 if ((r = _getdns_mini_event_init(result, &result->mini_event)))
869874 goto error;
870875
871876 result->fchg_resolvconf = NULL;
886891 * don't know that till later so we will have to do this every time. */
887892
888893 SSL_library_init();
894 #ifdef HAVE_LIBUNBOUND
889895 result->unbound_ctx = NULL;
890896 if ((r = rebuild_ub_ctx(result)))
891897 goto error;
898 #endif
892899
893900 create_local_hosts(result);
894901
960967 * might be an idle_timeout schedules, which will not get unscheduled
961968 * with cancel_outstanding_requests.
962969 */
963 priv_getdns_upstreams_dereference(context->upstreams);
964
970 _getdns_upstreams_dereference(context->upstreams);
971
972 #ifdef HAVE_LIBUNBOUND
965973 if (context->unbound_ctx)
966974 ub_ctx_delete(context->unbound_ctx);
975 #endif
967976
968977 context->processing = 0;
969978 context->extension->vmt->cleanup(context->extension);
9941003 context->trust_anchors != context->trust_anchors_spc)
9951004 GETDNS_FREE(context->mf, context->trust_anchors);
9961005
997 getdns_traverse_postorder(&context->local_hosts,
1006 _getdns_traverse_postorder(&context->local_hosts,
9981007 destroy_local_host, context);
9991008
10001009 GETDNS_FREE(context->my_mf, context);
10361045 return GETDNS_RETURN_GOOD;
10371046 }
10381047
1048 #ifdef HAVE_LIBUNBOUND
10391049 /*
10401050 * Helpers to set options on the unbound ctx
10411051 */
10801090 }
10811091
10821092 void
1083 priv_getdns_context_ub_read_cb(void *userarg)
1093 _getdns_context_ub_read_cb(void *userarg)
10841094 {
10851095 getdns_context *context = (getdns_context *)userarg;
10861096
11191129 set_ub_dns_transport(context);
11201130
11211131 context->ub_event.userarg = context;
1122 context->ub_event.read_cb = priv_getdns_context_ub_read_cb;
1132 context->ub_event.read_cb = _getdns_context_ub_read_cb;
11231133 context->ub_event.write_cb = NULL;
11241134 context->ub_event.timeout_cb = NULL;
11251135 context->ub_event.ev = NULL;
11261136
11271137 return GETDNS_RETURN_GOOD;
11281138 }
1139 #else
1140 #define set_ub_string_opt(ctx, opt, value) do {} while (0)
1141 #define set_ub_number_opt(ctx, opt, value) do {} while (0)
1142 #define getdns_context_request_count_changed(context) do {} while (0)
1143 #endif
11291144
11301145 /**
11311146 * Helper to dispatch the updated callback
14891504 return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
14901505 }
14911506 if (addresses != NULL) {
1492 if (getdns_list_copy(addresses, &copy) != GETDNS_RETURN_GOOD) {
1507 if (_getdns_list_copy(addresses, &copy) != GETDNS_RETURN_GOOD) {
14931508 return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
14941509 }
14951510 addresses = copy;
15601575 return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
15611576 }
15621577 if (value != NULL) {
1563 if (getdns_list_copy(value, &copy) != GETDNS_RETURN_GOOD) {
1578 if (_getdns_list_copy(value, &copy) != GETDNS_RETURN_GOOD) {
15641579 return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
15651580 }
15661581 value = copy;
17381753 freeaddrinfo(ai);
17391754 }
17401755 }
1741 priv_getdns_upstreams_dereference(context->upstreams);
1756 _getdns_upstreams_dereference(context->upstreams);
17421757 context->upstreams = upstreams;
17431758 dispatch_updated(context,
17441759 GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS);
17481763 invalid_parameter:
17491764 r = GETDNS_RETURN_INVALID_PARAMETER;
17501765 error:
1751 priv_getdns_upstreams_dereference(upstreams);
1766 _getdns_upstreams_dereference(upstreams);
17521767 return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
17531768 } /* getdns_context_set_upstream_recursive_servers */
17541769
18891904 getdns_network_req *netreq, **netreq_p;
18901905
18911906 for (netreq_p = req->netreqs; (netreq = *netreq_p); netreq_p++)
1907 #ifdef HAVE_LIBUNBOUND
18921908 if (netreq->unbound_id != -1) {
18931909 ub_cancel(req->context->unbound_ctx,
18941910 netreq->unbound_id);
18951911 netreq->unbound_id = -1;
18961912 } else
1897 priv_getdns_cancel_stub_request(netreq);
1913 #endif
1914 _getdns_cancel_stub_request(netreq);
18981915
18991916 req->canceled = 1;
19001917 }
19011918
19021919 getdns_return_t
1903 getdns_context_cancel_request(getdns_context *context,
1920 _getdns_context_cancel_request(getdns_context *context,
19041921 getdns_transaction_t transaction_id, int fire_callback)
19051922 {
19061923 getdns_dns_req *dnsreq;
19091926 return GETDNS_RETURN_INVALID_PARAMETER;
19101927
19111928 /* delete the node from the tree */
1912 if (!(dnsreq = (getdns_dns_req *)getdns_rbtree_delete(
1929 if (!(dnsreq = (getdns_dns_req *)_getdns_rbtree_delete(
19131930 &context->outbound_requests, &transaction_id)))
19141931 return GETDNS_RETURN_UNKNOWN_TRANSACTION;
19151932
19211938 NULL, dnsreq->user_pointer, transaction_id);
19221939
19231940 /* clean up */
1924 dns_req_free(dnsreq);
1941 _getdns_dns_req_free(dnsreq);
19251942 return GETDNS_RETURN_GOOD;
19261943 }
19271944
19371954 return GETDNS_RETURN_INVALID_PARAMETER;
19381955
19391956 context->processing = 1;
1940 getdns_return_t r = getdns_context_cancel_request(context, transaction_id, 1);
1957 getdns_return_t r = _getdns_context_cancel_request(context, transaction_id, 1);
19411958 context->processing = 0;
19421959 getdns_context_request_count_changed(context);
19431960 return r;
20702087 #endif
20712088
20722089 static getdns_return_t
2073 priv_getdns_ns_dns_setup(struct getdns_context *context)
2074 {
2075 priv_getdns_rr_iter rr_spc, *rr;
2090 _getdns_ns_dns_setup(struct getdns_context *context)
2091 {
2092 #ifdef HAVE_LIBUNBOUND
2093 _getdns_rr_iter rr_spc, *rr;
20762094 char ta_str[8192];
2095 #endif
20772096 assert(context);
20782097
20792098 switch (context->resolution_type) {
20872106 #endif
20882107
20892108 case GETDNS_RESOLUTION_RECURSING:
2109 #ifdef HAVE_LIBUNBOUND
20902110 /* TODO: use the root servers via root hints file */
20912111 (void) ub_ctx_set_fwd(context->unbound_ctx, NULL);
20922112 if (!context->unbound_ta_set && context->trust_anchors) {
2093 for ( rr = priv_getdns_rr_iter_init( &rr_spc
2113 for ( rr = _getdns_rr_iter_init( &rr_spc
20942114 , context->trust_anchors
20952115 , context->trust_anchors_len)
2096 ; rr ; rr = priv_getdns_rr_iter_next(rr) ) {
2116 ; rr ; rr = _getdns_rr_iter_next(rr) ) {
20972117
20982118 (void) gldns_wire2str_rr_buf(rr->pos,
20992119 rr->nxt - rr->pos, ta_str, sizeof(ta_str));
21032123 context->unbound_ta_set = 1;
21042124 }
21052125 return GETDNS_RETURN_GOOD;
2126 #else
2127 return GETDNS_RETURN_GENERIC_ERROR;
2128 #endif
21062129 }
21072130 return GETDNS_RETURN_BAD_CONTEXT;
21082131 }
21092132
21102133 getdns_return_t
2111 getdns_context_prepare_for_resolution(struct getdns_context *context,
2134 _getdns_context_prepare_for_resolution(struct getdns_context *context,
21122135 int usenamespaces)
21132136 {
21142137 int i;
21532176
21542177
21552178 if (! usenamespaces) {
2156 r = priv_getdns_ns_dns_setup(context);
2179 r = _getdns_ns_dns_setup(context);
21572180 if (r == GETDNS_RETURN_GOOD)
21582181 context->resolution_type_set = context->resolution_type;
21592182 return r;
21632186 for (i = 0; i < context->namespace_count; i++) {
21642187 switch (context->namespaces[i]) {
21652188 case GETDNS_NAMESPACE_DNS:
2166 r = priv_getdns_ns_dns_setup(context);
2189 r = _getdns_ns_dns_setup(context);
21672190 break;
21682191
21692192 default:
21752198 }
21762199 context->resolution_type_set = context->resolution_type;
21772200 return r;
2178 } /* getdns_context_prepare_for_resolution */
2179
2180 getdns_return_t
2181 getdns_context_track_outbound_request(getdns_dns_req *dnsreq)
2201 } /* _getdns_context_prepare_for_resolution */
2202
2203 getdns_return_t
2204 _getdns_context_track_outbound_request(getdns_dns_req *dnsreq)
21822205 {
21832206 if (!dnsreq)
21842207 return GETDNS_RETURN_INVALID_PARAMETER;
21852208
21862209 dnsreq->node.key = &(dnsreq->trans_id);
2187 if (!getdns_rbtree_insert(
2210 if (!_getdns_rbtree_insert(
21882211 &dnsreq->context->outbound_requests, &dnsreq->node))
21892212 return GETDNS_RETURN_GENERIC_ERROR;
21902213
21932216 }
21942217
21952218 getdns_return_t
2196 getdns_context_clear_outbound_request(getdns_dns_req *dnsreq)
2219 _getdns_context_clear_outbound_request(getdns_dns_req *dnsreq)
21972220 {
21982221 if (!dnsreq)
21992222 return GETDNS_RETURN_INVALID_PARAMETER;
22002223
2201 if (!getdns_rbtree_delete(
2224 if (!_getdns_rbtree_delete(
22022225 &dnsreq->context->outbound_requests, &dnsreq->trans_id))
22032226 return GETDNS_RETURN_GENERIC_ERROR;
22042227
22072230 }
22082231
22092232 getdns_return_t
2210 getdns_context_request_timed_out(struct getdns_dns_req *req)
2233 _getdns_context_request_timed_out(struct getdns_dns_req *req)
22112234 {
22122235 /* Don't use req after callback */
22132236 getdns_context* context = req->context;
22142237 getdns_transaction_t trans_id = req->trans_id;
22152238 getdns_callback_t cb = req->user_callback;
22162239 void *user_arg = req->user_pointer;
2217 getdns_dict *response = create_getdns_response(req);
2240 getdns_dict *response = _getdns_create_getdns_response(req);
22182241
22192242 /* cancel the req - also clears it from outbound and cleans up*/
2220 getdns_context_cancel_request(context, trans_id, 0);
2243 _getdns_context_cancel_request(context, trans_id, 0);
22212244 context->processing = 1;
22222245 cb(context, GETDNS_CALLBACK_TIMEOUT, response, user_arg, trans_id);
22232246 context->processing = 0;
22262249 }
22272250
22282251 char *
2229 getdns_strdup(const struct mem_funcs *mfs, const char *s)
2252 _getdns_strdup(const struct mem_funcs *mfs, const char *s)
22302253 {
22312254 size_t sz = strlen(s) + 1;
22322255 char *r = GETDNS_XMALLOC(*mfs, char, sz);
22372260 }
22382261
22392262 struct getdns_bindata *
2240 getdns_bindata_copy(struct mem_funcs *mfs,
2263 _getdns_bindata_copy(struct mem_funcs *mfs,
22412264 const struct getdns_bindata *src)
22422265 {
22432266 /* Don't know why, but nodata allows
22672290 }
22682291
22692292 void
2270 getdns_bindata_destroy(struct mem_funcs *mfs,
2293 _getdns_bindata_destroy(struct mem_funcs *mfs,
22712294 struct getdns_bindata *bindata)
22722295 {
22732296 if (!bindata)
22792302
22802303 /* TODO: Remove next_timeout argument from getdns_context_get_num_pending_requests
22812304 */
2282 void getdns_handle_timeouts(struct getdns_event_base* base, struct timeval* now,
2305 void _getdns_handle_timeouts(struct _getdns_event_base* base, struct timeval* now,
22832306 struct timeval* wait);
22842307 uint32_t
22852308 getdns_context_get_num_pending_requests(struct getdns_context* context,
22932316 context->extension->vmt->run_once(context->extension, 0);
22942317
22952318 /* TODO: Remove this when next_timeout is gone */
2296 getdns_handle_timeouts(context->mini_event.base,
2319 _getdns_handle_timeouts(context->mini_event.base,
22972320 &context->mini_event.time_tv, next_timeout ? next_timeout : &dispose);
22982321
22992322 return context->outbound_requests.count;
23052328 {
23062329 RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
23072330
2331 #ifdef HAVE_LIBUNBOUND
23082332 context->processing = 1;
23092333 if (ub_poll(context->unbound_ctx) && ub_process(context->unbound_ctx)){
23102334 /* need an async return code? */
23122336 return GETDNS_RETURN_GENERIC_ERROR;
23132337 }
23142338 context->processing = 0;
2339 #endif
23152340 context->extension->vmt->run_once(context->extension, 0);
23162341
23172342 return GETDNS_RETURN_GOOD;
23312356 } timeout_accumulator;
23322357
23332358 static void
2334 accumulate_outstanding_transactions(getdns_rbnode_t* node, void* arg) {
2359 accumulate_outstanding_transactions(_getdns_rbnode_t* node, void* arg) {
23352360 timeout_accumulator* acc = (timeout_accumulator*) arg;
23362361 acc->ids[acc->idx] = *((getdns_transaction_t*) node->key);
23372362 acc->idx++;
23442369 int i;
23452370 acc.idx = 0;
23462371 acc.ids = GETDNS_XMALLOC(context->my_mf, getdns_transaction_t, context->outbound_requests.count);
2347 getdns_traverse_postorder(&context->outbound_requests, accumulate_outstanding_transactions, &acc);
2372 _getdns_traverse_postorder(&context->outbound_requests, accumulate_outstanding_transactions, &acc);
23482373 for (i = 0; i < acc.idx; ++i) {
2349 getdns_context_cancel_request(context, acc.ids[i], fire_callback);
2374 _getdns_context_cancel_request(context, acc.ids[i], fire_callback);
23502375 }
23512376 GETDNS_FREE(context->my_mf, acc.ids);
23522377 }
23702395 context->processing = 0;
23712396 context->extension->vmt->cleanup(context->extension);
23722397 context->extension = &context->mini_event.loop;
2373 return getdns_mini_event_init(context, &context->mini_event);
2398 return _getdns_mini_event_init(context, &context->mini_event);
23742399 }
23752400
23762401 getdns_return_t
24222447 getdns_list *upstreams =
24232448 getdns_list_create_with_context(context);
24242449
2425 for (i = 0; i < context->upstreams->count; i++) {
2450 for (i = 0; i < context->upstreams->count;) {
24262451 size_t j;
24272452 getdns_dict *d;
24282453 upstream = &context->upstreams->upstreams[i];
24412466 (void) getdns_dict_set_int(d, "tls_port",
24422467 (uint32_t) upstream_port(upstream));
24432468 }
2444 r |= getdns_list_append_dict(upstreams, d);
2469 r |= _getdns_list_append_dict(upstreams, d);
24452470 getdns_dict_destroy(d);
24462471 }
24472472 r |= getdns_dict_set_list(result, "upstream_recursive_servers",
25122537 getdns_return_t
25132538 getdns_context_set_use_threads(getdns_context* context, int use_threads) {
25142539 RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
2540 int r = 0;
25152541 if (context->resolution_type_set != 0) {
25162542 /* already setup */
25172543 return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
25182544 }
2519 int r = 0;
2545 #ifdef HAVE_LIBUNBOUND
25202546 if (use_threads)
25212547 r = ub_ctx_async(context->unbound_ctx, 1);
25222548 else
25232549 r = ub_ctx_async(context->unbound_ctx, 0);
2550 #else
2551 (void)use_threads;
2552 #endif
25242553 return r == 0 ? GETDNS_RETURN_GOOD : GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
25252554 }
25262555
25272556 getdns_return_t
2528 getdns_context_local_namespace_resolve(
2557 _getdns_context_local_namespace_resolve(
25292558 getdns_dns_req *dnsreq, getdns_dict **response)
25302559 {
25312560 getdns_context *context = dnsreq->context;
25512580 canonicalize_dname(lookup);
25522581
25532582 if (!(hnas = (host_name_addrs *)
2554 getdns_rbtree_search(&context->local_hosts, lookup)))
2583 _getdns_rbtree_search(&context->local_hosts, lookup)))
25552584 return GETDNS_RETURN_GENERIC_ERROR;
25562585
25572586 if (!hnas->ipv4addrs && (!ipv6 || !hnas->ipv6addrs))
25922621 if (!(jaa = getdns_list_create_with_context(context)))
25932622 goto error;
25942623 for (i = 0; !getdns_list_get_dict(hnas->ipv4addrs, i, &addr); i++)
2595 if (getdns_list_append_dict(jaa, addr))
2624 if (_getdns_list_append_dict(jaa, addr))
25962625 break;
25972626 for (i = 0; !getdns_list_get_dict(hnas->ipv6addrs, i, &addr); i++)
2598 if (getdns_list_append_dict(jaa, addr))
2627 if (_getdns_list_append_dict(jaa, addr))
25992628 break;
26002629 if (!getdns_dict_set_list(*response, "just_address_answers", jaa)) {
26012630 getdns_list_destroy(jaa);
27402769 RETURN_IF_NULL(value, GETDNS_RETURN_INVALID_PARAMETER);
27412770 *value = NULL;
27422771 if (context->dns_root_servers) {
2743 return getdns_list_copy(context->dns_root_servers, value);
2772 return _getdns_list_copy(context->dns_root_servers, value);
27442773 }
27452774 return GETDNS_RETURN_GOOD;
27462775 }
27602789 RETURN_IF_NULL(value, GETDNS_RETURN_INVALID_PARAMETER);
27612790 *value = NULL;
27622791 if (context->suffix) {
2763 return getdns_list_copy(context->suffix, value);
2792 return _getdns_list_copy(context->suffix, value);
27642793 }
27652794 return GETDNS_RETURN_GOOD;
27662795 }
28052834 size_t i;
28062835 getdns_upstream *upstream;
28072836 getdns_list *upstreams = getdns_list_create();
2808 for (i = 0; i < context->upstreams->count; i++) {
2837 for (i = 0; i < context->upstreams->count;) {
28092838 size_t j;
28102839 getdns_dict *d;
28112840 upstream = &context->upstreams->upstreams[i];
28232852 (void) getdns_dict_set_int(d, "tls_port",
28242853 (uint32_t) upstream_port(upstream));
28252854 }
2826 r |= getdns_list_append_dict(upstreams, d);
2855 r |= _getdns_list_append_dict(upstreams, d);
28272856 getdns_dict_destroy(d);
28282857 }
28292858 if (r != GETDNS_RETURN_GOOD) {
7979 } getdns_tls_hs_state_t;
8080
8181 typedef struct getdns_upstream {
82 /* backpointer to containing upstreams structure */
8283 struct getdns_upstreams *upstreams;
8384
8485 socklen_t addr_len;
103104 /* Pipelining of TCP network requests */
104105 getdns_network_req *write_queue;
105106 getdns_network_req *write_queue_last;
106 getdns_rbtree_t netreq_by_query_id;
107 _getdns_rbtree_t netreq_by_query_id;
107108
108109 /* EDNS cookies */
109110 uint32_t secret;
163164 struct mem_funcs mf;
164165 struct mem_funcs my_mf;
165166
167 #ifdef HAVE_LIBUNBOUND
166168 /* The underlying contexts that do the real work */
167169 struct ub_ctx *unbound_ctx;
168170 int unbound_ta_set;
171 #endif
169172
170173 /* A tree to hold local host information*/
171 getdns_rbtree_t local_hosts;
174 _getdns_rbtree_t local_hosts;
172175
173176 int return_dnssec_status;
174177
180183 /*
181184 * outbound requests -> transaction to getdns_dns_req
182185 */
183 getdns_rbtree_t outbound_requests;
186 _getdns_rbtree_t outbound_requests;
184187
185188 /* Event loop extension. */
186189 getdns_eventloop *extension;
190
191 #ifdef HAVE_LIBUNBOUND
187192 getdns_eventloop_event ub_event;
193 #endif
188194
189195 /* The default extension */
190 getdns_mini_event mini_event;
196 _getdns_mini_event mini_event;
191197
192198 /*
193199 * state data used to detect changes to the system config files
207213 * @param usenamespaces if 0 then only use the DNS, else use context namespace list
208214 * @return GETDNS_RETURN_GOOD on success
209215 */
210 getdns_return_t getdns_context_prepare_for_resolution(struct getdns_context *context,
216 getdns_return_t _getdns_context_prepare_for_resolution(struct getdns_context *context,
211217 int usenamespaces);
212218
213219 /* track an outbound request */
214 getdns_return_t getdns_context_track_outbound_request(struct getdns_dns_req
220 getdns_return_t _getdns_context_track_outbound_request(struct getdns_dns_req
215221 *req);
216222 /* clear the outbound request from being tracked - does not cancel it */
217 getdns_return_t getdns_context_clear_outbound_request(struct getdns_dns_req
223 getdns_return_t _getdns_context_clear_outbound_request(struct getdns_dns_req
218224 *req);
219225
220 getdns_return_t getdns_context_request_timed_out(struct getdns_dns_req
226 getdns_return_t _getdns_context_request_timed_out(struct getdns_dns_req
221227 *req);
222228
223229 /* cancel callback internal - flag to indicate if req should be freed and callback fired */
224 getdns_return_t getdns_context_cancel_request(struct getdns_context *context,
230 getdns_return_t _getdns_context_cancel_request(struct getdns_context *context,
225231 getdns_transaction_t transaction_id, int fire_callback);
226232
227 char *getdns_strdup(const struct mem_funcs *mfs, const char *str);
228
229 struct getdns_bindata *getdns_bindata_copy(
233 char *_getdns_strdup(const struct mem_funcs *mfs, const char *str);
234
235 struct getdns_bindata *_getdns_bindata_copy(
230236 struct mem_funcs *mfs,
231237 const struct getdns_bindata *src);
232238
233 void getdns_bindata_destroy(
239 void _getdns_bindata_destroy(
234240 struct mem_funcs *mfs,
235241 struct getdns_bindata *bindata);
236242
237243 /* perform name resolution in /etc/hosts */
238 getdns_return_t getdns_context_local_namespace_resolve(
244 getdns_return_t _getdns_context_local_namespace_resolve(
239245 getdns_dns_req* req, struct getdns_dict **response);
240246
241 int filechg_check(struct getdns_context *context, struct filechg *fchg);
242
243 void priv_getdns_context_ub_read_cb(void *userarg);
244
245 void priv_getdns_upstreams_dereference(getdns_upstreams *upstreams);
246
247 void priv_getdns_upstream_shutdown(getdns_upstream *upstreams);
247 int _getdns_filechg_check(struct getdns_context *context, struct filechg *fchg);
248
249 void _getdns_context_ub_read_cb(void *userarg);
250
251 void _getdns_upstreams_dereference(getdns_upstreams *upstreams);
252
253 void _getdns_upstream_shutdown(getdns_upstream *upstream);
248254
249255 #endif /* _GETDNS_CONTEXT_H_ */
3636 #include <arpa/inet.h>
3737 #include <locale.h>
3838 #include <stringprep.h>
39 #include "config.h"
40 #ifdef HAVE_LIBIDN
3941 #include <idna.h>
42 #endif
4043 #include "getdns/getdns.h"
4144 #include "getdns/getdns_extra.h"
4245 #include "util-internal.h"
101104 char *
102105 getdns_convert_ulabel_to_alabel(const char *ulabel)
103106 {
107 #ifdef HAVE_LIBIDN
104108 int ret;
105109 char *buf;
106110 char *prepped;
138142 }
139143 free(prepped2);
140144 return buf;
145 #else
146 return NULL;
147 #endif
141148 }
142149
143150 /*---------------------------------------- getdns_convert_alabel_to_ulabel */
154161 char *
155162 getdns_convert_alabel_to_ulabel(const char *alabel)
156163 {
164 #ifdef HAVE_LIBIDN
157165 int ret; /* just in case we might want to use it someday */
158166 char *buf;
159167
163171 return NULL;
164172 }
165173 return buf;
174 #else
175 return NULL;
176 #endif
166177 }
167178
168179
00 /**
11 *
22 * getdns dict management functions, note that the internal storage is
3 * accomplished via an getdns_rbtree_t
3 * accomplished via an _getdns_rbtree_t
44 *
55 * Interfaces originally taken from the getdns API description pseudo implementation.
66 *
5555 * @return pointer to dictionary item, caller must not free storage associated with item
5656 * @return NULL if additnotfnd == FALSE and key is not in dictionary
5757 */
58 struct getdns_dict_item *
58 static struct getdns_dict_item *
5959 getdns_dict_find(const struct getdns_dict *dict, const char *key)
6060 {
6161 return (struct getdns_dict_item *)
62 getdns_rbtree_search((getdns_rbtree_t *)&(dict->root), key);
62 _getdns_rbtree_search((_getdns_rbtree_t *)&(dict->root), key);
6363 } /* getdns_dict_find */
6464
65 struct getdns_dict_item *
65 static struct getdns_dict_item *
6666 getdns_dict_find_and_add(struct getdns_dict *dict, const char *key)
6767 {
6868 struct getdns_dict_item *item;
6969
7070 item = (struct getdns_dict_item *)
71 getdns_rbtree_search(&(dict->root), key);
71 _getdns_rbtree_search(&(dict->root), key);
7272
7373 if (!item) {
7474 /* add a node */
7575 item = GETDNS_MALLOC(dict->mf, struct getdns_dict_item);
76 item->node.key = getdns_strdup(&dict->mf, key);
76 item->node.key = _getdns_strdup(&dict->mf, key);
7777 item->data.n = 0;
78 getdns_rbtree_insert(&(dict->root), (getdns_rbnode_t *) item);
78 _getdns_rbtree_insert(&(dict->root), (_getdns_rbnode_t *) item);
7979 }
8080 return item;
8181 } /* getdns_dict_find_and_add */
8484 /*---------------------------------------- getdns_dict_get_names
8585 */
8686 getdns_return_t
87 getdns_dict_get_names(const struct getdns_dict * dict,
88 struct getdns_list ** answer)
89 {
90 struct getdns_dict_item *item;
91 size_t index;
92 struct getdns_bindata bindata;
87 getdns_dict_get_names(const getdns_dict *dict, getdns_list **answer)
88 {
89 struct getdns_dict_item *item;
9390
9491 if (!dict || !answer)
9592 return GETDNS_RETURN_INVALID_PARAMETER;
10198 return GETDNS_RETURN_NO_SUCH_DICT_NAME;
10299
103100 RBTREE_FOR(item, struct getdns_dict_item *,
104 (getdns_rbtree_t *)&(dict->root)) {
105 if (getdns_list_add_item(*answer, &index) != GETDNS_RETURN_GOOD)
106 continue;
107 bindata.size = strlen(item->node.key) + 1;
108 bindata.data = (void *) item->node.key;
109 getdns_list_set_bindata(*answer, index, &bindata);
101 (_getdns_rbtree_t *)&(dict->root)) {
102 _getdns_list_append_string(*answer, item->node.key);
110103 }
111104 return GETDNS_RETURN_GOOD;
112105 } /* getdns_dict_get_names */
240233 dict->mf.mf.ext.realloc = realloc;
241234 dict->mf.mf.ext.free = free;
242235
243 getdns_rbtree_init(&(dict->root),
236 _getdns_rbtree_init(&(dict->root),
244237 (int (*)(const void *, const void *)) strcmp);
245238 return dict;
246239 }
277270 return getdns_dict_create_with_context(NULL);
278271 } /* getdns_dict_create */
279272
280 /*---------------------------------------- getdns_dict_copy */
273 /*---------------------------------------- _getdns_dict_copy */
281274 /**
282275 * private function used to make a copy of a dict structure,
283276 * the caller is responsible * for freeing storage allocated to returned value
287280 * @return NULL on error (out of memory, invalid srcdict)
288281 */
289282 getdns_return_t
290 getdns_dict_copy(const struct getdns_dict * srcdict,
283 _getdns_dict_copy(const struct getdns_dict * srcdict,
291284 struct getdns_dict ** dstdict)
292285 {
293286 struct getdns_dict_item *item;
311304
312305 retval = GETDNS_RETURN_GOOD;
313306 RBTREE_FOR(item, struct getdns_dict_item *,
314 (struct getdns_rbtree_t *)&(srcdict->root)) {
307 (struct _getdns_rbtree_t *)&(srcdict->root)) {
315308 key = (char *) item->node.key;
316309 switch (item->dtype) {
317310 case t_bindata:
341334 }
342335 }
343336 return GETDNS_RETURN_GOOD;
344 } /* getdns_dict_copy */
337 } /* _getdns_dict_copy */
345338
346339 /*---------------------------------------- getdns_dict_item_free */
347340 /**
351344 * to free the items
352345 * @return void
353346 */
354 void
355 getdns_dict_item_free(getdns_rbnode_t * node, void *arg)
347 static void
348 getdns_dict_item_free(_getdns_rbnode_t * node, void *arg)
356349 {
357350 struct getdns_dict_item *item = (struct getdns_dict_item *) node;
358351 struct getdns_dict *dict = (struct getdns_dict *)arg;
362355
363356 switch (item->dtype) {
364357 case t_bindata:
365 getdns_bindata_destroy(&dict->mf, item->data.bindata);
358 _getdns_bindata_destroy(&dict->mf, item->data.bindata);
366359 break;
367360 case t_dict:
368361 getdns_dict_destroy(item->data.dict);
383376 getdns_dict_destroy(struct getdns_dict *dict)
384377 {
385378 if (!dict) return;
386 getdns_traverse_postorder(&(dict->root), getdns_dict_item_free, dict);
379 _getdns_traverse_postorder(&(dict->root), getdns_dict_item_free, dict);
387380 GETDNS_FREE(dict->mf, dict);
388381 } /* getdns_dict_destroy */
389382
399392 if (!dict || !name || !child_dict)
400393 return GETDNS_RETURN_INVALID_PARAMETER;
401394
402 retval = getdns_dict_copy(child_dict, &newdict);
395 retval = _getdns_dict_copy(child_dict, &newdict);
403396 if (retval != GETDNS_RETURN_GOOD)
404397 return retval;
405398
425418 if (!dict || !name || !child_list)
426419 return GETDNS_RETURN_INVALID_PARAMETER;
427420
428 retval = getdns_list_copy(child_list, &newlist);
421 retval = _getdns_list_copy(child_list, &newlist);
429422 if (retval != GETDNS_RETURN_GOOD)
430423 return retval;
431424
450443 if (!dict || !name || !child_bindata)
451444 return GETDNS_RETURN_INVALID_PARAMETER;
452445
453 newbindata = getdns_bindata_copy(&dict->mf, child_bindata);
446 newbindata = _getdns_bindata_copy(&dict->mf, child_bindata);
454447 if (!newbindata)
455448 return GETDNS_RETURN_NO_SUCH_DICT_NAME;
456449
457450 item = getdns_dict_find_and_add(dict, name);
458451 if (!item) {
459 getdns_bindata_destroy(&dict->mf, newbindata);
452 _getdns_bindata_destroy(&dict->mf, newbindata);
460453 return GETDNS_RETURN_NO_SUCH_DICT_NAME;
461454 }
462455 item->dtype = t_bindata;
463456 item->data.bindata = newbindata;
464457 return GETDNS_RETURN_GOOD;
465458 } /* getdns_dict_set_bindata */
459
460 /*---------------------------------------- getdns_dict_set_bindata */
461 getdns_return_t
462 getdns_dict_util_set_string(getdns_dict *dict, char *name, const char *value)
463 {
464 struct getdns_dict_item *item;
465 getdns_bindata *newbindata;
466
467 if (!dict || !name || !value)
468 return GETDNS_RETURN_INVALID_PARAMETER;
469
470 if (!(newbindata = GETDNS_MALLOC(dict->mf, getdns_bindata)))
471 return GETDNS_RETURN_MEMORY_ERROR;
472
473 newbindata->size = strlen(value);
474 if (!(newbindata->data = (void *)_getdns_strdup(&dict->mf, value)))
475 goto error_free_bindata;
476
477 if ((item = getdns_dict_find_and_add(dict, name))) {
478
479 item->dtype = t_bindata;
480 item->data.bindata = newbindata;
481 return GETDNS_RETURN_GOOD;
482 }
483 GETDNS_FREE(dict->mf, newbindata->data);
484 error_free_bindata:
485 GETDNS_FREE(dict->mf, newbindata);
486 return GETDNS_RETURN_MEMORY_ERROR;
487 } /* getdns_dict_util_set_dict */
466488
467489 /*---------------------------------------- getdns_dict_set_int */
468490 getdns_return_t
498520 } /* getdns_indent */
499521
500522 static int
501 priv_getdns_bindata_is_dname(getdns_bindata *bindata)
523 _getdns_bindata_is_dname(getdns_bindata *bindata)
502524 {
503525 size_t i = 0, n_labels = 0;
504526
562584 if (gldns_buffer_printf(buf, json ? "\".\"" : "for .>") < 0)
563585 return -1;
564586
565 } else if (priv_getdns_bindata_is_dname(bindata)) {
587 } else if (_getdns_bindata_is_dname(bindata)) {
566588 (void)gldns_wire2str_dname_buf(
567589 bindata->data, bindata->size, spc, sizeof(spc));
568590 if (gldns_buffer_printf(
658680 return -1;
659681 if (!json && for_literals &&
660682 (strval =
661 priv_getdns_get_const_info(int_item)->name)) {
683 _getdns_get_const_info(int_item)->name)) {
662684 if (gldns_buffer_printf(buf, "%s", strval) < 0)
663685 return -1;
664686 } else if (0 >
709731 } /* getdns_pp_list */
710732
711733 static int
712 priv_getdns_print_class(gldns_buffer *buf, uint32_t klass)
734 _getdns_print_class(gldns_buffer *buf, uint32_t klass)
713735 {
714736 switch (klass) {
715737 case GETDNS_RRCLASS_IN:
732754 }
733755
734756 static int
735 priv_getdns_print_opcode(gldns_buffer *buf, uint32_t opcode)
757 _getdns_print_opcode(gldns_buffer *buf, uint32_t opcode)
736758 {
737759 switch (opcode) {
738760 case GETDNS_OPCODE_QUERY:
755777 }
756778
757779 static int
758 priv_getdns_print_rcode(gldns_buffer *buf, uint32_t rcode)
780 _getdns_print_rcode(gldns_buffer *buf, uint32_t rcode)
759781 {
760782 static const char *rcodes[] = {
761783 " GETDNS_RCODE_NOERROR" , " GETDNS_RCODE_FORMERR" ,
806828 i = 0;
807829 indent += 2;
808830 RBTREE_FOR(item, struct getdns_dict_item *,
809 (getdns_rbtree_t *)&(dict->root)) {
831 (_getdns_rbtree_t *)&(dict->root)) {
810832
811833 if (i && gldns_buffer_printf(buf, ",") < 0)
812834 return -1;
823845 (strcmp(item->node.key, "type") == 0 ||
824846 strcmp(item->node.key, "type_covered") == 0 ||
825847 strcmp(item->node.key, "qtype") == 0) &&
826 (strval = priv_getdns_rr_type_name(item->data.n))) {
848 (strval = _getdns_rr_type_name(item->data.n))) {
827849 if (gldns_buffer_printf(
828850 buf, " GETDNS_RRTYPE_%s", strval) < 0)
829851 return -1;
837859 strcmp(item->node.key, "follow_redirects") == 0 ||
838860 strcmp(item->node.key, "resolution_type") == 0) &&
839861 (strval =
840 priv_getdns_get_const_info(item->data.n)->name)) {
862 _getdns_get_const_info(item->data.n)->name)) {
841863 if (gldns_buffer_printf(buf, " %s", strval) < 0)
842864 return -1;
843865 break;
845867 if (!json &&
846868 (strcmp(item->node.key, "class") == 0 ||
847869 strcmp(item->node.key, "qclass") == 0) &&
848 priv_getdns_print_class(buf, item->data.n))
870 _getdns_print_class(buf, item->data.n))
849871 break;
850872 if (!json && strcmp(item->node.key, "opcode") == 0 &&
851 priv_getdns_print_opcode(buf, item->data.n))
873 _getdns_print_opcode(buf, item->data.n))
852874 break;
853875 if (!json && strcmp(item->node.key, "rcode") == 0 &&
854 priv_getdns_print_rcode(buf, item->data.n))
876 _getdns_print_rcode(buf, item->data.n))
855877 break;
856878 if (gldns_buffer_printf(
857879 buf,(json < 2 ? " %d" : "%d"), item->data.n) < 0)
10881110 return GETDNS_RETURN_NO_SUCH_DICT_NAME;
10891111
10901112 /* cleanup */
1091 getdns_rbtree_delete(&this_dict->root, name);
1113 _getdns_rbtree_delete(&this_dict->root, name);
10921114 getdns_dict_item_free(&item->node, this_dict);
10931115
10941116 return GETDNS_RETURN_GOOD;
5151 */
5252 struct getdns_dict_item
5353 {
54 getdns_rbnode_t node;
54 _getdns_rbnode_t node;
5555 getdns_data_type dtype;
5656 union getdns_item data;
5757 };
6565 */
6666 struct getdns_dict
6767 {
68 getdns_rbtree_t root;
68 _getdns_rbtree_t root;
6969 struct mem_funcs mf;
7070 };
7171
22 * /brief functions for DNSSEC
33 *
44 * In this file, the "dnssec_return_validation_chain" extension is implemented
5 * (with the priv_getdns_get_validation_chain() function)
5 * (with the _getdns_get_validation_chain() function)
66 * Also the function getdns_validate_dnssec is implemented.
77 * DNSSEC validation as a stub combines those two functionalities, by first
88 * fetching all the records that are necessary to be able to validate a
190190 #include <sys/types.h>
191191 #include <sys/stat.h>
192192 #include <unistd.h>
193 #include <unbound.h>
194193 #include <ldns/ldns.h>
194 #include <openssl/sha.h>
195195 #include "getdns/getdns.h"
196196 #include "config.h"
197197 #include "context.h"
237237
238238 inline static int _dname_equal(const uint8_t *left, const uint8_t *right)
239239 {
240 return priv_getdns_dname_equal(left, right);
240 return _getdns_dname_equal(left, right);
241241 }
242242
243243 static int _dname_is_parent(
252252 return *parent == 0;
253253 }
254254
255 static uint8_t *_dname_label_copy(uint8_t *dst, uint8_t *src, size_t dst_len)
255 static uint8_t *_dname_label_copy(uint8_t *dst, const uint8_t *src, size_t dst_len)
256256 {
257257 uint8_t *r = dst, i;
258258
355355 return rlabel == last_rlabel ? 0 : -1;
356356 }
357357
358 static int bitmap_has_type(priv_getdns_rdf_iter *bitmap, uint16_t rr_type)
358 static int bitmap_has_type(_getdns_rdf_iter *bitmap, uint16_t rr_type)
359359 {
360360 uint8_t *dptr, *dend;
361361 uint8_t window = rr_type >> 8;
377377 }
378378
379379 #if defined(SEC_DEBUG) && SEC_DEBUG
380 inline static void debug_sec_print_rr(const char *msg, priv_getdns_rr_iter *rr)
380 inline static void debug_sec_print_rr(const char *msg, _getdns_rr_iter *rr)
381381 {
382382 char str_spc[8192], *str = str_spc;
383383 size_t str_len = sizeof(str_spc);
420420
421421
422422 /* Utility functions to read rr_type and rr_class from a rr iterator */
423 static inline uint16_t rr_iter_type(priv_getdns_rr_iter *rr)
423 static inline uint16_t rr_iter_type(_getdns_rr_iter *rr)
424424 { return rr->rr_type + 2 <= rr->nxt ? gldns_read_uint16(rr->rr_type) : 0; }
425 static inline uint16_t rr_iter_class(priv_getdns_rr_iter *rr)
425 static inline uint16_t rr_iter_class(_getdns_rr_iter *rr)
426426 { return rr->rr_type + 4 <= rr->nxt ? gldns_read_uint16(rr->rr_type + 2) : 0; }
427427
428428 /* Utility function to compare owner name of rr with name */
429 static int rr_owner_equal(priv_getdns_rr_iter *rr, uint8_t *name)
429 static int rr_owner_equal(_getdns_rr_iter *rr, uint8_t *name)
430430 {
431431 uint8_t owner_spc[256], *owner;
432432 size_t owner_len = sizeof(owner_spc);
433433
434 return (owner = priv_getdns_owner_if_or_as_decompressed(rr, owner_spc
434 return (owner = _getdns_owner_if_or_as_decompressed(rr, owner_spc
435435 , &owner_len))
436436 && _dname_equal(owner, name);
437437 }
441441 */
442442
443443 /* Filter that only iterates over the ANSWER and AUTHORITY section */
444 static priv_getdns_rr_iter *rr_iter_ansauth(priv_getdns_rr_iter *rr)
444 static _getdns_rr_iter *rr_iter_ansauth(_getdns_rr_iter *rr)
445445 {
446446 while (rr && rr->pos && !(
447 priv_getdns_rr_iter_section(rr) == GLDNS_SECTION_ANSWER ||
448 priv_getdns_rr_iter_section(rr) == GLDNS_SECTION_AUTHORITY))
449
450 rr = priv_getdns_rr_iter_next(rr);
447 _getdns_rr_iter_section(rr) == GLDNS_SECTION_ANSWER ||
448 _getdns_rr_iter_section(rr) == GLDNS_SECTION_AUTHORITY))
449
450 rr = _getdns_rr_iter_next(rr);
451451
452452 return rr && rr->pos ? rr : NULL;
453453 }
454454
455455 /* Filter that only iterates over RRs with a certain name/class/type */
456 static priv_getdns_rr_iter *rr_iter_name_class_type(priv_getdns_rr_iter *rr,
456 static _getdns_rr_iter *rr_iter_name_class_type(_getdns_rr_iter *rr,
457457 uint8_t *name, uint16_t rr_class, uint16_t rr_type)
458458 {
459459 while (rr_iter_ansauth(rr) && !(
461461 rr_iter_class(rr) == rr_class &&
462462 rr_owner_equal(rr, name)))
463463
464 rr = priv_getdns_rr_iter_next(rr);
464 rr = _getdns_rr_iter_next(rr);
465465
466466 return rr && rr->pos ? rr : NULL;
467467 }
468468
469469 /* Filter that only iterates over RRs that do not have a name/class/type */
470 static priv_getdns_rr_iter *rr_iter_not_name_class_type(priv_getdns_rr_iter *rr,
470 static _getdns_rr_iter *rr_iter_not_name_class_type(_getdns_rr_iter *rr,
471471 uint8_t *name, uint16_t rr_class, uint16_t rr_type)
472472 {
473473 while (rr_iter_ansauth(rr) && (
476476 rr_iter_class(rr) == rr_class &&
477477 rr_owner_equal(rr, name))))
478478
479 rr = priv_getdns_rr_iter_next(rr);
479 rr = _getdns_rr_iter_next(rr);
480480
481481 return rr && rr->pos ? rr : NULL;
482482 }
484484 /* Filter that only iterates over RRs that are of type RRSIG, that cover
485485 * a RRset with a certain name/class/type
486486 */
487 static priv_getdns_rr_iter *rr_iter_rrsig_covering(priv_getdns_rr_iter *rr,
487 static _getdns_rr_iter *rr_iter_rrsig_covering(_getdns_rr_iter *rr,
488488 uint8_t *name, uint16_t rr_class, uint16_t rr_type)
489489 {
490490 while (rr_iter_ansauth(rr) && !(
494494 gldns_read_uint16(rr->rr_type + 10) == rr_type &&
495495 rr_owner_equal(rr, name)))
496496
497 rr = priv_getdns_rr_iter_next(rr);
497 rr = _getdns_rr_iter_next(rr);
498498
499499 return rr && rr->pos ? rr : NULL;
500500 }
508508 } getdns_rrset;
509509
510510 typedef struct rrtype_iter {
511 priv_getdns_rr_iter rr_i;
511 _getdns_rr_iter rr_i;
512512 getdns_rrset *rrset;
513513 } rrtype_iter;
514514
515515 typedef struct rrsig_iter {
516 priv_getdns_rr_iter rr_i;
516 _getdns_rr_iter rr_i;
517517 getdns_rrset *rrset;
518518 } rrsig_iter;
519519
520520 static rrtype_iter *rrtype_iter_next(rrtype_iter *i)
521521 {
522522 return (rrtype_iter *) rr_iter_name_class_type(
523 priv_getdns_rr_iter_next(&i->rr_i),
523 _getdns_rr_iter_next(&i->rr_i),
524524 i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
525525 }
526526
528528 {
529529 i->rrset = rrset;
530530 return (rrtype_iter *) rr_iter_name_class_type(
531 priv_getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len ),
531 _getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len ),
532532 i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
533533 }
534534
541541 static rrsig_iter *rrsig_iter_next(rrsig_iter *i)
542542 {
543543 return (rrsig_iter *) rr_iter_rrsig_covering(
544 priv_getdns_rr_iter_next(&i->rr_i),
544 _getdns_rr_iter_next(&i->rr_i),
545545 i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
546546 }
547547
549549 {
550550 i->rrset = rrset;
551551 return (rrsig_iter *) rr_iter_rrsig_covering(
552 priv_getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len),
552 _getdns_rr_iter_init(&i->rr_i, rrset->pkt, rrset->pkt_len),
553553 i->rrset->name, i->rrset->rr_class, i->rrset->rr_type);
554554 }
555555
588588 , rrset->rr_class);
589589 break;
590590 }
591 gldns_buffer_printf(&buf, "%s", priv_getdns_rr_type_name(rrset->rr_type));
591 gldns_buffer_printf(&buf, "%s", _getdns_rr_type_name(rrset->rr_type));
592592
593593 gldns_buffer_printf(&buf, ", rrs:");
594594 for ( rr = rrtype_iter_init(&rr_space, rrset), i = 1
616616 getdns_rrset rrset;
617617 uint8_t name_spc[256];
618618 size_t name_len;
619 priv_getdns_rr_iter rr_i;
619 _getdns_rr_iter rr_i;
620620 };
621621
622622 static rrset_iter *rrset_iter_init(rrset_iter *i, uint8_t *pkt, size_t pkt_len)
623623 {
624 priv_getdns_rr_iter *rr;
624 _getdns_rr_iter *rr;
625625
626626 i->rrset.name = i->name_spc;
627627 i->rrset.pkt = pkt;
628628 i->rrset.pkt_len = pkt_len;
629629 i->name_len = 0;
630630
631 for ( rr = priv_getdns_rr_iter_init(&i->rr_i, pkt, pkt_len)
631 for ( rr = _getdns_rr_iter_init(&i->rr_i, pkt, pkt_len)
632632 ;(rr = rr_iter_ansauth(rr))
633 ; rr = priv_getdns_rr_iter_next(rr)) {
633 ; rr = _getdns_rr_iter_next(rr)) {
634634
635635 if ((i->rrset.rr_type = rr_iter_type(rr))
636636 == GETDNS_RRTYPE_RRSIG)
638638
639639 i->rrset.rr_class = rr_iter_class(rr);
640640
641 if (!(i->rrset.name = priv_getdns_owner_if_or_as_decompressed(
641 if (!(i->rrset.name = _getdns_owner_if_or_as_decompressed(
642642 rr, i->name_spc, &i->name_len)))
643643 continue;
644644
654654
655655 static rrset_iter *rrset_iter_next(rrset_iter *i)
656656 {
657 priv_getdns_rr_iter *rr;
657 _getdns_rr_iter *rr;
658658
659659 if (!(rr = i && i->rr_i.pos ? &i->rr_i : NULL))
660660 return NULL;
665665
666666 i->rrset.rr_type = rr_iter_type(rr);
667667 i->rrset.rr_class = rr_iter_class(rr);
668 if (!(i->rrset.name = priv_getdns_owner_if_or_as_decompressed(
668 if (!(i->rrset.name = _getdns_owner_if_or_as_decompressed(
669669 rr, i->name_spc, &i->name_len)))
670670
671671 /* This is safe, because rr_iter_not_name_class_type will shift
887887 rrset_iter *i, i_spc;
888888 getdns_rrset *dname;
889889 rrtype_iter rr_spc, *rr;
890 priv_getdns_rdf_iter rdf_spc, *rdf;
890 _getdns_rdf_iter rdf_spc, *rdf;
891891 rrtype_iter drr_spc, *drr;
892 priv_getdns_rdf_iter drdf_spc, *drdf;
892 _getdns_rdf_iter drdf_spc, *drdf;
893893 uint8_t cname_rdata_spc[256], *cname_rdata,
894894 dname_rdata_spc[256], *dname_rdata,
895895 synth_name[256],
905905
906906 /* Get canonical name rdata field */
907907 if ( !(rr = rrtype_iter_init(&rr_spc, cname))
908 || !(rdf = priv_getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
909 || !(cname_rdata = priv_getdns_rdf_if_or_as_decompressed(
908 || !(rdf = _getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
909 || !(cname_rdata = _getdns_rdf_if_or_as_decompressed(
910910 rdf, cname_rdata_spc, &cname_rdata_len)))
911911 return 0;
912912
943943
944944 /* Get DNAME's rdata field */
945945 if ( !(drr = rrtype_iter_init(&drr_spc, dname))
946 || !(drdf=priv_getdns_rdf_iter_init(&drdf_spc,&drr->rr_i))
947 || !(dname_rdata = priv_getdns_rdf_if_or_as_decompressed(
946 || !(drdf=_getdns_rdf_iter_init(&drdf_spc,&drr->rr_i))
947 || !(dname_rdata = _getdns_rdf_if_or_as_decompressed(
948948 drdf, dname_rdata_spc, &dname_rdata_len)))
949949 continue;
950950
10401040 uint8_t cname_spc[256];
10411041 size_t cname_len = sizeof(cname_spc);
10421042 size_t anti_loop;
1043 priv_getdns_rdf_iter rdf_spc, *rdf;
1043 _getdns_rdf_iter rdf_spc, *rdf;
10441044 rrtype_iter *rr, rr_spc;
10451045
10461046 chain_head *head;
10591059 for (anti_loop = MAX_CNAMES; anti_loop; anti_loop--) {
10601060 if (!(rr = rrtype_iter_init(&rr_spc, &q_rrset)))
10611061 break;
1062 if (!(rdf = priv_getdns_rdf_iter_init(&rdf_spc, &rr->rr_i)))
1062 if (!(rdf = _getdns_rdf_iter_init(&rdf_spc, &rr->rr_i)))
10631063 break;
1064 q_rrset.name = priv_getdns_rdf_if_or_as_decompressed(
1064 q_rrset.name = _getdns_rdf_if_or_as_decompressed(
10651065 rdf, cname_spc, &cname_len);
10661066 }
10671067 q_rrset.rr_type = qtype;
11021102 DEBUG_SEC("schedule SOA lookup for %s\n", name);
11031103
11041104 if (! node->soa_req &&
1105 ! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_SOA,
1105 ! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_SOA,
11061106 dnssec_ok_checking_disabled, node, &dnsreq, NULL,
11071107 val_chain_node_soa_cb))
11081108
11491149 DEBUG_SEC("schedule DS & DNSKEY lookup for %s\n", name);
11501150
11511151 if (! node->dnskey_req /* not scheduled */ &&
1152 ! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DNSKEY,
1152 ! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DNSKEY,
11531153 dnssec_ok_checking_disabled, node, &dnsreq, NULL, val_chain_node_cb))
11541154
11551155 node->dnskey_req = dnsreq->netreqs[0];
11561156
11571157 if (! node->ds_req && node->parent /* not root */ &&
1158 ! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
1158 ! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
11591159 dnssec_ok_checking_disabled, node, &dnsreq, NULL, val_chain_node_cb))
11601160
11611161 node->ds_req = dnsreq->netreqs[0];
11911191 DEBUG_SEC("schedule DS lookup for %s\n", name);
11921192
11931193 if (! node->ds_req && node->parent /* not root */ &&
1194 ! priv_getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
1194 ! _getdns_general_loop(context, loop, name, GETDNS_RRTYPE_DS,
11951195 dnssec_ok_checking_disabled, node, &ds_req, NULL, val_chain_node_cb))
11961196
11971197 node->ds_req = ds_req->netreqs[0];
12131213
12141214 static void val_chain_sched_signer_node(chain_node *node, rrsig_iter *rrsig)
12151215 {
1216 priv_getdns_rdf_iter rdf_spc, *rdf;
1216 _getdns_rdf_iter rdf_spc, *rdf;
12171217 uint8_t signer_spc[256], *signer;
12181218 size_t signer_len;
12191219
1220 if (!(rdf = priv_getdns_rdf_iter_init_at(&rdf_spc, &rrsig->rr_i, 7)))
1220 if (!(rdf = _getdns_rdf_iter_init_at(&rdf_spc, &rrsig->rr_i, 7)))
12211221 return;
12221222
1223 if (!(signer = priv_getdns_rdf_if_or_as_decompressed(
1223 if (!(signer = _getdns_rdf_if_or_as_decompressed(
12241224 rdf, signer_spc, &signer_len)))
12251225 return;
12261226
12461246 getdns_rrset *rrset;
12471247 rrsig_iter *rrsig, rrsig_spc;
12481248
1249 getdns_context_clear_outbound_request(dnsreq);
1249 _getdns_context_clear_outbound_request(dnsreq);
12501250 switch (netreq->request_type) {
12511251 case GETDNS_RRTYPE_DS : node->ds.pkt = netreq->response;
12521252 node->ds.pkt_len = netreq->response_len;
12831283 rrset_iter i_spc;
12841284 getdns_rrset *rrset;
12851285
1286 getdns_context_clear_outbound_request(dnsreq);
1286 _getdns_context_clear_outbound_request(dnsreq);
12871287
12881288 if ((rrset = rrset_by_type(&i_spc, netreq, GETDNS_RRTYPE_SOA))) {
12891289
13131313 rrtype_iter rr_spc, *rr;
13141314 rrsig_iter rrsig_spc, *rrsig;
13151315 uint16_t keytag;
1316 priv_getdns_rdf_iter rdf_spc, *rdf;
1316 _getdns_rdf_iter rdf_spc, *rdf;
13171317 uint8_t signer_spc[256], *signer;
13181318 size_t signer_len = sizeof(signer_spc);
13191319
13461346 == keytag
13471347
13481348 /* Does the signer name match? */
1349 && (rdf = priv_getdns_rdf_iter_init_at(
1349 && (rdf = _getdns_rdf_iter_init_at(
13501350 &rdf_spc, &rrsig->rr_i, 7))
13511351
1352 && (signer = priv_getdns_rdf_if_or_as_decompressed(
1352 && (signer = _getdns_rdf_if_or_as_decompressed(
13531353 rdf, signer_spc, &signer_len))
13541354
13551355 && _dname_equal(dnskey->name, signer))
13601360 return 0;
13611361 }
13621362
1363 static ldns_rr *rr2ldns_rr(priv_getdns_rr_iter *rr)
1363 static ldns_rr *rr2ldns_rr(_getdns_rr_iter *rr)
13641364 {
13651365 ldns_rr *rr_l;
13661366 size_t pos = rr->pos - rr->pkt;
13671367
13681368 if (ldns_wire2rr(&rr_l, rr->pkt, rr->pkt_end - rr->pkt, &pos,
1369 (ldns_pkt_section)priv_getdns_rr_iter_section(rr)))
1369 (ldns_pkt_section)_getdns_rr_iter_section(rr)))
13701370 return NULL;
13711371 else
13721372 return rr_l;
14451445 static uint8_t *_getdns_nsec3_hash_label(uint8_t *label, size_t label_len,
14461446 uint8_t *name, uint8_t algorithm, uint16_t iterations, uint8_t *salt)
14471447 {
1448 ldns_rdf name_l = { _dname_len(name), LDNS_RDF_TYPE_DNAME, name };
1449 ldns_rdf *hname_l;
1450
1451 if (!(hname_l = ldns_nsec3_hash_name(
1452 &name_l, algorithm, iterations, *salt, salt + 1)))
1448 uint8_t buf[512], *dst, *eob;
1449 const uint8_t *src;
1450 uint8_t md[SHA_DIGEST_LENGTH + 256];
1451
1452 assert(SHA_DIGEST_LENGTH + 256 < sizeof(buf));
1453
1454 if (algorithm != GLDNS_SHA1)
14531455 return NULL;
14541456
1455 if ( label_len < hname_l->_size-1
1456 || label_len < *((uint8_t *)hname_l->_data) + 1
1457 || hname_l->_size-1 < *((uint8_t *)hname_l->_data) + 1) {
1458 ldns_rdf_deep_free(hname_l);
1457 for ( src = name, dst = buf, eob = buf + sizeof(buf)
1458 ; *src && dst + *src < eob
1459 ; src += *src + 1, dst += *dst + 1 )
1460 _dname_label_copy(dst, src, eob - dst);
1461
1462 if (*src || dst + *salt >= eob)
14591463 return NULL;
1460 }
1461 memcpy(label, hname_l->_data, *((uint8_t *)hname_l->_data) + 1);
1462 ldns_rdf_deep_free(hname_l);
1464 *dst++ = 0;
1465 (void)memcpy(dst, salt + 1, *salt);
1466 dst += *salt;
1467
1468 (void)SHA1(buf, dst - buf, md);
1469 if (iterations) {
1470 (void)memcpy(buf + SHA_DIGEST_LENGTH, salt + 1, *salt);
1471 while (iterations--) {
1472 (void)memcpy(buf, md, SHA_DIGEST_LENGTH);
1473 SHA1(buf, SHA_DIGEST_LENGTH + *salt, md);
1474 }
1475 }
1476 *label = gldns_b32_ntop_extended_hex(
1477 md, SHA_DIGEST_LENGTH, (char *)label + 1, label_len - 1);
1478
14631479 return label;
14641480 }
14651481
14671483 getdns_rrset *nsec3, uint8_t *name, uint8_t *label, size_t label_len)
14681484 {
14691485 rrsig_iter rrsig_spc, *rrsig;
1470 priv_getdns_rdf_iter rdf_spc, *rdf;
1486 _getdns_rdf_iter rdf_spc, *rdf;
14711487 uint8_t signer_spc[256], *signer;
14721488 size_t signer_len = sizeof(signer_spc);
14731489 rrtype_iter rr_spc, *rr;
14761492 (rrsig = rrsig_iter_init(&rrsig_spc, nsec3))
14771493
14781494 /* Access the signer name rdata field (7th) */
1479 && (rdf = priv_getdns_rdf_iter_init_at(
1495 && (rdf = _getdns_rdf_iter_init_at(
14801496 &rdf_spc, &rrsig->rr_i, 7))
14811497
14821498 /* Verify & decompress */
1483 && (signer = priv_getdns_rdf_if_or_as_decompressed(
1499 && (signer = _getdns_rdf_if_or_as_decompressed(
14841500 rdf, signer_spc, &signer_len))
14851501
14861502 /* signer of the NSEC3 is direct parent for this NSEC3? */
15471563 rrtype_iter *dnskey, getdns_rrset *rrset, uint8_t **nc_name)
15481564 {
15491565 rrsig_iter rrsig_spc, *rrsig;
1550 priv_getdns_rdf_iter rdf_spc, *rdf;
1566 _getdns_rdf_iter rdf_spc, *rdf;
15511567 uint8_t signer_spc[256], *signer;
15521568 size_t signer_len = sizeof(signer_spc);
15531569 uint16_t keytag;
15781594 && gldns_read_uint16(rrsig->rr_i.rr_type + 26) == keytag
15791595
15801596 /* Does the signer name match? */
1581 && (rdf = priv_getdns_rdf_iter_init_at(
1597 && (rdf = _getdns_rdf_iter_init_at(
15821598 &rdf_spc, &rrsig->rr_i, 7))
15831599
1584 && (signer = priv_getdns_rdf_if_or_as_decompressed(
1600 && (signer = _getdns_rdf_if_or_as_decompressed(
15851601 rdf, signer_spc, &signer_len))
15861602
15871603 && _dname_equal(dnskey->rrset->name, signer)
17891805 uint8_t next_spc[256], *next;
17901806 size_t next_len = sizeof(next_spc);
17911807 rrtype_iter rr_spc, *rr;
1792 priv_getdns_rdf_iter rdf_spc, *rdf;
1808 _getdns_rdf_iter rdf_spc, *rdf;
17931809 int nsec_cmp;
17941810 uint8_t *common1, *common2;
17951811
17961812 if (/* Get owner and next, nicely decompressed */
17971813 !(rr = rrtype_iter_init(&rr_spc, nsec))
1798 || !(rdf = priv_getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
1799 || !(owner = priv_getdns_owner_if_or_as_decompressed(
1814 || !(rdf = _getdns_rdf_iter_init(&rdf_spc, &rr->rr_i))
1815 || !(owner = _getdns_owner_if_or_as_decompressed(
18001816 &rr->rr_i, owner_spc, &owner_len))
1801 || !(next = priv_getdns_rdf_if_or_as_decompressed(
1817 || !(next = _getdns_rdf_if_or_as_decompressed(
18021818 rdf, next_spc, &next_len)))
18031819 return 0;
18041820
18571873 {
18581874 uint8_t label[65], next[65], owner[65];
18591875 rrtype_iter rr_spc, *rr;
1860 priv_getdns_rdf_iter rdf_spc, *rdf;
1876 _getdns_rdf_iter rdf_spc, *rdf;
18611877 int nsz = 0, nsec_cmp;
18621878
18631879 if (!name2nsec3_label(nsec3, name, label, sizeof(label)-1))
18661882 label[label[0]+1] = 0;
18671883
18681884 if ( !(rr = rrtype_iter_init(&rr_spc, nsec3))
1869 || !(rdf = priv_getdns_rdf_iter_init_at(&rdf_spc, &rr->rr_i, 4))
1885 || !(rdf = _getdns_rdf_iter_init_at(&rdf_spc, &rr->rr_i, 4))
18701886 || rdf->pos + *rdf->pos + 1 > rdf->nxt
18711887 || (nsz = gldns_b32_ntop_extended_hex(rdf->pos + 1, *rdf->pos,
18721888 (char *)next + 1, sizeof(next)-2)) < 0
19091925 rrset_iter i_spc, *i;
19101926 getdns_rrset *n;
19111927 rrtype_iter nsec_spc, *nsec_rr;
1912 priv_getdns_rdf_iter bitmap_spc, *bitmap;
1928 _getdns_rdf_iter bitmap_spc, *bitmap;
19131929 int keytag;
19141930
19151931 if (opt_out)
19221938
19231939 /* Get the bitmap rdata field */
19241940 && (nsec_rr = rrtype_iter_init(&nsec_spc, n))
1925 && (bitmap = priv_getdns_rdf_iter_init_at(
1941 && (bitmap = _getdns_rdf_iter_init_at(
19261942 &bitmap_spc, &nsec_rr->rr_i, 5))
19271943
19281944 && (keytag = a_key_signed_rrset(dnskey, n))
19591975
19601976 /* Get the bitmap rdata field */
19611977 && (nsec_rr = rrtype_iter_init(&nsec_spc, n))
1962 && (bitmap = priv_getdns_rdf_iter_init_at(
1978 && (bitmap = _getdns_rdf_iter_init_at(
19631979 &bitmap_spc, &nsec_rr->rr_i, 1))
19641980
19651981 /* NSEC should cover, but not match name...
20532069 {
20542070 getdns_rrset nsec_rrset, *cover, *ce;
20552071 rrtype_iter nsec_spc, *nsec_rr;
2056 priv_getdns_rdf_iter bitmap_spc, *bitmap;
2072 _getdns_rdf_iter bitmap_spc, *bitmap;
20572073 rrset_iter i_spc, *i;
20582074 uint8_t *ce_name, *nc_name;
20592075 uint8_t wc_name[256] = { 1, (uint8_t)'*' };
20762092 (nsec_rr = rrtype_iter_init(&nsec_spc, &nsec_rrset))
20772093
20782094 /* Get the bitmap rdata field */
2079 && (bitmap = priv_getdns_rdf_iter_init_at(
2095 && (bitmap = _getdns_rdf_iter_init_at(
20802096 &bitmap_spc, &nsec_rr->rr_i, 1))
20812097
20822098 /* At least the rr_type of rrset should be missing from it */
21462162
21472163 /* Get the bitmap rdata field */
21482164 || !(nsec_rr = rrtype_iter_init(&nsec_spc, cover))
2149 || !(bitmap = priv_getdns_rdf_iter_init_at(
2165 || !(bitmap = _getdns_rdf_iter_init_at(
21502166 &bitmap_spc, &nsec_rr->rr_i, 1))
21512167
21522168 /* When qname is a subdomain of the NSEC owner, make
22132229 && (nsec_rr = rrtype_iter_init(&nsec_spc, ce))
22142230
22152231 /* Get the bitmap rdata field */
2216 && (bitmap = priv_getdns_rdf_iter_init_at(
2232 && (bitmap = _getdns_rdf_iter_init_at(
22172233 &bitmap_spc, &nsec_rr->rr_i, 5))
22182234
22192235 /* At least the rr_type of rrset should be missing */
22782294
22792295 /* Get the bitmap rdata field */
22802296 || !(nsec_rr = rrtype_iter_init(&nsec_spc, ce))
2281 || !(bitmap = priv_getdns_rdf_iter_init_at(
2297 || !(bitmap = _getdns_rdf_iter_init_at(
22822298 &bitmap_spc, &nsec_rr->rr_i, 1))
22832299
22842300 /* No DNAME or delegation point at the closest
26602676 for ( rr = rrtype_iter_init(&rr_spc, rrset)
26612677 ; rr; rr = rrtype_iter_next(rr)) {
26622678
2663 if (!(rr_dict = priv_getdns_rr_iter2rr_dict(
2679 if (!(rr_dict = _getdns_rr_iter2rr_dict(
26642680 &ctxt->mf, &rr->rr_i)))
26652681 continue;
26662682
2667 (void)getdns_list_append_dict(val_chain_list, rr_dict);
2683 (void)_getdns_list_append_dict(val_chain_list, rr_dict);
26682684 getdns_dict_destroy(rr_dict);
26692685 }
26702686 for ( rrsig = rrsig_iter_init(&rrsig_spc, rrset)
26792695 != (signer & 0xFFFF))
26802696
26812697 /* Could not convert to rr_dict */
2682 || !(rr_dict = priv_getdns_rr_iter2rr_dict(
2698 || !(rr_dict = _getdns_rr_iter2rr_dict(
26832699 &ctxt->mf, &rrsig->rr_i)))
26842700 continue;
26852701
2686 (void)getdns_list_append_dict(val_chain_list, rr_dict);
2702 (void)_getdns_list_append_dict(val_chain_list, rr_dict);
26872703 getdns_dict_destroy(rr_dict);
26882704 }
26892705 }
27152731 (void) getdns_dict_set_bindata(rdata_dict, "rdata_raw", &bindata);
27162732 getdns_dict_destroy(rdata_dict);
27172733
2718 (void)getdns_list_append_dict(val_chain_list, rr_dict);
2734 (void)_getdns_list_append_dict(val_chain_list, rr_dict);
27192735 getdns_dict_destroy(rr_dict);
27202736 }
27212737
27722788 append_rrs2val_chain_list(
27732789 context, val_chain_list,
27742790 node->dnskey_req, node->dnskey_signer);
2775 dns_req_free(node->dnskey_req->owner);
2791 _getdns_dns_req_free(node->dnskey_req->owner);
27762792 }
27772793 if (node->ds_req) {
27782794 append_rrs2val_chain_list(
27892805 context, val_chain_list,
27902806 &node->ds);
27912807 }
2792 dns_req_free(node->ds_req->owner);
2808 _getdns_dns_req_free(node->ds_req->owner);
27932809 }
27942810 if (node->soa_req) {
2795 dns_req_free(node->soa_req->owner);
2811 _getdns_dns_req_free(node->soa_req->owner);
27962812 }
27972813 }
27982814 GETDNS_FREE(head->my_mf, head);
27992815 }
28002816
2801 response_dict = create_getdns_response(dnsreq);
2817 response_dict = _getdns_create_getdns_response(dnsreq);
28022818 if (val_chain_list) {
28032819 (void) getdns_dict_set_list(
28042820 response_dict, "validation_chain", val_chain_list);
28062822 }
28072823
28082824 /* Final user callback */
2809 priv_getdns_call_user_callback(dnsreq, response_dict);
2810 }
2811
2812
2813 void priv_getdns_get_validation_chain(getdns_dns_req *dnsreq)
2825 _getdns_call_user_callback(dnsreq, response_dict);
2826 }
2827
2828
2829 void _getdns_get_validation_chain(getdns_dns_req *dnsreq)
28142830 {
28152831 getdns_network_req *netreq, **netreq_p;
28162832 chain_head *chain = NULL;
28412857 if (chain)
28422858 check_chain_complete(chain);
28432859 else
2844 priv_getdns_call_user_callback(dnsreq,
2845 create_getdns_response(dnsreq));
2860 _getdns_call_user_callback(dnsreq,
2861 _getdns_create_getdns_response(dnsreq));
28462862 }
28472863
28482864
28612877 size_t qname_len = sizeof(qname_spc);
28622878 uint16_t qtype = 0, qclass = GETDNS_RRCLASS_IN;
28632879
2864 priv_getdns_rr_iter rr_spc, *rr;
2880 _getdns_rr_iter rr_spc, *rr;
28652881 rrset_iter tas_iter;
28662882
28672883 int s;
28912907
28922908 /* For each question in the question section add a chain head.
28932909 */
2894 if ( (rr = priv_getdns_rr_iter_init(&rr_spc, to_val, to_val_len))
2895 && priv_getdns_rr_iter_section(rr) == GLDNS_SECTION_QUESTION
2896 && (qname = priv_getdns_owner_if_or_as_decompressed(
2910 if ( (rr = _getdns_rr_iter_init(&rr_spc, to_val, to_val_len))
2911 && _getdns_rr_iter_section(rr) == GLDNS_SECTION_QUESTION
2912 && (qname = _getdns_owner_if_or_as_decompressed(
28972913 rr, qname_spc, &qname_len))
28982914 && rr->nxt >= rr->rr_type + 4) {
28992915
11 *
22 * /brief functions for DNSSEC
33 *
4 * The priv_getdns_get_validation_chain function is called after an answer
4 * The _getdns_get_validation_chain function is called after an answer
55 * has been fetched when the dnssec_return_validation_chain extension is set.
66 * It fetches DNSKEYs, DSes and their signatures for all RRSIGs found in the
77 * answer.
4343 #include "types-internal.h"
4444
4545 /* Do some additional requests to fetch the complete validation chain */
46 void priv_getdns_get_validation_chain(getdns_dns_req *dns_req);
46 void _getdns_get_validation_chain(getdns_dns_req *dns_req);
4747
4848 uint16_t _getdns_parse_ta_file(time_t *ta_mtime, gldns_buffer *gbuf);
4949
3939 #endif
4040
4141 static void
42 getdns_mini_event_cleanup(getdns_eventloop *loop)
43 {
44 getdns_mini_event *ext = (getdns_mini_event *)loop;
45 getdns_event_base_free(ext->base);
42 _getdns_mini_event_cleanup(getdns_eventloop *loop)
43 {
44 _getdns_mini_event *ext = (_getdns_mini_event *)loop;
45 _getdns_event_base_free(ext->base);
4646 }
4747
4848 void
49 getdns_mini_event_destroy(getdns_mini_event *ext)
49 _getdns_mini_event_destroy(_getdns_mini_event *ext)
5050 {
5151 assert(ext);
5252 ext->loop.vmt->cleanup(&ext->loop);
5353 GETDNS_FREE(ext->mf, ext);
5454 }
5555
56 void getdns_handle_timeouts(struct getdns_event_base* base,
56 void _getdns_handle_timeouts(struct _getdns_event_base* base,
5757 struct timeval* now, struct timeval* wait);
58 int getdns_handle_select(struct getdns_event_base* base, struct timeval* wait);
58 int _getdns_handle_select(struct _getdns_event_base* base, struct timeval* wait);
5959
6060 static int
61 getdns_mini_event_settime(getdns_mini_event *ext)
61 _getdns_mini_event_settime(_getdns_mini_event *ext)
6262 {
6363 if (gettimeofday(&ext->time_tv, NULL) < 0)
6464 return -1;
6767 }
6868
6969 static void
70 getdns_mini_event_run(getdns_eventloop *loop)
71 {
72 getdns_mini_event *ext = (getdns_mini_event *)loop;
70 _getdns_mini_event_run(getdns_eventloop *loop)
71 {
72 _getdns_mini_event *ext = (_getdns_mini_event *)loop;
7373 struct timeval wait;
7474
75 if (ext->n_events == 0 || getdns_mini_event_settime(ext) < 0)
75 if (ext->n_events == 0 || _getdns_mini_event_settime(ext) < 0)
7676 return;
7777
7878 do {
79 (void) getdns_handle_timeouts(ext->base, &ext->time_tv, &wait);
79 (void) _getdns_handle_timeouts(ext->base, &ext->time_tv, &wait);
8080
8181 if (!ext->n_events)
8282 break;
8383
84 if (getdns_handle_select(ext->base, &wait))
84 if (_getdns_handle_select(ext->base, &wait))
8585 break;
8686
8787 } while (ext->n_events);
8888 }
8989
9090 static void
91 getdns_mini_event_run_once(getdns_eventloop *loop, int blocking)
91 _getdns_mini_event_run_once(getdns_eventloop *loop, int blocking)
9292 {
9393 static struct timeval immediately = { 0, 0 };
94 getdns_mini_event *ext = (getdns_mini_event *)loop;
94 _getdns_mini_event *ext = (_getdns_mini_event *)loop;
9595 struct timeval wait;
9696
9797 if (blocking) {
98 if (getdns_mini_event_settime(ext) < 0)
98 if (_getdns_mini_event_settime(ext) < 0)
9999 return;
100 getdns_handle_timeouts(ext->base, &ext->time_tv, &wait);
101 if (getdns_handle_select(ext->base, &wait) < 0)
100 _getdns_handle_timeouts(ext->base, &ext->time_tv, &wait);
101 if (_getdns_handle_select(ext->base, &wait) < 0)
102102 return;
103103
104 } else if (getdns_handle_select(ext->base, &immediately) < 0)
104 } else if (_getdns_handle_select(ext->base, &immediately) < 0)
105105 return;
106106
107 getdns_handle_timeouts(ext->base, &ext->time_tv, &wait);
107 _getdns_handle_timeouts(ext->base, &ext->time_tv, &wait);
108108 }
109109
110110 static getdns_return_t
111 getdns_mini_event_clear(getdns_eventloop *loop, getdns_eventloop_event *el_ev)
111 _getdns_mini_event_clear(getdns_eventloop *loop, getdns_eventloop_event *el_ev)
112112 {
113113 getdns_return_t r = GETDNS_RETURN_GOOD;
114 getdns_mini_event *ext = (getdns_mini_event *)loop;
114 _getdns_mini_event *ext = (_getdns_mini_event *)loop;
115115
116116 assert(el_ev->ev);
117 DEBUG_SCHED("1. getdns_mini_event_clear(loop: %p, el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d, times: %d\n", loop, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events, (int)ext->base->times->count);
118
119 if (getdns_event_del(el_ev->ev) != 0)
117 DEBUG_SCHED("1. _getdns_mini_event_clear(loop: %p, el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d, times: %d\n", loop, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events, (int)ext->base->times->count);
118
119 if (_getdns_event_del(el_ev->ev) != 0)
120120 r = GETDNS_RETURN_GENERIC_ERROR;
121121
122122 GETDNS_FREE(ext->mf, el_ev->ev);
123123 el_ev->ev = NULL;
124124
125125 ext->n_events--;
126 DEBUG_SCHED("2. %d <- getdns_mini_event_clear(loop: %p, el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d, times: %d\n", r, loop, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events, (int)ext->base->times->count);
126 DEBUG_SCHED("2. %d <- _getdns_mini_event_clear(loop: %p, el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d, times: %d\n", r, loop, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events, (int)ext->base->times->count);
127127
128128 return r;
129129 }
130130
131131 static void
132 getdns_mini_event_callback(int fd, short bits, void *arg)
132 _getdns_mini_event_callback(int fd, short bits, void *arg)
133133 {
134134 getdns_eventloop_event *el_ev = (getdns_eventloop_event *)arg;
135 DEBUG_SCHED("1. getdns_mini_event_callback(fd: %d, bits: %d, el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p])\n", fd, (int)bits, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev);
135 DEBUG_SCHED("1. _getdns_mini_event_callback(fd: %d, bits: %d, el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p])\n", fd, (int)bits, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev);
136136 if (bits & EV_READ) {
137137 assert(el_ev->read_cb);
138138 el_ev->read_cb(el_ev->userarg);
147147 }
148148
149149 static getdns_return_t
150 getdns_mini_event_schedule(getdns_eventloop *loop,
150 _getdns_mini_event_schedule(getdns_eventloop *loop,
151151 int fd, uint64_t timeout, getdns_eventloop_event *el_ev)
152152 {
153 getdns_mini_event *ext = (getdns_mini_event *)loop;
154 struct getdns_event *my_ev;
153 _getdns_mini_event *ext = (_getdns_mini_event *)loop;
154 struct _getdns_event *my_ev;
155155 struct timeval tv = { timeout / 1000, (timeout % 1000) * 1000 };
156156
157157 assert(el_ev);
158158 assert(!(el_ev->read_cb || el_ev->write_cb) || fd >= 0);
159159 assert( el_ev->read_cb || el_ev->write_cb || el_ev->timeout_cb);
160160
161 if (!(my_ev = GETDNS_MALLOC(ext->mf, struct getdns_event)))
161 if (!(my_ev = GETDNS_MALLOC(ext->mf, struct _getdns_event)))
162162 return GETDNS_RETURN_MEMORY_ERROR;
163163
164164 el_ev->ev = my_ev;
165 DEBUG_SCHED("1. getdns_mini_event_schedule(loop: %p, fd: %d, timeout: %"PRId64", el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d\n", loop, fd, timeout, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events);
166 getdns_event_set(my_ev, fd, (
165 DEBUG_SCHED("1. _getdns_mini_event_schedule(loop: %p, fd: %d, timeout: %"PRId64", el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d\n", loop, fd, timeout, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events);
166 _getdns_event_set(my_ev, fd, (
167167 (el_ev->read_cb ? EV_READ|EV_PERSIST : 0) |
168168 (el_ev->write_cb ? EV_WRITE|EV_PERSIST : 0) |
169169 (el_ev->timeout_cb ? EV_TIMEOUT : 0)),
170 getdns_mini_event_callback, el_ev);
171
172 if (getdns_mini_event_settime(ext))
170 _getdns_mini_event_callback, el_ev);
171
172 if (_getdns_mini_event_settime(ext))
173173 goto error;
174174
175 (void) getdns_event_base_set(ext->base, my_ev);
176 if (getdns_event_add(my_ev, el_ev->timeout_cb ? &tv : NULL))
175 (void) _getdns_event_base_set(ext->base, my_ev);
176 if (_getdns_event_add(my_ev, el_ev->timeout_cb ? &tv : NULL))
177177 goto error;
178178
179179 ext->n_events++;
180 DEBUG_SCHED("2. getdns_mini_event_schedule(loop: %p, fd: %d, timeout: %"PRId64", el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d\n", loop, fd, timeout, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events);
180 DEBUG_SCHED("2. _getdns_mini_event_schedule(loop: %p, fd: %d, timeout: %"PRId64", el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d\n", loop, fd, timeout, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events);
181181
182182 return GETDNS_RETURN_GOOD;
183183 error:
184184 GETDNS_FREE(ext->mf, my_ev);
185185 el_ev->ev = NULL;
186186
187 DEBUG_SCHED("3. getdns_mini_event_schedule(loop: %p, fd: %d, timeout: %"PRId64", el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d\n", loop, fd, timeout, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events);
187 DEBUG_SCHED("3. _getdns_mini_event_schedule(loop: %p, fd: %d, timeout: %"PRId64", el_ev: %p[userarg: %p, r: %p, w: %p, t: %p, ev: %p]); n_events: %d\n", loop, fd, timeout, el_ev, el_ev->userarg, el_ev->read_cb, el_ev->write_cb, el_ev->timeout_cb, el_ev->ev, (int)ext->n_events);
188188 return GETDNS_RETURN_GENERIC_ERROR;
189189 }
190190
191191 getdns_return_t
192 getdns_mini_event_init(getdns_context *context, getdns_mini_event *ext)
193 {
194 static getdns_eventloop_vmt getdns_mini_event_vmt = {
195 getdns_mini_event_cleanup,
196 getdns_mini_event_schedule,
197 getdns_mini_event_clear,
198 getdns_mini_event_run,
199 getdns_mini_event_run_once
192 _getdns_mini_event_init(getdns_context *context, _getdns_mini_event *ext)
193 {
194 static getdns_eventloop_vmt _getdns_mini_event_vmt = {
195 _getdns_mini_event_cleanup,
196 _getdns_mini_event_schedule,
197 _getdns_mini_event_clear,
198 _getdns_mini_event_run,
199 _getdns_mini_event_run_once
200200 };
201201
202202 if (!context)
205205 return GETDNS_RETURN_INVALID_PARAMETER;
206206
207207 ext->n_events = 0;
208 ext->loop.vmt = &getdns_mini_event_vmt;
209 ext->base = getdns_event_init(&ext->time_secs, &ext->time_tv);
208 ext->loop.vmt = &_getdns_mini_event_vmt;
209 ext->base = _getdns_event_init(&ext->time_secs, &ext->time_tv);
210210 if (!ext->base)
211211 return GETDNS_RETURN_MEMORY_ERROR;
212212
215215 }
216216
217217 getdns_return_t
218 getdns_mini_event_create(getdns_context *context, getdns_mini_event **ext)
218 _getdns_mini_event_create(getdns_context *context, _getdns_mini_event **ext)
219219 {
220220 if (!context) return GETDNS_RETURN_BAD_CONTEXT;
221221 if (!ext) return GETDNS_RETURN_INVALID_PARAMETER;
222222
223 *ext = GETDNS_MALLOC(context->mf, getdns_mini_event);
224 return getdns_mini_event_init(context, *ext);
225 }
223 *ext = GETDNS_MALLOC(context->mf, _getdns_mini_event);
224 return _getdns_mini_event_init(context, *ext);
225 }
3737 #include "util/mini_event.h"
3838 #include "types-internal.h"
3939
40 typedef struct getdns_mini_event {
41 getdns_eventloop loop;
42 time_t time_secs;
43 struct timeval time_tv;
44 struct getdns_event_base *base;
45 size_t n_events;
46 struct mem_funcs mf;
47 } getdns_mini_event;
40 typedef struct _getdns_mini_event {
41 getdns_eventloop loop;
42 time_t time_secs;
43 struct timeval time_tv;
44 struct _getdns_event_base *base;
45 size_t n_events;
46 struct mem_funcs mf;
47 } _getdns_mini_event;
4848
4949 getdns_return_t
50 getdns_mini_event_init(getdns_context *context, getdns_mini_event *mini_event);
50 _getdns_mini_event_init(getdns_context *context, _getdns_mini_event *mini_event);
5151
5252 getdns_return_t
53 getdns_mini_event_create(getdns_context *ctxt, getdns_mini_event **mini_event);
53 _getdns_mini_event_create(getdns_context *ctxt, _getdns_mini_event **mini_event);
5454
5555 void
56 getdns_mini_event_destroy(getdns_mini_event *mini_event);
56 _getdns_mini_event_destroy(_getdns_mini_event *mini_event);
5757
5858 #endif /* _GETDNS_LIBMINI_EVENT_H_ */
3636
3737 #include <stdio.h>
3838 #include <string.h>
39 #include <unbound.h>
4039 #include "config.h"
4140 #include "gldns/wire2str.h"
4241 #include "context.h"
5049 ub_resolve_timeout(void *arg)
5150 {
5251 getdns_dns_req *dns_req = (getdns_dns_req *) arg;
53 (void) getdns_context_request_timed_out(dns_req);
52 (void) _getdns_context_request_timed_out(dns_req);
5453 }
5554
56 void priv_getdns_call_user_callback(getdns_dns_req *dns_req,
55 void _getdns_call_user_callback(getdns_dns_req *dns_req,
5756 struct getdns_dict *response)
5857 {
5958 struct getdns_context *context = dns_req->context;
6261 void *user_arg = dns_req->user_pointer;
6362
6463 /* clean up */
65 getdns_context_clear_outbound_request(dns_req);
66 dns_req_free(dns_req);
64 _getdns_context_clear_outbound_request(dns_req);
65 _getdns_dns_req_free(dns_req);
6766
6867 cb(context,
6968 (response ? GETDNS_CALLBACK_COMPLETE : GETDNS_CALLBACK_ERROR),
7069 response, user_arg, trans_id);
7170 }
7271
73 /* cleanup and send an error to the user callback */
74 static void
75 handle_network_request_error(getdns_network_req * netreq, int err)
76 {
77 priv_getdns_call_user_callback(netreq->owner, NULL);
78 }
79
8072 void
81 priv_getdns_check_dns_req_complete(getdns_dns_req *dns_req)
73 _getdns_check_dns_req_complete(getdns_dns_req *dns_req)
8274 {
8375 getdns_network_req **netreq_p, *netreq;
8476 int results_found = 0;
9385 if (dns_req->internal_cb)
9486 dns_req->internal_cb(dns_req);
9587 else if (! results_found)
96 priv_getdns_call_user_callback(dns_req, NULL);
88 _getdns_call_user_callback(dns_req, NULL);
9789 else if (dns_req->dnssec_return_validation_chain
9890 #ifdef STUB_NATIVE_DNSSEC
9991 || (dns_req->context->resolution_type == GETDNS_RESOLUTION_STUB
10193 dns_req->dnssec_return_only_secure))
10294 #endif
10395 )
104 priv_getdns_get_validation_chain(dns_req);
96 _getdns_get_validation_chain(dns_req);
10597 else
106 priv_getdns_call_user_callback(
107 dns_req, create_getdns_response(dns_req));
98 _getdns_call_user_callback(
99 dns_req, _getdns_create_getdns_response(dns_req));
108100 }
109101
102 #ifdef HAVE_LIBUNBOUND
110103 static void
111104 ub_resolve_callback(void* arg, int err, struct ub_result* ub_res)
112105 {
115108
116109 netreq->state = NET_REQ_FINISHED;
117110 if (err != 0) {
118 handle_network_request_error(netreq, err);
111 _getdns_call_user_callback(dns_req, NULL);
119112 return;
120113 }
121114 /* parse */
122115 if (getdns_apply_network_result(netreq, ub_res)) {
123116 ub_resolve_free(ub_res);
124 handle_network_request_error(netreq, err);
117 _getdns_call_user_callback(dns_req, NULL);
125118 return;
126119 }
127120 ub_resolve_free(ub_res);
128121
129 priv_getdns_check_dns_req_complete(dns_req);
122 _getdns_check_dns_req_complete(dns_req);
130123
131124 } /* ub_resolve_callback */
125 #endif
132126
133127
134128 static getdns_return_t
163157 (void) gldns_wire2str_dname_buf(dns_req->name,
164158 dns_req->name_len, name, sizeof(name));
165159
160 #ifdef HAVE_LIBUNBOUND
166161 return ub_resolve_async(dns_req->context->unbound_ctx,
167162 name, netreq->request_type, netreq->request_class,
168163 netreq, ub_resolve_callback, &(netreq->unbound_id)) ?
169164 GETDNS_RETURN_GENERIC_ERROR : GETDNS_RETURN_GOOD;
165 #else
166 return GETDNS_RETURN_GENERIC_ERROR;
167 #endif
170168 }
171169 /* Submit with stub resolver */
172 return priv_getdns_submit_stub_request(netreq);
170 return _getdns_submit_stub_request(netreq);
173171 }
174172
175173 static getdns_return_t
187185 if (!context || !name || (!callbackfn && !internal_cb))
188186 return GETDNS_RETURN_INVALID_PARAMETER;
189187
190 if ((r = priv_getdns_validate_dname(name)))
191 return r;
192
193 if (extensions && (r = priv_getdns_validate_extensions(extensions)))
188 if ((r = _getdns_validate_dname(name)))
189 return r;
190
191 if (extensions && (r = _getdns_validate_extensions(extensions)))
194192 return r;
195193
196194 /* Set up the context assuming we won't use the specified namespaces.
197195 This is (currently) identical to setting up a pure DNS namespace */
198 if ((r = getdns_context_prepare_for_resolution(context, 0)))
196 if ((r = _getdns_context_prepare_for_resolution(context, 0)))
199197 return r;
200198
201199 /* create the request */
202 if (!(req = dns_req_new(context, loop, name, request_type, extensions)))
200 if (!(req = _getdns_dns_req_new(context, loop, name, request_type, extensions)))
203201 return GETDNS_RETURN_MEMORY_ERROR;
204202
205203 req->user_pointer = userarg;
209207 if (dnsreq_p)
210208 *dnsreq_p = req;
211209
212 getdns_context_track_outbound_request(req);
210 _getdns_context_track_outbound_request(req);
213211
214212 if (!usenamespaces)
215213 /* issue all network requests */
221219 else for (i = 0; i < context->namespace_count; i++) {
222220 if (context->namespaces[i] == GETDNS_NAMESPACE_LOCALNAMES) {
223221
224 if (!(r = getdns_context_local_namespace_resolve(
222 if (!(r = _getdns_context_local_namespace_resolve(
225223 req, &localnames_response))) {
226224
227 priv_getdns_call_user_callback
225 _getdns_call_user_callback
228226 ( req, localnames_response);
229227 break;
230228 }
246244
247245 if (r != 0) {
248246 /* clean up the request */
249 getdns_context_clear_outbound_request(req);
250 dns_req_free(req);
247 _getdns_context_clear_outbound_request(req);
248 _getdns_dns_req_free(req);
251249 return r;
252250 }
253251 return GETDNS_RETURN_GOOD;
254252 } /* getdns_general_ns */
255253
256254 getdns_return_t
257 priv_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
255 _getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
258256 const char *name, uint16_t request_type, getdns_dict *extensions,
259257 void *userarg, getdns_dns_req **dnsreq_p,
260258 getdns_callback_t callback, internal_cb_t internal_cb)
266264 } /* getdns_general_loop */
267265
268266 getdns_return_t
269 priv_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
267 _getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
270268 const char *name, getdns_dict *extensions, void *userarg,
271269 getdns_transaction_t *transaction_id, getdns_callback_t callback)
272270 {
280278 return GETDNS_RETURN_MEMORY_ERROR;
281279 } else if (
282280 getdns_dict_get_int(my_extensions, "return_both_v4_and_v6", &value)
283 && (r = getdns_dict_copy(extensions, &my_extensions)))
281 && (r = _getdns_dict_copy(extensions, &my_extensions)))
284282 return r;
285283
286284 if (my_extensions != extensions && (r = getdns_dict_set_int(
300298 } /* getdns_address_loop */
301299
302300 getdns_return_t
303 priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
301 _getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
304302 getdns_dict *address, getdns_dict *extensions, void *userarg,
305303 getdns_transaction_t *transaction_id, getdns_callback_t callback)
306304 {
382380 default:
383381 return GETDNS_RETURN_INVALID_PARAMETER;
384382 }
385 retval = priv_getdns_general_loop(context, loop, name, req_type,
383 retval = _getdns_general_loop(context, loop, name, req_type,
386384 extensions, userarg, &dnsreq, callback, NULL);
387385 if (dnsreq && transaction_id)
388386 *transaction_id = dnsreq->trans_id;
390388 } /* getdns_hostname_loop */
391389
392390 getdns_return_t
393 priv_getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
391 _getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
394392 const char *name, getdns_dict *extensions, void *userarg,
395393 getdns_transaction_t * transaction_id, getdns_callback_t callback)
396394 {
416414 getdns_dns_req *dnsreq = NULL;
417415
418416 if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
419 r = priv_getdns_general_loop(context, context->extension,
417 r = _getdns_general_loop(context, context->extension,
420418 name, request_type, extensions,
421419 userarg, &dnsreq, callback, NULL);
422420 if (dnsreq && transaction_id)
434432 getdns_transaction_t *transaction_id, getdns_callback_t callback)
435433 {
436434 if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
437 return priv_getdns_address_loop(context, context->extension,
435 return _getdns_address_loop(context, context->extension,
438436 name, extensions, userarg,
439437 transaction_id, callback);
440438 } /* getdns_address */
449447 getdns_transaction_t *transaction_id, getdns_callback_t callback)
450448 {
451449 if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
452 return priv_getdns_hostname_loop(context, context->extension,
450 return _getdns_hostname_loop(context, context->extension,
453451 address, extensions, userarg, transaction_id, callback);
454452 } /* getdns_hostname */
455453
463461 getdns_transaction_t *transaction_id, getdns_callback_t callback)
464462 {
465463 if (!context) return GETDNS_RETURN_INVALID_PARAMETER;
466 return priv_getdns_service_loop(context, context->extension,
464 return _getdns_service_loop(context, context->extension,
467465 name, extensions, userarg, transaction_id, callback);
468466 } /* getdns_service */
469467
4141
4242 /* private inner helper used by sync and async */
4343
44 void priv_getdns_call_user_callback(getdns_dns_req *, getdns_dict *);
45 void priv_getdns_check_dns_req_complete(getdns_dns_req *dns_req);
44 void _getdns_call_user_callback(getdns_dns_req *, getdns_dict *);
45 void _getdns_check_dns_req_complete(getdns_dns_req *dns_req);
4646
4747 getdns_return_t
48 priv_getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
48 _getdns_general_loop(getdns_context *context, getdns_eventloop *loop,
4949 const char *name, uint16_t request_type, getdns_dict *extensions,
5050 void *userarg, getdns_dns_req **dnsreq,
5151 getdns_callback_t callbackfn, internal_cb_t internal_cb);
5252
5353 getdns_return_t
54 priv_getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
54 _getdns_address_loop(getdns_context *context, getdns_eventloop *loop,
5555 const char *name, getdns_dict *extensions,
5656 void *userarg, getdns_transaction_t *transaction_id,
5757 getdns_callback_t callbackfn);
5858
5959 getdns_return_t
60 priv_getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
60 _getdns_hostname_loop(getdns_context *context, getdns_eventloop *loop,
6161 getdns_dict *address, getdns_dict *extensions,
6262 void *userarg, getdns_transaction_t *transaction_id,
6363 getdns_callback_t callbackfn);
6464
6565 getdns_return_t
66 priv_getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
66 _getdns_service_loop(getdns_context *context, getdns_eventloop *loop,
6767 const char *name, getdns_dict *extensions,
6868 void *userarg, getdns_transaction_t *transaction_id,
6969 getdns_callback_t callbackfn);
338338 */
339339 getdns_return_t getdns_strerror(getdns_return_t err, char *buf, size_t buflen);
340340
341 #define GETDNS_VERSION "0.3.1"
342 #define GETDNS_NUMERIC_VERSION 0x00030000
341 #define GETDNS_VERSION "0.3.2rc1"
342 #define GETDNS_NUMERIC_VERSION 0x00030101
343343 #define GETDNS_API_VERSION "July 2015"
344344 #define GETDNS_API_NUMERIC_VERSION 0x07df0700
345345
145145 * in case of an error the list should be considered unusable
146146 * @return GETDNS_RETURN_GOOD on success, GETDNS_RETURN_GENERIC_ERROR if out of memory
147147 */
148 getdns_return_t
148 static getdns_return_t
149149 getdns_list_realloc(struct getdns_list *list)
150150 {
151151 struct getdns_list_item *newlist;
164164 return GETDNS_RETURN_GOOD;
165165 } /* getdns_list_realloc */
166166
167 /*---------------------------------------- getdns_list_copy */
168 getdns_return_t
169 getdns_list_copy(const struct getdns_list * srclist,
167 /*---------------------------------------- _getdns_list_copy */
168 getdns_return_t
169 _getdns_list_copy(const struct getdns_list * srclist,
170170 struct getdns_list ** dstlist)
171171 {
172172 int i;
190190 return GETDNS_RETURN_GENERIC_ERROR;
191191
192192 for (i = 0; i < srclist->numinuse; i++) {
193 retval = getdns_list_add_item(*dstlist, &index);
193 retval = _getdns_list_add_item(*dstlist, &index);
194194 if (retval != GETDNS_RETURN_GOOD) {
195195 getdns_list_destroy(*dstlist);
196196 *dstlist = NULL;
224224 }
225225 }
226226 return GETDNS_RETURN_GOOD;
227 } /* getdns_list_copy */
227 } /* _getdns_list_copy */
228228
229229 struct getdns_list *
230230 getdns_list_create_with_extended_memory_functions(
312312 break;
313313
314314 case t_bindata:
315 getdns_bindata_destroy(&list->mf,
315 _getdns_bindata_destroy(&list->mf,
316316 list->items[index].data.bindata);
317317 break;
318318
338338 GETDNS_FREE(list->mf, list);
339339 } /* getdns_list_destroy */
340340
341 /*---------------------------------------- getdns_list_add_item */
342 getdns_return_t
343 getdns_list_add_item(struct getdns_list *list, size_t * index)
341 /*---------------------------------------- _getdns_list_add_item */
342 getdns_return_t
343 _getdns_list_add_item(struct getdns_list *list, size_t * index)
344344 {
345345 getdns_return_t retval;
346346
357357 list->items[*index].data.n = 0;
358358 list->numinuse++;
359359 return GETDNS_RETURN_GOOD;
360 } /* getdns_list_add_item */
360 } /* _getdns_list_add_item */
361361
362362 /*---------------------------------------- getdns_list_set_dict */
363363 getdns_return_t
373373 if (index > list->numinuse)
374374 return GETDNS_RETURN_NO_SUCH_LIST_ITEM;
375375
376 retval = getdns_dict_copy(child_dict, &newdict);
376 retval = _getdns_dict_copy(child_dict, &newdict);
377377 if (retval != GETDNS_RETURN_GOOD)
378378 return retval;
379379
380380 if (index == list->numinuse) {
381 retval = getdns_list_add_item(list, &index);
381 retval = _getdns_list_add_item(list, &index);
382382 if (retval != GETDNS_RETURN_GOOD) {
383383 getdns_dict_destroy(newdict);
384384 return retval;
405405 if (index > list->numinuse)
406406 return GETDNS_RETURN_NO_SUCH_LIST_ITEM;
407407
408 retval = getdns_list_copy(child_list, &newlist);
408 retval = _getdns_list_copy(child_list, &newlist);
409409 if (retval != GETDNS_RETURN_GOOD)
410410 return retval;
411411
412412 if (index == list->numinuse) {
413 retval = getdns_list_add_item(list, &index);
413 retval = _getdns_list_add_item(list, &index);
414414 if (retval != GETDNS_RETURN_GOOD) {
415415 getdns_list_destroy(newlist);
416416 return retval;
437437 if (index > list->numinuse)
438438 return GETDNS_RETURN_NO_SUCH_LIST_ITEM;
439439
440 newbindata = getdns_bindata_copy(&list->mf, child_bindata);
440 newbindata = _getdns_bindata_copy(&list->mf, child_bindata);
441441 if (!newbindata)
442442 return GETDNS_RETURN_NO_SUCH_LIST_ITEM;
443443
444444 if (index == list->numinuse) {
445 retval = getdns_list_add_item(list, &index);
445 retval = _getdns_list_add_item(list, &index);
446446 if (retval != GETDNS_RETURN_GOOD) {
447 getdns_bindata_destroy(&list->mf, newbindata);
447 _getdns_bindata_destroy(&list->mf, newbindata);
448448 return retval;
449449 }
450450 } else
455455 return GETDNS_RETURN_GOOD;
456456 } /* getdns_list_set_bindata */
457457
458 /*----------------------------------------- getdns_list_set_string */
459 static getdns_return_t
460 getdns_list_set_string(getdns_list *list, size_t index, const char *value)
461 {
462 getdns_bindata *newbindata;
463 getdns_return_t retval;
464
465 if (!list || !value)
466 return GETDNS_RETURN_INVALID_PARAMETER;
467
468 if (index > list->numinuse)
469 return GETDNS_RETURN_NO_SUCH_LIST_ITEM;
470
471 if (!(newbindata = GETDNS_MALLOC(list->mf, getdns_bindata)))
472 return GETDNS_RETURN_MEMORY_ERROR;
473
474 newbindata->size = strlen(value);
475 if (!(newbindata->data = (void *)_getdns_strdup(&list->mf, value))) {
476 GETDNS_FREE(list->mf, newbindata);
477 return GETDNS_RETURN_MEMORY_ERROR;
478 }
479
480 if (index == list->numinuse) {
481 retval = _getdns_list_add_item(list, &index);
482 if (retval != GETDNS_RETURN_GOOD) {
483 GETDNS_FREE(list->mf, newbindata->data);
484 GETDNS_FREE(list->mf, newbindata);
485 return retval;
486 }
487 } else
488 getdns_list_destroy_item(list, index);
489
490 list->items[index].dtype = t_bindata;
491 list->items[index].data.bindata = newbindata;
492 return GETDNS_RETURN_GOOD;
493 } /* getdns_list_set_string */
494
458495 /*---------------------------------------- getdns_list_set_int */
459496 getdns_return_t
460497 getdns_list_set_int(struct getdns_list * list, size_t index,
469506 return GETDNS_RETURN_NO_SUCH_LIST_ITEM;
470507
471508 if (index == list->numinuse) {
472 retval = getdns_list_add_item(list, &index);
509 retval = _getdns_list_add_item(list, &index);
473510 if (retval != GETDNS_RETURN_GOOD)
474511 return retval;
475512 } else
481518 } /* getdns_list_set_int */
482519
483520 getdns_return_t
484 getdns_list_append_dict(getdns_list *list, const getdns_dict *child_dict)
521 _getdns_list_append_dict(getdns_list *list, const getdns_dict *child_dict)
485522 {
486523 if (!list) return GETDNS_RETURN_INVALID_PARAMETER;
487524 return getdns_list_set_dict(list, list->numinuse, child_dict);
488525 }
489526 getdns_return_t
490 getdns_list_append_list(getdns_list *list, const getdns_list *child_list)
527 _getdns_list_append_list(getdns_list *list, const getdns_list *child_list)
491528 {
492529 if (!list) return GETDNS_RETURN_INVALID_PARAMETER;
493530 return getdns_list_set_list(list, list->numinuse, child_list);
494531 }
495532 getdns_return_t
496 getdns_list_append_bindata(getdns_list *list, const getdns_bindata *child_bindata)
533 _getdns_list_append_bindata(getdns_list *list, const getdns_bindata *child_bindata)
497534 {
498535 if (!list) return GETDNS_RETURN_INVALID_PARAMETER;
499536 return getdns_list_set_bindata(list, list->numinuse, child_bindata);
500537 }
501538 getdns_return_t
502 getdns_list_append_int(getdns_list *list, uint32_t child_int)
539 _getdns_list_append_string(getdns_list *list, const char *value)
540 {
541 if (!list) return GETDNS_RETURN_INVALID_PARAMETER;
542 return getdns_list_set_string(list, list->numinuse, value);
543 }
544 getdns_return_t
545 _getdns_list_append_int(getdns_list *list, uint32_t child_int)
503546 {
504547 if (!list) return GETDNS_RETURN_INVALID_PARAMETER;
505548 return getdns_list_set_int(list, list->numinuse, child_int);
183183 }
184184
185185 void
186 dns_req_free(getdns_dns_req * req)
186 _getdns_dns_req_free(getdns_dns_req * req)
187187 {
188188 getdns_network_req **net_req;
189189 if (!req) {
190190 return;
191191 }
192192
193 priv_getdns_upstreams_dereference(req->upstreams);
193 _getdns_upstreams_dereference(req->upstreams);
194194
195195 /* cleanup network requests */
196196 for (net_req = req->netreqs; *net_req; net_req++)
207207
208208 /* create a new dns req to be submitted */
209209 getdns_dns_req *
210 dns_req_new(getdns_context *context, getdns_eventloop *loop,
210 _getdns_dns_req_new(getdns_context *context, getdns_eventloop *loop,
211211 const char *name, uint16_t request_type, getdns_dict *extensions)
212212 {
213213 int dnssec_return_status
5656 static getdns_return_t
5757 apl_n_list_append_value(getdns_list *list, uint8_t *rdf)
5858 {
59 return getdns_list_append_int(list, (*rdf >> 7));
60 }
61 static priv_getdns_rdf_special apl_n = {
59 return _getdns_list_append_int(list, (*rdf >> 7));
60 }
61 static _getdns_rdf_special apl_n = {
6262 apl_n_rdf_end, apl_n_dict_set_value, apl_n_list_append_value
6363 };
6464
7878 apl_afdpart_list_append_value(getdns_list *list, uint8_t *rdf)
7979 {
8080 getdns_bindata bindata = { (rdf[-1] & 0x7F), rdf };
81 return getdns_list_append_bindata(list, &bindata);
82 }
83 static priv_getdns_rdf_special apl_afdpart = {
81 return _getdns_list_append_bindata(list, &bindata);
82 }
83 static _getdns_rdf_special apl_afdpart = {
8484 apl_afdpart_rdf_end,
8585 apl_afdpart_dict_set_value, apl_afdpart_list_append_value
8686 };
164164 else if (! bindata.size)
165165 return GETDNS_RETURN_GOOD;
166166 else
167 return getdns_list_append_bindata(list, &bindata);
168 }
169 static priv_getdns_rdf_special ipseckey_gateway = {
167 return _getdns_list_append_bindata(list, &bindata);
168 }
169 static _getdns_rdf_special ipseckey_gateway = {
170170 ipseckey_gateway_rdf_end,
171171 ipseckey_gateway_dict_set_value, ipseckey_gateway_list_append_value
172172 };
186186 static getdns_return_t
187187 hip_pk_algorithm_list_append_value(getdns_list *list, uint8_t *rdf)
188188 {
189 return getdns_list_append_int(list, rdf[1]);
190 }
191 static priv_getdns_rdf_special hip_pk_algorithm = {
189 return _getdns_list_append_int(list, rdf[1]);
190 }
191 static _getdns_rdf_special hip_pk_algorithm = {
192192 hip_pk_algorithm_rdf_end,
193193 hip_pk_algorithm_dict_set_value, hip_pk_algorithm_list_append_value
194194 };
210210 hip_hit_list_append_value(getdns_list *list, uint8_t *rdf)
211211 {
212212 getdns_bindata bindata = { rdf[-1], rdf + 3 };
213 return getdns_list_append_bindata(list, &bindata);
214 }
215 static priv_getdns_rdf_special hip_hit = {
213 return _getdns_list_append_bindata(list, &bindata);
214 }
215 static _getdns_rdf_special hip_hit = {
216216 hip_hit_rdf_end, hip_hit_dict_set_value, hip_hit_list_append_value
217217 };
218218
233233 hip_public_key_list_append_value(getdns_list *list, uint8_t *rdf)
234234 {
235235 getdns_bindata bindata = { gldns_read_uint16(rdf), rdf + 2 + rdf[-2] };
236 return getdns_list_append_bindata(list, &bindata);
237 }
238 static priv_getdns_rdf_special hip_public_key = {
236 return _getdns_list_append_bindata(list, &bindata);
237 }
238 static _getdns_rdf_special hip_public_key = {
239239 hip_public_key_rdf_end,
240240 hip_public_key_dict_set_value, hip_public_key_list_append_value
241241 };
242242
243243
244 static priv_getdns_rdata_def a_rdata[] = {
244 static _getdns_rdata_def a_rdata[] = {
245245 { "ipv4_address" , GETDNS_RDF_A }};
246 static priv_getdns_rdata_def ns_rdata[] = {
246 static _getdns_rdata_def ns_rdata[] = {
247247 { "nsdname" , GETDNS_RDF_N_C }};
248 static priv_getdns_rdata_def md_rdata[] = {
248 static _getdns_rdata_def md_rdata[] = {
249249 { "madname" , GETDNS_RDF_N_C }};
250 static priv_getdns_rdata_def cname_rdata[] = {
250 static _getdns_rdata_def cname_rdata[] = {
251251 { "cname" , GETDNS_RDF_N_C }};
252 static priv_getdns_rdata_def soa_rdata[] = {
252 static _getdns_rdata_def soa_rdata[] = {
253253 { "mname" , GETDNS_RDF_N_C },
254254 { "rname" , GETDNS_RDF_N_C },
255255 { "serial" , GETDNS_RDF_I4 },
257257 { "retry" , GETDNS_RDF_I4 },
258258 { "expire" , GETDNS_RDF_I4 },
259259 { "minimum" , GETDNS_RDF_I4 }};
260 static priv_getdns_rdata_def mg_rdata[] = {
260 static _getdns_rdata_def mg_rdata[] = {
261261 { "mgmname" , GETDNS_RDF_N_C }};
262 static priv_getdns_rdata_def mr_rdata[] = {
262 static _getdns_rdata_def mr_rdata[] = {
263263 { "newname" , GETDNS_RDF_N_C }};
264 static priv_getdns_rdata_def null_rdata[] = {
264 static _getdns_rdata_def null_rdata[] = {
265265 { "anything" , GETDNS_RDF_X }};
266 static priv_getdns_rdata_def wks_rdata[] = {
266 static _getdns_rdata_def wks_rdata[] = {
267267 { "address" , GETDNS_RDF_A },
268268 { "protocol" , GETDNS_RDF_I1 },
269269 { "bitmap" , GETDNS_RDF_X }};
270 static priv_getdns_rdata_def ptr_rdata[] = {
270 static _getdns_rdata_def ptr_rdata[] = {
271271 { "ptrdname" , GETDNS_RDF_N_C }};
272 static priv_getdns_rdata_def hinfo_rdata[] = {
272 static _getdns_rdata_def hinfo_rdata[] = {
273273 { "cpu" , GETDNS_RDF_S },
274274 { "os" , GETDNS_RDF_S }};
275 static priv_getdns_rdata_def minfo_rdata[] = {
275 static _getdns_rdata_def minfo_rdata[] = {
276276 { "rmailbx" , GETDNS_RDF_N_C },
277277 { "emailbx" , GETDNS_RDF_N_C }};
278 static priv_getdns_rdata_def mx_rdata[] = {
278 static _getdns_rdata_def mx_rdata[] = {
279279 { "preference" , GETDNS_RDF_I2 },
280280 { "exchange" , GETDNS_RDF_N_C }};
281 static priv_getdns_rdata_def txt_rdata[] = {
281 static _getdns_rdata_def txt_rdata[] = {
282282 { "txt_strings" , GETDNS_RDF_S_M }};
283 static priv_getdns_rdata_def rp_rdata[] = {
283 static _getdns_rdata_def rp_rdata[] = {
284284 { "mbox_dname" , GETDNS_RDF_N },
285285 { "txt_dname" , GETDNS_RDF_N }};
286 static priv_getdns_rdata_def afsdb_rdata[] = {
286 static _getdns_rdata_def afsdb_rdata[] = {
287287 { "subtype" , GETDNS_RDF_I2 },
288288 { "hostname" , GETDNS_RDF_N }};
289 static priv_getdns_rdata_def x25_rdata[] = {
289 static _getdns_rdata_def x25_rdata[] = {
290290 { "psdn_address" , GETDNS_RDF_S }};
291 static priv_getdns_rdata_def isdn_rdata[] = {
291 static _getdns_rdata_def isdn_rdata[] = {
292292 { "isdn_address" , GETDNS_RDF_S },
293293 { "sa" , GETDNS_RDF_S }};
294 static priv_getdns_rdata_def rt_rdata[] = {
294 static _getdns_rdata_def rt_rdata[] = {
295295 { "preference" , GETDNS_RDF_I2 },
296296 { "intermediate_host" , GETDNS_RDF_N }};
297 static priv_getdns_rdata_def nsap_rdata[] = {
297 static _getdns_rdata_def nsap_rdata[] = {
298298 { "nsap" , GETDNS_RDF_X }};
299 static priv_getdns_rdata_def sig_rdata[] = {
299 static _getdns_rdata_def sig_rdata[] = {
300300 { "sig_obsolete" , GETDNS_RDF_X }};
301 static priv_getdns_rdata_def key_rdata[] = {
301 static _getdns_rdata_def key_rdata[] = {
302302 { "key_obsolete" , GETDNS_RDF_X }};
303 static priv_getdns_rdata_def px_rdata[] = {
303 static _getdns_rdata_def px_rdata[] = {
304304 { "preference" , GETDNS_RDF_I2 },
305305 { "map822" , GETDNS_RDF_N },
306306 { "mapx400" , GETDNS_RDF_N }};
307 static priv_getdns_rdata_def gpos_rdata[] = {
307 static _getdns_rdata_def gpos_rdata[] = {
308308 { "longitude" , GETDNS_RDF_S },
309309 { "latitude" , GETDNS_RDF_S },
310310 { "altitude" , GETDNS_RDF_S }};
311 static priv_getdns_rdata_def aaaa_rdata[] = {
311 static _getdns_rdata_def aaaa_rdata[] = {
312312 { "ipv6_address" , GETDNS_RDF_AAAA }};
313 static priv_getdns_rdata_def loc_rdata[] = {
313 static _getdns_rdata_def loc_rdata[] = {
314314 { "loc_obsolete" , GETDNS_RDF_X }};
315 static priv_getdns_rdata_def nxt_rdata[] = {
315 static _getdns_rdata_def nxt_rdata[] = {
316316 { "nxt_obsolete" , GETDNS_RDF_X }};
317 static priv_getdns_rdata_def srv_rdata[] = {
317 static _getdns_rdata_def srv_rdata[] = {
318318 { "priority" , GETDNS_RDF_I2 },
319319 { "weight" , GETDNS_RDF_I2 },
320320 { "port" , GETDNS_RDF_I2 },
321321 { "target" , GETDNS_RDF_N }};
322 static priv_getdns_rdata_def atma_rdata[] = {
322 static _getdns_rdata_def atma_rdata[] = {
323323 { "format" , GETDNS_RDF_X }};
324 static priv_getdns_rdata_def naptr_rdata[] = {
324 static _getdns_rdata_def naptr_rdata[] = {
325325 { "order" , GETDNS_RDF_I2 },
326326 { "preference" , GETDNS_RDF_I2 },
327327 { "flags" , GETDNS_RDF_S },
328328 { "service" , GETDNS_RDF_S },
329329 { "regexp" , GETDNS_RDF_S },
330330 { "replacement" , GETDNS_RDF_N }};
331 static priv_getdns_rdata_def kx_rdata[] = {
331 static _getdns_rdata_def kx_rdata[] = {
332332 { "preference" , GETDNS_RDF_I2 },
333333 { "exchanger" , GETDNS_RDF_N }};
334 static priv_getdns_rdata_def cert_rdata[] = {
334 static _getdns_rdata_def cert_rdata[] = {
335335 { "type" , GETDNS_RDF_I2 },
336336 { "key_tag" , GETDNS_RDF_I2 },
337337 { "algorithm" , GETDNS_RDF_I1 },
338338 { "certificate_or_crl" , GETDNS_RDF_B }};
339 static priv_getdns_rdata_def a6_rdata[] = {
339 static _getdns_rdata_def a6_rdata[] = {
340340 { "a6_obsolete" , GETDNS_RDF_X }};
341 static priv_getdns_rdata_def dname_rdata[] = {
341 static _getdns_rdata_def dname_rdata[] = {
342342 { "target" , GETDNS_RDF_N }};
343 static priv_getdns_rdata_def opt_rdata[] = {
343 static _getdns_rdata_def opt_rdata[] = {
344344 { "options" , GETDNS_RDF_R },
345345 { "option_code" , GETDNS_RDF_I2 },
346346 { "option_data" , GETDNS_RDF_X_S }};
347 static priv_getdns_rdata_def apl_rdata[] = {
347 static _getdns_rdata_def apl_rdata[] = {
348348 { "apitems" , GETDNS_RDF_R },
349349 { "address_family" , GETDNS_RDF_I2 },
350350 { "prefix" , GETDNS_RDF_I1 },
351351 { "n" , GETDNS_RDF_SPECIAL, &apl_n },
352352 { "afdpart" , GETDNS_RDF_SPECIAL, &apl_afdpart }};
353 static priv_getdns_rdata_def ds_rdata[] = {
353 static _getdns_rdata_def ds_rdata[] = {
354354 { "key_tag" , GETDNS_RDF_I2 },
355355 { "algorithm" , GETDNS_RDF_I1 },
356356 { "digest_type" , GETDNS_RDF_I1 },
357357 { "digest" , GETDNS_RDF_X }};
358 static priv_getdns_rdata_def sshfp_rdata[] = {
358 static _getdns_rdata_def sshfp_rdata[] = {
359359 { "algorithm" , GETDNS_RDF_I1 },
360360 { "fp_type" , GETDNS_RDF_I1 },
361361 { "fingerprint" , GETDNS_RDF_X }};
362 static priv_getdns_rdata_def ipseckey_rdata[] = {
362 static _getdns_rdata_def ipseckey_rdata[] = {
363363 { "algorithm" , GETDNS_RDF_I1 },
364364 { "gateway_type" , GETDNS_RDF_I1 },
365365 { "precedence" , GETDNS_RDF_I1 },
366366 { "gateway" , GETDNS_RDF_SPECIAL, &ipseckey_gateway },
367367 { "public_key" , GETDNS_RDF_B }};
368 static priv_getdns_rdata_def rrsig_rdata[] = {
368 static _getdns_rdata_def rrsig_rdata[] = {
369369 { "type_covered" , GETDNS_RDF_I2 },
370370 { "algorithm" , GETDNS_RDF_I1 },
371371 { "labels" , GETDNS_RDF_I1 },
375375 { "key_tag" , GETDNS_RDF_I2 },
376376 { "signers_name" , GETDNS_RDF_N },
377377 { "signature" , GETDNS_RDF_B }};
378 static priv_getdns_rdata_def nsec_rdata[] = {
378 static _getdns_rdata_def nsec_rdata[] = {
379379 { "next_domain_name" , GETDNS_RDF_N },
380380 { "type_bit_maps" , GETDNS_RDF_X }};
381 static priv_getdns_rdata_def dnskey_rdata[] = {
381 static _getdns_rdata_def dnskey_rdata[] = {
382382 { "flags" , GETDNS_RDF_I2 },
383383 { "protocol" , GETDNS_RDF_I1 },
384384 { "algorithm" , GETDNS_RDF_I1 },
385385 { "public_key" , GETDNS_RDF_B }};
386 static priv_getdns_rdata_def dhcid_rdata[] = {
386 static _getdns_rdata_def dhcid_rdata[] = {
387387 { "dhcid_opaque" , GETDNS_RDF_B }};
388 static priv_getdns_rdata_def nsec3_rdata[] = {
388 static _getdns_rdata_def nsec3_rdata[] = {
389389 { "hash_algorithm" , GETDNS_RDF_I1 },
390390 { "flags" , GETDNS_RDF_I1 },
391391 { "iterations" , GETDNS_RDF_I2 },
392392 { "salt" , GETDNS_RDF_X_C },
393393 { "next_hashed_owner_name" , GETDNS_RDF_B32_C},
394394 { "type_bit_maps" , GETDNS_RDF_X }};
395 static priv_getdns_rdata_def nsec3param_rdata[] = {
395 static _getdns_rdata_def nsec3param_rdata[] = {
396396 { "hash_algorithm" , GETDNS_RDF_I1 },
397397 { "flags" , GETDNS_RDF_I1 },
398398 { "iterations" , GETDNS_RDF_I2 },
399399 { "salt" , GETDNS_RDF_X_C }};
400 static priv_getdns_rdata_def tlsa_rdata[] = {
400 static _getdns_rdata_def tlsa_rdata[] = {
401401 { "certificate_usage" , GETDNS_RDF_I1 },
402402 { "selector" , GETDNS_RDF_I1 },
403403 { "matching_type" , GETDNS_RDF_I1 },
404404 { "certificate_association_data", GETDNS_RDF_X }};
405 static priv_getdns_rdata_def hip_rdata[] = {
405 static _getdns_rdata_def hip_rdata[] = {
406406 { "pk_algorithm" , GETDNS_RDF_SPECIAL, &hip_pk_algorithm },
407407 { "hit" , GETDNS_RDF_SPECIAL, &hip_hit },
408408 { "public_key" , GETDNS_RDF_SPECIAL, &hip_public_key },
409409 { "rendezvous_servers" , GETDNS_RDF_N_M }};
410 static priv_getdns_rdata_def csync_rdata[] = {
410 static _getdns_rdata_def csync_rdata[] = {
411411 { "serial" , GETDNS_RDF_I4 },
412412 { "flags" , GETDNS_RDF_I2 },
413413 { "type_bit_maps" , GETDNS_RDF_X }};
414 static priv_getdns_rdata_def spf_rdata[] = {
414 static _getdns_rdata_def spf_rdata[] = {
415415 { "text" , GETDNS_RDF_S_M }};
416 static priv_getdns_rdata_def nid_rdata[] = {
416 static _getdns_rdata_def nid_rdata[] = {
417417 { "preference" , GETDNS_RDF_I2 },
418418 { "node_id" , GETDNS_RDF_AA }};
419 static priv_getdns_rdata_def l32_rdata[] = {
419 static _getdns_rdata_def l32_rdata[] = {
420420 { "preference" , GETDNS_RDF_I2 },
421421 { "locator32" , GETDNS_RDF_A }};
422 static priv_getdns_rdata_def l64_rdata[] = {
422 static _getdns_rdata_def l64_rdata[] = {
423423 { "preference" , GETDNS_RDF_I2 },
424424 { "locator64" , GETDNS_RDF_AA }};
425 static priv_getdns_rdata_def lp_rdata[] = {
425 static _getdns_rdata_def lp_rdata[] = {
426426 { "preference" , GETDNS_RDF_I2 },
427427 { "fqdn" , GETDNS_RDF_N }};
428 static priv_getdns_rdata_def eui48_rdata[] = {
428 static _getdns_rdata_def eui48_rdata[] = {
429429 { "eui48_address" , GETDNS_RDF_X6 }};
430 static priv_getdns_rdata_def eui64_rdata[] = {
430 static _getdns_rdata_def eui64_rdata[] = {
431431 { "eui64_address" , GETDNS_RDF_X8 }};
432 static priv_getdns_rdata_def tkey_rdata[] = {
432 static _getdns_rdata_def tkey_rdata[] = {
433433 { "algorithm" , GETDNS_RDF_N },
434434 { "inception" , GETDNS_RDF_T },
435435 { "expiration" , GETDNS_RDF_T },
437437 { "error" , GETDNS_RDF_I2 },
438438 { "key_data" , GETDNS_RDF_X_S },
439439 { "other_data" , GETDNS_RDF_X_S }};
440 static priv_getdns_rdata_def tsig_rdata[] = {
440 static _getdns_rdata_def tsig_rdata[] = {
441441 { "algorithm" , GETDNS_RDF_N },
442442 { "time_signed" , GETDNS_RDF_T6 },
443443 { "fudge" , GETDNS_RDF_I2 },
445445 { "original_id" , GETDNS_RDF_I2 },
446446 { "error" , GETDNS_RDF_I2 },
447447 { "other_data" , GETDNS_RDF_X_S }};
448 static priv_getdns_rdata_def uri_rdata[] = {
448 static _getdns_rdata_def uri_rdata[] = {
449449 { "priority" , GETDNS_RDF_I2 },
450450 { "weight" , GETDNS_RDF_I2 },
451451 { "target" , GETDNS_RDF_S_L }};
452 static priv_getdns_rdata_def caa_rdata[] = {
452 static _getdns_rdata_def caa_rdata[] = {
453453 { "flags" , GETDNS_RDF_I1 },
454454 { "tag" , GETDNS_RDF_S },
455455 { "value" , GETDNS_RDF_S_L }};
456 static priv_getdns_rdata_def dlv_rdata[] = {
456 static _getdns_rdata_def dlv_rdata[] = {
457457 { "key_tag" , GETDNS_RDF_I2 },
458458 { "algorithm" , GETDNS_RDF_I1 },
459459 { "digest_type" , GETDNS_RDF_I1 },
460460 { "digest" , GETDNS_RDF_X }};
461461
462 static priv_getdns_rr_def priv_getdns_rr_defs[] = {
462 static _getdns_rr_def _getdns_rr_defs[] = {
463463 { NULL, NULL, 0 },
464464 { "A", a_rdata, ALEN( a_rdata) }, /* 1 - */
465465 { "NS", ns_rdata, ALEN( ns_rdata) },
722722 { "DLV", dlv_rdata, ALEN( dlv_rdata) } /* 32769 */
723723 };
724724
725 const priv_getdns_rr_def *
726 priv_getdns_rr_def_lookup(uint16_t rr_type)
725 const _getdns_rr_def *
726 _getdns_rr_def_lookup(uint16_t rr_type)
727727 {
728728 if (rr_type <= 257)
729 return &priv_getdns_rr_defs[rr_type];
729 return &_getdns_rr_defs[rr_type];
730730 else if (rr_type == 32768)
731 return &priv_getdns_rr_defs[258];
731 return &_getdns_rr_defs[258];
732732 else if (rr_type == 32769)
733 return &priv_getdns_rr_defs[259];
734 return priv_getdns_rr_defs;
733 return &_getdns_rr_defs[259];
734 return _getdns_rr_defs;
735735 }
736736
737737 const char *
738 priv_getdns_rr_type_name(int rr_type)
739 {
740 return priv_getdns_rr_def_lookup(rr_type)->name;
738 _getdns_rr_type_name(int rr_type)
739 {
740 return _getdns_rr_def_lookup(rr_type)->name;
741741 }
742742
743743 getdns_return_t
744 priv_getdns_rr_dict2wire(getdns_dict *rr_dict, gldns_buffer *buf)
744 _getdns_rr_dict2wire(getdns_dict *rr_dict, gldns_buffer *buf)
745745 {
746746 getdns_return_t r = GETDNS_RETURN_GOOD;
747747 struct getdns_bindata *name;
752752 uint32_t rr_class = GETDNS_RRCLASS_IN;
753753 uint32_t rr_ttl = 0;
754754 uint32_t value;
755 const priv_getdns_rr_def *rr_def;
756 const priv_getdns_rdata_def *rd_def;
755 const _getdns_rr_def *rr_def;
756 const _getdns_rdata_def *rd_def;
757757 int n_rdata_fields;
758758 size_t j, rdata_size_mark;
759759
777777 /* Does rdata contain compressed names?
778778 * Because rdata_raw is unusable then.
779779 */
780 rr_def = priv_getdns_rr_def_lookup(rr_type);
780 rr_def = _getdns_rr_def_lookup(rr_type);
781781 for ( rd_def = rr_def->rdata
782782 , n_rdata_fields = rr_def->n_rdata_fields
783783 ; n_rdata_fields ; n_rdata_fields-- , rd_def++ ) {
3535 #include "getdns/getdns.h"
3636 #include "gldns/gbuffer.h"
3737
38 typedef uint8_t *(*priv_getdns_rdf_end_t)(
38 typedef uint8_t *(*_getdns_rdf_end_t)(
3939 uint8_t *pkt, uint8_t *pkt_end, uint8_t *rdf);
40 /* Limit checks are already done with priv_getdns_rdf_end_t */
41 typedef getdns_return_t (*priv_getdns_rdf_dict_set_value_t)(
40 /* Limit checks are already done with _getdns_rdf_end_t */
41 typedef getdns_return_t (*_getdns_rdf_dict_set_value_t)(
4242 getdns_dict *dict, uint8_t *rdf);
43 typedef getdns_return_t (*priv_getdns_rdf_list_append_value_t)(
43 typedef getdns_return_t (*_getdns_rdf_list_append_value_t)(
4444 getdns_list *list, uint8_t *rdf);
4545
46 typedef struct priv_getdns_rdf_special {
47 priv_getdns_rdf_end_t rdf_end;
48 priv_getdns_rdf_dict_set_value_t dict_set_value;
49 priv_getdns_rdf_list_append_value_t list_append_value;
50 } priv_getdns_rdf_special;
46 typedef struct _getdns_rdf_special {
47 _getdns_rdf_end_t rdf_end;
48 _getdns_rdf_dict_set_value_t dict_set_value;
49 _getdns_rdf_list_append_value_t list_append_value;
50 } _getdns_rdf_special;
5151
5252 /* draft-levine-dnsextlang'ish type rr and rdata definitions */
5353
6060 #define GETDNS_RDF_FIXEDSZ 0x0000FF
6161 #define GETDNS_RDF_LEN_VAL 0x00FF00
6262
63 typedef enum priv_getdns_rdf_wf_type {
63 typedef enum _getdns_rdf_wf_type {
6464 GETDNS_RDF_N = 0x060000, /* N */
6565 GETDNS_RDF_N_A = 0x060000, /* N[A] */
6666 GETDNS_RDF_N_C = 0x0E0000, /* N[C] */
116116 GETDNS_RDF_R = 0x100000, /* Repeat */
117117
118118 GETDNS_RDF_SPECIAL = 0x800000,
119 } priv_getdns_rdf_type;
119 } _getdns_rdf_type;
120120
121 typedef struct priv_getdns_rdata_def {
121 typedef struct _getdns_rdata_def {
122122 const char *name;
123 priv_getdns_rdf_type type;
124 priv_getdns_rdf_special *special;
125 } priv_getdns_rdata_def;
123 _getdns_rdf_type type;
124 _getdns_rdf_special *special;
125 } _getdns_rdata_def;
126126
127 typedef struct priv_getdns_rr_def {
127 typedef struct _getdns_rr_def {
128128 const char *name;
129 const priv_getdns_rdata_def *rdata;
129 const _getdns_rdata_def *rdata;
130130 int n_rdata_fields;
131 } priv_getdns_rr_def;
131 } _getdns_rr_def;
132132
133 const priv_getdns_rr_def *priv_getdns_rr_def_lookup(uint16_t rr_type);
133 const _getdns_rr_def *_getdns_rr_def_lookup(uint16_t rr_type);
134134
135 getdns_return_t priv_getdns_rr_dict2wire(
135 getdns_return_t _getdns_rr_dict2wire(
136136 getdns_dict *rr_dict, gldns_buffer *buf);
137137
138 const char *priv_getdns_rr_type_name(int rr_type);
138 const char *_getdns_rr_type_name(int rr_type);
139139
140140 #endif
141141
3333 #include "gldns/rrdef.h"
3434
3535 static void
36 rr_iter_find_nxt(priv_getdns_rr_iter *i)
36 rr_iter_find_nxt(_getdns_rr_iter *i)
3737 {
3838 assert(i);
3939 assert(i->rr_type);
4747 : i->rr_type + 10 + gldns_read_uint16(i->rr_type + 8);
4848 }
4949
50 static priv_getdns_rr_iter *
51 find_rrtype(priv_getdns_rr_iter *i)
50 static _getdns_rr_iter *
51 find_rrtype(_getdns_rr_iter *i)
5252 {
5353 uint8_t *pos;
5454
8181 return NULL;
8282 }
8383
84 priv_getdns_rr_iter *
85 priv_getdns_rr_iter_init(priv_getdns_rr_iter *i, uint8_t *pkt, size_t pkt_len)
84 _getdns_rr_iter *
85 _getdns_rr_iter_init(_getdns_rr_iter *i, uint8_t *pkt, size_t pkt_len)
8686 {
8787 assert(i);
8888
9898 return find_rrtype(i);
9999 }
100100
101 priv_getdns_rr_iter *
102 priv_getdns_rr_iter_rewind(priv_getdns_rr_iter *i)
103 {
104 assert(i);
105
106 return priv_getdns_rr_iter_init(i, i->pkt, i->pkt_end - i->pkt);
107 }
108
109 priv_getdns_rr_iter *
110 priv_getdns_rr_iter_next(priv_getdns_rr_iter *i)
101 _getdns_rr_iter *
102 _getdns_rr_iter_rewind(_getdns_rr_iter *i)
103 {
104 assert(i);
105
106 return _getdns_rr_iter_init(i, i->pkt, i->pkt_end - i->pkt);
107 }
108
109 _getdns_rr_iter *
110 _getdns_rr_iter_next(_getdns_rr_iter *i)
111111 {
112112 assert(i);
113113
204204 }
205205
206206 uint8_t *
207 priv_getdns_owner_if_or_as_decompressed(priv_getdns_rr_iter *i,
207 _getdns_owner_if_or_as_decompressed(_getdns_rr_iter *i,
208208 uint8_t *ff_bytes, size_t *len)
209209 {
210210 return dname_if_or_as_decompressed(i->pkt, i->pkt_end, i->pos,
211211 ff_bytes, len, 0);
212212 }
213213
214 static priv_getdns_rdf_iter *
215 rdf_iter_find_nxt(priv_getdns_rdf_iter *i)
214 static _getdns_rdf_iter *
215 rdf_iter_find_nxt(_getdns_rdf_iter *i)
216216 {
217217 uint8_t *pos;
218218
268268 return NULL;
269269 }
270270
271 priv_getdns_rdf_iter *
272 priv_getdns_rdf_iter_init(priv_getdns_rdf_iter *i, priv_getdns_rr_iter *rr)
273 {
274 const priv_getdns_rr_def *rr_def;
271 _getdns_rdf_iter *
272 _getdns_rdf_iter_init(_getdns_rdf_iter *i, _getdns_rr_iter *rr)
273 {
274 const _getdns_rr_def *rr_def;
275275
276276 assert(i);
277277 assert(rr);
283283
284284 i->pkt = rr->pkt;
285285 i->pkt_end = rr->pkt_end;
286 rr_def = priv_getdns_rr_def_lookup(gldns_read_uint16(rr->rr_type));
286 rr_def = _getdns_rr_def_lookup(gldns_read_uint16(rr->rr_type));
287287 i->rdd_pos = rr_def->rdata;
288288 i->rdd_end = rr_def->rdata + rr_def->n_rdata_fields;
289289
303303 return NULL;
304304 }
305305
306 priv_getdns_rdf_iter *
307 priv_getdns_rdf_iter_next(priv_getdns_rdf_iter *i)
306 _getdns_rdf_iter *
307 _getdns_rdf_iter_next(_getdns_rdf_iter *i)
308308 {
309309 if (!i->pos)
310310 return NULL;
323323 return NULL;
324324 }
325325
326 priv_getdns_rdf_iter *
327 priv_getdns_rdf_iter_init_at(
328 priv_getdns_rdf_iter *i, priv_getdns_rr_iter *rr, size_t pos)
329 {
330 for ( i = priv_getdns_rdf_iter_init(i, rr)
326 _getdns_rdf_iter *
327 _getdns_rdf_iter_init_at(
328 _getdns_rdf_iter *i, _getdns_rr_iter *rr, size_t pos)
329 {
330 for ( i = _getdns_rdf_iter_init(i, rr)
331331 ; i && pos
332 ; i = priv_getdns_rdf_iter_next(i), pos--);
332 ; i = _getdns_rdf_iter_next(i), pos--);
333333 return i;
334334 }
335335
336336 uint8_t *
337 priv_getdns_rdf_if_or_as_decompressed(
338 priv_getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len)
337 _getdns_rdf_if_or_as_decompressed(
338 _getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len)
339339 {
340340 return dname_if_or_as_decompressed(i->pkt, i->pkt_end, i->pos,
341341 ff_bytes, len, 0);
3636 #include "gldns/pkthdr.h"
3737 #include "gldns/gbuffer.h"
3838
39 typedef struct priv_getdns_rr_iter {
39 typedef struct _getdns_rr_iter {
4040 uint8_t *pkt;
4141 uint8_t *pkt_end;
4242
5656 /* nxt point to the owner name of the next RR or to pkt_end */
5757 uint8_t *nxt;
5858
59 } priv_getdns_rr_iter;
59 } _getdns_rr_iter;
6060
61 priv_getdns_rr_iter *priv_getdns_rr_iter_init(priv_getdns_rr_iter *i,
61 _getdns_rr_iter *_getdns_rr_iter_init(_getdns_rr_iter *i,
6262 uint8_t *pkt, size_t pkt_len);
6363
64 priv_getdns_rr_iter *priv_getdns_rr_iter_rewind(priv_getdns_rr_iter *i);
64 _getdns_rr_iter *_getdns_rr_iter_rewind(_getdns_rr_iter *i);
6565
66 priv_getdns_rr_iter *priv_getdns_rr_iter_next(priv_getdns_rr_iter *i);
66 _getdns_rr_iter *_getdns_rr_iter_next(_getdns_rr_iter *i);
6767
68 uint8_t *priv_getdns_owner_if_or_as_decompressed(
69 priv_getdns_rr_iter *i, uint8_t *ff_bytes, size_t *len);
68 uint8_t *_getdns_owner_if_or_as_decompressed(
69 _getdns_rr_iter *i, uint8_t *ff_bytes, size_t *len);
7070
7171 static inline gldns_pkt_section
72 priv_getdns_rr_iter_section(priv_getdns_rr_iter *i)
72 _getdns_rr_iter_section(_getdns_rr_iter *i)
7373 {
7474 return i->n < GLDNS_QDCOUNT(i->pkt) ? GLDNS_SECTION_QUESTION
7575 : i->n < GLDNS_QDCOUNT(i->pkt)
8787 typedef struct piv_getdns_rdf_iter {
8888 uint8_t *pkt;
8989 uint8_t *pkt_end;
90 const priv_getdns_rdata_def *rdd_pos;
91 const priv_getdns_rdata_def *rdd_end;
92 const priv_getdns_rdata_def *rdd_repeat;
90 const _getdns_rdata_def *rdd_pos;
91 const _getdns_rdata_def *rdd_end;
92 const _getdns_rdata_def *rdd_repeat;
9393 uint8_t *pos;
9494 uint8_t *end;
9595 uint8_t *nxt;
96 } priv_getdns_rdf_iter;
96 } _getdns_rdf_iter;
9797
98 priv_getdns_rdf_iter *priv_getdns_rdf_iter_init(priv_getdns_rdf_iter *i,
99 priv_getdns_rr_iter *rr);
98 _getdns_rdf_iter *_getdns_rdf_iter_init(_getdns_rdf_iter *i,
99 _getdns_rr_iter *rr);
100100
101 priv_getdns_rdf_iter *priv_getdns_rdf_iter_next(priv_getdns_rdf_iter *i);
101 _getdns_rdf_iter *_getdns_rdf_iter_next(_getdns_rdf_iter *i);
102102
103 priv_getdns_rdf_iter *priv_getdns_rdf_iter_init_at(priv_getdns_rdf_iter *i,
104 priv_getdns_rr_iter *rr, size_t pos);
103 _getdns_rdf_iter *_getdns_rdf_iter_init_at(_getdns_rdf_iter *i,
104 _getdns_rr_iter *rr, size_t pos);
105105
106 uint8_t *priv_getdns_rdf_if_or_as_decompressed(
107 priv_getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len);
106 uint8_t *_getdns_rdf_if_or_as_decompressed(
107 _getdns_rdf_iter *i, uint8_t *ff_bytes, size_t *len);
108108
109109 #endif
178178 match_and_process_server_cookie(
179179 getdns_upstream *upstream, uint8_t *response, size_t response_len)
180180 {
181 priv_getdns_rr_iter rr_iter_storage, *rr_iter;
181 _getdns_rr_iter rr_iter_storage, *rr_iter;
182182 uint8_t *pos;
183183 uint16_t rdata_len, opt_code, opt_len;
184184
185185 /* Search for the OPT RR (if any) */
186 for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
186 for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
187187 , response, response_len)
188188 ; rr_iter
189 ; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
190
191 if (priv_getdns_rr_iter_section(rr_iter) !=
189 ; rr_iter = _getdns_rr_iter_next(rr_iter)) {
190
191 if (_getdns_rr_iter_section(rr_iter) !=
192192 GLDNS_SECTION_ADDITIONAL)
193193 continue;
194194
261261 getdns_dict_destroy(extensions);
262262 return 0;
263263 }
264 upstream->starttls_req = dns_req_new(dnsreq->context, loop,
264 upstream->starttls_req = _getdns_dns_req_new(dnsreq->context, loop,
265265 "STARTTLS", GETDNS_RRTYPE_TXT, extensions);
266266 /*TODO[TLS]: TO BIT*/
267267 if (upstream->starttls_req == NULL)
275275 static int
276276 is_starttls_response(getdns_network_req *netreq)
277277 {
278 priv_getdns_rr_iter rr_iter_storage, *rr_iter;
279 priv_getdns_rdf_iter rdf_iter_storage, *rdf_iter;
278 _getdns_rr_iter rr_iter_storage, *rr_iter;
279 _getdns_rdf_iter rdf_iter_storage, *rdf_iter;
280280 uint16_t rr_type;
281281 gldns_pkt_section section;
282282 uint8_t starttls_name_space[256], *starttls_name;
291291 if (GLDNS_ANCOUNT(netreq->response) != 1)
292292 return 0;
293293
294 for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
294 for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
295295 , netreq->response
296296 , netreq->response_len)
297297 ; rr_iter
298 ; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
299
300 section = priv_getdns_rr_iter_section(rr_iter);
298 ; rr_iter = _getdns_rr_iter_next(rr_iter)) {
299
300 section = _getdns_rr_iter_section(rr_iter);
301301 rr_type = gldns_read_uint16(rr_iter->rr_type);
302302 if (section != GLDNS_SECTION_ANSWER
303303 || rr_type != GETDNS_RRTYPE_TXT)
304304 continue;
305305
306 owner_name = priv_getdns_owner_if_or_as_decompressed(
306 owner_name = _getdns_owner_if_or_as_decompressed(
307307 rr_iter, owner_name_space, &owner_name_len);
308 if (!priv_getdns_dname_equal(netreq->owner->name, owner_name))
308 if (!_getdns_dname_equal(netreq->owner->name, owner_name))
309309 continue;
310310
311 if (!(rdf_iter = priv_getdns_rdf_iter_init(
311 if (!(rdf_iter = _getdns_rdf_iter_init(
312312 &rdf_iter_storage, rr_iter)))
313313 continue;
314314
315 if ((starttls_name = priv_getdns_rdf_if_or_as_decompressed(
315 if ((starttls_name = _getdns_rdf_if_or_as_decompressed(
316316 rdf_iter, starttls_name_space, &starttls_name_len)) &&
317 priv_getdns_dname_equal(starttls_name, owner_name))
317 _getdns_dname_equal(starttls_name, owner_name))
318318 return 1;
319319
320320 return 0;
369369 static int
370370 tcp_connected(getdns_upstream *upstream) {
371371 /* Already tried and failed, so let the fallback code take care of things */
372 /* TODO: We _should_ use a timeout on the TCP handshake*/
372373 if (upstream->fd == -1 || upstream->tcp.write_error != 0)
373374 return STUB_TCP_ERROR;
374375
421422
422423 /* Delete from upstream->netreq_by_query_id (if present) */
423424 query_id_intptr = (intptr_t)netreq->query_id;
424 (void) getdns_rbtree_delete(
425 (void) _getdns_rbtree_delete(
425426 &upstream->netreq_by_query_id, (void *)query_id_intptr);
426427
427428 /* Delete from upstream->write_queue (if present) */
447448 tls_cleanup(getdns_upstream *upstream)
448449 {
449450 DEBUG_STUB("*** %s\n", __FUNCTION__);
450 SSL_free(upstream->tls_obj);
451 if (upstream->tls_obj != NULL)
452 SSL_free(upstream->tls_obj);
451453 upstream->tls_obj = NULL;
452454 upstream->tls_hs_state = GETDNS_HS_FAILED;
453455 /* Reset timeout on failure*/
477479 while ((netreq = upstream->write_queue)) {
478480 stub_cleanup(netreq);
479481 netreq->state = NET_REQ_FINISHED;
480 priv_getdns_check_dns_req_complete(netreq->owner);
482 _getdns_check_dns_req_complete(netreq->owner);
481483 }
482484 while (upstream->netreq_by_query_id.count) {
483485 netreq = (getdns_network_req *)
484 getdns_rbtree_first(&upstream->netreq_by_query_id);
486 _getdns_rbtree_first(&upstream->netreq_by_query_id);
485487 stub_cleanup(netreq);
486488 netreq->state = NET_REQ_FINISHED;
487 priv_getdns_check_dns_req_complete(netreq->owner);
488 }
489 priv_getdns_upstream_shutdown(upstream);
489 _getdns_check_dns_req_complete(netreq->owner);
490 }
491 _getdns_upstream_shutdown(upstream);
490492 }
491493
492494 void
493 priv_getdns_cancel_stub_request(getdns_network_req *netreq)
495 _getdns_cancel_stub_request(getdns_network_req *netreq)
494496 {
495497 stub_cleanup(netreq);
496498 if (netreq->fd >= 0) close(netreq->fd);
506508 * using to keep connections open should we leave the connection up here? */
507509 if (netreq->fd >= 0) close(netreq->fd);
508510 netreq->state = NET_REQ_FINISHED;
509 priv_getdns_check_dns_req_complete(netreq->owner);
511 _getdns_check_dns_req_complete(netreq->owner);
510512 }
511513
512514 static void
528530 stub_cleanup(netreq);
529531 if (netreq->fd >= 0) close(netreq->fd);
530532 if (netreq->owner->user_callback)
531 (void) getdns_context_request_timed_out(netreq->owner);
533 (void) _getdns_context_request_timed_out(netreq->owner);
532534 else {
533535 netreq->state = NET_REQ_FINISHED;
534 priv_getdns_check_dns_req_complete(netreq->owner);
536 _getdns_check_dns_req_complete(netreq->owner);
535537 }
536538 }
537539
547549 upstream->event.timeout_cb = NULL;
548550 upstream->event.read_cb = NULL;
549551 upstream->event.write_cb = NULL;
550 priv_getdns_upstream_shutdown(upstream);
552 _getdns_upstream_shutdown(upstream);
551553 }
552554
553555 static void
694696 query_id_intptr = (intptr_t)query_id;
695697 netreq->node.key = (void *)query_id_intptr;
696698
697 } while (!getdns_rbtree_insert(
699 } while (!_getdns_rbtree_insert(
698700 &netreq->upstream->netreq_by_query_id, &netreq->node));
699701
700702 GLDNS_ID_SET(netreq->query, query_id);
10451047 query_id_intptr = (intptr_t)query_id;
10461048 netreq->node.key = (void *)query_id_intptr;
10471049
1048 } while (!getdns_rbtree_insert(
1050 } while (!_getdns_rbtree_insert(
10491051 &netreq->upstream->netreq_by_query_id, &netreq->node));
10501052
10511053 GLDNS_ID_SET(netreq->query, query_id);
11321134 dnsreq->upstreams->current = 0;
11331135 done:
11341136 netreq->state = NET_REQ_FINISHED;
1135 priv_getdns_check_dns_req_complete(dnsreq);
1137 _getdns_check_dns_req_complete(dnsreq);
11361138 }
11371139
11381140 static void
12111213
12121214 stub_cleanup(netreq);
12131215 close(netreq->fd);
1214 priv_getdns_check_dns_req_complete(dnsreq);
1216 _getdns_check_dns_req_complete(dnsreq);
12151217 }
12161218 }
12171219
12761278 /* Lookup netreq */
12771279 query_id = (uint16_t) q;
12781280 query_id_intptr = (intptr_t) query_id;
1279 netreq = (getdns_network_req *)getdns_rbtree_delete(
1281 netreq = (getdns_network_req *)_getdns_rbtree_delete(
12801282 &upstream->netreq_by_query_id, (void *)query_id_intptr);
12811283 if (! netreq) /* maybe canceled */ {
12821284 /* reset read buffer */
13221324 upstream_reschedule_netreq_events(upstream, netreq);
13231325
13241326 if (netreq->owner != upstream->starttls_req)
1325 priv_getdns_check_dns_req_complete(netreq->owner);
1327 _getdns_check_dns_req_complete(netreq->owner);
13261328 }
13271329 }
13281330
13651367 stub_cleanup(netreq);
13661368 if (fallback_on_write(netreq) == STUB_TCP_ERROR) {
13671369 netreq->state = NET_REQ_FINISHED;
1368 priv_getdns_check_dns_req_complete(netreq->owner);
1370 _getdns_check_dns_req_complete(netreq->owner);
13691371 }
13701372 return;
13711373
14021404 /* Delay the cleanup of the STARTTLS req until the write of the next
14031405 * req in the queue since for sync req, the event on a request is
14041406 * used for the callback that writes the next req. */
1405 dns_req_free(upstream->starttls_req);
1407 _getdns_dns_req_free(upstream->starttls_req);
14061408 upstream->starttls_req = NULL;
14071409 }
14081410 /* With synchonous lookups, schedule the read locally too */
16241626 getdns_upstream *upstream = netreq->upstream;
16251627
16261628 /* Try to find a fallback transport*/
1627 getdns_return_t result = priv_getdns_submit_stub_request(netreq);
1629 getdns_return_t result = _getdns_submit_stub_request(netreq);
16281630
16291631 /* For sync messages we must re-schedule the events on the old upstream
16301632 * here too. Must schedule this last to make sure it is called back first! */
16431645 upstream_reschedule_events(getdns_upstream *upstream, size_t idle_timeout) {
16441646
16451647 DEBUG_STUB("# %s: %p %d\n", __FUNCTION__, upstream, upstream->fd);
1646 int reschedule = 0;
16471648 GETDNS_CLEAR_EVENT(upstream->loop, &upstream->event);
16481649 if (!upstream->write_queue && upstream->event.write_cb) {
16491650 upstream->event.write_cb = NULL;
1650 reschedule = 1;
16511651 }
16521652 if (upstream->write_queue && !upstream->event.write_cb) {
16531653 upstream->event.write_cb = upstream_write_cb;
1654 reschedule = 1;
16551654 }
16561655 if (!upstream->netreq_by_query_id.count && upstream->event.read_cb) {
16571656 upstream->event.read_cb = NULL;
1658 reschedule = 1;
16591657 }
16601658 if (upstream->netreq_by_query_id.count && !upstream->event.read_cb) {
16611659 upstream->event.read_cb = upstream_read_cb;
1662 reschedule = 1;
1663 }
1664 if (reschedule) {
1665 if (upstream->event.read_cb || upstream->event.write_cb)
1666 GETDNS_SCHEDULE_EVENT(upstream->loop,
1667 upstream->fd, TIMEOUT_FOREVER, &upstream->event);
1668 else {
1669 DEBUG_STUB("# %s: *Idle connection %d* \n",
1670 __FUNCTION__, upstream->fd);
1671 upstream->event.timeout_cb = upstream_idle_timeout_cb;
1672 if (upstream->tcp.write_error != 0)
1673 idle_timeout = 0;
1674 GETDNS_SCHEDULE_EVENT(upstream->loop, upstream->fd,
1675 idle_timeout, &upstream->event);
1676 }
1660 }
1661 if (upstream->event.read_cb || upstream->event.write_cb)
1662 GETDNS_SCHEDULE_EVENT(upstream->loop,
1663 upstream->fd, TIMEOUT_FOREVER, &upstream->event);
1664 else {
1665 DEBUG_STUB("# %s: *Idle connection %d* \n",
1666 __FUNCTION__, upstream->fd);
1667 upstream->event.timeout_cb = upstream_idle_timeout_cb;
1668 if (upstream->tcp.write_error != 0)
1669 idle_timeout = 0;
1670 GETDNS_SCHEDULE_EVENT(upstream->loop, upstream->fd,
1671 idle_timeout, &upstream->event);
16771672 }
16781673 }
16791674
17051700 * So we will have to be aggressive and shut the connection....*/
17061701 DEBUG_STUB("# %s: **Closing connection %d**\n",
17071702 __FUNCTION__, upstream->fd);
1708 priv_getdns_upstream_shutdown(upstream);
1703 _getdns_upstream_shutdown(upstream);
17091704 }
17101705 }
17111706
17441739 }
17451740
17461741 getdns_return_t
1747 priv_getdns_submit_stub_request(getdns_network_req *netreq)
1742 _getdns_submit_stub_request(getdns_network_req *netreq)
17481743 {
17491744 DEBUG_STUB("--> %s\n", __FUNCTION__);
17501745 int fd = -1;
17741769 case GETDNS_TRANSPORT_TCP:
17751770 upstream_schedule_netreq(netreq->upstream, netreq);
17761771 /* TODO[TLS]: Change scheduling for sync calls. */
1772 /* For TLS, set a short timeout to catch setup problems. This is reset
1773 when the connection is successful.*/
17771774 GETDNS_CLEAR_EVENT(dnsreq->loop, &netreq->event);
17781775 GETDNS_SCHEDULE_EVENT(
1779 dnsreq->loop, netreq->upstream->fd, dnsreq->context->timeout,
1776 dnsreq->loop, netreq->upstream->fd, /*dnsreq->context->timeout,*/
1777 (transport == GETDNS_TRANSPORT_TLS ?
1778 dnsreq->context->timeout / 2 : dnsreq->context->timeout),
17801779 getdns_eventloop_event_init(&netreq->event, netreq, NULL,
17811780 ( dnsreq->loop != netreq->upstream->loop /* Synchronous lookup? */
1782 ? netreq_upstream_write_cb : NULL), stub_timeout_cb));
1781 ? netreq_upstream_write_cb : NULL),
1782 ( transport == GETDNS_TRANSPORT_TLS ?
1783 stub_tls_timeout_cb : stub_timeout_cb)));
17831784
17841785 return GETDNS_RETURN_GOOD;
17851786 default:
3636 #include "getdns/getdns.h"
3737 #include "types-internal.h"
3838
39 getdns_return_t priv_getdns_submit_stub_request(getdns_network_req *netreq);
39 getdns_return_t _getdns_submit_stub_request(getdns_network_req *netreq);
4040
41 void priv_getdns_cancel_stub_request(getdns_network_req *netreq);
41 void _getdns_cancel_stub_request(getdns_network_req *netreq);
4242
4343 #endif
4444
3333 */
3434
3535 #include <string.h>
36 #include <unbound.h>
3736 #include "getdns/getdns.h"
3837 #include "config.h"
3938 #include "context.h"
4645 #include "gldns/wire2str.h"
4746
4847 typedef struct getdns_sync_loop {
49 getdns_mini_event loop;
48 _getdns_mini_event loop;
49 #ifdef HAVE_LIBUNBOUND
5050 getdns_eventloop_event ub_event;
51 #endif
5152 getdns_context *context;
5253 int to_run;
5354 getdns_dict *response;
5657 static getdns_return_t
5758 getdns_sync_loop_init(getdns_context *context, getdns_sync_loop *loop)
5859 {
59 getdns_return_t r;
60 #ifdef HAVE_LIBUNBOUND
6061 getdns_eventloop *ext = &loop->loop.loop;
62 #endif
63 getdns_return_t r;
6164
6265 loop->response = NULL;
6366 loop->to_run = 1;
6467 loop->context = context;
6568
66 if ((r = getdns_mini_event_init(context, &loop->loop)))
67 return r;
68
69 if ((r = _getdns_mini_event_init(context, &loop->loop)))
70 return r;
71
72 #ifdef HAVE_LIBUNBOUND
6973 loop->ub_event.userarg = loop->context;
70 loop->ub_event.read_cb = priv_getdns_context_ub_read_cb;
74 loop->ub_event.read_cb = _getdns_context_ub_read_cb;
7175 loop->ub_event.write_cb = NULL;
7276 loop->ub_event.timeout_cb = NULL;
7377 loop->ub_event.ev = NULL;
7478
7579 return ext->vmt->schedule(ext, ub_fd(context->unbound_ctx),
7680 TIMEOUT_FOREVER, &loop->ub_event);
81 #else
82 return GETDNS_RETURN_GOOD;
83 #endif
7784 }
7885
7986 static void
8188 {
8289 getdns_eventloop *ext = &loop->loop.loop;
8390
91 #ifdef HAVE_LIBUNBOUND
8492 ext->vmt->clear(ext, &loop->ub_event);
93 #endif
8594 ext->vmt->cleanup(ext);
8695 }
8796
121130 if ((r = getdns_sync_loop_init(context, &loop)))
122131 return r;
123132
124 if ((r = priv_getdns_general_loop(context, &loop.loop.loop, name,
133 if ((r = _getdns_general_loop(context, &loop.loop.loop, name,
125134 request_type, extensions, &loop, NULL, getdns_sync_cb, NULL))) {
126135
127136 getdns_sync_loop_cleanup(&loop);
146155 if ((r = getdns_sync_loop_init(context, &loop)))
147156 return r;
148157
149 if ((r = priv_getdns_address_loop(context, &loop.loop.loop, name,
158 if ((r = _getdns_address_loop(context, &loop.loop.loop, name,
150159 extensions, &loop, NULL, getdns_sync_cb))) {
151160
152161 getdns_sync_loop_cleanup(&loop);
171180 if ((r = getdns_sync_loop_init(context, &loop)))
172181 return r;
173182
174 if ((r = priv_getdns_hostname_loop(context, &loop.loop.loop, address,
183 if ((r = _getdns_hostname_loop(context, &loop.loop.loop, address,
175184 extensions, &loop, NULL, getdns_sync_cb))) {
176185
177186 getdns_sync_loop_cleanup(&loop);
196205 if ((r = getdns_sync_loop_init(context, &loop)))
197206 return r;
198207
199 if ((r = priv_getdns_service_loop(context, &loop.loop.loop, name,
208 if ((r = _getdns_service_loop(context, &loop.loop.loop, name,
200209 extensions, &loop, NULL, getdns_sync_cb))) {
201210
202211 getdns_sync_loop_cleanup(&loop);
208217 GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR;
209218 }
210219
211 void
212 getdns_free_sync_request_memory(struct getdns_dict *response)
213 {
214 getdns_dict_destroy(response);
215 }
216
217220 /* getdns_core_sync.c */
129129 install: getdns_query
130130 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
131131 $(LIBTOOL) --mode=install cp getdns_query $(DESTDIR)$(bindir)
132
133 uninstall:
134 $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/getdns_query
132135
133136 nolibcheck:
134137 @echo "***"
190193 (cd $(srcdir) ; gcc -MM -I. -I.. *.c | \
191194 sed -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
192195 -e 's? \$$(srcdir)/config\.h? ../config.h?g' \
193 -e 's? \.\./getdns/getdns_extra\.h? $$(srcdir)/../getdns/getdns_extra.h?g' \
196 -e 's? $$(srcdir)/\.\./getdns/getdns_extra\.h? ../getdns/getdns_extra.h?g' \
194197 -e 's? \.\./getdns/getdns_ext_libevent\.h? $$(srcdir)/../getdns/getdns_ext_libevent.h?g' \
195198 -e 's? \.\./getdns/getdns_ext_libev\.h? $$(srcdir)/../getdns/getdns_ext_libev.h?g' \
196199 -e 's? \.\./getdns/getdns_ext_libuv\.h? $$(srcdir)/../getdns/getdns_ext_libuv.h?g' \
204207
205208 # Dependencies for the unit tests
206209 check_getdns.lo check_getdns.o: $(srcdir)/check_getdns.c ../getdns/getdns.h $(srcdir)/check_getdns_common.h \
207 $(srcdir)/check_getdns_general.h $(srcdir)/check_getdns_general_sync.h \
208 $(srcdir)/check_getdns_address.h $(srcdir)/check_getdns_address_sync.h \
209 $(srcdir)/check_getdns_hostname.h $(srcdir)/check_getdns_hostname_sync.h \
210 $(srcdir)/check_getdns_context_create.h $(srcdir)/check_getdns_context_destroy.h \
211 $(srcdir)/check_getdns_cancel_callback.h $(srcdir)/check_getdns_list_get_length.h \
212 $(srcdir)/check_getdns_list_get_data_type.h $(srcdir)/check_getdns_list_get_dict.h \
213 $(srcdir)/check_getdns_list_get_list.h $(srcdir)/check_getdns_list_get_int.h \
214 $(srcdir)/check_getdns_list_get_bindata.h $(srcdir)/check_getdns_dict_get_names.h \
215 $(srcdir)/check_getdns_dict_get_data_type.h $(srcdir)/check_getdns_dict_get_dict.h \
216 $(srcdir)/check_getdns_dict_get_list.h $(srcdir)/check_getdns_dict_get_bindata.h \
217 $(srcdir)/check_getdns_dict_get_int.h $(srcdir)/check_getdns_dict_destroy.h \
218 $(srcdir)/check_getdns_dict_set_dict.h $(srcdir)/check_getdns_dict_set_list.h \
219 $(srcdir)/check_getdns_dict_set_bindata.h $(srcdir)/check_getdns_dict_set_int.h \
220 $(srcdir)/check_getdns_convert_ulabel_to_alabel.h \
210 ../getdns/getdns_extra.h $(srcdir)/check_getdns_general.h \
211 $(srcdir)/check_getdns_general_sync.h $(srcdir)/check_getdns_address.h \
212 $(srcdir)/check_getdns_address_sync.h $(srcdir)/check_getdns_hostname.h \
213 $(srcdir)/check_getdns_hostname_sync.h $(srcdir)/check_getdns_context_create.h \
214 $(srcdir)/check_getdns_context_destroy.h $(srcdir)/check_getdns_cancel_callback.h \
215 $(srcdir)/check_getdns_list_get_length.h $(srcdir)/check_getdns_list_get_data_type.h \
216 $(srcdir)/check_getdns_list_get_dict.h $(srcdir)/check_getdns_list_get_list.h \
217 $(srcdir)/check_getdns_list_get_int.h $(srcdir)/check_getdns_list_get_bindata.h \
218 $(srcdir)/check_getdns_dict_get_names.h $(srcdir)/check_getdns_dict_get_data_type.h \
219 $(srcdir)/check_getdns_dict_get_dict.h $(srcdir)/check_getdns_dict_get_list.h \
220 $(srcdir)/check_getdns_dict_get_bindata.h $(srcdir)/check_getdns_dict_get_int.h \
221 $(srcdir)/check_getdns_dict_destroy.h $(srcdir)/check_getdns_dict_set_dict.h \
222 $(srcdir)/check_getdns_dict_set_list.h $(srcdir)/check_getdns_dict_set_bindata.h \
223 $(srcdir)/check_getdns_dict_set_int.h $(srcdir)/check_getdns_convert_ulabel_to_alabel.h \
221224 $(srcdir)/check_getdns_convert_alabel_to_ulabel.h $(srcdir)/check_getdns_pretty_print_dict.h \
222225 $(srcdir)/check_getdns_display_ip_address.h \
223226 $(srcdir)/check_getdns_context_set_context_update_callback.h \
226229 $(srcdir)/check_getdns_service.h $(srcdir)/check_getdns_service_sync.h \
227230 $(srcdir)/check_getdns_transport.h
228231 check_getdns_common.lo check_getdns_common.o: $(srcdir)/check_getdns_common.c ../getdns/getdns.h \
229 ../config.h $(srcdir)/check_getdns_common.h $(srcdir)/check_getdns_eventloop.h
232 ../config.h $(srcdir)/check_getdns_common.h ../getdns/getdns_extra.h \
233 $(srcdir)/check_getdns_eventloop.h
230234 check_getdns_context_set_timeout.lo check_getdns_context_set_timeout.o: $(srcdir)/check_getdns_context_set_timeout.c \
231235 $(srcdir)/check_getdns_context_set_timeout.h $(srcdir)/check_getdns_common.h \
232 ../getdns/getdns.h
236 ../getdns/getdns.h ../getdns/getdns_extra.h
233237 check_getdns_libev.lo check_getdns_libev.o: $(srcdir)/check_getdns_libev.c $(srcdir)/check_getdns_eventloop.h \
234238 ../config.h ../getdns/getdns.h $(srcdir)/../getdns/getdns_ext_libev.h \
235 $(srcdir)/../getdns/getdns_extra.h $(srcdir)/check_getdns_common.h
239 ../getdns/getdns_extra.h $(srcdir)/check_getdns_common.h
236240 check_getdns_libevent.lo check_getdns_libevent.o: $(srcdir)/check_getdns_libevent.c $(srcdir)/check_getdns_eventloop.h \
237241 ../config.h ../getdns/getdns.h $(srcdir)/../getdns/getdns_ext_libevent.h \
238 $(srcdir)/../getdns/getdns_extra.h $(srcdir)/check_getdns_libevent.h $(srcdir)/check_getdns_common.h
242 ../getdns/getdns_extra.h $(srcdir)/check_getdns_libevent.h $(srcdir)/check_getdns_common.h
239243 check_getdns_libuv.lo check_getdns_libuv.o: $(srcdir)/check_getdns_libuv.c $(srcdir)/check_getdns_eventloop.h \
240244 ../config.h ../getdns/getdns.h $(srcdir)/../getdns/getdns_ext_libuv.h \
241 $(srcdir)/../getdns/getdns_extra.h $(srcdir)/check_getdns_common.h
245 ../getdns/getdns_extra.h $(srcdir)/check_getdns_common.h
242246 check_getdns_selectloop.lo check_getdns_selectloop.o: $(srcdir)/check_getdns_selectloop.c \
243247 $(srcdir)/check_getdns_eventloop.h ../config.h ../getdns/getdns.h \
244 $(srcdir)/../getdns/getdns_extra.h
248 ../getdns/getdns_extra.h
245249 check_getdns_transport.lo check_getdns_transport.o: $(srcdir)/check_getdns_transport.c \
246 $(srcdir)/check_getdns_transport.h $(srcdir)/check_getdns_common.h ../getdns/getdns.h
250 $(srcdir)/check_getdns_transport.h $(srcdir)/check_getdns_common.h ../getdns/getdns.h \
251 ../getdns/getdns_extra.h
247252 getdns_query.lo getdns_query.o: $(srcdir)/getdns_query.c ../config.h ../getdns/getdns.h \
248 $(srcdir)/../getdns/getdns_extra.h
253 ../getdns/getdns_extra.h
249254 testmessages.lo testmessages.o: $(srcdir)/testmessages.c $(srcdir)/testmessages.h
250255 tests_dict.lo tests_dict.o: $(srcdir)/tests_dict.c $(srcdir)/testmessages.h ../getdns/getdns.h
251256 tests_list.lo tests_list.o: $(srcdir)/tests_list.c $(srcdir)/testmessages.h ../getdns/getdns.h
252257 tests_namespaces.lo tests_namespaces.o: $(srcdir)/tests_namespaces.c $(srcdir)/testmessages.h ../getdns/getdns.h
253258 tests_stub_async.lo tests_stub_async.o: $(srcdir)/tests_stub_async.c ../config.h $(srcdir)/testmessages.h \
254 ../getdns/getdns.h $(srcdir)/../getdns/getdns_extra.h
259 ../getdns/getdns.h ../getdns/getdns_extra.h
255260 tests_stub_sync.lo tests_stub_sync.o: $(srcdir)/tests_stub_sync.c $(srcdir)/testmessages.h ../getdns/getdns.h
2828 #include <stdio.h>
2929 #include <stdlib.h>
3030 #include <string.h>
31 #include <dirent.h>
31 #include <inttypes.h>
3232 #include <getdns/getdns.h>
3333 #include <getdns/getdns_extra.h>
34 #include <types-internal.h>
34
35 #if 0
36 #define DEBUG_GQ(...) do {fprintf(stderr, __VA_ARGS__);} while (0)
37 #else
38 #define DEBUG_GQ(...) do {} while (0)
39 #endif
40
41 #define MAX_TIMEOUTS FD_SETSIZE
42
43 /* Eventloop based on select */
44 typedef struct my_eventloop {
45 getdns_eventloop base;
46 getdns_eventloop_event *fd_events[FD_SETSIZE];
47 uint64_t fd_timeout_times[FD_SETSIZE];
48 getdns_eventloop_event *timeout_events[MAX_TIMEOUTS];
49 uint64_t timeout_times[MAX_TIMEOUTS];
50 } my_eventloop;
51
52 static uint64_t get_now_plus(uint64_t amount)
53 {
54 struct timeval tv;
55 uint64_t now;
56
57 if (gettimeofday(&tv, NULL)) {
58 perror("gettimeofday() failed");
59 exit(EXIT_FAILURE);
60 }
61 now = tv.tv_sec * 1000000 + tv.tv_usec;
62
63 return (now + amount * 1000) >= now ? now + amount * 1000 : -1;
64 }
65
66 getdns_return_t
67 my_eventloop_schedule(getdns_eventloop *loop,
68 int fd, uint64_t timeout, getdns_eventloop_event *event)
69 {
70 my_eventloop *my_loop = (my_eventloop *)loop;
71 size_t i;
72
73 assert(loop);
74 assert(event);
75 assert(fd < FD_SETSIZE);
76
77 DEBUG_GQ( "%s(loop: %p, fd: %d, timeout: %"PRIu64", event: %p)\n"
78 , __FUNCTION__, loop, fd, timeout, event);
79 if (fd >= 0 && (event->read_cb || event->write_cb)) {
80 assert(my_loop->fd_events[fd] == NULL);
81
82 my_loop->fd_events[fd] = event;
83 my_loop->fd_timeout_times[fd] = get_now_plus(timeout);
84 event->ev = (void *) (intptr_t) fd + 1;
85
86 DEBUG_GQ( "scheduled read/write at %d\n", fd);
87 return GETDNS_RETURN_GOOD;
88 }
89
90 assert(event->timeout_cb && !event->read_cb && !event->write_cb);
91
92 for (i = 0; i < MAX_TIMEOUTS; i++) {
93 if (my_loop->timeout_events[i] == NULL) {
94 my_loop->timeout_events[i] = event;
95 my_loop->timeout_times[i] = get_now_plus(timeout);
96 event->ev = (void *) (intptr_t) i + 1;
97
98 DEBUG_GQ( "scheduled timeout at %d\n", (int)i);
99 return GETDNS_RETURN_GOOD;
100 }
101 }
102 return GETDNS_RETURN_GENERIC_ERROR;
103 }
104
105 getdns_return_t
106 my_eventloop_clear(getdns_eventloop *loop, getdns_eventloop_event *event)
107 {
108 my_eventloop *my_loop = (my_eventloop *)loop;
109 size_t i;
110
111 assert(loop);
112 assert(event);
113
114 DEBUG_GQ( "%s(loop: %p, event: %p)\n", __FUNCTION__, loop, event);
115
116 i = (intptr_t)event->ev - 1;
117 assert(i >= 0 && i < FD_SETSIZE);
118
119 if (event->timeout_cb && !event->read_cb && !event->write_cb) {
120 assert(my_loop->timeout_events[i] == event);
121 my_loop->timeout_events[i] = NULL;
122 } else {
123 assert(my_loop->fd_events[i] == event);
124 my_loop->fd_events[i] = NULL;
125 }
126 event->ev = NULL;
127 return GETDNS_RETURN_GOOD;
128 }
129
130 void my_eventloop_cleanup(getdns_eventloop *loop)
131 {
132 }
133
134 void my_read_cb(int fd, getdns_eventloop_event *event)
135 {
136 DEBUG_GQ( "%s(fd: %d, event: %p)\n", __FUNCTION__, fd, event);
137 event->read_cb(event->userarg);
138 }
139
140 void my_write_cb(int fd, getdns_eventloop_event *event)
141 {
142 DEBUG_GQ( "%s(fd: %d, event: %p)\n", __FUNCTION__, fd, event);
143 event->write_cb(event->userarg);
144 }
145
146 void my_timeout_cb(int fd, getdns_eventloop_event *event)
147 {
148 DEBUG_GQ( "%s(fd: %d, event: %p)\n", __FUNCTION__, fd, event);
149 event->timeout_cb(event->userarg);
150 }
151
152 void my_eventloop_run_once(getdns_eventloop *loop, int blocking)
153 {
154 my_eventloop *my_loop = (my_eventloop *)loop;
155
156 fd_set readfds, writefds;
157 int fd, max_fd = -1;
158 uint64_t now, timeout = (uint64_t)-1;
159 size_t i;
160 struct timeval tv;
161
162 assert(loop);
163
164 FD_ZERO(&readfds);
165 FD_ZERO(&writefds);
166 now = get_now_plus(0);
167
168 for (i = 0; i < MAX_TIMEOUTS; i++) {
169 if (!my_loop->timeout_events[i])
170 continue;
171 if (now > my_loop->timeout_times[i])
172 my_timeout_cb(-1, my_loop->timeout_events[i]);
173 else if (my_loop->timeout_times[i] < timeout)
174 timeout = my_loop->timeout_times[i];
175 }
176 for (fd = 0; fd < FD_SETSIZE; fd++) {
177 if (!my_loop->fd_events[fd])
178 continue;
179 if (my_loop->fd_events[fd]->read_cb)
180 FD_SET(fd, &readfds);
181 if (my_loop->fd_events[fd]->write_cb)
182 FD_SET(fd, &writefds);
183 if (fd > max_fd)
184 max_fd = fd;
185 if (my_loop->fd_timeout_times[fd] < timeout)
186 timeout = my_loop->fd_timeout_times[fd];
187 }
188 if (max_fd == -1 && timeout == (uint64_t)-1)
189 return;
190
191 if (! blocking || now > timeout) {
192 tv.tv_sec = 0;
193 tv.tv_usec = 0;
194 } else {
195 tv.tv_sec = (timeout - now) / 1000000;
196 tv.tv_usec = (timeout - now) % 1000000;
197 }
198 if (select(max_fd + 1, &readfds, &writefds, NULL, &tv) < 0) {
199 perror("select() failed");
200 exit(EXIT_FAILURE);
201 }
202 now = get_now_plus(0);
203 for (fd = 0; fd < FD_SETSIZE; fd++) {
204 if (my_loop->fd_events[fd] &&
205 my_loop->fd_events[fd]->read_cb &&
206 FD_ISSET(fd, &readfds))
207 my_read_cb(fd, my_loop->fd_events[fd]);
208
209 if (my_loop->fd_events[fd] &&
210 my_loop->fd_events[fd]->write_cb &&
211 FD_ISSET(fd, &writefds))
212 my_write_cb(fd, my_loop->fd_events[fd]);
213
214 if (my_loop->fd_events[fd] &&
215 my_loop->fd_events[fd]->timeout_cb &&
216 now > my_loop->fd_timeout_times[fd])
217 my_timeout_cb(fd, my_loop->fd_events[fd]);
218
219 i = fd;
220 if (my_loop->timeout_events[i] &&
221 my_loop->timeout_events[i]->timeout_cb &&
222 now > my_loop->timeout_times[i])
223 my_timeout_cb(-1, my_loop->timeout_events[i]);
224 }
225 }
226
227 void my_eventloop_run(getdns_eventloop *loop)
228 {
229 my_eventloop *my_loop = (my_eventloop *)loop;
230 size_t i;
231
232 assert(loop);
233
234 i = 0;
235 while (i < MAX_TIMEOUTS) {
236 if (my_loop->fd_events[i] || my_loop->timeout_events[i]) {
237 my_eventloop_run_once(loop, 1);
238 i = 0;
239 } else {
240 i++;
241 }
242 }
243 }
244
245 void my_eventloop_init(my_eventloop *loop)
246 {
247 static getdns_eventloop_vmt my_eventloop_vmt = {
248 my_eventloop_cleanup,
249 my_eventloop_schedule,
250 my_eventloop_clear,
251 my_eventloop_run,
252 my_eventloop_run_once
253 };
254
255 (void) memset(loop, 0, sizeof(my_eventloop));
256 loop->base.vmt = &my_eventloop_vmt;
257 }
35258
36259 static int quiet = 0;
37260 static int batch_mode = 0;
103326 fill_transport_list(getdns_context *context, char *transport_list_str,
104327 getdns_transport_list_t *transports, size_t *transport_count)
105328 {
106 for (size_t i = 0; i < strlen(transport_list_str); i++, (*transport_count)++) {
329 size_t max_transports = *transport_count;
330 *transport_count = 0;
331 for ( size_t i = 0
332 ; i < max_transports && i < strlen(transport_list_str)
333 ; i++, (*transport_count)++) {
107334 switch(*(transport_list_str + i)) {
108335 case 'U':
109336 transports[i] = GETDNS_TRANSPORT_UDP;
268495 free(response_str);
269496 }
270497 fprintf(stdout,
271 "Result: The callback with ID %llu was successfull.\n",
498 "Response code was: GOOD. Status was: Callback with ID %llu was successfull.\n",
272499 (unsigned long long)trans_id);
273500
274501 } else if (callback_type == GETDNS_CALLBACK_CANCEL)
275502 fprintf(stderr,
276 "Result: The callback with ID %llu was cancelled. Exiting.\n",
503 "An error occurred: The callback with ID %llu was cancelled. Exiting.\n",
277504 (unsigned long long)trans_id);
278505 else {
279506 fprintf(stderr,
280 "Result: The callback got a callback_type of %d. Exiting.\n",
507 "An error occurred: The callback got a callback_type of %d. Exiting.\n",
281508 callback_type);
282509 fprintf(stderr,
283510 "Error : '%s'\n",
542769 "after -l\n");
543770 return GETDNS_RETURN_GENERIC_ERROR;
544771 }
545 size_t transport_count = 0;
546 getdns_transport_list_t transports[GETDNS_TRANSPORTS_MAX];
772 getdns_transport_list_t transports[10];
773 size_t transport_count = sizeof(transports);
547774 if ((r = fill_transport_list(context, argv[i], transports, &transport_count)) ||
548775 (r = getdns_context_set_dns_transport_list(context,
549776 transport_count, transports))){
588815 return r;
589816 }
590817
818 getdns_return_t do_the_call(void)
819 {
820 getdns_return_t r;
821 getdns_dict *address = NULL;
822 getdns_dict *response = NULL;
823 char *response_str;
824 uint32_t status;
825
826 if (calltype == HOSTNAME &&
827 !(address = ipaddr_dict(context, name))) {
828 fprintf(stderr, "Could not convert \"%s\" "
829 "to an IP address", name);
830 return GETDNS_RETURN_GOOD;
831 }
832 if (async) {
833 switch (calltype) {
834 case GENERAL:
835 r = getdns_general(context, name, request_type,
836 extensions, &response, NULL, callback);
837 break;
838 case ADDRESS:
839 r = getdns_address(context, name,
840 extensions, &response, NULL, callback);
841 break;
842 case HOSTNAME:
843 r = getdns_hostname(context, address,
844 extensions, &response, NULL, callback);
845 break;
846 case SERVICE:
847 r = getdns_service(context, name,
848 extensions, &response, NULL, callback);
849 break;
850 default:
851 r = GETDNS_RETURN_GENERIC_ERROR;
852 break;
853 }
854 if (r == GETDNS_RETURN_GOOD && !batch_mode)
855 getdns_context_run(context);
856 } else {
857 switch (calltype) {
858 case GENERAL:
859 r = getdns_general_sync(context, name,
860 request_type, extensions, &response);
861 break;
862 case ADDRESS:
863 r = getdns_address_sync(context, name,
864 extensions, &response);
865 break;
866 case HOSTNAME:
867 r = getdns_hostname_sync(context, address,
868 extensions, &response);
869 break;
870 case SERVICE:
871 r = getdns_service_sync(context, name,
872 extensions, &response);
873 break;
874 default:
875 r = GETDNS_RETURN_GENERIC_ERROR;
876 break;
877 }
878 if (r != GETDNS_RETURN_GOOD) {
879 fprintf(stderr, "An error occurred: %d '%s'\n", r,
880 getdns_get_errorstr_by_id(r));
881 return r;
882 }
883 if (response && !quiet) {
884 if ((response_str = json ?
885 getdns_print_json_dict(response, json == 1)
886 : getdns_pretty_print_dict(response))) {
887
888 fprintf( stdout, "SYNC response:\n%s\n"
889 , response_str);
890 validate_chain(response);
891 free(response_str);
892 } else {
893 r = GETDNS_RETURN_MEMORY_ERROR;
894 fprintf( stderr
895 , "Could not print response\n");
896 }
897 }
898 getdns_dict_get_int(response, "status", &status);
899 fprintf(stdout, "Response code was: GOOD. Status was: %s\n",
900 getdns_get_errorstr_by_id(status));
901 if (response)
902 getdns_dict_destroy(response);
903 }
904 return r;
905 }
906
907 my_eventloop my_loop;
908 FILE *fp;
909
910 void read_line_cb(void *userarg)
911 {
912 getdns_eventloop_event *read_line_ev = userarg;
913 getdns_return_t r;
914
915 char line[1024], *token, *linev[256];
916 int linec;
917
918 if (!fgets(line, 1024, fp) || !*line) {
919 if (query_file)
920 fprintf(stdout,"End of file.");
921 my_eventloop_clear(&my_loop.base, read_line_ev);
922 return;
923 }
924 if (query_file)
925 fprintf(stdout,"Found query: %s", line);
926
927 linev[0] = __FILE__;
928 linec = 1;
929 if (!(token = strtok(line, " \t\f\n\r"))) {
930 if (! query_file) {
931 printf("> ");
932 fflush(stdout);
933 }
934 return;
935 }
936 if (*token == '#') {
937 fprintf(stdout,"Result: Skipping comment\n");
938 if (! query_file) {
939 printf("> ");
940 fflush(stdout);
941 }
942 return;
943 }
944 do linev[linec++] = token;
945 while (linec < 256 && (token = strtok(NULL, " \t\f\n\r")));
946
947 if (((r = parse_args(linec, linev)) || (r = do_the_call())) &&
948 (r != CONTINUE && r != CONTINUE_ERROR))
949 my_eventloop_clear(&my_loop.base, read_line_ev);
950
951 else if (! query_file) {
952 printf("> ");
953 fflush(stdout);
954 }
955 }
956
591957 int
592958 main(int argc, char **argv)
593959 {
594 getdns_dict *response = NULL;
595 char *response_str;
596960 getdns_return_t r;
597 getdns_dict *address = NULL;
598 FILE *fp = NULL;
599961
600962 name = the_root;
601963 if ((r = getdns_context_create(&context, 1))) {
602964 fprintf(stderr, "Create context failed: %d\n", r);
603965 return r;
604966 }
967 my_eventloop_init(&my_loop);
968 if ((r = getdns_context_set_eventloop(context, &my_loop.base)))
969 goto done_destroy_context;
970 if ((r = getdns_context_set_use_threads(context, 1)))
971 goto done_destroy_context;
605972 extensions = getdns_dict_create();
606973 if (! extensions) {
607974 fprintf(stderr, "Could not create extensions dict\n");
617984 fprintf(stderr, "Could not open query file: %s\n", query_file);
618985 goto done_destroy_context;
619986 }
620 }
987 } else
988 fp = stdin;
621989
622990 /* Make the call */
623 do {
624 char line[1024], *token, *linev[256];
625 int linec;
626 if (interactive) {
627 if (!query_file) {
628 fprintf(stdout, "> ");
629 if (!fgets(line, 1024, stdin) || !*line)
630 break;
631 } else {
632 if (!fgets(line, 1024, fp) || !*line) {
633 fprintf(stdout,"End of file.");
634 break;
635 }
636 fprintf(stdout,"Found query: %s", line);
637 }
638
639 linev[0] = argv[0];
640 linec = 1;
641 if ( ! (token = strtok(line, " \t\f\n\r")))
642 continue;
643 if (*token == '#') {
644 fprintf(stdout,"Result: Skipping comment\n");
645 continue;
646 }
647 do linev[linec++] = token;
648 while (linec < 256 &&
649 (token = strtok(NULL, " \t\f\n\r")));
650 if ((r = parse_args(linec, linev))) {
651 if (r == CONTINUE || r == CONTINUE_ERROR)
652 continue;
653 else
654 goto done_destroy_context;
655 }
656
657 }
658 if (calltype == HOSTNAME &&
659 !(address = ipaddr_dict(context, name))) {
660 fprintf(stderr, "Could not convert \"%s\" "
661 "to an IP address", name);
662 continue;
663 }
664 if (async) {
665 switch (calltype) {
666 case GENERAL:
667 r = getdns_general(context, name, request_type,
668 extensions, &response, NULL, callback);
669 break;
670 case ADDRESS:
671 r = getdns_address(context, name,
672 extensions, &response, NULL, callback);
673 break;
674 case HOSTNAME:
675 r = getdns_hostname(context, address,
676 extensions, &response, NULL, callback);
677 break;
678 case SERVICE:
679 r = getdns_service(context, name,
680 extensions, &response, NULL, callback);
681 break;
682 default:
683 r = GETDNS_RETURN_GENERIC_ERROR;
684 break;
685 }
686 if (r)
687 goto done_destroy_extensions;
688 if (!batch_mode)
689 getdns_context_run(context);
690 } else {
691 switch (calltype) {
692 case GENERAL:
693 r = getdns_general_sync(context, name,
694 request_type, extensions, &response);
695 break;
696 case ADDRESS:
697 r = getdns_address_sync(context, name,
698 extensions, &response);
699 break;
700 case HOSTNAME:
701 r = getdns_hostname_sync(context, address,
702 extensions, &response);
703 break;
704 case SERVICE:
705 r = getdns_service_sync(context, name,
706 extensions, &response);
707 break;
708 default:
709 r = GETDNS_RETURN_GENERIC_ERROR;
710 break;
711 }
712 if (response && !quiet) {
713 if ((response_str = json ?
714 getdns_print_json_dict(response, json == 1)
715 : getdns_pretty_print_dict(response))) {
716
717 fprintf( stdout, "SYNC response:\n%s\n"
718 , response_str);
719 validate_chain(response);
720 free(response_str);
721 } else {
722 r = GETDNS_RETURN_MEMORY_ERROR;
723 fprintf( stderr
724 , "Could not print response\n");
725 }
726 }
727 if (r == GETDNS_RETURN_GOOD) {
728 uint32_t status;
729 getdns_dict_get_int(response, "status", &status);
730 fprintf(stdout, "Response code was: GOOD. Status was: %s\n",
731 getdns_get_errorstr_by_id(status));
732 } else
733 fprintf(stderr, "An error occurred: %d '%s'\n", r,
734 getdns_get_errorstr_by_id(r));
735 }
736 } while (interactive);
737
738 if (batch_mode)
991 if (interactive) {
992 getdns_eventloop_event read_line_ev = {
993 &read_line_ev, read_line_cb, NULL, NULL, NULL };
994 (void) my_eventloop_schedule(
995 &my_loop.base, fileno(fp), -1, &read_line_ev);
996 if (!query_file) {
997 printf("> ");
998 fflush(stdout);
999 }
1000 my_eventloop_run(&my_loop.base);
1001 }
1002 else
1003 r = do_the_call();
1004
1005 if ((r == GETDNS_RETURN_GOOD && batch_mode))
7391006 getdns_context_run(context);
7401007
7411008 /* Clean up */
742 done_destroy_extensions:
7431009 getdns_dict_destroy(extensions);
7441010 done_destroy_context:
745 if (response) getdns_dict_destroy(response);
7461011 getdns_context_destroy(context);
7471012
7481013 if (fp)
4141 #define GETDNS_LIST_BLOCKSZ 10
4242
4343
44 /* TODO: might want a separate unit test for getdns_list_copy() - right now the code gets
44 /* TODO: might want a separate unit test for _getdns_list_copy() - right now the code gets
4545 covered as a result of other tests */
4646
4747 /*---------------------------------------- tst_bindatasetget */
0 #!/usr/bin/env bash
1
2 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
3 SERVER_IP="8.8.8.8"
4 TLS_SERVER_IP="185.49.141.38"
5 GOOD_RESULT_SYNC="Status was: At least one response was returned"
6 GOOD_RESULT_ASYNC="successfull"
7 BAD_RESULT_SYNC="1 'Generic error'"
8 BAD_RESULT_ASYNC="callback_type of 703"
9 GOOD_COUNT=0
10 FAIL_COUNT=0
11
12 check_good () {
13 result=`echo $1 | grep "Response code was: GOOD." | tail -1 | sed 's/ All done.'// | sed 's/Response code was: GOOD. '//`
14 async_success=`echo $result | grep -c "$GOOD_RESULT_ASYNC"`
15 if [[ $result =~ $GOOD_RESULT_SYNC ]] || [[ $async_success =~ 1 ]]; then
16 (( GOOD_COUNT++ ))
17 echo -n "PASS: "
18 else
19 (( FAIL_COUNT++ ))
20 echo "FAIL (RESULT): " $1
21 echo -n "FAIL: "
22 fi
23 }
24
25 check_bad () {
26 result=`echo $1 | grep "An error occurred:" | tail -1 | sed 's/ All done.'//`
27 error=` echo $result | sed 's/An error occurred: //'`
28 if [[ ! -z $result ]]; then
29 if [[ $error =~ $BAD_RESULT_SYNC ]] || [[ $error =~ $BAD_RESULT_ASYNC ]]; then
30 (( GOOD_COUNT++ ))
31 echo -n "PASS:"
32 else
33 (( FAIL_COUNT++ ))
34 echo "FAIL (RESULT): " $error
35 echo -n "FAIL: "
36 fi
37 else
38 (( FAIL_COUNT++ ))
39 echo "FAIL (RESULT): " $1
40 echo -n "FAIL: "
41 fi
42 }
43
44 usage () {
45 echo "This is a basic and temporary testing script for the transport list"
46 echo "functionality that utilises getdns_query to perform multiple queries."
47 echo "It will be replaced by an automated test harness in future, but"
48 echo "it can be used to check the basic functionality for now. It is recommended that"
49 echo "local or known test servers are used, but it should work with the default servers:"
50 echo " - Google Open DNS for TCP and UDP only "
51 echo "- the getdnsapi.net test server Open Resolver for TLS, STARTTLS, TCP and UDP"
52 echo "NOTE: By default this script assumes it is located in the same directory"
53 echo "as the getdns_query binary. If it is not, then the location of the binary"
54 echo "can be specified via the command line option."
55 echo
56 echo "usage: test_transport.sh"
57 ehco " -p path to getdns_query binary"
58 echo " -s server configured for only TCP and UDP"
59 echo " -t server configured for TLS, STARTTLS, TCP and UDP"
60 }
61
62 while getopts ":p:s:t:dh" opt; do
63 case $opt in
64 d ) set -x ;;
65 p ) DIR=$OPTARG ;;
66 s ) SERVER_IP=$OPTARG ; echo "Setting server to $OPTARG" ;;
67 t ) TLS_SERVER_IP=$OPTARG ; echo "Setting TLS server to $OPTARG" ;;
68 h ) usage ; exit ;;
69 esac
70 done
71
72 GOOD_QUERIES=(
73 "-s -A -q getdnsapi.net -l U @${SERVER_IP} "
74 "-s -A -q getdnsapi.net -l T @${SERVER_IP} "
75 "-s -A -q getdnsapi.net -l L @${TLS_SERVER_IP}"
76 "-s -A -q getdnsapi.net -l S @${TLS_SERVER_IP}")
77
78 GOOD_FALLBACK_QUERIES=(
79 "-s -A -q getdnsapi.net -l LT @${SERVER_IP}"
80 "-s -A -q getdnsapi.net -l LU @${SERVER_IP}"
81 "-s -A -q getdnsapi.net -l L @${SERVER_IP} @${TLS_SERVER_IP}"
82 "-s -G -q DNSKEY getdnsapi.net -l UT @${SERVER_IP} -b 512 -D")
83
84 NOT_AVAILABLE_QUERIES=(
85 "-s -A -q getdnsapi.net -l L @${SERVER_IP} "
86 "-s -A -q getdnsapi.net -l S @${SERVER_IP} "
87 "-s -G -q DNSKEY getdnsapi.net -l U @${SERVER_IP} -b 512 -D")
88
89 echo "Starting transport test"
90 echo
91 for (( i = 0; i < 2; i+=1 )); do
92 if [[ i -eq 0 ]]; then
93 echo "**SYNC Mode**"
94 else
95 echo
96 echo "**ASYNC Mode**"
97 SYNC_MODE=" -a "
98 fi
99
100 echo "*Success cases:"
101 for (( j = 0; j < ${#GOOD_QUERIES[@]}; j+=1 )); do
102 check_good "`$DIR/getdns_query $SYNC_MODE ${GOOD_QUERIES[${j}]} 2>/dev/null`"
103 echo "getdns_query $SYNC_MODE ${GOOD_QUERIES[${j}]}"
104 (( COUNT++ ))
105 done
106
107 echo "*Success fallback cases:"
108 for (( j = 0; j < ${#GOOD_FALLBACK_QUERIES[@]}; j+=1 )); do
109 check_good "`$DIR/getdns_query $SYNC_MODE ${GOOD_FALLBACK_QUERIES[${j}]} 2>/dev/null`"
110 echo "getdns_query $SYNC_MODE ${GOOD_FALLBACK_QUERIES[${j}]}"
111 (( COUNT++ ))
112 done
113
114 echo "*Transport not available cases:"
115 for (( j = 0; j < ${#NOT_AVAILABLE_QUERIES[@]}; j+=1 )); do
116 check_bad "`$DIR/getdns_query $SYNC_MODE ${NOT_AVAILABLE_QUERIES[${j}]} 2>&1`"
117 echo "getdns_query $SYNC_MODE ${NOT_AVAILABLE_QUERIES[${j}]}"
118 (( COUNT++ ))
119 done
120 done
121
122 echo
123 echo "Finished transport test: did $COUNT queries, $GOOD_COUNT passes, $FAIL_COUNT failures"
124 echo
174174 typedef struct getdns_network_req
175175 {
176176 /* For storage in upstream->netreq_by_query_id */
177 getdns_rbnode_t node;
177 _getdns_rbnode_t node;
178178 /* the async_id from unbound */
179179 int unbound_id;
180180 /* state var */
226226 */
227227 typedef struct getdns_dns_req {
228228 /* For storage in context->outbound_requests */
229 getdns_rbnode_t node;
229 _getdns_rbnode_t node;
230230
231231 /* name */
232232 uint8_t name[256];
320320 extern getdns_dict *dnssec_ok_checking_disabled;
321321
322322 /* dns request utils */
323 getdns_dns_req *dns_req_new(getdns_context *context, getdns_eventloop *loop,
323 getdns_dns_req *_getdns_dns_req_new(getdns_context *context, getdns_eventloop *loop,
324324 const char *name, uint16_t request_type, getdns_dict *extensions);
325325
326 void dns_req_free(getdns_dns_req * req);
326 void _getdns_dns_req_free(getdns_dns_req * req);
327327
328328 #endif
329329 /* types-internal.h */
5151 #include "util/fptr_wlist.h"
5252
5353 /** compare events in tree, based on timevalue, ptr for uniqueness */
54 int getdns_mini_ev_cmp(const void* a, const void* b)
55 {
56 const struct getdns_event *e = (const struct getdns_event*)a;
57 const struct getdns_event *f = (const struct getdns_event*)b;
54 int _getdns_mini_ev_cmp(const void* a, const void* b)
55 {
56 const struct _getdns_event *e = (const struct _getdns_event*)a;
57 const struct _getdns_event *f = (const struct _getdns_event*)b;
5858 if(e->ev_timeout.tv_sec < f->ev_timeout.tv_sec)
5959 return -1;
6060 if(e->ev_timeout.tv_sec > f->ev_timeout.tv_sec)
7272
7373 /** set time */
7474 static int
75 settime(struct getdns_event_base* base)
75 settime(struct _getdns_event_base* base)
7676 {
7777 if(gettimeofday(base->time_tv, NULL) < 0) {
7878 return -1;
8484 }
8585
8686 /** create event base */
87 void *getdns_event_init(time_t* time_secs, struct timeval* time_tv)
88 {
89 struct getdns_event_base* base = (struct getdns_event_base*)malloc(
90 sizeof(struct getdns_event_base));
87 void *_getdns_event_init(time_t* time_secs, struct timeval* time_tv)
88 {
89 struct _getdns_event_base* base = (struct _getdns_event_base*)malloc(
90 sizeof(struct _getdns_event_base));
9191 if(!base)
9292 return NULL;
9393 memset(base, 0, sizeof(*base));
9494 base->time_secs = time_secs;
9595 base->time_tv = time_tv;
9696 if(settime(base) < 0) {
97 getdns_event_base_free(base);
98 return NULL;
99 }
100 base->times = getdns_rbtree_create(getdns_mini_ev_cmp);
97 _getdns_event_base_free(base);
98 return NULL;
99 }
100 base->times = _getdns_rbtree_create(_getdns_mini_ev_cmp);
101101 if(!base->times) {
102 getdns_event_base_free(base);
102 _getdns_event_base_free(base);
103103 return NULL;
104104 }
105105 base->capfd = MAX_FDS;
107107 if((int)FD_SETSIZE < base->capfd)
108108 base->capfd = (int)FD_SETSIZE;
109109 #endif
110 base->fds = (struct getdns_event**)calloc((size_t)base->capfd,
111 sizeof(struct getdns_event*));
110 base->fds = (struct _getdns_event**)calloc((size_t)base->capfd,
111 sizeof(struct _getdns_event*));
112112 if(!base->fds) {
113 getdns_event_base_free(base);
114 return NULL;
115 }
116 base->signals = (struct getdns_event**)calloc(MAX_SIG, sizeof(struct getdns_event*));
113 _getdns_event_base_free(base);
114 return NULL;
115 }
116 base->signals = (struct _getdns_event**)calloc(MAX_SIG, sizeof(struct _getdns_event*));
117117 if(!base->signals) {
118 getdns_event_base_free(base);
118 _getdns_event_base_free(base);
119119 return NULL;
120120 }
121121 #ifndef S_SPLINT_S
126126 }
127127
128128 /** get version */
129 const char *getdns_event_get_version(void)
129 const char *_getdns_event_get_version(void)
130130 {
131131 return "mini-event-"PACKAGE_VERSION;
132132 }
133133
134134 /** get polling method, select */
135 const char *getdns_event_get_method(void)
135 const char *_getdns_event_get_method(void)
136136 {
137137 return "select";
138138 }
139139
140140 /** call timeouts handlers, and return how long to wait for next one or -1 */
141 void getdns_handle_timeouts(struct getdns_event_base* base, struct timeval* now,
141 void _getdns_handle_timeouts(struct _getdns_event_base* base, struct timeval* now,
142142 struct timeval* wait)
143143 {
144 struct getdns_event* p;
144 struct _getdns_event* p;
145145 #ifndef S_SPLINT_S
146146 wait->tv_sec = (time_t)-1;
147147 #endif
148148
149 while((getdns_rbnode_t*)(p = (struct getdns_event*)getdns_rbtree_first(base->times))
149 while((_getdns_rbnode_t*)(p = (struct _getdns_event*)_getdns_rbtree_first(base->times))
150150 !=RBTREE_NULL) {
151151 #ifndef S_SPLINT_S
152152 if(p->ev_timeout.tv_sec > now->tv_sec ||
166166 }
167167 #endif
168168 /* event times out, remove it */
169 (void)getdns_rbtree_delete(base->times, p);
169 (void)_getdns_rbtree_delete(base->times, p);
170170 p->ev_events &= ~EV_TIMEOUT;
171171 fptr_ok(fptr_whitelist_event(p->ev_callback));
172172 (*p->ev_callback)(p->ev_fd, EV_TIMEOUT, p->ev_arg);
174174 }
175175
176176 /** call select and callbacks for that */
177 int getdns_handle_select(struct getdns_event_base* base, struct timeval* wait)
177 int _getdns_handle_select(struct _getdns_event_base* base, struct timeval* wait)
178178 {
179179 fd_set r, w;
180180 int ret, i;
226226 }
227227
228228 /** run select in a loop */
229 int getdns_event_base_dispatch(struct getdns_event_base* base)
229 int _getdns_event_base_dispatch(struct _getdns_event_base* base)
230230 {
231231 struct timeval wait;
232232 if(settime(base) < 0)
234234 while(!base->need_to_exit)
235235 {
236236 /* see if timeouts need handling */
237 getdns_handle_timeouts(base, base->time_tv, &wait);
237 _getdns_handle_timeouts(base, base->time_tv, &wait);
238238 if(base->need_to_exit)
239239 return 0;
240240 /* do select */
241 if(getdns_handle_select(base, &wait) < 0) {
241 if(_getdns_handle_select(base, &wait) < 0) {
242242 if(base->need_to_exit)
243243 return 0;
244244 return -1;
248248 }
249249
250250 /** exit that loop */
251 int getdns_event_base_loopexit(struct getdns_event_base* base,
251 int _getdns_event_base_loopexit(struct _getdns_event_base* base,
252252 struct timeval* ATTR_UNUSED(tv))
253253 {
254254 base->need_to_exit = 1;
256256 }
257257
258258 /* free event base, free events yourself */
259 void getdns_event_base_free(struct getdns_event_base* base)
259 void _getdns_event_base_free(struct _getdns_event_base* base)
260260 {
261261 if(!base)
262262 return;
270270 }
271271
272272 /** set content of event */
273 void getdns_event_set(struct getdns_event* ev, int fd, short bits,
273 void _getdns_event_set(struct _getdns_event* ev, int fd, short bits,
274274 void (*cb)(int, short, void *), void* arg)
275275 {
276276 ev->node.key = ev;
283283 }
284284
285285 /* add event to a base */
286 int getdns_event_base_set(struct getdns_event_base* base, struct getdns_event* ev)
286 int _getdns_event_base_set(struct _getdns_event_base* base, struct _getdns_event* ev)
287287 {
288288 ev->ev_base = base;
289289 ev->added = 0;
290290 return 0;
291291 }
292292
293 /* add event to make it active, you may not change it with getdns_event_set anymore */
294 int getdns_event_add(struct getdns_event* ev, struct timeval* tv)
293 /* add event to make it active, you may not change it with _getdns_event_set anymore */
294 int _getdns_event_add(struct _getdns_event* ev, struct timeval* tv)
295295 {
296296 if(ev->added)
297 getdns_event_del(ev);
297 _getdns_event_del(ev);
298298 if(ev->ev_fd != -1 && ev->ev_fd >= ev->ev_base->capfd)
299299 return -1;
300300 if( (ev->ev_events&(EV_READ|EV_WRITE)) && ev->ev_fd != -1) {
320320 ev->ev_timeout.tv_sec++;
321321 }
322322 #endif
323 (void)getdns_rbtree_insert(ev->ev_base->times, &ev->node);
323 (void)_getdns_rbtree_insert(ev->ev_base->times, &ev->node);
324324 }
325325 ev->added = 1;
326326 return 0;
327327 }
328328
329329 /* remove event, you may change it again */
330 int getdns_event_del(struct getdns_event* ev)
330 int _getdns_event_del(struct _getdns_event* ev)
331331 {
332332 if(ev->ev_fd != -1 && ev->ev_fd >= ev->ev_base->capfd)
333333 return -1;
334334 if((ev->ev_events&EV_TIMEOUT))
335 (void)getdns_rbtree_delete(ev->ev_base->times, &ev->node);
335 (void)_getdns_rbtree_delete(ev->ev_base->times, &ev->node);
336336 if((ev->ev_events&(EV_READ|EV_WRITE)) && ev->ev_fd != -1) {
337337 ev->ev_base->fds[ev->ev_fd] = NULL;
338338 FD_CLR(FD_SET_T ev->ev_fd, &ev->ev_base->reads);
345345 }
346346
347347 /** which base gets to handle signals */
348 static struct getdns_event_base* signal_base = NULL;
348 static struct _getdns_event_base* signal_base = NULL;
349349 /** signal handler */
350350 static RETSIGTYPE sigh(int sig)
351351 {
352 struct getdns_event* ev;
352 struct _getdns_event* ev;
353353 if(!signal_base || sig < 0 || sig >= MAX_SIG)
354354 return;
355355 ev = signal_base->signals[sig];
360360 }
361361
362362 /** install signal handler */
363 int getdns_signal_add(struct getdns_event* ev, struct timeval* ATTR_UNUSED(tv))
363 int _getdns_signal_add(struct _getdns_event* ev, struct timeval* ATTR_UNUSED(tv))
364364 {
365365 if(ev->ev_fd == -1 || ev->ev_fd >= MAX_SIG)
366366 return -1;
374374 }
375375
376376 /** remove signal handler */
377 int getdns_signal_del(struct getdns_event* ev)
377 int _getdns_signal_del(struct _getdns_event* ev)
378378 {
379379 if(ev->ev_fd == -1 || ev->ev_fd >= MAX_SIG)
380380 return -1;
385385
386386 #else /* USE_MINI_EVENT */
387387 #ifndef USE_WINSOCK
388 int getdns_mini_ev_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
388 int _getdns_mini_ev_cmp(const void* ATTR_UNUSED(a), const void* ATTR_UNUSED(b))
389389 {
390390 return 0;
391391 }
7878 #define MAX_SIG 32
7979
8080 /** event base */
81 struct getdns_event_base
81 struct _getdns_event_base
8282 {
8383 /** sorted by timeout (absolute), ptr */
84 getdns_rbtree_t* times;
84 _getdns_rbtree_t* times;
8585 /** array of 0 - maxfd of ptr to event for it */
86 struct getdns_event** fds;
86 struct _getdns_event** fds;
8787 /** max fd in use */
8888 int maxfd;
8989 /** capacity - size of the fds array */
9999 /** ready plus newly added events. */
100100 content;
101101 /** array of 0 - maxsig of ptr to event for it */
102 struct getdns_event** signals;
102 struct _getdns_event** signals;
103103 /** if we need to exit */
104104 int need_to_exit;
105105 /** where to store time in seconds */
111111 /**
112112 * Event structure. Has some of the event elements.
113113 */
114 struct getdns_event {
114 struct _getdns_event {
115115 /** node in timeout rbtree */
116 getdns_rbnode_t node;
116 _getdns_rbnode_t node;
117117 /** is event already added */
118118 int added;
119119
120120 /** event base it belongs to */
121 struct getdns_event_base *ev_base;
121 struct _getdns_event_base *ev_base;
122122 /** fd to poll or -1 for timeouts. signal number for sigs. */
123123 int ev_fd;
124124 /** what events this event is interested in, see EV_.. above. */
134134
135135 /* function prototypes (some are as they appear in event.h) */
136136 /** create event base */
137 void *getdns_event_init(time_t* time_secs, struct timeval* time_tv);
137 void *_getdns_event_init(time_t* time_secs, struct timeval* time_tv);
138138 /** get version */
139 const char *getdns_event_get_version(void);
139 const char *_getdns_event_get_version(void);
140140 /** get polling method, select */
141 const char *getdns_event_get_method(void);
141 const char *_getdns_event_get_method(void);
142142 /** run select in a loop */
143 int getdns_event_base_dispatch(struct getdns_event_base *);
143 int _getdns_event_base_dispatch(struct _getdns_event_base *);
144144 /** exit that loop */
145 int getdns_event_base_loopexit(struct getdns_event_base *, struct timeval *);
145 int _getdns_event_base_loopexit(struct _getdns_event_base *, struct timeval *);
146146 /** free event base. Free events yourself */
147 void getdns_event_base_free(struct getdns_event_base *);
147 void _getdns_event_base_free(struct _getdns_event_base *);
148148 /** set content of event */
149 void getdns_event_set(struct getdns_event *, int, short, void (*)(int, short, void *), void *);
149 void _getdns_event_set(struct _getdns_event *, int, short, void (*)(int, short, void *), void *);
150150 /** add event to a base. You *must* call this for every event. */
151 int getdns_event_base_set(struct getdns_event_base *, struct getdns_event *);
152 /** add event to make it active. You may not change it with getdns_event_set anymore */
153 int getdns_event_add(struct getdns_event *, struct timeval *);
151 int _getdns_event_base_set(struct _getdns_event_base *, struct _getdns_event *);
152 /** add event to make it active. You may not change it with _getdns_event_set anymore */
153 int _getdns_event_add(struct _getdns_event *, struct timeval *);
154154 /** remove event. You may change it again */
155 int getdns_event_del(struct getdns_event *);
155 int _getdns_event_del(struct _getdns_event *);
156156
157157 /** add a timer */
158 #define getdns_evtimer_add(ev, tv) getdns_event_add(ev, tv)
158 #define _getdns_evtimer_add(ev, tv) _getdns_event_add(ev, tv)
159159 /** remove a timer */
160 #define getdns_evtimer_del(ev) getdns_event_del(ev)
160 #define _getdns_evtimer_del(ev) _getdns_event_del(ev)
161161
162162 /* uses different implementation. Cannot mix fd/timeouts and signals inside
163 * the same struct getdns_event. create several event structs for that. */
163 * the same struct _getdns_event. create several event structs for that. */
164164 /** install signal handler */
165 int getdns_signal_add(struct getdns_event *, struct timeval *);
165 int _getdns_signal_add(struct _getdns_event *, struct timeval *);
166166 /** set signal event contents */
167 #define getdns_signal_set(ev, x, cb, arg) \
168 getdns_event_set(ev, x, EV_SIGNAL|EV_PERSIST, cb, arg)
167 #define _getdns_signal_set(ev, x, cb, arg) \
168 _getdns_event_set(ev, x, EV_SIGNAL|EV_PERSIST, cb, arg)
169169 /** remove signal handler */
170 int getdns_signal_del(struct getdns_event *);
170 int _getdns_signal_del(struct _getdns_event *);
171171
172172 #endif /* USE_MINI_EVENT and not USE_WINSOCK */
173173
174174 /** compare events in tree, based on timevalue, ptr for uniqueness */
175 int getdns_mini_ev_cmp(const void* a, const void* b);
175 int _getdns_mini_ev_cmp(const void* a, const void* b);
176176
177177 #endif /* MINI_EVENT_H */
4949 #define RED 1
5050
5151 /** the NULL node, global alloc */
52 getdns_rbnode_t getdns_rbtree_null_node = {
52 _getdns_rbnode_t _getdns_rbtree_null_node = {
5353 RBTREE_NULL, /* Parent. */
5454 RBTREE_NULL, /* Left. */
5555 RBTREE_NULL, /* Right. */
5858 };
5959
6060 /** rotate subtree left (to preserve redblack property) */
61 static void getdns_rbtree_rotate_left(getdns_rbtree_t *rbtree, getdns_rbnode_t *node);
61 static void _getdns_rbtree_rotate_left(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *node);
6262 /** rotate subtree right (to preserve redblack property) */
63 static void getdns_rbtree_rotate_right(getdns_rbtree_t *rbtree, getdns_rbnode_t *node);
63 static void _getdns_rbtree_rotate_right(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *node);
6464 /** Fixup node colours when insert happened */
65 static void getdns_rbtree_insert_fixup(getdns_rbtree_t *rbtree, getdns_rbnode_t *node);
65 static void _getdns_rbtree_insert_fixup(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *node);
6666 /** Fixup node colours when delete happened */
67 static void getdns_rbtree_delete_fixup(getdns_rbtree_t* rbtree, getdns_rbnode_t* child, getdns_rbnode_t* child_parent);
67 static void _getdns_rbtree_delete_fixup(_getdns_rbtree_t* rbtree, _getdns_rbnode_t* child, _getdns_rbnode_t* child_parent);
6868
6969 /*
7070 * Creates a new red black tree, intializes and returns a pointer to it.
7272 * Return NULL on failure.
7373 *
7474 */
75 getdns_rbtree_t *
76 getdns_rbtree_create (int (*cmpf)(const void *, const void *))
77 {
78 getdns_rbtree_t *rbtree;
75 _getdns_rbtree_t *
76 _getdns_rbtree_create (int (*cmpf)(const void *, const void *))
77 {
78 _getdns_rbtree_t *rbtree;
7979
8080 /* Allocate memory for it */
81 rbtree = (getdns_rbtree_t *) malloc(sizeof(getdns_rbtree_t));
81 rbtree = (_getdns_rbtree_t *) malloc(sizeof(_getdns_rbtree_t));
8282 if (!rbtree) {
8383 return NULL;
8484 }
8585
8686 /* Initialize it */
87 getdns_rbtree_init(rbtree, cmpf);
87 _getdns_rbtree_init(rbtree, cmpf);
8888
8989 return rbtree;
9090 }
9191
9292 void
93 getdns_rbtree_init(getdns_rbtree_t *rbtree, int (*cmpf)(const void *, const void *))
93 _getdns_rbtree_init(_getdns_rbtree_t *rbtree, int (*cmpf)(const void *, const void *))
9494 {
9595 /* Initialize it */
9696 rbtree->root = RBTREE_NULL;
103103 *
104104 */
105105 static void
106 getdns_rbtree_rotate_left(getdns_rbtree_t *rbtree, getdns_rbnode_t *node)
107 {
108 getdns_rbnode_t *right = node->right;
106 _getdns_rbtree_rotate_left(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *node)
107 {
108 _getdns_rbnode_t *right = node->right;
109109 node->right = right->left;
110110 if (right->left != RBTREE_NULL)
111111 right->left->parent = node;
130130 *
131131 */
132132 static void
133 getdns_rbtree_rotate_right(getdns_rbtree_t *rbtree, getdns_rbnode_t *node)
134 {
135 getdns_rbnode_t *left = node->left;
133 _getdns_rbtree_rotate_right(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *node)
134 {
135 _getdns_rbnode_t *left = node->left;
136136 node->left = left->right;
137137 if (left->right != RBTREE_NULL)
138138 left->right->parent = node;
153153 }
154154
155155 static void
156 getdns_rbtree_insert_fixup(getdns_rbtree_t *rbtree, getdns_rbnode_t *node)
157 {
158 getdns_rbnode_t *uncle;
156 _getdns_rbtree_insert_fixup(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *node)
157 {
158 _getdns_rbnode_t *uncle;
159159
160160 /* While not at the root and need fixing... */
161161 while (node != rbtree->root && node->parent->color == RED) {
178178 /* Are we the right child? */
179179 if (node == node->parent->right) {
180180 node = node->parent;
181 getdns_rbtree_rotate_left(rbtree, node);
181 _getdns_rbtree_rotate_left(rbtree, node);
182182 }
183183 /* Now we're the left child, repaint and rotate... */
184184 node->parent->color = BLACK;
185185 node->parent->parent->color = RED;
186 getdns_rbtree_rotate_right(rbtree, node->parent->parent);
186 _getdns_rbtree_rotate_right(rbtree, node->parent->parent);
187187 }
188188 } else {
189189 uncle = node->parent->parent->left;
203203 /* Are we the right child? */
204204 if (node == node->parent->left) {
205205 node = node->parent;
206 getdns_rbtree_rotate_right(rbtree, node);
206 _getdns_rbtree_rotate_right(rbtree, node);
207207 }
208208 /* Now we're the right child, repaint and rotate... */
209209 node->parent->color = BLACK;
210210 node->parent->parent->color = RED;
211 getdns_rbtree_rotate_left(rbtree, node->parent->parent);
211 _getdns_rbtree_rotate_left(rbtree, node->parent->parent);
212212 }
213213 }
214214 }
222222 * Returns NULL on failure or the pointer to the newly added node
223223 * otherwise.
224224 */
225 getdns_rbnode_t *
226 getdns_rbtree_insert (getdns_rbtree_t *rbtree, getdns_rbnode_t *data)
225 _getdns_rbnode_t *
226 _getdns_rbtree_insert (_getdns_rbtree_t *rbtree, _getdns_rbnode_t *data)
227227 {
228228 /* XXX Not necessary, but keeps compiler quiet... */
229229 int r = 0;
230230
231231 /* We start at the root of the tree */
232 getdns_rbnode_t *node = rbtree->root;
233 getdns_rbnode_t *parent = RBTREE_NULL;
234
235 fptr_ok(fptr_whitelist_getdns_rbtree_cmp(rbtree->cmp));
232 _getdns_rbnode_t *node = rbtree->root;
233 _getdns_rbnode_t *parent = RBTREE_NULL;
234
235 fptr_ok(fptr_whitelist__getdns_rbtree_cmp(rbtree->cmp));
236236 /* Lets find the new parent... */
237237 while (node != RBTREE_NULL) {
238238 /* Compare two keys, do we have a duplicate? */
266266 }
267267
268268 /* Fix up the red-black properties... */
269 getdns_rbtree_insert_fixup(rbtree, data);
269 _getdns_rbtree_insert_fixup(rbtree, data);
270270
271271 return data;
272272 }
275275 * Searches the red black tree, returns the data if key is found or NULL otherwise.
276276 *
277277 */
278 getdns_rbnode_t *
279 getdns_rbtree_search (getdns_rbtree_t *rbtree, const void *key)
280 {
281 getdns_rbnode_t *node;
282
283 if (getdns_rbtree_find_less_equal(rbtree, key, &node)) {
278 _getdns_rbnode_t *
279 _getdns_rbtree_search (_getdns_rbtree_t *rbtree, const void *key)
280 {
281 _getdns_rbnode_t *node;
282
283 if (_getdns_rbtree_find_less_equal(rbtree, key, &node)) {
284284 return node;
285285 } else {
286286 return NULL;
294294 }
295295
296296 /** helpers for delete: swap node pointers */
297 static void swap_np(getdns_rbnode_t** x, getdns_rbnode_t** y)
298 {
299 getdns_rbnode_t* t = *x; *x = *y; *y = t;
297 static void swap_np(_getdns_rbnode_t** x, _getdns_rbnode_t** y)
298 {
299 _getdns_rbnode_t* t = *x; *x = *y; *y = t;
300300 }
301301
302302 /** Update parent pointers of child trees of 'parent' */
303 static void change_parent_ptr(getdns_rbtree_t* rbtree, getdns_rbnode_t* parent, getdns_rbnode_t* old, getdns_rbnode_t* new)
303 static void change_parent_ptr(_getdns_rbtree_t* rbtree, _getdns_rbnode_t* parent, _getdns_rbnode_t* old, _getdns_rbnode_t* new)
304304 {
305305 if(parent == RBTREE_NULL)
306306 {
314314 if(parent->right == old) parent->right = new;
315315 }
316316 /** Update parent pointer of a node 'child' */
317 static void change_child_ptr(getdns_rbnode_t* child, getdns_rbnode_t* old, getdns_rbnode_t* new)
317 static void change_child_ptr(_getdns_rbnode_t* child, _getdns_rbnode_t* old, _getdns_rbnode_t* new)
318318 {
319319 if(child == RBTREE_NULL) return;
320320 log_assert(child->parent == old || child->parent == new);
321321 if(child->parent == old) child->parent = new;
322322 }
323323
324 getdns_rbnode_t*
325 getdns_rbtree_delete(getdns_rbtree_t *rbtree, const void *key)
326 {
327 getdns_rbnode_t *to_delete;
328 getdns_rbnode_t *child;
329 if((to_delete = getdns_rbtree_search(rbtree, key)) == 0) return 0;
324 _getdns_rbnode_t*
325 _getdns_rbtree_delete(_getdns_rbtree_t *rbtree, const void *key)
326 {
327 _getdns_rbnode_t *to_delete;
328 _getdns_rbnode_t *child;
329 if((to_delete = _getdns_rbtree_search(rbtree, key)) == 0) return 0;
330330 rbtree->count--;
331331
332332 /* make sure we have at most one non-leaf child */
333333 if(to_delete->left != RBTREE_NULL && to_delete->right != RBTREE_NULL)
334334 {
335335 /* swap with smallest from right subtree (or largest from left) */
336 getdns_rbnode_t *smright = to_delete->right;
336 _getdns_rbnode_t *smright = to_delete->right;
337337 while(smright->left != RBTREE_NULL)
338338 smright = smright->left;
339339 /* swap the smright and to_delete elements in the tree,
340 * but the getdns_rbnode_t is first part of user data struct
340 * but the _getdns_rbnode_t is first part of user data struct
341341 * so cannot just swap the keys and data pointers. Instead
342342 * readjust the pointers left,right,parent */
343343
389389 /* change child to BLACK, removing a RED node is no problem */
390390 if(child!=RBTREE_NULL) child->color = BLACK;
391391 }
392 else getdns_rbtree_delete_fixup(rbtree, child, to_delete->parent);
392 else _getdns_rbtree_delete_fixup(rbtree, child, to_delete->parent);
393393
394394 /* unlink completely */
395395 to_delete->parent = RBTREE_NULL;
399399 return to_delete;
400400 }
401401
402 static void getdns_rbtree_delete_fixup(getdns_rbtree_t* rbtree, getdns_rbnode_t* child, getdns_rbnode_t* child_parent)
403 {
404 getdns_rbnode_t* sibling;
402 static void _getdns_rbtree_delete_fixup(_getdns_rbtree_t* rbtree, _getdns_rbnode_t* child, _getdns_rbnode_t* child_parent)
403 {
404 _getdns_rbnode_t* sibling;
405405 int go_up = 1;
406406
407407 /* determine sibling to the node that is one-black short */
421421 child_parent->color = RED;
422422 sibling->color = BLACK;
423423 if(child_parent->right == child)
424 getdns_rbtree_rotate_right(rbtree, child_parent);
425 else getdns_rbtree_rotate_left(rbtree, child_parent);
424 _getdns_rbtree_rotate_right(rbtree, child_parent);
425 else _getdns_rbtree_rotate_left(rbtree, child_parent);
426426 /* new sibling after rotation */
427427 if(child_parent->right == child) sibling = child_parent->left;
428428 else sibling = child_parent->right;
467467 {
468468 sibling->color = RED;
469469 sibling->right->color = BLACK;
470 getdns_rbtree_rotate_left(rbtree, sibling);
470 _getdns_rbtree_rotate_left(rbtree, sibling);
471471 /* new sibling after rotation */
472472 if(child_parent->right == child) sibling = child_parent->left;
473473 else sibling = child_parent->right;
479479 {
480480 sibling->color = RED;
481481 sibling->left->color = BLACK;
482 getdns_rbtree_rotate_right(rbtree, sibling);
482 _getdns_rbtree_rotate_right(rbtree, sibling);
483483 /* new sibling after rotation */
484484 if(child_parent->right == child) sibling = child_parent->left;
485485 else sibling = child_parent->right;
492492 {
493493 log_assert(sibling->left->color == RED);
494494 sibling->left->color = BLACK;
495 getdns_rbtree_rotate_right(rbtree, child_parent);
495 _getdns_rbtree_rotate_right(rbtree, child_parent);
496496 }
497497 else
498498 {
499499 log_assert(sibling->right->color == RED);
500500 sibling->right->color = BLACK;
501 getdns_rbtree_rotate_left(rbtree, child_parent);
501 _getdns_rbtree_rotate_left(rbtree, child_parent);
502502 }
503503 }
504504
505505 int
506 getdns_rbtree_find_less_equal(getdns_rbtree_t *rbtree, const void *key, getdns_rbnode_t **result)
506 _getdns_rbtree_find_less_equal(_getdns_rbtree_t *rbtree, const void *key, _getdns_rbnode_t **result)
507507 {
508508 int r;
509 getdns_rbnode_t *node;
509 _getdns_rbnode_t *node;
510510
511511 log_assert(result);
512512
514514 node = rbtree->root;
515515
516516 *result = NULL;
517 fptr_ok(fptr_whitelist_getdns_rbtree_cmp(rbtree->cmp));
517 fptr_ok(fptr_whitelist__getdns_rbtree_cmp(rbtree->cmp));
518518
519519 /* While there are children... */
520520 while (node != RBTREE_NULL) {
539539 * Finds the first element in the red black tree
540540 *
541541 */
542 getdns_rbnode_t *
543 getdns_rbtree_first (getdns_rbtree_t *rbtree)
544 {
545 getdns_rbnode_t *node;
542 _getdns_rbnode_t *
543 _getdns_rbtree_first (_getdns_rbtree_t *rbtree)
544 {
545 _getdns_rbnode_t *node;
546546
547547 for (node = rbtree->root; node->left != RBTREE_NULL; node = node->left);
548548 return node;
549549 }
550550
551 getdns_rbnode_t *
552 getdns_rbtree_last (getdns_rbtree_t *rbtree)
553 {
554 getdns_rbnode_t *node;
551 _getdns_rbnode_t *
552 _getdns_rbtree_last (_getdns_rbtree_t *rbtree)
553 {
554 _getdns_rbnode_t *node;
555555
556556 for (node = rbtree->root; node->right != RBTREE_NULL; node = node->right);
557557 return node;
561561 * Returns the next node...
562562 *
563563 */
564 getdns_rbnode_t *
565 getdns_rbtree_next (getdns_rbnode_t *node)
566 {
567 getdns_rbnode_t *parent;
564 _getdns_rbnode_t *
565 _getdns_rbtree_next (_getdns_rbnode_t *node)
566 {
567 _getdns_rbnode_t *parent;
568568
569569 if (node->right != RBTREE_NULL) {
570570 /* One right, then keep on going left... */
580580 return node;
581581 }
582582
583 getdns_rbnode_t *
584 getdns_rbtree_previous(getdns_rbnode_t *node)
585 {
586 getdns_rbnode_t *parent;
583 _getdns_rbnode_t *
584 _getdns_rbtree_previous(_getdns_rbnode_t *node)
585 {
586 _getdns_rbnode_t *parent;
587587
588588 if (node->left != RBTREE_NULL) {
589589 /* One left, then keep on going right... */
601601
602602 /** recursive descent traverse */
603603 static void
604 getdns_traverse_post(void (*func)(getdns_rbnode_t*, void*), void* arg, getdns_rbnode_t* node)
604 _getdns_traverse_post(void (*func)(_getdns_rbnode_t*, void*), void* arg, _getdns_rbnode_t* node)
605605 {
606606 if(!node || node == RBTREE_NULL)
607607 return;
608608 /* recurse */
609 getdns_traverse_post(func, arg, node->left);
610 getdns_traverse_post(func, arg, node->right);
609 _getdns_traverse_post(func, arg, node->left);
610 _getdns_traverse_post(func, arg, node->right);
611611 /* call user func */
612612 (*func)(node, arg);
613613 }
614614
615615 void
616 getdns_traverse_postorder(getdns_rbtree_t* tree, void (*func)(getdns_rbnode_t*, void*), void* arg)
617 {
618 getdns_traverse_post(func, arg, tree->root);
619 }
616 _getdns_traverse_postorder(_getdns_rbtree_t* tree, void (*func)(_getdns_rbnode_t*, void*), void* arg)
617 {
618 _getdns_traverse_post(func, arg, tree->root);
619 }
4444
4545 /**
4646 * This structure must be the first member of the data structure in
47 * the rbtree. This allows easy casting between an getdns_rbnode_t and the
47 * the rbtree. This allows easy casting between an _getdns_rbnode_t and the
4848 * user data (poor man's inheritance).
4949 */
50 typedef struct getdns_rbnode_t getdns_rbnode_t;
50 typedef struct _getdns_rbnode_t _getdns_rbnode_t;
5151 /**
52 * The getdns_rbnode_t struct definition.
52 * The _getdns_rbnode_t struct definition.
5353 */
54 struct getdns_rbnode_t {
54 struct _getdns_rbnode_t {
5555 /** parent in rbtree, RBTREE_NULL for root */
56 getdns_rbnode_t *parent;
56 _getdns_rbnode_t *parent;
5757 /** left node (smaller items) */
58 getdns_rbnode_t *left;
58 _getdns_rbnode_t *left;
5959 /** right node (larger items) */
60 getdns_rbnode_t *right;
60 _getdns_rbnode_t *right;
6161 /** pointer to sorting key */
6262 const void *key;
6363 /** colour of this node */
6565 };
6666
6767 /** The nullpointer, points to empty node */
68 #define RBTREE_NULL &getdns_rbtree_null_node
68 #define RBTREE_NULL &_getdns_rbtree_null_node
6969 /** the global empty node */
70 extern getdns_rbnode_t getdns_rbtree_null_node;
70 extern _getdns_rbnode_t _getdns_rbtree_null_node;
7171
7272 /** An entire red black tree */
73 typedef struct getdns_rbtree_t getdns_rbtree_t;
73 typedef struct _getdns_rbtree_t _getdns_rbtree_t;
7474 /** definition for tree struct */
75 struct getdns_rbtree_t {
75 struct _getdns_rbtree_t {
7676 /** The root of the red-black tree */
77 getdns_rbnode_t *root;
77 _getdns_rbnode_t *root;
7878
7979 /** The number of the nodes in the tree */
8080 size_t count;
9191 * @param cmpf: compare function (like strcmp) takes pointers to two keys.
9292 * @return: new tree, empty.
9393 */
94 getdns_rbtree_t *getdns_rbtree_create(int (*cmpf)(const void *, const void *));
94 _getdns_rbtree_t *_getdns_rbtree_create(int (*cmpf)(const void *, const void *));
9595
9696 /**
9797 * Init a new tree (malloced by caller) with given key compare function.
9898 * @param rbtree: uninitialised memory for new tree, returned empty.
9999 * @param cmpf: compare function (like strcmp) takes pointers to two keys.
100100 */
101 void getdns_rbtree_init(getdns_rbtree_t *rbtree, int (*cmpf)(const void *, const void *));
101 void _getdns_rbtree_init(_getdns_rbtree_t *rbtree, int (*cmpf)(const void *, const void *));
102102
103103 /**
104104 * Insert data into the tree.
106106 * @param data: element to insert.
107107 * @return: data ptr or NULL if key already present.
108108 */
109 getdns_rbnode_t *getdns_rbtree_insert(getdns_rbtree_t *rbtree, getdns_rbnode_t *data);
109 _getdns_rbnode_t *_getdns_rbtree_insert(_getdns_rbtree_t *rbtree, _getdns_rbnode_t *data);
110110
111111 /**
112112 * Delete element from tree.
115115 * @return: node that is now unlinked from the tree. User to delete it.
116116 * returns 0 if node not present
117117 */
118 getdns_rbnode_t *getdns_rbtree_delete(getdns_rbtree_t *rbtree, const void *key);
118 _getdns_rbnode_t *_getdns_rbtree_delete(_getdns_rbtree_t *rbtree, const void *key);
119119
120120 /**
121121 * Find key in tree. Returns NULL if not found.
123123 * @param key: key that must match.
124124 * @return: node that fits or NULL.
125125 */
126 getdns_rbnode_t *getdns_rbtree_search(getdns_rbtree_t *rbtree, const void *key);
126 _getdns_rbnode_t *_getdns_rbtree_search(_getdns_rbtree_t *rbtree, const void *key);
127127
128128 /**
129129 * Find, but match does not have to be exact.
134134 * @return: true if exact match in result. Else result points to <= element,
135135 * or NULL if key is smaller than the smallest key.
136136 */
137 int getdns_rbtree_find_less_equal(getdns_rbtree_t *rbtree, const void *key,
138 getdns_rbnode_t **result);
137 int _getdns_rbtree_find_less_equal(_getdns_rbtree_t *rbtree, const void *key,
138 _getdns_rbnode_t **result);
139139
140140 /**
141141 * Returns first (smallest) node in the tree
142142 * @param rbtree: tree
143143 * @return: smallest element or NULL if tree empty.
144144 */
145 getdns_rbnode_t *getdns_rbtree_first(getdns_rbtree_t *rbtree);
145 _getdns_rbnode_t *_getdns_rbtree_first(_getdns_rbtree_t *rbtree);
146146
147147 /**
148148 * Returns last (largest) node in the tree
149149 * @param rbtree: tree
150150 * @return: largest element or NULL if tree empty.
151151 */
152 getdns_rbnode_t *getdns_rbtree_last(getdns_rbtree_t *rbtree);
152 _getdns_rbnode_t *_getdns_rbtree_last(_getdns_rbtree_t *rbtree);
153153
154154 /**
155155 * Returns next larger node in the tree
156156 * @param rbtree: tree
157157 * @return: next larger element or NULL if no larger in tree.
158158 */
159 getdns_rbnode_t *getdns_rbtree_next(getdns_rbnode_t *rbtree);
159 _getdns_rbnode_t *_getdns_rbtree_next(_getdns_rbnode_t *rbtree);
160160
161161 /**
162162 * Returns previous smaller node in the tree
163163 * @param rbtree: tree
164164 * @return: previous smaller element or NULL if no previous in tree.
165165 */
166 getdns_rbnode_t *getdns_rbtree_previous(getdns_rbnode_t *rbtree);
166 _getdns_rbnode_t *_getdns_rbtree_previous(_getdns_rbnode_t *rbtree);
167167
168168 /**
169 * Call with node=variable of struct* with getdns_rbnode_t as first element.
169 * Call with node=variable of struct* with _getdns_rbnode_t as first element.
170170 * with type is the type of a pointer to that struct.
171171 */
172172 #define RBTREE_FOR(node, type, rbtree) \
173 for(node=(type)getdns_rbtree_first(rbtree); \
174 (getdns_rbnode_t*)node != RBTREE_NULL; \
175 node = (type)getdns_rbtree_next((getdns_rbnode_t*)node))
173 for(node=(type)_getdns_rbtree_first(rbtree); \
174 (_getdns_rbnode_t*)node != RBTREE_NULL; \
175 node = (type)_getdns_rbtree_next((_getdns_rbnode_t*)node))
176176
177177 /**
178178 * Call function for all elements in the redblack tree, such that
185185 * The function must not alter the rbtree.
186186 * @param arg: user argument.
187187 */
188 void getdns_traverse_postorder(getdns_rbtree_t* tree, void (*func)(getdns_rbnode_t*, void*),
188 void _getdns_traverse_postorder(_getdns_rbtree_t* tree, void (*func)(_getdns_rbnode_t*, void*),
189189 void* arg);
190190
191191 #endif /* UTIL_RBTREE_H_ */
3737 #include <stdint.h>
3838 #include <stdlib.h>
3939 #include <ctype.h>
40 #include <unbound.h>
4140 #include "getdns/getdns.h"
4241 #include "dict.h"
4342 #include "list.h"
7271 {"specify_class", t_int},
7372 };
7473
75 static struct getdns_bindata IPv4_str_bindata = { 5, (void *)"IPv4" };
76 static struct getdns_bindata IPv6_str_bindata = { 5, (void *)"IPv6" };
77
78 getdns_return_t
79 getdns_dict_util_set_string(struct getdns_dict * dict, char *name, const char *value)
80 {
81 /* account for the null term */
82 if (value == NULL) {
83 return GETDNS_RETURN_WRONG_TYPE_REQUESTED;
84 }
85 struct getdns_bindata type_bin = { strlen(value) + 1, (uint8_t *) value };
86 return getdns_dict_set_bindata(dict, name, &type_bin);
87 }
8874
8975 getdns_return_t
9076 getdns_dict_util_get_string(struct getdns_dict * dict, char *name, char **result)
10389 }
10490
10591 getdns_return_t
106 dict_to_sockaddr(struct getdns_dict * ns, struct sockaddr_storage * output)
92 _getdns_dict_to_sockaddr(struct getdns_dict * ns, struct sockaddr_storage * output)
10793 {
10894 char *address_type = NULL;
10995 struct getdns_bindata *address_data = NULL;
143129 }
144130
145131 getdns_return_t
146 sockaddr_to_dict(struct getdns_context *context, struct sockaddr_storage *address,
132 _getdns_sockaddr_to_dict(struct getdns_context *context, struct sockaddr_storage *address,
147133 struct getdns_dict ** output)
148134 {
149135 if (!output || !address) {
178164 }
179165
180166 getdns_dict *
181 priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i)
167 _getdns_rr_iter2rr_dict(struct mem_funcs *mf, _getdns_rr_iter *i)
182168 {
183169 getdns_dict *rr_dict, *rdata_dict;
184170 getdns_bindata bindata;
185171 uint32_t int_val = 0;
186172 getdns_data_type val_type;
187 priv_getdns_rdf_iter rdf_storage, *rdf;
173 _getdns_rdf_iter rdf_storage, *rdf;
188174 getdns_list *repeat_list = NULL;
189175 getdns_dict *repeat_dict = NULL;
190176 uint8_t ff_bytes[256];
194180 if (!(rr_dict = _getdns_dict_create_with_mf(mf)))
195181 return NULL;
196182
197 bindata.data = priv_getdns_owner_if_or_as_decompressed(
183 bindata.data = _getdns_owner_if_or_as_decompressed(
198184 i, ff_bytes, &bindata.size);
199185
200186 /* question */
201 if (priv_getdns_rr_iter_section(i) == GLDNS_SECTION_QUESTION) {
187 if (_getdns_rr_iter_section(i) == GLDNS_SECTION_QUESTION) {
202188
203189 if (getdns_dict_set_int(rr_dict, "qtype",
204190 (uint32_t) gldns_read_uint16(i->rr_type)) ||
256242 if (getdns_dict_set_bindata(rdata_dict, "rdata_raw", &bindata))
257243 goto rdata_error;
258244 }
259 for ( rdf = priv_getdns_rdf_iter_init(&rdf_storage, i)
260 ; rdf; rdf = priv_getdns_rdf_iter_next(rdf)) {
245 for ( rdf = _getdns_rdf_iter_init(&rdf_storage, i)
246 ; rdf; rdf = _getdns_rdf_iter_next(rdf)) {
261247 if (rdf->rdd_pos->type & GETDNS_RDF_INTEGER) {
262248 val_type = t_int;
263249 switch (rdf->rdd_pos->type & GETDNS_RDF_FIXEDSZ) {
273259 } else if (rdf->rdd_pos->type & GETDNS_RDF_DNAME) {
274260 val_type = t_bindata;
275261
276 bindata.data = priv_getdns_rdf_if_or_as_decompressed(
262 bindata.data = _getdns_rdf_if_or_as_decompressed(
277263 rdf, ff_bytes, &bindata.size);
278264
279265 } else if (rdf->rdd_pos->type & GETDNS_RDF_BINDATA) {
334320
335321 switch (val_type) {
336322 case t_int:
337 if (getdns_list_append_int(repeat_list,
323 if (_getdns_list_append_int(repeat_list,
338324 int_val))
339325 goto rdata_error;
340326 break;
341327 case t_bindata:
342 if (getdns_list_append_bindata(repeat_list,
328 if (_getdns_list_append_bindata(repeat_list,
343329 &bindata))
344330 goto rdata_error;
345331 break;
359345 _getdns_list_create_with_mf(mf)))
360346 goto rdata_error;
361347
362 if (getdns_list_append_dict(
348 if (_getdns_list_append_dict(
363349 repeat_list, repeat_dict))
364350 goto rdata_error;
365351
394380 if (!repeat_list && !(repeat_list =
395381 _getdns_list_create_with_mf(mf)))
396382 goto rdata_error;
397 if (getdns_list_append_dict(repeat_list, repeat_dict))
383 if (_getdns_list_append_dict(repeat_list, repeat_dict))
398384 goto rdata_error;
399385 getdns_dict_destroy(repeat_dict);
400386 repeat_dict = NULL;
422408 }
423409
424410 int
425 priv_getdns_dname_equal(const uint8_t *s1, const uint8_t *s2)
411 _getdns_dname_equal(const uint8_t *s1, const uint8_t *s2)
426412 {
427413 uint8_t i;
428414 for (;;) {
453439 GLDNS_ ## Y (req->response))) goto error
454440
455441 getdns_dict *
456 priv_getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
442 _getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
457443 getdns_list *just_addrs, int *rrsigs_in_answer)
458444 {
459445 /* turn a packet into this glorious structure
504490 , getdns_list_create_with_context(context)
505491 };
506492 getdns_dict *rr_dict = NULL;
507 priv_getdns_rr_iter rr_iter_storage, *rr_iter;
508 priv_getdns_rdf_iter rdf_iter_storage, *rdf_iter;
493 _getdns_rr_iter rr_iter_storage, *rr_iter;
494 _getdns_rdf_iter rdf_iter_storage, *rdf_iter;
509495 getdns_bindata bindata;
510496 gldns_pkt_section section;
511497 uint8_t canonical_name_space[256],
547533 canonical_name = req->owner->name;
548534 canonical_name_len = req->owner->name_len;
549535
550 for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
536 for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
551537 , req->response
552538 , req->response_len)
553539 ; rr_iter
554 ; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
540 ; rr_iter = _getdns_rr_iter_next(rr_iter)) {
555541
556542 if (!set_dict(&rr_dict,
557 priv_getdns_rr_iter2rr_dict(&context->mf, rr_iter)))
543 _getdns_rr_iter2rr_dict(&context->mf, rr_iter)))
558544 continue;
559545
560 section = priv_getdns_rr_iter_section(rr_iter);
546 section = _getdns_rr_iter_section(rr_iter);
561547 if (section == GLDNS_SECTION_QUESTION) {
562548
563549 if (getdns_dict_set_dict(result, "question", rr_dict))
565551
566552 continue;
567553 }
568 if (getdns_list_append_dict(sections[section], rr_dict))
554 if (_getdns_list_append_dict(sections[section], rr_dict))
569555 goto error;
570556
571557
579565
580566 if (rr_type == GETDNS_RRTYPE_CNAME) {
581567
582 owner_name = priv_getdns_owner_if_or_as_decompressed(
568 owner_name = _getdns_owner_if_or_as_decompressed(
583569 rr_iter, owner_name_space, &owner_name_len);
584 if (!priv_getdns_dname_equal(canonical_name, owner_name))
570 if (!_getdns_dname_equal(canonical_name, owner_name))
585571 continue;
586572
587 if (!(rdf_iter = priv_getdns_rdf_iter_init(
573 if (!(rdf_iter = _getdns_rdf_iter_init(
588574 &rdf_iter_storage, rr_iter)))
589575 continue;
590576
591577 new_canonical = 1;
592 canonical_name = priv_getdns_rdf_if_or_as_decompressed(
578 canonical_name = _getdns_rdf_if_or_as_decompressed(
593579 rdf_iter,canonical_name_space,&canonical_name_len);
594580 continue;
595581 }
597583 if (rr_type != GETDNS_RRTYPE_A && rr_type != GETDNS_RRTYPE_AAAA)
598584 continue;
599585
600 if (!(rdf_iter = priv_getdns_rdf_iter_init(
586 if (!(rdf_iter = _getdns_rdf_iter_init(
601587 &rdf_iter_storage, rr_iter)))
602588 continue;
603589
605591 bindata.data = rdf_iter->pos;
606592 if (!set_dict(&rr_dict, getdns_dict_create_with_context(context)) ||
607593
608 getdns_dict_set_bindata(rr_dict, "address_type",
609 rr_type == GETDNS_RRTYPE_A ?
610 &IPv4_str_bindata : &IPv6_str_bindata) ||
594 getdns_dict_util_set_string(rr_dict, "address_type",
595 rr_type == GETDNS_RRTYPE_A ? "IPv4" : "IPv6" ) ||
611596
612597 getdns_dict_set_bindata(rr_dict,"address_data",&bindata) ||
613598
614 (just_addrs && getdns_list_append_dict(just_addrs, rr_dict))) {
599 (just_addrs && _getdns_list_append_dict(just_addrs, rr_dict))) {
615600
616601 goto error;
617602 }
637622 while (new_canonical) {
638623 new_canonical = 0;
639624
640 for ( rr_iter = priv_getdns_rr_iter_init(&rr_iter_storage
625 for ( rr_iter = _getdns_rr_iter_init(&rr_iter_storage
641626 , req->response
642627 , req->response_len)
643 ; rr_iter && priv_getdns_rr_iter_section(rr_iter)
628 ; rr_iter && _getdns_rr_iter_section(rr_iter)
644629 <= GLDNS_SECTION_ANSWER
645 ; rr_iter = priv_getdns_rr_iter_next(rr_iter)) {
646
647 if (priv_getdns_rr_iter_section(rr_iter) !=
630 ; rr_iter = _getdns_rr_iter_next(rr_iter)) {
631
632 if (_getdns_rr_iter_section(rr_iter) !=
648633 GLDNS_SECTION_ANSWER)
649634 continue;
650635
652637 GETDNS_RRTYPE_CNAME)
653638 continue;
654639
655 owner_name = priv_getdns_owner_if_or_as_decompressed(
640 owner_name = _getdns_owner_if_or_as_decompressed(
656641 rr_iter, owner_name_space, &owner_name_len);
657 if (!priv_getdns_dname_equal(canonical_name, owner_name))
642 if (!_getdns_dname_equal(canonical_name, owner_name))
658643 continue;
659644
660 if (!(rdf_iter = priv_getdns_rdf_iter_init(
645 if (!(rdf_iter = _getdns_rdf_iter_init(
661646 &rdf_iter_storage, rr_iter)))
662647 continue;
663648
664 canonical_name = priv_getdns_rdf_if_or_as_decompressed(
649 canonical_name = _getdns_rdf_if_or_as_decompressed(
665650 rdf_iter,canonical_name_space,&canonical_name_len);
666651 new_canonical = 1;
667652 }
686671 }
687672
688673 getdns_dict *
689 create_getdns_response(getdns_dns_req *completed_request)
674 _getdns_create_getdns_response(getdns_dns_req *completed_request)
690675 {
691676 getdns_dict *result;
692677 getdns_list *just_addrs = NULL;
752737 && netreq->dnssec_status != GETDNS_DNSSEC_SECURE)
753738 continue;
754739 }
755 if (!(reply = priv_getdns_create_reply_dict(context,
740 if (!(reply = _getdns_create_reply_dict(context,
756741 netreq, just_addrs, &rrsigs_in_answer)))
757742 goto error;
758743
779764 goto error;
780765 }
781766
782 if (getdns_list_append_dict(replies_tree, reply)) {
767 if (_getdns_list_append_dict(replies_tree, reply)) {
783768 getdns_dict_destroy(reply);
784769 goto error;
785770 }
788773 /* buffer */
789774 full_data.data = netreq->response;
790775 full_data.size = netreq->response_len;
791 if (getdns_list_append_bindata(replies_full, &full_data))
776 if (_getdns_list_append_bindata(replies_full, &full_data))
792777 goto error;
793778 }
794779 if (getdns_dict_set_list(result, "replies_tree", replies_tree))
835820
836821 /*---------------------------------------- validate_extensions */
837822 getdns_return_t
838 priv_getdns_validate_extensions(struct getdns_dict * extensions)
823 _getdns_validate_extensions(struct getdns_dict * extensions)
839824 {
840825 struct getdns_dict_item *item;
841826 getdns_extension_format *extformat;
857842 return GETDNS_RETURN_EXTENSION_MISFORMAT;
858843 }
859844 return GETDNS_RETURN_GOOD;
860 } /* priv_getdns_validate_extensions */
861
845 } /* _getdns_validate_extensions */
846
847 #ifdef HAVE_LIBUNBOUND
862848 getdns_return_t
863849 getdns_apply_network_result(getdns_network_req* netreq,
864850 struct ub_result* ub_res)
921907
922908 return GETDNS_RETURN_GOOD;
923909 }
910 #endif
924911
925912
926913 getdns_return_t
927 priv_getdns_validate_dname(const char* dname) {
914 _getdns_validate_dname(const char* dname) {
928915 int len;
929916 int label_len;
930917 const char* s;
987974 return GETDNS_RETURN_BAD_DOMAIN_NAME;
988975 }
989976 return GETDNS_RETURN_GOOD;
990 } /* priv_getdns_validate_dname */
977 } /* _getdns_validate_dname */
991978
992979
993980 static void _getdns_reply2wire_buf(gldns_buffer *buf, getdns_dict *reply)
10261013 ; !getdns_list_get_dict(section, i, &rr_dict)
10271014 ; i++ ) {
10281015
1029 if (!priv_getdns_rr_dict2wire(rr_dict, buf))
1016 if (!_getdns_rr_dict2wire(rr_dict, buf))
10301017 ancount++;
10311018 }
10321019 gldns_buffer_write_u16_at(
10371024 ; !getdns_list_get_dict(section, i, &rr_dict)
10381025 ; i++ ) {
10391026
1040 if (!priv_getdns_rr_dict2wire(rr_dict, buf))
1027 if (!_getdns_rr_dict2wire(rr_dict, buf))
10411028 nscount++;
10421029 }
10431030 gldns_buffer_write_u16_at(
10761063 ; !getdns_list_get_dict(l, i, &rr_dict)
10771064 ; i++ ) {
10781065
1079 if (!priv_getdns_rr_dict2wire(rr_dict, buf))
1066 if (!_getdns_rr_dict2wire(rr_dict, buf))
10801067 ancount++;
10811068 }
10821069 gldns_buffer_write_u16_at(buf, pkt_start+GLDNS_ANCOUNT_OFF, ancount);
11261113
11271114 void _getdns_wire2list(uint8_t *pkt, size_t pkt_len, getdns_list *l)
11281115 {
1129 priv_getdns_rr_iter rr_spc, *rr;
1116 _getdns_rr_iter rr_spc, *rr;
11301117 getdns_dict *rr_dict;
11311118
1132 for ( rr = priv_getdns_rr_iter_init(&rr_spc, pkt, pkt_len)
1133 ; rr ; rr = priv_getdns_rr_iter_next(rr)) {
1134
1135 if (!(rr_dict = priv_getdns_rr_iter2rr_dict(&l->mf, rr)))
1119 for ( rr = _getdns_rr_iter_init(&rr_spc, pkt, pkt_len)
1120 ; rr ; rr = _getdns_rr_iter_next(rr)) {
1121
1122 if (!(rr_dict = _getdns_rr_iter2rr_dict(&l->mf, rr)))
11361123 continue;
11371124
1138 (void)getdns_list_append_dict(l, rr_dict);
1125 (void)_getdns_list_append_dict(l, rr_dict);
11391126 getdns_dict_destroy(rr_dict);
11401127 }
11411128 }
6868 * @return GETDNS_RETURN_GOOD on success
6969 * @return GETDNS_RETURN_GENERAL_ERROR if out of memory
7070 */
71 getdns_return_t getdns_list_add_item(struct getdns_list *list, size_t * index);
72 getdns_return_t getdns_list_append_dict(getdns_list *list,
71 getdns_return_t _getdns_list_add_item(struct getdns_list *list, size_t * index);
72 getdns_return_t _getdns_list_append_dict(getdns_list *list,
7373 const getdns_dict *child_dict);
74 getdns_return_t getdns_list_append_list(getdns_list *list,
74 getdns_return_t _getdns_list_append_list(getdns_list *list,
7575 const getdns_list *child_list);
76 getdns_return_t getdns_list_append_bindata(getdns_list *list,
76 getdns_return_t _getdns_list_append_bindata(getdns_list *list,
7777 const getdns_bindata *child_bindata);
78 getdns_return_t getdns_list_append_int(getdns_list *list,
78 getdns_return_t _getdns_list_append_string(getdns_list *list,
79 const char *value);
80
81 getdns_return_t _getdns_list_append_int(getdns_list *list,
7982 uint32_t child_uint32);
8083
8184 /**
8992 * @return GETDNS_RETURN_NO_SUCH_LIST_ITEM if list is invalid
9093 * @return GETDNS_RETURN_GENERIC_ERROR if out of memory
9194 */
92 getdns_return_t getdns_list_copy(const struct getdns_list *srclist,
95 getdns_return_t _getdns_list_copy(const struct getdns_list *srclist,
9396 struct getdns_list **dstlist);
9497
9598 /**
101104 * @return GETDNS_RETURN_GOOD on success
102105 */
103106 getdns_return_t
104 getdns_dict_copy(const struct getdns_dict *srcdict,
107 _getdns_dict_copy(const struct getdns_dict *srcdict,
105108 struct getdns_dict **dstdict);
106109
107110 /**
113116 * @return GETDNS_RETURN_GOOD on success
114117 * @return GETDNS_RETURN_GENERIC_ERROR if keys missing from dictionary
115118 */
116 getdns_return_t dict_to_sockaddr(struct getdns_dict * ns,
119 getdns_return_t _getdns_dict_to_sockaddr(struct getdns_dict * ns,
117120 struct sockaddr_storage *output);
118 getdns_return_t sockaddr_to_dict(struct getdns_context *context,
121 getdns_return_t _getdns_sockaddr_to_dict(struct getdns_context *context,
119122 struct sockaddr_storage *sockaddr, struct getdns_dict ** output);
120123
121124 getdns_dict *
122 priv_getdns_rr_iter2rr_dict(struct mem_funcs *mf, priv_getdns_rr_iter *i);
125 _getdns_rr_iter2rr_dict(struct mem_funcs *mf, _getdns_rr_iter *i);
123126
124127 struct getdns_dns_req;
125 struct getdns_dict *create_getdns_response(struct getdns_dns_req *completed_request);
126
127 getdns_dict *priv_getdns_create_reply_dict(getdns_context *context,
128 struct getdns_dict *_getdns_create_getdns_response(struct getdns_dns_req *completed_request);
129
130 getdns_dict *_getdns_create_reply_dict(getdns_context *context,
128131 getdns_network_req *req, getdns_list *just_addrs, int *rrsigs_in_answer);
129132
130 getdns_return_t priv_getdns_validate_dname(const char* dname);
131
132 int priv_getdns_dname_equal(const uint8_t *s1, const uint8_t *s2);
133 getdns_return_t _getdns_validate_dname(const char* dname);
134
135 int _getdns_dname_equal(const uint8_t *s1, const uint8_t *s2);
133136
134137 uint8_t *_getdns_list2wire(
135138 getdns_list *l, uint8_t *buf, size_t *buf_len, struct mem_funcs *mf);
148151 * @return GETDNS_RETURN_NO_SUCH_EXTENSION A name in the extensions dict is not a valid extension.
149152 * @return GETDNS_RETURN_EXTENSION_MISFORMAT One or more of the extensions has a bad format.
150153 */
151 getdns_return_t priv_getdns_validate_extensions(struct getdns_dict * extensions);
154 getdns_return_t _getdns_validate_extensions(struct getdns_dict * extensions);
152155
153156 #define DEBUG_ON(...) do { \
154157 struct timeval tv; \
3434
3535 const char *getdns_get_version(void)
3636 {
37 return "0.3.1";
37 return "0.3.2rc1";
3838 }
3939
4040 uint32_t getdns_get_version_number(void)
4141 {
42 return 0x00030000;
42 return 0x00030101;
4343 }
4444
4545 const char *getdns_get_api_version(void)