PageRenderTime 374ms CodeModel.GetById 101ms app.highlight 192ms RepoModel.GetById 29ms app.codeStats 13ms

/exult/tags/Release0_25/ltmain.sh

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

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