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