Return to ltmain.sh CVS log | Up to [Public] / libwww / config |
1.1 frystyk 1: # ltmain.sh - Provide generalized library-building support services. 1.11 kahan 2: # NOTE: Changing this file will not affect anything until you rerun configure. 1.2 frystyk 3: # 1.13 ! vbancrof 4: # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 1.11 kahan 5: # Free Software Foundation, Inc. 1.5 frystyk 6: # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 1.1 frystyk 7: # 8: # This program is free software; you can redistribute it and/or modify 9: # it under the terms of the GNU General Public License as published by 10: # the Free Software Foundation; either version 2 of the License, or 11: # (at your option) any later version. 12: # 13: # This program is distributed in the hope that it will be useful, but 14: # WITHOUT ANY WARRANTY; without even the implied warranty of 15: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16: # General Public License for more details. 17: # 18: # You should have received a copy of the GNU General Public License 19: # along with this program; if not, write to the Free Software 1.13 ! vbancrof 20: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 1.1 frystyk 21: # 22: # As a special exception to the GNU General Public License, if you 23: # distribute this file as part of a program that contains a 24: # configuration script generated by Autoconf, you may include it under 25: # the same distribution terms that you use for the rest of that program. 26: 1.12 vbancrof 27: basename="s,^.*/,,g" 28: 29: # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 30: # is ksh but when the shell is invoked as "sh" and the current value of 31: # the _XPG environment variable is not equal to 1 (one), the special 32: # positional parameter $0, within a function call, is the name of the 33: # function. 34: progpath="$0" 35: 36: # The name of this program: 37: progname=`echo "$progpath" | $SED $basename` 38: modename="$progname" 39: 40: # Global variables: 41: EXIT_SUCCESS=0 42: EXIT_FAILURE=1 43: 44: PROGRAM=ltmain.sh 45: PACKAGE=libtool 1.13 ! vbancrof 46: VERSION=1.5.16 ! 47: TIMESTAMP=" (1.1220.2.235 2005/04/25 18:13:26)" 1.12 vbancrof 48: 1.13 ! vbancrof 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 1.12 vbancrof 54: 1.3 frystyk 55: # Check that we have a working $echo. 56: if test "X$1" = X--no-reexec; then 57: # Discard the --no-reexec flag, and continue. 58: shift 1.4 frystyk 59: elif test "X$1" = X--fallback-echo; then 1.5 frystyk 60: # Avoid inline document here, it may be left over 61: : 62: elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 63: # Yippee, $echo works! 64: : 65: else 66: # Restart under the correct shell, and then maybe $echo will work. 1.12 vbancrof 67: exec $SHELL "$progpath" --no-reexec ${1+"$@"} 1.5 frystyk 68: fi 69: 70: if test "X$1" = X--fallback-echo; then 1.4 frystyk 71: # used as fallback echo 72: shift 73: cat <<EOF 74: $* 75: EOF 1.12 vbancrof 76: exit $EXIT_SUCCESS 1.3 frystyk 77: fi 78: 1.1 frystyk 79: default_mode= 80: help="Try \`$progname --help' for more information." 81: magic="%%%MAGIC variable%%%" 82: mkdir="mkdir" 83: mv="mv -f" 84: rm="rm -f" 85: 1.2 frystyk 86: # Sed substitution that helps us do robust quoting. It backslashifies 87: # metacharacters that are still active within double-quoted strings. 1.12 vbancrof 88: Xsed="${SED}"' -e 1s/^X//' 1.2 frystyk 89: sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 1.12 vbancrof 90: # test EBCDIC or ASCII 91: case `echo A|tr A '\301'` in 92: A) # EBCDIC based system 93: SP2NL="tr '\100' '\n'" 94: NL2SP="tr '\r\n' '\100\100'" 95: ;; 96: *) # Assume ASCII based system 97: SP2NL="tr '\040' '\012'" 98: NL2SP="tr '\015\012' '\040\040'" 99: ;; 100: esac 1.2 frystyk 101: 102: # NLS nuisances. 103: # Only set LANG and LC_ALL to C if already set. 104: # These must not be set unconditionally because not all systems understand 105: # e.g. LANG=C (notably SCO). 1.3 frystyk 106: # We save the old values to restore during execute mode. 107: if test "${LC_ALL+set}" = set; then 108: save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL 109: fi 110: if test "${LANG+set}" = set; then 111: save_LANG="$LANG"; LANG=C; export LANG 112: fi 1.2 frystyk 113: 1.11 kahan 114: # Make sure IFS has a sensible default 1.13 ! vbancrof 115: lt_nl=' ! 116: ' ! 117: IFS=" $lt_nl" 1.1 frystyk 118: 119: if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 1.12 vbancrof 120: $echo "$modename: not configured to build any kind of library" 1>&2 121: $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 122: exit $EXIT_FAILURE 1.1 frystyk 123: fi 124: 125: # Global variables. 126: mode=$default_mode 127: nonopt= 128: prev= 129: prevopt= 130: run= 1.2 frystyk 131: show="$echo" 1.1 frystyk 132: show_help= 1.2 frystyk 133: execute_dlfiles= 1.4 frystyk 134: lo2o="s/\\.lo\$/.${objext}/" 1.5 frystyk 135: o2lo="s/\\.${objext}\$/.lo/" 1.13 ! vbancrof 136: quote_scanset='[[~#^*{};<>?'"'"' ]' 1.1 frystyk 137: 1.12 vbancrof 138: ##################################### 139: # Shell function definitions: 140: # This seems to be the best place for them 141: 142: # func_win32_libid arg 143: # return the library type of file 'arg' 144: # 145: # Need a lot of goo to handle *both* DLLs and import libs 146: # Has to be a shell function in order to 'eat' the argument 147: # that is supplied when $file_magic_command is called. 1.13 ! vbancrof 148: func_win32_libid () ! 149: { 1.12 vbancrof 150: win32_libid_type="unknown" 151: win32_fileres=`file -L $1 2>/dev/null` 152: case $win32_fileres in 153: *ar\ archive\ import\ library*) # definitely import 154: win32_libid_type="x86 archive import" 155: ;; 156: *ar\ archive*) # could be an import, or static 157: if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ 158: $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 159: win32_nmres=`eval $NM -f posix -A $1 | \ 160: sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` 161: if test "X$win32_nmres" = "Ximport" ; then 162: win32_libid_type="x86 archive import" 163: else 164: win32_libid_type="x86 archive static" 165: fi 166: fi 167: ;; 168: *DLL*) 169: win32_libid_type="x86 DLL" 170: ;; 171: *executable*) # but shell scripts are "executable" too... 172: case $win32_fileres in 173: *MS\ Windows\ PE\ Intel*) 174: win32_libid_type="x86 DLL" 175: ;; 176: esac 177: ;; 178: esac 179: $echo $win32_libid_type 180: } 181: 182: 183: # func_infer_tag arg 184: # Infer tagged configuration to use if any are available and 185: # if one wasn't chosen via the "--tag" command line option. 186: # Only attempt this if the compiler in the base compile 187: # command doesn't match the default compiler. 188: # arg is usually of the form 'gcc ...' 1.13 ! vbancrof 189: func_infer_tag () ! 190: { 1.12 vbancrof 191: if test -n "$available_tags" && test -z "$tagname"; then 192: CC_quoted= 193: for arg in $CC; do 194: case $arg in 1.13 ! vbancrof 195: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.12 vbancrof 196: arg="\"$arg\"" 197: ;; 198: esac 199: CC_quoted="$CC_quoted $arg" 200: done 201: case $@ in 202: # Blanks in the command may have been stripped by the calling shell, 203: # but not from the CC environment variable when configure was run. 204: " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; 205: # Blanks at the start of $base_compile will cause this to fail 206: # if we don't check for them as well. 207: *) 208: for z in $available_tags; do 209: if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 210: # Evaluate the configuration. 211: eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 212: CC_quoted= 213: for arg in $CC; do 214: # Double-quote args containing other shell metacharacters. 215: case $arg in 1.13 ! vbancrof 216: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.12 vbancrof 217: arg="\"$arg\"" 218: ;; 219: esac 220: CC_quoted="$CC_quoted $arg" 221: done 222: case "$@ " in 223: " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) 224: # The compiler in the base compile command matches 225: # the one in the tagged configuration. 226: # Assume this is the tagged configuration we want. 227: tagname=$z 228: break 229: ;; 230: esac 231: fi 232: done 233: # If $tagname still isn't set, then no tagged configuration 234: # was found and let the user know that the "--tag" command 235: # line option must be used. 236: if test -z "$tagname"; then 237: $echo "$modename: unable to infer tagged configuration" 238: $echo "$modename: specify a tag with \`--tag'" 1>&2 239: exit $EXIT_FAILURE 240: # else 241: # $echo "$modename: using $tagname tagged configuration" 242: fi 243: ;; 244: esac 245: fi 246: } 1.13 ! vbancrof 247: ! 248: ! 249: # func_extract_an_archive dir oldlib ! 250: func_extract_an_archive () ! 251: { ! 252: f_ex_an_ar_dir="$1"; shift ! 253: f_ex_an_ar_oldlib="$1" ! 254: ! 255: $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" ! 256: $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? ! 257: if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then ! 258: : ! 259: else ! 260: $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 ! 261: exit $EXIT_FAILURE ! 262: fi ! 263: } ! 264: ! 265: # func_extract_archives gentop oldlib ... ! 266: func_extract_archives () ! 267: { ! 268: my_gentop="$1"; shift ! 269: my_oldlibs=${1+"$@"} ! 270: my_oldobjs="" ! 271: my_xlib="" ! 272: my_xabs="" ! 273: my_xdir="" ! 274: my_status="" ! 275: ! 276: $show "${rm}r $my_gentop" ! 277: $run ${rm}r "$my_gentop" ! 278: $show "$mkdir $my_gentop" ! 279: $run $mkdir "$my_gentop" ! 280: my_status=$? ! 281: if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then ! 282: exit $my_status ! 283: fi ! 284: ! 285: for my_xlib in $my_oldlibs; do ! 286: # Extract the objects. ! 287: case $my_xlib in ! 288: [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; ! 289: *) my_xabs=`pwd`"/$my_xlib" ;; ! 290: esac ! 291: my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` ! 292: my_xdir="$my_gentop/$my_xlib" ! 293: ! 294: $show "${rm}r $my_xdir" ! 295: $run ${rm}r "$my_xdir" ! 296: $show "$mkdir $my_xdir" ! 297: $run $mkdir "$my_xdir" ! 298: status=$? ! 299: if test "$status" -ne 0 && test ! -d "$my_xdir"; then ! 300: exit $status ! 301: fi ! 302: case $host in ! 303: *-darwin*) ! 304: $show "Extracting $my_xabs" ! 305: # Do not bother doing anything if just a dry run ! 306: if test -z "$run"; then ! 307: darwin_orig_dir=`pwd` ! 308: cd $my_xdir || exit $? ! 309: darwin_archive=$my_xabs ! 310: darwin_curdir=`pwd` ! 311: darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` ! 312: darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` ! 313: if test -n "$darwin_arches"; then ! 314: darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` ! 315: darwin_arch= ! 316: $show "$darwin_base_archive has multiple architectures $darwin_arches" ! 317: for darwin_arch in $darwin_arches ; do ! 318: mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" ! 319: lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" ! 320: cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" ! 321: func_extract_an_archive "`pwd`" "${darwin_base_archive}" ! 322: cd "$darwin_curdir" ! 323: $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" ! 324: done # $darwin_arches ! 325: ## Okay now we have a bunch of thin objects, gotta fatten them up :) ! 326: darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` ! 327: darwin_file= ! 328: darwin_files= ! 329: for darwin_file in $darwin_filelist; do ! 330: darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` ! 331: lipo -create -output "$darwin_file" $darwin_files ! 332: done # $darwin_filelist ! 333: ${rm}r unfat-$$ ! 334: cd "$darwin_orig_dir" ! 335: else ! 336: cd "$darwin_orig_dir" ! 337: func_extract_an_archive "$my_xdir" "$my_xabs" ! 338: fi # $darwin_arches ! 339: fi # $run ! 340: ;; ! 341: *) ! 342: func_extract_an_archive "$my_xdir" "$my_xabs" ! 343: ;; ! 344: esac ! 345: my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` ! 346: done ! 347: func_extract_archives_result="$my_oldobjs" ! 348: } 1.12 vbancrof 349: # End of Shell function definitions 350: ##################################### 351: 352: # Darwin sucks 353: eval std_shrext=\"$shrext_cmds\" 354: 1.1 frystyk 355: # Parse our command line options once, thoroughly. 1.12 vbancrof 356: while test "$#" -gt 0 1.1 frystyk 357: do 358: arg="$1" 359: shift 360: 1.11 kahan 361: case $arg in 1.2 frystyk 362: -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 1.1 frystyk 363: *) optarg= ;; 364: esac 365: 366: # If the previous option needs an argument, assign it. 367: if test -n "$prev"; then 1.11 kahan 368: case $prev in 1.2 frystyk 369: execute_dlfiles) 1.11 kahan 370: execute_dlfiles="$execute_dlfiles $arg" 1.2 frystyk 371: ;; 1.12 vbancrof 372: tag) 373: tagname="$arg" 374: preserve_args="${preserve_args}=$arg" 375: 376: # Check whether tagname contains only valid characters 377: case $tagname in 378: *[!-_A-Za-z0-9,/]*) 379: $echo "$progname: invalid tag name: $tagname" 1>&2 380: exit $EXIT_FAILURE 381: ;; 382: esac 383: 384: case $tagname in 385: CC) 386: # Don't test for the "default" C tag, as we know, it's there, but 387: # not specially marked. 388: ;; 389: *) 390: if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then 391: taglist="$taglist $tagname" 392: # Evaluate the configuration. 393: eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" 394: else 395: $echo "$progname: ignoring unknown tag $tagname" 1>&2 396: fi 397: ;; 398: esac 399: ;; 1.2 frystyk 400: *) 401: eval "$prev=\$arg" 402: ;; 403: esac 404: 1.1 frystyk 405: prev= 406: prevopt= 407: continue 408: fi 409: 410: # Have we seen a non-optional argument yet? 1.11 kahan 411: case $arg in 1.1 frystyk 412: --help) 413: show_help=yes 414: ;; 415: 416: --version) 1.12 vbancrof 417: $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 418: $echo 1.13 ! vbancrof 419: $echo "Copyright (C) 2005 Free Software Foundation, Inc." 1.12 vbancrof 420: $echo "This is free software; see the source for copying conditions. There is NO" 421: $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 1.13 ! vbancrof 422: exit $? 1.1 frystyk 423: ;; 424: 1.3 frystyk 425: --config) 1.12 vbancrof 426: ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath 427: # Now print the configurations for the tags. 428: for tagname in $taglist; do 429: ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" 430: done 1.13 ! vbancrof 431: exit $? 1.3 frystyk 432: ;; 433: 434: --debug) 1.12 vbancrof 435: $echo "$progname: enabling shell trace mode" 1.3 frystyk 436: set -x 1.12 vbancrof 437: preserve_args="$preserve_args $arg" 1.3 frystyk 438: ;; 439: 1.1 frystyk 440: --dry-run | -n) 441: run=: 442: ;; 443: 444: --features) 1.12 vbancrof 445: $echo "host: $host" 1.1 frystyk 446: if test "$build_libtool_libs" = yes; then 1.12 vbancrof 447: $echo "enable shared libraries" 1.1 frystyk 448: else 1.12 vbancrof 449: $echo "disable shared libraries" 1.1 frystyk 450: fi 451: if test "$build_old_libs" = yes; then 1.12 vbancrof 452: $echo "enable static libraries" 1.1 frystyk 453: else 1.12 vbancrof 454: $echo "disable static libraries" 1.1 frystyk 455: fi 1.13 ! vbancrof 456: exit $? 1.1 frystyk 457: ;; 458: 459: --finish) mode="finish" ;; 460: 461: --mode) prevopt="--mode" prev=mode ;; 462: --mode=*) mode="$optarg" ;; 463: 1.11 kahan 464: --preserve-dup-deps) duplicate_deps="yes" ;; 465: 1.2 frystyk 466: --quiet | --silent) 467: show=: 1.12 vbancrof 468: preserve_args="$preserve_args $arg" 469: ;; 470: 471: --tag) prevopt="--tag" prev=tag ;; 472: --tag=*) 473: set tag "$optarg" ${1+"$@"} 474: shift 475: prev=tag 476: preserve_args="$preserve_args --tag" 1.2 frystyk 477: ;; 478: 479: -dlopen) 480: prevopt="-dlopen" 481: prev=execute_dlfiles 482: ;; 483: 1.1 frystyk 484: -*) 1.2 frystyk 485: $echo "$modename: unrecognized option \`$arg'" 1>&2 486: $echo "$help" 1>&2 1.12 vbancrof 487: exit $EXIT_FAILURE 1.1 frystyk 488: ;; 489: 490: *) 491: nonopt="$arg" 492: break 493: ;; 494: esac 495: done 496: 497: if test -n "$prevopt"; then 1.2 frystyk 498: $echo "$modename: option \`$prevopt' requires an argument" 1>&2 499: $echo "$help" 1>&2 1.12 vbancrof 500: exit $EXIT_FAILURE 1.1 frystyk 501: fi 502: 1.11 kahan 503: # If this variable is set in any of the actions, the command in it 504: # will be execed at the end. This prevents here-documents from being 505: # left over by shells. 506: exec_cmd= 507: 1.1 frystyk 508: if test -z "$show_help"; then 509: 510: # Infer the operation mode. 511: if test -z "$mode"; then 1.12 vbancrof 512: $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 1.13 ! vbancrof 513: $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 1.11 kahan 514: case $nonopt in 1.12 vbancrof 515: *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) 1.1 frystyk 516: mode=link 517: for arg 518: do 1.11 kahan 519: case $arg in 1.4 frystyk 520: -c) 521: mode=compile 522: break 523: ;; 524: esac 1.1 frystyk 525: done 526: ;; 1.3 frystyk 527: *db | *dbx | *strace | *truss) 1.2 frystyk 528: mode=execute 529: ;; 530: *install*|cp|mv) 1.1 frystyk 531: mode=install 532: ;; 533: *rm) 534: mode=uninstall 535: ;; 536: *) 1.2 frystyk 537: # If we have no mode, but dlfiles were specified, then do execute mode. 538: test -n "$execute_dlfiles" && mode=execute 539: 1.1 frystyk 540: # Just use the default operation mode. 541: if test -z "$mode"; then 1.4 frystyk 542: if test -n "$nonopt"; then 543: $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 544: else 545: $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 546: fi 1.1 frystyk 547: fi 548: ;; 549: esac 550: fi 551: 1.2 frystyk 552: # Only execute mode is allowed to have -dlopen flags. 553: if test -n "$execute_dlfiles" && test "$mode" != execute; then 554: $echo "$modename: unrecognized option \`-dlopen'" 1>&2 555: $echo "$help" 1>&2 1.12 vbancrof 556: exit $EXIT_FAILURE 1.2 frystyk 557: fi 558: 1.1 frystyk 559: # Change the help message to a mode-specific one. 560: generic_help="$help" 1.2 frystyk 561: help="Try \`$modename --help --mode=$mode' for more information." 1.1 frystyk 562: 563: # These modes are in order of execution frequency so that they run quickly. 1.11 kahan 564: case $mode in 1.1 frystyk 565: # libtool compile mode 566: compile) 1.2 frystyk 567: modename="$modename: compile" 1.1 frystyk 568: # Get the compilation command and the source file. 1.2 frystyk 569: base_compile= 1.12 vbancrof 570: srcfile="$nonopt" # always keep a non-empty value in "srcfile" 571: suppress_opt=yes 1.2 frystyk 572: suppress_output= 1.12 vbancrof 573: arg_mode=normal 574: libobj= 575: later= 1.1 frystyk 576: 577: for arg 578: do 1.12 vbancrof 579: case "$arg_mode" in 580: arg ) 581: # do not "continue". Instead, add this to base_compile 582: lastarg="$arg" 583: arg_mode=normal 584: ;; 1.11 kahan 585: 1.12 vbancrof 586: target ) 587: libobj="$arg" 588: arg_mode=normal 1.11 kahan 589: continue 590: ;; 591: 1.12 vbancrof 592: normal ) 593: # Accept any command-line options. 594: case $arg in 595: -o) 596: if test -n "$libobj" ; then 597: $echo "$modename: you cannot specify \`-o' more than once" 1>&2 598: exit $EXIT_FAILURE 599: fi 600: arg_mode=target 601: continue 602: ;; 1.2 frystyk 603: 1.12 vbancrof 604: -static | -prefer-pic | -prefer-non-pic) 605: later="$later $arg" 606: continue 607: ;; 1.11 kahan 608: 1.12 vbancrof 609: -no-suppress) 610: suppress_opt=no 611: continue 612: ;; 1.11 kahan 613: 1.12 vbancrof 614: -Xcompiler) 615: arg_mode=arg # the next one goes into the "base_compile" arg list 616: continue # The current "srcfile" will either be retained or 617: ;; # replaced later. I would guess that would be a bug. 618: 619: -Wc,*) 620: args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 621: lastarg= 622: save_ifs="$IFS"; IFS=',' 623: for arg in $args; do 624: IFS="$save_ifs" 1.11 kahan 625: 1.12 vbancrof 626: # Double-quote args containing other shell metacharacters. 627: # Many Bourne shells cannot handle close brackets correctly 628: # in scan sets, so we specify it separately. 629: case $arg in 1.13 ! vbancrof 630: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.12 vbancrof 631: arg="\"$arg\"" 632: ;; 633: esac 634: lastarg="$lastarg $arg" 635: done 1.11 kahan 636: IFS="$save_ifs" 1.12 vbancrof 637: lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 1.11 kahan 638: 1.12 vbancrof 639: # Add the arguments to base_compile. 1.11 kahan 640: base_compile="$base_compile $lastarg" 1.12 vbancrof 641: continue 642: ;; 1.2 frystyk 643: 1.12 vbancrof 644: * ) 645: # Accept the current argument as the source file. 646: # The previous "srcfile" becomes the current argument. 647: # 648: lastarg="$srcfile" 649: srcfile="$arg" 650: ;; 651: esac # case $arg 1.4 frystyk 652: ;; 1.12 vbancrof 653: esac # case $arg_mode 1.2 frystyk 654: 655: # Aesthetically quote the previous argument. 656: lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 657: 1.12 vbancrof 658: case $lastarg in 1.2 frystyk 659: # Double-quote args containing other shell metacharacters. 1.11 kahan 660: # Many Bourne shells cannot handle close brackets correctly 1.13 ! vbancrof 661: # in scan sets, and some SunOS ksh mistreat backslash-escaping ! 662: # in scan sets (worked around with variable expansion), ! 663: # and furthermore cannot handle '|' '&' '(' ')' in scan sets ! 664: # at all, so we specify them separately. ! 665: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.2 frystyk 666: lastarg="\"$lastarg\"" 667: ;; 1.1 frystyk 668: esac 669: 1.12 vbancrof 670: base_compile="$base_compile $lastarg" 671: done # for arg 1.1 frystyk 672: 1.12 vbancrof 673: case $arg_mode in 674: arg) 675: $echo "$modename: you must specify an argument for -Xcompile" 676: exit $EXIT_FAILURE 1.4 frystyk 677: ;; 1.12 vbancrof 678: target) 679: $echo "$modename: you must specify a target with \`-o'" 1>&2 680: exit $EXIT_FAILURE 1.4 frystyk 681: ;; 682: *) 1.12 vbancrof 683: # Get the name of the library object. 684: [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 1.4 frystyk 685: ;; 686: esac 1.1 frystyk 687: 688: # Recognize several different file suffixes. 1.4 frystyk 689: # If the user specifies -o file.o, it is replaced with file.lo 1.12 vbancrof 690: xform='[cCFSifmso]' 1.11 kahan 691: case $libobj in 1.2 frystyk 692: *.ada) xform=ada ;; 693: *.adb) xform=adb ;; 694: *.ads) xform=ads ;; 695: *.asm) xform=asm ;; 696: *.c++) xform=c++ ;; 1.1 frystyk 697: *.cc) xform=cc ;; 1.12 vbancrof 698: *.ii) xform=ii ;; 699: *.class) xform=class ;; 1.1 frystyk 700: *.cpp) xform=cpp ;; 701: *.cxx) xform=cxx ;; 702: *.f90) xform=f90 ;; 1.2 frystyk 703: *.for) xform=for ;; 1.12 vbancrof 704: *.java) xform=java ;; 1.1 frystyk 705: esac 706: 1.2 frystyk 707: libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 1.1 frystyk 708: 1.11 kahan 709: case $libobj in 1.4 frystyk 710: *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 1.1 frystyk 711: *) 1.4 frystyk 712: $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 1.12 vbancrof 713: exit $EXIT_FAILURE 1.1 frystyk 714: ;; 715: esac 716: 1.12 vbancrof 717: func_infer_tag $base_compile 718: 719: for arg in $later; do 720: case $arg in 721: -static) 722: build_old_libs=yes 723: continue 724: ;; 725: 726: -prefer-pic) 727: pic_mode=yes 728: continue 729: ;; 730: 731: -prefer-non-pic) 732: pic_mode=no 733: continue 734: ;; 735: esac 736: done 737: 1.13 ! vbancrof 738: qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` ! 739: case $qlibobj in ! 740: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") ! 741: qlibobj="\"$qlibobj\"" ;; ! 742: esac ! 743: if test "X$libobj" != "X$qlibobj"; then ! 744: $echo "$modename: libobj name \`$libobj' may not contain shell special characters." ! 745: exit $EXIT_FAILURE ! 746: fi 1.12 vbancrof 747: objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` 748: xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 749: if test "X$xdir" = "X$obj"; then 750: xdir= 751: else 752: xdir=$xdir/ 753: fi 754: lobj=${xdir}$objdir/$objname 755: 1.1 frystyk 756: if test -z "$base_compile"; then 1.2 frystyk 757: $echo "$modename: you must specify a compilation command" 1>&2 758: $echo "$help" 1>&2 1.12 vbancrof 759: exit $EXIT_FAILURE 1.1 frystyk 760: fi 761: 762: # Delete any leftover library objects. 763: if test "$build_old_libs" = yes; then 1.12 vbancrof 764: removelist="$obj $lobj $libobj ${libobj}T" 1.4 frystyk 765: else 1.12 vbancrof 766: removelist="$lobj $libobj ${libobj}T" 1.4 frystyk 767: fi 768: 769: $run $rm $removelist 1.12 vbancrof 770: trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 1.4 frystyk 771: 1.11 kahan 772: # On Cygwin there's no "real" PIC flag so we must build both object types 773: case $host_os in 774: cygwin* | mingw* | pw32* | os2*) 775: pic_mode=default 776: ;; 777: esac 1.12 vbancrof 778: if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 1.11 kahan 779: # non-PIC code in shared libraries is not supported 780: pic_mode=default 781: fi 782: 1.4 frystyk 783: # Calculate the filename of the output object if compiler does 784: # not support -o with -c 785: if test "$compiler_c_o" = no; then 1.11 kahan 786: output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 1.4 frystyk 787: lockfile="$output_obj.lock" 788: removelist="$removelist $output_obj $lockfile" 1.12 vbancrof 789: trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 1.1 frystyk 790: else 1.12 vbancrof 791: output_obj= 1.4 frystyk 792: need_locks=no 793: lockfile= 794: fi 795: 796: # Lock this critical section if it is needed 797: # We use this script file to make the link, it avoids creating a new file 798: if test "$need_locks" = yes; then 1.12 vbancrof 799: until $run ln "$progpath" "$lockfile" 2>/dev/null; do 1.4 frystyk 800: $show "Waiting for $lockfile to be removed" 801: sleep 2 802: done 803: elif test "$need_locks" = warn; then 804: if test -f "$lockfile"; then 1.12 vbancrof 805: $echo "\ 1.4 frystyk 806: *** ERROR, $lockfile exists and contains: 807: `cat $lockfile 2>/dev/null` 808: 809: This indicates that another process is trying to use the same 810: temporary object file, and libtool could not work around it because 811: your compiler does not support \`-c' and \`-o' together. If you 812: repeat this compilation, it may succeed, by chance, but you had better 813: avoid parallel builds (make -j) in this platform, or get a better 814: compiler." 815: 816: $run $rm $removelist 1.12 vbancrof 817: exit $EXIT_FAILURE 1.4 frystyk 818: fi 1.13 ! vbancrof 819: $echo "$srcfile" > "$lockfile" 1.4 frystyk 820: fi 821: 822: if test -n "$fix_srcfile_path"; then 823: eval srcfile=\"$fix_srcfile_path\" 1.1 frystyk 824: fi 1.13 ! vbancrof 825: qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` ! 826: case $qsrcfile in ! 827: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") ! 828: qsrcfile="\"$qsrcfile\"" ;; ! 829: esac 1.1 frystyk 830: 1.12 vbancrof 831: $run $rm "$libobj" "${libobj}T" 832: 833: # Create a libtool object file (analogous to a ".la" file), 834: # but don't create it if we're doing a dry run. 835: test -z "$run" && cat > ${libobj}T <<EOF 836: # $libobj - a libtool object file 837: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 838: # 839: # Please DO NOT delete this file! 840: # It is necessary for linking the library. 841: 842: # Name of the PIC object. 843: EOF 844: 1.1 frystyk 845: # Only build a PIC object if we are building libtool libraries. 846: if test "$build_libtool_libs" = yes; then 1.2 frystyk 847: # Without this assignment, base_compile gets emptied. 848: fbsd_hideous_sh_bug=$base_compile 849: 1.11 kahan 850: if test "$pic_mode" != no; then 1.13 ! vbancrof 851: command="$base_compile $qsrcfile $pic_flag" 1.11 kahan 852: else 853: # Don't build PIC code 1.13 ! vbancrof 854: command="$base_compile $qsrcfile" 1.11 kahan 855: fi 1.4 frystyk 856: 1.12 vbancrof 857: if test ! -d "${xdir}$objdir"; then 858: $show "$mkdir ${xdir}$objdir" 859: $run $mkdir ${xdir}$objdir 860: status=$? 861: if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then 862: exit $status 1.4 frystyk 863: fi 864: fi 1.12 vbancrof 865: 866: if test -z "$output_obj"; then 867: # Place PIC objects in $objdir 868: command="$command -o $lobj" 1.4 frystyk 869: fi 870: 1.12 vbancrof 871: $run $rm "$lobj" "$output_obj" 872: 1.4 frystyk 873: $show "$command" 874: if $run eval "$command"; then : 1.1 frystyk 875: else 1.4 frystyk 876: test -n "$output_obj" && $run $rm $removelist 1.12 vbancrof 877: exit $EXIT_FAILURE 1.4 frystyk 878: fi 879: 880: if test "$need_locks" = warn && 1.12 vbancrof 881: test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 882: $echo "\ 1.4 frystyk 883: *** ERROR, $lockfile contains: 884: `cat $lockfile 2>/dev/null` 885: 886: but it should contain: 887: $srcfile 888: 889: This indicates that another process is trying to use the same 890: temporary object file, and libtool could not work around it because 891: your compiler does not support \`-c' and \`-o' together. If you 892: repeat this compilation, it may succeed, by chance, but you had better 893: avoid parallel builds (make -j) in this platform, or get a better 894: compiler." 895: 896: $run $rm $removelist 1.12 vbancrof 897: exit $EXIT_FAILURE 1.4 frystyk 898: fi 899: 900: # Just move the object if needed, then go on to compile the next one 1.12 vbancrof 901: if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 902: $show "$mv $output_obj $lobj" 903: if $run $mv $output_obj $lobj; then : 1.4 frystyk 904: else 905: error=$? 906: $run $rm $removelist 907: exit $error 908: fi 1.1 frystyk 909: fi 910: 1.12 vbancrof 911: # Append the name of the PIC object to the libtool object file. 912: test -z "$run" && cat >> ${libobj}T <<EOF 913: pic_object='$objdir/$objname' 1.4 frystyk 914: 1.12 vbancrof 915: EOF 1.4 frystyk 916: 1.12 vbancrof 917: # Allow error messages only from the first compilation. 918: if test "$suppress_opt" = yes; then 919: suppress_output=' >/dev/null 2>&1' 1.1 frystyk 920: fi 1.12 vbancrof 921: else 922: # No PIC object so indicate it doesn't exist in the libtool 923: # object file. 924: test -z "$run" && cat >> ${libobj}T <<EOF 925: pic_object=none 1.1 frystyk 926: 1.12 vbancrof 927: EOF 1.1 frystyk 928: fi 929: 930: # Only build a position-dependent object if we build old libraries. 931: if test "$build_old_libs" = yes; then 1.11 kahan 932: if test "$pic_mode" != yes; then 933: # Don't build PIC code 1.13 ! vbancrof 934: command="$base_compile $qsrcfile" 1.11 kahan 935: else 1.13 ! vbancrof 936: command="$base_compile $qsrcfile $pic_flag" 1.11 kahan 937: fi 1.4 frystyk 938: if test "$compiler_c_o" = yes; then 939: command="$command -o $obj" 940: fi 941: 1.2 frystyk 942: # Suppress compiler output if we already did a PIC compilation. 1.4 frystyk 943: command="$command$suppress_output" 1.12 vbancrof 944: $run $rm "$obj" "$output_obj" 1.4 frystyk 945: $show "$command" 946: if $run eval "$command"; then : 1.1 frystyk 947: else 1.4 frystyk 948: $run $rm $removelist 1.12 vbancrof 949: exit $EXIT_FAILURE 1.4 frystyk 950: fi 951: 952: if test "$need_locks" = warn && 1.12 vbancrof 953: test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 954: $echo "\ 1.4 frystyk 955: *** ERROR, $lockfile contains: 956: `cat $lockfile 2>/dev/null` 957: 958: but it should contain: 959: $srcfile 960: 961: This indicates that another process is trying to use the same 962: temporary object file, and libtool could not work around it because 963: your compiler does not support \`-c' and \`-o' together. If you 964: repeat this compilation, it may succeed, by chance, but you had better 965: avoid parallel builds (make -j) in this platform, or get a better 966: compiler." 967: 968: $run $rm $removelist 1.12 vbancrof 969: exit $EXIT_FAILURE 1.4 frystyk 970: fi 971: 972: # Just move the object if needed 1.12 vbancrof 973: if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 1.4 frystyk 974: $show "$mv $output_obj $obj" 975: if $run $mv $output_obj $obj; then : 976: else 977: error=$? 978: $run $rm $removelist 979: exit $error 980: fi 981: fi 982: 1.12 vbancrof 983: # Append the name of the non-PIC object the libtool object file. 984: # Only append if the libtool object file exists. 985: test -z "$run" && cat >> ${libobj}T <<EOF 986: # Name of the non-PIC object. 987: non_pic_object='$objname' 988: 989: EOF 990: else 991: # Append the name of the non-PIC object the libtool object file. 992: # Only append if the libtool object file exists. 993: test -z "$run" && cat >> ${libobj}T <<EOF 994: # Name of the non-PIC object. 995: non_pic_object=none 996: 997: EOF 1.1 frystyk 998: fi 999: 1.12 vbancrof 1000: $run $mv "${libobj}T" "${libobj}" 1001: 1.4 frystyk 1002: # Unlock the critical section if it was locked 1003: if test "$need_locks" != no; then 1.11 kahan 1004: $run $rm "$lockfile" 1.1 frystyk 1005: fi 1006: 1.12 vbancrof 1007: exit $EXIT_SUCCESS 1.1 frystyk 1008: ;; 1009: 1010: # libtool link mode 1.11 kahan 1011: link | relink) 1.2 frystyk 1012: modename="$modename: link" 1.11 kahan 1013: case $host in 1014: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1.4 frystyk 1015: # It is impossible to link a dll without this setting, and 1016: # we shouldn't force the makefile maintainer to figure out 1017: # which system we are compiling for in order to pass an extra 1.12 vbancrof 1018: # flag for every libtool invocation. 1.4 frystyk 1019: # allow_undefined=no 1020: 1021: # FIXME: Unfortunately, there are problems with the above when trying 1022: # to make a dll which has undefined symbols, in which case not 1023: # even a static library is built. For now, we need to specify 1024: # -no-undefined on the libtool link line when we can be certain 1025: # that all symbols are satisfied, otherwise we get a static library. 1026: allow_undefined=yes 1027: ;; 1028: *) 1029: allow_undefined=yes 1030: ;; 1031: esac 1.11 kahan 1032: libtool_args="$nonopt" 1.12 vbancrof 1033: base_compile="$nonopt $@" 1.11 kahan 1034: compile_command="$nonopt" 1035: finalize_command="$nonopt" 1.2 frystyk 1036: 1.5 frystyk 1037: compile_rpath= 1038: finalize_rpath= 1.1 frystyk 1039: compile_shlibpath= 1040: finalize_shlibpath= 1.3 frystyk 1041: convenience= 1042: old_convenience= 1.1 frystyk 1043: deplibs= 1.11 kahan 1044: old_deplibs= 1045: compiler_flags= 1046: linker_flags= 1047: dllsearchpath= 1048: lib_search_path=`pwd` 1.12 vbancrof 1049: inst_prefix_dir= 1.4 frystyk 1050: 1051: avoid_version=no 1.2 frystyk 1052: dlfiles= 1053: dlprefiles= 1.5 frystyk 1054: dlself=no 1.1 frystyk 1055: export_dynamic=no 1.4 frystyk 1056: export_symbols= 1.5 frystyk 1057: export_symbols_regex= 1.3 frystyk 1058: generated= 1.1 frystyk 1059: libobjs= 1060: ltlibs= 1.4 frystyk 1061: module=no 1.11 kahan 1062: no_install=no 1.1 frystyk 1063: objs= 1.12 vbancrof 1064: non_pic_objects= 1065: precious_files_regex= 1.5 frystyk 1066: prefer_static_libs=no 1.4 frystyk 1067: preload=no 1.1 frystyk 1068: prev= 1069: prevarg= 1.2 frystyk 1070: release= 1071: rpath= 1.4 frystyk 1072: xrpath= 1.1 frystyk 1073: perm_rpath= 1074: temp_rpath= 1.5 frystyk 1075: thread_safe=no 1.1 frystyk 1076: vinfo= 1.12 vbancrof 1077: vinfo_number=no 1078: 1079: func_infer_tag $base_compile 1.1 frystyk 1080: 1081: # We need to know -static, to get the right output filenames. 1082: for arg 1083: do 1.11 kahan 1084: case $arg in 1.2 frystyk 1085: -all-static | -static) 1.5 frystyk 1086: if test "X$arg" = "X-all-static"; then 1087: if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 1.2 frystyk 1088: $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 1.5 frystyk 1089: fi 1090: if test -n "$link_static_flag"; then 1091: dlopen_self=$dlopen_self_static 1092: fi 1093: else 1094: if test -z "$pic_flag" && test -n "$link_static_flag"; then 1095: dlopen_self=$dlopen_self_static 1096: fi 1.4 frystyk 1097: fi 1098: build_libtool_libs=no 1.2 frystyk 1099: build_old_libs=yes 1.5 frystyk 1100: prefer_static_libs=yes 1.4 frystyk 1101: break 1102: ;; 1.1 frystyk 1103: esac 1104: done 1105: 1.2 frystyk 1106: # See if our shared archives depend on static archives. 1107: test -n "$old_archive_from_new_cmds" && build_old_libs=yes 1108: 1109: # Go through the arguments, transforming them on the way. 1.12 vbancrof 1110: while test "$#" -gt 0; do 1.3 frystyk 1111: arg="$1" 1112: shift 1.11 kahan 1113: case $arg in 1.13 ! vbancrof 1114: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.11 kahan 1115: qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test 1116: ;; 1117: *) qarg=$arg ;; 1118: esac 1119: libtool_args="$libtool_args $qarg" 1.3 frystyk 1120: 1.1 frystyk 1121: # If the previous option needs an argument, assign it. 1122: if test -n "$prev"; then 1.11 kahan 1123: case $prev in 1.4 frystyk 1124: output) 1125: compile_command="$compile_command @OUTPUT@" 1126: finalize_command="$finalize_command @OUTPUT@" 1127: ;; 1128: esac 1129: 1.11 kahan 1130: case $prev in 1.4 frystyk 1131: dlfiles|dlprefiles) 1132: if test "$preload" = no; then 1133: # Add the symbol object into the linking commands. 1134: compile_command="$compile_command @SYMFILE@" 1135: finalize_command="$finalize_command @SYMFILE@" 1136: preload=yes 1137: fi 1.11 kahan 1138: case $arg in 1.4 frystyk 1139: *.la | *.lo) ;; # We handle these cases below. 1.7 frystyk 1140: force) 1141: if test "$dlself" = no; then 1142: dlself=needless 1143: export_dynamic=yes 1144: fi 1145: prev= 1146: continue 1147: ;; 1.5 frystyk 1148: self) 1149: if test "$prev" = dlprefiles; then 1150: dlself=yes 1151: elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 1152: dlself=yes 1153: else 1154: dlself=needless 1155: export_dynamic=yes 1156: fi 1157: prev= 1158: continue 1159: ;; 1.4 frystyk 1160: *) 1.5 frystyk 1161: if test "$prev" = dlfiles; then 1162: dlfiles="$dlfiles $arg" 1163: else 1164: dlprefiles="$dlprefiles $arg" 1165: fi 1.4 frystyk 1166: prev= 1.11 kahan 1167: continue 1.4 frystyk 1168: ;; 1169: esac 1170: ;; 1.5 frystyk 1171: expsyms) 1.4 frystyk 1172: export_symbols="$arg" 1173: if test ! -f "$arg"; then 1174: $echo "$modename: symbol file \`$arg' does not exist" 1.12 vbancrof 1175: exit $EXIT_FAILURE 1.4 frystyk 1176: fi 1177: prev= 1.5 frystyk 1178: continue 1.4 frystyk 1179: ;; 1.5 frystyk 1180: expsyms_regex) 1181: export_symbols_regex="$arg" 1.2 frystyk 1182: prev= 1183: continue 1184: ;; 1.12 vbancrof 1185: inst_prefix) 1186: inst_prefix_dir="$arg" 1187: prev= 1188: continue 1189: ;; 1190: precious_regex) 1191: precious_files_regex="$arg" 1192: prev= 1193: continue 1194: ;; 1.5 frystyk 1195: release) 1196: release="-$arg" 1.4 frystyk 1197: prev= 1198: continue 1199: ;; 1.12 vbancrof 1200: objectlist) 1201: if test -f "$arg"; then 1202: save_arg=$arg 1203: moreargs= 1204: for fil in `cat $save_arg` 1205: do 1206: # moreargs="$moreargs $fil" 1207: arg=$fil 1208: # A libtool-controlled object. 1209: 1210: # Check to see that this really is a libtool object. 1211: if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1212: pic_object= 1213: non_pic_object= 1214: 1215: # Read the .lo file 1216: # If there is no directory component, then add one. 1217: case $arg in 1218: */* | *\\*) . $arg ;; 1219: *) . ./$arg ;; 1220: esac 1221: 1222: if test -z "$pic_object" || \ 1223: test -z "$non_pic_object" || 1224: test "$pic_object" = none && \ 1225: test "$non_pic_object" = none; then 1226: $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1227: exit $EXIT_FAILURE 1228: fi 1229: 1230: # Extract subdirectory from the argument. 1231: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1232: if test "X$xdir" = "X$arg"; then 1233: xdir= 1234: else 1235: xdir="$xdir/" 1236: fi 1237: 1238: if test "$pic_object" != none; then 1239: # Prepend the subdirectory the object is found in. 1240: pic_object="$xdir$pic_object" 1241: 1242: if test "$prev" = dlfiles; then 1243: if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1244: dlfiles="$dlfiles $pic_object" 1245: prev= 1246: continue 1247: else 1248: # If libtool objects are unsupported, then we need to preload. 1249: prev=dlprefiles 1250: fi 1251: fi 1252: 1253: # CHECK ME: I think I busted this. -Ossama 1254: if test "$prev" = dlprefiles; then 1255: # Preload the old-style object. 1256: dlprefiles="$dlprefiles $pic_object" 1257: prev= 1258: fi 1259: 1260: # A PIC object. 1261: libobjs="$libobjs $pic_object" 1262: arg="$pic_object" 1263: fi 1264: 1265: # Non-PIC object. 1266: if test "$non_pic_object" != none; then 1267: # Prepend the subdirectory the object is found in. 1268: non_pic_object="$xdir$non_pic_object" 1269: 1270: # A standard non-PIC object 1271: non_pic_objects="$non_pic_objects $non_pic_object" 1272: if test -z "$pic_object" || test "$pic_object" = none ; then 1273: arg="$non_pic_object" 1274: fi 1275: fi 1276: else 1277: # Only an error if not doing a dry-run. 1278: if test -z "$run"; then 1279: $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1280: exit $EXIT_FAILURE 1281: else 1282: # Dry-run case. 1283: 1284: # Extract subdirectory from the argument. 1285: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1286: if test "X$xdir" = "X$arg"; then 1287: xdir= 1288: else 1289: xdir="$xdir/" 1290: fi 1291: 1292: pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1293: non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1294: libobjs="$libobjs $pic_object" 1295: non_pic_objects="$non_pic_objects $non_pic_object" 1296: fi 1297: fi 1298: done 1299: else 1300: $echo "$modename: link input file \`$save_arg' does not exist" 1301: exit $EXIT_FAILURE 1302: fi 1303: arg=$save_arg 1304: prev= 1305: continue 1306: ;; 1.5 frystyk 1307: rpath | xrpath) 1308: # We need an absolute path. 1.11 kahan 1309: case $arg in 1.5 frystyk 1310: [\\/]* | [A-Za-z]:[\\/]*) ;; 1311: *) 1312: $echo "$modename: only absolute run-paths are allowed" 1>&2 1.12 vbancrof 1313: exit $EXIT_FAILURE 1.5 frystyk 1314: ;; 1315: esac 1316: if test "$prev" = rpath; then 1317: case "$rpath " in 1318: *" $arg "*) ;; 1319: *) rpath="$rpath $arg" ;; 1320: esac 1321: else 1322: case "$xrpath " in 1323: *" $arg "*) ;; 1324: *) xrpath="$xrpath $arg" ;; 1325: esac 1326: fi 1.4 frystyk 1327: prev= 1328: continue 1329: ;; 1.11 kahan 1330: xcompiler) 1331: compiler_flags="$compiler_flags $qarg" 1332: prev= 1333: compile_command="$compile_command $qarg" 1334: finalize_command="$finalize_command $qarg" 1335: continue 1336: ;; 1337: xlinker) 1338: linker_flags="$linker_flags $qarg" 1339: compiler_flags="$compiler_flags $wl$qarg" 1340: prev= 1341: compile_command="$compile_command $wl$qarg" 1342: finalize_command="$finalize_command $wl$qarg" 1343: continue 1344: ;; 1.12 vbancrof 1345: xcclinker) 1346: linker_flags="$linker_flags $qarg" 1347: compiler_flags="$compiler_flags $qarg" 1348: prev= 1349: compile_command="$compile_command $qarg" 1350: finalize_command="$finalize_command $qarg" 1351: continue 1352: ;; 1353: shrext) 1354: shrext_cmds="$arg" 1355: prev= 1356: continue 1357: ;; 1.13 ! vbancrof 1358: darwin_framework) ! 1359: compiler_flags="$compiler_flags $arg" ! 1360: prev= ! 1361: continue ! 1362: ;; 1.4 frystyk 1363: *) 1364: eval "$prev=\"\$arg\"" 1.2 frystyk 1365: prev= 1366: continue 1.1 frystyk 1367: ;; 1.4 frystyk 1368: esac 1.12 vbancrof 1369: fi # test -n "$prev" 1.1 frystyk 1370: 1371: prevarg="$arg" 1372: 1.11 kahan 1373: case $arg in 1.2 frystyk 1374: -all-static) 1375: if test -n "$link_static_flag"; then 1.4 frystyk 1376: compile_command="$compile_command $link_static_flag" 1.2 frystyk 1377: finalize_command="$finalize_command $link_static_flag" 1.4 frystyk 1378: fi 1379: continue 1.2 frystyk 1380: ;; 1.1 frystyk 1381: 1.2 frystyk 1382: -allow-undefined) 1383: # FIXME: remove this flag sometime in the future. 1384: $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 1.1 frystyk 1385: continue 1386: ;; 1387: 1.4 frystyk 1388: -avoid-version) 1389: avoid_version=yes 1390: continue 1391: ;; 1392: 1.2 frystyk 1393: -dlopen) 1.4 frystyk 1394: prev=dlfiles 1395: continue 1396: ;; 1.2 frystyk 1397: 1398: -dlpreopen) 1.4 frystyk 1399: prev=dlprefiles 1400: continue 1401: ;; 1.2 frystyk 1402: 1403: -export-dynamic) 1.5 frystyk 1404: export_dynamic=yes 1405: continue 1.4 frystyk 1406: ;; 1.2 frystyk 1407: 1.5 frystyk 1408: -export-symbols | -export-symbols-regex) 1409: if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1.11 kahan 1410: $echo "$modename: more than one -exported-symbols argument is not allowed" 1.12 vbancrof 1411: exit $EXIT_FAILURE 1.4 frystyk 1412: fi 1.5 frystyk 1413: if test "X$arg" = "X-export-symbols"; then 1414: prev=expsyms 1415: else 1416: prev=expsyms_regex 1417: fi 1.4 frystyk 1418: continue 1419: ;; 1.2 frystyk 1420: 1.13 ! vbancrof 1421: -framework) ! 1422: prev=darwin_framework ! 1423: compiler_flags="$compiler_flags $arg" ! 1424: continue ! 1425: ;; ! 1426: 1.12 vbancrof 1427: -inst-prefix-dir) 1428: prev=inst_prefix 1429: continue 1430: ;; 1431: 1.11 kahan 1432: # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* 1433: # so, if we see these flags be careful not to treat them like -L 1434: -L[A-Z][A-Z]*:*) 1435: case $with_gcc/$host in 1.12 vbancrof 1436: no/*-*-irix* | /*-*-irix*) 1.11 kahan 1437: compile_command="$compile_command $arg" 1438: finalize_command="$finalize_command $arg" 1439: ;; 1440: esac 1441: continue 1442: ;; 1443: 1.1 frystyk 1444: -L*) 1.5 frystyk 1445: dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` 1446: # We need an absolute path. 1.11 kahan 1447: case $dir in 1.5 frystyk 1448: [\\/]* | [A-Za-z]:[\\/]*) ;; 1.4 frystyk 1449: *) 1.5 frystyk 1450: absdir=`cd "$dir" && pwd` 1451: if test -z "$absdir"; then 1.11 kahan 1452: $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 1.12 vbancrof 1453: exit $EXIT_FAILURE 1.5 frystyk 1454: fi 1455: dir="$absdir" 1.4 frystyk 1456: ;; 1457: esac 1.11 kahan 1458: case "$deplibs " in 1459: *" -L$dir "*) ;; 1460: *) 1461: deplibs="$deplibs -L$dir" 1462: lib_search_path="$lib_search_path $dir" 1463: ;; 1.10 kahan 1464: esac 1.11 kahan 1465: case $host in 1466: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1467: case :$dllsearchpath: in 1468: *":$dir:"*) ;; 1469: *) dllsearchpath="$dllsearchpath:$dir";; 1.5 frystyk 1470: esac 1.4 frystyk 1471: ;; 1472: esac 1.11 kahan 1473: continue 1.4 frystyk 1474: ;; 1.1 frystyk 1475: 1.4 frystyk 1476: -l*) 1.11 kahan 1477: if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 1478: case $host in 1479: *-*-cygwin* | *-*-pw32* | *-*-beos*) 1480: # These systems don't actually have a C or math library (as such) 1.5 frystyk 1481: continue 1482: ;; 1.11 kahan 1483: *-*-mingw* | *-*-os2*) 1484: # These systems don't actually have a C library (as such) 1485: test "X$arg" = "X-lc" && continue 1486: ;; 1.13 ! vbancrof 1487: *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1.11 kahan 1488: # Do not include libc due to us having libc/libc_r. 1489: test "X$arg" = "X-lc" && continue 1490: ;; 1.12 vbancrof 1491: *-*-rhapsody* | *-*-darwin1.[012]) 1492: # Rhapsody C and math libraries are in the System framework 1493: deplibs="$deplibs -framework System" 1494: continue 1.5 frystyk 1495: esac 1.12 vbancrof 1496: elif test "X$arg" = "X-lc_r"; then 1497: case $host in 1.13 ! vbancrof 1498: *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1.12 vbancrof 1499: # Do not include libc_r directly, use -pthread flag. 1500: continue 1501: ;; 1502: esac 1.5 frystyk 1503: fi 1.4 frystyk 1504: deplibs="$deplibs $arg" 1.11 kahan 1505: continue 1.4 frystyk 1506: ;; 1.1 frystyk 1507: 1.13 ! vbancrof 1508: # Tru64 UNIX uses -model [arg] to determine the layout of C++ ! 1509: # classes, name mangling, and exception handling. ! 1510: -model) ! 1511: compile_command="$compile_command $arg" ! 1512: compiler_flags="$compiler_flags $arg" ! 1513: finalize_command="$finalize_command $arg" ! 1514: prev=xcompiler ! 1515: continue ! 1516: ;; ! 1517: 1.12 vbancrof 1518: -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 1.13 ! vbancrof 1519: compiler_flags="$compiler_flags $arg" ! 1520: compile_command="$compile_command $arg" ! 1521: finalize_command="$finalize_command $arg" 1.12 vbancrof 1522: continue 1523: ;; 1524: 1.4 frystyk 1525: -module) 1.5 frystyk 1526: module=yes 1527: continue 1.4 frystyk 1528: ;; 1.5 frystyk 1529: 1.13 ! vbancrof 1530: # -64, -mips[0-9] enable 64-bit mode on the SGI compiler ! 1531: # -r[0-9][0-9]* specifies the processor on the SGI compiler ! 1532: # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler ! 1533: # +DA*, +DD* enable 64-bit mode on the HP compiler ! 1534: # -q* pass through compiler args for the IBM compiler ! 1535: # -m* pass through architecture-specific compiler args for GCC ! 1536: -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) ! 1537: 1.12 vbancrof 1538: # Unknown arguments in both finalize_command and compile_command need 1539: # to be aesthetically quoted because they are evaled later. 1540: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1541: case $arg in 1.13 ! vbancrof 1542: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.12 vbancrof 1543: arg="\"$arg\"" 1544: ;; 1545: esac 1546: compile_command="$compile_command $arg" 1547: finalize_command="$finalize_command $arg" 1548: if test "$with_gcc" = "yes" ; then 1549: compiler_flags="$compiler_flags $arg" 1550: fi 1551: continue 1552: ;; 1553: 1554: -shrext) 1555: prev=shrext 1556: continue 1557: ;; 1558: 1.11 kahan 1559: -no-fast-install) 1560: fast_install=no 1561: continue 1562: ;; 1563: 1564: -no-install) 1565: case $host in 1566: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 1567: # The PATH hackery in wrapper scripts is required on Windows 1568: # in order for the loader to find any dlls it needs. 1569: $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 1570: $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 1571: fast_install=no 1572: ;; 1573: *) no_install=yes ;; 1574: esac 1575: continue 1576: ;; 1577: 1.2 frystyk 1578: -no-undefined) 1579: allow_undefined=no 1580: continue 1581: ;; 1582: 1.12 vbancrof 1583: -objectlist) 1584: prev=objectlist 1585: continue 1586: ;; 1587: 1.1 frystyk 1588: -o) prev=output ;; 1589: 1.12 vbancrof 1590: -precious-files-regex) 1591: prev=precious_regex 1592: continue 1593: ;; 1594: 1.2 frystyk 1595: -release) 1596: prev=release 1.1 frystyk 1597: continue 1598: ;; 1599: 1.2 frystyk 1600: -rpath) 1.4 frystyk 1601: prev=rpath 1602: continue 1603: ;; 1604: 1605: -R) 1606: prev=xrpath 1607: continue 1608: ;; 1609: 1610: -R*) 1.5 frystyk 1611: dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` 1612: # We need an absolute path. 1.11 kahan 1613: case $dir in 1.5 frystyk 1614: [\\/]* | [A-Za-z]:[\\/]*) ;; 1615: *) 1616: $echo "$modename: only absolute run-paths are allowed" 1>&2 1.12 vbancrof 1617: exit $EXIT_FAILURE 1.5 frystyk 1618: ;; 1619: esac 1620: case "$xrpath " in 1621: *" $dir "*) ;; 1622: *) xrpath="$xrpath $dir" ;; 1623: esac 1.4 frystyk 1624: continue 1625: ;; 1.2 frystyk 1626: 1.1 frystyk 1627: -static) 1.11 kahan 1628: # The effects of -static are defined in a previous loop. 1629: # We used to do the same as -all-static on platforms that 1630: # didn't have a PIC flag, but the assumption that the effects 1631: # would be equivalent was wrong. It would break on at least 1632: # Digital Unix and AIX. 1.1 frystyk 1633: continue 1634: ;; 1635: 1.5 frystyk 1636: -thread-safe) 1637: thread_safe=yes 1638: continue 1639: ;; 1640: 1.1 frystyk 1641: -version-info) 1.4 frystyk 1642: prev=vinfo 1643: continue 1644: ;; 1.12 vbancrof 1645: -version-number) 1646: prev=vinfo 1647: vinfo_number=yes 1648: continue 1649: ;; 1.1 frystyk 1650: 1.11 kahan 1651: -Wc,*) 1652: args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` 1653: arg= 1654: save_ifs="$IFS"; IFS=',' 1655: for flag in $args; do 1656: IFS="$save_ifs" 1657: case $flag in 1.13 ! vbancrof 1658: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.11 kahan 1659: flag="\"$flag\"" 1660: ;; 1661: esac 1662: arg="$arg $wl$flag" 1663: compiler_flags="$compiler_flags $flag" 1664: done 1665: IFS="$save_ifs" 1666: arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 1667: ;; 1668: 1669: -Wl,*) 1670: args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` 1671: arg= 1672: save_ifs="$IFS"; IFS=',' 1673: for flag in $args; do 1674: IFS="$save_ifs" 1675: case $flag in 1.13 ! vbancrof 1676: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.11 kahan 1677: flag="\"$flag\"" 1678: ;; 1679: esac 1680: arg="$arg $wl$flag" 1681: compiler_flags="$compiler_flags $wl$flag" 1682: linker_flags="$linker_flags $flag" 1683: done 1684: IFS="$save_ifs" 1685: arg=`$echo "X$arg" | $Xsed -e "s/^ //"` 1686: ;; 1687: 1688: -Xcompiler) 1689: prev=xcompiler 1690: continue 1691: ;; 1692: 1693: -Xlinker) 1694: prev=xlinker 1695: continue 1696: ;; 1697: 1.12 vbancrof 1698: -XCClinker) 1699: prev=xcclinker 1700: continue 1701: ;; 1702: 1.2 frystyk 1703: # Some other compiler flag. 1704: -* | +*) 1705: # Unknown arguments in both finalize_command and compile_command need 1706: # to be aesthetically quoted because they are evaled later. 1707: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1.11 kahan 1708: case $arg in 1.13 ! vbancrof 1709: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.2 frystyk 1710: arg="\"$arg\"" 1711: ;; 1712: esac 1.4 frystyk 1713: ;; 1.1 frystyk 1714: 1.12 vbancrof 1715: *.$objext) 1716: # A standard object. 1717: objs="$objs $arg" 1718: ;; 1719: 1720: *.lo) 1721: # A libtool-controlled object. 1722: 1723: # Check to see that this really is a libtool object. 1724: if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1725: pic_object= 1726: non_pic_object= 1727: 1728: # Read the .lo file 1729: # If there is no directory component, then add one. 1730: case $arg in 1731: */* | *\\*) . $arg ;; 1732: *) . ./$arg ;; 1733: esac 1734: 1735: if test -z "$pic_object" || \ 1736: test -z "$non_pic_object" || 1737: test "$pic_object" = none && \ 1738: test "$non_pic_object" = none; then 1739: $echo "$modename: cannot find name of object for \`$arg'" 1>&2 1740: exit $EXIT_FAILURE 1741: fi 1742: 1743: # Extract subdirectory from the argument. 1744: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1745: if test "X$xdir" = "X$arg"; then 1746: xdir= 1747: else 1748: xdir="$xdir/" 1749: fi 1750: 1751: if test "$pic_object" != none; then 1752: # Prepend the subdirectory the object is found in. 1753: pic_object="$xdir$pic_object" 1754: 1755: if test "$prev" = dlfiles; then 1756: if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then 1757: dlfiles="$dlfiles $pic_object" 1758: prev= 1759: continue 1760: else 1761: # If libtool objects are unsupported, then we need to preload. 1762: prev=dlprefiles 1763: fi 1764: fi 1765: 1766: # CHECK ME: I think I busted this. -Ossama 1767: if test "$prev" = dlprefiles; then 1768: # Preload the old-style object. 1769: dlprefiles="$dlprefiles $pic_object" 1770: prev= 1771: fi 1772: 1773: # A PIC object. 1774: libobjs="$libobjs $pic_object" 1775: arg="$pic_object" 1.2 frystyk 1776: fi 1.1 frystyk 1777: 1.12 vbancrof 1778: # Non-PIC object. 1779: if test "$non_pic_object" != none; then 1780: # Prepend the subdirectory the object is found in. 1781: non_pic_object="$xdir$non_pic_object" 1782: 1783: # A standard non-PIC object 1784: non_pic_objects="$non_pic_objects $non_pic_object" 1785: if test -z "$pic_object" || test "$pic_object" = none ; then 1786: arg="$non_pic_object" 1787: fi 1788: fi 1.11 kahan 1789: else 1.12 vbancrof 1790: # Only an error if not doing a dry-run. 1791: if test -z "$run"; then 1792: $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 1793: exit $EXIT_FAILURE 1794: else 1795: # Dry-run case. 1796: 1797: # Extract subdirectory from the argument. 1798: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` 1799: if test "X$xdir" = "X$arg"; then 1800: xdir= 1801: else 1802: xdir="$xdir/" 1803: fi 1804: 1805: pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` 1806: non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` 1807: libobjs="$libobjs $pic_object" 1808: non_pic_objects="$non_pic_objects $non_pic_object" 1809: fi 1.1 frystyk 1810: fi 1.11 kahan 1811: ;; 1812: 1813: *.$libext) 1814: # An archive. 1815: deplibs="$deplibs $arg" 1816: old_deplibs="$old_deplibs $arg" 1817: continue 1.4 frystyk 1818: ;; 1.1 frystyk 1819: 1.2 frystyk 1820: *.la) 1.4 frystyk 1821: # A libtool-controlled library. 1.1 frystyk 1822: 1.11 kahan 1823: if test "$prev" = dlfiles; then 1824: # This library was specified with -dlopen. 1825: dlfiles="$dlfiles $arg" 1826: prev= 1827: elif test "$prev" = dlprefiles; then 1828: # The library was specified with -dlpreopen. 1829: dlprefiles="$dlprefiles $arg" 1830: prev= 1.4 frystyk 1831: else 1.11 kahan 1832: deplibs="$deplibs $arg" 1.4 frystyk 1833: fi 1.11 kahan 1834: continue 1835: ;; 1.4 frystyk 1836: 1.11 kahan 1837: # Some other compiler argument. 1838: *) 1839: # Unknown arguments in both finalize_command and compile_command need 1840: # to be aesthetically quoted because they are evaled later. 1841: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1842: case $arg in 1.13 ! vbancrof 1843: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.11 kahan 1844: arg="\"$arg\"" 1845: ;; 1846: esac 1847: ;; 1848: esac # arg 1.10 kahan 1849: 1.11 kahan 1850: # Now actually substitute the argument into the commands. 1851: if test -n "$arg"; then 1852: compile_command="$compile_command $arg" 1853: finalize_command="$finalize_command $arg" 1854: fi 1855: done # argument parsing loop 1.4 frystyk 1856: 1.11 kahan 1857: if test -n "$prev"; then 1858: $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 1859: $echo "$help" 1>&2 1.12 vbancrof 1860: exit $EXIT_FAILURE 1.11 kahan 1861: fi 1.10 kahan 1862: 1.11 kahan 1863: if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 1864: eval arg=\"$export_dynamic_flag_spec\" 1865: compile_command="$compile_command $arg" 1866: finalize_command="$finalize_command $arg" 1867: fi 1.10 kahan 1868: 1.12 vbancrof 1869: oldlibs= 1.11 kahan 1870: # calculate the name of the file, without its directory 1871: outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` 1872: libobjs_save="$libobjs" 1.10 kahan 1873: 1.11 kahan 1874: if test -n "$shlibpath_var"; then 1875: # get the directories listed in $shlibpath_var 1876: eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 1877: else 1878: shlib_search_path= 1879: fi 1880: eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 1881: eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 1.4 frystyk 1882: 1.11 kahan 1883: output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` 1884: if test "X$output_objdir" = "X$output"; then 1885: output_objdir="$objdir" 1886: else 1887: output_objdir="$output_objdir/$objdir" 1888: fi 1889: # Create the object directory. 1.12 vbancrof 1890: if test ! -d "$output_objdir"; then 1.11 kahan 1891: $show "$mkdir $output_objdir" 1892: $run $mkdir $output_objdir 1893: status=$? 1.12 vbancrof 1894: if test "$status" -ne 0 && test ! -d "$output_objdir"; then 1.11 kahan 1895: exit $status 1896: fi 1897: fi 1.4 frystyk 1898: 1.11 kahan 1899: # Determine the type of output 1900: case $output in 1901: "") 1902: $echo "$modename: you must specify an output file" 1>&2 1903: $echo "$help" 1>&2 1.12 vbancrof 1904: exit $EXIT_FAILURE 1.11 kahan 1905: ;; 1906: *.$libext) linkmode=oldlib ;; 1907: *.lo | *.$objext) linkmode=obj ;; 1908: *.la) linkmode=lib ;; 1909: *) linkmode=prog ;; # Anything else should be a program. 1910: esac 1.4 frystyk 1911: 1.12 vbancrof 1912: case $host in 1913: *cygwin* | *mingw* | *pw32*) 1914: # don't eliminate duplications in $postdeps and $predeps 1915: duplicate_compiler_generated_deps=yes 1916: ;; 1917: *) 1918: duplicate_compiler_generated_deps=$duplicate_deps 1919: ;; 1920: esac 1.11 kahan 1921: specialdeplibs= 1.12 vbancrof 1922: 1.11 kahan 1923: libs= 1924: # Find all interdependent deplibs by searching for libraries 1925: # that are linked more than once (e.g. -la -lb -la) 1926: for deplib in $deplibs; do 1927: if test "X$duplicate_deps" = "Xyes" ; then 1928: case "$libs " in 1929: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 1930: esac 1931: fi 1932: libs="$libs $deplib" 1933: done 1.12 vbancrof 1934: 1935: if test "$linkmode" = lib; then 1936: libs="$predeps $libs $compiler_lib_search_path $postdeps" 1937: 1938: # Compute libraries that are listed more than once in $predeps 1939: # $postdeps and mark them as special (i.e., whose duplicates are 1940: # not to be eliminated). 1941: pre_post_deps= 1942: if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then 1943: for pre_post_dep in $predeps $postdeps; do 1944: case "$pre_post_deps " in 1945: *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; 1946: esac 1947: pre_post_deps="$pre_post_deps $pre_post_dep" 1948: done 1949: fi 1950: pre_post_deps= 1951: fi 1952: 1.11 kahan 1953: deplibs= 1954: newdependency_libs= 1955: newlib_search_path= 1956: need_relink=no # whether we're linking any uninstalled libtool libraries 1957: notinst_deplibs= # not-installed libtool libraries 1958: notinst_path= # paths that contain not-installed libtool libraries 1959: case $linkmode in 1960: lib) 1961: passes="conv link" 1962: for file in $dlfiles $dlprefiles; do 1963: case $file in 1964: *.la) ;; 1965: *) 1966: $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 1.12 vbancrof 1967: exit $EXIT_FAILURE 1.11 kahan 1968: ;; 1969: esac 1970: done 1971: ;; 1972: prog) 1973: compile_deplibs= 1974: finalize_deplibs= 1975: alldeplibs=no 1976: newdlfiles= 1977: newdlprefiles= 1978: passes="conv scan dlopen dlpreopen link" 1979: ;; 1980: *) passes="conv" 1981: ;; 1982: esac 1983: for pass in $passes; do 1.12 vbancrof 1984: if test "$linkmode,$pass" = "lib,link" || 1985: test "$linkmode,$pass" = "prog,scan"; then 1986: libs="$deplibs" 1987: deplibs= 1988: fi 1989: if test "$linkmode" = prog; then 1.11 kahan 1990: case $pass in 1.12 vbancrof 1991: dlopen) libs="$dlfiles" ;; 1.11 kahan 1992: dlpreopen) libs="$dlprefiles" ;; 1993: link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 1994: esac 1995: fi 1.12 vbancrof 1996: if test "$pass" = dlopen; then 1997: # Collect dlpreopened libraries 1998: save_deplibs="$deplibs" 1999: deplibs= 2000: fi 1.11 kahan 2001: for deplib in $libs; do 2002: lib= 2003: found=no 2004: case $deplib in 1.12 vbancrof 2005: -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) 2006: if test "$linkmode,$pass" = "prog,link"; then 2007: compile_deplibs="$deplib $compile_deplibs" 2008: finalize_deplibs="$deplib $finalize_deplibs" 2009: else 1.13 ! vbancrof 2010: compiler_flags="$compiler_flags $deplib" 1.12 vbancrof 2011: fi 2012: continue 2013: ;; 1.11 kahan 2014: -l*) 1.12 vbancrof 2015: if test "$linkmode" != lib && test "$linkmode" != prog; then 2016: $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 1.10 kahan 2017: continue 2018: fi 1.11 kahan 2019: name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` 2020: for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do 1.12 vbancrof 2021: for search_ext in .la $std_shrext .so .a; do 2022: # Search the libtool library 2023: lib="$searchdir/lib${name}${search_ext}" 2024: if test -f "$lib"; then 2025: if test "$search_ext" = ".la"; then 2026: found=yes 2027: else 2028: found=no 2029: fi 2030: break 2 2031: fi 2032: done 1.11 kahan 2033: done 2034: if test "$found" != yes; then 2035: # deplib doesn't seem to be a libtool library 2036: if test "$linkmode,$pass" = "prog,link"; then 2037: compile_deplibs="$deplib $compile_deplibs" 2038: finalize_deplibs="$deplib $finalize_deplibs" 2039: else 2040: deplibs="$deplib $deplibs" 1.12 vbancrof 2041: test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 1.11 kahan 2042: fi 2043: continue 1.12 vbancrof 2044: else # deplib is a libtool library 2045: # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, 2046: # We need to do some special things here, and not later. 2047: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 2048: case " $predeps $postdeps " in 2049: *" $deplib "*) 2050: if (${SED} -e '2q' $lib | 2051: grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 2052: library_names= 2053: old_library= 2054: case $lib in 2055: */* | *\\*) . $lib ;; 2056: *) . ./$lib ;; 2057: esac 2058: for l in $old_library $library_names; do 2059: ll="$l" 2060: done 2061: if test "X$ll" = "X$old_library" ; then # only static version available 2062: found=no 2063: ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2064: test "X$ladir" = "X$lib" && ladir="." 2065: lib=$ladir/$old_library 2066: if test "$linkmode,$pass" = "prog,link"; then 2067: compile_deplibs="$deplib $compile_deplibs" 2068: finalize_deplibs="$deplib $finalize_deplibs" 2069: else 2070: deplibs="$deplib $deplibs" 2071: test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" 2072: fi 2073: continue 2074: fi 2075: fi 2076: ;; 2077: *) ;; 2078: esac 2079: fi 1.10 kahan 2080: fi 1.11 kahan 2081: ;; # -l 2082: -L*) 2083: case $linkmode in 2084: lib) 2085: deplibs="$deplib $deplibs" 1.12 vbancrof 2086: test "$pass" = conv && continue 1.11 kahan 2087: newdependency_libs="$deplib $newdependency_libs" 2088: newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 2089: ;; 2090: prog) 1.12 vbancrof 2091: if test "$pass" = conv; then 1.11 kahan 2092: deplibs="$deplib $deplibs" 2093: continue 2094: fi 1.12 vbancrof 2095: if test "$pass" = scan; then 1.11 kahan 2096: deplibs="$deplib $deplibs" 2097: else 2098: compile_deplibs="$deplib $compile_deplibs" 2099: finalize_deplibs="$deplib $finalize_deplibs" 1.10 kahan 2100: fi 1.12 vbancrof 2101: newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` 1.10 kahan 2102: ;; 2103: *) 1.12 vbancrof 2104: $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 1.11 kahan 2105: ;; 2106: esac # linkmode 2107: continue 2108: ;; # -L 2109: -R*) 1.12 vbancrof 2110: if test "$pass" = link; then 1.11 kahan 2111: dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` 2112: # Make sure the xrpath contains only unique directories. 2113: case "$xrpath " in 2114: *" $dir "*) ;; 2115: *) xrpath="$xrpath $dir" ;; 1.10 kahan 2116: esac 1.11 kahan 2117: fi 2118: deplibs="$deplib $deplibs" 2119: continue 2120: ;; 2121: *.la) lib="$deplib" ;; 2122: *.$libext) 1.12 vbancrof 2123: if test "$pass" = conv; then 1.11 kahan 2124: deplibs="$deplib $deplibs" 2125: continue 2126: fi 2127: case $linkmode in 2128: lib) 1.13 ! vbancrof 2129: valid_a_lib=no ! 2130: case $deplibs_check_method in ! 2131: match_pattern*) ! 2132: set dummy $deplibs_check_method ! 2133: match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` ! 2134: if eval $echo \"$deplib\" 2>/dev/null \ ! 2135: | $SED 10q \ ! 2136: | $EGREP "$match_pattern_regex" > /dev/null; then ! 2137: valid_a_lib=yes ! 2138: fi ! 2139: ;; ! 2140: pass_all) ! 2141: valid_a_lib=yes ! 2142: ;; ! 2143: esac ! 2144: if test "$valid_a_lib" != yes; then 1.12 vbancrof 2145: $echo 2146: $echo "*** Warning: Trying to link with static lib archive $deplib." 2147: $echo "*** I have the capability to make that library automatically link in when" 2148: $echo "*** you link to this library. But I can only do this if you have a" 2149: $echo "*** shared version of the library, which you do not appear to have" 2150: $echo "*** because the file extensions .$libext of this argument makes me believe" 2151: $echo "*** that it is just a static archive that I should not used here." 1.11 kahan 2152: else 1.12 vbancrof 2153: $echo 2154: $echo "*** Warning: Linking the shared library $output against the" 2155: $echo "*** static library $deplib is not portable!" 1.11 kahan 2156: deplibs="$deplib $deplibs" 2157: fi 2158: continue 2159: ;; 2160: prog) 1.12 vbancrof 2161: if test "$pass" != link; then 1.11 kahan 2162: deplibs="$deplib $deplibs" 2163: else 2164: compile_deplibs="$deplib $compile_deplibs" 2165: finalize_deplibs="$deplib $finalize_deplibs" 2166: fi 2167: continue 1.10 kahan 2168: ;; 1.11 kahan 2169: esac # linkmode 2170: ;; # *.$libext 2171: *.lo | *.$objext) 1.12 vbancrof 2172: if test "$pass" = conv; then 2173: deplibs="$deplib $deplibs" 2174: elif test "$linkmode" = prog; then 2175: if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 2176: # If there is no dlopen support or we're linking statically, 2177: # we need to preload. 2178: newdlprefiles="$newdlprefiles $deplib" 2179: compile_deplibs="$deplib $compile_deplibs" 2180: finalize_deplibs="$deplib $finalize_deplibs" 2181: else 2182: newdlfiles="$newdlfiles $deplib" 2183: fi 1.11 kahan 2184: fi 2185: continue 2186: ;; 2187: %DEPLIBS%) 2188: alldeplibs=yes 2189: continue 2190: ;; 2191: esac # case $deplib 1.12 vbancrof 2192: if test "$found" = yes || test -f "$lib"; then : 1.11 kahan 2193: else 2194: $echo "$modename: cannot find the library \`$lib'" 1>&2 1.12 vbancrof 2195: exit $EXIT_FAILURE 1.11 kahan 2196: fi 2197: 2198: # Check to see that this really is a libtool archive. 1.12 vbancrof 2199: if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 1.11 kahan 2200: else 2201: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 1.12 vbancrof 2202: exit $EXIT_FAILURE 1.11 kahan 2203: fi 2204: 2205: ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` 2206: test "X$ladir" = "X$lib" && ladir="." 2207: 2208: dlname= 2209: dlopen= 2210: dlpreopen= 2211: libdir= 2212: library_names= 2213: old_library= 2214: # If the library was installed with an old release of libtool, 1.12 vbancrof 2215: # it will not redefine variables installed, or shouldnotlink 1.11 kahan 2216: installed=yes 1.12 vbancrof 2217: shouldnotlink=no 1.13 ! vbancrof 2218: avoidtemprpath= ! 2219: 1.11 kahan 2220: 2221: # Read the .la file 2222: case $lib in 2223: */* | *\\*) . $lib ;; 2224: *) . ./$lib ;; 2225: esac 2226: 2227: if test "$linkmode,$pass" = "lib,link" || 2228: test "$linkmode,$pass" = "prog,scan" || 1.12 vbancrof 2229: { test "$linkmode" != prog && test "$linkmode" != lib; }; then 1.11 kahan 2230: test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 2231: test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 2232: fi 2233: 1.12 vbancrof 2234: if test "$pass" = conv; then 1.11 kahan 2235: # Only check for convenience libraries 2236: deplibs="$lib $deplibs" 2237: if test -z "$libdir"; then 2238: if test -z "$old_library"; then 2239: $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 1.12 vbancrof 2240: exit $EXIT_FAILURE 1.11 kahan 2241: fi 2242: # It is a libtool convenience library, so add in its objects. 2243: convenience="$convenience $ladir/$objdir/$old_library" 2244: old_convenience="$old_convenience $ladir/$objdir/$old_library" 2245: tmp_libs= 2246: for deplib in $dependency_libs; do 2247: deplibs="$deplib $deplibs" 2248: if test "X$duplicate_deps" = "Xyes" ; then 2249: case "$tmp_libs " in 2250: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2251: esac 2252: fi 2253: tmp_libs="$tmp_libs $deplib" 2254: done 1.12 vbancrof 2255: elif test "$linkmode" != prog && test "$linkmode" != lib; then 1.11 kahan 2256: $echo "$modename: \`$lib' is not a convenience library" 1>&2 1.12 vbancrof 2257: exit $EXIT_FAILURE 1.11 kahan 2258: fi 2259: continue 2260: fi # $pass = conv 2261: 1.12 vbancrof 2262: 1.11 kahan 2263: # Get the name of the library we link against. 2264: linklib= 2265: for l in $old_library $library_names; do 2266: linklib="$l" 2267: done 2268: if test -z "$linklib"; then 2269: $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 1.12 vbancrof 2270: exit $EXIT_FAILURE 1.11 kahan 2271: fi 2272: 2273: # This library was specified with -dlopen. 1.12 vbancrof 2274: if test "$pass" = dlopen; then 1.11 kahan 2275: if test -z "$libdir"; then 2276: $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 1.12 vbancrof 2277: exit $EXIT_FAILURE 1.11 kahan 2278: fi 1.12 vbancrof 2279: if test -z "$dlname" || 2280: test "$dlopen_support" != yes || 2281: test "$build_libtool_libs" = no; then 1.11 kahan 2282: # If there is no dlname, no dlopen support or we're linking 1.12 vbancrof 2283: # statically, we need to preload. We also need to preload any 2284: # dependent libraries so libltdl's deplib preloader doesn't 2285: # bomb out in the load deplibs phase. 2286: dlprefiles="$dlprefiles $lib $dependency_libs" 1.11 kahan 2287: else 2288: newdlfiles="$newdlfiles $lib" 2289: fi 2290: continue 2291: fi # $pass = dlopen 2292: 2293: # We need an absolute path. 2294: case $ladir in 2295: [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 2296: *) 2297: abs_ladir=`cd "$ladir" && pwd` 2298: if test -z "$abs_ladir"; then 2299: $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 2300: $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 2301: abs_ladir="$ladir" 2302: fi 2303: ;; 2304: esac 2305: laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 2306: 2307: # Find the relevant object directory and library name. 2308: if test "X$installed" = Xyes; then 2309: if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then 2310: $echo "$modename: warning: library \`$lib' was moved." 1>&2 2311: dir="$ladir" 2312: absdir="$abs_ladir" 2313: libdir="$abs_ladir" 2314: else 2315: dir="$libdir" 2316: absdir="$libdir" 2317: fi 1.13 ! vbancrof 2318: test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 1.11 kahan 2319: else 1.13 ! vbancrof 2320: if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then ! 2321: dir="$ladir" ! 2322: absdir="$abs_ladir" ! 2323: # Remove this search path later ! 2324: notinst_path="$notinst_path $abs_ladir" ! 2325: else ! 2326: dir="$ladir/$objdir" ! 2327: absdir="$abs_ladir/$objdir" ! 2328: # Remove this search path later ! 2329: notinst_path="$notinst_path $abs_ladir" ! 2330: fi 1.11 kahan 2331: fi # $installed = yes 2332: name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 2333: 2334: # This library was specified with -dlpreopen. 1.12 vbancrof 2335: if test "$pass" = dlpreopen; then 1.11 kahan 2336: if test -z "$libdir"; then 2337: $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 1.12 vbancrof 2338: exit $EXIT_FAILURE 1.11 kahan 2339: fi 2340: # Prefer using a static library (so that no silly _DYNAMIC symbols 2341: # are required to link). 2342: if test -n "$old_library"; then 2343: newdlprefiles="$newdlprefiles $dir/$old_library" 2344: # Otherwise, use the dlname, so that lt_dlopen finds it. 2345: elif test -n "$dlname"; then 2346: newdlprefiles="$newdlprefiles $dir/$dlname" 2347: else 2348: newdlprefiles="$newdlprefiles $dir/$linklib" 2349: fi 2350: fi # $pass = dlpreopen 2351: 2352: if test -z "$libdir"; then 2353: # Link the convenience library 1.12 vbancrof 2354: if test "$linkmode" = lib; then 1.11 kahan 2355: deplibs="$dir/$old_library $deplibs" 2356: elif test "$linkmode,$pass" = "prog,link"; then 2357: compile_deplibs="$dir/$old_library $compile_deplibs" 2358: finalize_deplibs="$dir/$old_library $finalize_deplibs" 2359: else 1.12 vbancrof 2360: deplibs="$lib $deplibs" # used for prog,scan pass 1.11 kahan 2361: fi 2362: continue 2363: fi 2364: 1.12 vbancrof 2365: 2366: if test "$linkmode" = prog && test "$pass" != link; then 1.11 kahan 2367: newlib_search_path="$newlib_search_path $ladir" 2368: deplibs="$lib $deplibs" 2369: 2370: linkalldeplibs=no 2371: if test "$link_all_deplibs" != no || test -z "$library_names" || 2372: test "$build_libtool_libs" = no; then 2373: linkalldeplibs=yes 2374: fi 2375: 2376: tmp_libs= 2377: for deplib in $dependency_libs; do 2378: case $deplib in 2379: -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test 2380: esac 2381: # Need to link against all dependency_libs? 1.12 vbancrof 2382: if test "$linkalldeplibs" = yes; then 1.11 kahan 2383: deplibs="$deplib $deplibs" 2384: else 2385: # Need to hardcode shared library paths 2386: # or/and link against static libraries 2387: newdependency_libs="$deplib $newdependency_libs" 2388: fi 2389: if test "X$duplicate_deps" = "Xyes" ; then 2390: case "$tmp_libs " in 2391: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2392: esac 2393: fi 2394: tmp_libs="$tmp_libs $deplib" 2395: done # for deplib 2396: continue 2397: fi # $linkmode = prog... 2398: 1.12 vbancrof 2399: if test "$linkmode,$pass" = "prog,link"; then 2400: if test -n "$library_names" && 2401: { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 2402: # We need to hardcode the library path 1.13 ! vbancrof 2403: if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 1.12 vbancrof 2404: # Make sure the rpath contains only unique directories. 2405: case "$temp_rpath " in 2406: *" $dir "*) ;; 2407: *" $absdir "*) ;; 2408: *) temp_rpath="$temp_rpath $dir" ;; 2409: esac 2410: fi 1.3 frystyk 2411: 1.11 kahan 2412: # Hardcode the library path. 2413: # Skip directories that are in the system default run-time 2414: # search path. 2415: case " $sys_lib_dlsearch_path " in 2416: *" $absdir "*) ;; 2417: *) 2418: case "$compile_rpath " in 2419: *" $absdir "*) ;; 2420: *) compile_rpath="$compile_rpath $absdir" 2421: esac 2422: ;; 2423: esac 2424: case " $sys_lib_dlsearch_path " in 1.10 kahan 2425: *" $libdir "*) ;; 1.11 kahan 2426: *) 2427: case "$finalize_rpath " in 2428: *" $libdir "*) ;; 2429: *) finalize_rpath="$finalize_rpath $libdir" 2430: esac 2431: ;; 1.10 kahan 2432: esac 1.11 kahan 2433: fi # $linkmode,$pass = prog,link... 2434: 2435: if test "$alldeplibs" = yes && 2436: { test "$deplibs_check_method" = pass_all || 2437: { test "$build_libtool_libs" = yes && 2438: test -n "$library_names"; }; }; then 2439: # We only need to search for static libraries 2440: continue 2441: fi 1.12 vbancrof 2442: fi 1.11 kahan 2443: 1.12 vbancrof 2444: link_static=no # Whether the deplib will be linked statically 2445: if test -n "$library_names" && 2446: { test "$prefer_static_libs" = no || test -z "$old_library"; }; then 1.11 kahan 2447: if test "$installed" = no; then 2448: notinst_deplibs="$notinst_deplibs $lib" 2449: need_relink=yes 2450: fi 1.12 vbancrof 2451: # This is a shared library 2452: 2453: # Warn about portability, can't link against -module's on 2454: # some systems (darwin) 2455: if test "$shouldnotlink" = yes && test "$pass" = link ; then 2456: $echo 2457: if test "$linkmode" = prog; then 2458: $echo "*** Warning: Linking the executable $output against the loadable module" 2459: else 2460: $echo "*** Warning: Linking the shared library $output against the loadable module" 2461: fi 2462: $echo "*** $linklib is not portable!" 2463: fi 2464: if test "$linkmode" = lib && 2465: test "$hardcode_into_libs" = yes; then 2466: # Hardcode the library path. 2467: # Skip directories that are in the system default run-time 2468: # search path. 2469: case " $sys_lib_dlsearch_path " in 2470: *" $absdir "*) ;; 2471: *) 2472: case "$compile_rpath " in 2473: *" $absdir "*) ;; 2474: *) compile_rpath="$compile_rpath $absdir" 2475: esac 2476: ;; 2477: esac 2478: case " $sys_lib_dlsearch_path " in 2479: *" $libdir "*) ;; 2480: *) 2481: case "$finalize_rpath " in 2482: *" $libdir "*) ;; 2483: *) finalize_rpath="$finalize_rpath $libdir" 2484: esac 2485: ;; 2486: esac 2487: fi 1.10 kahan 2488: 1.11 kahan 2489: if test -n "$old_archive_from_expsyms_cmds"; then 2490: # figure out the soname 2491: set dummy $library_names 2492: realname="$2" 2493: shift; shift 2494: libname=`eval \\$echo \"$libname_spec\"` 2495: # use dlname if we got it. it's perfectly good, no? 2496: if test -n "$dlname"; then 2497: soname="$dlname" 2498: elif test -n "$soname_spec"; then 2499: # bleh windows 2500: case $host in 1.12 vbancrof 2501: *cygwin* | mingw*) 1.11 kahan 2502: major=`expr $current - $age` 2503: versuffix="-$major" 1.10 kahan 2504: ;; 2505: esac 1.11 kahan 2506: eval soname=\"$soname_spec\" 2507: else 2508: soname="$realname" 2509: fi 2510: 2511: # Make a new name for the extract_expsyms_cmds to use 2512: soroot="$soname" 1.12 vbancrof 2513: soname=`$echo $soroot | ${SED} -e 's/^.*\///'` 2514: newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" 1.11 kahan 2515: 2516: # If the library has no export list, then create one now 2517: if test -f "$output_objdir/$soname-def"; then : 2518: else 2519: $show "extracting exported symbol list from \`$soname'" 2520: save_ifs="$IFS"; IFS='~' 1.12 vbancrof 2521: cmds=$extract_expsyms_cmds 1.11 kahan 2522: for cmd in $cmds; do 2523: IFS="$save_ifs" 1.12 vbancrof 2524: eval cmd=\"$cmd\" 1.11 kahan 2525: $show "$cmd" 2526: $run eval "$cmd" || exit $? 2527: done 2528: IFS="$save_ifs" 2529: fi 2530: 2531: # Create $newlib 2532: if test -f "$output_objdir/$newlib"; then :; else 2533: $show "generating import library for \`$soname'" 2534: save_ifs="$IFS"; IFS='~' 1.12 vbancrof 2535: cmds=$old_archive_from_expsyms_cmds 1.11 kahan 2536: for cmd in $cmds; do 2537: IFS="$save_ifs" 1.12 vbancrof 2538: eval cmd=\"$cmd\" 1.11 kahan 2539: $show "$cmd" 2540: $run eval "$cmd" || exit $? 2541: done 2542: IFS="$save_ifs" 2543: fi 2544: # make sure the library variables are pointing to the new library 2545: dir=$output_objdir 2546: linklib=$newlib 1.12 vbancrof 2547: fi # test -n "$old_archive_from_expsyms_cmds" 1.11 kahan 2548: 1.12 vbancrof 2549: if test "$linkmode" = prog || test "$mode" != relink; then 1.11 kahan 2550: add_shlibpath= 2551: add_dir= 2552: add= 2553: lib_linked=yes 2554: case $hardcode_action in 2555: immediate | unsupported) 2556: if test "$hardcode_direct" = no; then 2557: add="$dir/$linklib" 1.12 vbancrof 2558: case $host in 2559: *-*-sco3.2v5* ) add_dir="-L$dir" ;; 2560: *-*-darwin* ) 2561: # if the lib is a module then we can not link against 2562: # it, someone is ignoring the new warnings I added 2563: if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then 2564: $echo "** Warning, lib $linklib is a module, not a shared library" 2565: if test -z "$old_library" ; then 2566: $echo 2567: $echo "** And there doesn't seem to be a static archive available" 2568: $echo "** The link will probably fail, sorry" 2569: else 2570: add="$dir/$old_library" 2571: fi 2572: fi 2573: esac 1.11 kahan 2574: elif test "$hardcode_minus_L" = no; then 2575: case $host in 2576: *-*-sunos*) add_shlibpath="$dir" ;; 2577: esac 2578: add_dir="-L$dir" 2579: add="-l$name" 2580: elif test "$hardcode_shlibpath_var" = no; then 2581: add_shlibpath="$dir" 2582: add="-l$name" 2583: else 2584: lib_linked=no 2585: fi 2586: ;; 2587: relink) 2588: if test "$hardcode_direct" = yes; then 2589: add="$dir/$linklib" 2590: elif test "$hardcode_minus_L" = yes; then 2591: add_dir="-L$dir" 1.12 vbancrof 2592: # Try looking first in the location we're being installed to. 2593: if test -n "$inst_prefix_dir"; then 2594: case "$libdir" in 2595: [\\/]*) 2596: add_dir="$add_dir -L$inst_prefix_dir$libdir" 2597: ;; 2598: esac 2599: fi 1.11 kahan 2600: add="-l$name" 2601: elif test "$hardcode_shlibpath_var" = yes; then 2602: add_shlibpath="$dir" 2603: add="-l$name" 2604: else 2605: lib_linked=no 2606: fi 2607: ;; 2608: *) lib_linked=no ;; 2609: esac 2610: 2611: if test "$lib_linked" != yes; then 2612: $echo "$modename: configuration error: unsupported hardcode properties" 1.12 vbancrof 2613: exit $EXIT_FAILURE 1.11 kahan 2614: fi 2615: 2616: if test -n "$add_shlibpath"; then 2617: case :$compile_shlibpath: in 2618: *":$add_shlibpath:"*) ;; 2619: *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; 1.10 kahan 2620: esac 1.11 kahan 2621: fi 1.12 vbancrof 2622: if test "$linkmode" = prog; then 1.11 kahan 2623: test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 2624: test -n "$add" && compile_deplibs="$add $compile_deplibs" 1.9 kahan 2625: else 1.11 kahan 2626: test -n "$add_dir" && deplibs="$add_dir $deplibs" 2627: test -n "$add" && deplibs="$add $deplibs" 2628: if test "$hardcode_direct" != yes && \ 2629: test "$hardcode_minus_L" != yes && \ 2630: test "$hardcode_shlibpath_var" = yes; then 2631: case :$finalize_shlibpath: in 2632: *":$libdir:"*) ;; 2633: *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 2634: esac 2635: fi 1.9 kahan 2636: fi 1.11 kahan 2637: fi 1.10 kahan 2638: 1.12 vbancrof 2639: if test "$linkmode" = prog || test "$mode" = relink; then 1.11 kahan 2640: add_shlibpath= 2641: add_dir= 2642: add= 2643: # Finalize command for both is simple: just hardcode it. 1.10 kahan 2644: if test "$hardcode_direct" = yes; then 1.11 kahan 2645: add="$libdir/$linklib" 1.10 kahan 2646: elif test "$hardcode_minus_L" = yes; then 1.11 kahan 2647: add_dir="-L$libdir" 2648: add="-l$name" 1.10 kahan 2649: elif test "$hardcode_shlibpath_var" = yes; then 1.11 kahan 2650: case :$finalize_shlibpath: in 2651: *":$libdir:"*) ;; 2652: *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; 1.10 kahan 2653: esac 1.11 kahan 2654: add="-l$name" 1.12 vbancrof 2655: elif test "$hardcode_automatic" = yes; then 2656: if test -n "$inst_prefix_dir" && 2657: test -f "$inst_prefix_dir$libdir/$linklib" ; then 2658: add="$inst_prefix_dir$libdir/$linklib" 2659: else 2660: add="$libdir/$linklib" 2661: fi 1.9 kahan 2662: else 1.11 kahan 2663: # We cannot seem to hardcode it, guess we'll fake it. 2664: add_dir="-L$libdir" 1.12 vbancrof 2665: # Try looking first in the location we're being installed to. 2666: if test -n "$inst_prefix_dir"; then 2667: case "$libdir" in 2668: [\\/]*) 2669: add_dir="$add_dir -L$inst_prefix_dir$libdir" 2670: ;; 2671: esac 2672: fi 1.11 kahan 2673: add="-l$name" 1.5 frystyk 2674: fi 1.10 kahan 2675: 1.12 vbancrof 2676: if test "$linkmode" = prog; then 1.11 kahan 2677: test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" 2678: test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 2679: else 2680: test -n "$add_dir" && deplibs="$add_dir $deplibs" 2681: test -n "$add" && deplibs="$add $deplibs" 2682: fi 1.9 kahan 2683: fi 1.12 vbancrof 2684: elif test "$linkmode" = prog; then 1.10 kahan 2685: # Here we assume that one of hardcode_direct or hardcode_minus_L 2686: # is not unsupported. This is valid on all known static and 2687: # shared platforms. 2688: if test "$hardcode_direct" != unsupported; then 2689: test -n "$old_library" && linklib="$old_library" 1.11 kahan 2690: compile_deplibs="$dir/$linklib $compile_deplibs" 2691: finalize_deplibs="$dir/$linklib $finalize_deplibs" 1.9 kahan 2692: else 1.11 kahan 2693: compile_deplibs="-l$name -L$dir $compile_deplibs" 2694: finalize_deplibs="-l$name -L$dir $finalize_deplibs" 1.9 kahan 2695: fi 1.11 kahan 2696: elif test "$build_libtool_libs" = yes; then 2697: # Not a shared library 2698: if test "$deplibs_check_method" != pass_all; then 2699: # We're trying link a shared library against a static one 2700: # but the system doesn't support it. 1.2 frystyk 2701: 1.11 kahan 2702: # Just print a warning and add the library to dependency_libs so 2703: # that the program can be linked against the static library. 1.12 vbancrof 2704: $echo 2705: $echo "*** Warning: This system can not link to static lib archive $lib." 2706: $echo "*** I have the capability to make that library automatically link in when" 2707: $echo "*** you link to this library. But I can only do this if you have a" 2708: $echo "*** shared version of the library, which you do not appear to have." 1.11 kahan 2709: if test "$module" = yes; then 1.12 vbancrof 2710: $echo "*** But as you try to build a module library, libtool will still create " 2711: $echo "*** a static module, that should work as long as the dlopening application" 2712: $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." 1.11 kahan 2713: if test -z "$global_symbol_pipe"; then 1.12 vbancrof 2714: $echo 2715: $echo "*** However, this would only work if libtool was able to extract symbol" 2716: $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 2717: $echo "*** not find such a program. So, this module is probably useless." 2718: $echo "*** \`nm' from GNU binutils and a full rebuild may help." 1.11 kahan 2719: fi 2720: if test "$build_old_libs" = no; then 2721: build_libtool_libs=module 2722: build_old_libs=yes 2723: else 2724: build_libtool_libs=no 2725: fi 2726: fi 2727: else 2728: convenience="$convenience $dir/$old_library" 2729: old_convenience="$old_convenience $dir/$old_library" 2730: deplibs="$dir/$old_library $deplibs" 2731: link_static=yes 2732: fi 2733: fi # link shared/static library? 1.9 kahan 2734: 1.12 vbancrof 2735: if test "$linkmode" = lib; then 1.11 kahan 2736: if test -n "$dependency_libs" && 1.12 vbancrof 2737: { test "$hardcode_into_libs" != yes || 2738: test "$build_old_libs" = yes || 2739: test "$link_static" = yes; }; then 1.11 kahan 2740: # Extract -R from dependency_libs 2741: temp_deplibs= 2742: for libdir in $dependency_libs; do 2743: case $libdir in 2744: -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` 2745: case " $xrpath " in 2746: *" $temp_xrpath "*) ;; 2747: *) xrpath="$xrpath $temp_xrpath";; 2748: esac;; 2749: *) temp_deplibs="$temp_deplibs $libdir";; 2750: esac 2751: done 2752: dependency_libs="$temp_deplibs" 2753: fi 1.9 kahan 2754: 1.11 kahan 2755: newlib_search_path="$newlib_search_path $absdir" 2756: # Link against this library 2757: test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" 2758: # ... and its dependency_libs 2759: tmp_libs= 2760: for deplib in $dependency_libs; do 2761: newdependency_libs="$deplib $newdependency_libs" 2762: if test "X$duplicate_deps" = "Xyes" ; then 2763: case "$tmp_libs " in 2764: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; 2765: esac 2766: fi 2767: tmp_libs="$tmp_libs $deplib" 2768: done 1.9 kahan 2769: 1.12 vbancrof 2770: if test "$link_all_deplibs" != no; then 1.11 kahan 2771: # Add the search paths of all dependency libraries 2772: for deplib in $dependency_libs; do 2773: case $deplib in 2774: -L*) path="$deplib" ;; 2775: *.la) 2776: dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` 2777: test "X$dir" = "X$deplib" && dir="." 2778: # We need an absolute path. 2779: case $dir in 2780: [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 2781: *) 2782: absdir=`cd "$dir" && pwd` 2783: if test -z "$absdir"; then 2784: $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 2785: absdir="$dir" 2786: fi 2787: ;; 2788: esac 2789: if grep "^installed=no" $deplib > /dev/null; then 1.12 vbancrof 2790: path="$absdir/$objdir" 1.11 kahan 2791: else 1.12 vbancrof 2792: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 1.11 kahan 2793: if test -z "$libdir"; then 2794: $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 1.12 vbancrof 2795: exit $EXIT_FAILURE 1.11 kahan 2796: fi 2797: if test "$absdir" != "$libdir"; then 2798: $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 2799: fi 1.12 vbancrof 2800: path="$absdir" 1.11 kahan 2801: fi 1.12 vbancrof 2802: depdepl= 2803: case $host in 2804: *-*-darwin*) 2805: # we do not want to link against static libs, 2806: # but need to link against shared 2807: eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 2808: if test -n "$deplibrary_names" ; then 2809: for tmp in $deplibrary_names ; do 2810: depdepl=$tmp 2811: done 2812: if test -f "$path/$depdepl" ; then 2813: depdepl="$path/$depdepl" 2814: fi 2815: # do not add paths which are already there 2816: case " $newlib_search_path " in 2817: *" $path "*) ;; 2818: *) newlib_search_path="$newlib_search_path $path";; 2819: esac 2820: fi 2821: path="" 2822: ;; 2823: *) 2824: path="-L$path" 2825: ;; 2826: esac 2827: ;; 2828: -l*) 2829: case $host in 2830: *-*-darwin*) 2831: # Again, we only want to link against shared libraries 2832: eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` 2833: for tmp in $newlib_search_path ; do 2834: if test -f "$tmp/lib$tmp_libs.dylib" ; then 2835: eval depdepl="$tmp/lib$tmp_libs.dylib" 2836: break 2837: fi 2838: done 2839: path="" 2840: ;; 2841: *) continue ;; 2842: esac 1.11 kahan 2843: ;; 2844: *) continue ;; 2845: esac 2846: case " $deplibs " in 1.13 ! vbancrof 2847: *" $path "*) ;; ! 2848: *) deplibs="$path $deplibs" ;; ! 2849: esac ! 2850: case " $deplibs " in 1.12 vbancrof 2851: *" $depdepl "*) ;; 2852: *) deplibs="$depdepl $deplibs" ;; 2853: esac 1.11 kahan 2854: done 2855: fi # link_all_deplibs != no 2856: fi # linkmode = lib 2857: done # for deplib in $libs 1.12 vbancrof 2858: dependency_libs="$newdependency_libs" 2859: if test "$pass" = dlpreopen; then 1.11 kahan 2860: # Link the dlpreopened libraries before other libraries 2861: for deplib in $save_deplibs; do 2862: deplibs="$deplib $deplibs" 2863: done 1.2 frystyk 2864: fi 1.12 vbancrof 2865: if test "$pass" != dlopen; then 2866: if test "$pass" != conv; then 1.11 kahan 2867: # Make sure lib_search_path contains only unique directories. 2868: lib_search_path= 2869: for dir in $newlib_search_path; do 2870: case "$lib_search_path " in 2871: *" $dir "*) ;; 2872: *) lib_search_path="$lib_search_path $dir" ;; 2873: esac 2874: done 2875: newlib_search_path= 2876: fi 1.1 frystyk 2877: 1.11 kahan 2878: if test "$linkmode,$pass" != "prog,link"; then 2879: vars="deplibs" 2880: else 2881: vars="compile_deplibs finalize_deplibs" 2882: fi 2883: for var in $vars dependency_libs; do 2884: # Add libraries to $var in reverse order 2885: eval tmp_libs=\"\$$var\" 2886: new_libs= 2887: for deplib in $tmp_libs; do 1.12 vbancrof 2888: # FIXME: Pedantically, this is the right thing to do, so 2889: # that some nasty dependency loop isn't accidentally 2890: # broken: 2891: #new_libs="$deplib $new_libs" 2892: # Pragmatically, this seems to cause very few problems in 2893: # practice: 1.11 kahan 2894: case $deplib in 2895: -L*) new_libs="$deplib $new_libs" ;; 1.12 vbancrof 2896: -R*) ;; 1.11 kahan 2897: *) 1.12 vbancrof 2898: # And here is the reason: when a library appears more 2899: # than once as an explicit dependence of a library, or 2900: # is implicitly linked in more than once by the 2901: # compiler, it is considered special, and multiple 2902: # occurrences thereof are not removed. Compare this 2903: # with having the same library being listed as a 2904: # dependency of multiple other libraries: in this case, 2905: # we know (pedantically, we assume) the library does not 2906: # need to be listed more than once, so we keep only the 2907: # last copy. This is not always right, but it is rare 2908: # enough that we require users that really mean to play 2909: # such unportable linking tricks to link the library 2910: # using -Wl,-lname, so that libtool does not consider it 2911: # for duplicate removal. 1.11 kahan 2912: case " $specialdeplibs " in 2913: *" $deplib "*) new_libs="$deplib $new_libs" ;; 2914: *) 2915: case " $new_libs " in 2916: *" $deplib "*) ;; 2917: *) new_libs="$deplib $new_libs" ;; 2918: esac 2919: ;; 2920: esac 2921: ;; 2922: esac 2923: done 2924: tmp_libs= 2925: for deplib in $new_libs; do 2926: case $deplib in 2927: -L*) 2928: case " $tmp_libs " in 2929: *" $deplib "*) ;; 2930: *) tmp_libs="$tmp_libs $deplib" ;; 2931: esac 2932: ;; 2933: *) tmp_libs="$tmp_libs $deplib" ;; 2934: esac 2935: done 2936: eval $var=\"$tmp_libs\" 2937: done # for var 1.12 vbancrof 2938: fi 2939: # Last step: remove runtime libs from dependency_libs 2940: # (they stay in deplibs) 2941: tmp_libs= 2942: for i in $dependency_libs ; do 2943: case " $predeps $postdeps $compiler_lib_search_path " in 2944: *" $i "*) 2945: i="" 2946: ;; 2947: esac 2948: if test -n "$i" ; then 2949: tmp_libs="$tmp_libs $i" 2950: fi 2951: done 2952: dependency_libs=$tmp_libs 1.11 kahan 2953: done # for pass 1.12 vbancrof 2954: if test "$linkmode" = prog; then 1.11 kahan 2955: dlfiles="$newdlfiles" 2956: dlprefiles="$newdlprefiles" 2957: fi 1.5 frystyk 2958: 1.11 kahan 2959: case $linkmode in 2960: oldlib) 1.12 vbancrof 2961: if test -n "$deplibs"; then 2962: $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 2963: fi 2964: 1.5 frystyk 2965: if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 1.4 frystyk 2966: $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 1.3 frystyk 2967: fi 2968: 2969: if test -n "$rpath"; then 1.4 frystyk 2970: $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 2971: fi 2972: 2973: if test -n "$xrpath"; then 2974: $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 1.3 frystyk 2975: fi 2976: 2977: if test -n "$vinfo"; then 1.12 vbancrof 2978: $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 1.3 frystyk 2979: fi 2980: 2981: if test -n "$release"; then 1.4 frystyk 2982: $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 2983: fi 2984: 1.5 frystyk 2985: if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 1.4 frystyk 2986: $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 1.3 frystyk 2987: fi 2988: 1.2 frystyk 2989: # Now set the variables for building old libraries. 2990: build_libtool_libs=no 1.3 frystyk 2991: oldlibs="$output" 1.11 kahan 2992: objs="$objs$old_deplibs" 1.2 frystyk 2993: ;; 2994: 1.11 kahan 2995: lib) 1.2 frystyk 2996: # Make sure we only generate libraries of the form `libNAME.la'. 1.11 kahan 2997: case $outputname in 1.4 frystyk 2998: lib*) 2999: name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` 1.12 vbancrof 3000: eval shared_ext=\"$shrext_cmds\" 1.4 frystyk 3001: eval libname=\"$libname_spec\" 3002: ;; 1.2 frystyk 3003: *) 1.4 frystyk 3004: if test "$module" = no; then 3005: $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 3006: $echo "$help" 1>&2 1.12 vbancrof 3007: exit $EXIT_FAILURE 1.4 frystyk 3008: fi 3009: if test "$need_lib_prefix" != no; then 3010: # Add the "lib" prefix for modules if required 3011: name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 1.12 vbancrof 3012: eval shared_ext=\"$shrext_cmds\" 1.4 frystyk 3013: eval libname=\"$libname_spec\" 3014: else 3015: libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` 3016: fi 1.2 frystyk 3017: ;; 3018: esac 3019: 1.1 frystyk 3020: if test -n "$objs"; then 1.11 kahan 3021: if test "$deplibs_check_method" != pass_all; then 3022: $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 1.12 vbancrof 3023: exit $EXIT_FAILURE 1.11 kahan 3024: else 1.12 vbancrof 3025: $echo 3026: $echo "*** Warning: Linking the shared library $output against the non-libtool" 3027: $echo "*** objects $objs is not portable!" 1.11 kahan 3028: libobjs="$libobjs $objs" 3029: fi 1.10 kahan 3030: fi 3031: 1.11 kahan 3032: if test "$dlself" != no; then 3033: $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 1.1 frystyk 3034: fi 3035: 1.2 frystyk 3036: set dummy $rpath 1.12 vbancrof 3037: if test "$#" -gt 2; then 1.2 frystyk 3038: $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 1.1 frystyk 3039: fi 1.2 frystyk 3040: install_libdir="$2" 1.1 frystyk 3041: 1.4 frystyk 3042: oldlibs= 1.3 frystyk 3043: if test -z "$rpath"; then 1.4 frystyk 3044: if test "$build_libtool_libs" = yes; then 3045: # Building a libtool convenience library. 1.12 vbancrof 3046: # Some compilers have problems with a `.al' extension so 3047: # convenience libraries should have the same extension an 3048: # archive normally would. 1.4 frystyk 3049: oldlibs="$output_objdir/$libname.$libext $oldlibs" 3050: build_libtool_libs=convenience 3051: build_old_libs=yes 3052: fi 1.3 frystyk 3053: 3054: if test -n "$vinfo"; then 1.12 vbancrof 3055: $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 1.3 frystyk 3056: fi 3057: 3058: if test -n "$release"; then 3059: $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 3060: fi 3061: else 3062: 3063: # Parse the version information argument. 1.11 kahan 3064: save_ifs="$IFS"; IFS=':' 1.3 frystyk 3065: set dummy $vinfo 0 0 0 3066: IFS="$save_ifs" 3067: 3068: if test -n "$8"; then 3069: $echo "$modename: too many parameters to \`-version-info'" 1>&2 3070: $echo "$help" 1>&2 1.12 vbancrof 3071: exit $EXIT_FAILURE 1.3 frystyk 3072: fi 3073: 1.12 vbancrof 3074: # convert absolute version numbers to libtool ages 3075: # this retains compatibility with .la files and attempts 3076: # to make the code below a bit more comprehensible 3077: 3078: case $vinfo_number in 3079: yes) 3080: number_major="$2" 3081: number_minor="$3" 3082: number_revision="$4" 3083: # 3084: # There are really only two kinds -- those that 3085: # use the current revision as the major version 3086: # and those that subtract age and use age as 3087: # a minor version. But, then there is irix 3088: # which has an extra 1 added just for fun 3089: # 3090: case $version_type in 3091: darwin|linux|osf|windows) 3092: current=`expr $number_major + $number_minor` 3093: age="$number_minor" 3094: revision="$number_revision" 3095: ;; 3096: freebsd-aout|freebsd-elf|sunos) 3097: current="$number_major" 3098: revision="$number_minor" 3099: age="0" 3100: ;; 3101: irix|nonstopux) 3102: current=`expr $number_major + $number_minor - 1` 3103: age="$number_minor" 3104: revision="$number_minor" 3105: ;; 3106: esac 3107: ;; 3108: no) 3109: current="$2" 3110: revision="$3" 3111: age="$4" 3112: ;; 3113: esac 1.3 frystyk 3114: 3115: # Check that each of the things are valid numbers. 1.11 kahan 3116: case $current in 1.13 ! vbancrof 3117: 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]) ;; 1.3 frystyk 3118: *) 1.13 ! vbancrof 3119: $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 1.3 frystyk 3120: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 1.12 vbancrof 3121: exit $EXIT_FAILURE 1.3 frystyk 3122: ;; 3123: esac 3124: 1.11 kahan 3125: case $revision in 1.13 ! vbancrof 3126: 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]) ;; 1.3 frystyk 3127: *) 1.13 ! vbancrof 3128: $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 1.3 frystyk 3129: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 1.12 vbancrof 3130: exit $EXIT_FAILURE 1.3 frystyk 3131: ;; 3132: esac 3133: 1.11 kahan 3134: case $age in 1.13 ! vbancrof 3135: 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]) ;; 1.3 frystyk 3136: *) 1.13 ! vbancrof 3137: $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 1.3 frystyk 3138: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 1.12 vbancrof 3139: exit $EXIT_FAILURE 1.3 frystyk 3140: ;; 3141: esac 1.1 frystyk 3142: 1.12 vbancrof 3143: if test "$age" -gt "$current"; then 1.3 frystyk 3144: $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 3145: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 1.12 vbancrof 3146: exit $EXIT_FAILURE 1.3 frystyk 3147: fi 1.1 frystyk 3148: 1.3 frystyk 3149: # Calculate the version variables. 3150: major= 3151: versuffix= 3152: verstring= 1.11 kahan 3153: case $version_type in 1.3 frystyk 3154: none) ;; 3155: 1.11 kahan 3156: darwin) 3157: # Like Linux, but with the current version available in 3158: # verstring for coding it into the library header 3159: major=.`expr $current - $age` 3160: versuffix="$major.$age.$revision" 3161: # Darwin ld doesn't like 0 for these options... 3162: minor_current=`expr $current + 1` 1.13 ! vbancrof 3163: verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" 1.11 kahan 3164: ;; 3165: 3166: freebsd-aout) 3167: major=".$current" 3168: versuffix=".$current.$revision"; 3169: ;; 3170: 3171: freebsd-elf) 3172: major=".$current" 3173: versuffix=".$current"; 3174: ;; 3175: 3176: irix | nonstopux) 1.12 vbancrof 3177: major=`expr $current - $age + 1` 3178: 1.11 kahan 3179: case $version_type in 3180: nonstopux) verstring_prefix=nonstopux ;; 3181: *) verstring_prefix=sgi ;; 3182: esac 3183: verstring="$verstring_prefix$major.$revision" 3184: 1.5 frystyk 3185: # Add in all the interfaces that we are compatible with. 3186: loop=$revision 1.12 vbancrof 3187: while test "$loop" -ne 0; do 1.5 frystyk 3188: iface=`expr $revision - $loop` 3189: loop=`expr $loop - 1` 1.11 kahan 3190: verstring="$verstring_prefix$major.$iface:$verstring" 1.5 frystyk 3191: done 1.11 kahan 3192: 3193: # Before this point, $major must not contain `.'. 3194: major=.$major 3195: versuffix="$major.$revision" 1.5 frystyk 3196: ;; 3197: 1.3 frystyk 3198: linux) 3199: major=.`expr $current - $age` 3200: versuffix="$major.$age.$revision" 3201: ;; 1.1 frystyk 3202: 1.3 frystyk 3203: osf) 1.12 vbancrof 3204: major=.`expr $current - $age` 1.3 frystyk 3205: versuffix=".$current.$age.$revision" 3206: verstring="$current.$age.$revision" 3207: 3208: # Add in all the interfaces that we are compatible with. 3209: loop=$age 1.12 vbancrof 3210: while test "$loop" -ne 0; do 1.3 frystyk 3211: iface=`expr $current - $loop` 3212: loop=`expr $loop - 1` 3213: verstring="$verstring:${iface}.0" 3214: done 1.1 frystyk 3215: 1.3 frystyk 3216: # Make executables depend on our current version. 3217: verstring="$verstring:${current}.0" 3218: ;; 1.1 frystyk 3219: 1.9 kahan 3220: sunos) 1.4 frystyk 3221: major=".$current" 1.9 kahan 3222: versuffix=".$current.$revision" 1.4 frystyk 3223: ;; 3224: 3225: windows) 1.11 kahan 3226: # Use '-' rather than '.', since we only want one 3227: # extension on DOS 8.3 filesystems. 1.4 frystyk 3228: major=`expr $current - $age` 1.11 kahan 3229: versuffix="-$major" 1.4 frystyk 3230: ;; 3231: 1.3 frystyk 3232: *) 3233: $echo "$modename: unknown library version type \`$version_type'" 1>&2 1.12 vbancrof 3234: $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 3235: exit $EXIT_FAILURE 1.3 frystyk 3236: ;; 3237: esac 1.1 frystyk 3238: 1.3 frystyk 3239: # Clear the version info if we defaulted, and they specified a release. 3240: if test -z "$vinfo" && test -n "$release"; then 3241: major= 1.11 kahan 3242: case $version_type in 3243: darwin) 3244: # we can't check for "0.0" in archive_cmds due to quoting 3245: # problems, so we reset it completely 1.12 vbancrof 3246: verstring= 1.11 kahan 3247: ;; 3248: *) 3249: verstring="0.0" 3250: ;; 3251: esac 1.4 frystyk 3252: if test "$need_version" = no; then 3253: versuffix= 3254: else 3255: versuffix=".0.0" 3256: fi 1.3 frystyk 3257: fi 1.1 frystyk 3258: 1.4 frystyk 3259: # Remove version info from name if versioning should be avoided 3260: if test "$avoid_version" = yes && test "$need_version" = no; then 3261: major= 3262: versuffix= 3263: verstring="" 3264: fi 1.11 kahan 3265: 1.3 frystyk 3266: # Check to see if the archive will have undefined symbols. 3267: if test "$allow_undefined" = yes; then 3268: if test "$allow_undefined_flag" = unsupported; then 3269: $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 3270: build_libtool_libs=no 3271: build_old_libs=yes 3272: fi 3273: else 3274: # Don't allow undefined symbols. 3275: allow_undefined_flag="$no_undefined_flag" 3276: fi 3277: fi 1.1 frystyk 3278: 1.11 kahan 3279: if test "$mode" != relink; then 1.12 vbancrof 3280: # Remove our outputs, but don't remove object files since they 3281: # may have been created when compiling PIC objects. 3282: removelist= 3283: tempremovelist=`$echo "$output_objdir/*"` 3284: for p in $tempremovelist; do 3285: case $p in 3286: *.$objext) 3287: ;; 3288: $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) 3289: if test "X$precious_files_regex" != "X"; then 3290: if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 3291: then 3292: continue 3293: fi 3294: fi 3295: removelist="$removelist $p" 3296: ;; 3297: *) ;; 3298: esac 3299: done 3300: if test -n "$removelist"; then 3301: $show "${rm}r $removelist" 3302: $run ${rm}r $removelist 3303: fi 1.4 frystyk 3304: fi 3305: 3306: # Now set the variables for building old libraries. 3307: if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 3308: oldlibs="$oldlibs $output_objdir/$libname.$libext" 3309: 3310: # Transform .lo files to .o files. 3311: oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 3312: fi 3313: 1.11 kahan 3314: # Eliminate all temporary directories. 3315: for path in $notinst_path; do 1.12 vbancrof 3316: lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` 3317: deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` 3318: dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` 1.11 kahan 3319: done 3320: 3321: if test -n "$xrpath"; then 3322: # If the user specified any rpath flags, then add them. 3323: temp_xrpath= 3324: for libdir in $xrpath; do 3325: temp_xrpath="$temp_xrpath -R$libdir" 3326: case "$finalize_rpath " in 3327: *" $libdir "*) ;; 3328: *) finalize_rpath="$finalize_rpath $libdir" ;; 3329: esac 3330: done 1.12 vbancrof 3331: if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then 1.11 kahan 3332: dependency_libs="$temp_xrpath $dependency_libs" 3333: fi 3334: fi 3335: 3336: # Make sure dlfiles contains only unique files that won't be dlpreopened 3337: old_dlfiles="$dlfiles" 3338: dlfiles= 3339: for lib in $old_dlfiles; do 3340: case " $dlprefiles $dlfiles " in 3341: *" $lib "*) ;; 3342: *) dlfiles="$dlfiles $lib" ;; 3343: esac 3344: done 3345: 3346: # Make sure dlprefiles contains only unique files 3347: old_dlprefiles="$dlprefiles" 3348: dlprefiles= 3349: for lib in $old_dlprefiles; do 3350: case "$dlprefiles " in 3351: *" $lib "*) ;; 3352: *) dlprefiles="$dlprefiles $lib" ;; 3353: esac 3354: done 3355: 1.4 frystyk 3356: if test "$build_libtool_libs" = yes; then 1.11 kahan 3357: if test -n "$rpath"; then 3358: case $host in 3359: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) 3360: # these systems don't actually have a c library (as such)! 3361: ;; 3362: *-*-rhapsody* | *-*-darwin1.[012]) 3363: # Rhapsody C library is in the System framework 3364: deplibs="$deplibs -framework System" 3365: ;; 3366: *-*-netbsd*) 3367: # Don't link with libc until the a.out ld.so is fixed. 3368: ;; 1.13 ! vbancrof 3369: *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 1.11 kahan 3370: # Do not include libc due to us having libc/libc_r. 1.12 vbancrof 3371: test "X$arg" = "X-lc" && continue 1.11 kahan 3372: ;; 1.12 vbancrof 3373: *) 1.11 kahan 3374: # Add libc to deplibs on all other systems if necessary. 1.12 vbancrof 3375: if test "$build_libtool_need_lc" = "yes"; then 1.11 kahan 3376: deplibs="$deplibs -lc" 3377: fi 3378: ;; 3379: esac 3380: fi 3381: 1.4 frystyk 3382: # Transform deplibs into only deplibs that can be linked in shared. 3383: name_save=$name 3384: libname_save=$libname 3385: release_save=$release 3386: versuffix_save=$versuffix 3387: major_save=$major 3388: # I'm not sure if I'm treating the release correctly. I think 3389: # release should show up in the -l (ie -lgmp5) so we don't want to 3390: # add it in twice. Is that correct? 3391: release="" 3392: versuffix="" 3393: major="" 3394: newdeplibs= 3395: droppeddeps=no 1.11 kahan 3396: case $deplibs_check_method in 1.4 frystyk 3397: pass_all) 1.5 frystyk 3398: # Don't check for shared/static. Everything works. 3399: # This might be a little naive. We might want to check 3400: # whether the library exists or not. But this is on 3401: # osf3 & osf4 and I'm not really sure... Just 1.12 vbancrof 3402: # implementing what was already the behavior. 1.4 frystyk 3403: newdeplibs=$deplibs 1.5 frystyk 3404: ;; 1.4 frystyk 3405: test_compile) 3406: # This code stresses the "libraries are programs" paradigm to its 3407: # limits. Maybe even breaks it. We compile a program, linking it 3408: # against the deplibs as a proxy for the library. Then we can check 3409: # whether they linked in statically or dynamically with ldd. 3410: $rm conftest.c 3411: cat > conftest.c <<EOF 3412: int main() { return 0; } 3413: EOF 3414: $rm conftest 1.12 vbancrof 3415: $LTCC -o conftest conftest.c $deplibs 3416: if test "$?" -eq 0 ; then 1.4 frystyk 3417: ldd_output=`ldd conftest` 3418: for i in $deplibs; do 3419: name="`expr $i : '-l\(.*\)'`" 3420: # If $name is empty we are operating on a -L argument. 1.12 vbancrof 3421: if test "$name" != "" && test "$name" -ne "0"; then 3422: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3423: case " $predeps $postdeps " in 3424: *" $i "*) 3425: newdeplibs="$newdeplibs $i" 3426: i="" 3427: ;; 3428: esac 3429: fi 3430: if test -n "$i" ; then 3431: libname=`eval \\$echo \"$libname_spec\"` 3432: deplib_matches=`eval \\$echo \"$library_names_spec\"` 3433: set dummy $deplib_matches 3434: deplib_match=$2 3435: if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3436: newdeplibs="$newdeplibs $i" 3437: else 3438: droppeddeps=yes 3439: $echo 3440: $echo "*** Warning: dynamic linker does not accept needed library $i." 3441: $echo "*** I have the capability to make that library automatically link in when" 3442: $echo "*** you link to this library. But I can only do this if you have a" 3443: $echo "*** shared version of the library, which I believe you do not have" 3444: $echo "*** because a test_compile did reveal that the linker did not use it for" 3445: $echo "*** its dynamic dependency list that programs get resolved with at runtime." 3446: fi 1.4 frystyk 3447: fi 3448: else 3449: newdeplibs="$newdeplibs $i" 3450: fi 3451: done 3452: else 1.12 vbancrof 3453: # Error occurred in the first compile. Let's try to salvage 1.11 kahan 3454: # the situation: Compile a separate program for each library. 1.4 frystyk 3455: for i in $deplibs; do 3456: name="`expr $i : '-l\(.*\)'`" 1.12 vbancrof 3457: # If $name is empty we are operating on a -L argument. 3458: if test "$name" != "" && test "$name" != "0"; then 1.4 frystyk 3459: $rm conftest 1.12 vbancrof 3460: $LTCC -o conftest conftest.c $i 1.4 frystyk 3461: # Did it work? 1.12 vbancrof 3462: if test "$?" -eq 0 ; then 1.4 frystyk 3463: ldd_output=`ldd conftest` 1.12 vbancrof 3464: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3465: case " $predeps $postdeps " in 3466: *" $i "*) 3467: newdeplibs="$newdeplibs $i" 3468: i="" 3469: ;; 3470: esac 3471: fi 3472: if test -n "$i" ; then 3473: libname=`eval \\$echo \"$libname_spec\"` 3474: deplib_matches=`eval \\$echo \"$library_names_spec\"` 3475: set dummy $deplib_matches 3476: deplib_match=$2 3477: if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 3478: newdeplibs="$newdeplibs $i" 3479: else 3480: droppeddeps=yes 3481: $echo 3482: $echo "*** Warning: dynamic linker does not accept needed library $i." 3483: $echo "*** I have the capability to make that library automatically link in when" 3484: $echo "*** you link to this library. But I can only do this if you have a" 3485: $echo "*** shared version of the library, which you do not appear to have" 3486: $echo "*** because a test_compile did reveal that the linker did not use this one" 3487: $echo "*** as a dynamic dependency that programs can get resolved with at runtime." 3488: fi 1.5 frystyk 3489: fi 1.4 frystyk 3490: else 3491: droppeddeps=yes 1.12 vbancrof 3492: $echo 3493: $echo "*** Warning! Library $i is needed by this library but I was not able to" 3494: $echo "*** make it link in! You will probably need to install it or some" 3495: $echo "*** library that it depends on before this library will be fully" 3496: $echo "*** functional. Installing it before continuing would be even better." 1.4 frystyk 3497: fi 3498: else 3499: newdeplibs="$newdeplibs $i" 3500: fi 3501: done 3502: fi 3503: ;; 1.5 frystyk 3504: file_magic*) 1.4 frystyk 3505: set dummy $deplibs_check_method 1.11 kahan 3506: file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 1.4 frystyk 3507: for a_deplib in $deplibs; do 3508: name="`expr $a_deplib : '-l\(.*\)'`" 3509: # If $name is empty we are operating on a -L argument. 1.12 vbancrof 3510: if test "$name" != "" && test "$name" != "0"; then 3511: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3512: case " $predeps $postdeps " in 3513: *" $a_deplib "*) 3514: newdeplibs="$newdeplibs $a_deplib" 3515: a_deplib="" 3516: ;; 3517: esac 3518: fi 3519: if test -n "$a_deplib" ; then 3520: libname=`eval \\$echo \"$libname_spec\"` 3521: for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3522: potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3523: for potent_lib in $potential_libs; do 1.4 frystyk 3524: # Follow soft links. 1.6 frystyk 3525: if ls -lLd "$potent_lib" 2>/dev/null \ 1.4 frystyk 3526: | grep " -> " >/dev/null; then 1.11 kahan 3527: continue 1.4 frystyk 3528: fi 3529: # The statement above tries to avoid entering an 3530: # endless loop below, in case of cyclic links. 3531: # We might still enter an endless loop, since a link 3532: # loop can be closed while we follow links, 3533: # but so what? 3534: potlib="$potent_lib" 3535: while test -h "$potlib" 2>/dev/null; do 1.12 vbancrof 3536: potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 1.11 kahan 3537: case $potliblink in 1.5 frystyk 3538: [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 3539: *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 1.4 frystyk 3540: esac 3541: done 1.5 frystyk 3542: if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ 1.12 vbancrof 3543: | ${SED} 10q \ 3544: | $EGREP "$file_magic_regex" > /dev/null; then 1.4 frystyk 3545: newdeplibs="$newdeplibs $a_deplib" 3546: a_deplib="" 3547: break 2 3548: fi 1.12 vbancrof 3549: done 3550: done 3551: fi 1.4 frystyk 3552: if test -n "$a_deplib" ; then 3553: droppeddeps=yes 1.12 vbancrof 3554: $echo 3555: $echo "*** Warning: linker path does not have real file for library $a_deplib." 3556: $echo "*** I have the capability to make that library automatically link in when" 3557: $echo "*** you link to this library. But I can only do this if you have a" 3558: $echo "*** shared version of the library, which you do not appear to have" 3559: $echo "*** because I did check the linker path looking for a file starting" 1.11 kahan 3560: if test -z "$potlib" ; then 1.12 vbancrof 3561: $echo "*** with $libname but no candidates were found. (...for file magic test)" 1.11 kahan 3562: else 1.12 vbancrof 3563: $echo "*** with $libname and none of the candidates passed a file format test" 3564: $echo "*** using a file magic. Last file checked: $potlib" 1.11 kahan 3565: fi 3566: fi 3567: else 3568: # Add a -L argument. 3569: newdeplibs="$newdeplibs $a_deplib" 3570: fi 3571: done # Gone through all deplibs. 3572: ;; 3573: match_pattern*) 3574: set dummy $deplibs_check_method 3575: match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 3576: for a_deplib in $deplibs; do 3577: name="`expr $a_deplib : '-l\(.*\)'`" 3578: # If $name is empty we are operating on a -L argument. 3579: if test -n "$name" && test "$name" != "0"; then 1.12 vbancrof 3580: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3581: case " $predeps $postdeps " in 3582: *" $a_deplib "*) 3583: newdeplibs="$newdeplibs $a_deplib" 3584: a_deplib="" 3585: ;; 3586: esac 3587: fi 3588: if test -n "$a_deplib" ; then 3589: libname=`eval \\$echo \"$libname_spec\"` 3590: for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 3591: potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 3592: for potent_lib in $potential_libs; do 3593: potlib="$potent_lib" # see symlink-check above in file_magic test 3594: if eval $echo \"$potent_lib\" 2>/dev/null \ 3595: | ${SED} 10q \ 3596: | $EGREP "$match_pattern_regex" > /dev/null; then 3597: newdeplibs="$newdeplibs $a_deplib" 3598: a_deplib="" 3599: break 2 3600: fi 3601: done 1.11 kahan 3602: done 1.12 vbancrof 3603: fi 1.11 kahan 3604: if test -n "$a_deplib" ; then 3605: droppeddeps=yes 1.12 vbancrof 3606: $echo 3607: $echo "*** Warning: linker path does not have real file for library $a_deplib." 3608: $echo "*** I have the capability to make that library automatically link in when" 3609: $echo "*** you link to this library. But I can only do this if you have a" 3610: $echo "*** shared version of the library, which you do not appear to have" 3611: $echo "*** because I did check the linker path looking for a file starting" 1.11 kahan 3612: if test -z "$potlib" ; then 1.12 vbancrof 3613: $echo "*** with $libname but no candidates were found. (...for regex pattern test)" 1.11 kahan 3614: else 1.12 vbancrof 3615: $echo "*** with $libname and none of the candidates passed a file format test" 3616: $echo "*** using a regex pattern. Last file checked: $potlib" 1.11 kahan 3617: fi 1.4 frystyk 3618: fi 3619: else 3620: # Add a -L argument. 3621: newdeplibs="$newdeplibs $a_deplib" 3622: fi 3623: done # Gone through all deplibs. 3624: ;; 1.5 frystyk 3625: none | unknown | *) 3626: newdeplibs="" 1.12 vbancrof 3627: tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ 3628: -e 's/ -[LR][^ ]*//g'` 3629: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 3630: for i in $predeps $postdeps ; do 3631: # can't use Xsed below, because $i might contain '/' 3632: tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` 3633: done 3634: fi 3635: if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ 3636: | grep . >/dev/null; then 3637: $echo 1.5 frystyk 3638: if test "X$deplibs_check_method" = "Xnone"; then 1.12 vbancrof 3639: $echo "*** Warning: inter-library dependencies are not supported in this platform." 1.5 frystyk 3640: else 1.12 vbancrof 3641: $echo "*** Warning: inter-library dependencies are not known to be supported." 1.5 frystyk 3642: fi 1.12 vbancrof 3643: $echo "*** All declared inter-library dependencies are being dropped." 1.5 frystyk 3644: droppeddeps=yes 3645: fi 3646: ;; 1.4 frystyk 3647: esac 3648: versuffix=$versuffix_save 3649: major=$major_save 3650: release=$release_save 3651: libname=$libname_save 3652: name=$name_save 3653: 1.11 kahan 3654: case $host in 3655: *-*-rhapsody* | *-*-darwin1.[012]) 3656: # On Rhapsody replace the C library is the System framework 3657: newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` 3658: ;; 3659: esac 3660: 1.5 frystyk 3661: if test "$droppeddeps" = yes; then 3662: if test "$module" = yes; then 1.12 vbancrof 3663: $echo 3664: $echo "*** Warning: libtool could not satisfy all declared inter-library" 3665: $echo "*** dependencies of module $libname. Therefore, libtool will create" 3666: $echo "*** a static module, that should work as long as the dlopening" 3667: $echo "*** application is linked with the -dlopen flag." 1.5 frystyk 3668: if test -z "$global_symbol_pipe"; then 1.12 vbancrof 3669: $echo 3670: $echo "*** However, this would only work if libtool was able to extract symbol" 3671: $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" 3672: $echo "*** not find such a program. So, this module is probably useless." 3673: $echo "*** \`nm' from GNU binutils and a full rebuild may help." 1.5 frystyk 3674: fi 3675: if test "$build_old_libs" = no; then 3676: oldlibs="$output_objdir/$libname.$libext" 3677: build_libtool_libs=module 3678: build_old_libs=yes 3679: else 3680: build_libtool_libs=no 3681: fi 1.4 frystyk 3682: else 1.12 vbancrof 3683: $echo "*** The inter-library dependencies that have been dropped here will be" 3684: $echo "*** automatically added whenever a program is linked with this library" 3685: $echo "*** or is declared to -dlopen it." 3686: 3687: if test "$allow_undefined" = no; then 3688: $echo 3689: $echo "*** Since this library must not contain undefined symbols," 3690: $echo "*** because either the platform does not support them or" 3691: $echo "*** it was explicitly requested with -no-undefined," 3692: $echo "*** libtool will only create a static version of it." 1.11 kahan 3693: if test "$build_old_libs" = no; then 3694: oldlibs="$output_objdir/$libname.$libext" 3695: build_libtool_libs=module 3696: build_old_libs=yes 3697: else 3698: build_libtool_libs=no 3699: fi 3700: fi 1.4 frystyk 3701: fi 3702: fi 1.5 frystyk 3703: # Done checking deplibs! 3704: deplibs=$newdeplibs 1.1 frystyk 3705: fi 3706: 1.5 frystyk 3707: # All the library-specific variables (install_libdir is set above). 3708: library_names= 3709: old_library= 3710: dlname= 1.11 kahan 3711: 1.5 frystyk 3712: # Test again, we may have decided not to build it any more 1.1 frystyk 3713: if test "$build_libtool_libs" = yes; then 1.12 vbancrof 3714: if test "$hardcode_into_libs" = yes; then 1.11 kahan 3715: # Hardcode the library paths 3716: hardcode_libdirs= 3717: dep_rpath= 3718: rpath="$finalize_rpath" 3719: test "$mode" != relink && rpath="$compile_rpath$rpath" 3720: for libdir in $rpath; do 3721: if test -n "$hardcode_libdir_flag_spec"; then 3722: if test -n "$hardcode_libdir_separator"; then 3723: if test -z "$hardcode_libdirs"; then 3724: hardcode_libdirs="$libdir" 3725: else 3726: # Just accumulate the unique libdirs. 3727: case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 3728: *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 3729: ;; 3730: *) 3731: hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 3732: ;; 3733: esac 3734: fi 3735: else 3736: eval flag=\"$hardcode_libdir_flag_spec\" 3737: dep_rpath="$dep_rpath $flag" 3738: fi 3739: elif test -n "$runpath_var"; then 3740: case "$perm_rpath " in 3741: *" $libdir "*) ;; 3742: *) perm_rpath="$perm_rpath $libdir" ;; 3743: esac 3744: fi 3745: done 3746: # Substitute the hardcoded libdirs into the rpath. 3747: if test -n "$hardcode_libdir_separator" && 3748: test -n "$hardcode_libdirs"; then 3749: libdir="$hardcode_libdirs" 1.12 vbancrof 3750: if test -n "$hardcode_libdir_flag_spec_ld"; then 3751: eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 3752: else 3753: eval dep_rpath=\"$hardcode_libdir_flag_spec\" 3754: fi 1.11 kahan 3755: fi 3756: if test -n "$runpath_var" && test -n "$perm_rpath"; then 3757: # We should set the runpath_var. 3758: rpath= 3759: for dir in $perm_rpath; do 3760: rpath="$rpath$dir:" 3761: done 3762: eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 3763: fi 3764: test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 3765: fi 3766: 3767: shlibpath="$finalize_shlibpath" 3768: test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 3769: if test -n "$shlibpath"; then 3770: eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 3771: fi 3772: 1.3 frystyk 3773: # Get the real and link names of the library. 1.12 vbancrof 3774: eval shared_ext=\"$shrext_cmds\" 1.3 frystyk 3775: eval library_names=\"$library_names_spec\" 3776: set dummy $library_names 3777: realname="$2" 3778: shift; shift 1.1 frystyk 3779: 1.3 frystyk 3780: if test -n "$soname_spec"; then 3781: eval soname=\"$soname_spec\" 3782: else 3783: soname="$realname" 3784: fi 1.12 vbancrof 3785: if test -z "$dlname"; then 3786: dlname=$soname 3787: fi 1.1 frystyk 3788: 1.4 frystyk 3789: lib="$output_objdir/$realname" 1.1 frystyk 3790: for link 3791: do 3792: linknames="$linknames $link" 3793: done 3794: 1.5 frystyk 3795: # Use standard objects if they are pic 1.4 frystyk 3796: test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 1.3 frystyk 3797: 1.5 frystyk 3798: # Prepare the list of exported symbols 3799: if test -z "$export_symbols"; then 3800: if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then 3801: $show "generating symbol list for \`$libname.la'" 3802: export_symbols="$output_objdir/$libname.exp" 3803: $run $rm $export_symbols 1.12 vbancrof 3804: cmds=$export_symbols_cmds 1.11 kahan 3805: save_ifs="$IFS"; IFS='~' 1.5 frystyk 3806: for cmd in $cmds; do 3807: IFS="$save_ifs" 1.12 vbancrof 3808: eval cmd=\"$cmd\" 3809: if len=`expr "X$cmd" : ".*"` && 3810: test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3811: $show "$cmd" 3812: $run eval "$cmd" || exit $? 3813: skipped_export=false 3814: else 3815: # The command line is too long to execute in one step. 3816: $show "using reloadable object file for export list..." 3817: skipped_export=: 3818: fi 1.5 frystyk 3819: done 3820: IFS="$save_ifs" 3821: if test -n "$export_symbols_regex"; then 1.12 vbancrof 3822: $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" 3823: $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' 1.5 frystyk 3824: $show "$mv \"${export_symbols}T\" \"$export_symbols\"" 3825: $run eval '$mv "${export_symbols}T" "$export_symbols"' 3826: fi 3827: fi 3828: fi 3829: 3830: if test -n "$export_symbols" && test -n "$include_expsyms"; then 3831: $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' 3832: fi 3833: 1.12 vbancrof 3834: tmp_deplibs= 3835: for test_deplib in $deplibs; do 3836: case " $convenience " in 3837: *" $test_deplib "*) ;; 3838: *) 3839: tmp_deplibs="$tmp_deplibs $test_deplib" 3840: ;; 3841: esac 3842: done 3843: deplibs="$tmp_deplibs" 3844: 1.7 frystyk 3845: if test -n "$convenience"; then 3846: if test -n "$whole_archive_flag_spec"; then 1.12 vbancrof 3847: save_libobjs=$libobjs 1.7 frystyk 3848: eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3849: else 3850: gentop="$output_objdir/${outputname}x" 3851: generated="$generated $gentop" 3852: 1.13 ! vbancrof 3853: func_extract_archives $gentop $convenience ! 3854: libobjs="$libobjs $func_extract_archives_result" 1.7 frystyk 3855: fi 3856: fi 1.13 ! vbancrof 3857: 1.7 frystyk 3858: if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 3859: eval flag=\"$thread_safe_flag_spec\" 1.11 kahan 3860: linker_flags="$linker_flags $flag" 3861: fi 3862: 3863: # Make a backup of the uninstalled library when relinking 3864: if test "$mode" = relink; then 3865: $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 1.7 frystyk 3866: fi 3867: 1.3 frystyk 3868: # Do each of the archive commands. 1.12 vbancrof 3869: if test "$module" = yes && test -n "$module_cmds" ; then 3870: if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 3871: eval test_cmds=\"$module_expsym_cmds\" 3872: cmds=$module_expsym_cmds 3873: else 3874: eval test_cmds=\"$module_cmds\" 3875: cmds=$module_cmds 3876: fi 3877: else 1.5 frystyk 3878: if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 1.12 vbancrof 3879: eval test_cmds=\"$archive_expsym_cmds\" 3880: cmds=$archive_expsym_cmds 3881: else 3882: eval test_cmds=\"$archive_cmds\" 3883: cmds=$archive_cmds 3884: fi 3885: fi 3886: 3887: if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && 3888: test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 3889: : 1.4 frystyk 3890: else 1.12 vbancrof 3891: # The command line is too long to link in one step, link piecewise. 3892: $echo "creating reloadable object files..." 3893: 3894: # Save the value of $output and $libobjs because we want to 3895: # use them later. If we have whole_archive_flag_spec, we 3896: # want to use save_libobjs as it was before 3897: # whole_archive_flag_spec was expanded, because we can't 3898: # assume the linker understands whole_archive_flag_spec. 3899: # This may have to be revisited, in case too many 3900: # convenience libraries get linked in and end up exceeding 3901: # the spec. 3902: if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 3903: save_libobjs=$libobjs 3904: fi 3905: save_output=$output 1.13 ! vbancrof 3906: output_la=`$echo "X$output" | $Xsed -e "$basename"` 1.12 vbancrof 3907: 3908: # Clear the reloadable object creation command queue and 3909: # initialize k to one. 3910: test_cmds= 3911: concat_cmds= 3912: objlist= 3913: delfiles= 3914: last_robj= 3915: k=1 1.13 ! vbancrof 3916: output=$output_objdir/$output_la-${k}.$objext 1.12 vbancrof 3917: # Loop over the list of objects to be linked. 3918: for obj in $save_libobjs 3919: do 3920: eval test_cmds=\"$reload_cmds $objlist $last_robj\" 3921: if test "X$objlist" = X || 3922: { len=`expr "X$test_cmds" : ".*"` && 3923: test "$len" -le "$max_cmd_len"; }; then 3924: objlist="$objlist $obj" 3925: else 3926: # The command $test_cmds is almost too long, add a 3927: # command to the queue. 3928: if test "$k" -eq 1 ; then 3929: # The first file doesn't have a previous command to add. 3930: eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 3931: else 3932: # All subsequent reloadable object files will link in 3933: # the last one created. 3934: eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" 3935: fi 1.13 ! vbancrof 3936: last_robj=$output_objdir/$output_la-${k}.$objext 1.12 vbancrof 3937: k=`expr $k + 1` 1.13 ! vbancrof 3938: output=$output_objdir/$output_la-${k}.$objext 1.12 vbancrof 3939: objlist=$obj 3940: len=1 3941: fi 3942: done 3943: # Handle the remaining objects by creating one last 3944: # reloadable object file. All subsequent reloadable object 3945: # files will link in the last one created. 3946: test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 3947: eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 3948: 3949: if ${skipped_export-false}; then 3950: $show "generating symbol list for \`$libname.la'" 3951: export_symbols="$output_objdir/$libname.exp" 3952: $run $rm $export_symbols 3953: libobjs=$output 3954: # Append the command to create the export file. 3955: eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" 3956: fi 3957: 1.13 ! vbancrof 3958: # Set up a command to remove the reloadable object files 1.12 vbancrof 3959: # after they are used. 3960: i=0 3961: while test "$i" -lt "$k" 3962: do 3963: i=`expr $i + 1` 1.13 ! vbancrof 3964: delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" 1.12 vbancrof 3965: done 3966: 3967: $echo "creating a temporary reloadable object file: $output" 3968: 3969: # Loop through the commands generated above and execute them. 3970: save_ifs="$IFS"; IFS='~' 3971: for cmd in $concat_cmds; do 3972: IFS="$save_ifs" 3973: $show "$cmd" 3974: $run eval "$cmd" || exit $? 3975: done 3976: IFS="$save_ifs" 3977: 3978: libobjs=$output 3979: # Restore the value of output. 3980: output=$save_output 3981: 3982: if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 3983: eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 3984: fi 3985: # Expand the library linking commands again to reset the 3986: # value of $libobjs for piecewise linking. 3987: 3988: # Do each of the archive commands. 3989: if test "$module" = yes && test -n "$module_cmds" ; then 3990: if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 3991: cmds=$module_expsym_cmds 3992: else 3993: cmds=$module_cmds 3994: fi 3995: else 3996: if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 3997: cmds=$archive_expsym_cmds 3998: else 3999: cmds=$archive_cmds 4000: fi 4001: fi 4002: 4003: # Append the command to remove the reloadable object files 4004: # to the just-reset $cmds. 4005: eval cmds=\"\$cmds~\$rm $delfiles\" 1.4 frystyk 4006: fi 1.11 kahan 4007: save_ifs="$IFS"; IFS='~' 1.3 frystyk 4008: for cmd in $cmds; do 4009: IFS="$save_ifs" 1.12 vbancrof 4010: eval cmd=\"$cmd\" 1.3 frystyk 4011: $show "$cmd" 4012: $run eval "$cmd" || exit $? 4013: done 4014: IFS="$save_ifs" 1.1 frystyk 4015: 1.11 kahan 4016: # Restore the uninstalled library and exit 4017: if test "$mode" = relink; then 4018: $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? 1.12 vbancrof 4019: exit $EXIT_SUCCESS 1.11 kahan 4020: fi 4021: 1.3 frystyk 4022: # Create links to the real library. 4023: for linkname in $linknames; do 4024: if test "$realname" != "$linkname"; then 1.4 frystyk 4025: $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" 4026: $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? 1.3 frystyk 4027: fi 4028: done 1.1 frystyk 4029: 1.4 frystyk 4030: # If -module or -export-dynamic was specified, set the dlname. 4031: if test "$module" = yes || test "$export_dynamic" = yes; then 1.3 frystyk 4032: # On all known operating systems, these are identical. 4033: dlname="$soname" 4034: fi 1.1 frystyk 4035: fi 4036: ;; 4037: 1.11 kahan 4038: obj) 1.1 frystyk 4039: if test -n "$deplibs"; then 1.4 frystyk 4040: $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 1.1 frystyk 4041: fi 4042: 1.5 frystyk 4043: if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 1.4 frystyk 4044: $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 1.2 frystyk 4045: fi 4046: 4047: if test -n "$rpath"; then 1.4 frystyk 4048: $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 4049: fi 4050: 4051: if test -n "$xrpath"; then 4052: $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 1.1 frystyk 4053: fi 4054: 4055: if test -n "$vinfo"; then 1.4 frystyk 4056: $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 1.2 frystyk 4057: fi 4058: 4059: if test -n "$release"; then 1.4 frystyk 4060: $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 1.1 frystyk 4061: fi 4062: 1.11 kahan 4063: case $output in 1.1 frystyk 4064: *.lo) 1.11 kahan 4065: if test -n "$objs$old_deplibs"; then 1.4 frystyk 4066: $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 1.12 vbancrof 4067: exit $EXIT_FAILURE 1.4 frystyk 4068: fi 4069: libobj="$output" 4070: obj=`$echo "X$output" | $Xsed -e "$lo2o"` 4071: ;; 1.1 frystyk 4072: *) 1.4 frystyk 4073: libobj= 4074: obj="$output" 4075: ;; 1.1 frystyk 4076: esac 4077: 4078: # Delete the old objects. 4079: $run $rm $obj $libobj 4080: 1.7 frystyk 4081: # Objects from convenience libraries. This assumes 4082: # single-version convenience libraries. Whenever we create 4083: # different ones for PIC/non-PIC, this we'll have to duplicate 4084: # the extraction. 4085: reload_conv_objs= 4086: gentop= 4087: # reload_cmds runs $LD directly, so let us get rid of 4088: # -Wl from whole_archive_flag_spec 1.11 kahan 4089: wl= 1.7 frystyk 4090: 4091: if test -n "$convenience"; then 4092: if test -n "$whole_archive_flag_spec"; then 4093: eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" 4094: else 4095: gentop="$output_objdir/${obj}x" 4096: generated="$generated $gentop" 4097: 1.13 ! vbancrof 4098: func_extract_archives $gentop $convenience ! 4099: reload_conv_objs="$reload_objs $func_extract_archives_result" 1.7 frystyk 4100: fi 4101: fi 4102: 1.1 frystyk 4103: # Create the old-style object. 1.11 kahan 4104: reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test 1.1 frystyk 4105: 4106: output="$obj" 1.12 vbancrof 4107: cmds=$reload_cmds 1.11 kahan 4108: save_ifs="$IFS"; IFS='~' 1.1 frystyk 4109: for cmd in $cmds; do 1.4 frystyk 4110: IFS="$save_ifs" 1.12 vbancrof 4111: eval cmd=\"$cmd\" 1.4 frystyk 4112: $show "$cmd" 4113: $run eval "$cmd" || exit $? 1.1 frystyk 4114: done 4115: IFS="$save_ifs" 4116: 4117: # Exit if we aren't doing a library object file. 1.7 frystyk 4118: if test -z "$libobj"; then 4119: if test -n "$gentop"; then 4120: $show "${rm}r $gentop" 4121: $run ${rm}r $gentop 4122: fi 4123: 1.12 vbancrof 4124: exit $EXIT_SUCCESS 1.7 frystyk 4125: fi 1.1 frystyk 4126: 4127: if test "$build_libtool_libs" != yes; then 1.7 frystyk 4128: if test -n "$gentop"; then 4129: $show "${rm}r $gentop" 4130: $run ${rm}r $gentop 4131: fi 4132: 1.4 frystyk 4133: # Create an invalid libtool object if no PIC, so that we don't 4134: # accidentally link it into a program. 1.12 vbancrof 4135: # $show "echo timestamp > $libobj" 4136: # $run eval "echo timestamp > $libobj" || exit $? 4137: exit $EXIT_SUCCESS 1.1 frystyk 4138: fi 4139: 1.11 kahan 4140: if test -n "$pic_flag" || test "$pic_mode" != default; then 1.4 frystyk 4141: # Only do commands if we really have different PIC objects. 1.7 frystyk 4142: reload_objs="$libobjs $reload_conv_objs" 1.4 frystyk 4143: output="$libobj" 1.12 vbancrof 4144: cmds=$reload_cmds 1.11 kahan 4145: save_ifs="$IFS"; IFS='~' 1.4 frystyk 4146: for cmd in $cmds; do 4147: IFS="$save_ifs" 1.12 vbancrof 4148: eval cmd=\"$cmd\" 1.4 frystyk 4149: $show "$cmd" 4150: $run eval "$cmd" || exit $? 4151: done 4152: IFS="$save_ifs" 1.1 frystyk 4153: fi 4154: 1.7 frystyk 4155: if test -n "$gentop"; then 4156: $show "${rm}r $gentop" 4157: $run ${rm}r $gentop 4158: fi 4159: 1.12 vbancrof 4160: exit $EXIT_SUCCESS 1.1 frystyk 4161: ;; 4162: 1.11 kahan 4163: prog) 4164: case $host in 1.12 vbancrof 4165: *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; 1.11 kahan 4166: esac 1.2 frystyk 4167: if test -n "$vinfo"; then 1.4 frystyk 4168: $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 1.1 frystyk 4169: fi 4170: 1.2 frystyk 4171: if test -n "$release"; then 1.4 frystyk 4172: $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 1.1 frystyk 4173: fi 4174: 1.5 frystyk 4175: if test "$preload" = yes; then 1.11 kahan 4176: if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && 1.5 frystyk 4177: test "$dlopen_self_static" = unknown; then 4178: $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." 1.11 kahan 4179: fi 1.5 frystyk 4180: fi 1.11 kahan 4181: 4182: case $host in 4183: *-*-rhapsody* | *-*-darwin1.[012]) 4184: # On Rhapsody replace the C library is the System framework 4185: compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4186: finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` 4187: ;; 4188: esac 4189: 1.12 vbancrof 4190: case $host in 4191: *darwin*) 4192: # Don't allow lazy linking, it breaks C++ global constructors 4193: if test "$tagname" = CXX ; then 4194: compile_command="$compile_command ${wl}-bind_at_load" 4195: finalize_command="$finalize_command ${wl}-bind_at_load" 4196: fi 4197: ;; 4198: esac 4199: 1.11 kahan 4200: compile_command="$compile_command $compile_deplibs" 4201: finalize_command="$finalize_command $finalize_deplibs" 4202: 1.4 frystyk 4203: if test -n "$rpath$xrpath"; then 1.2 frystyk 4204: # If the user specified any rpath flags, then add them. 1.4 frystyk 4205: for libdir in $rpath $xrpath; do 1.5 frystyk 4206: # This is the magic to use -rpath. 4207: case "$finalize_rpath " in 4208: *" $libdir "*) ;; 4209: *) finalize_rpath="$finalize_rpath $libdir" ;; 4210: esac 4211: done 4212: fi 1.4 frystyk 4213: 1.5 frystyk 4214: # Now hardcode the library paths 4215: rpath= 4216: hardcode_libdirs= 4217: for libdir in $compile_rpath $finalize_rpath; do 4218: if test -n "$hardcode_libdir_flag_spec"; then 4219: if test -n "$hardcode_libdir_separator"; then 4220: if test -z "$hardcode_libdirs"; then 4221: hardcode_libdirs="$libdir" 4222: else 4223: # Just accumulate the unique libdirs. 1.11 kahan 4224: case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 1.5 frystyk 4225: *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4226: ;; 4227: *) 4228: hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4229: ;; 4230: esac 1.4 frystyk 4231: fi 1.5 frystyk 4232: else 4233: eval flag=\"$hardcode_libdir_flag_spec\" 4234: rpath="$rpath $flag" 4235: fi 4236: elif test -n "$runpath_var"; then 4237: case "$perm_rpath " in 4238: *" $libdir "*) ;; 4239: *) perm_rpath="$perm_rpath $libdir" ;; 4240: esac 4241: fi 1.11 kahan 4242: case $host in 4243: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) 4244: case :$dllsearchpath: in 4245: *":$libdir:"*) ;; 4246: *) dllsearchpath="$dllsearchpath:$libdir";; 4247: esac 4248: ;; 4249: esac 1.5 frystyk 4250: done 4251: # Substitute the hardcoded libdirs into the rpath. 4252: if test -n "$hardcode_libdir_separator" && 4253: test -n "$hardcode_libdirs"; then 4254: libdir="$hardcode_libdirs" 4255: eval rpath=\" $hardcode_libdir_flag_spec\" 4256: fi 4257: compile_rpath="$rpath" 4258: 4259: rpath= 4260: hardcode_libdirs= 4261: for libdir in $finalize_rpath; do 4262: if test -n "$hardcode_libdir_flag_spec"; then 4263: if test -n "$hardcode_libdir_separator"; then 4264: if test -z "$hardcode_libdirs"; then 4265: hardcode_libdirs="$libdir" 4266: else 4267: # Just accumulate the unique libdirs. 1.11 kahan 4268: case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in 1.5 frystyk 4269: *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 4270: ;; 4271: *) 4272: hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 4273: ;; 4274: esac 1.4 frystyk 4275: fi 1.5 frystyk 4276: else 4277: eval flag=\"$hardcode_libdir_flag_spec\" 4278: rpath="$rpath $flag" 1.4 frystyk 4279: fi 1.5 frystyk 4280: elif test -n "$runpath_var"; then 4281: case "$finalize_perm_rpath " in 4282: *" $libdir "*) ;; 4283: *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; 4284: esac 4285: fi 4286: done 4287: # Substitute the hardcoded libdirs into the rpath. 4288: if test -n "$hardcode_libdir_separator" && 4289: test -n "$hardcode_libdirs"; then 4290: libdir="$hardcode_libdirs" 4291: eval rpath=\" $hardcode_libdir_flag_spec\" 1.4 frystyk 4292: fi 1.5 frystyk 4293: finalize_rpath="$rpath" 1.4 frystyk 4294: 1.2 frystyk 4295: if test -n "$libobjs" && test "$build_old_libs" = yes; then 1.4 frystyk 4296: # Transform all the library objects into standard objects. 4297: compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 4298: finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 1.2 frystyk 4299: fi 4300: 1.5 frystyk 4301: dlsyms= 1.7 frystyk 4302: if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 1.5 frystyk 4303: if test -n "$NM" && test -n "$global_symbol_pipe"; then 4304: dlsyms="${outputname}S.c" 4305: else 4306: $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 4307: fi 1.2 frystyk 4308: fi 4309: 4310: if test -n "$dlsyms"; then 1.11 kahan 4311: case $dlsyms in 1.4 frystyk 4312: "") ;; 4313: *.c) 4314: # Discover the nlist of each of the dlfiles. 1.5 frystyk 4315: nlist="$output_objdir/${outputname}.nm" 1.1 frystyk 4316: 1.5 frystyk 4317: $show "$rm $nlist ${nlist}S ${nlist}T" 4318: $run $rm "$nlist" "${nlist}S" "${nlist}T" 1.2 frystyk 4319: 1.4 frystyk 4320: # Parse the name list into a source file. 1.5 frystyk 4321: $show "creating $output_objdir/$dlsyms" 1.2 frystyk 4322: 1.5 frystyk 4323: test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ 1.4 frystyk 4324: /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ 4325: /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ 1.2 frystyk 4326: 4327: #ifdef __cplusplus 4328: extern \"C\" { 4329: #endif 4330: 4331: /* Prevent the only kind of declaration conflicts we can make. */ 1.4 frystyk 4332: #define lt_preloaded_symbols some_other_symbol 1.2 frystyk 4333: 1.3 frystyk 4334: /* External symbol declarations for the compiler. */\ 4335: " 1.2 frystyk 4336: 1.5 frystyk 4337: if test "$dlself" = yes; then 4338: $show "generating symbol list for \`$output'" 4339: 4340: test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" 4341: 4342: # Add our own program objects to the symbol list. 1.11 kahan 4343: progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 1.5 frystyk 4344: for arg in $progfiles; do 4345: $show "extracting global C symbols from \`$arg'" 4346: $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4347: done 4348: 4349: if test -n "$exclude_expsyms"; then 1.12 vbancrof 4350: $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 1.5 frystyk 4351: $run eval '$mv "$nlist"T "$nlist"' 4352: fi 1.11 kahan 4353: 1.5 frystyk 4354: if test -n "$export_symbols_regex"; then 1.12 vbancrof 4355: $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 1.5 frystyk 4356: $run eval '$mv "$nlist"T "$nlist"' 4357: fi 4358: 4359: # Prepare the list of exported symbols 4360: if test -z "$export_symbols"; then 1.13 ! vbancrof 4361: export_symbols="$output_objdir/$outputname.exp" 1.5 frystyk 4362: $run $rm $export_symbols 1.12 vbancrof 4363: $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 1.5 frystyk 4364: else 1.13 ! vbancrof 4365: $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' ! 4366: $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 1.5 frystyk 4367: $run eval 'mv "$nlist"T "$nlist"' 4368: fi 1.4 frystyk 4369: fi 4370: 4371: for arg in $dlprefiles; do 4372: $show "extracting global C symbols from \`$arg'" 1.12 vbancrof 4373: name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` 4374: $run eval '$echo ": $name " >> "$nlist"' 1.4 frystyk 4375: $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" 4376: done 4377: 4378: if test -z "$run"; then 4379: # Make sure we have at least an empty file. 4380: test -f "$nlist" || : > "$nlist" 4381: 1.5 frystyk 4382: if test -n "$exclude_expsyms"; then 1.12 vbancrof 4383: $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T 1.5 frystyk 4384: $mv "$nlist"T "$nlist" 4385: fi 4386: 1.4 frystyk 4387: # Try sorting and uniquifying the output. 1.12 vbancrof 4388: if grep -v "^: " < "$nlist" | 4389: if sort -k 3 </dev/null >/dev/null 2>&1; then 4390: sort -k 3 4391: else 4392: sort +2 4393: fi | 4394: uniq > "$nlist"S; then 1.5 frystyk 4395: : 1.4 frystyk 4396: else 1.5 frystyk 4397: grep -v "^: " < "$nlist" > "$nlist"S 1.4 frystyk 4398: fi 4399: 1.5 frystyk 4400: if test -f "$nlist"S; then 4401: eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' 1.2 frystyk 4402: else 1.12 vbancrof 4403: $echo '/* NONE */' >> "$output_objdir/$dlsyms" 1.2 frystyk 4404: fi 4405: 1.4 frystyk 4406: $echo >> "$output_objdir/$dlsyms" "\ 1.3 frystyk 4407: 1.4 frystyk 4408: #undef lt_preloaded_symbols 1.2 frystyk 4409: 4410: #if defined (__STDC__) && __STDC__ 1.11 kahan 4411: # define lt_ptr void * 1.2 frystyk 4412: #else 1.11 kahan 4413: # define lt_ptr char * 1.4 frystyk 4414: # define const 1.2 frystyk 4415: #endif 4416: 4417: /* The mapping between symbol names and symbols. */ 1.13 ! vbancrof 4418: " ! 4419: ! 4420: case $host in ! 4421: *cygwin* | *mingw* ) ! 4422: $echo >> "$output_objdir/$dlsyms" "\ ! 4423: /* DATA imports from DLLs on WIN32 can't be const, because ! 4424: runtime relocations are performed -- see ld's documentation ! 4425: on pseudo-relocs */ ! 4426: struct { ! 4427: " ! 4428: ;; ! 4429: * ) ! 4430: $echo >> "$output_objdir/$dlsyms" "\ 1.4 frystyk 4431: const struct { 1.13 ! vbancrof 4432: " ! 4433: ;; ! 4434: esac ! 4435: ! 4436: ! 4437: $echo >> "$output_objdir/$dlsyms" "\ 1.4 frystyk 4438: const char *name; 1.11 kahan 4439: lt_ptr address; 1.2 frystyk 4440: } 1.4 frystyk 4441: lt_preloaded_symbols[] = 1.3 frystyk 4442: {\ 4443: " 1.2 frystyk 4444: 1.11 kahan 4445: eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" 1.4 frystyk 4446: 4447: $echo >> "$output_objdir/$dlsyms" "\ 1.11 kahan 4448: {0, (lt_ptr) 0} 1.2 frystyk 4449: }; 4450: 1.4 frystyk 4451: /* This works around a problem in FreeBSD linker */ 1.5 frystyk 4452: #ifdef FREEBSD_WORKAROUND 1.4 frystyk 4453: static const void *lt_preloaded_setup() { 4454: return lt_preloaded_symbols; 4455: } 1.5 frystyk 4456: #endif 1.4 frystyk 4457: 1.2 frystyk 4458: #ifdef __cplusplus 4459: } 1.3 frystyk 4460: #endif\ 4461: " 1.4 frystyk 4462: fi 1.2 frystyk 4463: 1.5 frystyk 4464: pic_flag_for_symtable= 1.11 kahan 4465: case $host in 1.5 frystyk 4466: # compiling the symbol table file with pic_flag works around 4467: # a FreeBSD bug that causes programs to crash when -lm is 4468: # linked before any other PIC object. But we must not use 4469: # pic_flag when linking with -static. The problem exists in 4470: # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 1.11 kahan 4471: *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 1.5 frystyk 4472: case "$compile_command " in 4473: *" -static "*) ;; 1.12 vbancrof 4474: *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; 1.11 kahan 4475: esac;; 4476: *-*-hpux*) 4477: case "$compile_command " in 4478: *" -static "*) ;; 1.12 vbancrof 4479: *) pic_flag_for_symtable=" $pic_flag";; 1.5 frystyk 4480: esac 4481: esac 4482: 1.4 frystyk 4483: # Now compile the dynamic symbol file. 1.12 vbancrof 4484: $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" 4485: $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? 1.5 frystyk 4486: 4487: # Clean up the generated files. 4488: $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" 4489: $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" 1.4 frystyk 4490: 4491: # Transform the symbol file into the correct name. 1.5 frystyk 4492: compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 4493: finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` 1.4 frystyk 4494: ;; 4495: *) 4496: $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 1.12 vbancrof 4497: exit $EXIT_FAILURE 1.4 frystyk 4498: ;; 4499: esac 4500: else 4501: # We keep going just in case the user didn't refer to 4502: # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 4503: # really was required. 1.2 frystyk 4504: 1.4 frystyk 4505: # Nullify the symbol file. 4506: compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` 4507: finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` 1.2 frystyk 4508: fi 4509: 1.12 vbancrof 4510: if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 1.4 frystyk 4511: # Replace the output file specification. 4512: compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 1.5 frystyk 4513: link_command="$compile_command$compile_rpath" 1.4 frystyk 4514: 4515: # We have no uninstalled library dependencies, so finalize right now. 1.5 frystyk 4516: $show "$link_command" 4517: $run eval "$link_command" 1.2 frystyk 4518: status=$? 1.11 kahan 4519: 1.5 frystyk 4520: # Delete the generated files. 4521: if test -n "$dlsyms"; then 4522: $show "$rm $output_objdir/${outputname}S.${objext}" 4523: $run $rm "$output_objdir/${outputname}S.${objext}" 1.2 frystyk 4524: fi 1.5 frystyk 4525: 4526: exit $status 1.1 frystyk 4527: fi 4528: 4529: if test -n "$shlibpath_var"; then 1.4 frystyk 4530: # We should set the shlibpath_var 4531: rpath= 4532: for dir in $temp_rpath; do 1.11 kahan 4533: case $dir in 1.5 frystyk 4534: [\\/]* | [A-Za-z]:[\\/]*) 1.4 frystyk 4535: # Absolute path. 4536: rpath="$rpath$dir:" 4537: ;; 4538: *) 4539: # Relative path: add a thisdir entry. 4540: rpath="$rpath\$thisdir/$dir:" 4541: ;; 4542: esac 4543: done 4544: temp_rpath="$rpath" 1.1 frystyk 4545: fi 4546: 1.5 frystyk 4547: if test -n "$compile_shlibpath$finalize_shlibpath"; then 4548: compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" 1.1 frystyk 4549: fi 4550: if test -n "$finalize_shlibpath"; then 1.4 frystyk 4551: finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 1.1 frystyk 4552: fi 4553: 1.5 frystyk 4554: compile_var= 4555: finalize_var= 1.4 frystyk 4556: if test -n "$runpath_var"; then 1.5 frystyk 4557: if test -n "$perm_rpath"; then 1.4 frystyk 4558: # We should set the runpath_var. 4559: rpath= 4560: for dir in $perm_rpath; do 4561: rpath="$rpath$dir:" 4562: done 1.5 frystyk 4563: compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 1.4 frystyk 4564: fi 1.5 frystyk 4565: if test -n "$finalize_perm_rpath"; then 1.4 frystyk 4566: # We should set the runpath_var. 4567: rpath= 4568: for dir in $finalize_perm_rpath; do 4569: rpath="$rpath$dir:" 4570: done 1.5 frystyk 4571: finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 1.4 frystyk 4572: fi 1.1 frystyk 4573: fi 4574: 1.11 kahan 4575: if test "$no_install" = yes; then 4576: # We don't need to create a wrapper script. 4577: link_command="$compile_var$compile_command$compile_rpath" 4578: # Replace the output file specification. 4579: link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 4580: # Delete the old output file. 4581: $run $rm $output 4582: # Link the executable and exit 4583: $show "$link_command" 4584: $run eval "$link_command" || exit $? 1.12 vbancrof 4585: exit $EXIT_SUCCESS 1.11 kahan 4586: fi 4587: 1.3 frystyk 4588: if test "$hardcode_action" = relink; then 1.5 frystyk 4589: # Fast installation is not supported 4590: link_command="$compile_var$compile_command$compile_rpath" 4591: relink_command="$finalize_var$finalize_command$finalize_rpath" 1.11 kahan 4592: 1.4 frystyk 4593: $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 4594: $echo "$modename: \`$output' will be relinked during installation" 1>&2 1.5 frystyk 4595: else 4596: if test "$fast_install" != no; then 4597: link_command="$finalize_var$compile_command$finalize_rpath" 4598: if test "$fast_install" = yes; then 4599: relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` 4600: else 4601: # fast_install is set to needless 4602: relink_command= 4603: fi 4604: else 4605: link_command="$compile_var$compile_command$compile_rpath" 4606: relink_command="$finalize_var$finalize_command$finalize_rpath" 4607: fi 1.3 frystyk 4608: fi 1.1 frystyk 4609: 1.5 frystyk 4610: # Replace the output file specification. 4611: link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 1.11 kahan 4612: 1.5 frystyk 4613: # Delete the old output files. 4614: $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname 4615: 4616: $show "$link_command" 4617: $run eval "$link_command" || exit $? 1.1 frystyk 4618: 4619: # Now create the wrapper script. 1.2 frystyk 4620: $show "creating $output" 4621: 1.5 frystyk 4622: # Quote the relink command for shipping. 4623: if test -n "$relink_command"; then 1.11 kahan 4624: # Preserve any variables that may affect compiler behavior 4625: for var in $variables_saved_for_relink; do 4626: if eval test -z \"\${$var+set}\"; then 4627: relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 4628: elif eval var_value=\$$var; test -z "$var_value"; then 4629: relink_command="$var=; export $var; $relink_command" 4630: else 4631: var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 4632: relink_command="$var=\"$var_value\"; export $var; $relink_command" 4633: fi 4634: done 4635: relink_command="(cd `pwd`; $relink_command)" 1.5 frystyk 4636: relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 4637: fi 1.2 frystyk 4638: 4639: # Quote $echo for shipping. 1.12 vbancrof 4640: if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then 4641: case $progpath in 4642: [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; 4643: *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; 1.4 frystyk 4644: esac 4645: qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` 4646: else 4647: qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` 4648: fi 1.1 frystyk 4649: 4650: # Only actually do things if our run command is non-null. 4651: if test -z "$run"; then 1.4 frystyk 4652: # win32 will think the script is a binary if it has 4653: # a .exe suffix, so we strip it off here. 4654: case $output in 1.12 vbancrof 4655: *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; 1.4 frystyk 4656: esac 1.11 kahan 4657: # test for cygwin because mv fails w/o .exe extensions 4658: case $host in 1.12 vbancrof 4659: *cygwin*) 4660: exeext=.exe 4661: outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; 1.11 kahan 4662: *) exeext= ;; 4663: esac 1.12 vbancrof 4664: case $host in 4665: *cygwin* | *mingw* ) 1.13 ! vbancrof 4666: cwrappersource=`$echo ${objdir}/lt-${outputname}.c` 1.12 vbancrof 4667: cwrapper=`$echo ${output}.exe` 4668: $rm $cwrappersource $cwrapper 4669: trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 4670: 4671: cat > $cwrappersource <<EOF 4672: 4673: /* $cwrappersource - temporary wrapper executable for $objdir/$outputname 4674: Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 4675: 4676: The $output program cannot be directly executed until all the libtool 4677: libraries that it depends on are installed. 4678: 4679: This wrapper executable should never be moved out of the build directory. 4680: If it is, it will not operate correctly. 4681: 4682: Currently, it simply execs the wrapper *script* "/bin/sh $output", 4683: but could eventually absorb all of the scripts functionality and 4684: exec $objdir/$outputname directly. 4685: */ 4686: EOF 4687: cat >> $cwrappersource<<"EOF" 4688: #include <stdio.h> 4689: #include <stdlib.h> 4690: #include <unistd.h> 4691: #include <malloc.h> 4692: #include <stdarg.h> 4693: #include <assert.h> 4694: 4695: #if defined(PATH_MAX) 4696: # define LT_PATHMAX PATH_MAX 4697: #elif defined(MAXPATHLEN) 4698: # define LT_PATHMAX MAXPATHLEN 4699: #else 4700: # define LT_PATHMAX 1024 4701: #endif 4702: 4703: #ifndef DIR_SEPARATOR 4704: #define DIR_SEPARATOR '/' 4705: #endif 4706: 4707: #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 4708: defined (__OS2__) 4709: #define HAVE_DOS_BASED_FILE_SYSTEM 4710: #ifndef DIR_SEPARATOR_2 4711: #define DIR_SEPARATOR_2 '\\' 4712: #endif 4713: #endif 4714: 4715: #ifndef DIR_SEPARATOR_2 4716: # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) 4717: #else /* DIR_SEPARATOR_2 */ 4718: # define IS_DIR_SEPARATOR(ch) \ 4719: (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) 4720: #endif /* DIR_SEPARATOR_2 */ 4721: 4722: #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 4723: #define XFREE(stale) do { \ 4724: if (stale) { free ((void *) stale); stale = 0; } \ 4725: } while (0) 4726: 4727: const char *program_name = NULL; 4728: 4729: void * xmalloc (size_t num); 4730: char * xstrdup (const char *string); 4731: char * basename (const char *name); 4732: char * fnqualify(const char *path); 4733: char * strendzap(char *str, const char *pat); 4734: void lt_fatal (const char *message, ...); 4735: 4736: int 4737: main (int argc, char *argv[]) 4738: { 4739: char **newargz; 4740: int i; 4741: 4742: program_name = (char *) xstrdup ((char *) basename (argv[0])); 4743: newargz = XMALLOC(char *, argc+2); 4744: EOF 4745: 4746: cat >> $cwrappersource <<EOF 4747: newargz[0] = "$SHELL"; 4748: EOF 4749: 4750: cat >> $cwrappersource <<"EOF" 4751: newargz[1] = fnqualify(argv[0]); 4752: /* we know the script has the same name, without the .exe */ 4753: /* so make sure newargz[1] doesn't end in .exe */ 4754: strendzap(newargz[1],".exe"); 4755: for (i = 1; i < argc; i++) 4756: newargz[i+1] = xstrdup(argv[i]); 4757: newargz[argc+1] = NULL; 4758: EOF 4759: 4760: cat >> $cwrappersource <<EOF 4761: execv("$SHELL",newargz); 4762: EOF 4763: 4764: cat >> $cwrappersource <<"EOF" 4765: } 4766: 4767: void * 4768: xmalloc (size_t num) 4769: { 4770: void * p = (void *) malloc (num); 4771: if (!p) 4772: lt_fatal ("Memory exhausted"); 4773: 4774: return p; 4775: } 4776: 4777: char * 4778: xstrdup (const char *string) 4779: { 4780: return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL 4781: ; 4782: } 4783: 4784: char * 4785: basename (const char *name) 4786: { 4787: const char *base; 4788: 4789: #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 4790: /* Skip over the disk name in MSDOS pathnames. */ 4791: if (isalpha (name[0]) && name[1] == ':') 4792: name += 2; 4793: #endif 4794: 4795: for (base = name; *name; name++) 4796: if (IS_DIR_SEPARATOR (*name)) 4797: base = name + 1; 4798: return (char *) base; 4799: } 4800: 4801: char * 4802: fnqualify(const char *path) 4803: { 4804: size_t size; 4805: char *p; 4806: char tmp[LT_PATHMAX + 1]; 4807: 4808: assert(path != NULL); 4809: 4810: /* Is it qualified already? */ 4811: #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 4812: if (isalpha (path[0]) && path[1] == ':') 4813: return xstrdup (path); 4814: #endif 4815: if (IS_DIR_SEPARATOR (path[0])) 4816: return xstrdup (path); 4817: 4818: /* prepend the current directory */ 4819: /* doesn't handle '~' */ 4820: if (getcwd (tmp, LT_PATHMAX) == NULL) 4821: lt_fatal ("getcwd failed"); 4822: size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ 4823: p = XMALLOC(char, size); 4824: sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); 4825: return p; 4826: } 4827: 4828: char * 4829: strendzap(char *str, const char *pat) 4830: { 4831: size_t len, patlen; 4832: 4833: assert(str != NULL); 4834: assert(pat != NULL); 4835: 4836: len = strlen(str); 4837: patlen = strlen(pat); 4838: 4839: if (patlen <= len) 4840: { 4841: str += len - patlen; 4842: if (strcmp(str, pat) == 0) 4843: *str = '\0'; 4844: } 4845: return str; 4846: } 4847: 4848: static void 4849: lt_error_core (int exit_status, const char * mode, 4850: const char * message, va_list ap) 4851: { 4852: fprintf (stderr, "%s: %s: ", program_name, mode); 4853: vfprintf (stderr, message, ap); 4854: fprintf (stderr, ".\n"); 4855: 4856: if (exit_status >= 0) 4857: exit (exit_status); 4858: } 4859: 4860: void 4861: lt_fatal (const char *message, ...) 4862: { 4863: va_list ap; 4864: va_start (ap, message); 4865: lt_error_core (EXIT_FAILURE, "FATAL", message, ap); 4866: va_end (ap); 4867: } 4868: EOF 4869: # we should really use a build-platform specific compiler 4870: # here, but OTOH, the wrappers (shell script and this C one) 4871: # are only useful if you want to execute the "real" binary. 4872: # Since the "real" binary is built for $host, then this 4873: # wrapper might as well be built for $host, too. 4874: $run $LTCC -s -o $cwrapper $cwrappersource 4875: ;; 4876: esac 1.4 frystyk 4877: $rm $output 1.12 vbancrof 4878: trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 1.1 frystyk 4879: 1.4 frystyk 4880: $echo > $output "\ 1.3 frystyk 4881: #! $SHELL 1.1 frystyk 4882: 1.4 frystyk 4883: # $output - temporary wrapper script for $objdir/$outputname 4884: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 1.1 frystyk 4885: # 4886: # The $output program cannot be directly executed until all the libtool 4887: # libraries that it depends on are installed. 4888: # 1.4 frystyk 4889: # This wrapper script should never be moved out of the build directory. 1.1 frystyk 4890: # If it is, it will not operate correctly. 4891: 1.2 frystyk 4892: # Sed substitution that helps us do robust quoting. It backslashifies 4893: # metacharacters that are still active within double-quoted strings. 1.12 vbancrof 4894: Xsed='${SED} -e 1s/^X//' 1.2 frystyk 4895: sed_quote_subst='$sed_quote_subst' 4896: 4897: # The HP-UX ksh and POSIX shell print the target directory to stdout 4898: # if CDPATH is set. 1.13 ! vbancrof 4899: (unset CDPATH) >/dev/null 2>&1 && unset CDPATH 1.2 frystyk 4900: 1.5 frystyk 4901: relink_command=\"$relink_command\" 4902: 1.1 frystyk 4903: # This environment variable determines our operation mode. 1.2 frystyk 4904: if test \"\$libtool_install_magic\" = \"$magic\"; then 1.5 frystyk 4905: # install mode needs the following variable: 1.11 kahan 4906: notinst_deplibs='$notinst_deplibs' 1.1 frystyk 4907: else 1.2 frystyk 4908: # When we are sourced in execute mode, \$file and \$echo are already set. 1.3 frystyk 4909: if test \"\$libtool_execute_magic\" != \"$magic\"; then 1.2 frystyk 4910: echo=\"$qecho\" 4911: file=\"\$0\" 1.3 frystyk 4912: # Make sure echo works. 4913: if test \"X\$1\" = X--no-reexec; then 4914: # Discard the --no-reexec flag, and continue. 4915: shift 4916: elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then 4917: # Yippee, \$echo works! 4918: : 4919: else 4920: # Restart under the correct shell, and then maybe \$echo will work. 4921: exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} 4922: fi 4923: fi\ 4924: " 1.4 frystyk 4925: $echo >> $output "\ 1.2 frystyk 4926: 1.1 frystyk 4927: # Find the directory that this script lives in. 1.2 frystyk 4928: thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` 4929: test \"x\$thisdir\" = \"x\$file\" && thisdir=. 1.1 frystyk 4930: 1.2 frystyk 4931: # Follow symbolic links until we get to the real thisdir. 1.12 vbancrof 4932: file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` 1.2 frystyk 4933: while test -n \"\$file\"; do 4934: destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` 4935: 4936: # If there was a directory component, then change thisdir. 4937: if test \"x\$destdir\" != \"x\$file\"; then 4938: case \"\$destdir\" in 1.11 kahan 4939: [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; 1.2 frystyk 4940: *) thisdir=\"\$thisdir/\$destdir\" ;; 4941: esac 4942: fi 1.1 frystyk 4943: 1.2 frystyk 4944: file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` 1.12 vbancrof 4945: file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` 1.2 frystyk 4946: done 1.1 frystyk 4947: 1.2 frystyk 4948: # Try to get the absolute directory name. 4949: absdir=\`cd \"\$thisdir\" && pwd\` 4950: test -n \"\$absdir\" && thisdir=\"\$absdir\" 1.5 frystyk 4951: " 1.1 frystyk 4952: 1.5 frystyk 4953: if test "$fast_install" = yes; then 1.12 vbancrof 4954: $echo >> $output "\ 1.11 kahan 4955: program=lt-'$outputname'$exeext 1.2 frystyk 4956: progdir=\"\$thisdir/$objdir\" 1.11 kahan 4957: 1.5 frystyk 4958: if test ! -f \"\$progdir/\$program\" || \\ 1.12 vbancrof 4959: { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ 1.5 frystyk 4960: test \"X\$file\" != \"X\$progdir/\$program\"; }; then 4961: 4962: file=\"\$\$-\$program\" 4963: 4964: if test ! -d \"\$progdir\"; then 4965: $mkdir \"\$progdir\" 4966: else 4967: $rm \"\$progdir/\$file\" 4968: fi" 4969: 1.12 vbancrof 4970: $echo >> $output "\ 1.5 frystyk 4971: 4972: # relink executable if necessary 4973: if test -n \"\$relink_command\"; then 1.11 kahan 4974: if relink_command_output=\`eval \$relink_command 2>&1\`; then : 1.5 frystyk 4975: else 1.11 kahan 4976: $echo \"\$relink_command_output\" >&2 1.5 frystyk 4977: $rm \"\$progdir/\$file\" 1.12 vbancrof 4978: exit $EXIT_FAILURE 1.5 frystyk 4979: fi 4980: fi 4981: 4982: $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 4983: { $rm \"\$progdir/\$program\"; 4984: $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } 4985: $rm \"\$progdir/\$file\" 4986: fi" 4987: else 1.12 vbancrof 4988: $echo >> $output "\ 1.11 kahan 4989: program='$outputname' 1.5 frystyk 4990: progdir=\"\$thisdir/$objdir\" 4991: " 4992: fi 4993: 1.12 vbancrof 4994: $echo >> $output "\ 1.1 frystyk 4995: 1.2 frystyk 4996: if test -f \"\$progdir/\$program\"; then" 1.1 frystyk 4997: 1.4 frystyk 4998: # Export our shlibpath_var if we have one. 1.5 frystyk 4999: if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 1.4 frystyk 5000: $echo >> $output "\ 1.3 frystyk 5001: # Add our own library path to $shlibpath_var 1.2 frystyk 5002: $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 1.1 frystyk 5003: 5004: # Some systems cannot cope with colon-terminated $shlibpath_var 1.4 frystyk 5005: # The second colon is a workaround for a bug in BeOS R4 sed 5006: $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` 1.1 frystyk 5007: 5008: export $shlibpath_var 1.2 frystyk 5009: " 1.4 frystyk 5010: fi 5011: 5012: # fixup the dll searchpath if we need to. 5013: if test -n "$dllsearchpath"; then 5014: $echo >> $output "\ 5015: # Add the dll search path components to the executable PATH 5016: PATH=$dllsearchpath:\$PATH 5017: " 5018: fi 1.2 frystyk 5019: 1.4 frystyk 5020: $echo >> $output "\ 1.3 frystyk 5021: if test \"\$libtool_execute_magic\" != \"$magic\"; then 1.2 frystyk 5022: # Run the actual program with our arguments. 1.4 frystyk 5023: " 5024: case $host in 1.11 kahan 5025: # Backslashes separate directories on plain windows 5026: *-*-mingw | *-*-os2*) 1.4 frystyk 5027: $echo >> $output "\ 5028: exec \$progdir\\\\\$program \${1+\"\$@\"} 5029: " 5030: ;; 1.11 kahan 5031: 1.4 frystyk 5032: *) 5033: $echo >> $output "\ 1.12 vbancrof 5034: exec \$progdir/\$program \${1+\"\$@\"} 1.4 frystyk 5035: " 5036: ;; 5037: esac 5038: $echo >> $output "\ 1.3 frystyk 5039: \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" 1.12 vbancrof 5040: exit $EXIT_FAILURE 1.2 frystyk 5041: fi 1.1 frystyk 5042: else 5043: # The program doesn't exist. 1.2 frystyk 5044: \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 5045: \$echo \"This script is just a wrapper for \$program.\" 1>&2 1.12 vbancrof 5046: $echo \"See the $PACKAGE documentation for more information.\" 1>&2 5047: exit $EXIT_FAILURE 1.1 frystyk 5048: fi 1.3 frystyk 5049: fi\ 5050: " 1.4 frystyk 5051: chmod +x $output 1.1 frystyk 5052: fi 1.12 vbancrof 5053: exit $EXIT_SUCCESS 1.1 frystyk 5054: ;; 5055: esac 5056: 5057: # See if we need to build an old-fashioned archive. 1.3 frystyk 5058: for oldlib in $oldlibs; do 5059: 5060: if test "$build_libtool_libs" = convenience; then 1.4 frystyk 5061: oldobjs="$libobjs_save" 1.3 frystyk 5062: addlibs="$convenience" 5063: build_libtool_libs=no 5064: else 1.4 frystyk 5065: if test "$build_libtool_libs" = module; then 5066: oldobjs="$libobjs_save" 5067: build_libtool_libs=no 5068: else 1.12 vbancrof 5069: oldobjs="$old_deplibs $non_pic_objects" 1.4 frystyk 5070: fi 1.3 frystyk 5071: addlibs="$old_convenience" 5072: fi 5073: 1.5 frystyk 5074: if test -n "$addlibs"; then 5075: gentop="$output_objdir/${outputname}x" 5076: generated="$generated $gentop" 1.11 kahan 5077: 1.13 ! vbancrof 5078: func_extract_archives $gentop $addlibs ! 5079: oldobjs="$oldobjs $func_extract_archives_result" 1.5 frystyk 5080: fi 1.1 frystyk 5081: 1.2 frystyk 5082: # Do each command in the archive commands. 5083: if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 1.12 vbancrof 5084: cmds=$old_archive_from_new_cmds 1.1 frystyk 5085: else 1.13 ! vbancrof 5086: # POSIX demands no paths to be encoded in archives. We have ! 5087: # to avoid creating archives with duplicate basenames if we ! 5088: # might have to extract them afterwards, e.g., when creating a ! 5089: # static archive out of a convenience library, or when linking ! 5090: # the entirety of a libtool archive into another (currently ! 5091: # not supported by libtool). ! 5092: if (for obj in $oldobjs ! 5093: do ! 5094: $echo "X$obj" | $Xsed -e 's%^.*/%%' ! 5095: done | sort | sort -uc >/dev/null 2>&1); then ! 5096: : ! 5097: else ! 5098: $echo "copying selected object files to avoid basename conflicts..." ! 5099: ! 5100: if test -z "$gentop"; then ! 5101: gentop="$output_objdir/${outputname}x" ! 5102: generated="$generated $gentop" ! 5103: ! 5104: $show "${rm}r $gentop" ! 5105: $run ${rm}r "$gentop" ! 5106: $show "$mkdir $gentop" ! 5107: $run $mkdir "$gentop" ! 5108: status=$? ! 5109: if test "$status" -ne 0 && test ! -d "$gentop"; then ! 5110: exit $status ! 5111: fi ! 5112: fi ! 5113: ! 5114: save_oldobjs=$oldobjs ! 5115: oldobjs= ! 5116: counter=1 ! 5117: for obj in $save_oldobjs ! 5118: do ! 5119: objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` ! 5120: case " $oldobjs " in ! 5121: " ") oldobjs=$obj ;; ! 5122: *[\ /]"$objbase "*) ! 5123: while :; do ! 5124: # Make sure we don't pick an alternate name that also ! 5125: # overlaps. ! 5126: newobj=lt$counter-$objbase ! 5127: counter=`expr $counter + 1` ! 5128: case " $oldobjs " in ! 5129: *[\ /]"$newobj "*) ;; ! 5130: *) if test ! -f "$gentop/$newobj"; then break; fi ;; ! 5131: esac ! 5132: done ! 5133: $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" ! 5134: $run ln "$obj" "$gentop/$newobj" || ! 5135: $run cp "$obj" "$gentop/$newobj" ! 5136: oldobjs="$oldobjs $gentop/$newobj" ! 5137: ;; ! 5138: *) oldobjs="$oldobjs $obj" ;; ! 5139: esac ! 5140: done ! 5141: fi ! 5142: 1.12 vbancrof 5143: eval cmds=\"$old_archive_cmds\" 5144: 5145: if len=`expr "X$cmds" : ".*"` && 5146: test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then 5147: cmds=$old_archive_cmds 5148: else 5149: # the command line is too long to link in one step, link in parts 5150: $echo "using piecewise archive linking..." 5151: save_RANLIB=$RANLIB 5152: RANLIB=: 5153: objlist= 5154: concat_cmds= 5155: save_oldobjs=$oldobjs 1.13 ! vbancrof 5156: 1.12 vbancrof 5157: # Is there a better way of finding the last object in the list? 5158: for obj in $save_oldobjs 5159: do 5160: last_oldobj=$obj 5161: done 5162: for obj in $save_oldobjs 5163: do 5164: oldobjs="$objlist $obj" 5165: objlist="$objlist $obj" 5166: eval test_cmds=\"$old_archive_cmds\" 5167: if len=`expr "X$test_cmds" : ".*"` && 5168: test "$len" -le "$max_cmd_len"; then 5169: : 1.11 kahan 5170: else 1.12 vbancrof 5171: # the above command should be used before it gets too long 5172: oldobjs=$objlist 5173: if test "$obj" = "$last_oldobj" ; then 5174: RANLIB=$save_RANLIB 5175: fi 5176: test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 5177: eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 5178: objlist= 1.11 kahan 5179: fi 1.12 vbancrof 5180: done 5181: RANLIB=$save_RANLIB 5182: oldobjs=$objlist 5183: if test "X$oldobjs" = "X" ; then 5184: eval cmds=\"\$concat_cmds\" 5185: else 5186: eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 1.5 frystyk 5187: fi 1.12 vbancrof 5188: fi 1.1 frystyk 5189: fi 1.11 kahan 5190: save_ifs="$IFS"; IFS='~' 1.1 frystyk 5191: for cmd in $cmds; do 1.12 vbancrof 5192: eval cmd=\"$cmd\" 1.4 frystyk 5193: IFS="$save_ifs" 5194: $show "$cmd" 5195: $run eval "$cmd" || exit $? 1.1 frystyk 5196: done 5197: IFS="$save_ifs" 1.3 frystyk 5198: done 5199: 5200: if test -n "$generated"; then 5201: $show "${rm}r$generated" 5202: $run ${rm}r$generated 1.1 frystyk 5203: fi 5204: 5205: # Now create the libtool archive. 1.11 kahan 5206: case $output in 1.1 frystyk 5207: *.la) 5208: old_library= 1.4 frystyk 5209: test "$build_old_libs" = yes && old_library="$libname.$libext" 1.2 frystyk 5210: $show "creating $output" 1.1 frystyk 5211: 1.11 kahan 5212: # Preserve any variables that may affect compiler behavior 5213: for var in $variables_saved_for_relink; do 5214: if eval test -z \"\${$var+set}\"; then 5215: relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" 5216: elif eval var_value=\$$var; test -z "$var_value"; then 5217: relink_command="$var=; export $var; $relink_command" 5218: else 5219: var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` 5220: relink_command="$var=\"$var_value\"; export $var; $relink_command" 5221: fi 5222: done 5223: # Quote the link command for shipping. 1.12 vbancrof 5224: relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 1.11 kahan 5225: relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` 1.12 vbancrof 5226: if test "$hardcode_automatic" = yes ; then 5227: relink_command= 5228: fi 5229: 1.5 frystyk 5230: 1.1 frystyk 5231: # Only create the output if not a dry run. 5232: if test -z "$run"; then 1.5 frystyk 5233: for installed in no yes; do 5234: if test "$installed" = yes; then 5235: if test -z "$install_libdir"; then 5236: break 5237: fi 5238: output="$output_objdir/$outputname"i 1.11 kahan 5239: # Replace all uninstalled libtool libraries with the installed ones 5240: newdependency_libs= 5241: for deplib in $dependency_libs; do 5242: case $deplib in 5243: *.la) 5244: name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` 1.12 vbancrof 5245: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 1.11 kahan 5246: if test -z "$libdir"; then 5247: $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 1.12 vbancrof 5248: exit $EXIT_FAILURE 1.11 kahan 5249: fi 5250: newdependency_libs="$newdependency_libs $libdir/$name" 5251: ;; 5252: *) newdependency_libs="$newdependency_libs $deplib" ;; 5253: esac 5254: done 5255: dependency_libs="$newdependency_libs" 5256: newdlfiles= 5257: for lib in $dlfiles; do 5258: name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 1.12 vbancrof 5259: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 1.11 kahan 5260: if test -z "$libdir"; then 5261: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 1.12 vbancrof 5262: exit $EXIT_FAILURE 1.11 kahan 5263: fi 5264: newdlfiles="$newdlfiles $libdir/$name" 5265: done 5266: dlfiles="$newdlfiles" 5267: newdlprefiles= 5268: for lib in $dlprefiles; do 5269: name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` 1.12 vbancrof 5270: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 1.11 kahan 5271: if test -z "$libdir"; then 5272: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 1.12 vbancrof 5273: exit $EXIT_FAILURE 1.11 kahan 5274: fi 5275: newdlprefiles="$newdlprefiles $libdir/$name" 5276: done 5277: dlprefiles="$newdlprefiles" 1.12 vbancrof 5278: else 5279: newdlfiles= 5280: for lib in $dlfiles; do 5281: case $lib in 5282: [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 5283: *) abs=`pwd`"/$lib" ;; 5284: esac 5285: newdlfiles="$newdlfiles $abs" 5286: done 5287: dlfiles="$newdlfiles" 5288: newdlprefiles= 5289: for lib in $dlprefiles; do 5290: case $lib in 5291: [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 5292: *) abs=`pwd`"/$lib" ;; 5293: esac 5294: newdlprefiles="$newdlprefiles $abs" 5295: done 5296: dlprefiles="$newdlprefiles" 1.5 frystyk 5297: fi 5298: $rm $output 1.11 kahan 5299: # place dlname in correct position for cygwin 5300: tdlname=$dlname 5301: case $host,$output,$installed,$module,$dlname in 1.12 vbancrof 5302: *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 1.11 kahan 5303: esac 1.5 frystyk 5304: $echo > $output "\ 5305: # $outputname - a libtool library file 1.4 frystyk 5306: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP 1.5 frystyk 5307: # 5308: # Please DO NOT delete this file! 5309: # It is necessary for linking the library. 1.1 frystyk 5310: 5311: # The name that we can dlopen(3). 1.11 kahan 5312: dlname='$tdlname' 1.1 frystyk 5313: 5314: # Names of this library. 5315: library_names='$library_names' 5316: 5317: # The name of the static archive. 5318: old_library='$old_library' 5319: 1.2 frystyk 5320: # Libraries that this one depends upon. 5321: dependency_libs='$dependency_libs' 5322: 1.1 frystyk 5323: # Version information for $libname. 5324: current=$current 5325: age=$age 5326: revision=$revision 5327: 1.4 frystyk 5328: # Is this an already installed library? 1.5 frystyk 5329: installed=$installed 1.4 frystyk 5330: 1.12 vbancrof 5331: # Should we warn about portability when linking against -modules? 5332: shouldnotlink=$module 5333: 1.11 kahan 5334: # Files to dlopen/dlpreopen 5335: dlopen='$dlfiles' 5336: dlpreopen='$dlprefiles' 5337: 1.1 frystyk 5338: # Directory that this library needs to be installed in: 1.11 kahan 5339: libdir='$install_libdir'" 1.12 vbancrof 5340: if test "$installed" = no && test "$need_relink" = yes; then 1.11 kahan 5341: $echo >> $output "\ 5342: relink_command=\"$relink_command\"" 5343: fi 1.5 frystyk 5344: done 1.1 frystyk 5345: fi 5346: 5347: # Do a symbolic link so that the libtool archive can be found in 5348: # LD_LIBRARY_PATH before the program is installed. 1.4 frystyk 5349: $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" 1.11 kahan 5350: $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? 1.1 frystyk 5351: ;; 5352: esac 1.12 vbancrof 5353: exit $EXIT_SUCCESS 1.1 frystyk 5354: ;; 5355: 5356: # libtool install mode 5357: install) 1.2 frystyk 5358: modename="$modename: install" 5359: 1.3 frystyk 5360: # There may be an optional sh(1) argument at the beginning of 1.2 frystyk 5361: # install_prog (especially on Windows NT). 1.11 kahan 5362: if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 5363: # Allow the use of GNU shtool's install command. 5364: $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then 1.2 frystyk 5365: # Aesthetically quote it. 5366: arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` 1.11 kahan 5367: case $arg in 1.13 ! vbancrof 5368: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.2 frystyk 5369: arg="\"$arg\"" 5370: ;; 5371: esac 5372: install_prog="$arg " 5373: arg="$1" 5374: shift 5375: else 5376: install_prog= 5377: arg="$nonopt" 5378: fi 1.1 frystyk 5379: 1.2 frystyk 5380: # The real first argument should be the name of the installation program. 5381: # Aesthetically quote it. 5382: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1.11 kahan 5383: case $arg in 1.13 ! vbancrof 5384: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.2 frystyk 5385: arg="\"$arg\"" 5386: ;; 5387: esac 5388: install_prog="$install_prog$arg" 1.1 frystyk 5389: 5390: # We need to accept at least all the BSD install flags. 5391: dest= 5392: files= 5393: opts= 5394: prev= 5395: install_type= 1.3 frystyk 5396: isdir=no 1.1 frystyk 5397: stripme= 5398: for arg 5399: do 5400: if test -n "$dest"; then 1.4 frystyk 5401: files="$files $dest" 5402: dest="$arg" 5403: continue 1.1 frystyk 5404: fi 5405: 1.11 kahan 5406: case $arg in 1.1 frystyk 5407: -d) isdir=yes ;; 5408: -f) prev="-f" ;; 5409: -g) prev="-g" ;; 5410: -m) prev="-m" ;; 5411: -o) prev="-o" ;; 5412: -s) 1.4 frystyk 5413: stripme=" -s" 5414: continue 5415: ;; 1.1 frystyk 5416: -*) ;; 5417: 5418: *) 1.4 frystyk 5419: # If the previous option needed an argument, then skip it. 5420: if test -n "$prev"; then 5421: prev= 5422: else 5423: dest="$arg" 5424: continue 5425: fi 5426: ;; 1.1 frystyk 5427: esac 1.2 frystyk 5428: 5429: # Aesthetically quote the argument. 5430: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 1.11 kahan 5431: case $arg in 1.13 ! vbancrof 5432: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") 1.2 frystyk 5433: arg="\"$arg\"" 5434: ;; 5435: esac 1.1 frystyk 5436: install_prog="$install_prog $arg" 5437: done 5438: 5439: if test -z "$install_prog"; then 1.2 frystyk 5440: $echo "$modename: you must specify an install program" 1>&2 5441: $echo "$help" 1>&2 1.12 vbancrof 5442: exit $EXIT_FAILURE 1.1 frystyk 5443: fi 5444: 5445: if test -n "$prev"; then 1.2 frystyk 5446: $echo "$modename: the \`$prev' option requires an argument" 1>&2 5447: $echo "$help" 1>&2 1.12 vbancrof 5448: exit $EXIT_FAILURE 1.1 frystyk 5449: fi 5450: 5451: if test -z "$files"; then 5452: if test -z "$dest"; then 1.4 frystyk 5453: $echo "$modename: no file or destination specified" 1>&2 1.1 frystyk 5454: else 1.4 frystyk 5455: $echo "$modename: you must specify a destination" 1>&2 1.1 frystyk 5456: fi 1.2 frystyk 5457: $echo "$help" 1>&2 1.12 vbancrof 5458: exit $EXIT_FAILURE 1.1 frystyk 5459: fi 5460: 5461: # Strip any trailing slash from the destination. 1.2 frystyk 5462: dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` 1.1 frystyk 5463: 5464: # Check to see that the destination is a directory. 5465: test -d "$dest" && isdir=yes 1.3 frystyk 5466: if test "$isdir" = yes; then 1.1 frystyk 5467: destdir="$dest" 5468: destname= 5469: else 1.2 frystyk 5470: destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` 5471: test "X$destdir" = "X$dest" && destdir=. 5472: destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` 1.1 frystyk 5473: 5474: # Not a directory, so check to see that there is only one file specified. 5475: set dummy $files 1.12 vbancrof 5476: if test "$#" -gt 2; then 1.4 frystyk 5477: $echo "$modename: \`$dest' is not a directory" 1>&2 5478: $echo "$help" 1>&2 1.12 vbancrof 5479: exit $EXIT_FAILURE 1.1 frystyk 5480: fi 5481: fi 1.11 kahan 5482: case $destdir in 1.5 frystyk 5483: [\\/]* | [A-Za-z]:[\\/]*) ;; 1.1 frystyk 5484: *) 5485: for file in $files; do 1.11 kahan 5486: case $file in 1.4 frystyk 5487: *.lo) ;; 5488: *) 5489: $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 5490: $echo "$help" 1>&2 1.12 vbancrof 5491: exit $EXIT_FAILURE 1.4 frystyk 5492: ;; 5493: esac 1.1 frystyk 5494: done 5495: ;; 5496: esac 5497: 1.2 frystyk 5498: # This variable tells wrapper scripts just to set variables rather 5499: # than running their programs. 5500: libtool_install_magic="$magic" 5501: 1.1 frystyk 5502: staticlibs= 5503: future_libdirs= 5504: current_libdirs= 5505: for file in $files; do 5506: 5507: # Do each installation. 1.11 kahan 5508: case $file in 5509: *.$libext) 1.4 frystyk 5510: # Do the static libraries later. 5511: staticlibs="$staticlibs $file" 5512: ;; 1.1 frystyk 5513: 5514: *.la) 1.4 frystyk 5515: # Check to see that this really is a libtool archive. 1.12 vbancrof 5516: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 1.4 frystyk 5517: else 5518: $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 5519: $echo "$help" 1>&2 1.12 vbancrof 5520: exit $EXIT_FAILURE 1.4 frystyk 5521: fi 5522: 5523: library_names= 5524: old_library= 1.11 kahan 5525: relink_command= 1.4 frystyk 5526: # If there is no directory component, then add one. 1.11 kahan 5527: case $file in 1.4 frystyk 5528: */* | *\\*) . $file ;; 5529: *) . ./$file ;; 5530: esac 5531: 5532: # Add the libdir to current_libdirs if it is the destination. 5533: if test "X$destdir" = "X$libdir"; then 5534: case "$current_libdirs " in 5535: *" $libdir "*) ;; 5536: *) current_libdirs="$current_libdirs $libdir" ;; 5537: esac 5538: else 5539: # Note the libdir as a future libdir. 5540: case "$future_libdirs " in 5541: *" $libdir "*) ;; 5542: *) future_libdirs="$future_libdirs $libdir" ;; 5543: esac 5544: fi 5545: 1.11 kahan 5546: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ 1.4 frystyk 5547: test "X$dir" = "X$file/" && dir= 5548: dir="$dir$objdir" 5549: 1.11 kahan 5550: if test -n "$relink_command"; then 1.12 vbancrof 5551: # Determine the prefix the user has applied to our future dir. 5552: inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` 5553: 5554: # Don't allow the user to place us outside of our expected 5555: # location b/c this prevents finding dependent libraries that 5556: # are installed to the same prefix. 5557: # At present, this check doesn't affect windows .dll's that 5558: # are installed into $libdir/../bin (currently, that works fine) 5559: # but it's something to keep an eye on. 5560: if test "$inst_prefix_dir" = "$destdir"; then 5561: $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 5562: exit $EXIT_FAILURE 5563: fi 5564: 5565: if test -n "$inst_prefix_dir"; then 5566: # Stick the inst_prefix_dir data into the link command. 5567: relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` 5568: else 5569: relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` 5570: fi 5571: 1.11 kahan 5572: $echo "$modename: warning: relinking \`$file'" 1>&2 5573: $show "$relink_command" 5574: if $run eval "$relink_command"; then : 5575: else 5576: $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 1.12 vbancrof 5577: exit $EXIT_FAILURE 1.11 kahan 5578: fi 5579: fi 5580: 1.4 frystyk 5581: # See the names of the shared library. 5582: set dummy $library_names 5583: if test -n "$2"; then 5584: realname="$2" 5585: shift 5586: shift 5587: 1.11 kahan 5588: srcname="$realname" 5589: test -n "$relink_command" && srcname="$realname"T 5590: 1.4 frystyk 5591: # Install the shared library and build the symlinks. 1.11 kahan 5592: $show "$install_prog $dir/$srcname $destdir/$realname" 5593: $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? 5594: if test -n "$stripme" && test -n "$striplib"; then 5595: $show "$striplib $destdir/$realname" 5596: $run eval "$striplib $destdir/$realname" || exit $? 5597: fi 1.4 frystyk 5598: 1.12 vbancrof 5599: if test "$#" -gt 0; then 1.4 frystyk 5600: # Delete the old symlinks, and create new ones. 5601: for linkname 5602: do 5603: if test "$linkname" != "$realname"; then 5604: $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" 5605: $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" 5606: fi 5607: done 5608: fi 5609: 5610: # Do each command in the postinstall commands. 5611: lib="$destdir/$realname" 1.12 vbancrof 5612: cmds=$postinstall_cmds 1.11 kahan 5613: save_ifs="$IFS"; IFS='~' 1.4 frystyk 5614: for cmd in $cmds; do 5615: IFS="$save_ifs" 1.12 vbancrof 5616: eval cmd=\"$cmd\" 1.4 frystyk 5617: $show "$cmd" 5618: $run eval "$cmd" || exit $? 5619: done 5620: IFS="$save_ifs" 5621: fi 5622: 5623: # Install the pseudo-library for information purposes. 5624: name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 5625: instname="$dir/$name"i 5626: $show "$install_prog $instname $destdir/$name" 5627: $run eval "$install_prog $instname $destdir/$name" || exit $? 5628: 5629: # Maybe install the static library, too. 5630: test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" 5631: ;; 1.1 frystyk 5632: 5633: *.lo) 1.4 frystyk 5634: # Install (i.e. copy) a libtool object. 5635: 5636: # Figure out destination file name, if it wasn't already specified. 5637: if test -n "$destname"; then 5638: destfile="$destdir/$destname" 5639: else 5640: destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 5641: destfile="$destdir/$destfile" 5642: fi 5643: 5644: # Deduce the name of the destination old-style object file. 1.11 kahan 5645: case $destfile in 1.4 frystyk 5646: *.lo) 5647: staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` 5648: ;; 1.11 kahan 5649: *.$objext) 1.4 frystyk 5650: staticdest="$destfile" 5651: destfile= 5652: ;; 5653: *) 5654: $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 5655: $echo "$help" 1>&2 1.12 vbancrof 5656: exit $EXIT_FAILURE 1.4 frystyk 5657: ;; 5658: esac 5659: 5660: # Install the libtool object if requested. 5661: if test -n "$destfile"; then 5662: $show "$install_prog $file $destfile" 5663: $run eval "$install_prog $file $destfile" || exit $? 5664: fi 1.1 frystyk 5665: 1.4 frystyk 5666: # Install the old object if enabled. 5667: if test "$build_old_libs" = yes; then 5668: # Deduce the name of the old-style object file. 5669: staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` 5670: 5671: $show "$install_prog $staticobj $staticdest" 5672: $run eval "$install_prog \$staticobj \$staticdest" || exit $? 5673: fi 1.12 vbancrof 5674: exit $EXIT_SUCCESS 1.4 frystyk 5675: ;; 1.1 frystyk 5676: 5677: *) 1.4 frystyk 5678: # Figure out destination file name, if it wasn't already specified. 5679: if test -n "$destname"; then 5680: destfile="$destdir/$destname" 5681: else 5682: destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 5683: destfile="$destdir/$destfile" 5684: fi 5685: 1.12 vbancrof 5686: # If the file is missing, and there is a .exe on the end, strip it 5687: # because it is most likely a libtool script we actually want to 5688: # install 5689: stripped_ext="" 5690: case $file in 5691: *.exe) 5692: if test ! -f "$file"; then 5693: file=`$echo $file|${SED} 's,.exe$,,'` 5694: stripped_ext=".exe" 5695: fi 5696: ;; 5697: esac 5698: 1.4 frystyk 5699: # Do a test to see if this is really a libtool program. 1.11 kahan 5700: case $host in 5701: *cygwin*|*mingw*) 1.12 vbancrof 5702: wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` 1.11 kahan 5703: ;; 5704: *) 5705: wrapper=$file 5706: ;; 5707: esac 1.12 vbancrof 5708: if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then 1.11 kahan 5709: notinst_deplibs= 1.5 frystyk 5710: relink_command= 1.4 frystyk 5711: 1.12 vbancrof 5712: # To insure that "foo" is sourced, and not "foo.exe", 5713: # finese the cygwin/MSYS system by explicitly sourcing "foo." 5714: # which disallows the automatic-append-.exe behavior. 5715: case $build in 5716: *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; 5717: *) wrapperdot=${wrapper} ;; 5718: esac 1.4 frystyk 5719: # If there is no directory component, then add one. 1.11 kahan 5720: case $file in 1.12 vbancrof 5721: */* | *\\*) . ${wrapperdot} ;; 5722: *) . ./${wrapperdot} ;; 1.4 frystyk 5723: esac 5724: 5725: # Check the variables that should have been set. 1.11 kahan 5726: if test -z "$notinst_deplibs"; then 5727: $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 1.12 vbancrof 5728: exit $EXIT_FAILURE 1.4 frystyk 5729: fi 5730: 5731: finalize=yes 1.11 kahan 5732: for lib in $notinst_deplibs; do 1.4 frystyk 5733: # Check to see that each library is installed. 5734: libdir= 5735: if test -f "$lib"; then 5736: # If there is no directory component, then add one. 1.11 kahan 5737: case $lib in 1.4 frystyk 5738: */* | *\\*) . $lib ;; 5739: *) . ./$lib ;; 5740: esac 5741: fi 1.11 kahan 5742: libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 1.4 frystyk 5743: if test -n "$libdir" && test ! -f "$libfile"; then 5744: $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 5745: finalize=no 5746: fi 5747: done 5748: 1.11 kahan 5749: relink_command= 1.12 vbancrof 5750: # To insure that "foo" is sourced, and not "foo.exe", 5751: # finese the cygwin/MSYS system by explicitly sourcing "foo." 5752: # which disallows the automatic-append-.exe behavior. 5753: case $build in 5754: *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; 5755: *) wrapperdot=${wrapper} ;; 5756: esac 1.11 kahan 5757: # If there is no directory component, then add one. 5758: case $file in 1.12 vbancrof 5759: */* | *\\*) . ${wrapperdot} ;; 5760: *) . ./${wrapperdot} ;; 1.11 kahan 5761: esac 5762: 1.5 frystyk 5763: outputname= 5764: if test "$fast_install" = no && test -n "$relink_command"; then 5765: if test "$finalize" = yes && test -z "$run"; then 5766: tmpdir="/tmp" 5767: test -n "$TMPDIR" && tmpdir="$TMPDIR" 5768: tmpdir="$tmpdir/libtool-$$" 1.12 vbancrof 5769: save_umask=`umask` 5770: umask 0077 5771: if $mkdir "$tmpdir"; then 5772: umask $save_umask 1.5 frystyk 5773: else 1.12 vbancrof 5774: umask $save_umask 1.5 frystyk 5775: $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 5776: continue 5777: fi 1.12 vbancrof 5778: file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` 1.5 frystyk 5779: outputname="$tmpdir/$file" 5780: # Replace the output file specification. 5781: relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` 5782: 5783: $show "$relink_command" 5784: if $run eval "$relink_command"; then : 1.4 frystyk 5785: else 5786: $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 1.5 frystyk 5787: ${rm}r "$tmpdir" 1.4 frystyk 5788: continue 5789: fi 1.5 frystyk 5790: file="$outputname" 1.4 frystyk 5791: else 1.5 frystyk 5792: $echo "$modename: warning: cannot relink \`$file'" 1>&2 1.4 frystyk 5793: fi 5794: else 5795: # Install the binary that we compiled earlier. 1.12 vbancrof 5796: file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 1.4 frystyk 5797: fi 5798: fi 1.1 frystyk 5799: 1.11 kahan 5800: # remove .exe since cygwin /usr/bin/install will append another 5801: # one anyways 5802: case $install_prog,$host in 1.12 vbancrof 5803: */usr/bin/install*,*cygwin*) 1.11 kahan 5804: case $file:$destfile in 5805: *.exe:*.exe) 5806: # this is ok 5807: ;; 5808: *.exe:*) 5809: destfile=$destfile.exe 5810: ;; 5811: *:*.exe) 1.12 vbancrof 5812: destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` 1.11 kahan 5813: ;; 5814: esac 5815: ;; 5816: esac 1.4 frystyk 5817: $show "$install_prog$stripme $file $destfile" 5818: $run eval "$install_prog\$stripme \$file \$destfile" || exit $? 1.5 frystyk 5819: test -n "$outputname" && ${rm}r "$tmpdir" 1.4 frystyk 5820: ;; 1.1 frystyk 5821: esac 5822: done 5823: 5824: for file in $staticlibs; do 1.2 frystyk 5825: name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 1.1 frystyk 5826: 5827: # Set up the ranlib parameters. 5828: oldlib="$destdir/$name" 5829: 5830: $show "$install_prog $file $oldlib" 1.2 frystyk 5831: $run eval "$install_prog \$file \$oldlib" || exit $? 1.1 frystyk 5832: 1.12 vbancrof 5833: if test -n "$stripme" && test -n "$old_striplib"; then 1.11 kahan 5834: $show "$old_striplib $oldlib" 5835: $run eval "$old_striplib $oldlib" || exit $? 5836: fi 5837: 1.1 frystyk 5838: # Do each command in the postinstall commands. 1.12 vbancrof 5839: cmds=$old_postinstall_cmds 1.11 kahan 5840: save_ifs="$IFS"; IFS='~' 1.1 frystyk 5841: for cmd in $cmds; do 1.4 frystyk 5842: IFS="$save_ifs" 1.12 vbancrof 5843: eval cmd=\"$cmd\" 1.4 frystyk 5844: $show "$cmd" 5845: $run eval "$cmd" || exit $? 1.1 frystyk 5846: done 5847: IFS="$save_ifs" 5848: done 5849: 5850: if test -n "$future_libdirs"; then 1.2 frystyk 5851: $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 1.1 frystyk 5852: fi 5853: 5854: if test -n "$current_libdirs"; then 5855: # Maybe just do a dry run. 5856: test -n "$run" && current_libdirs=" -n$current_libdirs" 1.12 vbancrof 5857: exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 1.11 kahan 5858: else 1.12 vbancrof 5859: exit $EXIT_SUCCESS 1.1 frystyk 5860: fi 5861: ;; 5862: 1.2 frystyk 5863: # libtool finish mode 5864: finish) 5865: modename="$modename: finish" 5866: libdirs="$nonopt" 1.3 frystyk 5867: admincmds= 1.2 frystyk 5868: 5869: if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 5870: for dir 5871: do 1.4 frystyk 5872: libdirs="$libdirs $dir" 1.2 frystyk 5873: done 5874: 5875: for libdir in $libdirs; do 5876: if test -n "$finish_cmds"; then 5877: # Do each command in the finish commands. 1.12 vbancrof 5878: cmds=$finish_cmds 1.11 kahan 5879: save_ifs="$IFS"; IFS='~' 1.4 frystyk 5880: for cmd in $cmds; do 5881: IFS="$save_ifs" 1.12 vbancrof 5882: eval cmd=\"$cmd\" 1.4 frystyk 5883: $show "$cmd" 5884: $run eval "$cmd" || admincmds="$admincmds 1.3 frystyk 5885: $cmd" 1.4 frystyk 5886: done 5887: IFS="$save_ifs" 1.2 frystyk 5888: fi 5889: if test -n "$finish_eval"; then 5890: # Do the single finish_eval. 1.3 frystyk 5891: eval cmds=\"$finish_eval\" 5892: $run eval "$cmds" || admincmds="$admincmds 5893: $cmds" 1.2 frystyk 5894: fi 5895: done 5896: fi 5897: 1.4 frystyk 5898: # Exit here if they wanted silent mode. 1.12 vbancrof 5899: test "$show" = : && exit $EXIT_SUCCESS 1.4 frystyk 5900: 1.12 vbancrof 5901: $echo "----------------------------------------------------------------------" 5902: $echo "Libraries have been installed in:" 1.2 frystyk 5903: for libdir in $libdirs; do 1.12 vbancrof 5904: $echo " $libdir" 1.1 frystyk 5905: done 1.12 vbancrof 5906: $echo 5907: $echo "If you ever happen to want to link against installed libraries" 5908: $echo "in a given directory, LIBDIR, you must either use libtool, and" 5909: $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 5910: $echo "flag during linking and do at least one of the following:" 1.2 frystyk 5911: if test -n "$shlibpath_var"; then 1.12 vbancrof 5912: $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 5913: $echo " during execution" 1.2 frystyk 5914: fi 5915: if test -n "$runpath_var"; then 1.12 vbancrof 5916: $echo " - add LIBDIR to the \`$runpath_var' environment variable" 5917: $echo " during linking" 1.2 frystyk 5918: fi 5919: if test -n "$hardcode_libdir_flag_spec"; then 5920: libdir=LIBDIR 1.3 frystyk 5921: eval flag=\"$hardcode_libdir_flag_spec\" 1.1 frystyk 5922: 1.12 vbancrof 5923: $echo " - use the \`$flag' linker flag" 1.2 frystyk 5924: fi 1.3 frystyk 5925: if test -n "$admincmds"; then 1.12 vbancrof 5926: $echo " - have your system administrator run these commands:$admincmds" 1.3 frystyk 5927: fi 1.2 frystyk 5928: if test -f /etc/ld.so.conf; then 1.12 vbancrof 5929: $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 1.2 frystyk 5930: fi 1.12 vbancrof 5931: $echo 5932: $echo "See any operating system documentation about shared libraries for" 5933: $echo "more information, such as the ld(1) and ld.so(8) manual pages." 5934: $echo "----------------------------------------------------------------------" 5935: exit $EXIT_SUCCESS 1.2 frystyk 5936: ;; 5937: 5938: # libtool execute mode 5939: execute) 5940: modename="$modename: execute" 5941: 5942: # The first argument is the command name. 5943: cmd="$nonopt" 5944: if test -z "$cmd"; then 5945: $echo "$modename: you must specify a COMMAND" 1>&2 5946: $echo "$help" 1.12 vbancrof 5947: exit $EXIT_FAILURE 1.1 frystyk 5948: fi 5949: 1.2 frystyk 5950: # Handle -dlopen flags immediately. 5951: for file in $execute_dlfiles; do 1.3 frystyk 5952: if test ! -f "$file"; then 1.2 frystyk 5953: $echo "$modename: \`$file' is not a file" 1>&2 5954: $echo "$help" 1>&2 1.12 vbancrof 5955: exit $EXIT_FAILURE 1.1 frystyk 5956: fi 5957: 1.2 frystyk 5958: dir= 1.11 kahan 5959: case $file in 1.2 frystyk 5960: *.la) 1.4 frystyk 5961: # Check to see that this really is a libtool archive. 1.12 vbancrof 5962: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : 1.4 frystyk 5963: else 5964: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 5965: $echo "$help" 1>&2 1.12 vbancrof 5966: exit $EXIT_FAILURE 1.4 frystyk 5967: fi 1.2 frystyk 5968: 5969: # Read the libtool library. 5970: dlname= 5971: library_names= 5972: 1.4 frystyk 5973: # If there is no directory component, then add one. 1.11 kahan 5974: case $file in 1.2 frystyk 5975: */* | *\\*) . $file ;; 1.4 frystyk 5976: *) . ./$file ;; 1.2 frystyk 5977: esac 5978: 5979: # Skip this library if it cannot be dlopened. 5980: if test -z "$dlname"; then 5981: # Warn if it was a shared library. 5982: test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" 5983: continue 5984: fi 5985: 5986: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 5987: test "X$dir" = "X$file" && dir=. 5988: 5989: if test -f "$dir/$objdir/$dlname"; then 5990: dir="$dir/$objdir" 5991: else 5992: $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 1.12 vbancrof 5993: exit $EXIT_FAILURE 1.2 frystyk 5994: fi 5995: ;; 5996: 5997: *.lo) 5998: # Just add the directory containing the .lo file. 5999: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 6000: test "X$dir" = "X$file" && dir=. 6001: ;; 6002: 6003: *) 6004: $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 1.4 frystyk 6005: continue 1.2 frystyk 6006: ;; 1.1 frystyk 6007: esac 6008: 1.2 frystyk 6009: # Get the absolute pathname. 6010: absdir=`cd "$dir" && pwd` 6011: test -n "$absdir" && dir="$absdir" 6012: 6013: # Now add the directory to shlibpath_var. 6014: if eval "test -z \"\$$shlibpath_var\""; then 6015: eval "$shlibpath_var=\"\$dir\"" 1.1 frystyk 6016: else 1.2 frystyk 6017: eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 1.1 frystyk 6018: fi 6019: done 6020: 1.2 frystyk 6021: # This variable tells wrapper scripts just to set shlibpath_var 6022: # rather than running their programs. 6023: libtool_execute_magic="$magic" 6024: 6025: # Check if any of the arguments is a wrapper script. 6026: args= 6027: for file 6028: do 1.11 kahan 6029: case $file in 1.2 frystyk 6030: -*) ;; 6031: *) 1.4 frystyk 6032: # Do a test to see if this is really a libtool program. 1.12 vbancrof 6033: if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1.2 frystyk 6034: # If there is no directory component, then add one. 1.11 kahan 6035: case $file in 1.2 frystyk 6036: */* | *\\*) . $file ;; 6037: *) . ./$file ;; 6038: esac 6039: 6040: # Transform arg to wrapped name. 6041: file="$progdir/$program" 6042: fi 1.4 frystyk 6043: ;; 1.2 frystyk 6044: esac 6045: # Quote arguments (to preserve shell metacharacters). 6046: file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` 6047: args="$args \"$file\"" 6048: done 1.1 frystyk 6049: 1.2 frystyk 6050: if test -z "$run"; then 1.11 kahan 6051: if test -n "$shlibpath_var"; then 6052: # Export the shlibpath_var. 6053: eval "export $shlibpath_var" 6054: fi 1.1 frystyk 6055: 1.12 vbancrof 6056: # Restore saved environment variables 1.3 frystyk 6057: if test "${save_LC_ALL+set}" = set; then 1.4 frystyk 6058: LC_ALL="$save_LC_ALL"; export LC_ALL 1.3 frystyk 6059: fi 6060: if test "${save_LANG+set}" = set; then 1.4 frystyk 6061: LANG="$save_LANG"; export LANG 1.3 frystyk 6062: fi 6063: 1.11 kahan 6064: # Now prepare to actually exec the command. 6065: exec_cmd="\$cmd$args" 1.2 frystyk 6066: else 6067: # Display what would be done. 1.11 kahan 6068: if test -n "$shlibpath_var"; then 6069: eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" 6070: $echo "export $shlibpath_var" 6071: fi 1.2 frystyk 6072: $echo "$cmd$args" 1.12 vbancrof 6073: exit $EXIT_SUCCESS 1.1 frystyk 6074: fi 6075: ;; 6076: 1.11 kahan 6077: # libtool clean and uninstall mode 6078: clean | uninstall) 6079: modename="$modename: $mode" 1.1 frystyk 6080: rm="$nonopt" 6081: files= 1.11 kahan 6082: rmforce= 6083: exit_status=0 6084: 6085: # This variable tells wrapper scripts just to set variables rather 6086: # than running their programs. 6087: libtool_install_magic="$magic" 1.1 frystyk 6088: 6089: for arg 6090: do 1.11 kahan 6091: case $arg in 6092: -f) rm="$rm $arg"; rmforce=yes ;; 1.1 frystyk 6093: -*) rm="$rm $arg" ;; 6094: *) files="$files $arg" ;; 6095: esac 6096: done 6097: 6098: if test -z "$rm"; then 1.2 frystyk 6099: $echo "$modename: you must specify an RM program" 1>&2 6100: $echo "$help" 1>&2 1.12 vbancrof 6101: exit $EXIT_FAILURE 1.1 frystyk 6102: fi 6103: 1.11 kahan 6104: rmdirs= 6105: 1.12 vbancrof 6106: origobjdir="$objdir" 1.1 frystyk 6107: for file in $files; do 1.2 frystyk 6108: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` 1.11 kahan 6109: if test "X$dir" = "X$file"; then 6110: dir=. 1.12 vbancrof 6111: objdir="$origobjdir" 1.11 kahan 6112: else 1.12 vbancrof 6113: objdir="$dir/$origobjdir" 1.11 kahan 6114: fi 1.2 frystyk 6115: name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 1.12 vbancrof 6116: test "$mode" = uninstall && objdir="$dir" 1.11 kahan 6117: 6118: # Remember objdir for removal later, being careful to avoid duplicates 1.12 vbancrof 6119: if test "$mode" = clean; then 1.11 kahan 6120: case " $rmdirs " in 6121: *" $objdir "*) ;; 6122: *) rmdirs="$rmdirs $objdir" ;; 6123: esac 6124: fi 6125: 6126: # Don't error if the file doesn't exist and rm -f was used. 6127: if (test -L "$file") >/dev/null 2>&1 \ 6128: || (test -h "$file") >/dev/null 2>&1 \ 6129: || test -f "$file"; then 6130: : 6131: elif test -d "$file"; then 6132: exit_status=1 6133: continue 6134: elif test "$rmforce" = yes; then 6135: continue 6136: fi 1.1 frystyk 6137: 6138: rmfiles="$file" 6139: 1.11 kahan 6140: case $name in 1.1 frystyk 6141: *.la) 1.4 frystyk 6142: # Possibly a libtool archive, so verify it. 1.12 vbancrof 6143: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 1.4 frystyk 6144: . $dir/$name 6145: 6146: # Delete the libtool libraries and symlinks. 6147: for n in $library_names; do 1.11 kahan 6148: rmfiles="$rmfiles $objdir/$n" 1.4 frystyk 6149: done 1.11 kahan 6150: test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" 1.12 vbancrof 6151: test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" 1.2 frystyk 6152: 1.12 vbancrof 6153: if test "$mode" = uninstall; then 1.11 kahan 6154: if test -n "$library_names"; then 6155: # Do each command in the postuninstall commands. 1.12 vbancrof 6156: cmds=$postuninstall_cmds 1.11 kahan 6157: save_ifs="$IFS"; IFS='~' 6158: for cmd in $cmds; do 6159: IFS="$save_ifs" 1.12 vbancrof 6160: eval cmd=\"$cmd\" 1.11 kahan 6161: $show "$cmd" 6162: $run eval "$cmd" 1.12 vbancrof 6163: if test "$?" -ne 0 && test "$rmforce" != yes; then 1.11 kahan 6164: exit_status=1 6165: fi 6166: done 1.2 frystyk 6167: IFS="$save_ifs" 1.11 kahan 6168: fi 1.2 frystyk 6169: 1.11 kahan 6170: if test -n "$old_library"; then 6171: # Do each command in the old_postuninstall commands. 1.12 vbancrof 6172: cmds=$old_postuninstall_cmds 1.11 kahan 6173: save_ifs="$IFS"; IFS='~' 6174: for cmd in $cmds; do 6175: IFS="$save_ifs" 1.12 vbancrof 6176: eval cmd=\"$cmd\" 1.11 kahan 6177: $show "$cmd" 6178: $run eval "$cmd" 1.12 vbancrof 6179: if test "$?" -ne 0 && test "$rmforce" != yes; then 1.11 kahan 6180: exit_status=1 6181: fi 6182: done 1.2 frystyk 6183: IFS="$save_ifs" 1.11 kahan 6184: fi 6185: # FIXME: should reinstall the best remaining shared library. 1.2 frystyk 6186: fi 1.4 frystyk 6187: fi 6188: ;; 1.1 frystyk 6189: 6190: *.lo) 1.12 vbancrof 6191: # Possibly a libtool object, so verify it. 6192: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6193: 6194: # Read the .lo file 6195: . $dir/$name 6196: 6197: # Add PIC object to the list of files to remove. 6198: if test -n "$pic_object" \ 6199: && test "$pic_object" != none; then 6200: rmfiles="$rmfiles $dir/$pic_object" 6201: fi 6202: 6203: # Add non-PIC object to the list of files to remove. 6204: if test -n "$non_pic_object" \ 6205: && test "$non_pic_object" != none; then 6206: rmfiles="$rmfiles $dir/$non_pic_object" 6207: fi 1.4 frystyk 6208: fi 6209: ;; 1.2 frystyk 6210: 6211: *) 1.12 vbancrof 6212: if test "$mode" = clean ; then 6213: noexename=$name 6214: case $file in 6215: *.exe) 6216: file=`$echo $file|${SED} 's,.exe$,,'` 6217: noexename=`$echo $name|${SED} 's,.exe$,,'` 6218: # $file with .exe has already been added to rmfiles, 6219: # add $file without .exe 6220: rmfiles="$rmfiles $file" 6221: ;; 6222: esac 6223: # Do a test to see if this is a libtool program. 6224: if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then 6225: relink_command= 6226: . $dir/$noexename 1.11 kahan 6227: 1.12 vbancrof 6228: # note $name still contains .exe if it was in $file originally 6229: # as does the version of $file that was added into $rmfiles 6230: rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" 6231: if test "$fast_install" = yes && test -n "$relink_command"; then 6232: rmfiles="$rmfiles $objdir/lt-$name" 6233: fi 6234: if test "X$noexename" != "X$name" ; then 6235: rmfiles="$rmfiles $objdir/lt-${noexename}.c" 6236: fi 1.11 kahan 6237: fi 6238: fi 1.2 frystyk 6239: ;; 1.1 frystyk 6240: esac 1.11 kahan 6241: $show "$rm $rmfiles" 6242: $run $rm $rmfiles || exit_status=1 6243: done 1.12 vbancrof 6244: objdir="$origobjdir" 1.11 kahan 6245: 6246: # Try to remove the ${objdir}s in the directories where we deleted files 6247: for dir in $rmdirs; do 6248: if test -d "$dir"; then 6249: $show "rmdir $dir" 6250: $run rmdir $dir >/dev/null 2>&1 6251: fi 1.9 kahan 6252: done 1.11 kahan 6253: 6254: exit $exit_status 1.1 frystyk 6255: ;; 6256: 1.2 frystyk 6257: "") 6258: $echo "$modename: you must specify a MODE" 1>&2 6259: $echo "$generic_help" 1>&2 1.12 vbancrof 6260: exit $EXIT_FAILURE 1.1 frystyk 6261: ;; 6262: esac 6263: 1.11 kahan 6264: if test -z "$exec_cmd"; then 6265: $echo "$modename: invalid operation mode \`$mode'" 1>&2 6266: $echo "$generic_help" 1>&2 1.12 vbancrof 6267: exit $EXIT_FAILURE 1.11 kahan 6268: fi 6269: fi # test -z "$show_help" 6270: 6271: if test -n "$exec_cmd"; then 6272: eval exec $exec_cmd 1.12 vbancrof 6273: exit $EXIT_FAILURE 1.11 kahan 6274: fi 1.9 kahan 6275: 1.1 frystyk 6276: # We need to display help for each of the modes. 1.11 kahan 6277: case $mode in 1.2 frystyk 6278: "") $echo \ 6279: "Usage: $modename [OPTION]... [MODE-ARG]... 1.1 frystyk 6280: 6281: Provide generalized library-building support services. 6282: 1.3 frystyk 6283: --config show all configuration variables 6284: --debug enable verbose shell tracing 1.1 frystyk 6285: -n, --dry-run display commands without modifying any files 1.3 frystyk 6286: --features display basic configuration information and exit 1.1 frystyk 6287: --finish same as \`--mode=finish' 6288: --help display this help message and exit 6289: --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] 1.2 frystyk 6290: --quiet same as \`--silent' 6291: --silent don't print informational messages 1.12 vbancrof 6292: --tag=TAG use configuration variables from tag TAG 1.1 frystyk 6293: --version print version information 6294: 6295: MODE must be one of the following: 6296: 1.11 kahan 6297: clean remove files from the build directory 1.1 frystyk 6298: compile compile a source file into a libtool object 1.2 frystyk 6299: execute automatically set library path, then run a program 1.1 frystyk 6300: finish complete the installation of libtool libraries 6301: install install libraries or executables 6302: link create a library or an executable 6303: uninstall remove libraries from an installed directory 6304: 1.2 frystyk 6305: MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for 1.12 vbancrof 6306: a more detailed description of MODE. 6307: 6308: Report bugs to <bug-libtool@gnu.org>." 6309: exit $EXIT_SUCCESS 1.1 frystyk 6310: ;; 6311: 1.11 kahan 6312: clean) 6313: $echo \ 6314: "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 6315: 6316: Remove files from the build directory. 6317: 6318: RM is the name of the program to use to delete files associated with each FILE 6319: (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 6320: to RM. 6321: 6322: If FILE is a libtool library, object or program, all the files associated 6323: with it are deleted. Otherwise, only FILE itself is deleted using RM." 6324: ;; 6325: 1.1 frystyk 6326: compile) 1.2 frystyk 6327: $echo \ 6328: "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 1.1 frystyk 6329: 6330: Compile a source file into a libtool library object. 1.3 frystyk 6331: 6332: This mode accepts the following additional options: 6333: 1.4 frystyk 6334: -o OUTPUT-FILE set the output file name to OUTPUT-FILE 1.11 kahan 6335: -prefer-pic try to building PIC objects only 6336: -prefer-non-pic try to building non-PIC objects only 1.3 frystyk 6337: -static always build a \`.o' file suitable for static linking 1.1 frystyk 6338: 6339: COMPILE-COMMAND is a command to be used in creating a \`standard' object file 6340: from the given SOURCEFILE. 6341: 6342: The output file name is determined by removing the directory component from 6343: SOURCEFILE, then substituting the C source code suffix \`.c' with the 1.2 frystyk 6344: library object suffix, \`.lo'." 1.1 frystyk 6345: ;; 6346: 1.2 frystyk 6347: execute) 6348: $echo \ 6349: "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... 6350: 6351: Automatically set library path, then run a program. 6352: 6353: This mode accepts the following additional options: 1.1 frystyk 6354: 1.2 frystyk 6355: -dlopen FILE add the directory containing FILE to the library path 1.1 frystyk 6356: 1.2 frystyk 6357: This mode sets the library path environment variable according to \`-dlopen' 6358: flags. 1.1 frystyk 6359: 1.2 frystyk 6360: If any of the ARGS are libtool executable wrappers, then they are translated 6361: into their corresponding uninstalled binary, and any of their required library 6362: directories are added to the library path. 6363: 6364: Then, COMMAND is executed, with ARGS as arguments." 1.1 frystyk 6365: ;; 6366: 6367: finish) 1.2 frystyk 6368: $echo \ 6369: "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... 1.1 frystyk 6370: 6371: Complete the installation of libtool libraries. 6372: 6373: Each LIBDIR is a directory that contains libtool libraries. 6374: 6375: The commands that this mode executes may require superuser privileges. Use 1.2 frystyk 6376: the \`--dry-run' option if you just want to see what would be executed." 1.1 frystyk 6377: ;; 6378: 6379: install) 1.2 frystyk 6380: $echo \ 6381: "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... 1.1 frystyk 6382: 6383: Install executables or libraries. 6384: 6385: INSTALL-COMMAND is the installation command. The first component should be 6386: either the \`install' or \`cp' program. 6387: 6388: The rest of the components are interpreted as arguments to that command (only 1.2 frystyk 6389: BSD-compatible install options are recognized)." 1.1 frystyk 6390: ;; 6391: 6392: link) 1.2 frystyk 6393: $echo \ 6394: "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... 1.1 frystyk 6395: 6396: Link object files or libraries together to form another library, or to 6397: create an executable program. 6398: 6399: LINK-COMMAND is a command using the C compiler that you would use to create 6400: a program from several object files. 6401: 6402: The following components of LINK-COMMAND are treated specially: 6403: 1.2 frystyk 6404: -all-static do not do any dynamic linking at all 1.4 frystyk 6405: -avoid-version do not add a version suffix if possible 1.2 frystyk 6406: -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 1.4 frystyk 6407: -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 1.1 frystyk 6408: -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 1.4 frystyk 6409: -export-symbols SYMFILE 6410: try to export only the symbols listed in SYMFILE 1.5 frystyk 6411: -export-symbols-regex REGEX 6412: try to export only the symbols matching REGEX 1.1 frystyk 6413: -LLIBDIR search LIBDIR for required installed libraries 6414: -lNAME OUTPUT-FILE requires the installed library libNAME 1.4 frystyk 6415: -module build a library that can dlopened 1.11 kahan 6416: -no-fast-install disable the fast-install mode 6417: -no-install link a not-installable executable 1.2 frystyk 6418: -no-undefined declare that a library does not refer to external symbols 1.1 frystyk 6419: -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 1.12 vbancrof 6420: -objectlist FILE Use a list of object files found in FILE to specify objects 6421: -precious-files-regex REGEX 6422: don't remove output files matching REGEX 1.2 frystyk 6423: -release RELEASE specify package release information 1.1 frystyk 6424: -rpath LIBDIR the created library will eventually be installed in LIBDIR 1.4 frystyk 6425: -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 1.2 frystyk 6426: -static do not do any dynamic linking of libtool libraries 1.1 frystyk 6427: -version-info CURRENT[:REVISION[:AGE]] 1.4 frystyk 6428: specify library version info [each variable defaults to 0] 1.1 frystyk 6429: 6430: All other options (arguments beginning with \`-') are ignored. 6431: 6432: Every other argument is treated as a filename. Files ending in \`.la' are 6433: treated as uninstalled libtool libraries, other files are standard or library 6434: object files. 6435: 1.4 frystyk 6436: If the OUTPUT-FILE ends in \`.la', then a libtool library is created, 6437: only library objects (\`.lo' files) may be specified, and \`-rpath' is 6438: required, except when creating a convenience library. 1.1 frystyk 6439: 1.4 frystyk 6440: If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 6441: using \`ar' and \`ranlib', or on Windows using \`lib'. 1.1 frystyk 6442: 1.4 frystyk 6443: If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 6444: is created, otherwise an executable program is created." 1.1 frystyk 6445: ;; 6446: 6447: uninstall) 1.5 frystyk 6448: $echo \ 1.2 frystyk 6449: "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 1.1 frystyk 6450: 6451: Remove libraries from an installation directory. 6452: 6453: RM is the name of the program to use to delete files associated with each FILE 6454: (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 6455: to RM. 6456: 6457: If FILE is a libtool library, all the files associated with it are deleted. 1.2 frystyk 6458: Otherwise, only FILE itself is deleted using RM." 1.1 frystyk 6459: ;; 6460: 6461: *) 1.2 frystyk 6462: $echo "$modename: invalid operation mode \`$mode'" 1>&2 6463: $echo "$help" 1>&2 1.12 vbancrof 6464: exit $EXIT_FAILURE 1.1 frystyk 6465: ;; 6466: esac 6467: 1.12 vbancrof 6468: $echo 1.2 frystyk 6469: $echo "Try \`$modename --help' for more information about other modes." 1.1 frystyk 6470: 1.13 ! vbancrof 6471: exit $? 1.12 vbancrof 6472: 6473: # The TAGs below are defined such that we never get into a situation 6474: # in which we disable both kinds of libraries. Given conflicting 6475: # choices, we go for a static library, that is the most portable, 6476: # since we can't tell whether shared libraries were disabled because 6477: # the user asked for that or because the platform doesn't support 6478: # them. This is particularly important on AIX, because we don't 6479: # support having both static and shared libraries enabled at the same 6480: # time on that platform, so we default to a shared-only configuration. 6481: # If a disable-shared tag is given, we'll fallback to a static-only 6482: # configuration. But we'll never go from static-only to shared-only. 6483: 6484: # ### BEGIN LIBTOOL TAG CONFIG: disable-shared 6485: build_libtool_libs=no 6486: build_old_libs=yes 6487: # ### END LIBTOOL TAG CONFIG: disable-shared 6488: 6489: # ### BEGIN LIBTOOL TAG CONFIG: disable-static 6490: build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` 6491: # ### END LIBTOOL TAG CONFIG: disable-static 1.1 frystyk 6492: 6493: # Local Variables: 6494: # mode:shell-script 6495: # sh-indentation:2 6496: # End: