Changeset 85
- Timestamp:
- 05/18/08 06:35:58
- Files:
-
- spatialindex/trunk/ltmain.sh (modified) (125 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spatialindex/trunk/ltmain.sh
r44 r85 2 2 # NOTE: Changing this file will not affect anything until you rerun configure. 3 3 # 4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 , 20054 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 5 5 # Free Software Foundation, Inc. 6 6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 … … 18 18 # You should have received a copy of the GNU General Public License 19 19 # along with this program; if not, write to the Free Software 20 # Foundation, Inc., 5 1 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 21 # 22 22 # As a special exception to the GNU General Public License, if you … … 34 34 progpath="$0" 35 35 36 # RH: define SED for historic ltconfig's generated by Libtool 1.3 37 [ -z "$SED" ] && SED=sed 38 36 39 # The name of this program: 37 40 progname=`echo "$progpath" | $SED $basename` … … 44 47 PROGRAM=ltmain.sh 45 48 PACKAGE=libtool 46 VERSION=1.5.22 47 TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" 48 49 # See if we are running on zsh, and set the options which allow our 50 # commands through without removal of \ escapes. 51 if test -n "${ZSH_VERSION+set}" ; then 52 setopt NO_GLOB_SUBST 53 fi 49 VERSION=1.5.6 50 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)" 51 EGREP="grep -E" 52 54 53 55 54 # Check that we have a working $echo. … … 89 88 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 90 89 # test EBCDIC or ASCII 91 case `echo X|tr X '\101'` in 92 A) # ASCII based system 93 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr 94 SP2NL='tr \040 \012' 95 NL2SP='tr \015\012 \040\040' 90 case `echo A|tr A '\301'` in 91 A) # EBCDIC based system 92 SP2NL="tr '\100' '\n'" 93 NL2SP="tr '\r\n' '\100\100'" 96 94 ;; 97 *) # EBCDICbased system98 SP2NL= 'tr \100 \n'99 NL2SP= 'tr \r\n \100\100'95 *) # Assume ASCII based system 96 SP2NL="tr '\040' '\012'" 97 NL2SP="tr '\015\012' '\040\040'" 100 98 ;; 101 99 esac … … 114 112 115 113 # Make sure IFS has a sensible default 116 lt_nl=' 117 ' 118 IFS=" $lt_nl" 114 : ${IFS=" 115 "} 119 116 120 117 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then … … 133 130 show_help= 134 131 execute_dlfiles= 135 duplicate_deps=no136 preserve_args=137 132 lo2o="s/\\.lo\$/.${objext}/" 138 133 o2lo="s/\\.${objext}\$/.lo/" … … 141 136 # Shell function definitions: 142 137 # This seems to be the best place for them 143 144 # func_mktempdir [string]145 # Make a temporary directory that won't clash with other running146 # libtool processes, and avoids race conditions if possible. If147 # given, STRING is the basename for that directory.148 func_mktempdir ()149 {150 my_template="${TMPDIR-/tmp}/${1-$progname}"151 152 if test "$run" = ":"; then153 # Return a directory name, but don't create it in dry-run mode154 my_tmpdir="${my_template}-$$"155 else156 157 # If mktemp works, use that first and foremost158 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`159 160 if test ! -d "$my_tmpdir"; then161 # Failing that, at least try and use $RANDOM to avoid a race162 my_tmpdir="${my_template}-${RANDOM-0}$$"163 164 save_mktempdir_umask=`umask`165 umask 0077166 $mkdir "$my_tmpdir"167 umask $save_mktempdir_umask168 fi169 170 # If we're not in dry-run mode, bomb out on failure171 test -d "$my_tmpdir" || {172 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2173 exit $EXIT_FAILURE174 }175 fi176 177 $echo "X$my_tmpdir" | $Xsed178 }179 180 138 181 139 # func_win32_libid arg … … 185 143 # Has to be a shell function in order to 'eat' the argument 186 144 # that is supplied when $file_magic_command is called. 187 func_win32_libid () 188 { 145 func_win32_libid () { 189 146 win32_libid_type="unknown" 190 147 win32_fileres=`file -L $1 2>/dev/null` … … 197 154 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 198 155 win32_nmres=`eval $NM -f posix -A $1 | \ 199 $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` 200 case $win32_nmres in 201 import*) win32_libid_type="x86 archive import";; 202 *) win32_libid_type="x86 archive static";; 203 esac 156 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` 157 if test "X$win32_nmres" = "Ximport" ; then 158 win32_libid_type="x86 archive import" 159 else 160 win32_libid_type="x86 archive static" 161 fi 204 162 fi 205 163 ;; … … 225 183 # command doesn't match the default compiler. 226 184 # arg is usually of the form 'gcc ...' 227 func_infer_tag () 228 { 185 func_infer_tag () { 229 186 if test -n "$available_tags" && test -z "$tagname"; then 230 187 CC_quoted= … … 283 240 fi 284 241 } 285 286 287 # func_extract_an_archive dir oldlib288 func_extract_an_archive ()289 {290 f_ex_an_ar_dir="$1"; shift291 f_ex_an_ar_oldlib="$1"292 293 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"294 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?295 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then296 :297 else298 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2299 exit $EXIT_FAILURE300 fi301 }302 303 # func_extract_archives gentop oldlib ...304 func_extract_archives ()305 {306 my_gentop="$1"; shift307 my_oldlibs=${1+"$@"}308 my_oldobjs=""309 my_xlib=""310 my_xabs=""311 my_xdir=""312 my_status=""313 314 $show "${rm}r $my_gentop"315 $run ${rm}r "$my_gentop"316 $show "$mkdir $my_gentop"317 $run $mkdir "$my_gentop"318 my_status=$?319 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then320 exit $my_status321 fi322 323 for my_xlib in $my_oldlibs; do324 # Extract the objects.325 case $my_xlib in326 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;327 *) my_xabs=`pwd`"/$my_xlib" ;;328 esac329 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`330 my_xdir="$my_gentop/$my_xlib"331 332 $show "${rm}r $my_xdir"333 $run ${rm}r "$my_xdir"334 $show "$mkdir $my_xdir"335 $run $mkdir "$my_xdir"336 exit_status=$?337 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then338 exit $exit_status339 fi340 case $host in341 *-darwin*)342 $show "Extracting $my_xabs"343 # Do not bother doing anything if just a dry run344 if test -z "$run"; then345 darwin_orig_dir=`pwd`346 cd $my_xdir || exit $?347 darwin_archive=$my_xabs348 darwin_curdir=`pwd`349 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`350 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`351 if test -n "$darwin_arches"; then352 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`353 darwin_arch=354 $show "$darwin_base_archive has multiple architectures $darwin_arches"355 for darwin_arch in $darwin_arches ; do356 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"357 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"358 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"359 func_extract_an_archive "`pwd`" "${darwin_base_archive}"360 cd "$darwin_curdir"361 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"362 done # $darwin_arches363 ## Okay now we have a bunch of thin objects, gotta fatten them up :)364 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`365 darwin_file=366 darwin_files=367 for darwin_file in $darwin_filelist; do368 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`369 lipo -create -output "$darwin_file" $darwin_files370 done # $darwin_filelist371 ${rm}r unfat-$$372 cd "$darwin_orig_dir"373 else374 cd "$darwin_orig_dir"375 func_extract_an_archive "$my_xdir" "$my_xabs"376 fi # $darwin_arches377 fi # $run378 ;;379 *)380 func_extract_an_archive "$my_xdir" "$my_xabs"381 ;;382 esac383 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`384 done385 func_extract_archives_result="$my_oldobjs"386 }387 242 # End of Shell function definitions 388 243 ##################################### … … 390 245 # Darwin sucks 391 246 eval std_shrext=\"$shrext_cmds\" 392 393 disable_libs=no394 247 395 248 # Parse our command line options once, thoroughly. … … 457 310 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 458 311 $echo 459 $echo "Copyright (C) 200 5Free Software Foundation, Inc."312 $echo "Copyright (C) 2003 Free Software Foundation, Inc." 460 313 $echo "This is free software; see the source for copying conditions. There is NO" 461 314 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 462 exit $ ?315 exit $EXIT_SUCCESS 463 316 ;; 464 317 … … 469 322 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 470 323 done 471 exit $ ?324 exit $EXIT_SUCCESS 472 325 ;; 473 326 … … 494 347 $echo "disable static libraries" 495 348 fi 496 exit $ ?349 exit $EXIT_SUCCESS 497 350 ;; 498 351 … … 509 362 ;; 510 363 511 --tag) 512 prevopt="--tag" 513 prev=tag 514 preserve_args="$preserve_args --tag" 515 ;; 364 --tag) prevopt="--tag" prev=tag ;; 516 365 --tag=*) 517 366 set tag "$optarg" ${1+"$@"} … … 545 394 fi 546 395 547 case $disable_libs in548 no)549 ;;550 shared)551 build_libtool_libs=no552 build_old_libs=yes553 ;;554 static)555 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`556 ;;557 esac558 559 396 # If this variable is set in any of the actions, the command in it 560 397 # will be execed at the end. This prevents here-documents from being … … 567 404 if test -z "$mode"; then 568 405 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 569 $echo "*** Future versions of Libtool will require - -mode=MODE be specified." 1>&2406 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 570 407 case $nonopt in 571 408 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) … … 633 470 for arg 634 471 do 635 case $arg_modein472 case "$arg_mode" in 636 473 arg ) 637 474 # do not "continue". Instead, add this to base_compile … … 715 552 # Double-quote args containing other shell metacharacters. 716 553 # Many Bourne shells cannot handle close brackets correctly 717 # in scan sets, and some SunOS ksh mistreat backslash-escaping 718 # in scan sets (worked around with variable expansion), 719 # and furthermore cannot handle '|' '&' '(' ')' in scan sets 720 # at all, so we specify them separately. 554 # in scan sets, so we specify it separately. 721 555 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 722 556 lastarg="\"$lastarg\"" … … 792 626 done 793 627 794 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`795 case $qlibobj in796 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")797 qlibobj="\"$qlibobj\"" ;;798 esac799 test "X$libobj" != "X$qlibobj" \800 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \801 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."802 628 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 803 629 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` … … 872 698 exit $EXIT_FAILURE 873 699 fi 874 $echo "$srcfile"> "$lockfile"700 $echo $srcfile > "$lockfile" 875 701 fi 876 702 … … 878 704 eval srcfile=\"$fix_srcfile_path\" 879 705 fi 880 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`881 case $qsrcfile in882 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")883 qsrcfile="\"$qsrcfile\"" ;;884 esac885 706 886 707 $run $rm "$libobj" "${libobj}T" … … 904 725 905 726 if test "$pic_mode" != no; then 906 command="$base_compile $ qsrcfile $pic_flag"727 command="$base_compile $srcfile $pic_flag" 907 728 else 908 729 # Don't build PIC code 909 command="$base_compile $ qsrcfile"730 command="$base_compile $srcfile" 910 731 fi 911 732 … … 913 734 $show "$mkdir ${xdir}$objdir" 914 735 $run $mkdir ${xdir}$objdir 915 exit_status=$?916 if test "$ exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then917 exit $ exit_status736 status=$? 737 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then 738 exit $status 918 739 fi 919 740 fi … … 987 808 if test "$pic_mode" != yes; then 988 809 # Don't build PIC code 989 command="$base_compile $ qsrcfile"810 command="$base_compile $srcfile" 990 811 else 991 command="$base_compile $ qsrcfile $pic_flag"812 command="$base_compile $srcfile $pic_flag" 992 813 fi 993 814 if test "$compiler_c_o" = yes; then … … 1118 939 objs= 1119 940 non_pic_objects= 1120 notinst_path= # paths that contain not-installed libtool libraries1121 941 precious_files_regex= 1122 942 prefer_static_libs=no … … 1147 967 dlopen_self=$dlopen_self_static 1148 968 fi 1149 prefer_static_libs=yes1150 969 else 1151 970 if test -z "$pic_flag" && test -n "$link_static_flag"; then 1152 971 dlopen_self=$dlopen_self_static 1153 972 fi 1154 prefer_static_libs=built1155 973 fi 1156 974 build_libtool_libs=no 1157 975 build_old_libs=yes 976 prefer_static_libs=yes 1158 977 break 1159 978 ;; … … 1330 1149 arg="$non_pic_object" 1331 1150 fi 1332 else1333 # If the PIC object exists, use it instead.1334 # $xdir was prepended to $pic_object above.1335 non_pic_object="$pic_object"1336 non_pic_objects="$non_pic_objects $non_pic_object"1337 1151 fi 1338 1152 else … … 1418 1232 continue 1419 1233 ;; 1420 darwin_framework|darwin_framework_skip)1421 test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"1422 compile_command="$compile_command $arg"1423 finalize_command="$finalize_command $arg"1424 prev=1425 continue1426 ;;1427 1234 *) 1428 1235 eval "$prev=\"\$arg\"" … … 1480 1287 prev=expsyms_regex 1481 1288 fi 1482 continue1483 ;;1484 1485 -framework|-arch|-isysroot)1486 case " $CC " in1487 *" ${arg} ${1} "* | *" ${arg} ${1} "*)1488 prev=darwin_framework_skip ;;1489 *) compiler_flags="$compiler_flags $arg"1490 prev=darwin_framework ;;1491 esac1492 compile_command="$compile_command $arg"1493 finalize_command="$finalize_command $arg"1494 1289 continue 1495 1290 ;; … … 1521 1316 if test -z "$absdir"; then 1522 1317 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1523 absdir="$dir" 1524 notinst_path="$notinst_path $dir" 1318 exit $EXIT_FAILURE 1525 1319 fi 1526 1320 dir="$absdir" … … 1536 1330 case $host in 1537 1331 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1538 testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`1539 1332 case :$dllsearchpath: in 1540 1333 *":$dir:"*) ;; 1541 1334 *) dllsearchpath="$dllsearchpath:$dir";; 1542 1335 esac 1543 case :$dllsearchpath: in1544 *":$testbindir:"*) ;;1545 *) dllsearchpath="$dllsearchpath:$testbindir";;1546 esac1547 1336 ;; 1548 1337 esac … … 1553 1342 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 1554 1343 case $host in 1555 *-*-cygwin* | *-*- mingw* | *-*-pw32* | *-*-beos*)1344 *-*-cygwin* | *-*-pw32* | *-*-beos*) 1556 1345 # These systems don't actually have a C or math library (as such) 1557 1346 continue 1558 1347 ;; 1559 *-*- os2*)1348 *-*-mingw* | *-*-os2*) 1560 1349 # These systems don't actually have a C library (as such) 1561 1350 test "X$arg" = "X-lc" && continue 1562 1351 ;; 1563 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)1352 *-*-openbsd* | *-*-freebsd*) 1564 1353 # Do not include libc due to us having libc/libc_r. 1565 1354 test "X$arg" = "X-lc" && continue … … 1569 1358 deplibs="$deplibs -framework System" 1570 1359 continue 1571 ;;1572 *-*-sco3.2v5* | *-*-sco5v6*)1573 # Causes problems with __ctype1574 test "X$arg" = "X-lc" && continue1575 ;;1576 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)1577 # Compiler inserts libc in the correct place for threads to work1578 test "X$arg" = "X-lc" && continue1579 ;;1580 1360 esac 1581 1361 elif test "X$arg" = "X-lc_r"; then 1582 1362 case $host in 1583 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)1363 *-*-openbsd* | *-*-freebsd*) 1584 1364 # Do not include libc_r directly, use -pthread flag. 1585 1365 continue … … 1591 1371 ;; 1592 1372 1593 # Tru64 UNIX uses -model [arg] to determine the layout of C++1594 # classes, name mangling, and exception handling.1595 -model)1596 compile_command="$compile_command $arg"1597 compiler_flags="$compiler_flags $arg"1598 finalize_command="$finalize_command $arg"1599 prev=xcompiler1600 continue1601 ;;1602 1603 1373 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 1604 compiler_flags="$compiler_flags $arg" 1605 compile_command="$compile_command $arg" 1606 finalize_command="$finalize_command $arg" 1374 deplibs="$deplibs $arg" 1607 1375 continue 1608 1376 ;; … … 1613 1381 ;; 1614 1382 1615 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler 1616 # -r[0-9][0-9]* specifies the processor on the SGI compiler 1617 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler 1618 # +DA*, +DD* enable 64-bit mode on the HP compiler 1619 # -q* pass through compiler args for the IBM compiler 1620 # -m* pass through architecture-specific compiler args for GCC 1621 # -m*, -t[45]*, -txscale* pass through architecture-specific 1622 # compiler args for GCC 1623 # -pg pass through profiling flag for GCC 1624 # @file GCC response files 1625 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ 1626 -t[45]*|-txscale*|@*) 1627 1383 # gcc -m* arguments should be passed to the linker via $compiler_flags 1384 # in order to pass architecture information to the linker 1385 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo 1386 # but this is not reliable with gcc because gcc may use -mfoo to 1387 # select a different linker, different libraries, etc, while 1388 # -Wl,-mfoo simply passes -mfoo to the linker. 1389 -m*) 1628 1390 # Unknown arguments in both finalize_command and compile_command need 1629 1391 # to be aesthetically quoted because they are evaled later. … … 1636 1398 compile_command="$compile_command $arg" 1637 1399 finalize_command="$finalize_command $arg" 1638 compiler_flags="$compiler_flags $arg" 1400 if test "$with_gcc" = "yes" ; then 1401 compiler_flags="$compiler_flags $arg" 1402 fi 1639 1403 continue 1640 1404 ;; … … 1874 1638 arg="$non_pic_object" 1875 1639 fi 1876 else1877 # If the PIC object exists, use it instead.1878 # $xdir was prepended to $pic_object above.1879 non_pic_object="$pic_object"1880 non_pic_objects="$non_pic_objects $non_pic_object"1881 1640 fi 1882 1641 else … … 1984 1743 $show "$mkdir $output_objdir" 1985 1744 $run $mkdir $output_objdir 1986 exit_status=$?1987 if test "$ exit_status" -ne 0 && test ! -d "$output_objdir"; then1988 exit $ exit_status1745 status=$? 1746 if test "$status" -ne 0 && test ! -d "$output_objdir"; then 1747 exit $status 1989 1748 fi 1990 1749 fi … … 2049 1808 need_relink=no # whether we're linking any uninstalled libtool libraries 2050 1809 notinst_deplibs= # not-installed libtool libraries 1810 notinst_path= # paths that contain not-installed libtool libraries 2051 1811 case $linkmode in 2052 1812 lib) … … 2100 1860 finalize_deplibs="$deplib $finalize_deplibs" 2101 1861 else 2102 compiler_flags="$compiler_flags $deplib"1862 deplibs="$deplib $deplibs" 2103 1863 fi 2104 1864 continue … … 2107 1867 if test "$linkmode" != lib && test "$linkmode" != prog; then 2108 1868 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 1869 continue 1870 fi 1871 if test "$pass" = conv; then 1872 deplibs="$deplib $deplibs" 2109 1873 continue 2110 1874 fi … … 2219 1983 case $linkmode in 2220 1984 lib) 2221 valid_a_lib=no 2222 case $deplibs_check_method in 2223 match_pattern*) 2224 set dummy $deplibs_check_method 2225 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 2226 if eval $echo \"$deplib\" 2>/dev/null \ 2227 | $SED 10q \ 2228 | $EGREP "$match_pattern_regex" > /dev/null; then 2229 valid_a_lib=yes 2230 fi 2231 ;; 2232 pass_all) 2233 valid_a_lib=yes 2234 ;; 2235 esac 2236 if test "$valid_a_lib" != yes; then 1985 if test "$deplibs_check_method" != pass_all; then 2237 1986 $echo 2238 1987 $echo "*** Warning: Trying to link with static lib archive $deplib." … … 2284 2033 if test "$found" = yes || test -f "$lib"; then : 2285 2034 else 2286 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&22035 $echo "$modename: cannot find the library \`$lib'" 1>&2 2287 2036 exit $EXIT_FAILURE 2288 2037 fi … … 2308 2057 installed=yes 2309 2058 shouldnotlink=no 2310 avoidtemprpath=2311 2312 2059 2313 2060 # Read the .la file … … 2408 2155 absdir="$libdir" 2409 2156 fi 2410 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes2411 2157 else 2412 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2413 dir="$ladir" 2414 absdir="$abs_ladir" 2415 # Remove this search path later 2416 notinst_path="$notinst_path $abs_ladir" 2417 else 2418 dir="$ladir/$objdir" 2419 absdir="$abs_ladir/$objdir" 2420 # Remove this search path later 2421 notinst_path="$notinst_path $abs_ladir" 2422 fi 2158 dir="$ladir/$objdir" 2159 absdir="$abs_ladir/$objdir" 2160 # Remove this search path later 2161 notinst_path="$notinst_path $abs_ladir" 2423 2162 fi # $installed = yes 2424 2163 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` … … 2493 2232 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2494 2233 # We need to hardcode the library path 2495 if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then2234 if test -n "$shlibpath_var"; then 2496 2235 # Make sure the rpath contains only unique directories. 2497 2236 case "$temp_rpath " in 2498 2237 *" $dir "*) ;; 2499 2238 *" $absdir "*) ;; 2500 *) temp_rpath="$temp_rpath $ absdir" ;;2239 *) temp_rpath="$temp_rpath $dir" ;; 2501 2240 esac 2502 2241 fi … … 2535 2274 2536 2275 link_static=no # Whether the deplib will be linked statically 2537 use_static_libs=$prefer_static_libs2538 if test "$use_static_libs" = built && test "$installed" = yes ; then2539 use_static_libs=no2540 fi2541 2276 if test -n "$library_names" && 2542 { test "$ use_static_libs" = no || test -z "$old_library"; }; then2277 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2543 2278 if test "$installed" = no; then 2544 2279 notinst_deplibs="$notinst_deplibs $lib" … … 2653 2388 add="$dir/$linklib" 2654 2389 case $host in 2655 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 2656 *-*-sysv4*uw2*) add_dir="-L$dir" ;; 2657 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 2658 *-*-unixware7*) add_dir="-L$dir" ;; 2390 *-*-sco3.2v5* ) add_dir="-L$dir" ;; 2659 2391 *-*-darwin* ) 2660 2392 # if the lib is a module then we can not link against 2661 2393 # it, someone is ignoring the new warnings I added 2662 if /usr/bin/file -L $add 2> /dev/null | 2663 $EGREP ": [^:]* bundle" >/dev/null ; then 2394 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then 2664 2395 $echo "** Warning, lib $linklib is a module, not a shared library" 2665 2396 if test -z "$old_library" ; then … … 2692 2423 # Try looking first in the location we're being installed to. 2693 2424 if test -n "$inst_prefix_dir"; then 2694 case $libdirin2425 case "$libdir" in 2695 2426 [\\/]*) 2696 2427 add_dir="$add_dir -L$inst_prefix_dir$libdir" … … 2765 2496 # Try looking first in the location we're being installed to. 2766 2497 if test -n "$inst_prefix_dir"; then 2767 case $libdirin2498 case "$libdir" in 2768 2499 [\\/]*) 2769 2500 add_dir="$add_dir -L$inst_prefix_dir$libdir" … … 2826 2557 fi 2827 2558 else 2559 convenience="$convenience $dir/$old_library" 2560 old_convenience="$old_convenience $dir/$old_library" 2828 2561 deplibs="$dir/$old_library $deplibs" 2829 2562 link_static=yes … … 2943 2676 esac 2944 2677 case " $deplibs " in 2945 *" $ path"*) ;;2946 *) deplibs="$ path$deplibs" ;;2678 *" $depdepl "*) ;; 2679 *) deplibs="$depdepl $deplibs" ;; 2947 2680 esac 2948 2681 case " $deplibs " in 2949 *" $ depdepl"*) ;;2950 *) deplibs="$dep depl $deplibs" ;;2682 *" $path "*) ;; 2683 *) deplibs="$deplibs $path" ;; 2951 2684 esac 2952 2685 done … … 3213 2946 # Check that each of the things are valid numbers. 3214 2947 case $current in 3215 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]) ;;2948 [0-9]*) ;; 3216 2949 *) 3217 $echo "$modename: CURRENT \`$current' must bea nonnegative integer" 1>&22950 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 3218 2951 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3219 2952 exit $EXIT_FAILURE … … 3222 2955 3223 2956 case $revision in 3224 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]) ;;2957 [0-9]*) ;; 3225 2958 *) 3226 $echo "$modename: REVISION \`$revision' must bea nonnegative integer" 1>&22959 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 3227 2960 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3228 2961 exit $EXIT_FAILURE … … 3231 2964 3232 2965 case $age in 3233 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]) ;;2966 [0-9]*) ;; 3234 2967 *) 3235 $echo "$modename: AGE \`$age' must bea nonnegative integer" 1>&22968 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 3236 2969 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 3237 2970 exit $EXIT_FAILURE … … 3259 2992 # Darwin ld doesn't like 0 for these options... 3260 2993 minor_current=`expr $current + 1` 3261 verstring=" ${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"2994 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" 3262 2995 ;; 3263 2996 … … 3412 3145 # Eliminate all temporary directories. 3413 3146 for path in $notinst_path; do 3414 lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`3415 deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`3416 dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`3147 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` 3148 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` 3149 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` 3417 3150 done 3418 3151 … … 3465 3198 # Don't link with libc until the a.out ld.so is fixed. 3466 3199 ;; 3467 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)3200 *-*-openbsd* | *-*-freebsd*) 3468 3201 # Do not include libc due to us having libc/libc_r. 3469 ;; 3470 *-*-sco3.2v5* | *-*-sco5v6*) 3471 # Causes problems with __ctype 3472 ;; 3473 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 3474 # Compiler inserts libc in the correct place for threads to work 3202 test "X$arg" = "X-lc" && continue 3475 3203 ;; 3476 3204 *) … … 3516 3244 EOF 3517 3245 $rm conftest 3518 $LTCC $LTCFLAGS-o conftest conftest.c $deplibs3246 $LTCC -o conftest conftest.c $deplibs 3519 3247 if test "$?" -eq 0 ; then 3520 3248 ldd_output=`ldd conftest` 3521 3249 for i in $deplibs; do 3522 name= `expr $i : '-l\(.*\)'`3250 name="`expr $i : '-l\(.*\)'`" 3523 3251 # If $name is empty we are operating on a -L argument. 3524 3252 if test "$name" != "" && test "$name" -ne "0"; then … … 3557 3285 # the situation: Compile a separate program for each library. 3558 3286 for i in $deplibs; do 3559 name= `expr $i : '-l\(.*\)'`3287 name="`expr $i : '-l\(.*\)'`" 3560 3288 # If $name is empty we are operating on a -L argument. 3561 3289 if test "$name" != "" && test "$name" != "0"; then 3562 3290 $rm conftest 3563 $LTCC $LTCFLAGS-o conftest conftest.c $i3291 $LTCC -o conftest conftest.c $i 3564 3292 # Did it work? 3565 3293 if test "$?" -eq 0 ; then … … 3609 3337 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3610 3338 for a_deplib in $deplibs; do 3611 name= `expr $a_deplib : '-l\(.*\)'`3339 name="`expr $a_deplib : '-l\(.*\)'`" 3612 3340 # If $name is empty we are operating on a -L argument. 3613 3341 if test "$name" != "" && test "$name" != "0"; then … … 3678 3406 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3679 3407 for a_deplib in $deplibs; do 3680 name= `expr $a_deplib : '-l\(.*\)'`3408 name="`expr $a_deplib : '-l\(.*\)'`" 3681 3409 # If $name is empty we are operating on a -L argument. 3682 3410 if test -n "$name" && test "$name" != "0"; then … … 3808 3536 fi 3809 3537 3810 3811 # move library search paths that coincide with paths to not yet3812 # installed libraries to the beginning of the library search list3813 new_libs=3814 for path in $notinst_path; do3815 case " $new_libs " in3816 *" -L$path/$objdir "*) ;;3817 *)3818 case " $deplibs " in3819 *" -L$path/$objdir "*)3820 new_libs="$new_libs -L$path/$objdir" ;;3821 esac3822 ;;3823 esac3824 done3825 for deplib in $deplibs; do3826 case $deplib in3827 -L*)3828 case " $new_libs " in3829 *" $deplib "*) ;;3830 *) new_libs="$new_libs $deplib" ;;3831 esac3832 ;;3833 *) new_libs="$new_libs $deplib" ;;3834 esac3835 done3836 deplibs="$new_libs"3837 3838 3839 3538 # All the library-specific variables (install_libdir is set above). 3840 3539 library_names= … … 3920 3619 3921 3620 lib="$output_objdir/$realname" 3922 linknames=3923 3621 for link 3924 3622 do … … 3949 3647 $show "using reloadable object file for export list..." 3950 3648 skipped_export=: 3951 # Break out early, otherwise skipped_export may be3952 # set to false by a later but shorter cmd.3953 break3954 3649 fi 3955 3650 done … … 3985 3680 else 3986 3681 gentop="$output_objdir/${outputname}x" 3682 $show "${rm}r $gentop" 3683 $run ${rm}r "$gentop" 3684 $show "$mkdir $gentop" 3685 $run $mkdir "$gentop" 3686 status=$? 3687 if test "$status" -ne 0 && test ! -d "$gentop"; then 3688 exit $status 3689 fi 3987 3690 generated="$generated $gentop" 3988 3691 3989 func_extract_archives $gentop $convenience 3990 libobjs="$libobjs $func_extract_archives_result" 3991 fi 3992 fi 3993 3692 for xlib in $convenience; do 3693 # Extract the objects. 3694 case $xlib in 3695 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; 3696 *) xabs=`pwd`"/$xlib" ;; 3697 esac 3698 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` 3699 xdir="$gentop/$xlib" 3700 3701 $show "${rm}r $xdir" 3702 $run ${rm}r "$xdir" 3703 $show "$mkdir $xdir" 3704 $run $mkdir "$xdir" 3705 status=$? 3706 if test "$status" -ne 0 && test ! -d "$xdir"; then 3707 exit $status 3708 fi 3709 # We will extract separately just the conflicting names and we will no 3710 # longer touch any unique names. It is faster to leave these extract 3711 # automatically by $AR in one run. 3712 $show "(cd $xdir && $AR x $xabs)" 3713 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? 3714 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then 3715 : 3716
