PageRenderTime 405ms CodeModel.GetById 111ms app.highlight 205ms RepoModel.GetById 56ms app.codeStats 1ms

/trunk/freefem/admin/ltmain.sh

#
Shell | 2453 lines | 2091 code | 147 blank | 215 comment | 202 complexity | 5bdc100fd4fd45e4031dc95e03e69d76 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1# ltmain.sh - Provide generalized library-building support services.
   2# NOTE: Changing this file will not affect anything until you rerun configure.
   3#
   4# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
   5# Free Software Foundation, Inc.
   6# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
   7#
   8# This program is free software; you can redistribute it and/or modify
   9# it under the terms of the GNU General Public License as published by
  10# the Free Software Foundation; either version 2 of the License, or
  11# (at your option) any later version.
  12#
  13# This program is distributed in the hope that it will be useful, but
  14# WITHOUT ANY WARRANTY; without even the implied warranty of
  15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16# General Public License for more details.
  17#
  18# You should have received a copy of the GNU General Public License
  19# along with this program; if not, write to the Free Software
  20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21#
  22# As a special exception to the GNU General Public License, if you
  23# distribute this file as part of a program that contains a
  24# configuration script generated by Autoconf, you may include it under
  25# the same distribution terms that you use for the rest of that program.
  26
  27# Check that we have a working $echo.
  28if test "X$1" = X--no-reexec; then
  29  # Discard the --no-reexec flag, and continue.
  30  shift
  31elif test "X$1" = X--fallback-echo; then
  32  # Avoid inline document here, it may be left over
  33  :
  34elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  35  # Yippee, $echo works!
  36  :
  37else
  38  # Restart under the correct shell, and then maybe $echo will work.
  39  exec $SHELL "$0" --no-reexec ${1+"$@"}
  40fi
  41
  42if test "X$1" = X--fallback-echo; then
  43  # used as fallback echo
  44  shift
  45  cat <<EOF
  46$*
  47EOF
  48  exit 0
  49fi
  50
  51# The name of this program.
  52progname=`$echo "$0" | ${SED} 's%^.*/%%'`
  53modename="$progname"
  54
  55# Constants.
  56PROGRAM=ltmain.sh
  57PACKAGE=libtool
  58VERSION=1.5.0a
  59TIMESTAMP=" (1.1220.2.25 2003/08/01 19:08:35) Debian$Rev: 206 $"
  60
  61default_mode=
  62help="Try \`$progname --help' for more information."
  63magic="%%%MAGIC variable%%%"
  64mkdir="mkdir"
  65mv="mv -f"
  66rm="rm -f"
  67
  68# Sed substitution that helps us do robust quoting.  It backslashifies
  69# metacharacters that are still active within double-quoted strings.
  70Xsed="${SED}"' -e 1s/^X//'
  71sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  72# test EBCDIC or ASCII
  73case `echo A|tr A '\301'` in
  74 A) # EBCDIC based system
  75  SP2NL="tr '\100' '\n'"
  76  NL2SP="tr '\r\n' '\100\100'"
  77  ;;
  78 *) # Assume ASCII based system
  79  SP2NL="tr '\040' '\012'"
  80  NL2SP="tr '\015\012' '\040\040'"
  81  ;;
  82esac
  83
  84# NLS nuisances.
  85# Only set LANG and LC_ALL to C if already set.
  86# These must not be set unconditionally because not all systems understand
  87# e.g. LANG=C (notably SCO).
  88# We save the old values to restore during execute mode.
  89if test "${LC_ALL+set}" = set; then
  90  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  91fi
  92if test "${LANG+set}" = set; then
  93  save_LANG="$LANG"; LANG=C; export LANG
  94fi
  95
  96# Make sure IFS has a sensible default
  97: ${IFS=" 	
  98"}
  99
 100if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
 101  $echo "$modename: not configured to build any kind of library" 1>&2
 102  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
 103  exit 1
 104fi
 105
 106# Global variables.
 107mode=$default_mode
 108nonopt=
 109prev=
 110prevopt=
 111run=
 112show="$echo"
 113show_help=
 114execute_dlfiles=
 115lo2o="s/\\.lo\$/.${objext}/"
 116o2lo="s/\\.${objext}\$/.lo/"
 117
 118#####################################
 119# Shell function definitions:
 120# This seems to be the best place for them
 121
 122# Need a lot of goo to handle *both* DLLs and import libs
 123# Has to be a shell function in order to 'eat' the argument
 124# that is supplied when $file_magic_command is called.
 125win32_libid () {
 126  win32_libid_type="unknown"
 127  win32_fileres=`file -L $1 2>/dev/null`
 128  case $win32_fileres in
 129  *ar\ archive\ import\ library*) # definitely import
 130    win32_libid_type="x86 archive import"
 131    ;;
 132  *ar\ archive*) # could be an import, or static
 133    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
 134      grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
 135      win32_nmres=`eval $NM -f posix -A $1 | \
 136	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
 137      if test "X$win32_nmres" = "Ximport" ; then
 138        win32_libid_type="x86 archive import"
 139      else
 140        win32_libid_type="x86 archive static"
 141      fi
 142    fi
 143    ;;
 144  *DLL*) 
 145    win32_libid_type="x86 DLL"
 146    ;;
 147  *executable*) # but shell scripts are "executable" too...
 148    case $win32_fileres in
 149    *MS\ Windows\ PE\ Intel*)
 150      win32_libid_type="x86 DLL"
 151      ;;
 152    esac
 153    ;;
 154  esac
 155  $echo $win32_libid_type
 156}
 157
 158# End of Shell function definitions
 159#####################################
 160
 161# Parse our command line options once, thoroughly.
 162while test "$#" -gt 0
 163do
 164  arg="$1"
 165  shift
 166
 167  case $arg in
 168  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
 169  *) optarg= ;;
 170  esac
 171
 172  # If the previous option needs an argument, assign it.
 173  if test -n "$prev"; then
 174    case $prev in
 175    execute_dlfiles)
 176      execute_dlfiles="$execute_dlfiles $arg"
 177      ;;
 178    tag)
 179      tagname="$arg"
 180
 181      # Check whether tagname contains only valid characters
 182      case $tagname in
 183      *[!-_A-Za-z0-9,/]*)
 184	$echo "$progname: invalid tag name: $tagname" 1>&2
 185	exit 1
 186	;;
 187      esac
 188
 189      case $tagname in
 190      CC)
 191	# Don't test for the "default" C tag, as we know, it's there, but
 192	# not specially marked.
 193	;;
 194      *)
 195	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
 196	  taglist="$taglist $tagname"
 197	  # Evaluate the configuration.
 198	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
 199	else
 200	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
 201	fi
 202	;;
 203      esac
 204      ;;
 205    *)
 206      eval "$prev=\$arg"
 207      ;;
 208    esac
 209
 210    prev=
 211    prevopt=
 212    continue
 213  fi
 214
 215  # Have we seen a non-optional argument yet?
 216  case $arg in
 217  --help)
 218    show_help=yes
 219    ;;
 220
 221  --version)
 222    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
 223    $echo
 224    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
 225    $echo "This is free software; see the source for copying conditions.  There is NO"
 226    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 227    exit 0
 228    ;;
 229
 230  --config)
 231    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
 232    # Now print the configurations for the tags.
 233    for tagname in $taglist; do
 234      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
 235    done
 236    exit 0
 237    ;;
 238
 239  --debug)
 240    $echo "$progname: enabling shell trace mode"
 241    set -x
 242    ;;
 243
 244  --dry-run | -n)
 245    run=:
 246    ;;
 247
 248  --features)
 249    $echo "host: $host"
 250    if test "$build_libtool_libs" = yes; then
 251      $echo "enable shared libraries"
 252    else
 253      $echo "disable shared libraries"
 254    fi
 255    if test "$build_old_libs" = yes; then
 256      $echo "enable static libraries"
 257    else
 258      $echo "disable static libraries"
 259    fi
 260    exit 0
 261    ;;
 262
 263  --finish) mode="finish" ;;
 264
 265  --mode) prevopt="--mode" prev=mode ;;
 266  --mode=*) mode="$optarg" ;;
 267
 268  --preserve-dup-deps) duplicate_deps="yes" ;;
 269
 270  --quiet | --silent)
 271    show=:
 272    ;;
 273
 274  --tag) prevopt="--tag" prev=tag ;;
 275  --tag=*)
 276    set tag "$optarg" ${1+"$@"}
 277    shift
 278    prev=tag
 279    ;;
 280
 281  -dlopen)
 282    prevopt="-dlopen"
 283    prev=execute_dlfiles
 284    ;;
 285
 286  -*)
 287    $echo "$modename: unrecognized option \`$arg'" 1>&2
 288    $echo "$help" 1>&2
 289    exit 1
 290    ;;
 291
 292  *)
 293    nonopt="$arg"
 294    break
 295    ;;
 296  esac
 297done
 298
 299if test -n "$prevopt"; then
 300  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
 301  $echo "$help" 1>&2
 302  exit 1
 303fi
 304
 305# If this variable is set in any of the actions, the command in it
 306# will be execed at the end.  This prevents here-documents from being
 307# left over by shells.
 308exec_cmd=
 309
 310if test -z "$show_help"; then
 311
 312  # Infer the operation mode.
 313  if test -z "$mode"; then
 314    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
 315    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
 316    case $nonopt in
 317    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
 318      mode=link
 319      for arg
 320      do
 321	case $arg in
 322	-c)
 323	   mode=compile
 324	   break
 325	   ;;
 326	esac
 327      done
 328      ;;
 329    *db | *dbx | *strace | *truss)
 330      mode=execute
 331      ;;
 332    *install*|cp|mv)
 333      mode=install
 334      ;;
 335    *rm)
 336      mode=uninstall
 337      ;;
 338    *)
 339      # If we have no mode, but dlfiles were specified, then do execute mode.
 340      test -n "$execute_dlfiles" && mode=execute
 341
 342      # Just use the default operation mode.
 343      if test -z "$mode"; then
 344	if test -n "$nonopt"; then
 345	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
 346	else
 347	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
 348	fi
 349      fi
 350      ;;
 351    esac
 352  fi
 353
 354  # Only execute mode is allowed to have -dlopen flags.
 355  if test -n "$execute_dlfiles" && test "$mode" != execute; then
 356    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
 357    $echo "$help" 1>&2
 358    exit 1
 359  fi
 360
 361  # Change the help message to a mode-specific one.
 362  generic_help="$help"
 363  help="Try \`$modename --help --mode=$mode' for more information."
 364
 365  # These modes are in order of execution frequency so that they run quickly.
 366  case $mode in
 367  # libtool compile mode
 368  compile)
 369    modename="$modename: compile"
 370    # Get the compilation command and the source file.
 371    base_compile=
 372    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
 373    suppress_output=
 374    arg_mode=normal
 375    libobj=
 376
 377    for arg
 378    do
 379      case "$arg_mode" in
 380      arg  )
 381	# do not "continue".  Instead, add this to base_compile
 382	lastarg="$arg"
 383	arg_mode=normal
 384	;;
 385
 386      target )
 387	libobj="$arg"
 388	arg_mode=normal
 389	continue
 390	;;
 391
 392      normal )
 393	# Accept any command-line options.
 394	case $arg in
 395	-o)
 396	  if test -n "$libobj" ; then
 397	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
 398	    exit 1
 399	  fi
 400	  arg_mode=target
 401	  continue
 402	  ;;
 403
 404	-static)
 405	  build_old_libs=yes
 406	  continue
 407	  ;;
 408
 409	-prefer-pic)
 410	  pic_mode=yes
 411	  continue
 412	  ;;
 413
 414	-prefer-non-pic)
 415	  pic_mode=no
 416	  continue
 417	  ;;
 418
 419	-Xcompiler)
 420	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
 421	  continue      #  The current "srcfile" will either be retained or
 422	  ;;            #  replaced later.  I would guess that would be a bug.
 423
 424	-Wc,*)
 425	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
 426	  lastarg=
 427	  save_ifs="$IFS"; IFS=','
 428	  for arg in $args; do
 429	    IFS="$save_ifs"
 430
 431	    # Double-quote args containing other shell metacharacters.
 432	    # Many Bourne shells cannot handle close brackets correctly
 433	    # in scan sets, so we specify it separately.
 434	    case $arg in
 435	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 436	      arg="\"$arg\""
 437	      ;;
 438	    esac
 439	    lastarg="$lastarg $arg"
 440	  done
 441	  IFS="$save_ifs"
 442	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
 443
 444	  # Add the arguments to base_compile.
 445	  base_compile="$base_compile $lastarg"
 446	  continue
 447	  ;;
 448
 449	* )
 450	  # Accept the current argument as the source file.
 451	  # The previous "srcfile" becomes the current argument.
 452	  #
 453	  lastarg="$srcfile"
 454	  srcfile="$arg"
 455	  ;;
 456	esac  #  case $arg
 457	;;
 458      esac    #  case $arg_mode
 459
 460      # Aesthetically quote the previous argument.
 461      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
 462
 463      case $lastarg in
 464      # Double-quote args containing other shell metacharacters.
 465      # Many Bourne shells cannot handle close brackets correctly
 466      # in scan sets, so we specify it separately.
 467      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 468	lastarg="\"$lastarg\""
 469	;;
 470      esac
 471
 472      base_compile="$base_compile $lastarg"
 473    done # for arg
 474
 475    case $arg_mode in
 476    arg)
 477      $echo "$modename: you must specify an argument for -Xcompile"
 478      exit 1
 479      ;;
 480    target)
 481      $echo "$modename: you must specify a target with \`-o'" 1>&2
 482      exit 1
 483      ;;
 484    *)
 485      # Get the name of the library object.
 486      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
 487      ;;
 488    esac
 489
 490    # Recognize several different file suffixes.
 491    # If the user specifies -o file.o, it is replaced with file.lo
 492    xform='[cCFSifmso]'
 493    case $libobj in
 494    *.ada) xform=ada ;;
 495    *.adb) xform=adb ;;
 496    *.ads) xform=ads ;;
 497    *.asm) xform=asm ;;
 498    *.c++) xform=c++ ;;
 499    *.cc) xform=cc ;;
 500    *.ii) xform=ii ;;
 501    *.class) xform=class ;;
 502    *.cpp) xform=cpp ;;
 503    *.cxx) xform=cxx ;;
 504    *.f90) xform=f90 ;;
 505    *.for) xform=for ;;
 506    *.java) xform=java ;;
 507    esac
 508
 509    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
 510
 511    case $libobj in
 512    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
 513    *)
 514      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
 515      exit 1
 516      ;;
 517    esac
 518
 519    # Infer tagged configuration to use if any are available and
 520    # if one wasn't chosen via the "--tag" command line option.
 521    # Only attempt this if the compiler in the base compile
 522    # command doesn't match the default compiler.
 523    if test -n "$available_tags" && test -z "$tagname"; then
 524      case $base_compile in
 525      # Blanks in the command may have been stripped by the calling shell,
 526      # but not from the CC environment variable when configure was run.
 527      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
 528      # Blanks at the start of $base_compile will cause this to fail
 529      # if we don't check for them as well.
 530      *)
 531	for z in $available_tags; do
 532	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
 533	    # Evaluate the configuration.
 534	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
 535	    case "$base_compile " in
 536	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
 537	      # The compiler in the base compile command matches
 538	      # the one in the tagged configuration.
 539	      # Assume this is the tagged configuration we want.
 540	      tagname=$z
 541	      break
 542	      ;;
 543	    esac
 544	  fi
 545	done
 546	# If $tagname still isn't set, then no tagged configuration
 547	# was found and let the user know that the "--tag" command
 548	# line option must be used.
 549	if test -z "$tagname"; then
 550	  $echo "$modename: unable to infer tagged configuration"
 551	  $echo "$modename: specify a tag with \`--tag'" 1>&2
 552	  exit 1
 553#        else
 554#          $echo "$modename: using $tagname tagged configuration"
 555	fi
 556	;;
 557      esac
 558    fi
 559
 560    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
 561    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
 562    if test "X$xdir" = "X$obj"; then
 563      xdir=
 564    else
 565      xdir=$xdir/
 566    fi
 567    lobj=${xdir}$objdir/$objname
 568
 569    if test -z "$base_compile"; then
 570      $echo "$modename: you must specify a compilation command" 1>&2
 571      $echo "$help" 1>&2
 572      exit 1
 573    fi
 574
 575    # Delete any leftover library objects.
 576    if test "$build_old_libs" = yes; then
 577      removelist="$obj $lobj $libobj ${libobj}T"
 578    else
 579      removelist="$lobj $libobj ${libobj}T"
 580    fi
 581
 582    $run $rm $removelist
 583    trap "$run $rm $removelist; exit 1" 1 2 15
 584
 585    # On Cygwin there's no "real" PIC flag so we must build both object types
 586    case $host_os in
 587    cygwin* | mingw* | pw32* | os2*)
 588      pic_mode=default
 589      ;;
 590    esac
 591    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
 592      # non-PIC code in shared libraries is not supported
 593      pic_mode=default
 594    fi
 595
 596    # Calculate the filename of the output object if compiler does
 597    # not support -o with -c
 598    if test "$compiler_c_o" = no; then
 599      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
 600      lockfile="$output_obj.lock"
 601      removelist="$removelist $output_obj $lockfile"
 602      trap "$run $rm $removelist; exit 1" 1 2 15
 603    else
 604      output_obj=
 605      need_locks=no
 606      lockfile=
 607    fi
 608
 609    # Lock this critical section if it is needed
 610    # We use this script file to make the link, it avoids creating a new file
 611    if test "$need_locks" = yes; then
 612      until $run ln "$0" "$lockfile" 2>/dev/null; do
 613	$show "Waiting for $lockfile to be removed"
 614	sleep 2
 615      done
 616    elif test "$need_locks" = warn; then
 617      if test -f "$lockfile"; then
 618	$echo "\
 619*** ERROR, $lockfile exists and contains:
 620`cat $lockfile 2>/dev/null`
 621
 622This indicates that another process is trying to use the same
 623temporary object file, and libtool could not work around it because
 624your compiler does not support \`-c' and \`-o' together.  If you
 625repeat this compilation, it may succeed, by chance, but you had better
 626avoid parallel builds (make -j) in this platform, or get a better
 627compiler."
 628
 629	$run $rm $removelist
 630	exit 1
 631      fi
 632      $echo $srcfile > "$lockfile"
 633    fi
 634
 635    if test -n "$fix_srcfile_path"; then
 636      eval srcfile=\"$fix_srcfile_path\"
 637    fi
 638
 639    $run $rm "$libobj" "${libobj}T"
 640
 641    # Create a libtool object file (analogous to a ".la" file),
 642    # but don't create it if we're doing a dry run.
 643    test -z "$run" && cat > ${libobj}T <<EOF
 644# $libobj - a libtool object file
 645# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
 646#
 647# Please DO NOT delete this file!
 648# It is necessary for linking the library.
 649
 650# Name of the PIC object.
 651EOF
 652
 653    # Only build a PIC object if we are building libtool libraries.
 654    if test "$build_libtool_libs" = yes; then
 655      # Without this assignment, base_compile gets emptied.
 656      fbsd_hideous_sh_bug=$base_compile
 657
 658      if test "$pic_mode" != no; then
 659	command="$base_compile $srcfile $pic_flag"
 660      else
 661	# Don't build PIC code
 662	command="$base_compile $srcfile"
 663      fi
 664
 665      if test ! -d "${xdir}$objdir"; then
 666	$show "$mkdir ${xdir}$objdir"
 667	$run $mkdir ${xdir}$objdir
 668	status=$?
 669	if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
 670	  exit $status
 671	fi
 672      fi
 673
 674      if test -z "$output_obj"; then
 675	# Place PIC objects in $objdir
 676	command="$command -o $lobj"
 677      fi
 678
 679      $run $rm "$lobj" "$output_obj"
 680
 681      $show "$command"
 682      if $run eval "$command"; then :
 683      else
 684	test -n "$output_obj" && $run $rm $removelist
 685	exit 1
 686      fi
 687
 688      if test "$need_locks" = warn &&
 689	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 690	$echo "\
 691*** ERROR, $lockfile contains:
 692`cat $lockfile 2>/dev/null`
 693
 694but it should contain:
 695$srcfile
 696
 697This indicates that another process is trying to use the same
 698temporary object file, and libtool could not work around it because
 699your compiler does not support \`-c' and \`-o' together.  If you
 700repeat this compilation, it may succeed, by chance, but you had better
 701avoid parallel builds (make -j) in this platform, or get a better
 702compiler."
 703
 704	$run $rm $removelist
 705	exit 1
 706      fi
 707
 708      # Just move the object if needed, then go on to compile the next one
 709      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
 710	$show "$mv $output_obj $lobj"
 711	if $run $mv $output_obj $lobj; then :
 712	else
 713	  error=$?
 714	  $run $rm $removelist
 715	  exit $error
 716	fi
 717      fi
 718
 719      # Append the name of the PIC object to the libtool object file.
 720      test -z "$run" && cat >> ${libobj}T <<EOF
 721pic_object='$objdir/$objname'
 722
 723EOF
 724
 725      # Allow error messages only from the first compilation.
 726      suppress_output=' >/dev/null 2>&1'
 727    else
 728      # No PIC object so indicate it doesn't exist in the libtool
 729      # object file.
 730      test -z "$run" && cat >> ${libobj}T <<EOF
 731pic_object=none
 732
 733EOF
 734    fi
 735
 736    # Only build a position-dependent object if we build old libraries.
 737    if test "$build_old_libs" = yes; then
 738      if test "$pic_mode" != yes; then
 739	# Don't build PIC code
 740	command="$base_compile $srcfile"
 741      else
 742	command="$base_compile $srcfile $pic_flag"
 743      fi
 744      if test "$compiler_c_o" = yes; then
 745	command="$command -o $obj"
 746      fi
 747
 748      # Suppress compiler output if we already did a PIC compilation.
 749      command="$command$suppress_output"
 750      $run $rm "$obj" "$output_obj"
 751      $show "$command"
 752      if $run eval "$command"; then :
 753      else
 754	$run $rm $removelist
 755	exit 1
 756      fi
 757
 758      if test "$need_locks" = warn &&
 759	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 760	$echo "\
 761*** ERROR, $lockfile contains:
 762`cat $lockfile 2>/dev/null`
 763
 764but it should contain:
 765$srcfile
 766
 767This indicates that another process is trying to use the same
 768temporary object file, and libtool could not work around it because
 769your compiler does not support \`-c' and \`-o' together.  If you
 770repeat this compilation, it may succeed, by chance, but you had better
 771avoid parallel builds (make -j) in this platform, or get a better
 772compiler."
 773
 774	$run $rm $removelist
 775	exit 1
 776      fi
 777
 778      # Just move the object if needed
 779      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
 780	$show "$mv $output_obj $obj"
 781	if $run $mv $output_obj $obj; then :
 782	else
 783	  error=$?
 784	  $run $rm $removelist
 785	  exit $error
 786	fi
 787      fi
 788
 789      # Append the name of the non-PIC object the libtool object file.
 790      # Only append if the libtool object file exists.
 791      test -z "$run" && cat >> ${libobj}T <<EOF
 792# Name of the non-PIC object.
 793non_pic_object='$objname'
 794
 795EOF
 796    else
 797      # Append the name of the non-PIC object the libtool object file.
 798      # Only append if the libtool object file exists.
 799      test -z "$run" && cat >> ${libobj}T <<EOF
 800# Name of the non-PIC object.
 801non_pic_object=none
 802
 803EOF
 804    fi
 805
 806    $run $mv "${libobj}T" "${libobj}"
 807
 808    # Unlock the critical section if it was locked
 809    if test "$need_locks" != no; then
 810      $run $rm "$lockfile"
 811    fi
 812
 813    exit 0
 814    ;;
 815
 816  # libtool link mode
 817  link | relink)
 818    modename="$modename: link"
 819    case $host in
 820    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 821      # It is impossible to link a dll without this setting, and
 822      # we shouldn't force the makefile maintainer to figure out
 823      # which system we are compiling for in order to pass an extra
 824      # flag for every libtool invocation.
 825      # allow_undefined=no
 826
 827      # FIXME: Unfortunately, there are problems with the above when trying
 828      # to make a dll which has undefined symbols, in which case not
 829      # even a static library is built.  For now, we need to specify
 830      # -no-undefined on the libtool link line when we can be certain
 831      # that all symbols are satisfied, otherwise we get a static library.
 832      allow_undefined=yes
 833      ;;
 834    *)
 835      allow_undefined=yes
 836      ;;
 837    esac
 838    libtool_args="$nonopt"
 839    base_compile="$nonopt"
 840    compile_command="$nonopt"
 841    finalize_command="$nonopt"
 842
 843    compile_rpath=
 844    finalize_rpath=
 845    compile_shlibpath=
 846    finalize_shlibpath=
 847    convenience=
 848    old_convenience=
 849    deplibs=
 850    old_deplibs=
 851    compiler_flags=
 852    linker_flags=
 853    dllsearchpath=
 854    lib_search_path=`pwd`
 855    inst_prefix_dir=
 856
 857    avoid_version=no
 858    dlfiles=
 859    dlprefiles=
 860    dlself=no
 861    export_dynamic=no
 862    export_symbols=
 863    export_symbols_regex=
 864    generated=
 865    libobjs=
 866    ltlibs=
 867    module=no
 868    no_install=no
 869    objs=
 870    non_pic_objects=
 871    prefer_static_libs=no
 872    preload=no
 873    prev=
 874    prevarg=
 875    release=
 876    rpath=
 877    xrpath=
 878    perm_rpath=
 879    temp_rpath=
 880    thread_safe=no
 881    vinfo=
 882    vinfo_number=no
 883
 884    # We need to know -static, to get the right output filenames.
 885    for arg
 886    do
 887      case $arg in
 888      -all-static | -static)
 889	if test "X$arg" = "X-all-static"; then
 890	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
 891	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
 892	  fi
 893	  if test -n "$link_static_flag"; then
 894	    dlopen_self=$dlopen_self_static
 895	  fi
 896	else
 897	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
 898	    dlopen_self=$dlopen_self_static
 899	  fi
 900	fi
 901	build_libtool_libs=no
 902	build_old_libs=yes
 903	prefer_static_libs=yes
 904	break
 905	;;
 906      esac
 907    done
 908
 909    # See if our shared archives depend on static archives.
 910    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
 911
 912    # Go through the arguments, transforming them on the way.
 913    while test "$#" -gt 0; do
 914      arg="$1"
 915      base_compile="$base_compile $arg"
 916      shift
 917      case $arg in
 918      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
 919	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
 920	;;
 921      *) qarg=$arg ;;
 922      esac
 923      libtool_args="$libtool_args $qarg"
 924
 925      # If the previous option needs an argument, assign it.
 926      if test -n "$prev"; then
 927	case $prev in
 928	output)
 929	  compile_command="$compile_command @OUTPUT@"
 930	  finalize_command="$finalize_command @OUTPUT@"
 931	  ;;
 932	esac
 933
 934	case $prev in
 935	dlfiles|dlprefiles)
 936	  if test "$preload" = no; then
 937	    # Add the symbol object into the linking commands.
 938	    compile_command="$compile_command @SYMFILE@"
 939	    finalize_command="$finalize_command @SYMFILE@"
 940	    preload=yes
 941	  fi
 942	  case $arg in
 943	  *.la | *.lo) ;;  # We handle these cases below.
 944	  force)
 945	    if test "$dlself" = no; then
 946	      dlself=needless
 947	      export_dynamic=yes
 948	    fi
 949	    prev=
 950	    continue
 951	    ;;
 952	  self)
 953	    if test "$prev" = dlprefiles; then
 954	      dlself=yes
 955	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
 956	      dlself=yes
 957	    else
 958	      dlself=needless
 959	      export_dynamic=yes
 960	    fi
 961	    prev=
 962	    continue
 963	    ;;
 964	  *)
 965	    if test "$prev" = dlfiles; then
 966	      dlfiles="$dlfiles $arg"
 967	    else
 968	      dlprefiles="$dlprefiles $arg"
 969	    fi
 970	    prev=
 971	    continue
 972	    ;;
 973	  esac
 974	  ;;
 975	expsyms)
 976	  export_symbols="$arg"
 977	  if test ! -f "$arg"; then
 978	    $echo "$modename: symbol file \`$arg' does not exist"
 979	    exit 1
 980	  fi
 981	  prev=
 982	  continue
 983	  ;;
 984	expsyms_regex)
 985	  export_symbols_regex="$arg"
 986	  prev=
 987	  continue
 988	  ;;
 989	inst_prefix)
 990	  inst_prefix_dir="$arg"
 991	  prev=
 992	  continue
 993	  ;;
 994	release)
 995	  release="-$arg"
 996	  prev=
 997	  continue
 998	  ;;
 999	objectlist)
1000	  if test -f "$arg"; then
1001	    save_arg=$arg
1002	    moreargs=
1003	    for fil in `cat $save_arg`
1004	    do
1005#	      moreargs="$moreargs $fil"
1006	      arg=$fil
1007	      # A libtool-controlled object.
1008
1009	      # Check to see that this really is a libtool object.
1010	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1011		pic_object=
1012		non_pic_object=
1013
1014		# Read the .lo file
1015		# If there is no directory component, then add one.
1016		case $arg in
1017		*/* | *\\*) . $arg ;;
1018		*) . ./$arg ;;
1019		esac
1020
1021		if test -z "$pic_object" || \
1022		   test -z "$non_pic_object" ||
1023		   test "$pic_object" = none && \
1024		   test "$non_pic_object" = none; then
1025		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1026		  exit 1
1027		fi
1028
1029		# Extract subdirectory from the argument.
1030		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1031		if test "X$xdir" = "X$arg"; then
1032		  xdir=
1033		else
1034		  xdir="$xdir/"
1035		fi
1036
1037		if test "$pic_object" != none; then
1038		  # Prepend the subdirectory the object is found in.
1039		  pic_object="$xdir$pic_object"
1040
1041		  if test "$prev" = dlfiles; then
1042		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1043		      dlfiles="$dlfiles $pic_object"
1044		      prev=
1045		      continue
1046		    else
1047		      # If libtool objects are unsupported, then we need to preload.
1048		      prev=dlprefiles
1049		    fi
1050		  fi
1051
1052		  # CHECK ME:  I think I busted this.  -Ossama
1053		  if test "$prev" = dlprefiles; then
1054		    # Preload the old-style object.
1055		    dlprefiles="$dlprefiles $pic_object"
1056		    prev=
1057		  fi
1058
1059		  # A PIC object.
1060		  libobjs="$libobjs $pic_object"
1061		  arg="$pic_object"
1062		fi
1063
1064		# Non-PIC object.
1065		if test "$non_pic_object" != none; then
1066		  # Prepend the subdirectory the object is found in.
1067		  non_pic_object="$xdir$non_pic_object"
1068
1069		  # A standard non-PIC object
1070		  non_pic_objects="$non_pic_objects $non_pic_object"
1071		  if test -z "$pic_object" || test "$pic_object" = none ; then
1072		    arg="$non_pic_object"
1073		  fi
1074		fi
1075	      else
1076		# Only an error if not doing a dry-run.
1077		if test -z "$run"; then
1078		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1079		  exit 1
1080		else
1081		  # Dry-run case.
1082
1083		  # Extract subdirectory from the argument.
1084		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1085		  if test "X$xdir" = "X$arg"; then
1086		    xdir=
1087		  else
1088		    xdir="$xdir/"
1089		  fi
1090
1091		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1092		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1093		  libobjs="$libobjs $pic_object"
1094		  non_pic_objects="$non_pic_objects $non_pic_object"
1095		fi
1096	      fi
1097	    done
1098	  else
1099	    $echo "$modename: link input file \`$save_arg' does not exist"
1100	    exit 1
1101	  fi
1102	  arg=$save_arg
1103	  prev=
1104	  continue
1105	  ;;
1106	rpath | xrpath)
1107	  # We need an absolute path.
1108	  case $arg in
1109	  [\\/]* | [A-Za-z]:[\\/]*) ;;
1110	  *)
1111	    $echo "$modename: only absolute run-paths are allowed" 1>&2
1112	    exit 1
1113	    ;;
1114	  esac
1115	  if test "$prev" = rpath; then
1116	    case "$rpath " in
1117	    *" $arg "*) ;;
1118	    *) rpath="$rpath $arg" ;;
1119	    esac
1120	  else
1121	    case "$xrpath " in
1122	    *" $arg "*) ;;
1123	    *) xrpath="$xrpath $arg" ;;
1124	    esac
1125	  fi
1126	  prev=
1127	  continue
1128	  ;;
1129	xcompiler)
1130	  compiler_flags="$compiler_flags $qarg"
1131	  prev=
1132	  compile_command="$compile_command $qarg"
1133	  finalize_command="$finalize_command $qarg"
1134	  continue
1135	  ;;
1136	xlinker)
1137	  linker_flags="$linker_flags $qarg"
1138	  compiler_flags="$compiler_flags $wl$qarg"
1139	  prev=
1140	  compile_command="$compile_command $wl$qarg"
1141	  finalize_command="$finalize_command $wl$qarg"
1142	  continue
1143	  ;;
1144	xcclinker)
1145	  linker_flags="$linker_flags $qarg"
1146	  compiler_flags="$compiler_flags $qarg"
1147	  prev=
1148	  compile_command="$compile_command $qarg"
1149	  finalize_command="$finalize_command $qarg"
1150	  continue
1151	  ;;
1152	*)
1153	  eval "$prev=\"\$arg\""
1154	  prev=
1155	  continue
1156	  ;;
1157	esac
1158      fi # test -n "$prev"
1159
1160      prevarg="$arg"
1161
1162      case $arg in
1163      -all-static)
1164	if test -n "$link_static_flag"; then
1165	  compile_command="$compile_command $link_static_flag"
1166	  finalize_command="$finalize_command $link_static_flag"
1167	fi
1168	continue
1169	;;
1170
1171      -allow-undefined)
1172	# FIXME: remove this flag sometime in the future.
1173	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1174	continue
1175	;;
1176
1177      -avoid-version)
1178	avoid_version=yes
1179	continue
1180	;;
1181
1182      -dlopen)
1183	prev=dlfiles
1184	continue
1185	;;
1186
1187      -dlpreopen)
1188	prev=dlprefiles
1189	continue
1190	;;
1191
1192      -export-dynamic)
1193	export_dynamic=yes
1194	continue
1195	;;
1196
1197      -export-symbols | -export-symbols-regex)
1198	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1199	  $echo "$modename: more than one -exported-symbols argument is not allowed"
1200	  exit 1
1201	fi
1202	if test "X$arg" = "X-export-symbols"; then
1203	  prev=expsyms
1204	else
1205	  prev=expsyms_regex
1206	fi
1207	continue
1208	;;
1209
1210      -inst-prefix-dir)
1211	prev=inst_prefix
1212	continue
1213	;;
1214
1215      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1216      # so, if we see these flags be careful not to treat them like -L
1217      -L[A-Z][A-Z]*:*)
1218	case $with_gcc/$host in
1219	no/*-*-irix* | /*-*-irix*)
1220	  compile_command="$compile_command $arg"
1221	  finalize_command="$finalize_command $arg"
1222	  ;;
1223	esac
1224	continue
1225	;;
1226
1227      -L*)
1228	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1229	# We need an absolute path.
1230	case $dir in
1231	[\\/]* | [A-Za-z]:[\\/]*) ;;
1232	*)
1233	  absdir=`cd "$dir" && pwd`
1234	  if test -z "$absdir"; then
1235	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1236	    exit 1
1237	  fi
1238	  dir="$absdir"
1239	  ;;
1240	esac
1241	case "$deplibs " in
1242	*" -L$dir "*) ;;
1243	*)
1244	  deplibs="$deplibs -L$dir"
1245	  lib_search_path="$lib_search_path $dir"
1246	  ;;
1247	esac
1248	case $host in
1249	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1250	  case :$dllsearchpath: in
1251	  *":$dir:"*) ;;
1252	  *) dllsearchpath="$dllsearchpath:$dir";;
1253	  esac
1254	  ;;
1255	esac
1256	continue
1257	;;
1258
1259      -l*)
1260	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1261	  case $host in
1262	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
1263	    # These systems don't actually have a C or math library (as such)
1264	    continue
1265	    ;;
1266	  *-*-mingw* | *-*-os2*)
1267	    # These systems don't actually have a C library (as such)
1268	    test "X$arg" = "X-lc" && continue
1269	    ;;
1270	  *-*-openbsd* | *-*-freebsd*)
1271	    # Do not include libc due to us having libc/libc_r.
1272	    test "X$arg" = "X-lc" && continue
1273	    ;;
1274	  *-*-rhapsody* | *-*-darwin1.[012])
1275	    # Rhapsody C and math libraries are in the System framework
1276	    deplibs="$deplibs -framework System"
1277	    continue
1278	  esac
1279	elif test "X$arg" = "X-lc_r"; then
1280	 case $host in
1281	 *-*-openbsd* | *-*-freebsd*)
1282	   # Do not include libc_r directly, use -pthread flag.
1283	   continue
1284	   ;;
1285	 esac
1286	fi
1287	deplibs="$deplibs $arg"
1288	continue
1289	;;
1290
1291      -module)
1292	module=yes
1293	continue
1294	;;
1295
1296      # gcc -m* arguments should be passed to the linker via $compiler_flags
1297      # in order to pass architecture information to the linker
1298      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
1299      # but this is not reliable with gcc because gcc may use -mfoo to
1300      # select a different linker, different libraries, etc, while
1301      # -Wl,-mfoo simply passes -mfoo to the linker.
1302      -m*)
1303	# Unknown arguments in both finalize_command and compile_command need
1304	# to be aesthetically quoted because they are evaled later.
1305	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1306	case $arg in
1307	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1308	  arg="\"$arg\""
1309	  ;;
1310	esac
1311        compile_command="$compile_command $arg"
1312        finalize_command="$finalize_command $arg"
1313        if test "$with_gcc" = "yes" ; then
1314          compiler_flags="$compiler_flags $arg"
1315        fi
1316        continue
1317        ;;
1318
1319      -shrext)
1320	prev=shrext
1321	continue
1322	;;
1323
1324      -no-fast-install)
1325	fast_install=no
1326	continue
1327	;;
1328
1329      -no-install)
1330	case $host in
1331	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1332	  # The PATH hackery in wrapper scripts is required on Windows
1333	  # in order for the loader to find any dlls it needs.
1334	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1335	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1336	  fast_install=no
1337	  ;;
1338	*) no_install=yes ;;
1339	esac
1340	continue
1341	;;
1342
1343      -no-undefined)
1344	allow_undefined=no
1345	continue
1346	;;
1347
1348      -objectlist)
1349	prev=objectlist
1350	continue
1351	;;
1352
1353      -o) prev=output ;;
1354
1355      -release)
1356	prev=release
1357	continue
1358	;;
1359
1360      -rpath)
1361	prev=rpath
1362	continue
1363	;;
1364
1365      -R)
1366	prev=xrpath
1367	continue
1368	;;
1369
1370      -R*)
1371	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1372	# We need an absolute path.
1373	case $dir in
1374	[\\/]* | [A-Za-z]:[\\/]*) ;;
1375	*)
1376	  $echo "$modename: only absolute run-paths are allowed" 1>&2
1377	  exit 1
1378	  ;;
1379	esac
1380	case "$xrpath " in
1381	*" $dir "*) ;;
1382	*) xrpath="$xrpath $dir" ;;
1383	esac
1384	continue
1385	;;
1386
1387      -static)
1388	# The effects of -static are defined in a previous loop.
1389	# We used to do the same as -all-static on platforms that
1390	# didn't have a PIC flag, but the assumption that the effects
1391	# would be equivalent was wrong.  It would break on at least
1392	# Digital Unix and AIX.
1393	continue
1394	;;
1395
1396      -thread-safe)
1397	thread_safe=yes
1398	continue
1399	;;
1400
1401      -version-info)
1402	prev=vinfo
1403	continue
1404	;;
1405      -version-number)
1406	prev=vinfo
1407	vinfo_number=yes
1408	continue
1409	;;
1410
1411      -Wc,*)
1412	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1413	arg=
1414	save_ifs="$IFS"; IFS=','
1415	for flag in $args; do
1416	  IFS="$save_ifs"
1417	  case $flag in
1418	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1419	    flag="\"$flag\""
1420	    ;;
1421	  esac
1422	  arg="$arg $wl$flag"
1423	  compiler_flags="$compiler_flags $flag"
1424	done
1425	IFS="$save_ifs"
1426	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1427	;;
1428
1429      -Wl,*)
1430	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1431	arg=
1432	save_ifs="$IFS"; IFS=','
1433	for flag in $args; do
1434	  IFS="$save_ifs"
1435	  case $flag in
1436	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1437	    flag="\"$flag\""
1438	    ;;
1439	  esac
1440	  arg="$arg $wl$flag"
1441	  compiler_flags="$compiler_flags $wl$flag"
1442	  linker_flags="$linker_flags $flag"
1443	done
1444	IFS="$save_ifs"
1445	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1446	;;
1447
1448      -Xcompiler)
1449	prev=xcompiler
1450	continue
1451	;;
1452
1453      -Xlinker)
1454	prev=xlinker
1455	continue
1456	;;
1457
1458      -XCClinker)
1459	prev=xcclinker
1460	continue
1461	;;
1462
1463      # Some other compiler flag.
1464      -* | +*)
1465	# Unknown arguments in both finalize_command and compile_command need
1466	# to be aesthetically quoted because they are evaled later.
1467	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1468	case $arg in
1469	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1470	  arg="\"$arg\""
1471	  ;;
1472	esac
1473	;;
1474
1475      *.$objext)
1476	# A standard object.
1477	objs="$objs $arg"
1478	;;
1479
1480      *.lo)
1481	# A libtool-controlled object.
1482
1483	# Check to see that this really is a libtool object.
1484	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1485	  pic_object=
1486	  non_pic_object=
1487
1488	  # Read the .lo file
1489	  # If there is no directory component, then add one.
1490	  case $arg in
1491	  */* | *\\*) . $arg ;;
1492	  *) . ./$arg ;;
1493	  esac
1494
1495	  if test -z "$pic_object" || \
1496	     test -z "$non_pic_object" ||
1497	     test "$pic_object" = none && \
1498	     test "$non_pic_object" = none; then
1499	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1500	    exit 1
1501	  fi
1502
1503	  # Extract subdirectory from the argument.
1504	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1505	  if test "X$xdir" = "X$arg"; then
1506	    xdir=
1507 	  else
1508	    xdir="$xdir/"
1509	  fi
1510
1511	  if test "$pic_object" != none; then
1512	    # Prepend the subdirectory the object is found in.
1513	    pic_object="$xdir$pic_object"
1514
1515	    if test "$prev" = dlfiles; then
1516	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1517		dlfiles="$dlfiles $pic_object"
1518		prev=
1519		continue
1520	      else
1521		# If libtool objects are unsupported, then we need to preload.
1522		prev=dlprefiles
1523	      fi
1524	    fi
1525
1526	    # CHECK ME:  I think I busted this.  -Ossama
1527	    if test "$prev" = dlprefiles; then
1528	      # Preload the old-style object.
1529	      dlprefiles="$dlprefiles $pic_object"
1530	      prev=
1531	    fi
1532
1533	    # A PIC object.
1534	    libobjs="$libobjs $pic_object"
1535	    arg="$pic_object"
1536	  fi
1537
1538	  # Non-PIC object.
1539	  if test "$non_pic_object" != none; then
1540	    # Prepend the subdirectory the object is found in.
1541	    non_pic_object="$xdir$non_pic_object"
1542
1543	    # A standard non-PIC object
1544	    non_pic_objects="$non_pic_objects $non_pic_object"
1545	    if test -z "$pic_object" || test "$pic_object" = none ; then
1546	      arg="$non_pic_object"
1547	    fi
1548	  fi
1549	else
1550	  # Only an error if not doing a dry-run.
1551	  if test -z "$run"; then
1552	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1553	    exit 1
1554	  else
1555	    # Dry-run case.
1556
1557	    # Extract subdirectory from the argument.
1558	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1559	    if test "X$xdir" = "X$arg"; then
1560	      xdir=
1561	    else
1562	      xdir="$xdir/"
1563	    fi
1564
1565	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1566	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1567	    libobjs="$libobjs $pic_object"
1568	    non_pic_objects="$non_pic_objects $non_pic_object"
1569	  fi
1570	fi
1571	;;
1572
1573      *.$libext)
1574	# An archive.
1575	deplibs="$deplibs $arg"
1576	old_deplibs="$old_deplibs $arg"
1577	continue
1578	;;
1579
1580      *.la)
1581	# A libtool-controlled library.
1582
1583	if test "$prev" = dlfiles; then
1584	  # This library was specified with -dlopen.
1585	  dlfiles="$dlfiles $arg"
1586	  prev=
1587	elif test "$prev" = dlprefiles; then
1588	  # The library was specified with -dlpreopen.
1589	  dlprefiles="$dlprefiles $arg"
1590	  prev=
1591	else
1592	  deplibs="$deplibs $arg"
1593	fi
1594	continue
1595	;;
1596
1597      # Some other compiler argument.
1598      *)
1599	# Unknown arguments in both finalize_command and compile_command need
1600	# to be aesthetically quoted because they are evaled later.
1601	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1602	case $arg in
1603	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1604	  arg="\"$arg\""
1605	  ;;
1606	esac
1607	;;
1608      esac # arg
1609
1610      # Now actually substitute the argument into the commands.
1611      if test -n "$arg"; then
1612	compile_command="$compile_command $arg"
1613	finalize_command="$finalize_command $arg"
1614      fi
1615    done # argument parsing loop
1616
1617    if test -n "$prev"; then
1618      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1619      $echo "$help" 1>&2
1620      exit 1
1621    fi
1622
1623    # Infer tagged configuration to use if any are available and
1624    # if one wasn't chosen via the "--tag" command line option.
1625    # Only attempt this if the compiler in the base link
1626    # command doesn't match the default compiler.
1627    if test -n "$available_tags" && test -z "$tagname"; then
1628      case $base_compile in
1629      # Blanks in the command may have been stripped by the calling shell,
1630      # but not from the CC environment variable when configure was run.
1631      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1632      # Blanks at the start of $base_compile will cause this to fail
1633      # if we don't check for them as well.
1634      *)
1635	for z in $available_tags; do
1636	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1637	    # Evaluate the configuration.
1638	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1639	    case $base_compile in
1640	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1641	      # The compiler in $compile_command matches
1642	      # the one in the tagged configuration.
1643	      # Assume this is the tagged configuration we want.
1644	      tagname=$z
1645	      break
1646	      ;;
1647	    esac
1648	  fi
1649	done
1650	# If $tagname still isn't set, then no tagged configuration
1651	# was found and let the user know that the "--tag" command
1652	# line option must be used.
1653	if test -z "$tagname"; then
1654	  $echo "$modename: unable to infer tagged configuration"
1655	  $echo "$modename: specify a tag with \`--tag'" 1>&2
1656	  exit 1
1657#       else
1658#         $echo "$modename: using $tagname tagged configuration"
1659	fi
1660	;;
1661      esac
1662    fi
1663
1664    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1665      eval arg=\"$export_dynamic_flag_spec\"
1666      compile_command="$compile_command $arg"
1667      finalize_command="$finalize_command $arg"
1668    fi
1669
1670    oldlibs=
1671    # calculate the name of the file, without its directory
1672    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1673    libobjs_save="$libobjs"
1674
1675    if test -n "$shlibpath_var"; then
1676      # get the directories listed in $shlibpath_var
1677      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1678    else
1679      shlib_search_path=
1680    fi
1681    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1682    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1683
1684    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1685    if test "X$output_objdir" = "X$output"; then
1686      output_objdir="$objdir"
1687    else
1688      output_objdir="$output_objdir/$objdir"
1689    fi
1690    # Create the object directory.
1691    if test ! -d "$output_objdir"; then
1692      $show "$mkdir $output_objdir"
1693      $run $mkdir $output_objdir
1694      status=$?
1695      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1696	exit $status
1697      fi
1698    fi
1699
1700    # Determine the type of output
1701    case $output in
1702    "")
1703      $echo "$modename: you must specify an output file" 1>&2
1704      $echo "$help" 1>&2
1705      exit 1
1706      ;;
1707    *.$libext) linkmode=oldlib ;;
1708    *.lo | *.$objext) linkmode=obj ;;
1709    *.la) linkmode=lib ;;
1710    *) linkmode=prog ;; # Anything else should be a program.
1711    esac
1712
1713    case $host in
1714    *cygwin* | *mingw* | *pw32*)
1715      # don't eliminate duplcations in $postdeps and $predeps
1716      duplicate_compiler_generated_deps=yes
1717      ;;
1718    *)
1719      duplicate_compiler_generated_deps=$duplicate_deps
1720      ;;
1721    esac
1722    specialdeplibs=
1723
1724    libs=
1725    # Find all interdependent deplibs by searching for libraries
1726    # that are linked more than once (e.g. -la -lb -la)
1727    for deplib in $deplibs; do
1728      if test "X$duplicate_deps" = "Xyes" ; then
1729	case "$libs " in
1730	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1731	esac
1732      fi
1733      libs="$libs $deplib"
1734    done
1735
1736    if test "$linkmode" = lib; then
1737      libs="$predeps $libs $compiler_lib_search_path $postdeps"
1738
1739      # Compute libraries that are listed more than once in $predeps
1740      # $postdeps and mark them as special (i.e., whose duplicates are
1741      # not to be eliminated).
1742      pre_post_deps=
1743      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1744	for pre_post_dep in $predeps $postdeps; do
1745	  case "$pre_post_deps " in
1746	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1747	  esac
1748	  pre_post_deps="$pre_post_deps $pre_post_dep"
1749	done
1750      fi
1751      pre_post_deps=
1752    fi
1753
1754    deplibs=
1755    newdependency_libs=
1756    newlib_search_path=
1757    need_relink=no # whether we're linking any uninstalled libtool libraries
1758    notinst_deplibs= # not-installed libtool libraries
1759    notinst_path= # paths that contain not-installed libtool libraries
1760    case $linkmode in
1761    lib)
1762	passes="conv link"
1763	for file in $dlfiles $dlprefiles; do
1764	  case $file in
1765	  *.la) ;;
1766	  *)
1767	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1768	    exit 1
1769	    ;;
1770	  esac
1771	done
1772	;;
1773    prog)
1774	compile_deplibs=
1775	finalize_deplibs=
1776	alldeplibs=no
1777	newdlfiles=
1778	newdlprefiles=
1779	passes="conv scan dlopen dlpreopen link"
1780	;;
1781    *)  passes="conv"
1782	;;
1783    esac
1784    for pass in $passes; do
1785      if test "$linkmode,$pass" = "lib,link" ||
1786	 test "$linkmode,$pass" = "prog,scan"; then
1787	libs="$deplibs"
1788	deplibs=
1789      fi
1790      if test "$linkmode" = prog; then
1791	case $pass in
1792	dlopen) libs="$dlfiles" ;;
1793	dlpreopen) libs="$dlprefiles" ;;
1794	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1795	esac
1796      fi
1797      if test "$pass" = dlopen; then
1798	# Collect dlpreopened libraries
1799	save_deplibs="$deplibs"
1800	deplibs=
1801      fi
1802      for deplib in $libs; do
1803	lib=
1804	found=no
1805	case $deplib in
1806	-l*)
1807	  if test "$linkmode" != lib && test "$linkmode" != prog; then
1808	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1809	    continue
1810	  fi
1811	  if test "$pass" = conv; then
1812	    deplibs="$deplib $deplibs"
1813	    continue
1814	  fi
1815	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1816	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1817	    for search_ext in .la $shrext .so .a; do
1818	      # Search the libtool library
1819	      lib="$searchdir/lib${name}${search_ext}"
1820	      if test -f "$lib"; then
1821		if test "$search_ext" = ".la"; then
1822		  found=yes
1823		else
1824		  found=no
1825		fi
1826		break 2
1827	      fi
1828	    done
1829	  done
1830	  if test "$found" != yes; then
1831	    # deplib doesn't seem to be a libtool library
1832	    if test "$linkmode,$pass" = "prog,link"; then
1833	      compile_deplibs="$deplib $compile_deplibs"
1834	      finalize_deplibs="$deplib $finalize_deplibs"
1835	    else
1836	      deplibs="$deplib $deplibs"
1837	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1838	    fi
1839	    continue
1840	  else # deplib is a libtool library
1841	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
1842	    # We need to do some special things here, and not later.
1843	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
1844	      case " $predeps $postdeps " in
1845	      *" $deplib "*)
1846		if (${SED} -e '2q' $lib |
1847                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1848		  library_names=
1849		  old_library=
1850		  case $lib in
1851		  */* | *\\*) . $lib ;;
1852		  *) . ./$lib ;;
1853		  esac
1854		  for l in $old_library $library_names; do
1855		    ll="$l"
1856		  done
1857		  if test "X$ll" = "X$old_library" ; then # only static version available
1858		    found=no
1859		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1860		    test "X$ladir" = "X$lib" && ladir="."
1861		    lib=$ladir/$old_library
1862		    if test "$linkmode,$pass" = "prog,link"; then
1863		      compile_deplibs="$deplib $compile_deplibs"
1864		      finalize_deplibs="$deplib $finalize_deplibs"
1865		    else
1866		      deplibs="$deplib $deplibs"
1867		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1868		    fi
1869		    continue
1870		  fi
1871		fi
1872	        ;;
1873	      *) ;;
1874	      esac
1875	    fi
1876	  fi
1877	  ;; # -l
1878	-L*)
1879	  case $linkmode in
1880	  lib)
1881	    deplibs="$deplib $deplibs"
1882	    test "$pass" = conv && continue
1883	    newdependency_libs="$deplib $newdependency_libs"
1884	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1885	    ;;
1886	  prog)
1887	    if test "$pass" = conv; then
1888	      deplibs="$deplib $deplibs"
1889	      continue
1890	    fi
1891	    if test "$pass" = scan; then
1892	      deplibs="$deplib $deplibs"
1893	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1894	    else
1895	      compile_deplibs="$deplib $compile_deplibs"
1896	      finalize_deplibs="$deplib $finalize_deplibs"
1897	    fi
1898	    ;;
1899	  *)
1900	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1901	    ;;
1902	  esac # linkmode
1903	  continue
1904	  ;; # -L
1905	-R*)
1906	  if test "$pass" = link; then
1907	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1908	    # Make sure the xrpath contains only unique directories.
1909	    case "$xrpath " in
1910	    *" $dir "*) ;;
1911	    *) xrpath="$xrpath $dir" ;;
1912	    esac
1913	  fi
1914	  deplibs="$deplib $deplibs"
1915	  continue
1916	  ;;
1917	*.la) lib="$deplib" ;;
1918	*.$libext)
1919	  if test "$pass" = conv; then
1920	    deplibs="$deplib $deplibs"
1921	    continue
1922	  fi
1923	  case $linkmode in
1924	  lib)
1925	    if test "$deplibs_check_method" != pass_all; then
1926	      $echo
1927	      $echo "*** Warning: Trying to link with static lib archive $deplib."
1928	      $echo "*** I have the capability to make that library automatically link in when"
1929	      $echo "*** you link to this library.  But I can only do this if you have a"
1930	      $echo "*** shared version of the library, which you do not appear to have"
1931	      $echo "*** because the file extensions .$libext of this argument makes me believe"
1932	      $echo "*** that it is just a static archive that I should not used here."
1933	    else
1934	      $echo
1935	      $echo "*** Warning: Linking the shared library $output against the"
1936	      $echo "*** static library $deplib is not portable!"
1937	      deplibs="$deplib $deplibs"
1938	    fi
1939

Large files files are truncated, but you can click here to view the full file