PageRenderTime 312ms CodeModel.GetById 51ms app.highlight 201ms RepoModel.GetById 40ms app.codeStats 1ms

/exult/tags/Release0_25/libtool

#
Shell | 2485 lines | 1975 code | 217 blank | 293 comment | 201 complexity | d69f4ce1cca9a09e5c42fd1d1afd1227 MD5 | raw file

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

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

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