Error Buddy
Do you have an error message from your application? Then find the answer with Error Buddy. You can search over 40000 source code files and troubleshooting documents using our beta lucene/nutch search interface or if you prefer, search as normal using google. With LXR technology you can drill right down into the line of source code where it came from with full cross-referencing.
If after searching you didn't get your ideal answer, or you are still unclear what the error means, you can choose to post that question to the community forums following the link included in the search results.
[1.6]001 # ltmain.sh - Provide generalized library-building support services. 002 # NOTE: Changing this file will not affect anything until you rerun configure. 003 # 004 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 005 # Free Software Foundation, Inc. 006 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 007 # 008 # This program is free software; you can redistribute it and/or modify 009 # it under the terms of the GNU General Public License as published by 010 # the Free Software Foundation; either version 2 of the License, or 011 # (at your option) any later version. 012 # 013 # This program is distributed in the hope that it will be useful, but 014 # WITHOUT ANY WARRANTY; without even the implied warranty of 015 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 016 # General Public License for more details. 017 # 018 # You should have received a copy of the GNU General Public License 019 # along with this program; if not, write to the Free Software 020 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 021 # 022 # As a special exception to the GNU General Public License, if you 023 # distribute this file as part of a program that contains a 024 # configuration script generated by Autoconf, you may include it under 025 # the same distribution terms that you use for the rest of that program. 026 027 # Check that we have a working $echo. 028 if test "X$1" = X--no-reexec; then 029 # Discard the --no-reexec flag, and continue. 030 shift 031 elif test "X$1" = X--fallback-echo; then 032 # Avoid inline document here, it may be left over 033 : 034 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 035 # Yippee, $echo works! 036 : 037 else 038 # Restart under the correct shell, and then maybe $echo will work. 039 exec $SHELL "$0" --no-reexec ${1+"$@"} 040 fi 041 042 if test "X$1" = X--fallback-echo; then 043 # used as fallback echo 044 shift 045 cat <<EOF 046 $* 047 EOF 048 exit 0 049 fi 050 051 # The name of this program. 052 progname=`$echo "$0" | sed 's%^.*/%%'` 053 modename="$progname" 054 055 # Constants. 056 PROGRAM=ltmain.sh 057 PACKAGE=libtool 058 VERSION=1.4 059 TIMESTAMP=" (1.920 2001/04/24 23:26:18)" 060 061 default_mode= 062 help="Try \`$progname --help' for more information." 063 magic="%%%MAGIC variable%%%" 064 mkdir="mkdir" 065 mv="mv -f" 066 rm="rm -f" 067 068 # Sed substitution that helps us do robust quoting. It backslashifies 069 # metacharacters that are still active within double-quoted strings. 070 Xsed='sed -e 1s/^X//' 071 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' 072 SP2NL='tr \040 \012' 073 NL2SP='tr \015\012 \040\040' 074 075 # NLS nuisances. 076 # Only set LANG and LC_ALL to C if already set. 077 # These must not be set unconditionally because not all systems understand 078 # e.g. LANG=C (notably SCO). 079 # We save the old values to restore during execute mode. 080 if test "${LC_ALL+set}" = set; then 081 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL 082 fi 083 if test "${LANG+set}" = set; then 084 save_LANG="$LANG"; LANG=C; export LANG 085 fi 086 087 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 088 echo "$modename: not configured to build any kind of library" 1>&2 089 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 090 exit 1 091 fi 092 093 # Global variables. 094 mode=$default_mode 095 nonopt= 096 prev= 097 prevopt= 098 run= 099 show="$echo" 100 show_help= 101 execute_dlfiles= 102 lo2o="s/\\.lo\$/.${objext}/" 103 o2lo="s/\\.${objext}\$/.lo/" 104 105 # Parse our command line options once, thoroughly. 106 while test $# -gt 0 107 do 108 arg="$1" 109 shift 110 111 case $arg in 112 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; 113 *) optarg= ;; 114 esac 115 116 # If the previous option needs an argument, assign it. 117 if test -n "$prev"; then 118 case $prev in 119 execute_dlfiles) 120 execute_dlfiles="$execute_dlfiles $arg" 121 ;; 122 *) 123 eval "$prev=\$arg" 124 ;; 125 esac 126 127 prev= 128 prevopt= 129 continue 130 fi 131 132 # Have we seen a non-optional argument yet? 133 case $arg in 134 --help) 135 show_help=yes 136 ;; 137 138 --version) 139 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" 140 exit 0 141 ;; 142 143 --config) 144 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 145 exit 0 146 ;; 147 148 --debug) 149 echo "$progname: enabling shell trace mode" 150 set -x 151 ;; 152 153 --dry-run | -n) 154 run=: 155 ;; 156 157 --features) 158 echo "host: $host" 159 if test "$build_libtool_libs" = yes; then 160 echo "enable shared libraries" 161 else 162 echo "disable shared libraries" 163 fi 164 if test "$build_old_libs" = yes; then 165 echo "enable static libraries" 166 else 167 echo "disable static libraries" 168 fi 169 exit 0 170 ;; 171 172 --finish) mode="finish" ;; 173 174 --mode) prevopt="--mode" prev=mode ;; 175 --mode=*) mode="$optarg" ;; 176 177 --quiet | --silent) 178 show=: 179 ;; 180 181 -dlopen) 182 prevopt="-dlopen" 183 prev=execute_dlfiles 184 ;; 185 186 -*) 187 $echo "$modename: unrecognized option \`$arg'" 1>&2 188 $echo "$help" 1>&2 189 exit 1 190 ;; 191 192 *) 193 nonopt="$arg" 194 break 195 ;; 196 esac 197 done 198 199 if test -n "$prevopt"; then 200 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 201 $echo "$help" 1>&2 202 exit 1 203 fi 204 205 if test -z "$show_help"; then 206 207 # Infer the operation mode. 208 if test -z "$mode"; then 209 case $nonopt in 210 *cc | *++ | gcc* | *-gcc*) 211 mode=link 212 for arg 213 do 214 case $arg in 215 -c) 216 mode=compile 217 break 218 ;; 219 esac 220 done 221 ;; 222 *db | *dbx | *strace | *truss) 223 mode=execute 224 ;; 225 *install*|cp|mv) 226 mode=install 227 ;; 228 *rm) 229 mode=uninstall 230 ;; 231 *) 232 # If we have no mode, but dlfiles were specified, then do execute mode. 233 test -n "$execute_dlfiles" && mode=execute 234 235 # Just use the default operation mode. 236 if test -z "$mode"; then 237 if test -n "$nonopt"; then 238 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 239 else 240 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 241 fi 242 fi 243 ;; 244 esac 245 fi 246 247 # Only execute mode is allowed to have -dlopen flags. 248 if test -n "$execute_dlfiles" && test "$mode" != execute; then 249 $echo "$modename: unrecognized option \`-dlopen'" 1>&2 250 $echo "$help" 1>&2 251 exit 1 252 fi 253 254 # Change the help message to a mode-specific one. 255 generic_help="$help" 256 help="Try \`$modename --help --mode=$mode' for more information." 257 258 # These modes are in order of execution frequency so that they run quickly. 259 case $mode in 260 # libtool compile mode 261 compile) 262 modename="$modename: compile" 263 # Get the compilation command and the source file. 264 base_compile= 265 prev= 266 lastarg= 267 srcfile="$nonopt" 268 suppress_output= 269 270 user_target=no 271 for arg 272 do 273 case $prev in 274 "") ;; 275 xcompiler) 276 # Aesthetically quote the previous argument. 277 prev= 278 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` 279 280 case $arg in 281 # Double-quote args containing other shell metacharacters. 282 # Many Bourne shells cannot handle close brackets correctly 283 # in scan sets, so we specify it separately. 284 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 285 arg="\"$arg\"" 286 ;; 287 esac 288 289 # Add the previous argument to base_compile. 290 if test -z "$base_compile"; then 291 base_compile="$lastarg" 292 else 293 base_compile="$base_compile $lastarg" 294 fi 295 continue 296 ;; 297 esac 298 299 # Accept any command-line options. 300 case $arg in 301 -o) 302 if test "$user_target" != "no"; then 303 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 304 exit 1 305 fi 306 user_target=next 307 ;; 308 309 -static) 310 build_old_libs=yes 311 continue 312 ;; 313 314 -prefer-pic) 315 pic_mode=yes 316 continue 317 ;; 318 319 -prefer-non-pic) 320 pic_mode=no 321 continue 322 ;; 323 324 -Xcompiler) 325 prev=xcompiler 326 continue 327 ;; 328 329 -Wc,*) 330 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` 331 lastarg= 332 IFS="${IFS= }"; save_ifs="$IFS"; IFS=',' 333 for arg in $args; do 334 IFS="$save_ifs" 335 336 # Double-quote args containing other shell metacharacters. 337 # Many Bourne shells cannot handle close brackets correctly 338 # in scan sets, so we specify it separately. 339 case $arg in 340 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 341 arg="\"$arg\"" 342 ;; 343 esac 344 lastarg="$lastarg $arg" 345 done 346 IFS="$save_ifs" 347 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` 348 349 # Add the arguments to base_compile. 350 if test -z "$base_compile"; then 351 base_compile="$lastarg" 352 else 353 base_compile="$base_compile $lastarg" 354 fi 355 continue 356 ;; 357 esac 358 359 case $user_target in 360 next) 361 # The next one is the -o target name 362 user_target=yes 363 continue 364 ;; 365 yes) 366 # We got the output file 367 user_target=set 368 libobj="$arg" 369 continue 370 ;; 371 esac 372 373 # Accept the current argument as the source file. 374 lastarg="$srcfile" 375 srcfile="$arg" 376 377 # Aesthetically quote the previous argument. 378 379 # Backslashify any backslashes, double quotes, and dollar signs. 380 # These are the only characters that are still specially 381 # interpreted inside of double-quoted scrings. 382 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` 383 384 # Double-quote args containing other shell metacharacters. 385 # Many Bourne shells cannot handle close brackets correctly 386 # in scan sets, so we specify it separately. 387 case $lastarg in 388 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 389 lastarg="\"$lastarg\"" 390 ;; 391 esac 392 393 # Add the previous argument to base_compile. 394 if test -z "$base_compile"; then 395 base_compile="$lastarg" 396 else 397 base_compile="$base_compile $lastarg" 398 fi 399 done 400 401 case $user_target in 402 set) 403 ;; 404 no) 405 # Get the name of the library object. 406 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` 407 ;; 408 *) 409 $echo "$modename: you must specify a target with \`-o'" 1>&2 410 exit 1 411 ;; 412 esac 413 414 # Recognize several different file suffixes. 415 # If the user specifies -o file.o, it is replaced with file.lo 416 xform='[cCFSfmso]' 417 case $libobj in 418 *.ada) xform=ada ;; 419 *.adb) xform=adb ;; 420 *.ads) xform=ads ;; 421 *.asm) xform=asm ;; 422 *.c++) xform=c++ ;; 423 *.cc) xform=cc ;; 424 *.cpp) xform=cpp ;; 425 *.cxx) xform=cxx ;; 426 *.f90) xform=f90 ;; 427 *.for) xform=for ;; 428 esac 429 430 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` 431 432 case $libobj in 433 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; 434 *) 435 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 436 exit 1 437 ;; 438 esac 439 440 if test -z "$base_compile"; then 441 $echo "$modename: you must specify a compilation command" 1>&2 442 $echo "$help" 1>&2 443 exit 1 444 fi 445 446 # Delete any leftover library objects. 447 if test "$build_old_libs" = yes; then 448 removelist="$obj $libobj" 449 else 450 removelist="$libobj" 451 fi 452 453 $run $rm $removelist 454 trap "$run $rm $removelist; exit 1" 1 2 15 455 456 # On Cygwin there's no "real" PIC flag so we must build both object types 457 case $host_os in 458 cygwin* | mingw* | pw32* | os2*) 459 pic_mode=default 460 ;; 461 esac 462 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then 463 # non-PIC code in shared libraries is not supported 464 pic_mode=default 465 fi 466 467 # Calculate the filename of the output object if compiler does 468 # not support -o with -c 469 if test "$compiler_c_o" = no; then 470 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 471 lockfile="$output_obj.lock" 472 removelist="$removelist $output_obj $lockfile" 473 trap "$run $rm $removelist; exit 1" 1 2 15 474 else 475 need_locks=no 476 lockfile= 477 fi 478 479 # Lock this critical section if it is needed 480 # We use this script file to make the link, it avoids creating a new file 481 if test "$need_locks" = yes; then 482 until $run ln "$0" "$lockfile" 2>/dev/null; do 483 $show "Waiting for $lockfile to be removed" 484 sleep 2 485 done 486 elif test "$need_locks" = warn; then 487 if test -f "$lockfile"; then 488 echo "\ 489 *** ERROR, $lockfile exists and contains: 490 `cat $lockfile 2>/dev/null` 491 492 This indicates that another process is trying to use the same 493 temporary object file, and libtool could not work around it because 494 your compiler does not support \`-c' and \`-o' together. If you 495 repeat this compilation, it may succeed, by chance, but you had better 496 avoid parallel builds (make -j) in this platform, or get a better 497 compiler." 498 499 $run $rm $removelist 500 exit 1 501 fi 502 echo $srcfile > "$lockfile" 503 fi 504 505 if test -n "$fix_srcfile_path"; then 506 eval srcfile=\"$fix_srcfile_path\" 507 fi 508 509 # Only build a PIC object if we are building libtool libraries. 510 if test "$build_libtool_libs" = yes; then 511 # Without this assignment, base_compile gets emptied. 512 fbsd_hideous_sh_bug=$base_compile 513 514 if test "$pic_mode" != no; then 515 # All platforms use -DPIC, to notify preprocessed assembler code. 516 command="$base_compile $srcfile $pic_flag -DPIC" 517 else 518 # Don't build PIC code 519 command="$base_compile $srcfile" 520 fi 521 if test "$build_old_libs" = yes; then 522 lo_libobj="$libobj" 523 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` 524 if test "X$dir" = "X$libobj"; then 525 dir="$objdir" 526 else 527 dir="$dir/$objdir" 528 fi 529 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` 530 531 if test -d "$dir"; then 532 $show "$rm $libobj" 533 $run $rm $libobj 534 else 535 $show "$mkdir $dir" 536 $run $mkdir $dir 537 status=$? 538 if test $status -ne 0 && test ! -d $dir; then 539 exit $status 540 fi 541 fi 542 fi 543 if test "$compiler_o_lo" = yes; then 544 output_obj="$libobj" 545 command="$command -o $output_obj" 546 elif test "$compiler_c_o" = yes; then 547 output_obj="$obj" 548 command="$command -o $output_obj" 549 fi 550 551 $run $rm "$output_obj" 552 $show "$command" 553 if $run eval "$command"; then : 554 else 555 test -n "$output_obj" && $run $rm $removelist 556 exit 1 557 fi 558 559 if test "$need_locks" = warn && 560 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 561 echo "\ 562 *** ERROR, $lockfile contains: 563 `cat $lockfile 2>/dev/null` 564 565 but it should contain: 566 $srcfile 567 568 This indicates that another process is trying to use the same 569 temporary object file, and libtool could not work around it because 570 your compiler does not support \`-c' and \`-o' together. If you 571 repeat this compilation, it may succeed, by chance, but you had better 572 avoid parallel builds (make -j) in this platform, or get a better 573 compiler." 574 575 $run $rm $removelist 576 exit 1 577 fi 578 579 # Just move the object if needed, then go on to compile the next one 580 if test x"$output_obj" != x"$libobj"; then 581 $show "$mv $output_obj $libobj" 582 if $run $mv $output_obj $libobj; then : 583 else 584 error=$? 585 $run $rm $removelist 586 exit $error 587 fi 588 fi 589 590 # If we have no pic_flag, then copy the object into place and finish. 591 if (test -z "$pic_flag" || test "$pic_mode" != default) && 592 test "$build_old_libs" = yes; then 593 # Rename the .lo from within objdir to obj 594 if test -f $obj; then 595 $show $rm $obj 596 $run $rm $obj 597 fi 598 599 $show "$mv $libobj $obj" 600 if $run $mv $libobj $obj; then : 601 else 602 error=$? 603 $run $rm $removelist 604 exit $error 605 fi 606 607 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` 608 if test "X$xdir" = "X$obj"; then 609 xdir="." 610 else 611 xdir="$xdir" 612 fi 613 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` 614 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` 615 # Now arrange that obj and lo_libobj become the same file 616 $show "(cd $xdir && $LN_S $baseobj $libobj)" 617 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then 618 exit 0 619 else 620 error=$? 621 $run $rm $removelist 622 exit $error 623 fi 624 fi 625 626 # Allow error messages only from the first compilation. 627 suppress_output=' >/dev/null 2>&1' 628 fi 629 630 # Only build a position-dependent object if we build old libraries. 631 if test "$build_old_libs" = yes; then 632 if test "$pic_mode" != yes; then 633 # Don't build PIC code 634 command="$base_compile $srcfile" 635 else 636 # All platforms use -DPIC, to notify preprocessed assembler code. 637 command="$base_compile $srcfile $pic_flag -DPIC" 638 fi 639 if test "$compiler_c_o" = yes; then 640 command="$command -o $obj" 641 output_obj="$obj" 642 fi 643 644 # Suppress compiler output if we already did a PIC compilation. 645 command="$command$suppress_output" 646 $run $rm "$output_obj" 647 $show "$command" 648 if $run eval "$command"; then : 649 else 650 $run $rm $removelist 651 exit 1 652 fi 653 654 if test "$need_locks" = warn && 655 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then 656 echo "\ 657 *** ERROR, $lockfile contains: 658 `cat $lockfile 2>/dev/null` 659 660 but it should contain: 661 $srcfile 662 663 This indicates that another process is trying to use the same 664 temporary object file, and libtool could not work around it because 665 your compiler does not support \`-c' and \`-o' together. If you 666 repeat this compilation, it may succeed, by chance, but you had better 667 avoid parallel builds (make -j) in this platform, or get a better 668 compiler." 669 670 $run $rm $removelist 671 exit 1 672 fi 673 674 # Just move the object if needed 675 if test x"$output_obj" != x"$obj"; then 676 $show "$mv $output_obj $obj" 677 if $run $mv $output_obj $obj; then : 678 else 679 error=$? 680 $run $rm $removelist 681 exit $error 682 fi 683 fi 684 685 # Create an invalid libtool object if no PIC, so that we do not 686 # accidentally link it into a program. 687 if test "$build_libtool_libs" != yes; then 688 $show "echo timestamp > $libobj" 689 $run eval "echo timestamp > \$libobj" || exit $? 690 else 691 # Move the .lo from within objdir 692 $show "$mv $libobj $lo_libobj" 693 if $run $mv $libobj $lo_libobj; then : 694 else 695 error=$? 696 $run $rm $removelist 697 exit $error 698 fi 699 fi 700 fi 701 702 # Unlock the critical section if it was locked 703 if test "$need_locks" != no; then 704 $run $rm "$lockfile" 705 fi 706 707 exit 0 708 ;; 709 710 # libtool link mode 711 link | relink) 712 modename="$modename: link" 713 case $