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