cannam@86: # ltmain.sh - Provide generalized library-building support services. cannam@86: # NOTE: Changing this file will not affect anything until you rerun configure. cannam@86: # cannam@86: # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 cannam@86: # Free Software Foundation, Inc. cannam@86: # Originally by Gordon Matzigkeit , 1996 cannam@86: # cannam@86: # This program is free software; you can redistribute it and/or modify cannam@86: # it under the terms of the GNU General Public License as published by cannam@86: # the Free Software Foundation; either version 2 of the License, or cannam@86: # (at your option) any later version. cannam@86: # cannam@86: # This program is distributed in the hope that it will be useful, but cannam@86: # WITHOUT ANY WARRANTY; without even the implied warranty of cannam@86: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU cannam@86: # General Public License for more details. cannam@86: # cannam@86: # You should have received a copy of the GNU General Public License cannam@86: # along with this program; if not, write to the Free Software cannam@86: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. cannam@86: # cannam@86: # As a special exception to the GNU General Public License, if you cannam@86: # distribute this file as part of a program that contains a cannam@86: # configuration script generated by Autoconf, you may include it under cannam@86: # the same distribution terms that you use for the rest of that program. cannam@86: cannam@86: basename="s,^.*/,,g" cannam@86: cannam@86: # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh cannam@86: # is ksh but when the shell is invoked as "sh" and the current value of cannam@86: # the _XPG environment variable is not equal to 1 (one), the special cannam@86: # positional parameter $0, within a function call, is the name of the cannam@86: # function. cannam@86: progpath="$0" cannam@86: cannam@86: # The name of this program: cannam@86: progname=`echo "$progpath" | $SED $basename` cannam@86: modename="$progname" cannam@86: cannam@86: # Global variables: cannam@86: EXIT_SUCCESS=0 cannam@86: EXIT_FAILURE=1 cannam@86: cannam@86: PROGRAM=ltmain.sh cannam@86: PACKAGE=libtool cannam@86: VERSION=1.5.16 cannam@86: TIMESTAMP=" (1.1220.2.235 2005/04/25 18:13:26)" cannam@86: cannam@86: # See if we are running on zsh, and set the options which allow our cannam@86: # commands through without removal of \ escapes. cannam@86: if test -n "${ZSH_VERSION+set}" ; then cannam@86: setopt NO_GLOB_SUBST cannam@86: fi cannam@86: cannam@86: # Check that we have a working $echo. cannam@86: if test "X$1" = X--no-reexec; then cannam@86: # Discard the --no-reexec flag, and continue. cannam@86: shift cannam@86: elif test "X$1" = X--fallback-echo; then cannam@86: # Avoid inline document here, it may be left over cannam@86: : cannam@86: elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then cannam@86: # Yippee, $echo works! cannam@86: : cannam@86: else cannam@86: # Restart under the correct shell, and then maybe $echo will work. cannam@86: exec $SHELL "$progpath" --no-reexec ${1+"$@"} cannam@86: fi cannam@86: cannam@86: if test "X$1" = X--fallback-echo; then cannam@86: # used as fallback echo cannam@86: shift cannam@86: cat <&2 cannam@86: $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Global variables. cannam@86: mode=$default_mode cannam@86: nonopt= cannam@86: prev= cannam@86: prevopt= cannam@86: run= cannam@86: show="$echo" cannam@86: show_help= cannam@86: execute_dlfiles= cannam@86: lo2o="s/\\.lo\$/.${objext}/" cannam@86: o2lo="s/\\.${objext}\$/.lo/" cannam@86: quote_scanset='[[~#^*{};<>?'"'"' ]' cannam@86: cannam@86: ##################################### cannam@86: # Shell function definitions: cannam@86: # This seems to be the best place for them cannam@86: cannam@86: # func_win32_libid arg cannam@86: # return the library type of file 'arg' cannam@86: # cannam@86: # Need a lot of goo to handle *both* DLLs and import libs cannam@86: # Has to be a shell function in order to 'eat' the argument cannam@86: # that is supplied when $file_magic_command is called. cannam@86: func_win32_libid () cannam@86: { cannam@86: win32_libid_type="unknown" cannam@86: win32_fileres=`file -L $1 2>/dev/null` cannam@86: case $win32_fileres in cannam@86: *ar\ archive\ import\ library*) # definitely import cannam@86: win32_libid_type="x86 archive import" cannam@86: ;; cannam@86: *ar\ archive*) # could be an import, or static cannam@86: if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ cannam@86: $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then cannam@86: win32_nmres=`eval $NM -f posix -A $1 | \ cannam@86: sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` cannam@86: if test "X$win32_nmres" = "Ximport" ; then cannam@86: win32_libid_type="x86 archive import" cannam@86: else cannam@86: win32_libid_type="x86 archive static" cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: *DLL*) cannam@86: win32_libid_type="x86 DLL" cannam@86: ;; cannam@86: *executable*) # but shell scripts are "executable" too... cannam@86: case $win32_fileres in cannam@86: *MS\ Windows\ PE\ Intel*) cannam@86: win32_libid_type="x86 DLL" cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: $echo $win32_libid_type cannam@86: } cannam@86: cannam@86: cannam@86: # func_infer_tag arg cannam@86: # Infer tagged configuration to use if any are available and cannam@86: # if one wasn't chosen via the "--tag" command line option. cannam@86: # Only attempt this if the compiler in the base compile cannam@86: # command doesn't match the default compiler. cannam@86: # arg is usually of the form 'gcc ...' cannam@86: func_infer_tag () cannam@86: { cannam@86: if test -n "$available_tags" && test -z "$tagname"; then cannam@86: CC_quoted= cannam@86: for arg in $CC; do cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: CC_quoted="$CC_quoted $arg" cannam@86: done cannam@86: case $@ in cannam@86: # Blanks in the command may have been stripped by the calling shell, cannam@86: # but not from the CC environment variable when configure was run. cannam@86: " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; cannam@86: # Blanks at the start of $base_compile will cause this to fail cannam@86: # if we don't check for them as well. cannam@86: *) cannam@86: for z in $available_tags; do cannam@86: if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then cannam@86: # Evaluate the configuration. cannam@86: eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" cannam@86: CC_quoted= cannam@86: for arg in $CC; do cannam@86: # Double-quote args containing other shell metacharacters. cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: CC_quoted="$CC_quoted $arg" cannam@86: done cannam@86: case "$@ " in cannam@86: " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) cannam@86: # The compiler in the base compile command matches cannam@86: # the one in the tagged configuration. cannam@86: # Assume this is the tagged configuration we want. cannam@86: tagname=$z cannam@86: break cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: done cannam@86: # If $tagname still isn't set, then no tagged configuration cannam@86: # was found and let the user know that the "--tag" command cannam@86: # line option must be used. cannam@86: if test -z "$tagname"; then cannam@86: $echo "$modename: unable to infer tagged configuration" cannam@86: $echo "$modename: specify a tag with \`--tag'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: # else cannam@86: # $echo "$modename: using $tagname tagged configuration" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: } cannam@86: cannam@86: cannam@86: # func_extract_an_archive dir oldlib cannam@86: func_extract_an_archive () cannam@86: { cannam@86: f_ex_an_ar_dir="$1"; shift cannam@86: f_ex_an_ar_oldlib="$1" cannam@86: cannam@86: $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" cannam@86: $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? cannam@86: if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then cannam@86: : cannam@86: else cannam@86: $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: } cannam@86: cannam@86: # func_extract_archives gentop oldlib ... cannam@86: func_extract_archives () cannam@86: { cannam@86: my_gentop="$1"; shift cannam@86: my_oldlibs=${1+"$@"} cannam@86: my_oldobjs="" cannam@86: my_xlib="" cannam@86: my_xabs="" cannam@86: my_xdir="" cannam@86: my_status="" cannam@86: cannam@86: $show "${rm}r $my_gentop" cannam@86: $run ${rm}r "$my_gentop" cannam@86: $show "$mkdir $my_gentop" cannam@86: $run $mkdir "$my_gentop" cannam@86: my_status=$? cannam@86: if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then cannam@86: exit $my_status cannam@86: fi cannam@86: cannam@86: for my_xlib in $my_oldlibs; do cannam@86: # Extract the objects. cannam@86: case $my_xlib in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; cannam@86: *) my_xabs=`pwd`"/$my_xlib" ;; cannam@86: esac cannam@86: my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` cannam@86: my_xdir="$my_gentop/$my_xlib" cannam@86: cannam@86: $show "${rm}r $my_xdir" cannam@86: $run ${rm}r "$my_xdir" cannam@86: $show "$mkdir $my_xdir" cannam@86: $run $mkdir "$my_xdir" cannam@86: status=$? cannam@86: if test "$status" -ne 0 && test ! -d "$my_xdir"; then cannam@86: exit $status cannam@86: fi cannam@86: case $host in cannam@86: *-darwin*) cannam@86: $show "Extracting $my_xabs" cannam@86: # Do not bother doing anything if just a dry run cannam@86: if test -z "$run"; then cannam@86: darwin_orig_dir=`pwd` cannam@86: cd $my_xdir || exit $? cannam@86: darwin_archive=$my_xabs cannam@86: darwin_curdir=`pwd` cannam@86: darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` cannam@86: darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` cannam@86: if test -n "$darwin_arches"; then cannam@86: darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` cannam@86: darwin_arch= cannam@86: $show "$darwin_base_archive has multiple architectures $darwin_arches" cannam@86: for darwin_arch in $darwin_arches ; do cannam@86: mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" cannam@86: lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cannam@86: cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" cannam@86: func_extract_an_archive "`pwd`" "${darwin_base_archive}" cannam@86: cd "$darwin_curdir" cannam@86: $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" cannam@86: done # $darwin_arches cannam@86: ## Okay now we have a bunch of thin objects, gotta fatten them up :) cannam@86: darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` cannam@86: darwin_file= cannam@86: darwin_files= cannam@86: for darwin_file in $darwin_filelist; do cannam@86: darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` cannam@86: lipo -create -output "$darwin_file" $darwin_files cannam@86: done # $darwin_filelist cannam@86: ${rm}r unfat-$$ cannam@86: cd "$darwin_orig_dir" cannam@86: else cannam@86: cd "$darwin_orig_dir" cannam@86: func_extract_an_archive "$my_xdir" "$my_xabs" cannam@86: fi # $darwin_arches cannam@86: fi # $run cannam@86: ;; cannam@86: *) cannam@86: func_extract_an_archive "$my_xdir" "$my_xabs" cannam@86: ;; cannam@86: esac cannam@86: my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` cannam@86: done cannam@86: func_extract_archives_result="$my_oldobjs" cannam@86: } cannam@86: # End of Shell function definitions cannam@86: ##################################### cannam@86: cannam@86: # Darwin sucks cannam@86: eval std_shrext=\"$shrext_cmds\" cannam@86: cannam@86: # Parse our command line options once, thoroughly. cannam@86: while test "$#" -gt 0 cannam@86: do cannam@86: arg="$1" cannam@86: shift cannam@86: cannam@86: case $arg in cannam@86: -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; cannam@86: *) optarg= ;; cannam@86: esac cannam@86: cannam@86: # If the previous option needs an argument, assign it. cannam@86: if test -n "$prev"; then cannam@86: case $prev in cannam@86: execute_dlfiles) cannam@86: execute_dlfiles="$execute_dlfiles $arg" cannam@86: ;; cannam@86: tag) cannam@86: tagname="$arg" cannam@86: preserve_args="${preserve_args}=$arg" cannam@86: cannam@86: # Check whether tagname contains only valid characters cannam@86: case $tagname in cannam@86: *[!-_A-Za-z0-9,/]*) cannam@86: $echo "$progname: invalid tag name: $tagname" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: case $tagname in cannam@86: CC) cannam@86: # Don't test for the "default" C tag, as we know, it's there, but cannam@86: # not specially marked. cannam@86: ;; cannam@86: *) cannam@86: if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then cannam@86: taglist="$taglist $tagname" cannam@86: # Evaluate the configuration. cannam@86: eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" cannam@86: else cannam@86: $echo "$progname: ignoring unknown tag $tagname" 1>&2 cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: *) cannam@86: eval "$prev=\$arg" cannam@86: ;; cannam@86: esac cannam@86: cannam@86: prev= cannam@86: prevopt= cannam@86: continue cannam@86: fi cannam@86: cannam@86: # Have we seen a non-optional argument yet? cannam@86: case $arg in cannam@86: --help) cannam@86: show_help=yes cannam@86: ;; cannam@86: cannam@86: --version) cannam@86: $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" cannam@86: $echo cannam@86: $echo "Copyright (C) 2005 Free Software Foundation, Inc." cannam@86: $echo "This is free software; see the source for copying conditions. There is NO" cannam@86: $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." cannam@86: exit $? cannam@86: ;; cannam@86: cannam@86: --config) cannam@86: ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath cannam@86: # Now print the configurations for the tags. cannam@86: for tagname in $taglist; do cannam@86: ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" cannam@86: done cannam@86: exit $? cannam@86: ;; cannam@86: cannam@86: --debug) cannam@86: $echo "$progname: enabling shell trace mode" cannam@86: set -x cannam@86: preserve_args="$preserve_args $arg" cannam@86: ;; cannam@86: cannam@86: --dry-run | -n) cannam@86: run=: cannam@86: ;; cannam@86: cannam@86: --features) cannam@86: $echo "host: $host" cannam@86: if test "$build_libtool_libs" = yes; then cannam@86: $echo "enable shared libraries" cannam@86: else cannam@86: $echo "disable shared libraries" cannam@86: fi cannam@86: if test "$build_old_libs" = yes; then cannam@86: $echo "enable static libraries" cannam@86: else cannam@86: $echo "disable static libraries" cannam@86: fi cannam@86: exit $? cannam@86: ;; cannam@86: cannam@86: --finish) mode="finish" ;; cannam@86: cannam@86: --mode) prevopt="--mode" prev=mode ;; cannam@86: --mode=*) mode="$optarg" ;; cannam@86: cannam@86: --preserve-dup-deps) duplicate_deps="yes" ;; cannam@86: cannam@86: --quiet | --silent) cannam@86: show=: cannam@86: preserve_args="$preserve_args $arg" cannam@86: ;; cannam@86: cannam@86: --tag) prevopt="--tag" prev=tag ;; cannam@86: --tag=*) cannam@86: set tag "$optarg" ${1+"$@"} cannam@86: shift cannam@86: prev=tag cannam@86: preserve_args="$preserve_args --tag" cannam@86: ;; cannam@86: cannam@86: -dlopen) cannam@86: prevopt="-dlopen" cannam@86: prev=execute_dlfiles cannam@86: ;; cannam@86: cannam@86: -*) cannam@86: $echo "$modename: unrecognized option \`$arg'" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: cannam@86: *) cannam@86: nonopt="$arg" cannam@86: break cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: if test -n "$prevopt"; then cannam@86: $echo "$modename: option \`$prevopt' requires an argument" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # If this variable is set in any of the actions, the command in it cannam@86: # will be execed at the end. This prevents here-documents from being cannam@86: # left over by shells. cannam@86: exec_cmd= cannam@86: cannam@86: if test -z "$show_help"; then cannam@86: cannam@86: # Infer the operation mode. cannam@86: if test -z "$mode"; then cannam@86: $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 cannam@86: $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 cannam@86: case $nonopt in cannam@86: *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) cannam@86: mode=link cannam@86: for arg cannam@86: do cannam@86: case $arg in cannam@86: -c) cannam@86: mode=compile cannam@86: break cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: ;; cannam@86: *db | *dbx | *strace | *truss) cannam@86: mode=execute cannam@86: ;; cannam@86: *install*|cp|mv) cannam@86: mode=install cannam@86: ;; cannam@86: *rm) cannam@86: mode=uninstall cannam@86: ;; cannam@86: *) cannam@86: # If we have no mode, but dlfiles were specified, then do execute mode. cannam@86: test -n "$execute_dlfiles" && mode=execute cannam@86: cannam@86: # Just use the default operation mode. cannam@86: if test -z "$mode"; then cannam@86: if test -n "$nonopt"; then cannam@86: $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 cannam@86: else cannam@86: $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: # Only execute mode is allowed to have -dlopen flags. cannam@86: if test -n "$execute_dlfiles" && test "$mode" != execute; then cannam@86: $echo "$modename: unrecognized option \`-dlopen'" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Change the help message to a mode-specific one. cannam@86: generic_help="$help" cannam@86: help="Try \`$modename --help --mode=$mode' for more information." cannam@86: cannam@86: # These modes are in order of execution frequency so that they run quickly. cannam@86: case $mode in cannam@86: # libtool compile mode cannam@86: compile) cannam@86: modename="$modename: compile" cannam@86: # Get the compilation command and the source file. cannam@86: base_compile= cannam@86: srcfile="$nonopt" # always keep a non-empty value in "srcfile" cannam@86: suppress_opt=yes cannam@86: suppress_output= cannam@86: arg_mode=normal cannam@86: libobj= cannam@86: later= cannam@86: cannam@86: for arg cannam@86: do cannam@86: case "$arg_mode" in cannam@86: arg ) cannam@86: # do not "continue". Instead, add this to base_compile cannam@86: lastarg="$arg" cannam@86: arg_mode=normal cannam@86: ;; cannam@86: cannam@86: target ) cannam@86: libobj="$arg" cannam@86: arg_mode=normal cannam@86: continue cannam@86: ;; cannam@86: cannam@86: normal ) cannam@86: # Accept any command-line options. cannam@86: case $arg in cannam@86: -o) cannam@86: if test -n "$libobj" ; then cannam@86: $echo "$modename: you cannot specify \`-o' more than once" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: arg_mode=target cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -static | -prefer-pic | -prefer-non-pic) cannam@86: later="$later $arg" cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -no-suppress) cannam@86: suppress_opt=no cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -Xcompiler) cannam@86: arg_mode=arg # the next one goes into the "base_compile" arg list cannam@86: continue # The current "srcfile" will either be retained or cannam@86: ;; # replaced later. I would guess that would be a bug. cannam@86: cannam@86: -Wc,*) cannam@86: args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` cannam@86: lastarg= cannam@86: save_ifs="$IFS"; IFS=',' cannam@86: for arg in $args; do cannam@86: IFS="$save_ifs" cannam@86: cannam@86: # Double-quote args containing other shell metacharacters. cannam@86: # Many Bourne shells cannot handle close brackets correctly cannam@86: # in scan sets, so we specify it separately. cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: lastarg="$lastarg $arg" cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` cannam@86: cannam@86: # Add the arguments to base_compile. cannam@86: base_compile="$base_compile $lastarg" cannam@86: continue cannam@86: ;; cannam@86: cannam@86: * ) cannam@86: # Accept the current argument as the source file. cannam@86: # The previous "srcfile" becomes the current argument. cannam@86: # cannam@86: lastarg="$srcfile" cannam@86: srcfile="$arg" cannam@86: ;; cannam@86: esac # case $arg cannam@86: ;; cannam@86: esac # case $arg_mode cannam@86: cannam@86: # Aesthetically quote the previous argument. cannam@86: lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` cannam@86: cannam@86: case $lastarg in cannam@86: # Double-quote args containing other shell metacharacters. cannam@86: # Many Bourne shells cannot handle close brackets correctly cannam@86: # in scan sets, and some SunOS ksh mistreat backslash-escaping cannam@86: # in scan sets (worked around with variable expansion), cannam@86: # and furthermore cannot handle '|' '&' '(' ')' in scan sets cannam@86: # at all, so we specify them separately. cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: lastarg="\"$lastarg\"" cannam@86: ;; cannam@86: esac cannam@86: cannam@86: base_compile="$base_compile $lastarg" cannam@86: done # for arg cannam@86: cannam@86: case $arg_mode in cannam@86: arg) cannam@86: $echo "$modename: you must specify an argument for -Xcompile" cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: target) cannam@86: $echo "$modename: you must specify a target with \`-o'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: *) cannam@86: # Get the name of the library object. cannam@86: [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Recognize several different file suffixes. cannam@86: # If the user specifies -o file.o, it is replaced with file.lo cannam@86: xform='[cCFSifmso]' cannam@86: case $libobj in cannam@86: *.ada) xform=ada ;; cannam@86: *.adb) xform=adb ;; cannam@86: *.ads) xform=ads ;; cannam@86: *.asm) xform=asm ;; cannam@86: *.c++) xform=c++ ;; cannam@86: *.cc) xform=cc ;; cannam@86: *.ii) xform=ii ;; cannam@86: *.class) xform=class ;; cannam@86: *.cpp) xform=cpp ;; cannam@86: *.cxx) xform=cxx ;; cannam@86: *.f90) xform=f90 ;; cannam@86: *.for) xform=for ;; cannam@86: *.java) xform=java ;; cannam@86: esac cannam@86: cannam@86: libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` cannam@86: cannam@86: case $libobj in cannam@86: *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; cannam@86: *) cannam@86: $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: func_infer_tag $base_compile cannam@86: cannam@86: for arg in $later; do cannam@86: case $arg in cannam@86: -static) cannam@86: build_old_libs=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -prefer-pic) cannam@86: pic_mode=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -prefer-non-pic) cannam@86: pic_mode=no cannam@86: continue cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` cannam@86: case $qlibobj in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: qlibobj="\"$qlibobj\"" ;; cannam@86: esac cannam@86: if test "X$libobj" != "X$qlibobj"; then cannam@86: $echo "$modename: libobj name \`$libobj' may not contain shell special characters." cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` cannam@86: xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$xdir" = "X$obj"; then cannam@86: xdir= cannam@86: else cannam@86: xdir=$xdir/ cannam@86: fi cannam@86: lobj=${xdir}$objdir/$objname cannam@86: cannam@86: if test -z "$base_compile"; then cannam@86: $echo "$modename: you must specify a compilation command" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Delete any leftover library objects. cannam@86: if test "$build_old_libs" = yes; then cannam@86: removelist="$obj $lobj $libobj ${libobj}T" cannam@86: else cannam@86: removelist="$lobj $libobj ${libobj}T" cannam@86: fi cannam@86: cannam@86: $run $rm $removelist cannam@86: trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 cannam@86: cannam@86: # On Cygwin there's no "real" PIC flag so we must build both object types cannam@86: case $host_os in cannam@86: cygwin* | mingw* | pw32* | os2*) cannam@86: pic_mode=default cannam@86: ;; cannam@86: esac cannam@86: if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then cannam@86: # non-PIC code in shared libraries is not supported cannam@86: pic_mode=default cannam@86: fi cannam@86: cannam@86: # Calculate the filename of the output object if compiler does cannam@86: # not support -o with -c cannam@86: if test "$compiler_c_o" = no; then cannam@86: output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} cannam@86: lockfile="$output_obj.lock" cannam@86: removelist="$removelist $output_obj $lockfile" cannam@86: trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 cannam@86: else cannam@86: output_obj= cannam@86: need_locks=no cannam@86: lockfile= cannam@86: fi cannam@86: cannam@86: # Lock this critical section if it is needed cannam@86: # We use this script file to make the link, it avoids creating a new file cannam@86: if test "$need_locks" = yes; then cannam@86: until $run ln "$progpath" "$lockfile" 2>/dev/null; do cannam@86: $show "Waiting for $lockfile to be removed" cannam@86: sleep 2 cannam@86: done cannam@86: elif test "$need_locks" = warn; then cannam@86: if test -f "$lockfile"; then cannam@86: $echo "\ cannam@86: *** ERROR, $lockfile exists and contains: cannam@86: `cat $lockfile 2>/dev/null` cannam@86: cannam@86: This indicates that another process is trying to use the same cannam@86: temporary object file, and libtool could not work around it because cannam@86: your compiler does not support \`-c' and \`-o' together. If you cannam@86: repeat this compilation, it may succeed, by chance, but you had better cannam@86: avoid parallel builds (make -j) in this platform, or get a better cannam@86: compiler." cannam@86: cannam@86: $run $rm $removelist cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: $echo "$srcfile" > "$lockfile" cannam@86: fi cannam@86: cannam@86: if test -n "$fix_srcfile_path"; then cannam@86: eval srcfile=\"$fix_srcfile_path\" cannam@86: fi cannam@86: qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` cannam@86: case $qsrcfile in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: qsrcfile="\"$qsrcfile\"" ;; cannam@86: esac cannam@86: cannam@86: $run $rm "$libobj" "${libobj}T" cannam@86: cannam@86: # Create a libtool object file (analogous to a ".la" file), cannam@86: # but don't create it if we're doing a dry run. cannam@86: test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then cannam@86: $echo "\ cannam@86: *** ERROR, $lockfile contains: cannam@86: `cat $lockfile 2>/dev/null` cannam@86: cannam@86: but it should contain: cannam@86: $srcfile cannam@86: cannam@86: This indicates that another process is trying to use the same cannam@86: temporary object file, and libtool could not work around it because cannam@86: your compiler does not support \`-c' and \`-o' together. If you cannam@86: repeat this compilation, it may succeed, by chance, but you had better cannam@86: avoid parallel builds (make -j) in this platform, or get a better cannam@86: compiler." cannam@86: cannam@86: $run $rm $removelist cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Just move the object if needed, then go on to compile the next one cannam@86: if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then cannam@86: $show "$mv $output_obj $lobj" cannam@86: if $run $mv $output_obj $lobj; then : cannam@86: else cannam@86: error=$? cannam@86: $run $rm $removelist cannam@86: exit $error cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Append the name of the PIC object to the libtool object file. cannam@86: test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then cannam@86: $echo "\ cannam@86: *** ERROR, $lockfile contains: cannam@86: `cat $lockfile 2>/dev/null` cannam@86: cannam@86: but it should contain: cannam@86: $srcfile cannam@86: cannam@86: This indicates that another process is trying to use the same cannam@86: temporary object file, and libtool could not work around it because cannam@86: your compiler does not support \`-c' and \`-o' together. If you cannam@86: repeat this compilation, it may succeed, by chance, but you had better cannam@86: avoid parallel builds (make -j) in this platform, or get a better cannam@86: compiler." cannam@86: cannam@86: $run $rm $removelist cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Just move the object if needed cannam@86: if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then cannam@86: $show "$mv $output_obj $obj" cannam@86: if $run $mv $output_obj $obj; then : cannam@86: else cannam@86: error=$? cannam@86: $run $rm $removelist cannam@86: exit $error cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Append the name of the non-PIC object the libtool object file. cannam@86: # Only append if the libtool object file exists. cannam@86: test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 cannam@86: fi cannam@86: if test -n "$link_static_flag"; then cannam@86: dlopen_self=$dlopen_self_static cannam@86: fi cannam@86: else cannam@86: if test -z "$pic_flag" && test -n "$link_static_flag"; then cannam@86: dlopen_self=$dlopen_self_static cannam@86: fi cannam@86: fi cannam@86: build_libtool_libs=no cannam@86: build_old_libs=yes cannam@86: prefer_static_libs=yes cannam@86: break cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: # See if our shared archives depend on static archives. cannam@86: test -n "$old_archive_from_new_cmds" && build_old_libs=yes cannam@86: cannam@86: # Go through the arguments, transforming them on the way. cannam@86: while test "$#" -gt 0; do cannam@86: arg="$1" cannam@86: shift cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test cannam@86: ;; cannam@86: *) qarg=$arg ;; cannam@86: esac cannam@86: libtool_args="$libtool_args $qarg" cannam@86: cannam@86: # If the previous option needs an argument, assign it. cannam@86: if test -n "$prev"; then cannam@86: case $prev in cannam@86: output) cannam@86: compile_command="$compile_command @OUTPUT@" cannam@86: finalize_command="$finalize_command @OUTPUT@" cannam@86: ;; cannam@86: esac cannam@86: cannam@86: case $prev in cannam@86: dlfiles|dlprefiles) cannam@86: if test "$preload" = no; then cannam@86: # Add the symbol object into the linking commands. cannam@86: compile_command="$compile_command @SYMFILE@" cannam@86: finalize_command="$finalize_command @SYMFILE@" cannam@86: preload=yes cannam@86: fi cannam@86: case $arg in cannam@86: *.la | *.lo) ;; # We handle these cases below. cannam@86: force) cannam@86: if test "$dlself" = no; then cannam@86: dlself=needless cannam@86: export_dynamic=yes cannam@86: fi cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: self) cannam@86: if test "$prev" = dlprefiles; then cannam@86: dlself=yes cannam@86: elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then cannam@86: dlself=yes cannam@86: else cannam@86: dlself=needless cannam@86: export_dynamic=yes cannam@86: fi cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: *) cannam@86: if test "$prev" = dlfiles; then cannam@86: dlfiles="$dlfiles $arg" cannam@86: else cannam@86: dlprefiles="$dlprefiles $arg" cannam@86: fi cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: expsyms) cannam@86: export_symbols="$arg" cannam@86: if test ! -f "$arg"; then cannam@86: $echo "$modename: symbol file \`$arg' does not exist" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: expsyms_regex) cannam@86: export_symbols_regex="$arg" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: inst_prefix) cannam@86: inst_prefix_dir="$arg" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: precious_regex) cannam@86: precious_files_regex="$arg" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: release) cannam@86: release="-$arg" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: objectlist) cannam@86: if test -f "$arg"; then cannam@86: save_arg=$arg cannam@86: moreargs= cannam@86: for fil in `cat $save_arg` cannam@86: do cannam@86: # moreargs="$moreargs $fil" cannam@86: arg=$fil cannam@86: # A libtool-controlled object. cannam@86: cannam@86: # Check to see that this really is a libtool object. cannam@86: if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: pic_object= cannam@86: non_pic_object= cannam@86: cannam@86: # Read the .lo file cannam@86: # If there is no directory component, then add one. cannam@86: case $arg in cannam@86: */* | *\\*) . $arg ;; cannam@86: *) . ./$arg ;; cannam@86: esac cannam@86: cannam@86: if test -z "$pic_object" || \ cannam@86: test -z "$non_pic_object" || cannam@86: test "$pic_object" = none && \ cannam@86: test "$non_pic_object" = none; then cannam@86: $echo "$modename: cannot find name of object for \`$arg'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Extract subdirectory from the argument. cannam@86: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$xdir" = "X$arg"; then cannam@86: xdir= cannam@86: else cannam@86: xdir="$xdir/" cannam@86: fi cannam@86: cannam@86: if test "$pic_object" != none; then cannam@86: # Prepend the subdirectory the object is found in. cannam@86: pic_object="$xdir$pic_object" cannam@86: cannam@86: if test "$prev" = dlfiles; then cannam@86: if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then cannam@86: dlfiles="$dlfiles $pic_object" cannam@86: prev= cannam@86: continue cannam@86: else cannam@86: # If libtool objects are unsupported, then we need to preload. cannam@86: prev=dlprefiles cannam@86: fi cannam@86: fi cannam@86: cannam@86: # CHECK ME: I think I busted this. -Ossama cannam@86: if test "$prev" = dlprefiles; then cannam@86: # Preload the old-style object. cannam@86: dlprefiles="$dlprefiles $pic_object" cannam@86: prev= cannam@86: fi cannam@86: cannam@86: # A PIC object. cannam@86: libobjs="$libobjs $pic_object" cannam@86: arg="$pic_object" cannam@86: fi cannam@86: cannam@86: # Non-PIC object. cannam@86: if test "$non_pic_object" != none; then cannam@86: # Prepend the subdirectory the object is found in. cannam@86: non_pic_object="$xdir$non_pic_object" cannam@86: cannam@86: # A standard non-PIC object cannam@86: non_pic_objects="$non_pic_objects $non_pic_object" cannam@86: if test -z "$pic_object" || test "$pic_object" = none ; then cannam@86: arg="$non_pic_object" cannam@86: fi cannam@86: fi cannam@86: else cannam@86: # Only an error if not doing a dry-run. cannam@86: if test -z "$run"; then cannam@86: $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: else cannam@86: # Dry-run case. cannam@86: cannam@86: # Extract subdirectory from the argument. cannam@86: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$xdir" = "X$arg"; then cannam@86: xdir= cannam@86: else cannam@86: xdir="$xdir/" cannam@86: fi cannam@86: cannam@86: pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` cannam@86: non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` cannam@86: libobjs="$libobjs $pic_object" cannam@86: non_pic_objects="$non_pic_objects $non_pic_object" cannam@86: fi cannam@86: fi cannam@86: done cannam@86: else cannam@86: $echo "$modename: link input file \`$save_arg' does not exist" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: arg=$save_arg cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: rpath | xrpath) cannam@86: # We need an absolute path. cannam@86: case $arg in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) ;; cannam@86: *) cannam@86: $echo "$modename: only absolute run-paths are allowed" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: if test "$prev" = rpath; then cannam@86: case "$rpath " in cannam@86: *" $arg "*) ;; cannam@86: *) rpath="$rpath $arg" ;; cannam@86: esac cannam@86: else cannam@86: case "$xrpath " in cannam@86: *" $arg "*) ;; cannam@86: *) xrpath="$xrpath $arg" ;; cannam@86: esac cannam@86: fi cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: xcompiler) cannam@86: compiler_flags="$compiler_flags $qarg" cannam@86: prev= cannam@86: compile_command="$compile_command $qarg" cannam@86: finalize_command="$finalize_command $qarg" cannam@86: continue cannam@86: ;; cannam@86: xlinker) cannam@86: linker_flags="$linker_flags $qarg" cannam@86: compiler_flags="$compiler_flags $wl$qarg" cannam@86: prev= cannam@86: compile_command="$compile_command $wl$qarg" cannam@86: finalize_command="$finalize_command $wl$qarg" cannam@86: continue cannam@86: ;; cannam@86: xcclinker) cannam@86: linker_flags="$linker_flags $qarg" cannam@86: compiler_flags="$compiler_flags $qarg" cannam@86: prev= cannam@86: compile_command="$compile_command $qarg" cannam@86: finalize_command="$finalize_command $qarg" cannam@86: continue cannam@86: ;; cannam@86: shrext) cannam@86: shrext_cmds="$arg" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: darwin_framework) cannam@86: compiler_flags="$compiler_flags $arg" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: *) cannam@86: eval "$prev=\"\$arg\"" cannam@86: prev= cannam@86: continue cannam@86: ;; cannam@86: esac cannam@86: fi # test -n "$prev" cannam@86: cannam@86: prevarg="$arg" cannam@86: cannam@86: case $arg in cannam@86: -all-static) cannam@86: if test -n "$link_static_flag"; then cannam@86: compile_command="$compile_command $link_static_flag" cannam@86: finalize_command="$finalize_command $link_static_flag" cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -allow-undefined) cannam@86: # FIXME: remove this flag sometime in the future. cannam@86: $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -avoid-version) cannam@86: avoid_version=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -dlopen) cannam@86: prev=dlfiles cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -dlpreopen) cannam@86: prev=dlprefiles cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -export-dynamic) cannam@86: export_dynamic=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -export-symbols | -export-symbols-regex) cannam@86: if test -n "$export_symbols" || test -n "$export_symbols_regex"; then cannam@86: $echo "$modename: more than one -exported-symbols argument is not allowed" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: if test "X$arg" = "X-export-symbols"; then cannam@86: prev=expsyms cannam@86: else cannam@86: prev=expsyms_regex cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -framework) cannam@86: prev=darwin_framework cannam@86: compiler_flags="$compiler_flags $arg" cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -inst-prefix-dir) cannam@86: prev=inst_prefix cannam@86: continue cannam@86: ;; cannam@86: cannam@86: # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* cannam@86: # so, if we see these flags be careful not to treat them like -L cannam@86: -L[A-Z][A-Z]*:*) cannam@86: case $with_gcc/$host in cannam@86: no/*-*-irix* | /*-*-irix*) cannam@86: compile_command="$compile_command $arg" cannam@86: finalize_command="$finalize_command $arg" cannam@86: ;; cannam@86: esac cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -L*) cannam@86: dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` cannam@86: # We need an absolute path. cannam@86: case $dir in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) ;; cannam@86: *) cannam@86: absdir=`cd "$dir" && pwd` cannam@86: if test -z "$absdir"; then cannam@86: $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: dir="$absdir" cannam@86: ;; cannam@86: esac cannam@86: case "$deplibs " in cannam@86: *" -L$dir "*) ;; cannam@86: *) cannam@86: deplibs="$deplibs -L$dir" cannam@86: lib_search_path="$lib_search_path $dir" cannam@86: ;; cannam@86: esac cannam@86: case $host in cannam@86: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) cannam@86: case :$dllsearchpath: in cannam@86: *":$dir:"*) ;; cannam@86: *) dllsearchpath="$dllsearchpath:$dir";; cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -l*) cannam@86: if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then cannam@86: case $host in cannam@86: *-*-cygwin* | *-*-pw32* | *-*-beos*) cannam@86: # These systems don't actually have a C or math library (as such) cannam@86: continue cannam@86: ;; cannam@86: *-*-mingw* | *-*-os2*) cannam@86: # These systems don't actually have a C library (as such) cannam@86: test "X$arg" = "X-lc" && continue cannam@86: ;; cannam@86: *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) cannam@86: # Do not include libc due to us having libc/libc_r. cannam@86: test "X$arg" = "X-lc" && continue cannam@86: ;; cannam@86: *-*-rhapsody* | *-*-darwin1.[012]) cannam@86: # Rhapsody C and math libraries are in the System framework cannam@86: deplibs="$deplibs -framework System" cannam@86: continue cannam@86: esac cannam@86: elif test "X$arg" = "X-lc_r"; then cannam@86: case $host in cannam@86: *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) cannam@86: # Do not include libc_r directly, use -pthread flag. cannam@86: continue cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: deplibs="$deplibs $arg" cannam@86: continue cannam@86: ;; cannam@86: cannam@86: # Tru64 UNIX uses -model [arg] to determine the layout of C++ cannam@86: # classes, name mangling, and exception handling. cannam@86: -model) cannam@86: compile_command="$compile_command $arg" cannam@86: compiler_flags="$compiler_flags $arg" cannam@86: finalize_command="$finalize_command $arg" cannam@86: prev=xcompiler cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) cannam@86: compiler_flags="$compiler_flags $arg" cannam@86: compile_command="$compile_command $arg" cannam@86: finalize_command="$finalize_command $arg" cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -module) cannam@86: module=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: # -64, -mips[0-9] enable 64-bit mode on the SGI compiler cannam@86: # -r[0-9][0-9]* specifies the processor on the SGI compiler cannam@86: # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler cannam@86: # +DA*, +DD* enable 64-bit mode on the HP compiler cannam@86: # -q* pass through compiler args for the IBM compiler cannam@86: # -m* pass through architecture-specific compiler args for GCC cannam@86: -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) cannam@86: cannam@86: # Unknown arguments in both finalize_command and compile_command need cannam@86: # to be aesthetically quoted because they are evaled later. cannam@86: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: compile_command="$compile_command $arg" cannam@86: finalize_command="$finalize_command $arg" cannam@86: if test "$with_gcc" = "yes" ; then cannam@86: compiler_flags="$compiler_flags $arg" cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -shrext) cannam@86: prev=shrext cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -no-fast-install) cannam@86: fast_install=no cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -no-install) cannam@86: case $host in cannam@86: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) cannam@86: # The PATH hackery in wrapper scripts is required on Windows cannam@86: # in order for the loader to find any dlls it needs. cannam@86: $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 cannam@86: $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 cannam@86: fast_install=no cannam@86: ;; cannam@86: *) no_install=yes ;; cannam@86: esac cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -no-undefined) cannam@86: allow_undefined=no cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -objectlist) cannam@86: prev=objectlist cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -o) prev=output ;; cannam@86: cannam@86: -precious-files-regex) cannam@86: prev=precious_regex cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -release) cannam@86: prev=release cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -rpath) cannam@86: prev=rpath cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -R) cannam@86: prev=xrpath cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -R*) cannam@86: dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` cannam@86: # We need an absolute path. cannam@86: case $dir in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) ;; cannam@86: *) cannam@86: $echo "$modename: only absolute run-paths are allowed" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: case "$xrpath " in cannam@86: *" $dir "*) ;; cannam@86: *) xrpath="$xrpath $dir" ;; cannam@86: esac cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -static) cannam@86: # The effects of -static are defined in a previous loop. cannam@86: # We used to do the same as -all-static on platforms that cannam@86: # didn't have a PIC flag, but the assumption that the effects cannam@86: # would be equivalent was wrong. It would break on at least cannam@86: # Digital Unix and AIX. cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -thread-safe) cannam@86: thread_safe=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -version-info) cannam@86: prev=vinfo cannam@86: continue cannam@86: ;; cannam@86: -version-number) cannam@86: prev=vinfo cannam@86: vinfo_number=yes cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -Wc,*) cannam@86: args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` cannam@86: arg= cannam@86: save_ifs="$IFS"; IFS=',' cannam@86: for flag in $args; do cannam@86: IFS="$save_ifs" cannam@86: case $flag in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: flag="\"$flag\"" cannam@86: ;; cannam@86: esac cannam@86: arg="$arg $wl$flag" cannam@86: compiler_flags="$compiler_flags $flag" cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: arg=`$echo "X$arg" | $Xsed -e "s/^ //"` cannam@86: ;; cannam@86: cannam@86: -Wl,*) cannam@86: args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` cannam@86: arg= cannam@86: save_ifs="$IFS"; IFS=',' cannam@86: for flag in $args; do cannam@86: IFS="$save_ifs" cannam@86: case $flag in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: flag="\"$flag\"" cannam@86: ;; cannam@86: esac cannam@86: arg="$arg $wl$flag" cannam@86: compiler_flags="$compiler_flags $wl$flag" cannam@86: linker_flags="$linker_flags $flag" cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: arg=`$echo "X$arg" | $Xsed -e "s/^ //"` cannam@86: ;; cannam@86: cannam@86: -Xcompiler) cannam@86: prev=xcompiler cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -Xlinker) cannam@86: prev=xlinker cannam@86: continue cannam@86: ;; cannam@86: cannam@86: -XCClinker) cannam@86: prev=xcclinker cannam@86: continue cannam@86: ;; cannam@86: cannam@86: # Some other compiler flag. cannam@86: -* | +*) cannam@86: # Unknown arguments in both finalize_command and compile_command need cannam@86: # to be aesthetically quoted because they are evaled later. cannam@86: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: cannam@86: *.$objext) cannam@86: # A standard object. cannam@86: objs="$objs $arg" cannam@86: ;; cannam@86: cannam@86: *.lo) cannam@86: # A libtool-controlled object. cannam@86: cannam@86: # Check to see that this really is a libtool object. cannam@86: if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: pic_object= cannam@86: non_pic_object= cannam@86: cannam@86: # Read the .lo file cannam@86: # If there is no directory component, then add one. cannam@86: case $arg in cannam@86: */* | *\\*) . $arg ;; cannam@86: *) . ./$arg ;; cannam@86: esac cannam@86: cannam@86: if test -z "$pic_object" || \ cannam@86: test -z "$non_pic_object" || cannam@86: test "$pic_object" = none && \ cannam@86: test "$non_pic_object" = none; then cannam@86: $echo "$modename: cannot find name of object for \`$arg'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Extract subdirectory from the argument. cannam@86: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$xdir" = "X$arg"; then cannam@86: xdir= cannam@86: else cannam@86: xdir="$xdir/" cannam@86: fi cannam@86: cannam@86: if test "$pic_object" != none; then cannam@86: # Prepend the subdirectory the object is found in. cannam@86: pic_object="$xdir$pic_object" cannam@86: cannam@86: if test "$prev" = dlfiles; then cannam@86: if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then cannam@86: dlfiles="$dlfiles $pic_object" cannam@86: prev= cannam@86: continue cannam@86: else cannam@86: # If libtool objects are unsupported, then we need to preload. cannam@86: prev=dlprefiles cannam@86: fi cannam@86: fi cannam@86: cannam@86: # CHECK ME: I think I busted this. -Ossama cannam@86: if test "$prev" = dlprefiles; then cannam@86: # Preload the old-style object. cannam@86: dlprefiles="$dlprefiles $pic_object" cannam@86: prev= cannam@86: fi cannam@86: cannam@86: # A PIC object. cannam@86: libobjs="$libobjs $pic_object" cannam@86: arg="$pic_object" cannam@86: fi cannam@86: cannam@86: # Non-PIC object. cannam@86: if test "$non_pic_object" != none; then cannam@86: # Prepend the subdirectory the object is found in. cannam@86: non_pic_object="$xdir$non_pic_object" cannam@86: cannam@86: # A standard non-PIC object cannam@86: non_pic_objects="$non_pic_objects $non_pic_object" cannam@86: if test -z "$pic_object" || test "$pic_object" = none ; then cannam@86: arg="$non_pic_object" cannam@86: fi cannam@86: fi cannam@86: else cannam@86: # Only an error if not doing a dry-run. cannam@86: if test -z "$run"; then cannam@86: $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: else cannam@86: # Dry-run case. cannam@86: cannam@86: # Extract subdirectory from the argument. cannam@86: xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$xdir" = "X$arg"; then cannam@86: xdir= cannam@86: else cannam@86: xdir="$xdir/" cannam@86: fi cannam@86: cannam@86: pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` cannam@86: non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` cannam@86: libobjs="$libobjs $pic_object" cannam@86: non_pic_objects="$non_pic_objects $non_pic_object" cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: cannam@86: *.$libext) cannam@86: # An archive. cannam@86: deplibs="$deplibs $arg" cannam@86: old_deplibs="$old_deplibs $arg" cannam@86: continue cannam@86: ;; cannam@86: cannam@86: *.la) cannam@86: # A libtool-controlled library. cannam@86: cannam@86: if test "$prev" = dlfiles; then cannam@86: # This library was specified with -dlopen. cannam@86: dlfiles="$dlfiles $arg" cannam@86: prev= cannam@86: elif test "$prev" = dlprefiles; then cannam@86: # The library was specified with -dlpreopen. cannam@86: dlprefiles="$dlprefiles $arg" cannam@86: prev= cannam@86: else cannam@86: deplibs="$deplibs $arg" cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: cannam@86: # Some other compiler argument. cannam@86: *) cannam@86: # Unknown arguments in both finalize_command and compile_command need cannam@86: # to be aesthetically quoted because they are evaled later. cannam@86: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: esac # arg cannam@86: cannam@86: # Now actually substitute the argument into the commands. cannam@86: if test -n "$arg"; then cannam@86: compile_command="$compile_command $arg" cannam@86: finalize_command="$finalize_command $arg" cannam@86: fi cannam@86: done # argument parsing loop cannam@86: cannam@86: if test -n "$prev"; then cannam@86: $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then cannam@86: eval arg=\"$export_dynamic_flag_spec\" cannam@86: compile_command="$compile_command $arg" cannam@86: finalize_command="$finalize_command $arg" cannam@86: fi cannam@86: cannam@86: oldlibs= cannam@86: # calculate the name of the file, without its directory cannam@86: outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` cannam@86: libobjs_save="$libobjs" cannam@86: cannam@86: if test -n "$shlibpath_var"; then cannam@86: # get the directories listed in $shlibpath_var cannam@86: eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` cannam@86: else cannam@86: shlib_search_path= cannam@86: fi cannam@86: eval sys_lib_search_path=\"$sys_lib_search_path_spec\" cannam@86: eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" cannam@86: cannam@86: output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$output_objdir" = "X$output"; then cannam@86: output_objdir="$objdir" cannam@86: else cannam@86: output_objdir="$output_objdir/$objdir" cannam@86: fi cannam@86: # Create the object directory. cannam@86: if test ! -d "$output_objdir"; then cannam@86: $show "$mkdir $output_objdir" cannam@86: $run $mkdir $output_objdir cannam@86: status=$? cannam@86: if test "$status" -ne 0 && test ! -d "$output_objdir"; then cannam@86: exit $status cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Determine the type of output cannam@86: case $output in cannam@86: "") cannam@86: $echo "$modename: you must specify an output file" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: *.$libext) linkmode=oldlib ;; cannam@86: *.lo | *.$objext) linkmode=obj ;; cannam@86: *.la) linkmode=lib ;; cannam@86: *) linkmode=prog ;; # Anything else should be a program. cannam@86: esac cannam@86: cannam@86: case $host in cannam@86: *cygwin* | *mingw* | *pw32*) cannam@86: # don't eliminate duplications in $postdeps and $predeps cannam@86: duplicate_compiler_generated_deps=yes cannam@86: ;; cannam@86: *) cannam@86: duplicate_compiler_generated_deps=$duplicate_deps cannam@86: ;; cannam@86: esac cannam@86: specialdeplibs= cannam@86: cannam@86: libs= cannam@86: # Find all interdependent deplibs by searching for libraries cannam@86: # that are linked more than once (e.g. -la -lb -la) cannam@86: for deplib in $deplibs; do cannam@86: if test "X$duplicate_deps" = "Xyes" ; then cannam@86: case "$libs " in cannam@86: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; cannam@86: esac cannam@86: fi cannam@86: libs="$libs $deplib" cannam@86: done cannam@86: cannam@86: if test "$linkmode" = lib; then cannam@86: libs="$predeps $libs $compiler_lib_search_path $postdeps" cannam@86: cannam@86: # Compute libraries that are listed more than once in $predeps cannam@86: # $postdeps and mark them as special (i.e., whose duplicates are cannam@86: # not to be eliminated). cannam@86: pre_post_deps= cannam@86: if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then cannam@86: for pre_post_dep in $predeps $postdeps; do cannam@86: case "$pre_post_deps " in cannam@86: *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; cannam@86: esac cannam@86: pre_post_deps="$pre_post_deps $pre_post_dep" cannam@86: done cannam@86: fi cannam@86: pre_post_deps= cannam@86: fi cannam@86: cannam@86: deplibs= cannam@86: newdependency_libs= cannam@86: newlib_search_path= cannam@86: need_relink=no # whether we're linking any uninstalled libtool libraries cannam@86: notinst_deplibs= # not-installed libtool libraries cannam@86: notinst_path= # paths that contain not-installed libtool libraries cannam@86: case $linkmode in cannam@86: lib) cannam@86: passes="conv link" cannam@86: for file in $dlfiles $dlprefiles; do cannam@86: case $file in cannam@86: *.la) ;; cannam@86: *) cannam@86: $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: ;; cannam@86: prog) cannam@86: compile_deplibs= cannam@86: finalize_deplibs= cannam@86: alldeplibs=no cannam@86: newdlfiles= cannam@86: newdlprefiles= cannam@86: passes="conv scan dlopen dlpreopen link" cannam@86: ;; cannam@86: *) passes="conv" cannam@86: ;; cannam@86: esac cannam@86: for pass in $passes; do cannam@86: if test "$linkmode,$pass" = "lib,link" || cannam@86: test "$linkmode,$pass" = "prog,scan"; then cannam@86: libs="$deplibs" cannam@86: deplibs= cannam@86: fi cannam@86: if test "$linkmode" = prog; then cannam@86: case $pass in cannam@86: dlopen) libs="$dlfiles" ;; cannam@86: dlpreopen) libs="$dlprefiles" ;; cannam@86: link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; cannam@86: esac cannam@86: fi cannam@86: if test "$pass" = dlopen; then cannam@86: # Collect dlpreopened libraries cannam@86: save_deplibs="$deplibs" cannam@86: deplibs= cannam@86: fi cannam@86: for deplib in $libs; do cannam@86: lib= cannam@86: found=no cannam@86: case $deplib in cannam@86: -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) cannam@86: if test "$linkmode,$pass" = "prog,link"; then cannam@86: compile_deplibs="$deplib $compile_deplibs" cannam@86: finalize_deplibs="$deplib $finalize_deplibs" cannam@86: else cannam@86: compiler_flags="$compiler_flags $deplib" cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: -l*) cannam@86: if test "$linkmode" != lib && test "$linkmode" != prog; then cannam@86: $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 cannam@86: continue cannam@86: fi cannam@86: name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` cannam@86: for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do cannam@86: for search_ext in .la $std_shrext .so .a; do cannam@86: # Search the libtool library cannam@86: lib="$searchdir/lib${name}${search_ext}" cannam@86: if test -f "$lib"; then cannam@86: if test "$search_ext" = ".la"; then cannam@86: found=yes cannam@86: else cannam@86: found=no cannam@86: fi cannam@86: break 2 cannam@86: fi cannam@86: done cannam@86: done cannam@86: if test "$found" != yes; then cannam@86: # deplib doesn't seem to be a libtool library cannam@86: if test "$linkmode,$pass" = "prog,link"; then cannam@86: compile_deplibs="$deplib $compile_deplibs" cannam@86: finalize_deplibs="$deplib $finalize_deplibs" cannam@86: else cannam@86: deplibs="$deplib $deplibs" cannam@86: test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" cannam@86: fi cannam@86: continue cannam@86: else # deplib is a libtool library cannam@86: # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, cannam@86: # We need to do some special things here, and not later. cannam@86: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then cannam@86: case " $predeps $postdeps " in cannam@86: *" $deplib "*) cannam@86: if (${SED} -e '2q' $lib | cannam@86: grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: library_names= cannam@86: old_library= cannam@86: case $lib in cannam@86: */* | *\\*) . $lib ;; cannam@86: *) . ./$lib ;; cannam@86: esac cannam@86: for l in $old_library $library_names; do cannam@86: ll="$l" cannam@86: done cannam@86: if test "X$ll" = "X$old_library" ; then # only static version available cannam@86: found=no cannam@86: ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` cannam@86: test "X$ladir" = "X$lib" && ladir="." cannam@86: lib=$ladir/$old_library cannam@86: if test "$linkmode,$pass" = "prog,link"; then cannam@86: compile_deplibs="$deplib $compile_deplibs" cannam@86: finalize_deplibs="$deplib $finalize_deplibs" cannam@86: else cannam@86: deplibs="$deplib $deplibs" cannam@86: test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" cannam@86: fi cannam@86: continue cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: *) ;; cannam@86: esac cannam@86: fi cannam@86: fi cannam@86: ;; # -l cannam@86: -L*) cannam@86: case $linkmode in cannam@86: lib) cannam@86: deplibs="$deplib $deplibs" cannam@86: test "$pass" = conv && continue cannam@86: newdependency_libs="$deplib $newdependency_libs" cannam@86: newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` cannam@86: ;; cannam@86: prog) cannam@86: if test "$pass" = conv; then cannam@86: deplibs="$deplib $deplibs" cannam@86: continue cannam@86: fi cannam@86: if test "$pass" = scan; then cannam@86: deplibs="$deplib $deplibs" cannam@86: else cannam@86: compile_deplibs="$deplib $compile_deplibs" cannam@86: finalize_deplibs="$deplib $finalize_deplibs" cannam@86: fi cannam@86: newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` cannam@86: ;; cannam@86: *) cannam@86: $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 cannam@86: ;; cannam@86: esac # linkmode cannam@86: continue cannam@86: ;; # -L cannam@86: -R*) cannam@86: if test "$pass" = link; then cannam@86: dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` cannam@86: # Make sure the xrpath contains only unique directories. cannam@86: case "$xrpath " in cannam@86: *" $dir "*) ;; cannam@86: *) xrpath="$xrpath $dir" ;; cannam@86: esac cannam@86: fi cannam@86: deplibs="$deplib $deplibs" cannam@86: continue cannam@86: ;; cannam@86: *.la) lib="$deplib" ;; cannam@86: *.$libext) cannam@86: if test "$pass" = conv; then cannam@86: deplibs="$deplib $deplibs" cannam@86: continue cannam@86: fi cannam@86: case $linkmode in cannam@86: lib) cannam@86: valid_a_lib=no cannam@86: case $deplibs_check_method in cannam@86: match_pattern*) cannam@86: set dummy $deplibs_check_method cannam@86: match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` cannam@86: if eval $echo \"$deplib\" 2>/dev/null \ cannam@86: | $SED 10q \ cannam@86: | $EGREP "$match_pattern_regex" > /dev/null; then cannam@86: valid_a_lib=yes cannam@86: fi cannam@86: ;; cannam@86: pass_all) cannam@86: valid_a_lib=yes cannam@86: ;; cannam@86: esac cannam@86: if test "$valid_a_lib" != yes; then cannam@86: $echo cannam@86: $echo "*** Warning: Trying to link with static lib archive $deplib." cannam@86: $echo "*** I have the capability to make that library automatically link in when" cannam@86: $echo "*** you link to this library. But I can only do this if you have a" cannam@86: $echo "*** shared version of the library, which you do not appear to have" cannam@86: $echo "*** because the file extensions .$libext of this argument makes me believe" cannam@86: $echo "*** that it is just a static archive that I should not used here." cannam@86: else cannam@86: $echo cannam@86: $echo "*** Warning: Linking the shared library $output against the" cannam@86: $echo "*** static library $deplib is not portable!" cannam@86: deplibs="$deplib $deplibs" cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: prog) cannam@86: if test "$pass" != link; then cannam@86: deplibs="$deplib $deplibs" cannam@86: else cannam@86: compile_deplibs="$deplib $compile_deplibs" cannam@86: finalize_deplibs="$deplib $finalize_deplibs" cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: esac # linkmode cannam@86: ;; # *.$libext cannam@86: *.lo | *.$objext) cannam@86: if test "$pass" = conv; then cannam@86: deplibs="$deplib $deplibs" cannam@86: elif test "$linkmode" = prog; then cannam@86: if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then cannam@86: # If there is no dlopen support or we're linking statically, cannam@86: # we need to preload. cannam@86: newdlprefiles="$newdlprefiles $deplib" cannam@86: compile_deplibs="$deplib $compile_deplibs" cannam@86: finalize_deplibs="$deplib $finalize_deplibs" cannam@86: else cannam@86: newdlfiles="$newdlfiles $deplib" cannam@86: fi cannam@86: fi cannam@86: continue cannam@86: ;; cannam@86: %DEPLIBS%) cannam@86: alldeplibs=yes cannam@86: continue cannam@86: ;; cannam@86: esac # case $deplib cannam@86: if test "$found" = yes || test -f "$lib"; then : cannam@86: else cannam@86: $echo "$modename: cannot find the library \`$lib'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Check to see that this really is a libtool archive. cannam@86: if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : cannam@86: else cannam@86: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` cannam@86: test "X$ladir" = "X$lib" && ladir="." cannam@86: cannam@86: dlname= cannam@86: dlopen= cannam@86: dlpreopen= cannam@86: libdir= cannam@86: library_names= cannam@86: old_library= cannam@86: # If the library was installed with an old release of libtool, cannam@86: # it will not redefine variables installed, or shouldnotlink cannam@86: installed=yes cannam@86: shouldnotlink=no cannam@86: avoidtemprpath= cannam@86: cannam@86: cannam@86: # Read the .la file cannam@86: case $lib in cannam@86: */* | *\\*) . $lib ;; cannam@86: *) . ./$lib ;; cannam@86: esac cannam@86: cannam@86: if test "$linkmode,$pass" = "lib,link" || cannam@86: test "$linkmode,$pass" = "prog,scan" || cannam@86: { test "$linkmode" != prog && test "$linkmode" != lib; }; then cannam@86: test -n "$dlopen" && dlfiles="$dlfiles $dlopen" cannam@86: test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" cannam@86: fi cannam@86: cannam@86: if test "$pass" = conv; then cannam@86: # Only check for convenience libraries cannam@86: deplibs="$lib $deplibs" cannam@86: if test -z "$libdir"; then cannam@86: if test -z "$old_library"; then cannam@86: $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: # It is a libtool convenience library, so add in its objects. cannam@86: convenience="$convenience $ladir/$objdir/$old_library" cannam@86: old_convenience="$old_convenience $ladir/$objdir/$old_library" cannam@86: tmp_libs= cannam@86: for deplib in $dependency_libs; do cannam@86: deplibs="$deplib $deplibs" cannam@86: if test "X$duplicate_deps" = "Xyes" ; then cannam@86: case "$tmp_libs " in cannam@86: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; cannam@86: esac cannam@86: fi cannam@86: tmp_libs="$tmp_libs $deplib" cannam@86: done cannam@86: elif test "$linkmode" != prog && test "$linkmode" != lib; then cannam@86: $echo "$modename: \`$lib' is not a convenience library" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: continue cannam@86: fi # $pass = conv cannam@86: cannam@86: cannam@86: # Get the name of the library we link against. cannam@86: linklib= cannam@86: for l in $old_library $library_names; do cannam@86: linklib="$l" cannam@86: done cannam@86: if test -z "$linklib"; then cannam@86: $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # This library was specified with -dlopen. cannam@86: if test "$pass" = dlopen; then cannam@86: if test -z "$libdir"; then cannam@86: $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: if test -z "$dlname" || cannam@86: test "$dlopen_support" != yes || cannam@86: test "$build_libtool_libs" = no; then cannam@86: # If there is no dlname, no dlopen support or we're linking cannam@86: # statically, we need to preload. We also need to preload any cannam@86: # dependent libraries so libltdl's deplib preloader doesn't cannam@86: # bomb out in the load deplibs phase. cannam@86: dlprefiles="$dlprefiles $lib $dependency_libs" cannam@86: else cannam@86: newdlfiles="$newdlfiles $lib" cannam@86: fi cannam@86: continue cannam@86: fi # $pass = dlopen cannam@86: cannam@86: # We need an absolute path. cannam@86: case $ladir in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; cannam@86: *) cannam@86: abs_ladir=`cd "$ladir" && pwd` cannam@86: if test -z "$abs_ladir"; then cannam@86: $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 cannam@86: $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 cannam@86: abs_ladir="$ladir" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` cannam@86: cannam@86: # Find the relevant object directory and library name. cannam@86: if test "X$installed" = Xyes; then cannam@86: if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then cannam@86: $echo "$modename: warning: library \`$lib' was moved." 1>&2 cannam@86: dir="$ladir" cannam@86: absdir="$abs_ladir" cannam@86: libdir="$abs_ladir" cannam@86: else cannam@86: dir="$libdir" cannam@86: absdir="$libdir" cannam@86: fi cannam@86: test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes cannam@86: else cannam@86: if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then cannam@86: dir="$ladir" cannam@86: absdir="$abs_ladir" cannam@86: # Remove this search path later cannam@86: notinst_path="$notinst_path $abs_ladir" cannam@86: else cannam@86: dir="$ladir/$objdir" cannam@86: absdir="$abs_ladir/$objdir" cannam@86: # Remove this search path later cannam@86: notinst_path="$notinst_path $abs_ladir" cannam@86: fi cannam@86: fi # $installed = yes cannam@86: name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` cannam@86: cannam@86: # This library was specified with -dlpreopen. cannam@86: if test "$pass" = dlpreopen; then cannam@86: if test -z "$libdir"; then cannam@86: $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: # Prefer using a static library (so that no silly _DYNAMIC symbols cannam@86: # are required to link). cannam@86: if test -n "$old_library"; then cannam@86: newdlprefiles="$newdlprefiles $dir/$old_library" cannam@86: # Otherwise, use the dlname, so that lt_dlopen finds it. cannam@86: elif test -n "$dlname"; then cannam@86: newdlprefiles="$newdlprefiles $dir/$dlname" cannam@86: else cannam@86: newdlprefiles="$newdlprefiles $dir/$linklib" cannam@86: fi cannam@86: fi # $pass = dlpreopen cannam@86: cannam@86: if test -z "$libdir"; then cannam@86: # Link the convenience library cannam@86: if test "$linkmode" = lib; then cannam@86: deplibs="$dir/$old_library $deplibs" cannam@86: elif test "$linkmode,$pass" = "prog,link"; then cannam@86: compile_deplibs="$dir/$old_library $compile_deplibs" cannam@86: finalize_deplibs="$dir/$old_library $finalize_deplibs" cannam@86: else cannam@86: deplibs="$lib $deplibs" # used for prog,scan pass cannam@86: fi cannam@86: continue cannam@86: fi cannam@86: cannam@86: cannam@86: if test "$linkmode" = prog && test "$pass" != link; then cannam@86: newlib_search_path="$newlib_search_path $ladir" cannam@86: deplibs="$lib $deplibs" cannam@86: cannam@86: linkalldeplibs=no cannam@86: if test "$link_all_deplibs" != no || test -z "$library_names" || cannam@86: test "$build_libtool_libs" = no; then cannam@86: linkalldeplibs=yes cannam@86: fi cannam@86: cannam@86: tmp_libs= cannam@86: for deplib in $dependency_libs; do cannam@86: case $deplib in cannam@86: -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test cannam@86: esac cannam@86: # Need to link against all dependency_libs? cannam@86: if test "$linkalldeplibs" = yes; then cannam@86: deplibs="$deplib $deplibs" cannam@86: else cannam@86: # Need to hardcode shared library paths cannam@86: # or/and link against static libraries cannam@86: newdependency_libs="$deplib $newdependency_libs" cannam@86: fi cannam@86: if test "X$duplicate_deps" = "Xyes" ; then cannam@86: case "$tmp_libs " in cannam@86: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; cannam@86: esac cannam@86: fi cannam@86: tmp_libs="$tmp_libs $deplib" cannam@86: done # for deplib cannam@86: continue cannam@86: fi # $linkmode = prog... cannam@86: cannam@86: if test "$linkmode,$pass" = "prog,link"; then cannam@86: if test -n "$library_names" && cannam@86: { test "$prefer_static_libs" = no || test -z "$old_library"; }; then cannam@86: # We need to hardcode the library path cannam@86: if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then cannam@86: # Make sure the rpath contains only unique directories. cannam@86: case "$temp_rpath " in cannam@86: *" $dir "*) ;; cannam@86: *" $absdir "*) ;; cannam@86: *) temp_rpath="$temp_rpath $dir" ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: # Hardcode the library path. cannam@86: # Skip directories that are in the system default run-time cannam@86: # search path. cannam@86: case " $sys_lib_dlsearch_path " in cannam@86: *" $absdir "*) ;; cannam@86: *) cannam@86: case "$compile_rpath " in cannam@86: *" $absdir "*) ;; cannam@86: *) compile_rpath="$compile_rpath $absdir" cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: case " $sys_lib_dlsearch_path " in cannam@86: *" $libdir "*) ;; cannam@86: *) cannam@86: case "$finalize_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) finalize_rpath="$finalize_rpath $libdir" cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: fi # $linkmode,$pass = prog,link... cannam@86: cannam@86: if test "$alldeplibs" = yes && cannam@86: { test "$deplibs_check_method" = pass_all || cannam@86: { test "$build_libtool_libs" = yes && cannam@86: test -n "$library_names"; }; }; then cannam@86: # We only need to search for static libraries cannam@86: continue cannam@86: fi cannam@86: fi cannam@86: cannam@86: link_static=no # Whether the deplib will be linked statically cannam@86: if test -n "$library_names" && cannam@86: { test "$prefer_static_libs" = no || test -z "$old_library"; }; then cannam@86: if test "$installed" = no; then cannam@86: notinst_deplibs="$notinst_deplibs $lib" cannam@86: need_relink=yes cannam@86: fi cannam@86: # This is a shared library cannam@86: cannam@86: # Warn about portability, can't link against -module's on cannam@86: # some systems (darwin) cannam@86: if test "$shouldnotlink" = yes && test "$pass" = link ; then cannam@86: $echo cannam@86: if test "$linkmode" = prog; then cannam@86: $echo "*** Warning: Linking the executable $output against the loadable module" cannam@86: else cannam@86: $echo "*** Warning: Linking the shared library $output against the loadable module" cannam@86: fi cannam@86: $echo "*** $linklib is not portable!" cannam@86: fi cannam@86: if test "$linkmode" = lib && cannam@86: test "$hardcode_into_libs" = yes; then cannam@86: # Hardcode the library path. cannam@86: # Skip directories that are in the system default run-time cannam@86: # search path. cannam@86: case " $sys_lib_dlsearch_path " in cannam@86: *" $absdir "*) ;; cannam@86: *) cannam@86: case "$compile_rpath " in cannam@86: *" $absdir "*) ;; cannam@86: *) compile_rpath="$compile_rpath $absdir" cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: case " $sys_lib_dlsearch_path " in cannam@86: *" $libdir "*) ;; cannam@86: *) cannam@86: case "$finalize_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) finalize_rpath="$finalize_rpath $libdir" cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: if test -n "$old_archive_from_expsyms_cmds"; then cannam@86: # figure out the soname cannam@86: set dummy $library_names cannam@86: realname="$2" cannam@86: shift; shift cannam@86: libname=`eval \\$echo \"$libname_spec\"` cannam@86: # use dlname if we got it. it's perfectly good, no? cannam@86: if test -n "$dlname"; then cannam@86: soname="$dlname" cannam@86: elif test -n "$soname_spec"; then cannam@86: # bleh windows cannam@86: case $host in cannam@86: *cygwin* | mingw*) cannam@86: major=`expr $current - $age` cannam@86: versuffix="-$major" cannam@86: ;; cannam@86: esac cannam@86: eval soname=\"$soname_spec\" cannam@86: else cannam@86: soname="$realname" cannam@86: fi cannam@86: cannam@86: # Make a new name for the extract_expsyms_cmds to use cannam@86: soroot="$soname" cannam@86: soname=`$echo $soroot | ${SED} -e 's/^.*\///'` cannam@86: newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" cannam@86: cannam@86: # If the library has no export list, then create one now cannam@86: if test -f "$output_objdir/$soname-def"; then : cannam@86: else cannam@86: $show "extracting exported symbol list from \`$soname'" cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: cmds=$extract_expsyms_cmds cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: cannam@86: # Create $newlib cannam@86: if test -f "$output_objdir/$newlib"; then :; else cannam@86: $show "generating import library for \`$soname'" cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: cmds=$old_archive_from_expsyms_cmds cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: # make sure the library variables are pointing to the new library cannam@86: dir=$output_objdir cannam@86: linklib=$newlib cannam@86: fi # test -n "$old_archive_from_expsyms_cmds" cannam@86: cannam@86: if test "$linkmode" = prog || test "$mode" != relink; then cannam@86: add_shlibpath= cannam@86: add_dir= cannam@86: add= cannam@86: lib_linked=yes cannam@86: case $hardcode_action in cannam@86: immediate | unsupported) cannam@86: if test "$hardcode_direct" = no; then cannam@86: add="$dir/$linklib" cannam@86: case $host in cannam@86: *-*-sco3.2v5* ) add_dir="-L$dir" ;; cannam@86: *-*-darwin* ) cannam@86: # if the lib is a module then we can not link against cannam@86: # it, someone is ignoring the new warnings I added cannam@86: if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then cannam@86: $echo "** Warning, lib $linklib is a module, not a shared library" cannam@86: if test -z "$old_library" ; then cannam@86: $echo cannam@86: $echo "** And there doesn't seem to be a static archive available" cannam@86: $echo "** The link will probably fail, sorry" cannam@86: else cannam@86: add="$dir/$old_library" cannam@86: fi cannam@86: fi cannam@86: esac cannam@86: elif test "$hardcode_minus_L" = no; then cannam@86: case $host in cannam@86: *-*-sunos*) add_shlibpath="$dir" ;; cannam@86: esac cannam@86: add_dir="-L$dir" cannam@86: add="-l$name" cannam@86: elif test "$hardcode_shlibpath_var" = no; then cannam@86: add_shlibpath="$dir" cannam@86: add="-l$name" cannam@86: else cannam@86: lib_linked=no cannam@86: fi cannam@86: ;; cannam@86: relink) cannam@86: if test "$hardcode_direct" = yes; then cannam@86: add="$dir/$linklib" cannam@86: elif test "$hardcode_minus_L" = yes; then cannam@86: add_dir="-L$dir" cannam@86: # Try looking first in the location we're being installed to. cannam@86: if test -n "$inst_prefix_dir"; then cannam@86: case "$libdir" in cannam@86: [\\/]*) cannam@86: add_dir="$add_dir -L$inst_prefix_dir$libdir" cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: add="-l$name" cannam@86: elif test "$hardcode_shlibpath_var" = yes; then cannam@86: add_shlibpath="$dir" cannam@86: add="-l$name" cannam@86: else cannam@86: lib_linked=no cannam@86: fi cannam@86: ;; cannam@86: *) lib_linked=no ;; cannam@86: esac cannam@86: cannam@86: if test "$lib_linked" != yes; then cannam@86: $echo "$modename: configuration error: unsupported hardcode properties" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: if test -n "$add_shlibpath"; then cannam@86: case :$compile_shlibpath: in cannam@86: *":$add_shlibpath:"*) ;; cannam@86: *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; cannam@86: esac cannam@86: fi cannam@86: if test "$linkmode" = prog; then cannam@86: test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" cannam@86: test -n "$add" && compile_deplibs="$add $compile_deplibs" cannam@86: else cannam@86: test -n "$add_dir" && deplibs="$add_dir $deplibs" cannam@86: test -n "$add" && deplibs="$add $deplibs" cannam@86: if test "$hardcode_direct" != yes && \ cannam@86: test "$hardcode_minus_L" != yes && \ cannam@86: test "$hardcode_shlibpath_var" = yes; then cannam@86: case :$finalize_shlibpath: in cannam@86: *":$libdir:"*) ;; cannam@86: *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; cannam@86: esac cannam@86: fi cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test "$linkmode" = prog || test "$mode" = relink; then cannam@86: add_shlibpath= cannam@86: add_dir= cannam@86: add= cannam@86: # Finalize command for both is simple: just hardcode it. cannam@86: if test "$hardcode_direct" = yes; then cannam@86: add="$libdir/$linklib" cannam@86: elif test "$hardcode_minus_L" = yes; then cannam@86: add_dir="-L$libdir" cannam@86: add="-l$name" cannam@86: elif test "$hardcode_shlibpath_var" = yes; then cannam@86: case :$finalize_shlibpath: in cannam@86: *":$libdir:"*) ;; cannam@86: *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; cannam@86: esac cannam@86: add="-l$name" cannam@86: elif test "$hardcode_automatic" = yes; then cannam@86: if test -n "$inst_prefix_dir" && cannam@86: test -f "$inst_prefix_dir$libdir/$linklib" ; then cannam@86: add="$inst_prefix_dir$libdir/$linklib" cannam@86: else cannam@86: add="$libdir/$linklib" cannam@86: fi cannam@86: else cannam@86: # We cannot seem to hardcode it, guess we'll fake it. cannam@86: add_dir="-L$libdir" cannam@86: # Try looking first in the location we're being installed to. cannam@86: if test -n "$inst_prefix_dir"; then cannam@86: case "$libdir" in cannam@86: [\\/]*) cannam@86: add_dir="$add_dir -L$inst_prefix_dir$libdir" cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: add="-l$name" cannam@86: fi cannam@86: cannam@86: if test "$linkmode" = prog; then cannam@86: test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" cannam@86: test -n "$add" && finalize_deplibs="$add $finalize_deplibs" cannam@86: else cannam@86: test -n "$add_dir" && deplibs="$add_dir $deplibs" cannam@86: test -n "$add" && deplibs="$add $deplibs" cannam@86: fi cannam@86: fi cannam@86: elif test "$linkmode" = prog; then cannam@86: # Here we assume that one of hardcode_direct or hardcode_minus_L cannam@86: # is not unsupported. This is valid on all known static and cannam@86: # shared platforms. cannam@86: if test "$hardcode_direct" != unsupported; then cannam@86: test -n "$old_library" && linklib="$old_library" cannam@86: compile_deplibs="$dir/$linklib $compile_deplibs" cannam@86: finalize_deplibs="$dir/$linklib $finalize_deplibs" cannam@86: else cannam@86: compile_deplibs="-l$name -L$dir $compile_deplibs" cannam@86: finalize_deplibs="-l$name -L$dir $finalize_deplibs" cannam@86: fi cannam@86: elif test "$build_libtool_libs" = yes; then cannam@86: # Not a shared library cannam@86: if test "$deplibs_check_method" != pass_all; then cannam@86: # We're trying link a shared library against a static one cannam@86: # but the system doesn't support it. cannam@86: cannam@86: # Just print a warning and add the library to dependency_libs so cannam@86: # that the program can be linked against the static library. cannam@86: $echo cannam@86: $echo "*** Warning: This system can not link to static lib archive $lib." cannam@86: $echo "*** I have the capability to make that library automatically link in when" cannam@86: $echo "*** you link to this library. But I can only do this if you have a" cannam@86: $echo "*** shared version of the library, which you do not appear to have." cannam@86: if test "$module" = yes; then cannam@86: $echo "*** But as you try to build a module library, libtool will still create " cannam@86: $echo "*** a static module, that should work as long as the dlopening application" cannam@86: $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." cannam@86: if test -z "$global_symbol_pipe"; then cannam@86: $echo cannam@86: $echo "*** However, this would only work if libtool was able to extract symbol" cannam@86: $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" cannam@86: $echo "*** not find such a program. So, this module is probably useless." cannam@86: $echo "*** \`nm' from GNU binutils and a full rebuild may help." cannam@86: fi cannam@86: if test "$build_old_libs" = no; then cannam@86: build_libtool_libs=module cannam@86: build_old_libs=yes cannam@86: else cannam@86: build_libtool_libs=no cannam@86: fi cannam@86: fi cannam@86: else cannam@86: convenience="$convenience $dir/$old_library" cannam@86: old_convenience="$old_convenience $dir/$old_library" cannam@86: deplibs="$dir/$old_library $deplibs" cannam@86: link_static=yes cannam@86: fi cannam@86: fi # link shared/static library? cannam@86: cannam@86: if test "$linkmode" = lib; then cannam@86: if test -n "$dependency_libs" && cannam@86: { test "$hardcode_into_libs" != yes || cannam@86: test "$build_old_libs" = yes || cannam@86: test "$link_static" = yes; }; then cannam@86: # Extract -R from dependency_libs cannam@86: temp_deplibs= cannam@86: for libdir in $dependency_libs; do cannam@86: case $libdir in cannam@86: -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` cannam@86: case " $xrpath " in cannam@86: *" $temp_xrpath "*) ;; cannam@86: *) xrpath="$xrpath $temp_xrpath";; cannam@86: esac;; cannam@86: *) temp_deplibs="$temp_deplibs $libdir";; cannam@86: esac cannam@86: done cannam@86: dependency_libs="$temp_deplibs" cannam@86: fi cannam@86: cannam@86: newlib_search_path="$newlib_search_path $absdir" cannam@86: # Link against this library cannam@86: test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" cannam@86: # ... and its dependency_libs cannam@86: tmp_libs= cannam@86: for deplib in $dependency_libs; do cannam@86: newdependency_libs="$deplib $newdependency_libs" cannam@86: if test "X$duplicate_deps" = "Xyes" ; then cannam@86: case "$tmp_libs " in cannam@86: *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; cannam@86: esac cannam@86: fi cannam@86: tmp_libs="$tmp_libs $deplib" cannam@86: done cannam@86: cannam@86: if test "$link_all_deplibs" != no; then cannam@86: # Add the search paths of all dependency libraries cannam@86: for deplib in $dependency_libs; do cannam@86: case $deplib in cannam@86: -L*) path="$deplib" ;; cannam@86: *.la) cannam@86: dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` cannam@86: test "X$dir" = "X$deplib" && dir="." cannam@86: # We need an absolute path. cannam@86: case $dir in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; cannam@86: *) cannam@86: absdir=`cd "$dir" && pwd` cannam@86: if test -z "$absdir"; then cannam@86: $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 cannam@86: absdir="$dir" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: if grep "^installed=no" $deplib > /dev/null; then cannam@86: path="$absdir/$objdir" cannam@86: else cannam@86: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` cannam@86: if test -z "$libdir"; then cannam@86: $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: if test "$absdir" != "$libdir"; then cannam@86: $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 cannam@86: fi cannam@86: path="$absdir" cannam@86: fi cannam@86: depdepl= cannam@86: case $host in cannam@86: *-*-darwin*) cannam@86: # we do not want to link against static libs, cannam@86: # but need to link against shared cannam@86: eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` cannam@86: if test -n "$deplibrary_names" ; then cannam@86: for tmp in $deplibrary_names ; do cannam@86: depdepl=$tmp cannam@86: done cannam@86: if test -f "$path/$depdepl" ; then cannam@86: depdepl="$path/$depdepl" cannam@86: fi cannam@86: # do not add paths which are already there cannam@86: case " $newlib_search_path " in cannam@86: *" $path "*) ;; cannam@86: *) newlib_search_path="$newlib_search_path $path";; cannam@86: esac cannam@86: fi cannam@86: path="" cannam@86: ;; cannam@86: *) cannam@86: path="-L$path" cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: -l*) cannam@86: case $host in cannam@86: *-*-darwin*) cannam@86: # Again, we only want to link against shared libraries cannam@86: eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` cannam@86: for tmp in $newlib_search_path ; do cannam@86: if test -f "$tmp/lib$tmp_libs.dylib" ; then cannam@86: eval depdepl="$tmp/lib$tmp_libs.dylib" cannam@86: break cannam@86: fi cannam@86: done cannam@86: path="" cannam@86: ;; cannam@86: *) continue ;; cannam@86: esac cannam@86: ;; cannam@86: *) continue ;; cannam@86: esac cannam@86: case " $deplibs " in cannam@86: *" $path "*) ;; cannam@86: *) deplibs="$path $deplibs" ;; cannam@86: esac cannam@86: case " $deplibs " in cannam@86: *" $depdepl "*) ;; cannam@86: *) deplibs="$depdepl $deplibs" ;; cannam@86: esac cannam@86: done cannam@86: fi # link_all_deplibs != no cannam@86: fi # linkmode = lib cannam@86: done # for deplib in $libs cannam@86: dependency_libs="$newdependency_libs" cannam@86: if test "$pass" = dlpreopen; then cannam@86: # Link the dlpreopened libraries before other libraries cannam@86: for deplib in $save_deplibs; do cannam@86: deplibs="$deplib $deplibs" cannam@86: done cannam@86: fi cannam@86: if test "$pass" != dlopen; then cannam@86: if test "$pass" != conv; then cannam@86: # Make sure lib_search_path contains only unique directories. cannam@86: lib_search_path= cannam@86: for dir in $newlib_search_path; do cannam@86: case "$lib_search_path " in cannam@86: *" $dir "*) ;; cannam@86: *) lib_search_path="$lib_search_path $dir" ;; cannam@86: esac cannam@86: done cannam@86: newlib_search_path= cannam@86: fi cannam@86: cannam@86: if test "$linkmode,$pass" != "prog,link"; then cannam@86: vars="deplibs" cannam@86: else cannam@86: vars="compile_deplibs finalize_deplibs" cannam@86: fi cannam@86: for var in $vars dependency_libs; do cannam@86: # Add libraries to $var in reverse order cannam@86: eval tmp_libs=\"\$$var\" cannam@86: new_libs= cannam@86: for deplib in $tmp_libs; do cannam@86: # FIXME: Pedantically, this is the right thing to do, so cannam@86: # that some nasty dependency loop isn't accidentally cannam@86: # broken: cannam@86: #new_libs="$deplib $new_libs" cannam@86: # Pragmatically, this seems to cause very few problems in cannam@86: # practice: cannam@86: case $deplib in cannam@86: -L*) new_libs="$deplib $new_libs" ;; cannam@86: -R*) ;; cannam@86: *) cannam@86: # And here is the reason: when a library appears more cannam@86: # than once as an explicit dependence of a library, or cannam@86: # is implicitly linked in more than once by the cannam@86: # compiler, it is considered special, and multiple cannam@86: # occurrences thereof are not removed. Compare this cannam@86: # with having the same library being listed as a cannam@86: # dependency of multiple other libraries: in this case, cannam@86: # we know (pedantically, we assume) the library does not cannam@86: # need to be listed more than once, so we keep only the cannam@86: # last copy. This is not always right, but it is rare cannam@86: # enough that we require users that really mean to play cannam@86: # such unportable linking tricks to link the library cannam@86: # using -Wl,-lname, so that libtool does not consider it cannam@86: # for duplicate removal. cannam@86: case " $specialdeplibs " in cannam@86: *" $deplib "*) new_libs="$deplib $new_libs" ;; cannam@86: *) cannam@86: case " $new_libs " in cannam@86: *" $deplib "*) ;; cannam@86: *) new_libs="$deplib $new_libs" ;; cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: tmp_libs= cannam@86: for deplib in $new_libs; do cannam@86: case $deplib in cannam@86: -L*) cannam@86: case " $tmp_libs " in cannam@86: *" $deplib "*) ;; cannam@86: *) tmp_libs="$tmp_libs $deplib" ;; cannam@86: esac cannam@86: ;; cannam@86: *) tmp_libs="$tmp_libs $deplib" ;; cannam@86: esac cannam@86: done cannam@86: eval $var=\"$tmp_libs\" cannam@86: done # for var cannam@86: fi cannam@86: # Last step: remove runtime libs from dependency_libs cannam@86: # (they stay in deplibs) cannam@86: tmp_libs= cannam@86: for i in $dependency_libs ; do cannam@86: case " $predeps $postdeps $compiler_lib_search_path " in cannam@86: *" $i "*) cannam@86: i="" cannam@86: ;; cannam@86: esac cannam@86: if test -n "$i" ; then cannam@86: tmp_libs="$tmp_libs $i" cannam@86: fi cannam@86: done cannam@86: dependency_libs=$tmp_libs cannam@86: done # for pass cannam@86: if test "$linkmode" = prog; then cannam@86: dlfiles="$newdlfiles" cannam@86: dlprefiles="$newdlprefiles" cannam@86: fi cannam@86: cannam@86: case $linkmode in cannam@86: oldlib) cannam@86: if test -n "$deplibs"; then cannam@86: $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then cannam@86: $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$rpath"; then cannam@86: $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$xrpath"; then cannam@86: $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$vinfo"; then cannam@86: $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$release"; then cannam@86: $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$export_symbols" || test -n "$export_symbols_regex"; then cannam@86: $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 cannam@86: fi cannam@86: cannam@86: # Now set the variables for building old libraries. cannam@86: build_libtool_libs=no cannam@86: oldlibs="$output" cannam@86: objs="$objs$old_deplibs" cannam@86: ;; cannam@86: cannam@86: lib) cannam@86: # Make sure we only generate libraries of the form `libNAME.la'. cannam@86: case $outputname in cannam@86: lib*) cannam@86: name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` cannam@86: eval shared_ext=\"$shrext_cmds\" cannam@86: eval libname=\"$libname_spec\" cannam@86: ;; cannam@86: *) cannam@86: if test "$module" = no; then cannam@86: $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: if test "$need_lib_prefix" != no; then cannam@86: # Add the "lib" prefix for modules if required cannam@86: name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` cannam@86: eval shared_ext=\"$shrext_cmds\" cannam@86: eval libname=\"$libname_spec\" cannam@86: else cannam@86: libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: cannam@86: if test -n "$objs"; then cannam@86: if test "$deplibs_check_method" != pass_all; then cannam@86: $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 cannam@86: exit $EXIT_FAILURE cannam@86: else cannam@86: $echo cannam@86: $echo "*** Warning: Linking the shared library $output against the non-libtool" cannam@86: $echo "*** objects $objs is not portable!" cannam@86: libobjs="$libobjs $objs" cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test "$dlself" != no; then cannam@86: $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 cannam@86: fi cannam@86: cannam@86: set dummy $rpath cannam@86: if test "$#" -gt 2; then cannam@86: $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 cannam@86: fi cannam@86: install_libdir="$2" cannam@86: cannam@86: oldlibs= cannam@86: if test -z "$rpath"; then cannam@86: if test "$build_libtool_libs" = yes; then cannam@86: # Building a libtool convenience library. cannam@86: # Some compilers have problems with a `.al' extension so cannam@86: # convenience libraries should have the same extension an cannam@86: # archive normally would. cannam@86: oldlibs="$output_objdir/$libname.$libext $oldlibs" cannam@86: build_libtool_libs=convenience cannam@86: build_old_libs=yes cannam@86: fi cannam@86: cannam@86: if test -n "$vinfo"; then cannam@86: $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$release"; then cannam@86: $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 cannam@86: fi cannam@86: else cannam@86: cannam@86: # Parse the version information argument. cannam@86: save_ifs="$IFS"; IFS=':' cannam@86: set dummy $vinfo 0 0 0 cannam@86: IFS="$save_ifs" cannam@86: cannam@86: if test -n "$8"; then cannam@86: $echo "$modename: too many parameters to \`-version-info'" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # convert absolute version numbers to libtool ages cannam@86: # this retains compatibility with .la files and attempts cannam@86: # to make the code below a bit more comprehensible cannam@86: cannam@86: case $vinfo_number in cannam@86: yes) cannam@86: number_major="$2" cannam@86: number_minor="$3" cannam@86: number_revision="$4" cannam@86: # cannam@86: # There are really only two kinds -- those that cannam@86: # use the current revision as the major version cannam@86: # and those that subtract age and use age as cannam@86: # a minor version. But, then there is irix cannam@86: # which has an extra 1 added just for fun cannam@86: # cannam@86: case $version_type in cannam@86: darwin|linux|osf|windows) cannam@86: current=`expr $number_major + $number_minor` cannam@86: age="$number_minor" cannam@86: revision="$number_revision" cannam@86: ;; cannam@86: freebsd-aout|freebsd-elf|sunos) cannam@86: current="$number_major" cannam@86: revision="$number_minor" cannam@86: age="0" cannam@86: ;; cannam@86: irix|nonstopux) cannam@86: current=`expr $number_major + $number_minor - 1` cannam@86: age="$number_minor" cannam@86: revision="$number_minor" cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: no) cannam@86: current="$2" cannam@86: revision="$3" cannam@86: age="$4" cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Check that each of the things are valid numbers. cannam@86: case $current in cannam@86: 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; cannam@86: *) cannam@86: $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 cannam@86: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: case $revision in cannam@86: 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; cannam@86: *) cannam@86: $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 cannam@86: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: case $age in cannam@86: 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; cannam@86: *) cannam@86: $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 cannam@86: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: if test "$age" -gt "$current"; then cannam@86: $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 cannam@86: $echo "$modename: \`$vinfo' is not valid version information" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Calculate the version variables. cannam@86: major= cannam@86: versuffix= cannam@86: verstring= cannam@86: case $version_type in cannam@86: none) ;; cannam@86: cannam@86: darwin) cannam@86: # Like Linux, but with the current version available in cannam@86: # verstring for coding it into the library header cannam@86: major=.`expr $current - $age` cannam@86: versuffix="$major.$age.$revision" cannam@86: # Darwin ld doesn't like 0 for these options... cannam@86: minor_current=`expr $current + 1` cannam@86: verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" cannam@86: ;; cannam@86: cannam@86: freebsd-aout) cannam@86: major=".$current" cannam@86: versuffix=".$current.$revision"; cannam@86: ;; cannam@86: cannam@86: freebsd-elf) cannam@86: major=".$current" cannam@86: versuffix=".$current"; cannam@86: ;; cannam@86: cannam@86: irix | nonstopux) cannam@86: major=`expr $current - $age + 1` cannam@86: cannam@86: case $version_type in cannam@86: nonstopux) verstring_prefix=nonstopux ;; cannam@86: *) verstring_prefix=sgi ;; cannam@86: esac cannam@86: verstring="$verstring_prefix$major.$revision" cannam@86: cannam@86: # Add in all the interfaces that we are compatible with. cannam@86: loop=$revision cannam@86: while test "$loop" -ne 0; do cannam@86: iface=`expr $revision - $loop` cannam@86: loop=`expr $loop - 1` cannam@86: verstring="$verstring_prefix$major.$iface:$verstring" cannam@86: done cannam@86: cannam@86: # Before this point, $major must not contain `.'. cannam@86: major=.$major cannam@86: versuffix="$major.$revision" cannam@86: ;; cannam@86: cannam@86: linux) cannam@86: major=.`expr $current - $age` cannam@86: versuffix="$major.$age.$revision" cannam@86: ;; cannam@86: cannam@86: osf) cannam@86: major=.`expr $current - $age` cannam@86: versuffix=".$current.$age.$revision" cannam@86: verstring="$current.$age.$revision" cannam@86: cannam@86: # Add in all the interfaces that we are compatible with. cannam@86: loop=$age cannam@86: while test "$loop" -ne 0; do cannam@86: iface=`expr $current - $loop` cannam@86: loop=`expr $loop - 1` cannam@86: verstring="$verstring:${iface}.0" cannam@86: done cannam@86: cannam@86: # Make executables depend on our current version. cannam@86: verstring="$verstring:${current}.0" cannam@86: ;; cannam@86: cannam@86: sunos) cannam@86: major=".$current" cannam@86: versuffix=".$current.$revision" cannam@86: ;; cannam@86: cannam@86: windows) cannam@86: # Use '-' rather than '.', since we only want one cannam@86: # extension on DOS 8.3 filesystems. cannam@86: major=`expr $current - $age` cannam@86: versuffix="-$major" cannam@86: ;; cannam@86: cannam@86: *) cannam@86: $echo "$modename: unknown library version type \`$version_type'" 1>&2 cannam@86: $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Clear the version info if we defaulted, and they specified a release. cannam@86: if test -z "$vinfo" && test -n "$release"; then cannam@86: major= cannam@86: case $version_type in cannam@86: darwin) cannam@86: # we can't check for "0.0" in archive_cmds due to quoting cannam@86: # problems, so we reset it completely cannam@86: verstring= cannam@86: ;; cannam@86: *) cannam@86: verstring="0.0" cannam@86: ;; cannam@86: esac cannam@86: if test "$need_version" = no; then cannam@86: versuffix= cannam@86: else cannam@86: versuffix=".0.0" cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Remove version info from name if versioning should be avoided cannam@86: if test "$avoid_version" = yes && test "$need_version" = no; then cannam@86: major= cannam@86: versuffix= cannam@86: verstring="" cannam@86: fi cannam@86: cannam@86: # Check to see if the archive will have undefined symbols. cannam@86: if test "$allow_undefined" = yes; then cannam@86: if test "$allow_undefined_flag" = unsupported; then cannam@86: $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 cannam@86: build_libtool_libs=no cannam@86: build_old_libs=yes cannam@86: fi cannam@86: else cannam@86: # Don't allow undefined symbols. cannam@86: allow_undefined_flag="$no_undefined_flag" cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test "$mode" != relink; then cannam@86: # Remove our outputs, but don't remove object files since they cannam@86: # may have been created when compiling PIC objects. cannam@86: removelist= cannam@86: tempremovelist=`$echo "$output_objdir/*"` cannam@86: for p in $tempremovelist; do cannam@86: case $p in cannam@86: *.$objext) cannam@86: ;; cannam@86: $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) cannam@86: if test "X$precious_files_regex" != "X"; then cannam@86: if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 cannam@86: then cannam@86: continue cannam@86: fi cannam@86: fi cannam@86: removelist="$removelist $p" cannam@86: ;; cannam@86: *) ;; cannam@86: esac cannam@86: done cannam@86: if test -n "$removelist"; then cannam@86: $show "${rm}r $removelist" cannam@86: $run ${rm}r $removelist cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Now set the variables for building old libraries. cannam@86: if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then cannam@86: oldlibs="$oldlibs $output_objdir/$libname.$libext" cannam@86: cannam@86: # Transform .lo files to .o files. cannam@86: oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` cannam@86: fi cannam@86: cannam@86: # Eliminate all temporary directories. cannam@86: for path in $notinst_path; do cannam@86: lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` cannam@86: deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` cannam@86: dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` cannam@86: done cannam@86: cannam@86: if test -n "$xrpath"; then cannam@86: # If the user specified any rpath flags, then add them. cannam@86: temp_xrpath= cannam@86: for libdir in $xrpath; do cannam@86: temp_xrpath="$temp_xrpath -R$libdir" cannam@86: case "$finalize_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) finalize_rpath="$finalize_rpath $libdir" ;; cannam@86: esac cannam@86: done cannam@86: if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then cannam@86: dependency_libs="$temp_xrpath $dependency_libs" cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Make sure dlfiles contains only unique files that won't be dlpreopened cannam@86: old_dlfiles="$dlfiles" cannam@86: dlfiles= cannam@86: for lib in $old_dlfiles; do cannam@86: case " $dlprefiles $dlfiles " in cannam@86: *" $lib "*) ;; cannam@86: *) dlfiles="$dlfiles $lib" ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: # Make sure dlprefiles contains only unique files cannam@86: old_dlprefiles="$dlprefiles" cannam@86: dlprefiles= cannam@86: for lib in $old_dlprefiles; do cannam@86: case "$dlprefiles " in cannam@86: *" $lib "*) ;; cannam@86: *) dlprefiles="$dlprefiles $lib" ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: if test "$build_libtool_libs" = yes; then cannam@86: if test -n "$rpath"; then cannam@86: case $host in cannam@86: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) cannam@86: # these systems don't actually have a c library (as such)! cannam@86: ;; cannam@86: *-*-rhapsody* | *-*-darwin1.[012]) cannam@86: # Rhapsody C library is in the System framework cannam@86: deplibs="$deplibs -framework System" cannam@86: ;; cannam@86: *-*-netbsd*) cannam@86: # Don't link with libc until the a.out ld.so is fixed. cannam@86: ;; cannam@86: *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) cannam@86: # Do not include libc due to us having libc/libc_r. cannam@86: test "X$arg" = "X-lc" && continue cannam@86: ;; cannam@86: *) cannam@86: # Add libc to deplibs on all other systems if necessary. cannam@86: if test "$build_libtool_need_lc" = "yes"; then cannam@86: deplibs="$deplibs -lc" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: # Transform deplibs into only deplibs that can be linked in shared. cannam@86: name_save=$name cannam@86: libname_save=$libname cannam@86: release_save=$release cannam@86: versuffix_save=$versuffix cannam@86: major_save=$major cannam@86: # I'm not sure if I'm treating the release correctly. I think cannam@86: # release should show up in the -l (ie -lgmp5) so we don't want to cannam@86: # add it in twice. Is that correct? cannam@86: release="" cannam@86: versuffix="" cannam@86: major="" cannam@86: newdeplibs= cannam@86: droppeddeps=no cannam@86: case $deplibs_check_method in cannam@86: pass_all) cannam@86: # Don't check for shared/static. Everything works. cannam@86: # This might be a little naive. We might want to check cannam@86: # whether the library exists or not. But this is on cannam@86: # osf3 & osf4 and I'm not really sure... Just cannam@86: # implementing what was already the behavior. cannam@86: newdeplibs=$deplibs cannam@86: ;; cannam@86: test_compile) cannam@86: # This code stresses the "libraries are programs" paradigm to its cannam@86: # limits. Maybe even breaks it. We compile a program, linking it cannam@86: # against the deplibs as a proxy for the library. Then we can check cannam@86: # whether they linked in statically or dynamically with ldd. cannam@86: $rm conftest.c cannam@86: cat > conftest.c </dev/null` cannam@86: for potent_lib in $potential_libs; do cannam@86: # Follow soft links. cannam@86: if ls -lLd "$potent_lib" 2>/dev/null \ cannam@86: | grep " -> " >/dev/null; then cannam@86: continue cannam@86: fi cannam@86: # The statement above tries to avoid entering an cannam@86: # endless loop below, in case of cyclic links. cannam@86: # We might still enter an endless loop, since a link cannam@86: # loop can be closed while we follow links, cannam@86: # but so what? cannam@86: potlib="$potent_lib" cannam@86: while test -h "$potlib" 2>/dev/null; do cannam@86: potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` cannam@86: case $potliblink in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; cannam@86: *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; cannam@86: esac cannam@86: done cannam@86: if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ cannam@86: | ${SED} 10q \ cannam@86: | $EGREP "$file_magic_regex" > /dev/null; then cannam@86: newdeplibs="$newdeplibs $a_deplib" cannam@86: a_deplib="" cannam@86: break 2 cannam@86: fi cannam@86: done cannam@86: done cannam@86: fi cannam@86: if test -n "$a_deplib" ; then cannam@86: droppeddeps=yes cannam@86: $echo cannam@86: $echo "*** Warning: linker path does not have real file for library $a_deplib." cannam@86: $echo "*** I have the capability to make that library automatically link in when" cannam@86: $echo "*** you link to this library. But I can only do this if you have a" cannam@86: $echo "*** shared version of the library, which you do not appear to have" cannam@86: $echo "*** because I did check the linker path looking for a file starting" cannam@86: if test -z "$potlib" ; then cannam@86: $echo "*** with $libname but no candidates were found. (...for file magic test)" cannam@86: else cannam@86: $echo "*** with $libname and none of the candidates passed a file format test" cannam@86: $echo "*** using a file magic. Last file checked: $potlib" cannam@86: fi cannam@86: fi cannam@86: else cannam@86: # Add a -L argument. cannam@86: newdeplibs="$newdeplibs $a_deplib" cannam@86: fi cannam@86: done # Gone through all deplibs. cannam@86: ;; cannam@86: match_pattern*) cannam@86: set dummy $deplibs_check_method cannam@86: match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` cannam@86: for a_deplib in $deplibs; do cannam@86: name="`expr $a_deplib : '-l\(.*\)'`" cannam@86: # If $name is empty we are operating on a -L argument. cannam@86: if test -n "$name" && test "$name" != "0"; then cannam@86: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then cannam@86: case " $predeps $postdeps " in cannam@86: *" $a_deplib "*) cannam@86: newdeplibs="$newdeplibs $a_deplib" cannam@86: a_deplib="" cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: if test -n "$a_deplib" ; then cannam@86: libname=`eval \\$echo \"$libname_spec\"` cannam@86: for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do cannam@86: potential_libs=`ls $i/$libname[.-]* 2>/dev/null` cannam@86: for potent_lib in $potential_libs; do cannam@86: potlib="$potent_lib" # see symlink-check above in file_magic test cannam@86: if eval $echo \"$potent_lib\" 2>/dev/null \ cannam@86: | ${SED} 10q \ cannam@86: | $EGREP "$match_pattern_regex" > /dev/null; then cannam@86: newdeplibs="$newdeplibs $a_deplib" cannam@86: a_deplib="" cannam@86: break 2 cannam@86: fi cannam@86: done cannam@86: done cannam@86: fi cannam@86: if test -n "$a_deplib" ; then cannam@86: droppeddeps=yes cannam@86: $echo cannam@86: $echo "*** Warning: linker path does not have real file for library $a_deplib." cannam@86: $echo "*** I have the capability to make that library automatically link in when" cannam@86: $echo "*** you link to this library. But I can only do this if you have a" cannam@86: $echo "*** shared version of the library, which you do not appear to have" cannam@86: $echo "*** because I did check the linker path looking for a file starting" cannam@86: if test -z "$potlib" ; then cannam@86: $echo "*** with $libname but no candidates were found. (...for regex pattern test)" cannam@86: else cannam@86: $echo "*** with $libname and none of the candidates passed a file format test" cannam@86: $echo "*** using a regex pattern. Last file checked: $potlib" cannam@86: fi cannam@86: fi cannam@86: else cannam@86: # Add a -L argument. cannam@86: newdeplibs="$newdeplibs $a_deplib" cannam@86: fi cannam@86: done # Gone through all deplibs. cannam@86: ;; cannam@86: none | unknown | *) cannam@86: newdeplibs="" cannam@86: tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ cannam@86: -e 's/ -[LR][^ ]*//g'` cannam@86: if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then cannam@86: for i in $predeps $postdeps ; do cannam@86: # can't use Xsed below, because $i might contain '/' cannam@86: tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` cannam@86: done cannam@86: fi cannam@86: if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ cannam@86: | grep . >/dev/null; then cannam@86: $echo cannam@86: if test "X$deplibs_check_method" = "Xnone"; then cannam@86: $echo "*** Warning: inter-library dependencies are not supported in this platform." cannam@86: else cannam@86: $echo "*** Warning: inter-library dependencies are not known to be supported." cannam@86: fi cannam@86: $echo "*** All declared inter-library dependencies are being dropped." cannam@86: droppeddeps=yes cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: versuffix=$versuffix_save cannam@86: major=$major_save cannam@86: release=$release_save cannam@86: libname=$libname_save cannam@86: name=$name_save cannam@86: cannam@86: case $host in cannam@86: *-*-rhapsody* | *-*-darwin1.[012]) cannam@86: # On Rhapsody replace the C library is the System framework cannam@86: newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` cannam@86: ;; cannam@86: esac cannam@86: cannam@86: if test "$droppeddeps" = yes; then cannam@86: if test "$module" = yes; then cannam@86: $echo cannam@86: $echo "*** Warning: libtool could not satisfy all declared inter-library" cannam@86: $echo "*** dependencies of module $libname. Therefore, libtool will create" cannam@86: $echo "*** a static module, that should work as long as the dlopening" cannam@86: $echo "*** application is linked with the -dlopen flag." cannam@86: if test -z "$global_symbol_pipe"; then cannam@86: $echo cannam@86: $echo "*** However, this would only work if libtool was able to extract symbol" cannam@86: $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" cannam@86: $echo "*** not find such a program. So, this module is probably useless." cannam@86: $echo "*** \`nm' from GNU binutils and a full rebuild may help." cannam@86: fi cannam@86: if test "$build_old_libs" = no; then cannam@86: oldlibs="$output_objdir/$libname.$libext" cannam@86: build_libtool_libs=module cannam@86: build_old_libs=yes cannam@86: else cannam@86: build_libtool_libs=no cannam@86: fi cannam@86: else cannam@86: $echo "*** The inter-library dependencies that have been dropped here will be" cannam@86: $echo "*** automatically added whenever a program is linked with this library" cannam@86: $echo "*** or is declared to -dlopen it." cannam@86: cannam@86: if test "$allow_undefined" = no; then cannam@86: $echo cannam@86: $echo "*** Since this library must not contain undefined symbols," cannam@86: $echo "*** because either the platform does not support them or" cannam@86: $echo "*** it was explicitly requested with -no-undefined," cannam@86: $echo "*** libtool will only create a static version of it." cannam@86: if test "$build_old_libs" = no; then cannam@86: oldlibs="$output_objdir/$libname.$libext" cannam@86: build_libtool_libs=module cannam@86: build_old_libs=yes cannam@86: else cannam@86: build_libtool_libs=no cannam@86: fi cannam@86: fi cannam@86: fi cannam@86: fi cannam@86: # Done checking deplibs! cannam@86: deplibs=$newdeplibs cannam@86: fi cannam@86: cannam@86: # All the library-specific variables (install_libdir is set above). cannam@86: library_names= cannam@86: old_library= cannam@86: dlname= cannam@86: cannam@86: # Test again, we may have decided not to build it any more cannam@86: if test "$build_libtool_libs" = yes; then cannam@86: if test "$hardcode_into_libs" = yes; then cannam@86: # Hardcode the library paths cannam@86: hardcode_libdirs= cannam@86: dep_rpath= cannam@86: rpath="$finalize_rpath" cannam@86: test "$mode" != relink && rpath="$compile_rpath$rpath" cannam@86: for libdir in $rpath; do cannam@86: if test -n "$hardcode_libdir_flag_spec"; then cannam@86: if test -n "$hardcode_libdir_separator"; then cannam@86: if test -z "$hardcode_libdirs"; then cannam@86: hardcode_libdirs="$libdir" cannam@86: else cannam@86: # Just accumulate the unique libdirs. cannam@86: case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in cannam@86: *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) cannam@86: ;; cannam@86: *) cannam@86: hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: else cannam@86: eval flag=\"$hardcode_libdir_flag_spec\" cannam@86: dep_rpath="$dep_rpath $flag" cannam@86: fi cannam@86: elif test -n "$runpath_var"; then cannam@86: case "$perm_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) perm_rpath="$perm_rpath $libdir" ;; cannam@86: esac cannam@86: fi cannam@86: done cannam@86: # Substitute the hardcoded libdirs into the rpath. cannam@86: if test -n "$hardcode_libdir_separator" && cannam@86: test -n "$hardcode_libdirs"; then cannam@86: libdir="$hardcode_libdirs" cannam@86: if test -n "$hardcode_libdir_flag_spec_ld"; then cannam@86: eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" cannam@86: else cannam@86: eval dep_rpath=\"$hardcode_libdir_flag_spec\" cannam@86: fi cannam@86: fi cannam@86: if test -n "$runpath_var" && test -n "$perm_rpath"; then cannam@86: # We should set the runpath_var. cannam@86: rpath= cannam@86: for dir in $perm_rpath; do cannam@86: rpath="$rpath$dir:" cannam@86: done cannam@86: eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" cannam@86: fi cannam@86: test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" cannam@86: fi cannam@86: cannam@86: shlibpath="$finalize_shlibpath" cannam@86: test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" cannam@86: if test -n "$shlibpath"; then cannam@86: eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" cannam@86: fi cannam@86: cannam@86: # Get the real and link names of the library. cannam@86: eval shared_ext=\"$shrext_cmds\" cannam@86: eval library_names=\"$library_names_spec\" cannam@86: set dummy $library_names cannam@86: realname="$2" cannam@86: shift; shift cannam@86: cannam@86: if test -n "$soname_spec"; then cannam@86: eval soname=\"$soname_spec\" cannam@86: else cannam@86: soname="$realname" cannam@86: fi cannam@86: if test -z "$dlname"; then cannam@86: dlname=$soname cannam@86: fi cannam@86: cannam@86: lib="$output_objdir/$realname" cannam@86: for link cannam@86: do cannam@86: linknames="$linknames $link" cannam@86: done cannam@86: cannam@86: # Use standard objects if they are pic cannam@86: test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` cannam@86: cannam@86: # Prepare the list of exported symbols cannam@86: if test -z "$export_symbols"; then cannam@86: if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then cannam@86: $show "generating symbol list for \`$libname.la'" cannam@86: export_symbols="$output_objdir/$libname.exp" cannam@86: $run $rm $export_symbols cannam@86: cmds=$export_symbols_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: if len=`expr "X$cmd" : ".*"` && cannam@86: test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: skipped_export=false cannam@86: else cannam@86: # The command line is too long to execute in one step. cannam@86: $show "using reloadable object file for export list..." cannam@86: skipped_export=: cannam@86: fi cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: if test -n "$export_symbols_regex"; then cannam@86: $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" cannam@86: $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' cannam@86: $show "$mv \"${export_symbols}T\" \"$export_symbols\"" cannam@86: $run eval '$mv "${export_symbols}T" "$export_symbols"' cannam@86: fi cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test -n "$export_symbols" && test -n "$include_expsyms"; then cannam@86: $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' cannam@86: fi cannam@86: cannam@86: tmp_deplibs= cannam@86: for test_deplib in $deplibs; do cannam@86: case " $convenience " in cannam@86: *" $test_deplib "*) ;; cannam@86: *) cannam@86: tmp_deplibs="$tmp_deplibs $test_deplib" cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: deplibs="$tmp_deplibs" cannam@86: cannam@86: if test -n "$convenience"; then cannam@86: if test -n "$whole_archive_flag_spec"; then cannam@86: save_libobjs=$libobjs cannam@86: eval libobjs=\"\$libobjs $whole_archive_flag_spec\" cannam@86: else cannam@86: gentop="$output_objdir/${outputname}x" cannam@86: generated="$generated $gentop" cannam@86: cannam@86: func_extract_archives $gentop $convenience cannam@86: libobjs="$libobjs $func_extract_archives_result" cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then cannam@86: eval flag=\"$thread_safe_flag_spec\" cannam@86: linker_flags="$linker_flags $flag" cannam@86: fi cannam@86: cannam@86: # Make a backup of the uninstalled library when relinking cannam@86: if test "$mode" = relink; then cannam@86: $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? cannam@86: fi cannam@86: cannam@86: # Do each of the archive commands. cannam@86: if test "$module" = yes && test -n "$module_cmds" ; then cannam@86: if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cannam@86: eval test_cmds=\"$module_expsym_cmds\" cannam@86: cmds=$module_expsym_cmds cannam@86: else cannam@86: eval test_cmds=\"$module_cmds\" cannam@86: cmds=$module_cmds cannam@86: fi cannam@86: else cannam@86: if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cannam@86: eval test_cmds=\"$archive_expsym_cmds\" cannam@86: cmds=$archive_expsym_cmds cannam@86: else cannam@86: eval test_cmds=\"$archive_cmds\" cannam@86: cmds=$archive_cmds cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && cannam@86: test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cannam@86: : cannam@86: else cannam@86: # The command line is too long to link in one step, link piecewise. cannam@86: $echo "creating reloadable object files..." cannam@86: cannam@86: # Save the value of $output and $libobjs because we want to cannam@86: # use them later. If we have whole_archive_flag_spec, we cannam@86: # want to use save_libobjs as it was before cannam@86: # whole_archive_flag_spec was expanded, because we can't cannam@86: # assume the linker understands whole_archive_flag_spec. cannam@86: # This may have to be revisited, in case too many cannam@86: # convenience libraries get linked in and end up exceeding cannam@86: # the spec. cannam@86: if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then cannam@86: save_libobjs=$libobjs cannam@86: fi cannam@86: save_output=$output cannam@86: output_la=`$echo "X$output" | $Xsed -e "$basename"` cannam@86: cannam@86: # Clear the reloadable object creation command queue and cannam@86: # initialize k to one. cannam@86: test_cmds= cannam@86: concat_cmds= cannam@86: objlist= cannam@86: delfiles= cannam@86: last_robj= cannam@86: k=1 cannam@86: output=$output_objdir/$output_la-${k}.$objext cannam@86: # Loop over the list of objects to be linked. cannam@86: for obj in $save_libobjs cannam@86: do cannam@86: eval test_cmds=\"$reload_cmds $objlist $last_robj\" cannam@86: if test "X$objlist" = X || cannam@86: { len=`expr "X$test_cmds" : ".*"` && cannam@86: test "$len" -le "$max_cmd_len"; }; then cannam@86: objlist="$objlist $obj" cannam@86: else cannam@86: # The command $test_cmds is almost too long, add a cannam@86: # command to the queue. cannam@86: if test "$k" -eq 1 ; then cannam@86: # The first file doesn't have a previous command to add. cannam@86: eval concat_cmds=\"$reload_cmds $objlist $last_robj\" cannam@86: else cannam@86: # All subsequent reloadable object files will link in cannam@86: # the last one created. cannam@86: eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" cannam@86: fi cannam@86: last_robj=$output_objdir/$output_la-${k}.$objext cannam@86: k=`expr $k + 1` cannam@86: output=$output_objdir/$output_la-${k}.$objext cannam@86: objlist=$obj cannam@86: len=1 cannam@86: fi cannam@86: done cannam@86: # Handle the remaining objects by creating one last cannam@86: # reloadable object file. All subsequent reloadable object cannam@86: # files will link in the last one created. cannam@86: test -z "$concat_cmds" || concat_cmds=$concat_cmds~ cannam@86: eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" cannam@86: cannam@86: if ${skipped_export-false}; then cannam@86: $show "generating symbol list for \`$libname.la'" cannam@86: export_symbols="$output_objdir/$libname.exp" cannam@86: $run $rm $export_symbols cannam@86: libobjs=$output cannam@86: # Append the command to create the export file. cannam@86: eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" cannam@86: fi cannam@86: cannam@86: # Set up a command to remove the reloadable object files cannam@86: # after they are used. cannam@86: i=0 cannam@86: while test "$i" -lt "$k" cannam@86: do cannam@86: i=`expr $i + 1` cannam@86: delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" cannam@86: done cannam@86: cannam@86: $echo "creating a temporary reloadable object file: $output" cannam@86: cannam@86: # Loop through the commands generated above and execute them. cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $concat_cmds; do cannam@86: IFS="$save_ifs" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: cannam@86: libobjs=$output cannam@86: # Restore the value of output. cannam@86: output=$save_output cannam@86: cannam@86: if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then cannam@86: eval libobjs=\"\$libobjs $whole_archive_flag_spec\" cannam@86: fi cannam@86: # Expand the library linking commands again to reset the cannam@86: # value of $libobjs for piecewise linking. cannam@86: cannam@86: # Do each of the archive commands. cannam@86: if test "$module" = yes && test -n "$module_cmds" ; then cannam@86: if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cannam@86: cmds=$module_expsym_cmds cannam@86: else cannam@86: cmds=$module_cmds cannam@86: fi cannam@86: else cannam@86: if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cannam@86: cmds=$archive_expsym_cmds cannam@86: else cannam@86: cmds=$archive_cmds cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Append the command to remove the reloadable object files cannam@86: # to the just-reset $cmds. cannam@86: eval cmds=\"\$cmds~\$rm $delfiles\" cannam@86: fi cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: cannam@86: # Restore the uninstalled library and exit cannam@86: if test "$mode" = relink; then cannam@86: $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? cannam@86: exit $EXIT_SUCCESS cannam@86: fi cannam@86: cannam@86: # Create links to the real library. cannam@86: for linkname in $linknames; do cannam@86: if test "$realname" != "$linkname"; then cannam@86: $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" cannam@86: $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? cannam@86: fi cannam@86: done cannam@86: cannam@86: # If -module or -export-dynamic was specified, set the dlname. cannam@86: if test "$module" = yes || test "$export_dynamic" = yes; then cannam@86: # On all known operating systems, these are identical. cannam@86: dlname="$soname" cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: cannam@86: obj) cannam@86: if test -n "$deplibs"; then cannam@86: $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then cannam@86: $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$rpath"; then cannam@86: $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$xrpath"; then cannam@86: $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$vinfo"; then cannam@86: $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$release"; then cannam@86: $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 cannam@86: fi cannam@86: cannam@86: case $output in cannam@86: *.lo) cannam@86: if test -n "$objs$old_deplibs"; then cannam@86: $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: libobj="$output" cannam@86: obj=`$echo "X$output" | $Xsed -e "$lo2o"` cannam@86: ;; cannam@86: *) cannam@86: libobj= cannam@86: obj="$output" cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Delete the old objects. cannam@86: $run $rm $obj $libobj cannam@86: cannam@86: # Objects from convenience libraries. This assumes cannam@86: # single-version convenience libraries. Whenever we create cannam@86: # different ones for PIC/non-PIC, this we'll have to duplicate cannam@86: # the extraction. cannam@86: reload_conv_objs= cannam@86: gentop= cannam@86: # reload_cmds runs $LD directly, so let us get rid of cannam@86: # -Wl from whole_archive_flag_spec cannam@86: wl= cannam@86: cannam@86: if test -n "$convenience"; then cannam@86: if test -n "$whole_archive_flag_spec"; then cannam@86: eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" cannam@86: else cannam@86: gentop="$output_objdir/${obj}x" cannam@86: generated="$generated $gentop" cannam@86: cannam@86: func_extract_archives $gentop $convenience cannam@86: reload_conv_objs="$reload_objs $func_extract_archives_result" cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Create the old-style object. cannam@86: reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test cannam@86: cannam@86: output="$obj" cannam@86: cmds=$reload_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: cannam@86: # Exit if we aren't doing a library object file. cannam@86: if test -z "$libobj"; then cannam@86: if test -n "$gentop"; then cannam@86: $show "${rm}r $gentop" cannam@86: $run ${rm}r $gentop cannam@86: fi cannam@86: cannam@86: exit $EXIT_SUCCESS cannam@86: fi cannam@86: cannam@86: if test "$build_libtool_libs" != yes; then cannam@86: if test -n "$gentop"; then cannam@86: $show "${rm}r $gentop" cannam@86: $run ${rm}r $gentop cannam@86: fi cannam@86: cannam@86: # Create an invalid libtool object if no PIC, so that we don't cannam@86: # accidentally link it into a program. cannam@86: # $show "echo timestamp > $libobj" cannam@86: # $run eval "echo timestamp > $libobj" || exit $? cannam@86: exit $EXIT_SUCCESS cannam@86: fi cannam@86: cannam@86: if test -n "$pic_flag" || test "$pic_mode" != default; then cannam@86: # Only do commands if we really have different PIC objects. cannam@86: reload_objs="$libobjs $reload_conv_objs" cannam@86: output="$libobj" cannam@86: cmds=$reload_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: cannam@86: if test -n "$gentop"; then cannam@86: $show "${rm}r $gentop" cannam@86: $run ${rm}r $gentop cannam@86: fi cannam@86: cannam@86: exit $EXIT_SUCCESS cannam@86: ;; cannam@86: cannam@86: prog) cannam@86: case $host in cannam@86: *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; cannam@86: esac cannam@86: if test -n "$vinfo"; then cannam@86: $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$release"; then cannam@86: $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 cannam@86: fi cannam@86: cannam@86: if test "$preload" = yes; then cannam@86: if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && cannam@86: test "$dlopen_self_static" = unknown; then cannam@86: $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." cannam@86: fi cannam@86: fi cannam@86: cannam@86: case $host in cannam@86: *-*-rhapsody* | *-*-darwin1.[012]) cannam@86: # On Rhapsody replace the C library is the System framework cannam@86: compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` cannam@86: finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` cannam@86: ;; cannam@86: esac cannam@86: cannam@86: case $host in cannam@86: *darwin*) cannam@86: # Don't allow lazy linking, it breaks C++ global constructors cannam@86: if test "$tagname" = CXX ; then cannam@86: compile_command="$compile_command ${wl}-bind_at_load" cannam@86: finalize_command="$finalize_command ${wl}-bind_at_load" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: cannam@86: compile_command="$compile_command $compile_deplibs" cannam@86: finalize_command="$finalize_command $finalize_deplibs" cannam@86: cannam@86: if test -n "$rpath$xrpath"; then cannam@86: # If the user specified any rpath flags, then add them. cannam@86: for libdir in $rpath $xrpath; do cannam@86: # This is the magic to use -rpath. cannam@86: case "$finalize_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) finalize_rpath="$finalize_rpath $libdir" ;; cannam@86: esac cannam@86: done cannam@86: fi cannam@86: cannam@86: # Now hardcode the library paths cannam@86: rpath= cannam@86: hardcode_libdirs= cannam@86: for libdir in $compile_rpath $finalize_rpath; do cannam@86: if test -n "$hardcode_libdir_flag_spec"; then cannam@86: if test -n "$hardcode_libdir_separator"; then cannam@86: if test -z "$hardcode_libdirs"; then cannam@86: hardcode_libdirs="$libdir" cannam@86: else cannam@86: # Just accumulate the unique libdirs. cannam@86: case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in cannam@86: *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) cannam@86: ;; cannam@86: *) cannam@86: hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: else cannam@86: eval flag=\"$hardcode_libdir_flag_spec\" cannam@86: rpath="$rpath $flag" cannam@86: fi cannam@86: elif test -n "$runpath_var"; then cannam@86: case "$perm_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) perm_rpath="$perm_rpath $libdir" ;; cannam@86: esac cannam@86: fi cannam@86: case $host in cannam@86: *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) cannam@86: case :$dllsearchpath: in cannam@86: *":$libdir:"*) ;; cannam@86: *) dllsearchpath="$dllsearchpath:$libdir";; cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: # Substitute the hardcoded libdirs into the rpath. cannam@86: if test -n "$hardcode_libdir_separator" && cannam@86: test -n "$hardcode_libdirs"; then cannam@86: libdir="$hardcode_libdirs" cannam@86: eval rpath=\" $hardcode_libdir_flag_spec\" cannam@86: fi cannam@86: compile_rpath="$rpath" cannam@86: cannam@86: rpath= cannam@86: hardcode_libdirs= cannam@86: for libdir in $finalize_rpath; do cannam@86: if test -n "$hardcode_libdir_flag_spec"; then cannam@86: if test -n "$hardcode_libdir_separator"; then cannam@86: if test -z "$hardcode_libdirs"; then cannam@86: hardcode_libdirs="$libdir" cannam@86: else cannam@86: # Just accumulate the unique libdirs. cannam@86: case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in cannam@86: *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) cannam@86: ;; cannam@86: *) cannam@86: hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" cannam@86: ;; cannam@86: esac cannam@86: fi cannam@86: else cannam@86: eval flag=\"$hardcode_libdir_flag_spec\" cannam@86: rpath="$rpath $flag" cannam@86: fi cannam@86: elif test -n "$runpath_var"; then cannam@86: case "$finalize_perm_rpath " in cannam@86: *" $libdir "*) ;; cannam@86: *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; cannam@86: esac cannam@86: fi cannam@86: done cannam@86: # Substitute the hardcoded libdirs into the rpath. cannam@86: if test -n "$hardcode_libdir_separator" && cannam@86: test -n "$hardcode_libdirs"; then cannam@86: libdir="$hardcode_libdirs" cannam@86: eval rpath=\" $hardcode_libdir_flag_spec\" cannam@86: fi cannam@86: finalize_rpath="$rpath" cannam@86: cannam@86: if test -n "$libobjs" && test "$build_old_libs" = yes; then cannam@86: # Transform all the library objects into standard objects. cannam@86: compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` cannam@86: finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` cannam@86: fi cannam@86: cannam@86: dlsyms= cannam@86: if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then cannam@86: if test -n "$NM" && test -n "$global_symbol_pipe"; then cannam@86: dlsyms="${outputname}S.c" cannam@86: else cannam@86: $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test -n "$dlsyms"; then cannam@86: case $dlsyms in cannam@86: "") ;; cannam@86: *.c) cannam@86: # Discover the nlist of each of the dlfiles. cannam@86: nlist="$output_objdir/${outputname}.nm" cannam@86: cannam@86: $show "$rm $nlist ${nlist}S ${nlist}T" cannam@86: $run $rm "$nlist" "${nlist}S" "${nlist}T" cannam@86: cannam@86: # Parse the name list into a source file. cannam@86: $show "creating $output_objdir/$dlsyms" cannam@86: cannam@86: test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ cannam@86: /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ cannam@86: /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ cannam@86: cannam@86: #ifdef __cplusplus cannam@86: extern \"C\" { cannam@86: #endif cannam@86: cannam@86: /* Prevent the only kind of declaration conflicts we can make. */ cannam@86: #define lt_preloaded_symbols some_other_symbol cannam@86: cannam@86: /* External symbol declarations for the compiler. */\ cannam@86: " cannam@86: cannam@86: if test "$dlself" = yes; then cannam@86: $show "generating symbol list for \`$output'" cannam@86: cannam@86: test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" cannam@86: cannam@86: # Add our own program objects to the symbol list. cannam@86: progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` cannam@86: for arg in $progfiles; do cannam@86: $show "extracting global C symbols from \`$arg'" cannam@86: $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" cannam@86: done cannam@86: cannam@86: if test -n "$exclude_expsyms"; then cannam@86: $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' cannam@86: $run eval '$mv "$nlist"T "$nlist"' cannam@86: fi cannam@86: cannam@86: if test -n "$export_symbols_regex"; then cannam@86: $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' cannam@86: $run eval '$mv "$nlist"T "$nlist"' cannam@86: fi cannam@86: cannam@86: # Prepare the list of exported symbols cannam@86: if test -z "$export_symbols"; then cannam@86: export_symbols="$output_objdir/$outputname.exp" cannam@86: $run $rm $export_symbols cannam@86: $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' cannam@86: else cannam@86: $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' cannam@86: $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' cannam@86: $run eval 'mv "$nlist"T "$nlist"' cannam@86: fi cannam@86: fi cannam@86: cannam@86: for arg in $dlprefiles; do cannam@86: $show "extracting global C symbols from \`$arg'" cannam@86: name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` cannam@86: $run eval '$echo ": $name " >> "$nlist"' cannam@86: $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" cannam@86: done cannam@86: cannam@86: if test -z "$run"; then cannam@86: # Make sure we have at least an empty file. cannam@86: test -f "$nlist" || : > "$nlist" cannam@86: cannam@86: if test -n "$exclude_expsyms"; then cannam@86: $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T cannam@86: $mv "$nlist"T "$nlist" cannam@86: fi cannam@86: cannam@86: # Try sorting and uniquifying the output. cannam@86: if grep -v "^: " < "$nlist" | cannam@86: if sort -k 3 /dev/null 2>&1; then cannam@86: sort -k 3 cannam@86: else cannam@86: sort +2 cannam@86: fi | cannam@86: uniq > "$nlist"S; then cannam@86: : cannam@86: else cannam@86: grep -v "^: " < "$nlist" > "$nlist"S cannam@86: fi cannam@86: cannam@86: if test -f "$nlist"S; then cannam@86: eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' cannam@86: else cannam@86: $echo '/* NONE */' >> "$output_objdir/$dlsyms" cannam@86: fi cannam@86: cannam@86: $echo >> "$output_objdir/$dlsyms" "\ cannam@86: cannam@86: #undef lt_preloaded_symbols cannam@86: cannam@86: #if defined (__STDC__) && __STDC__ cannam@86: # define lt_ptr void * cannam@86: #else cannam@86: # define lt_ptr char * cannam@86: # define const cannam@86: #endif cannam@86: cannam@86: /* The mapping between symbol names and symbols. */ cannam@86: " cannam@86: cannam@86: case $host in cannam@86: *cygwin* | *mingw* ) cannam@86: $echo >> "$output_objdir/$dlsyms" "\ cannam@86: /* DATA imports from DLLs on WIN32 can't be const, because cannam@86: runtime relocations are performed -- see ld's documentation cannam@86: on pseudo-relocs */ cannam@86: struct { cannam@86: " cannam@86: ;; cannam@86: * ) cannam@86: $echo >> "$output_objdir/$dlsyms" "\ cannam@86: const struct { cannam@86: " cannam@86: ;; cannam@86: esac cannam@86: cannam@86: cannam@86: $echo >> "$output_objdir/$dlsyms" "\ cannam@86: const char *name; cannam@86: lt_ptr address; cannam@86: } cannam@86: lt_preloaded_symbols[] = cannam@86: {\ cannam@86: " cannam@86: cannam@86: eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" cannam@86: cannam@86: $echo >> "$output_objdir/$dlsyms" "\ cannam@86: {0, (lt_ptr) 0} cannam@86: }; cannam@86: cannam@86: /* This works around a problem in FreeBSD linker */ cannam@86: #ifdef FREEBSD_WORKAROUND cannam@86: static const void *lt_preloaded_setup() { cannam@86: return lt_preloaded_symbols; cannam@86: } cannam@86: #endif cannam@86: cannam@86: #ifdef __cplusplus cannam@86: } cannam@86: #endif\ cannam@86: " cannam@86: fi cannam@86: cannam@86: pic_flag_for_symtable= cannam@86: case $host in cannam@86: # compiling the symbol table file with pic_flag works around cannam@86: # a FreeBSD bug that causes programs to crash when -lm is cannam@86: # linked before any other PIC object. But we must not use cannam@86: # pic_flag when linking with -static. The problem exists in cannam@86: # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. cannam@86: *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) cannam@86: case "$compile_command " in cannam@86: *" -static "*) ;; cannam@86: *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; cannam@86: esac;; cannam@86: *-*-hpux*) cannam@86: case "$compile_command " in cannam@86: *" -static "*) ;; cannam@86: *) pic_flag_for_symtable=" $pic_flag";; cannam@86: esac cannam@86: esac cannam@86: cannam@86: # Now compile the dynamic symbol file. cannam@86: $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" cannam@86: $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? cannam@86: cannam@86: # Clean up the generated files. cannam@86: $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" cannam@86: $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" cannam@86: cannam@86: # Transform the symbol file into the correct name. cannam@86: compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` cannam@86: finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` cannam@86: ;; cannam@86: *) cannam@86: $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: else cannam@86: # We keep going just in case the user didn't refer to cannam@86: # lt_preloaded_symbols. The linker will fail if global_symbol_pipe cannam@86: # really was required. cannam@86: cannam@86: # Nullify the symbol file. cannam@86: compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` cannam@86: finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` cannam@86: fi cannam@86: cannam@86: if test "$need_relink" = no || test "$build_libtool_libs" != yes; then cannam@86: # Replace the output file specification. cannam@86: compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` cannam@86: link_command="$compile_command$compile_rpath" cannam@86: cannam@86: # We have no uninstalled library dependencies, so finalize right now. cannam@86: $show "$link_command" cannam@86: $run eval "$link_command" cannam@86: status=$? cannam@86: cannam@86: # Delete the generated files. cannam@86: if test -n "$dlsyms"; then cannam@86: $show "$rm $output_objdir/${outputname}S.${objext}" cannam@86: $run $rm "$output_objdir/${outputname}S.${objext}" cannam@86: fi cannam@86: cannam@86: exit $status cannam@86: fi cannam@86: cannam@86: if test -n "$shlibpath_var"; then cannam@86: # We should set the shlibpath_var cannam@86: rpath= cannam@86: for dir in $temp_rpath; do cannam@86: case $dir in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) cannam@86: # Absolute path. cannam@86: rpath="$rpath$dir:" cannam@86: ;; cannam@86: *) cannam@86: # Relative path: add a thisdir entry. cannam@86: rpath="$rpath\$thisdir/$dir:" cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: temp_rpath="$rpath" cannam@86: fi cannam@86: cannam@86: if test -n "$compile_shlibpath$finalize_shlibpath"; then cannam@86: compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" cannam@86: fi cannam@86: if test -n "$finalize_shlibpath"; then cannam@86: finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" cannam@86: fi cannam@86: cannam@86: compile_var= cannam@86: finalize_var= cannam@86: if test -n "$runpath_var"; then cannam@86: if test -n "$perm_rpath"; then cannam@86: # We should set the runpath_var. cannam@86: rpath= cannam@86: for dir in $perm_rpath; do cannam@86: rpath="$rpath$dir:" cannam@86: done cannam@86: compile_var="$runpath_var=\"$rpath\$$runpath_var\" " cannam@86: fi cannam@86: if test -n "$finalize_perm_rpath"; then cannam@86: # We should set the runpath_var. cannam@86: rpath= cannam@86: for dir in $finalize_perm_rpath; do cannam@86: rpath="$rpath$dir:" cannam@86: done cannam@86: finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " cannam@86: fi cannam@86: fi cannam@86: cannam@86: if test "$no_install" = yes; then cannam@86: # We don't need to create a wrapper script. cannam@86: link_command="$compile_var$compile_command$compile_rpath" cannam@86: # Replace the output file specification. cannam@86: link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` cannam@86: # Delete the old output file. cannam@86: $run $rm $output cannam@86: # Link the executable and exit cannam@86: $show "$link_command" cannam@86: $run eval "$link_command" || exit $? cannam@86: exit $EXIT_SUCCESS cannam@86: fi cannam@86: cannam@86: if test "$hardcode_action" = relink; then cannam@86: # Fast installation is not supported cannam@86: link_command="$compile_var$compile_command$compile_rpath" cannam@86: relink_command="$finalize_var$finalize_command$finalize_rpath" cannam@86: cannam@86: $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 cannam@86: $echo "$modename: \`$output' will be relinked during installation" 1>&2 cannam@86: else cannam@86: if test "$fast_install" != no; then cannam@86: link_command="$finalize_var$compile_command$finalize_rpath" cannam@86: if test "$fast_install" = yes; then cannam@86: relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` cannam@86: else cannam@86: # fast_install is set to needless cannam@86: relink_command= cannam@86: fi cannam@86: else cannam@86: link_command="$compile_var$compile_command$compile_rpath" cannam@86: relink_command="$finalize_var$finalize_command$finalize_rpath" cannam@86: fi cannam@86: fi cannam@86: cannam@86: # Replace the output file specification. cannam@86: link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` cannam@86: cannam@86: # Delete the old output files. cannam@86: $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname cannam@86: cannam@86: $show "$link_command" cannam@86: $run eval "$link_command" || exit $? cannam@86: cannam@86: # Now create the wrapper script. cannam@86: $show "creating $output" cannam@86: cannam@86: # Quote the relink command for shipping. cannam@86: if test -n "$relink_command"; then cannam@86: # Preserve any variables that may affect compiler behavior cannam@86: for var in $variables_saved_for_relink; do cannam@86: if eval test -z \"\${$var+set}\"; then cannam@86: relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" cannam@86: elif eval var_value=\$$var; test -z "$var_value"; then cannam@86: relink_command="$var=; export $var; $relink_command" cannam@86: else cannam@86: var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` cannam@86: relink_command="$var=\"$var_value\"; export $var; $relink_command" cannam@86: fi cannam@86: done cannam@86: relink_command="(cd `pwd`; $relink_command)" cannam@86: relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` cannam@86: fi cannam@86: cannam@86: # Quote $echo for shipping. cannam@86: if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then cannam@86: case $progpath in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; cannam@86: *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; cannam@86: esac cannam@86: qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` cannam@86: else cannam@86: qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` cannam@86: fi cannam@86: cannam@86: # Only actually do things if our run command is non-null. cannam@86: if test -z "$run"; then cannam@86: # win32 will think the script is a binary if it has cannam@86: # a .exe suffix, so we strip it off here. cannam@86: case $output in cannam@86: *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; cannam@86: esac cannam@86: # test for cygwin because mv fails w/o .exe extensions cannam@86: case $host in cannam@86: *cygwin*) cannam@86: exeext=.exe cannam@86: outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; cannam@86: *) exeext= ;; cannam@86: esac cannam@86: case $host in cannam@86: *cygwin* | *mingw* ) cannam@86: cwrappersource=`$echo ${objdir}/lt-${outputname}.c` cannam@86: cwrapper=`$echo ${output}.exe` cannam@86: $rm $cwrappersource $cwrapper cannam@86: trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cannam@86: cannam@86: cat > $cwrappersource <> $cwrappersource<<"EOF" cannam@86: #include cannam@86: #include cannam@86: #include cannam@86: #include cannam@86: #include cannam@86: #include cannam@86: cannam@86: #if defined(PATH_MAX) cannam@86: # define LT_PATHMAX PATH_MAX cannam@86: #elif defined(MAXPATHLEN) cannam@86: # define LT_PATHMAX MAXPATHLEN cannam@86: #else cannam@86: # define LT_PATHMAX 1024 cannam@86: #endif cannam@86: cannam@86: #ifndef DIR_SEPARATOR cannam@86: #define DIR_SEPARATOR '/' cannam@86: #endif cannam@86: cannam@86: #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ cannam@86: defined (__OS2__) cannam@86: #define HAVE_DOS_BASED_FILE_SYSTEM cannam@86: #ifndef DIR_SEPARATOR_2 cannam@86: #define DIR_SEPARATOR_2 '\\' cannam@86: #endif cannam@86: #endif cannam@86: cannam@86: #ifndef DIR_SEPARATOR_2 cannam@86: # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) cannam@86: #else /* DIR_SEPARATOR_2 */ cannam@86: # define IS_DIR_SEPARATOR(ch) \ cannam@86: (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) cannam@86: #endif /* DIR_SEPARATOR_2 */ cannam@86: cannam@86: #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) cannam@86: #define XFREE(stale) do { \ cannam@86: if (stale) { free ((void *) stale); stale = 0; } \ cannam@86: } while (0) cannam@86: cannam@86: const char *program_name = NULL; cannam@86: cannam@86: void * xmalloc (size_t num); cannam@86: char * xstrdup (const char *string); cannam@86: char * basename (const char *name); cannam@86: char * fnqualify(const char *path); cannam@86: char * strendzap(char *str, const char *pat); cannam@86: void lt_fatal (const char *message, ...); cannam@86: cannam@86: int cannam@86: main (int argc, char *argv[]) cannam@86: { cannam@86: char **newargz; cannam@86: int i; cannam@86: cannam@86: program_name = (char *) xstrdup ((char *) basename (argv[0])); cannam@86: newargz = XMALLOC(char *, argc+2); cannam@86: EOF cannam@86: cannam@86: cat >> $cwrappersource <> $cwrappersource <<"EOF" cannam@86: newargz[1] = fnqualify(argv[0]); cannam@86: /* we know the script has the same name, without the .exe */ cannam@86: /* so make sure newargz[1] doesn't end in .exe */ cannam@86: strendzap(newargz[1],".exe"); cannam@86: for (i = 1; i < argc; i++) cannam@86: newargz[i+1] = xstrdup(argv[i]); cannam@86: newargz[argc+1] = NULL; cannam@86: EOF cannam@86: cannam@86: cat >> $cwrappersource <> $cwrappersource <<"EOF" cannam@86: } cannam@86: cannam@86: void * cannam@86: xmalloc (size_t num) cannam@86: { cannam@86: void * p = (void *) malloc (num); cannam@86: if (!p) cannam@86: lt_fatal ("Memory exhausted"); cannam@86: cannam@86: return p; cannam@86: } cannam@86: cannam@86: char * cannam@86: xstrdup (const char *string) cannam@86: { cannam@86: return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL cannam@86: ; cannam@86: } cannam@86: cannam@86: char * cannam@86: basename (const char *name) cannam@86: { cannam@86: const char *base; cannam@86: cannam@86: #if defined (HAVE_DOS_BASED_FILE_SYSTEM) cannam@86: /* Skip over the disk name in MSDOS pathnames. */ cannam@86: if (isalpha (name[0]) && name[1] == ':') cannam@86: name += 2; cannam@86: #endif cannam@86: cannam@86: for (base = name; *name; name++) cannam@86: if (IS_DIR_SEPARATOR (*name)) cannam@86: base = name + 1; cannam@86: return (char *) base; cannam@86: } cannam@86: cannam@86: char * cannam@86: fnqualify(const char *path) cannam@86: { cannam@86: size_t size; cannam@86: char *p; cannam@86: char tmp[LT_PATHMAX + 1]; cannam@86: cannam@86: assert(path != NULL); cannam@86: cannam@86: /* Is it qualified already? */ cannam@86: #if defined (HAVE_DOS_BASED_FILE_SYSTEM) cannam@86: if (isalpha (path[0]) && path[1] == ':') cannam@86: return xstrdup (path); cannam@86: #endif cannam@86: if (IS_DIR_SEPARATOR (path[0])) cannam@86: return xstrdup (path); cannam@86: cannam@86: /* prepend the current directory */ cannam@86: /* doesn't handle '~' */ cannam@86: if (getcwd (tmp, LT_PATHMAX) == NULL) cannam@86: lt_fatal ("getcwd failed"); cannam@86: size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ cannam@86: p = XMALLOC(char, size); cannam@86: sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); cannam@86: return p; cannam@86: } cannam@86: cannam@86: char * cannam@86: strendzap(char *str, const char *pat) cannam@86: { cannam@86: size_t len, patlen; cannam@86: cannam@86: assert(str != NULL); cannam@86: assert(pat != NULL); cannam@86: cannam@86: len = strlen(str); cannam@86: patlen = strlen(pat); cannam@86: cannam@86: if (patlen <= len) cannam@86: { cannam@86: str += len - patlen; cannam@86: if (strcmp(str, pat) == 0) cannam@86: *str = '\0'; cannam@86: } cannam@86: return str; cannam@86: } cannam@86: cannam@86: static void cannam@86: lt_error_core (int exit_status, const char * mode, cannam@86: const char * message, va_list ap) cannam@86: { cannam@86: fprintf (stderr, "%s: %s: ", program_name, mode); cannam@86: vfprintf (stderr, message, ap); cannam@86: fprintf (stderr, ".\n"); cannam@86: cannam@86: if (exit_status >= 0) cannam@86: exit (exit_status); cannam@86: } cannam@86: cannam@86: void cannam@86: lt_fatal (const char *message, ...) cannam@86: { cannam@86: va_list ap; cannam@86: va_start (ap, message); cannam@86: lt_error_core (EXIT_FAILURE, "FATAL", message, ap); cannam@86: va_end (ap); cannam@86: } cannam@86: EOF cannam@86: # we should really use a build-platform specific compiler cannam@86: # here, but OTOH, the wrappers (shell script and this C one) cannam@86: # are only useful if you want to execute the "real" binary. cannam@86: # Since the "real" binary is built for $host, then this cannam@86: # wrapper might as well be built for $host, too. cannam@86: $run $LTCC -s -o $cwrapper $cwrappersource cannam@86: ;; cannam@86: esac cannam@86: $rm $output cannam@86: trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 cannam@86: cannam@86: $echo > $output "\ cannam@86: #! $SHELL cannam@86: cannam@86: # $output - temporary wrapper script for $objdir/$outputname cannam@86: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP cannam@86: # cannam@86: # The $output program cannot be directly executed until all the libtool cannam@86: # libraries that it depends on are installed. cannam@86: # cannam@86: # This wrapper script should never be moved out of the build directory. cannam@86: # If it is, it will not operate correctly. cannam@86: cannam@86: # Sed substitution that helps us do robust quoting. It backslashifies cannam@86: # metacharacters that are still active within double-quoted strings. cannam@86: Xsed='${SED} -e 1s/^X//' cannam@86: sed_quote_subst='$sed_quote_subst' cannam@86: cannam@86: # The HP-UX ksh and POSIX shell print the target directory to stdout cannam@86: # if CDPATH is set. cannam@86: (unset CDPATH) >/dev/null 2>&1 && unset CDPATH cannam@86: cannam@86: relink_command=\"$relink_command\" cannam@86: cannam@86: # This environment variable determines our operation mode. cannam@86: if test \"\$libtool_install_magic\" = \"$magic\"; then cannam@86: # install mode needs the following variable: cannam@86: notinst_deplibs='$notinst_deplibs' cannam@86: else cannam@86: # When we are sourced in execute mode, \$file and \$echo are already set. cannam@86: if test \"\$libtool_execute_magic\" != \"$magic\"; then cannam@86: echo=\"$qecho\" cannam@86: file=\"\$0\" cannam@86: # Make sure echo works. cannam@86: if test \"X\$1\" = X--no-reexec; then cannam@86: # Discard the --no-reexec flag, and continue. cannam@86: shift cannam@86: elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then cannam@86: # Yippee, \$echo works! cannam@86: : cannam@86: else cannam@86: # Restart under the correct shell, and then maybe \$echo will work. cannam@86: exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} cannam@86: fi cannam@86: fi\ cannam@86: " cannam@86: $echo >> $output "\ cannam@86: cannam@86: # Find the directory that this script lives in. cannam@86: thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` cannam@86: test \"x\$thisdir\" = \"x\$file\" && thisdir=. cannam@86: cannam@86: # Follow symbolic links until we get to the real thisdir. cannam@86: file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` cannam@86: while test -n \"\$file\"; do cannam@86: destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` cannam@86: cannam@86: # If there was a directory component, then change thisdir. cannam@86: if test \"x\$destdir\" != \"x\$file\"; then cannam@86: case \"\$destdir\" in cannam@86: [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; cannam@86: *) thisdir=\"\$thisdir/\$destdir\" ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` cannam@86: file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` cannam@86: done cannam@86: cannam@86: # Try to get the absolute directory name. cannam@86: absdir=\`cd \"\$thisdir\" && pwd\` cannam@86: test -n \"\$absdir\" && thisdir=\"\$absdir\" cannam@86: " cannam@86: cannam@86: if test "$fast_install" = yes; then cannam@86: $echo >> $output "\ cannam@86: program=lt-'$outputname'$exeext cannam@86: progdir=\"\$thisdir/$objdir\" cannam@86: cannam@86: if test ! -f \"\$progdir/\$program\" || \\ cannam@86: { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ cannam@86: test \"X\$file\" != \"X\$progdir/\$program\"; }; then cannam@86: cannam@86: file=\"\$\$-\$program\" cannam@86: cannam@86: if test ! -d \"\$progdir\"; then cannam@86: $mkdir \"\$progdir\" cannam@86: else cannam@86: $rm \"\$progdir/\$file\" cannam@86: fi" cannam@86: cannam@86: $echo >> $output "\ cannam@86: cannam@86: # relink executable if necessary cannam@86: if test -n \"\$relink_command\"; then cannam@86: if relink_command_output=\`eval \$relink_command 2>&1\`; then : cannam@86: else cannam@86: $echo \"\$relink_command_output\" >&2 cannam@86: $rm \"\$progdir/\$file\" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: fi cannam@86: cannam@86: $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || cannam@86: { $rm \"\$progdir/\$program\"; cannam@86: $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } cannam@86: $rm \"\$progdir/\$file\" cannam@86: fi" cannam@86: else cannam@86: $echo >> $output "\ cannam@86: program='$outputname' cannam@86: progdir=\"\$thisdir/$objdir\" cannam@86: " cannam@86: fi cannam@86: cannam@86: $echo >> $output "\ cannam@86: cannam@86: if test -f \"\$progdir/\$program\"; then" cannam@86: cannam@86: # Export our shlibpath_var if we have one. cannam@86: if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then cannam@86: $echo >> $output "\ cannam@86: # Add our own library path to $shlibpath_var cannam@86: $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" cannam@86: cannam@86: # Some systems cannot cope with colon-terminated $shlibpath_var cannam@86: # The second colon is a workaround for a bug in BeOS R4 sed cannam@86: $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` cannam@86: cannam@86: export $shlibpath_var cannam@86: " cannam@86: fi cannam@86: cannam@86: # fixup the dll searchpath if we need to. cannam@86: if test -n "$dllsearchpath"; then cannam@86: $echo >> $output "\ cannam@86: # Add the dll search path components to the executable PATH cannam@86: PATH=$dllsearchpath:\$PATH cannam@86: " cannam@86: fi cannam@86: cannam@86: $echo >> $output "\ cannam@86: if test \"\$libtool_execute_magic\" != \"$magic\"; then cannam@86: # Run the actual program with our arguments. cannam@86: " cannam@86: case $host in cannam@86: # Backslashes separate directories on plain windows cannam@86: *-*-mingw | *-*-os2*) cannam@86: $echo >> $output "\ cannam@86: exec \$progdir\\\\\$program \${1+\"\$@\"} cannam@86: " cannam@86: ;; cannam@86: cannam@86: *) cannam@86: $echo >> $output "\ cannam@86: exec \$progdir/\$program \${1+\"\$@\"} cannam@86: " cannam@86: ;; cannam@86: esac cannam@86: $echo >> $output "\ cannam@86: \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: else cannam@86: # The program doesn't exist. cannam@86: \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 cannam@86: \$echo \"This script is just a wrapper for \$program.\" 1>&2 cannam@86: $echo \"See the $PACKAGE documentation for more information.\" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: fi\ cannam@86: " cannam@86: chmod +x $output cannam@86: fi cannam@86: exit $EXIT_SUCCESS cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # See if we need to build an old-fashioned archive. cannam@86: for oldlib in $oldlibs; do cannam@86: cannam@86: if test "$build_libtool_libs" = convenience; then cannam@86: oldobjs="$libobjs_save" cannam@86: addlibs="$convenience" cannam@86: build_libtool_libs=no cannam@86: else cannam@86: if test "$build_libtool_libs" = module; then cannam@86: oldobjs="$libobjs_save" cannam@86: build_libtool_libs=no cannam@86: else cannam@86: oldobjs="$old_deplibs $non_pic_objects" cannam@86: fi cannam@86: addlibs="$old_convenience" cannam@86: fi cannam@86: cannam@86: if test -n "$addlibs"; then cannam@86: gentop="$output_objdir/${outputname}x" cannam@86: generated="$generated $gentop" cannam@86: cannam@86: func_extract_archives $gentop $addlibs cannam@86: oldobjs="$oldobjs $func_extract_archives_result" cannam@86: fi cannam@86: cannam@86: # Do each command in the archive commands. cannam@86: if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cannam@86: cmds=$old_archive_from_new_cmds cannam@86: else cannam@86: # POSIX demands no paths to be encoded in archives. We have cannam@86: # to avoid creating archives with duplicate basenames if we cannam@86: # might have to extract them afterwards, e.g., when creating a cannam@86: # static archive out of a convenience library, or when linking cannam@86: # the entirety of a libtool archive into another (currently cannam@86: # not supported by libtool). cannam@86: if (for obj in $oldobjs cannam@86: do cannam@86: $echo "X$obj" | $Xsed -e 's%^.*/%%' cannam@86: done | sort | sort -uc >/dev/null 2>&1); then cannam@86: : cannam@86: else cannam@86: $echo "copying selected object files to avoid basename conflicts..." cannam@86: cannam@86: if test -z "$gentop"; then cannam@86: gentop="$output_objdir/${outputname}x" cannam@86: generated="$generated $gentop" cannam@86: cannam@86: $show "${rm}r $gentop" cannam@86: $run ${rm}r "$gentop" cannam@86: $show "$mkdir $gentop" cannam@86: $run $mkdir "$gentop" cannam@86: status=$? cannam@86: if test "$status" -ne 0 && test ! -d "$gentop"; then cannam@86: exit $status cannam@86: fi cannam@86: fi cannam@86: cannam@86: save_oldobjs=$oldobjs cannam@86: oldobjs= cannam@86: counter=1 cannam@86: for obj in $save_oldobjs cannam@86: do cannam@86: objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` cannam@86: case " $oldobjs " in cannam@86: " ") oldobjs=$obj ;; cannam@86: *[\ /]"$objbase "*) cannam@86: while :; do cannam@86: # Make sure we don't pick an alternate name that also cannam@86: # overlaps. cannam@86: newobj=lt$counter-$objbase cannam@86: counter=`expr $counter + 1` cannam@86: case " $oldobjs " in cannam@86: *[\ /]"$newobj "*) ;; cannam@86: *) if test ! -f "$gentop/$newobj"; then break; fi ;; cannam@86: esac cannam@86: done cannam@86: $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" cannam@86: $run ln "$obj" "$gentop/$newobj" || cannam@86: $run cp "$obj" "$gentop/$newobj" cannam@86: oldobjs="$oldobjs $gentop/$newobj" cannam@86: ;; cannam@86: *) oldobjs="$oldobjs $obj" ;; cannam@86: esac cannam@86: done cannam@86: fi cannam@86: cannam@86: eval cmds=\"$old_archive_cmds\" cannam@86: cannam@86: if len=`expr "X$cmds" : ".*"` && cannam@86: test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cannam@86: cmds=$old_archive_cmds cannam@86: else cannam@86: # the command line is too long to link in one step, link in parts cannam@86: $echo "using piecewise archive linking..." cannam@86: save_RANLIB=$RANLIB cannam@86: RANLIB=: cannam@86: objlist= cannam@86: concat_cmds= cannam@86: save_oldobjs=$oldobjs cannam@86: cannam@86: # Is there a better way of finding the last object in the list? cannam@86: for obj in $save_oldobjs cannam@86: do cannam@86: last_oldobj=$obj cannam@86: done cannam@86: for obj in $save_oldobjs cannam@86: do cannam@86: oldobjs="$objlist $obj" cannam@86: objlist="$objlist $obj" cannam@86: eval test_cmds=\"$old_archive_cmds\" cannam@86: if len=`expr "X$test_cmds" : ".*"` && cannam@86: test "$len" -le "$max_cmd_len"; then cannam@86: : cannam@86: else cannam@86: # the above command should be used before it gets too long cannam@86: oldobjs=$objlist cannam@86: if test "$obj" = "$last_oldobj" ; then cannam@86: RANLIB=$save_RANLIB cannam@86: fi cannam@86: test -z "$concat_cmds" || concat_cmds=$concat_cmds~ cannam@86: eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" cannam@86: objlist= cannam@86: fi cannam@86: done cannam@86: RANLIB=$save_RANLIB cannam@86: oldobjs=$objlist cannam@86: if test "X$oldobjs" = "X" ; then cannam@86: eval cmds=\"\$concat_cmds\" cannam@86: else cannam@86: eval cmds=\"\$concat_cmds~\$old_archive_cmds\" cannam@86: fi cannam@86: fi cannam@86: fi cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: eval cmd=\"$cmd\" cannam@86: IFS="$save_ifs" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: done cannam@86: cannam@86: if test -n "$generated"; then cannam@86: $show "${rm}r$generated" cannam@86: $run ${rm}r$generated cannam@86: fi cannam@86: cannam@86: # Now create the libtool archive. cannam@86: case $output in cannam@86: *.la) cannam@86: old_library= cannam@86: test "$build_old_libs" = yes && old_library="$libname.$libext" cannam@86: $show "creating $output" cannam@86: cannam@86: # Preserve any variables that may affect compiler behavior cannam@86: for var in $variables_saved_for_relink; do cannam@86: if eval test -z \"\${$var+set}\"; then cannam@86: relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" cannam@86: elif eval var_value=\$$var; test -z "$var_value"; then cannam@86: relink_command="$var=; export $var; $relink_command" cannam@86: else cannam@86: var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` cannam@86: relink_command="$var=\"$var_value\"; export $var; $relink_command" cannam@86: fi cannam@86: done cannam@86: # Quote the link command for shipping. cannam@86: relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" cannam@86: relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` cannam@86: if test "$hardcode_automatic" = yes ; then cannam@86: relink_command= cannam@86: fi cannam@86: cannam@86: cannam@86: # Only create the output if not a dry run. cannam@86: if test -z "$run"; then cannam@86: for installed in no yes; do cannam@86: if test "$installed" = yes; then cannam@86: if test -z "$install_libdir"; then cannam@86: break cannam@86: fi cannam@86: output="$output_objdir/$outputname"i cannam@86: # Replace all uninstalled libtool libraries with the installed ones cannam@86: newdependency_libs= cannam@86: for deplib in $dependency_libs; do cannam@86: case $deplib in cannam@86: *.la) cannam@86: name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` cannam@86: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` cannam@86: if test -z "$libdir"; then cannam@86: $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: newdependency_libs="$newdependency_libs $libdir/$name" cannam@86: ;; cannam@86: *) newdependency_libs="$newdependency_libs $deplib" ;; cannam@86: esac cannam@86: done cannam@86: dependency_libs="$newdependency_libs" cannam@86: newdlfiles= cannam@86: for lib in $dlfiles; do cannam@86: name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` cannam@86: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` cannam@86: if test -z "$libdir"; then cannam@86: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: newdlfiles="$newdlfiles $libdir/$name" cannam@86: done cannam@86: dlfiles="$newdlfiles" cannam@86: newdlprefiles= cannam@86: for lib in $dlprefiles; do cannam@86: name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` cannam@86: eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` cannam@86: if test -z "$libdir"; then cannam@86: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: newdlprefiles="$newdlprefiles $libdir/$name" cannam@86: done cannam@86: dlprefiles="$newdlprefiles" cannam@86: else cannam@86: newdlfiles= cannam@86: for lib in $dlfiles; do cannam@86: case $lib in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; cannam@86: *) abs=`pwd`"/$lib" ;; cannam@86: esac cannam@86: newdlfiles="$newdlfiles $abs" cannam@86: done cannam@86: dlfiles="$newdlfiles" cannam@86: newdlprefiles= cannam@86: for lib in $dlprefiles; do cannam@86: case $lib in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; cannam@86: *) abs=`pwd`"/$lib" ;; cannam@86: esac cannam@86: newdlprefiles="$newdlprefiles $abs" cannam@86: done cannam@86: dlprefiles="$newdlprefiles" cannam@86: fi cannam@86: $rm $output cannam@86: # place dlname in correct position for cygwin cannam@86: tdlname=$dlname cannam@86: case $host,$output,$installed,$module,$dlname in cannam@86: *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; cannam@86: esac cannam@86: $echo > $output "\ cannam@86: # $outputname - a libtool library file cannam@86: # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP cannam@86: # cannam@86: # Please DO NOT delete this file! cannam@86: # It is necessary for linking the library. cannam@86: cannam@86: # The name that we can dlopen(3). cannam@86: dlname='$tdlname' cannam@86: cannam@86: # Names of this library. cannam@86: library_names='$library_names' cannam@86: cannam@86: # The name of the static archive. cannam@86: old_library='$old_library' cannam@86: cannam@86: # Libraries that this one depends upon. cannam@86: dependency_libs='$dependency_libs' cannam@86: cannam@86: # Version information for $libname. cannam@86: current=$current cannam@86: age=$age cannam@86: revision=$revision cannam@86: cannam@86: # Is this an already installed library? cannam@86: installed=$installed cannam@86: cannam@86: # Should we warn about portability when linking against -modules? cannam@86: shouldnotlink=$module cannam@86: cannam@86: # Files to dlopen/dlpreopen cannam@86: dlopen='$dlfiles' cannam@86: dlpreopen='$dlprefiles' cannam@86: cannam@86: # Directory that this library needs to be installed in: cannam@86: libdir='$install_libdir'" cannam@86: if test "$installed" = no && test "$need_relink" = yes; then cannam@86: $echo >> $output "\ cannam@86: relink_command=\"$relink_command\"" cannam@86: fi cannam@86: done cannam@86: fi cannam@86: cannam@86: # Do a symbolic link so that the libtool archive can be found in cannam@86: # LD_LIBRARY_PATH before the program is installed. cannam@86: $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" cannam@86: $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? cannam@86: ;; cannam@86: esac cannam@86: exit $EXIT_SUCCESS cannam@86: ;; cannam@86: cannam@86: # libtool install mode cannam@86: install) cannam@86: modename="$modename: install" cannam@86: cannam@86: # There may be an optional sh(1) argument at the beginning of cannam@86: # install_prog (especially on Windows NT). cannam@86: if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || cannam@86: # Allow the use of GNU shtool's install command. cannam@86: $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then cannam@86: # Aesthetically quote it. cannam@86: arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: install_prog="$arg " cannam@86: arg="$1" cannam@86: shift cannam@86: else cannam@86: install_prog= cannam@86: arg="$nonopt" cannam@86: fi cannam@86: cannam@86: # The real first argument should be the name of the installation program. cannam@86: # Aesthetically quote it. cannam@86: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: install_prog="$install_prog$arg" cannam@86: cannam@86: # We need to accept at least all the BSD install flags. cannam@86: dest= cannam@86: files= cannam@86: opts= cannam@86: prev= cannam@86: install_type= cannam@86: isdir=no cannam@86: stripme= cannam@86: for arg cannam@86: do cannam@86: if test -n "$dest"; then cannam@86: files="$files $dest" cannam@86: dest="$arg" cannam@86: continue cannam@86: fi cannam@86: cannam@86: case $arg in cannam@86: -d) isdir=yes ;; cannam@86: -f) prev="-f" ;; cannam@86: -g) prev="-g" ;; cannam@86: -m) prev="-m" ;; cannam@86: -o) prev="-o" ;; cannam@86: -s) cannam@86: stripme=" -s" cannam@86: continue cannam@86: ;; cannam@86: -*) ;; cannam@86: cannam@86: *) cannam@86: # If the previous option needed an argument, then skip it. cannam@86: if test -n "$prev"; then cannam@86: prev= cannam@86: else cannam@86: dest="$arg" cannam@86: continue cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Aesthetically quote the argument. cannam@86: arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` cannam@86: case $arg in cannam@86: *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") cannam@86: arg="\"$arg\"" cannam@86: ;; cannam@86: esac cannam@86: install_prog="$install_prog $arg" cannam@86: done cannam@86: cannam@86: if test -z "$install_prog"; then cannam@86: $echo "$modename: you must specify an install program" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: if test -n "$prev"; then cannam@86: $echo "$modename: the \`$prev' option requires an argument" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: if test -z "$files"; then cannam@86: if test -z "$dest"; then cannam@86: $echo "$modename: no file or destination specified" 1>&2 cannam@86: else cannam@86: $echo "$modename: you must specify a destination" 1>&2 cannam@86: fi cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Strip any trailing slash from the destination. cannam@86: dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` cannam@86: cannam@86: # Check to see that the destination is a directory. cannam@86: test -d "$dest" && isdir=yes cannam@86: if test "$isdir" = yes; then cannam@86: destdir="$dest" cannam@86: destname= cannam@86: else cannam@86: destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` cannam@86: test "X$destdir" = "X$dest" && destdir=. cannam@86: destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` cannam@86: cannam@86: # Not a directory, so check to see that there is only one file specified. cannam@86: set dummy $files cannam@86: if test "$#" -gt 2; then cannam@86: $echo "$modename: \`$dest' is not a directory" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: fi cannam@86: case $destdir in cannam@86: [\\/]* | [A-Za-z]:[\\/]*) ;; cannam@86: *) cannam@86: for file in $files; do cannam@86: case $file in cannam@86: *.lo) ;; cannam@86: *) cannam@86: $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # This variable tells wrapper scripts just to set variables rather cannam@86: # than running their programs. cannam@86: libtool_install_magic="$magic" cannam@86: cannam@86: staticlibs= cannam@86: future_libdirs= cannam@86: current_libdirs= cannam@86: for file in $files; do cannam@86: cannam@86: # Do each installation. cannam@86: case $file in cannam@86: *.$libext) cannam@86: # Do the static libraries later. cannam@86: staticlibs="$staticlibs $file" cannam@86: ;; cannam@86: cannam@86: *.la) cannam@86: # Check to see that this really is a libtool archive. cannam@86: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : cannam@86: else cannam@86: $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: library_names= cannam@86: old_library= cannam@86: relink_command= cannam@86: # If there is no directory component, then add one. cannam@86: case $file in cannam@86: */* | *\\*) . $file ;; cannam@86: *) . ./$file ;; cannam@86: esac cannam@86: cannam@86: # Add the libdir to current_libdirs if it is the destination. cannam@86: if test "X$destdir" = "X$libdir"; then cannam@86: case "$current_libdirs " in cannam@86: *" $libdir "*) ;; cannam@86: *) current_libdirs="$current_libdirs $libdir" ;; cannam@86: esac cannam@86: else cannam@86: # Note the libdir as a future libdir. cannam@86: case "$future_libdirs " in cannam@86: *" $libdir "*) ;; cannam@86: *) future_libdirs="$future_libdirs $libdir" ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ cannam@86: test "X$dir" = "X$file/" && dir= cannam@86: dir="$dir$objdir" cannam@86: cannam@86: if test -n "$relink_command"; then cannam@86: # Determine the prefix the user has applied to our future dir. cannam@86: inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` cannam@86: cannam@86: # Don't allow the user to place us outside of our expected cannam@86: # location b/c this prevents finding dependent libraries that cannam@86: # are installed to the same prefix. cannam@86: # At present, this check doesn't affect windows .dll's that cannam@86: # are installed into $libdir/../bin (currently, that works fine) cannam@86: # but it's something to keep an eye on. cannam@86: if test "$inst_prefix_dir" = "$destdir"; then cannam@86: $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: if test -n "$inst_prefix_dir"; then cannam@86: # Stick the inst_prefix_dir data into the link command. cannam@86: relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` cannam@86: else cannam@86: relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` cannam@86: fi cannam@86: cannam@86: $echo "$modename: warning: relinking \`$file'" 1>&2 cannam@86: $show "$relink_command" cannam@86: if $run eval "$relink_command"; then : cannam@86: else cannam@86: $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: fi cannam@86: cannam@86: # See the names of the shared library. cannam@86: set dummy $library_names cannam@86: if test -n "$2"; then cannam@86: realname="$2" cannam@86: shift cannam@86: shift cannam@86: cannam@86: srcname="$realname" cannam@86: test -n "$relink_command" && srcname="$realname"T cannam@86: cannam@86: # Install the shared library and build the symlinks. cannam@86: $show "$install_prog $dir/$srcname $destdir/$realname" cannam@86: $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? cannam@86: if test -n "$stripme" && test -n "$striplib"; then cannam@86: $show "$striplib $destdir/$realname" cannam@86: $run eval "$striplib $destdir/$realname" || exit $? cannam@86: fi cannam@86: cannam@86: if test "$#" -gt 0; then cannam@86: # Delete the old symlinks, and create new ones. cannam@86: for linkname cannam@86: do cannam@86: if test "$linkname" != "$realname"; then cannam@86: $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" cannam@86: $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" cannam@86: fi cannam@86: done cannam@86: fi cannam@86: cannam@86: # Do each command in the postinstall commands. cannam@86: lib="$destdir/$realname" cannam@86: cmds=$postinstall_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: cannam@86: # Install the pseudo-library for information purposes. cannam@86: name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` cannam@86: instname="$dir/$name"i cannam@86: $show "$install_prog $instname $destdir/$name" cannam@86: $run eval "$install_prog $instname $destdir/$name" || exit $? cannam@86: cannam@86: # Maybe install the static library, too. cannam@86: test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" cannam@86: ;; cannam@86: cannam@86: *.lo) cannam@86: # Install (i.e. copy) a libtool object. cannam@86: cannam@86: # Figure out destination file name, if it wasn't already specified. cannam@86: if test -n "$destname"; then cannam@86: destfile="$destdir/$destname" cannam@86: else cannam@86: destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` cannam@86: destfile="$destdir/$destfile" cannam@86: fi cannam@86: cannam@86: # Deduce the name of the destination old-style object file. cannam@86: case $destfile in cannam@86: *.lo) cannam@86: staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` cannam@86: ;; cannam@86: *.$objext) cannam@86: staticdest="$destfile" cannam@86: destfile= cannam@86: ;; cannam@86: *) cannam@86: $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Install the libtool object if requested. cannam@86: if test -n "$destfile"; then cannam@86: $show "$install_prog $file $destfile" cannam@86: $run eval "$install_prog $file $destfile" || exit $? cannam@86: fi cannam@86: cannam@86: # Install the old object if enabled. cannam@86: if test "$build_old_libs" = yes; then cannam@86: # Deduce the name of the old-style object file. cannam@86: staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` cannam@86: cannam@86: $show "$install_prog $staticobj $staticdest" cannam@86: $run eval "$install_prog \$staticobj \$staticdest" || exit $? cannam@86: fi cannam@86: exit $EXIT_SUCCESS cannam@86: ;; cannam@86: cannam@86: *) cannam@86: # Figure out destination file name, if it wasn't already specified. cannam@86: if test -n "$destname"; then cannam@86: destfile="$destdir/$destname" cannam@86: else cannam@86: destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` cannam@86: destfile="$destdir/$destfile" cannam@86: fi cannam@86: cannam@86: # If the file is missing, and there is a .exe on the end, strip it cannam@86: # because it is most likely a libtool script we actually want to cannam@86: # install cannam@86: stripped_ext="" cannam@86: case $file in cannam@86: *.exe) cannam@86: if test ! -f "$file"; then cannam@86: file=`$echo $file|${SED} 's,.exe$,,'` cannam@86: stripped_ext=".exe" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Do a test to see if this is really a libtool program. cannam@86: case $host in cannam@86: *cygwin*|*mingw*) cannam@86: wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` cannam@86: ;; cannam@86: *) cannam@86: wrapper=$file cannam@86: ;; cannam@86: esac cannam@86: if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then cannam@86: notinst_deplibs= cannam@86: relink_command= cannam@86: cannam@86: # To insure that "foo" is sourced, and not "foo.exe", cannam@86: # finese the cygwin/MSYS system by explicitly sourcing "foo." cannam@86: # which disallows the automatic-append-.exe behavior. cannam@86: case $build in cannam@86: *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; cannam@86: *) wrapperdot=${wrapper} ;; cannam@86: esac cannam@86: # If there is no directory component, then add one. cannam@86: case $file in cannam@86: */* | *\\*) . ${wrapperdot} ;; cannam@86: *) . ./${wrapperdot} ;; cannam@86: esac cannam@86: cannam@86: # Check the variables that should have been set. cannam@86: if test -z "$notinst_deplibs"; then cannam@86: $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: finalize=yes cannam@86: for lib in $notinst_deplibs; do cannam@86: # Check to see that each library is installed. cannam@86: libdir= cannam@86: if test -f "$lib"; then cannam@86: # If there is no directory component, then add one. cannam@86: case $lib in cannam@86: */* | *\\*) . $lib ;; cannam@86: *) . ./$lib ;; cannam@86: esac cannam@86: fi cannam@86: libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test cannam@86: if test -n "$libdir" && test ! -f "$libfile"; then cannam@86: $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 cannam@86: finalize=no cannam@86: fi cannam@86: done cannam@86: cannam@86: relink_command= cannam@86: # To insure that "foo" is sourced, and not "foo.exe", cannam@86: # finese the cygwin/MSYS system by explicitly sourcing "foo." cannam@86: # which disallows the automatic-append-.exe behavior. cannam@86: case $build in cannam@86: *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; cannam@86: *) wrapperdot=${wrapper} ;; cannam@86: esac cannam@86: # If there is no directory component, then add one. cannam@86: case $file in cannam@86: */* | *\\*) . ${wrapperdot} ;; cannam@86: *) . ./${wrapperdot} ;; cannam@86: esac cannam@86: cannam@86: outputname= cannam@86: if test "$fast_install" = no && test -n "$relink_command"; then cannam@86: if test "$finalize" = yes && test -z "$run"; then cannam@86: tmpdir="/tmp" cannam@86: test -n "$TMPDIR" && tmpdir="$TMPDIR" cannam@86: tmpdir="$tmpdir/libtool-$$" cannam@86: save_umask=`umask` cannam@86: umask 0077 cannam@86: if $mkdir "$tmpdir"; then cannam@86: umask $save_umask cannam@86: else cannam@86: umask $save_umask cannam@86: $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 cannam@86: continue cannam@86: fi cannam@86: file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` cannam@86: outputname="$tmpdir/$file" cannam@86: # Replace the output file specification. cannam@86: relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` cannam@86: cannam@86: $show "$relink_command" cannam@86: if $run eval "$relink_command"; then : cannam@86: else cannam@86: $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 cannam@86: ${rm}r "$tmpdir" cannam@86: continue cannam@86: fi cannam@86: file="$outputname" cannam@86: else cannam@86: $echo "$modename: warning: cannot relink \`$file'" 1>&2 cannam@86: fi cannam@86: else cannam@86: # Install the binary that we compiled earlier. cannam@86: file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` cannam@86: fi cannam@86: fi cannam@86: cannam@86: # remove .exe since cygwin /usr/bin/install will append another cannam@86: # one anyways cannam@86: case $install_prog,$host in cannam@86: */usr/bin/install*,*cygwin*) cannam@86: case $file:$destfile in cannam@86: *.exe:*.exe) cannam@86: # this is ok cannam@86: ;; cannam@86: *.exe:*) cannam@86: destfile=$destfile.exe cannam@86: ;; cannam@86: *:*.exe) cannam@86: destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` cannam@86: ;; cannam@86: esac cannam@86: ;; cannam@86: esac cannam@86: $show "$install_prog$stripme $file $destfile" cannam@86: $run eval "$install_prog\$stripme \$file \$destfile" || exit $? cannam@86: test -n "$outputname" && ${rm}r "$tmpdir" cannam@86: ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: for file in $staticlibs; do cannam@86: name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` cannam@86: cannam@86: # Set up the ranlib parameters. cannam@86: oldlib="$destdir/$name" cannam@86: cannam@86: $show "$install_prog $file $oldlib" cannam@86: $run eval "$install_prog \$file \$oldlib" || exit $? cannam@86: cannam@86: if test -n "$stripme" && test -n "$old_striplib"; then cannam@86: $show "$old_striplib $oldlib" cannam@86: $run eval "$old_striplib $oldlib" || exit $? cannam@86: fi cannam@86: cannam@86: # Do each command in the postinstall commands. cannam@86: cmds=$old_postinstall_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || exit $? cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: done cannam@86: cannam@86: if test -n "$future_libdirs"; then cannam@86: $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 cannam@86: fi cannam@86: cannam@86: if test -n "$current_libdirs"; then cannam@86: # Maybe just do a dry run. cannam@86: test -n "$run" && current_libdirs=" -n$current_libdirs" cannam@86: exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' cannam@86: else cannam@86: exit $EXIT_SUCCESS cannam@86: fi cannam@86: ;; cannam@86: cannam@86: # libtool finish mode cannam@86: finish) cannam@86: modename="$modename: finish" cannam@86: libdirs="$nonopt" cannam@86: admincmds= cannam@86: cannam@86: if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then cannam@86: for dir cannam@86: do cannam@86: libdirs="$libdirs $dir" cannam@86: done cannam@86: cannam@86: for libdir in $libdirs; do cannam@86: if test -n "$finish_cmds"; then cannam@86: # Do each command in the finish commands. cannam@86: cmds=$finish_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" || admincmds="$admincmds cannam@86: $cmd" cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: if test -n "$finish_eval"; then cannam@86: # Do the single finish_eval. cannam@86: eval cmds=\"$finish_eval\" cannam@86: $run eval "$cmds" || admincmds="$admincmds cannam@86: $cmds" cannam@86: fi cannam@86: done cannam@86: fi cannam@86: cannam@86: # Exit here if they wanted silent mode. cannam@86: test "$show" = : && exit $EXIT_SUCCESS cannam@86: cannam@86: $echo "----------------------------------------------------------------------" cannam@86: $echo "Libraries have been installed in:" cannam@86: for libdir in $libdirs; do cannam@86: $echo " $libdir" cannam@86: done cannam@86: $echo cannam@86: $echo "If you ever happen to want to link against installed libraries" cannam@86: $echo "in a given directory, LIBDIR, you must either use libtool, and" cannam@86: $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" cannam@86: $echo "flag during linking and do at least one of the following:" cannam@86: if test -n "$shlibpath_var"; then cannam@86: $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" cannam@86: $echo " during execution" cannam@86: fi cannam@86: if test -n "$runpath_var"; then cannam@86: $echo " - add LIBDIR to the \`$runpath_var' environment variable" cannam@86: $echo " during linking" cannam@86: fi cannam@86: if test -n "$hardcode_libdir_flag_spec"; then cannam@86: libdir=LIBDIR cannam@86: eval flag=\"$hardcode_libdir_flag_spec\" cannam@86: cannam@86: $echo " - use the \`$flag' linker flag" cannam@86: fi cannam@86: if test -n "$admincmds"; then cannam@86: $echo " - have your system administrator run these commands:$admincmds" cannam@86: fi cannam@86: if test -f /etc/ld.so.conf; then cannam@86: $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" cannam@86: fi cannam@86: $echo cannam@86: $echo "See any operating system documentation about shared libraries for" cannam@86: $echo "more information, such as the ld(1) and ld.so(8) manual pages." cannam@86: $echo "----------------------------------------------------------------------" cannam@86: exit $EXIT_SUCCESS cannam@86: ;; cannam@86: cannam@86: # libtool execute mode cannam@86: execute) cannam@86: modename="$modename: execute" cannam@86: cannam@86: # The first argument is the command name. cannam@86: cmd="$nonopt" cannam@86: if test -z "$cmd"; then cannam@86: $echo "$modename: you must specify a COMMAND" 1>&2 cannam@86: $echo "$help" cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Handle -dlopen flags immediately. cannam@86: for file in $execute_dlfiles; do cannam@86: if test ! -f "$file"; then cannam@86: $echo "$modename: \`$file' is not a file" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: dir= cannam@86: case $file in cannam@86: *.la) cannam@86: # Check to see that this really is a libtool archive. cannam@86: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : cannam@86: else cannam@86: $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # Read the libtool library. cannam@86: dlname= cannam@86: library_names= cannam@86: cannam@86: # If there is no directory component, then add one. cannam@86: case $file in cannam@86: */* | *\\*) . $file ;; cannam@86: *) . ./$file ;; cannam@86: esac cannam@86: cannam@86: # Skip this library if it cannot be dlopened. cannam@86: if test -z "$dlname"; then cannam@86: # Warn if it was a shared library. cannam@86: test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" cannam@86: continue cannam@86: fi cannam@86: cannam@86: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` cannam@86: test "X$dir" = "X$file" && dir=. cannam@86: cannam@86: if test -f "$dir/$objdir/$dlname"; then cannam@86: dir="$dir/$objdir" cannam@86: else cannam@86: $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: ;; cannam@86: cannam@86: *.lo) cannam@86: # Just add the directory containing the .lo file. cannam@86: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` cannam@86: test "X$dir" = "X$file" && dir=. cannam@86: ;; cannam@86: cannam@86: *) cannam@86: $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 cannam@86: continue cannam@86: ;; cannam@86: esac cannam@86: cannam@86: # Get the absolute pathname. cannam@86: absdir=`cd "$dir" && pwd` cannam@86: test -n "$absdir" && dir="$absdir" cannam@86: cannam@86: # Now add the directory to shlibpath_var. cannam@86: if eval "test -z \"\$$shlibpath_var\""; then cannam@86: eval "$shlibpath_var=\"\$dir\"" cannam@86: else cannam@86: eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" cannam@86: fi cannam@86: done cannam@86: cannam@86: # This variable tells wrapper scripts just to set shlibpath_var cannam@86: # rather than running their programs. cannam@86: libtool_execute_magic="$magic" cannam@86: cannam@86: # Check if any of the arguments is a wrapper script. cannam@86: args= cannam@86: for file cannam@86: do cannam@86: case $file in cannam@86: -*) ;; cannam@86: *) cannam@86: # Do a test to see if this is really a libtool program. cannam@86: if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: # If there is no directory component, then add one. cannam@86: case $file in cannam@86: */* | *\\*) . $file ;; cannam@86: *) . ./$file ;; cannam@86: esac cannam@86: cannam@86: # Transform arg to wrapped name. cannam@86: file="$progdir/$program" cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: # Quote arguments (to preserve shell metacharacters). cannam@86: file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` cannam@86: args="$args \"$file\"" cannam@86: done cannam@86: cannam@86: if test -z "$run"; then cannam@86: if test -n "$shlibpath_var"; then cannam@86: # Export the shlibpath_var. cannam@86: eval "export $shlibpath_var" cannam@86: fi cannam@86: cannam@86: # Restore saved environment variables cannam@86: if test "${save_LC_ALL+set}" = set; then cannam@86: LC_ALL="$save_LC_ALL"; export LC_ALL cannam@86: fi cannam@86: if test "${save_LANG+set}" = set; then cannam@86: LANG="$save_LANG"; export LANG cannam@86: fi cannam@86: cannam@86: # Now prepare to actually exec the command. cannam@86: exec_cmd="\$cmd$args" cannam@86: else cannam@86: # Display what would be done. cannam@86: if test -n "$shlibpath_var"; then cannam@86: eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" cannam@86: $echo "export $shlibpath_var" cannam@86: fi cannam@86: $echo "$cmd$args" cannam@86: exit $EXIT_SUCCESS cannam@86: fi cannam@86: ;; cannam@86: cannam@86: # libtool clean and uninstall mode cannam@86: clean | uninstall) cannam@86: modename="$modename: $mode" cannam@86: rm="$nonopt" cannam@86: files= cannam@86: rmforce= cannam@86: exit_status=0 cannam@86: cannam@86: # This variable tells wrapper scripts just to set variables rather cannam@86: # than running their programs. cannam@86: libtool_install_magic="$magic" cannam@86: cannam@86: for arg cannam@86: do cannam@86: case $arg in cannam@86: -f) rm="$rm $arg"; rmforce=yes ;; cannam@86: -*) rm="$rm $arg" ;; cannam@86: *) files="$files $arg" ;; cannam@86: esac cannam@86: done cannam@86: cannam@86: if test -z "$rm"; then cannam@86: $echo "$modename: you must specify an RM program" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: rmdirs= cannam@86: cannam@86: origobjdir="$objdir" cannam@86: for file in $files; do cannam@86: dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` cannam@86: if test "X$dir" = "X$file"; then cannam@86: dir=. cannam@86: objdir="$origobjdir" cannam@86: else cannam@86: objdir="$dir/$origobjdir" cannam@86: fi cannam@86: name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` cannam@86: test "$mode" = uninstall && objdir="$dir" cannam@86: cannam@86: # Remember objdir for removal later, being careful to avoid duplicates cannam@86: if test "$mode" = clean; then cannam@86: case " $rmdirs " in cannam@86: *" $objdir "*) ;; cannam@86: *) rmdirs="$rmdirs $objdir" ;; cannam@86: esac cannam@86: fi cannam@86: cannam@86: # Don't error if the file doesn't exist and rm -f was used. cannam@86: if (test -L "$file") >/dev/null 2>&1 \ cannam@86: || (test -h "$file") >/dev/null 2>&1 \ cannam@86: || test -f "$file"; then cannam@86: : cannam@86: elif test -d "$file"; then cannam@86: exit_status=1 cannam@86: continue cannam@86: elif test "$rmforce" = yes; then cannam@86: continue cannam@86: fi cannam@86: cannam@86: rmfiles="$file" cannam@86: cannam@86: case $name in cannam@86: *.la) cannam@86: # Possibly a libtool archive, so verify it. cannam@86: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: . $dir/$name cannam@86: cannam@86: # Delete the libtool libraries and symlinks. cannam@86: for n in $library_names; do cannam@86: rmfiles="$rmfiles $objdir/$n" cannam@86: done cannam@86: test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" cannam@86: test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" cannam@86: cannam@86: if test "$mode" = uninstall; then cannam@86: if test -n "$library_names"; then cannam@86: # Do each command in the postuninstall commands. cannam@86: cmds=$postuninstall_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" cannam@86: if test "$?" -ne 0 && test "$rmforce" != yes; then cannam@86: exit_status=1 cannam@86: fi cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: cannam@86: if test -n "$old_library"; then cannam@86: # Do each command in the old_postuninstall commands. cannam@86: cmds=$old_postuninstall_cmds cannam@86: save_ifs="$IFS"; IFS='~' cannam@86: for cmd in $cmds; do cannam@86: IFS="$save_ifs" cannam@86: eval cmd=\"$cmd\" cannam@86: $show "$cmd" cannam@86: $run eval "$cmd" cannam@86: if test "$?" -ne 0 && test "$rmforce" != yes; then cannam@86: exit_status=1 cannam@86: fi cannam@86: done cannam@86: IFS="$save_ifs" cannam@86: fi cannam@86: # FIXME: should reinstall the best remaining shared library. cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: cannam@86: *.lo) cannam@86: # Possibly a libtool object, so verify it. cannam@86: if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: cannam@86: # Read the .lo file cannam@86: . $dir/$name cannam@86: cannam@86: # Add PIC object to the list of files to remove. cannam@86: if test -n "$pic_object" \ cannam@86: && test "$pic_object" != none; then cannam@86: rmfiles="$rmfiles $dir/$pic_object" cannam@86: fi cannam@86: cannam@86: # Add non-PIC object to the list of files to remove. cannam@86: if test -n "$non_pic_object" \ cannam@86: && test "$non_pic_object" != none; then cannam@86: rmfiles="$rmfiles $dir/$non_pic_object" cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: cannam@86: *) cannam@86: if test "$mode" = clean ; then cannam@86: noexename=$name cannam@86: case $file in cannam@86: *.exe) cannam@86: file=`$echo $file|${SED} 's,.exe$,,'` cannam@86: noexename=`$echo $name|${SED} 's,.exe$,,'` cannam@86: # $file with .exe has already been added to rmfiles, cannam@86: # add $file without .exe cannam@86: rmfiles="$rmfiles $file" cannam@86: ;; cannam@86: esac cannam@86: # Do a test to see if this is a libtool program. cannam@86: if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then cannam@86: relink_command= cannam@86: . $dir/$noexename cannam@86: cannam@86: # note $name still contains .exe if it was in $file originally cannam@86: # as does the version of $file that was added into $rmfiles cannam@86: rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" cannam@86: if test "$fast_install" = yes && test -n "$relink_command"; then cannam@86: rmfiles="$rmfiles $objdir/lt-$name" cannam@86: fi cannam@86: if test "X$noexename" != "X$name" ; then cannam@86: rmfiles="$rmfiles $objdir/lt-${noexename}.c" cannam@86: fi cannam@86: fi cannam@86: fi cannam@86: ;; cannam@86: esac cannam@86: $show "$rm $rmfiles" cannam@86: $run $rm $rmfiles || exit_status=1 cannam@86: done cannam@86: objdir="$origobjdir" cannam@86: cannam@86: # Try to remove the ${objdir}s in the directories where we deleted files cannam@86: for dir in $rmdirs; do cannam@86: if test -d "$dir"; then cannam@86: $show "rmdir $dir" cannam@86: $run rmdir $dir >/dev/null 2>&1 cannam@86: fi cannam@86: done cannam@86: cannam@86: exit $exit_status cannam@86: ;; cannam@86: cannam@86: "") cannam@86: $echo "$modename: you must specify a MODE" 1>&2 cannam@86: $echo "$generic_help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: if test -z "$exec_cmd"; then cannam@86: $echo "$modename: invalid operation mode \`$mode'" 1>&2 cannam@86: $echo "$generic_help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: fi # test -z "$show_help" cannam@86: cannam@86: if test -n "$exec_cmd"; then cannam@86: eval exec $exec_cmd cannam@86: exit $EXIT_FAILURE cannam@86: fi cannam@86: cannam@86: # We need to display help for each of the modes. cannam@86: case $mode in cannam@86: "") $echo \ cannam@86: "Usage: $modename [OPTION]... [MODE-ARG]... cannam@86: cannam@86: Provide generalized library-building support services. cannam@86: cannam@86: --config show all configuration variables cannam@86: --debug enable verbose shell tracing cannam@86: -n, --dry-run display commands without modifying any files cannam@86: --features display basic configuration information and exit cannam@86: --finish same as \`--mode=finish' cannam@86: --help display this help message and exit cannam@86: --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] cannam@86: --quiet same as \`--silent' cannam@86: --silent don't print informational messages cannam@86: --tag=TAG use configuration variables from tag TAG cannam@86: --version print version information cannam@86: cannam@86: MODE must be one of the following: cannam@86: cannam@86: clean remove files from the build directory cannam@86: compile compile a source file into a libtool object cannam@86: execute automatically set library path, then run a program cannam@86: finish complete the installation of libtool libraries cannam@86: install install libraries or executables cannam@86: link create a library or an executable cannam@86: uninstall remove libraries from an installed directory cannam@86: cannam@86: MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for cannam@86: a more detailed description of MODE. cannam@86: cannam@86: Report bugs to ." cannam@86: exit $EXIT_SUCCESS cannam@86: ;; cannam@86: cannam@86: clean) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... cannam@86: cannam@86: Remove files from the build directory. cannam@86: cannam@86: RM is the name of the program to use to delete files associated with each FILE cannam@86: (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed cannam@86: to RM. cannam@86: cannam@86: If FILE is a libtool library, object or program, all the files associated cannam@86: with it are deleted. Otherwise, only FILE itself is deleted using RM." cannam@86: ;; cannam@86: cannam@86: compile) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE cannam@86: cannam@86: Compile a source file into a libtool library object. cannam@86: cannam@86: This mode accepts the following additional options: cannam@86: cannam@86: -o OUTPUT-FILE set the output file name to OUTPUT-FILE cannam@86: -prefer-pic try to building PIC objects only cannam@86: -prefer-non-pic try to building non-PIC objects only cannam@86: -static always build a \`.o' file suitable for static linking cannam@86: cannam@86: COMPILE-COMMAND is a command to be used in creating a \`standard' object file cannam@86: from the given SOURCEFILE. cannam@86: cannam@86: The output file name is determined by removing the directory component from cannam@86: SOURCEFILE, then substituting the C source code suffix \`.c' with the cannam@86: library object suffix, \`.lo'." cannam@86: ;; cannam@86: cannam@86: execute) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... cannam@86: cannam@86: Automatically set library path, then run a program. cannam@86: cannam@86: This mode accepts the following additional options: cannam@86: cannam@86: -dlopen FILE add the directory containing FILE to the library path cannam@86: cannam@86: This mode sets the library path environment variable according to \`-dlopen' cannam@86: flags. cannam@86: cannam@86: If any of the ARGS are libtool executable wrappers, then they are translated cannam@86: into their corresponding uninstalled binary, and any of their required library cannam@86: directories are added to the library path. cannam@86: cannam@86: Then, COMMAND is executed, with ARGS as arguments." cannam@86: ;; cannam@86: cannam@86: finish) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... cannam@86: cannam@86: Complete the installation of libtool libraries. cannam@86: cannam@86: Each LIBDIR is a directory that contains libtool libraries. cannam@86: cannam@86: The commands that this mode executes may require superuser privileges. Use cannam@86: the \`--dry-run' option if you just want to see what would be executed." cannam@86: ;; cannam@86: cannam@86: install) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... cannam@86: cannam@86: Install executables or libraries. cannam@86: cannam@86: INSTALL-COMMAND is the installation command. The first component should be cannam@86: either the \`install' or \`cp' program. cannam@86: cannam@86: The rest of the components are interpreted as arguments to that command (only cannam@86: BSD-compatible install options are recognized)." cannam@86: ;; cannam@86: cannam@86: link) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... cannam@86: cannam@86: Link object files or libraries together to form another library, or to cannam@86: create an executable program. cannam@86: cannam@86: LINK-COMMAND is a command using the C compiler that you would use to create cannam@86: a program from several object files. cannam@86: cannam@86: The following components of LINK-COMMAND are treated specially: cannam@86: cannam@86: -all-static do not do any dynamic linking at all cannam@86: -avoid-version do not add a version suffix if possible cannam@86: -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime cannam@86: -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols cannam@86: -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) cannam@86: -export-symbols SYMFILE cannam@86: try to export only the symbols listed in SYMFILE cannam@86: -export-symbols-regex REGEX cannam@86: try to export only the symbols matching REGEX cannam@86: -LLIBDIR search LIBDIR for required installed libraries cannam@86: -lNAME OUTPUT-FILE requires the installed library libNAME cannam@86: -module build a library that can dlopened cannam@86: -no-fast-install disable the fast-install mode cannam@86: -no-install link a not-installable executable cannam@86: -no-undefined declare that a library does not refer to external symbols cannam@86: -o OUTPUT-FILE create OUTPUT-FILE from the specified objects cannam@86: -objectlist FILE Use a list of object files found in FILE to specify objects cannam@86: -precious-files-regex REGEX cannam@86: don't remove output files matching REGEX cannam@86: -release RELEASE specify package release information cannam@86: -rpath LIBDIR the created library will eventually be installed in LIBDIR cannam@86: -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries cannam@86: -static do not do any dynamic linking of libtool libraries cannam@86: -version-info CURRENT[:REVISION[:AGE]] cannam@86: specify library version info [each variable defaults to 0] cannam@86: cannam@86: All other options (arguments beginning with \`-') are ignored. cannam@86: cannam@86: Every other argument is treated as a filename. Files ending in \`.la' are cannam@86: treated as uninstalled libtool libraries, other files are standard or library cannam@86: object files. cannam@86: cannam@86: If the OUTPUT-FILE ends in \`.la', then a libtool library is created, cannam@86: only library objects (\`.lo' files) may be specified, and \`-rpath' is cannam@86: required, except when creating a convenience library. cannam@86: cannam@86: If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created cannam@86: using \`ar' and \`ranlib', or on Windows using \`lib'. cannam@86: cannam@86: If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file cannam@86: is created, otherwise an executable program is created." cannam@86: ;; cannam@86: cannam@86: uninstall) cannam@86: $echo \ cannam@86: "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... cannam@86: cannam@86: Remove libraries from an installation directory. cannam@86: cannam@86: RM is the name of the program to use to delete files associated with each FILE cannam@86: (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed cannam@86: to RM. cannam@86: cannam@86: If FILE is a libtool library, all the files associated with it are deleted. cannam@86: Otherwise, only FILE itself is deleted using RM." cannam@86: ;; cannam@86: cannam@86: *) cannam@86: $echo "$modename: invalid operation mode \`$mode'" 1>&2 cannam@86: $echo "$help" 1>&2 cannam@86: exit $EXIT_FAILURE cannam@86: ;; cannam@86: esac cannam@86: cannam@86: $echo cannam@86: $echo "Try \`$modename --help' for more information about other modes." cannam@86: cannam@86: exit $? cannam@86: cannam@86: # The TAGs below are defined such that we never get into a situation cannam@86: # in which we disable both kinds of libraries. Given conflicting cannam@86: # choices, we go for a static library, that is the most portable, cannam@86: # since we can't tell whether shared libraries were disabled because cannam@86: # the user asked for that or because the platform doesn't support cannam@86: # them. This is particularly important on AIX, because we don't cannam@86: # support having both static and shared libraries enabled at the same cannam@86: # time on that platform, so we default to a shared-only configuration. cannam@86: # If a disable-shared tag is given, we'll fallback to a static-only cannam@86: # configuration. But we'll never go from static-only to shared-only. cannam@86: cannam@86: # ### BEGIN LIBTOOL TAG CONFIG: disable-shared cannam@86: build_libtool_libs=no cannam@86: build_old_libs=yes cannam@86: # ### END LIBTOOL TAG CONFIG: disable-shared cannam@86: cannam@86: # ### BEGIN LIBTOOL TAG CONFIG: disable-static cannam@86: build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` cannam@86: # ### END LIBTOOL TAG CONFIG: disable-static cannam@86: cannam@86: # Local Variables: cannam@86: # mode:shell-script cannam@86: # sh-indentation:2 cannam@86: # End: