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