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