# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Check that we have a working $echo. if test "X$1" = X--no-reexec { # Discard the --no-reexec flag, and continue. shift } elif test "X$1" = X--fallback-echo { # Avoid inline document here, it may be left over : } elif test "X$(shell {$echo '\t'})" = 'X\t' { # Yippee, $echo works! : } else { # Restart under the correct shell, and then maybe $echo will work. exec $SHELL $0 --no-reexec ${1+"$@"} } if test "X$1" = X--fallback-echo { # used as fallback echo shift cat <<< """ $[join(ARGV)] """ exit 0 } # The name of this program. setvar progname = $($echo $0 | ${SED} 's%^.*/%%) setvar modename = "$progname" # Constants. setvar PROGRAM = 'ltmain.sh' setvar PACKAGE = 'libtool' setvar VERSION = '1.4.3' setvar TIMESTAMP = "" (1.922.2.111 2002/10/23 02:54:36)"" setvar default_mode = '' setvar help = ""Try \`$progname --help' for more information."" setvar magic = ""%%%MAGIC variable%%%"" setvar mkdir = ""mkdir"" setvar mv = ""mv -f"" setvar rm = ""rm -f"" # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. setvar Xsed = ""${SED}"' -e 1s/^X//"' setvar sed_quote_subst = ''s/\([\\`\\"$\\\\]\)/\\\1/g'' # test EBCDIC or ASCII case{ *[Cc]1* { # EBCDIC based system setvar SP2NL = ""tr '\100' '\n'"" setvar NL2SP = ""tr '\r\n' '\100\100'"" } * { # Assume ASCII based system setvar SP2NL = ""tr '\040' '\012'"" setvar NL2SP = ""tr '\015\012' '\040\040'"" } } # NLS nuisances. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. if test ${LC_ALL+set} = set { setvar save_LC_ALL = "$LC_ALL"; setvar LC_ALL = 'C'; export LC_ALL } if test ${LANG+set} = set { setvar save_LANG = "$LANG"; setvar LANG = 'C'; export LANG } # Make sure IFS has a sensible default : ${IFS=" "} if test $build_libtool_libs != yes && test $build_old_libs != yes { echo "$modename: not configured to build any kind of library" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 } # Global variables. setvar mode = "$default_mode" setvar nonopt = '' setvar prev = '' setvar prevopt = '' setvar run = '' setvar show = "$echo" setvar show_help = '' setvar execute_dlfiles = '' setvar lo2o = ""s/\\.lo\$/.${objext}/"" setvar o2lo = ""s/\\.${objext}\$/.lo/"" # Parse our command line options once, thoroughly. while test $# -gt 0 { setvar arg = "$1" shift case (arg) { -*=* { setvar optarg = $($echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//) } * { setvar optarg = '' } } # If the previous option needs an argument, assign it. if test -n $prev { case (prev) { execute_dlfiles { setvar execute_dlfiles = ""$execute_dlfiles $arg"" } * { eval "$prev=\$arg" } } setvar prev = '' setvar prevopt = '' continue } # Have we seen a non-optional argument yet? case (arg) { --help { setvar show_help = 'yes' } --version { echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" exit 0 } --config { ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 exit 0 } --debug { echo "$progname: enabling shell trace mode" set -x } --dry-run | -n { setvar run = ':' } --features { echo "host: $host" if test $build_libtool_libs = yes { echo "enable shared libraries" } else { echo "disable shared libraries" } if test $build_old_libs = yes { echo "enable static libraries" } else { echo "disable static libraries" } exit 0 } --finish { setvar mode = ""finish"" } --mode { setvar prevopt = ""--mode"," prev = 'mode' } --mode=* { setvar mode = "$optarg" } --preserve-dup-deps { setvar duplicate_deps = ""yes"" } --quiet | --silent { setvar show = ':' } -dlopen { setvar prevopt = ""-dlopen"" setvar prev = 'execute_dlfiles' } -* { $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo $help 1>&2 exit 1 } * { setvar nonopt = "$arg" break } } } if test -n $prevopt { $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo $help 1>&2 exit 1 } # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. setvar exec_cmd = '' if test -z $show_help { # Infer the operation mode. if test -z $mode { case (nonopt) { *cc | *++ | gcc* | *-gcc* | g++* | xlc* { setvar mode = 'link'for arg in @ARGV { case (arg) { -c { setvar mode = 'compile' break } } } } *db | *dbx | *strace | *truss { setvar mode = 'execute' } *install*|cp|mv { setvar mode = 'install' } *rm { setvar mode = 'uninstall' } * { # If we have no mode, but dlfiles were specified, then do execute mode. test -n $execute_dlfiles && setvar mode = 'execute' # Just use the default operation mode. if test -z $mode { if test -n $nonopt { $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 } else { $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 } } } } } # Only execute mode is allowed to have -dlopen flags. if test -n $execute_dlfiles && test $mode != execute { $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo $help 1>&2 exit 1 } # Change the help message to a mode-specific one. setvar generic_help = "$help" setvar help = ""Try \`$modename --help --mode=$mode' for more information."" # These modes are in order of execution frequency so that they run quickly. case (mode) { # libtool compile mode compile { setvar modename = ""$modename: compile"" # Get the compilation command and the source file. setvar base_compile = '' setvar prev = '' setvar lastarg = '' setvar srcfile = "$nonopt" setvar suppress_output = '' setvar user_target = 'no'for arg in @ARGV { case (prev) { "" { } xcompiler { # Aesthetically quote the previous argument. setvar prev = '' setvar lastarg = $($echo "X$arg" | $Xsed -e $sed_quote_subst) case (arg) { # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar arg = ""\"$arg"\"" } } # Add the previous argument to base_compile. if test -z $base_compile { setvar base_compile = "$lastarg" } else { setvar base_compile = ""$base_compile $lastarg"" } continue } } # Accept any command-line options. case (arg) { -o { if test $user_target != "no" { $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 } setvar user_target = 'next' } -static { setvar build_old_libs = 'yes' continue } -prefer-pic { setvar pic_mode = 'yes' continue } -prefer-non-pic { setvar pic_mode = 'no' continue } -Xcompiler { setvar prev = 'xcompiler' continue } -Wc,* { setvar args = $($echo "X$arg" | $Xsed -e "s/^-Wc,//) setvar lastarg = '' setvar save_ifs = "$IFS"; setvar IFS = '','' for arg in $args { setvar IFS = "$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar arg = ""\"$arg"\"" } } setvar lastarg = ""$lastarg $arg"" } setvar IFS = "$save_ifs" setvar lastarg = $($echo "X$lastarg" | $Xsed -e "s/^ //) # Add the arguments to base_compile. if test -z $base_compile { setvar base_compile = "$lastarg" } else { setvar base_compile = ""$base_compile $lastarg"" } continue } } case (user_target) { next { # The next one is the -o target name setvar user_target = 'yes' continue } yes { # We got the output file setvar user_target = 'set' setvar libobj = "$arg" continue } } # Accept the current argument as the source file. setvar lastarg = "$srcfile" setvar srcfile = "$arg" # Aesthetically quote the previous argument. # Backslashify any backslashes, double quotes, and dollar signs. # These are the only characters that are still specially # interpreted inside of double-quoted scrings. setvar lastarg = $($echo "X$lastarg" | $Xsed -e $sed_quote_subst) # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case (lastarg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar lastarg = ""\"$lastarg"\"" } } # Add the previous argument to base_compile. if test -z $base_compile { setvar base_compile = "$lastarg" } else { setvar base_compile = ""$base_compile $lastarg"" } } case (user_target) { set { } no { # Get the name of the library object. setvar libobj = $($echo "X$srcfile" | $Xsed -e 's%^.*/%%) } * { $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 } } # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo setvar xform = ''[cCFSfmso]'' case (libobj) { *.ada { setvar xform = 'ada' } *.adb { setvar xform = 'adb' } *.ads { setvar xform = 'ads' } *.asm { setvar xform = 'asm' } *.c++ { setvar xform = "c++" } *.cc { setvar xform = 'cc' } *.cpp { setvar xform = 'cpp' } *.cxx { setvar xform = 'cxx' } *.f90 { setvar xform = 'f90' } *.for { setvar xform = 'for' } } setvar libobj = $($echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/) case (libobj) { *.lo { setvar obj = $($echo "X$libobj" | $Xsed -e $lo2o) } * { $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit 1 } } if test -z $base_compile { $echo "$modename: you must specify a compilation command" 1>&2 $echo $help 1>&2 exit 1 } # Delete any leftover library objects. if test $build_old_libs = yes { setvar removelist = ""$obj $libobj"" } else { setvar removelist = "$libobj" } $run $rm $removelist trap "$run $rm $removelist; exit 1" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case (host_os) { cygwin* | mingw* | pw32* | os2* { setvar pic_mode = 'default' } } if test $pic_mode = no && test $deplibs_check_method != pass_all { # non-PIC code in shared libraries is not supported setvar pic_mode = 'default' } # Calculate the filename of the output object if compiler does # not support -o with -c if test $compiler_c_o = no { setvar output_obj = "$($echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%).${objext}" setvar lockfile = ""$output_obj.lock"" setvar removelist = ""$removelist $output_obj $lockfile"" trap "$run $rm $removelist; exit 1" 1 2 15 } else { setvar need_locks = 'no' setvar lockfile = '' } # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test $need_locks = yes { while ! $run ln $0 $lockfile { $show "Waiting for $lockfile to be removed" sleep 2 } } elif test $need_locks = warn { if test -f $lockfile { echo "\ *** ERROR, $lockfile exists and contains: $(cat $lockfile ) This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 } echo $srcfile > "$lockfile" } if test -n $fix_srcfile_path { eval srcfile='"'$fix_srcfile_path'"' } # Only build a PIC object if we are building libtool libraries. if test $build_libtool_libs = yes { # Without this assignment, base_compile gets emptied. setvar fbsd_hideous_sh_bug = "$base_compile" if test $pic_mode != no { # All platforms use -DPIC, to notify preprocessed assembler code. setvar command = ""$base_compile $srcfile $pic_flag -DPIC"" } else { # Don't build PIC code setvar command = ""$base_compile $srcfile"" } if test $build_old_libs = yes { setvar lo_libobj = "$libobj" setvar dir = $($echo "X$libobj" | $Xsed -e 's%/[^/]*$%%) if test "X$dir" = "X$libobj" { setvar dir = "$objdir" } else { setvar dir = ""$dir/$objdir"" } setvar libobj = ""$dir/"$($echo "X$libobj" | $Xsed -e 's%^.*/%%)" if test -d $dir { $show "$rm $libobj" $run $rm $libobj } else { $show "$mkdir $dir" $run $mkdir $dir setvar status = ""$? if test $status -ne 0 && test ! -d $dir { exit $status } } } if test $compiler_o_lo = yes { setvar output_obj = "$libobj" setvar command = ""$command -o $output_obj"" } elif test $compiler_c_o = yes { setvar output_obj = "$obj" setvar command = ""$command -o $output_obj"" } $run $rm $output_obj $show $command if $run eval $command { : } else { test -n $output_obj && $run $rm $removelist exit 1 } if test $need_locks = warn && test x"$(cat $lockfile )" != x"$srcfile" { echo "\ *** ERROR, $lockfile contains: $(cat $lockfile ) but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 } # Just move the object if needed, then go on to compile the next one if test x"$output_obj" != x"$libobj" { $show "$mv $output_obj $libobj" if $run $mv $output_obj $libobj { : } else { setvar error = ""$? $run $rm $removelist exit $error } } # If we have no pic_flag, then copy the object into place and finish. if shell {test -z $pic_flag || test $pic_mode != default} && test $build_old_libs = yes { # Rename the .lo from within objdir to obj if test -f $obj { $show $rm $obj $run $rm $obj } $show "$mv $libobj $obj" if $run $mv $libobj $obj { : } else { setvar error = ""$? $run $rm $removelist exit $error } setvar xdir = $($echo "X$obj" | $Xsed -e 's%/[^/]*$%%) if test "X$xdir" = "X$obj" { setvar xdir = ""."" } else { setvar xdir = "$xdir" } setvar baseobj = $($echo "X$obj" | $Xsed -e "s%.*/%%) setvar libobj = $($echo "X$baseobj" | $Xsed -e $o2lo) # Now arrange that obj and lo_libobj become the same file $show "(cd $xdir && $LN_S $baseobj $libobj)" if $run eval '(cd $xdir && $LN_S $baseobj $libobj)' { # Unlock the critical section if it was locked if test $need_locks != no { $run $rm $lockfile } exit 0 } else { setvar error = ""$? $run $rm $removelist exit $error } } # Allow error messages only from the first compilation. setvar suppress_output = '' >/dev/null 2>&1'' } # Only build a position-dependent object if we build old libraries. if test $build_old_libs = yes { if test $pic_mode != yes { # Don't build PIC code setvar command = ""$base_compile $srcfile"" } else { # All platforms use -DPIC, to notify preprocessed assembler code. setvar command = ""$base_compile $srcfile $pic_flag -DPIC"" } if test $compiler_c_o = yes { setvar command = ""$command -o $obj"" setvar output_obj = "$obj" } # Suppress compiler output if we already did a PIC compilation. setvar command = ""$command$suppress_output"" $run $rm $output_obj $show $command if $run eval $command { : } else { $run $rm $removelist exit 1 } if test $need_locks = warn && test x"$(cat $lockfile )" != x"$srcfile" { echo "\ *** ERROR, $lockfile contains: $(cat $lockfile ) but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit 1 } # Just move the object if needed if test x"$output_obj" != x"$obj" { $show "$mv $output_obj $obj" if $run $mv $output_obj $obj { : } else { setvar error = ""$? $run $rm $removelist exit $error } } # Create an invalid libtool object if no PIC, so that we do not # accidentally link it into a program. if test $build_libtool_libs != yes { $show "echo timestamp > $libobj" $run eval "echo timestamp > \$libobj" || exit $? } else { # Move the .lo from within objdir $show "$mv $libobj $lo_libobj" if $run $mv $libobj $lo_libobj { : } else { setvar error = ""$? $run $rm $removelist exit $error } } } # Unlock the critical section if it was locked if test $need_locks != no { $run $rm $lockfile } exit 0 } # libtool link mode link | relink { setvar modename = ""$modename: link"" case (host) { *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* { # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invokation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. setvar allow_undefined = 'yes' } * { setvar allow_undefined = 'yes' } } setvar libtool_args = "$nonopt" setvar compile_command = "$nonopt" setvar finalize_command = "$nonopt" setvar compile_rpath = '' setvar finalize_rpath = '' setvar compile_shlibpath = '' setvar finalize_shlibpath = '' setvar convenience = '' setvar old_convenience = '' setvar deplibs = '' setvar old_deplibs = '' setvar compiler_flags = '' setvar linker_flags = '' setvar dllsearchpath = '' setvar lib_search_path = $(pwd) setvar inst_prefix_dir = '' setvar avoid_version = 'no' setvar dlfiles = '' setvar dlprefiles = '' setvar dlself = 'no' setvar export_dynamic = 'no' setvar export_symbols = '' setvar export_symbols_regex = '' setvar generated = '' setvar libobjs = '' setvar ltlibs = '' setvar module = 'no' setvar no_install = 'no' setvar objs = '' setvar prefer_static_libs = 'no' setvar preload = 'no' setvar prev = '' setvar prevarg = '' setvar release = '' setvar rpath = '' setvar xrpath = '' setvar perm_rpath = '' setvar temp_rpath = '' setvar thread_safe = 'no' setvar vinfo = ''for arg in @ARGV { case (arg) { -all-static | -static { if test "X$arg" = "X-all-static" { if test $build_libtool_libs = yes && test -z $link_static_flag { $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 } if test -n $link_static_flag { setvar dlopen_self = "$dlopen_self_static" } } else { if test -z $pic_flag && test -n $link_static_flag { setvar dlopen_self = "$dlopen_self_static" } } setvar build_libtool_libs = 'no' setvar build_old_libs = 'yes' setvar prefer_static_libs = 'yes' break } } } # See if our shared archives depend on static archives. test -n $old_archive_from_new_cmds && setvar build_old_libs = 'yes' # Go through the arguments, transforming them on the way. while test $Argc -gt 0 { setvar arg = "$1" shift case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar qarg = "'"'$($echo "X$arg" | $Xsed -e $sed_quote_subst)'"'" ### testsuite: skip nested quoting test } * { setvar qarg = "$arg" } } setvar libtool_args = ""$libtool_args $qarg"" # If the previous option needs an argument, assign it. if test -n $prev { case (prev) { output { setvar compile_command = ""$compile_command @OUTPUT@"" setvar finalize_command = ""$finalize_command @OUTPUT@"" } } case (prev) { dlfiles|dlprefiles { if test $preload = no { # Add the symbol object into the linking commands. setvar compile_command = ""$compile_command @SYMFILE@"" setvar finalize_command = ""$finalize_command @SYMFILE@"" setvar preload = 'yes' } case (arg) { *.la | *.lo { } # We handle these cases below. force { if test $dlself = no { setvar dlself = 'needless' setvar export_dynamic = 'yes' } setvar prev = '' continue } self { if test $prev = dlprefiles { setvar dlself = 'yes' } elif test $prev = dlfiles && test $dlopen_self != yes { setvar dlself = 'yes' } else { setvar dlself = 'needless' setvar export_dynamic = 'yes' } setvar prev = '' continue } * { if test $prev = dlfiles { setvar dlfiles = ""$dlfiles $arg"" } else { setvar dlprefiles = ""$dlprefiles $arg"" } setvar prev = '' continue } } } expsyms { setvar export_symbols = "$arg" if test ! -f $arg { $echo "$modename: symbol file \`$arg' does not exist" exit 1 } setvar prev = '' continue } expsyms_regex { setvar export_symbols_regex = "$arg" setvar prev = '' continue } inst_prefix { setvar inst_prefix_dir = "$arg" setvar prev = '' continue } release { setvar release = ""-$arg"" setvar prev = '' continue } rpath | xrpath { # We need an absolute path. case (arg) { [\\/]* | [A-Za-z]:[\\/]* { } * { $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 } } if test $prev = rpath { case{ *" $arg "* { } * { setvar rpath = ""$rpath $arg"" } } } else { case{ *" $arg "* { } * { setvar xrpath = ""$xrpath $arg"" } } } setvar prev = '' continue } xcompiler { setvar compiler_flags = ""$compiler_flags $qarg"" setvar prev = '' setvar compile_command = ""$compile_command $qarg"" setvar finalize_command = ""$finalize_command $qarg"" continue } xlinker { setvar linker_flags = ""$linker_flags $qarg"" setvar compiler_flags = ""$compiler_flags $wl$qarg"" setvar prev = '' setvar compile_command = ""$compile_command $wl$qarg"" setvar finalize_command = ""$finalize_command $wl$qarg"" continue } * { eval "$prev=\"\$arg\"" setvar prev = '' continue } } } # test -n $prev setvar prevarg = "$arg" case (arg) { -all-static { if test -n $link_static_flag { setvar compile_command = ""$compile_command $link_static_flag"" setvar finalize_command = ""$finalize_command $link_static_flag"" } continue } -allow-undefined { # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue } -avoid-version { setvar avoid_version = 'yes' continue } -dlopen { setvar prev = 'dlfiles' continue } -dlpreopen { setvar prev = 'dlprefiles' continue } -export-dynamic { setvar export_dynamic = 'yes' continue } -export-symbols | -export-symbols-regex { if test -n $export_symbols || test -n $export_symbols_regex { $echo "$modename: more than one -exported-symbols argument is not allowed" exit 1 } if test "X$arg" = "X-export-symbols" { setvar prev = 'expsyms' } else { setvar prev = 'expsyms_regex' } continue } -inst-prefix-dir { setvar prev = 'inst_prefix' continue } # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:* { case (with_gcc) { no/*-*-irix* | no/*-*-nonstopux* { setvar compile_command = ""$compile_command $arg"" setvar finalize_command = ""$finalize_command $arg"" } } continue } -L* { setvar dir = $($echo "X$arg" | $Xsed -e 's/^-L//) # We need an absolute path. case (dir) { [\\/]* | [A-Za-z]:[\\/]* { } * { setvar absdir = $(cd $dir && pwd) if test -z $absdir { $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 } setvar dir = "$absdir" } } case{ *" -L$dir "* { } * { setvar deplibs = ""$deplibs -L$dir"" setvar lib_search_path = ""$lib_search_path $dir"" } } case (host) { *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* { case{ *":$dir:"* { } * { setvar dllsearchpath = ""$dllsearchpath:$dir""} } } } continue } -l* { if test "X$arg" = "X-lc" || test "X$arg" = "X-lm" { case (host) { *-*-cygwin* | *-*-pw32* | *-*-beos* { # These systems don't actually have a C or math library (as such) continue } *-*-mingw* | *-*-os2* { # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue } *-*-openbsd* | *-*-freebsd* { # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue } } } elif test "X$arg" = "X-lc_r" { case (host) { *-*-openbsd* | *-*-freebsd* { # Do not include libc_r directly, use -pthread flag. continue } } } setvar deplibs = ""$deplibs $arg"" continue } -module { setvar module = 'yes' continue } -no-fast-install { setvar fast_install = 'no' continue } -no-install { case (host) { *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* { # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 setvar fast_install = 'no' } * { setvar no_install = 'yes' } } continue } -no-undefined { setvar allow_undefined = 'no' continue } -o { setvar prev = 'output' } -release { setvar prev = 'release' continue } -rpath { setvar prev = 'rpath' continue } -R { setvar prev = 'xrpath' continue } -R* { setvar dir = $($echo "X$arg" | $Xsed -e 's/^-R//) # We need an absolute path. case (dir) { [\\/]* | [A-Za-z]:[\\/]* { } * { $echo "$modename: only absolute run-paths are allowed" 1>&2 exit 1 } } case{ *" $dir "* { } * { setvar xrpath = ""$xrpath $dir"" } } continue } -static { # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue } -thread-safe { setvar thread_safe = 'yes' continue } -version-info { setvar prev = 'vinfo' continue } -Wc,* { setvar args = $($echo "X$arg" | $Xsed -e $sed_quote_subst -e 's/^-Wc,//) setvar arg = '' setvar save_ifs = "$IFS"; setvar IFS = '','' for flag in $args { setvar IFS = "$save_ifs" case (flag) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar flag = ""\"$flag"\"" } } setvar arg = ""$arg $wl$flag"" setvar compiler_flags = ""$compiler_flags $flag"" } setvar IFS = "$save_ifs" setvar arg = $($echo "X$arg" | $Xsed -e "s/^ //) } -Wl,* { setvar args = $($echo "X$arg" | $Xsed -e $sed_quote_subst -e 's/^-Wl,//) setvar arg = '' setvar save_ifs = "$IFS"; setvar IFS = '','' for flag in $args { setvar IFS = "$save_ifs" case (flag) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar flag = ""\"$flag"\"" } } setvar arg = ""$arg $wl$flag"" setvar compiler_flags = ""$compiler_flags $wl$flag"" setvar linker_flags = ""$linker_flags $flag"" } setvar IFS = "$save_ifs" setvar arg = $($echo "X$arg" | $Xsed -e "s/^ //) } -Xcompiler { setvar prev = 'xcompiler' continue } -Xlinker { setvar prev = 'xlinker' continue } # Some other compiler flag. -* | +* { # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. setvar arg = $($echo "X$arg" | $Xsed -e $sed_quote_subst) case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar arg = ""\"$arg"\"" } } } *.lo | *.$objext { # A library or standard object. if test $prev = dlfiles { # This file was specified with -dlopen. if test $build_libtool_libs = yes && test $dlopen_support = yes { setvar dlfiles = ""$dlfiles $arg"" setvar prev = '' continue } else { # If libtool objects are unsupported, then we need to preload. setvar prev = 'dlprefiles' } } if test $prev = dlprefiles { # Preload the old-style object. setvar dlprefiles = ""$dlprefiles "$($echo "X$arg" | $Xsed -e $lo2o)" setvar prev = '' } else { case (arg) { *.lo { setvar libobjs = ""$libobjs $arg"" } * { setvar objs = ""$objs $arg"" } } } } *.$libext { # An archive. setvar deplibs = ""$deplibs $arg"" setvar old_deplibs = ""$old_deplibs $arg"" continue } *.la { # A libtool-controlled library. if test $prev = dlfiles { # This library was specified with -dlopen. setvar dlfiles = ""$dlfiles $arg"" setvar prev = '' } elif test $prev = dlprefiles { # The library was specified with -dlpreopen. setvar dlprefiles = ""$dlprefiles $arg"" setvar prev = '' } else { setvar deplibs = ""$deplibs $arg"" } continue } # Some other compiler argument. * { # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. setvar arg = $($echo "X$arg" | $Xsed -e $sed_quote_subst) case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"" { setvar arg = ""\"$arg"\"" } } } } # arg # Now actually substitute the argument into the commands. if test -n $arg { setvar compile_command = ""$compile_command $arg"" setvar finalize_command = ""$finalize_command $arg"" } } # argument parsing loop if test -n $prev { $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo $help 1>&2 exit 1 } if test $export_dynamic = yes && test -n $export_dynamic_flag_spec { eval arg='"'$export_dynamic_flag_spec'"' setvar compile_command = ""$compile_command $arg"" setvar finalize_command = ""$finalize_command $arg"" } # calculate the name of the file, without its directory setvar outputname = $($echo "X$output" | $Xsed -e 's%^.*/%%) setvar libobjs_save = "$libobjs" if test -n $shlibpath_var { # get the directories listed in $shlibpath_var eval shlib_search_path='`''$'echo '"'X'$'{$shlibpath_var}'"' '|' '$'Xsed -e '''s/:/ /g''''`' } else { setvar shlib_search_path = '' } eval sys_lib_search_path='"'$sys_lib_search_path_spec'"' eval sys_lib_dlsearch_path='"'$sys_lib_dlsearch_path_spec'"' setvar output_objdir = $($echo "X$output" | $Xsed -e 's%/[^/]*$%%) if test "X$output_objdir" = "X$output" { setvar output_objdir = "$objdir" } else { setvar output_objdir = ""$output_objdir/$objdir"" } # Create the object directory. if test ! -d $output_objdir { $show "$mkdir $output_objdir" $run $mkdir $output_objdir setvar status = ""$? if test $status -ne 0 && test ! -d $output_objdir { exit $status } } # Determine the type of output case (output) { "" { $echo "$modename: you must specify an output file" 1>&2 $echo $help 1>&2 exit 1 } *.$libext { setvar linkmode = 'oldlib' } *.lo | *.$objext { setvar linkmode = 'obj' } *.la { setvar linkmode = 'lib' } * { setvar linkmode = 'prog' } # Anything else should be a program. } setvar specialdeplibs = '' setvar libs = '' # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs { if test "X$duplicate_deps" = "Xyes" { case{ *" $deplib "* { setvar specialdeplibs = ""$specialdeplibs $deplib"" } } } setvar libs = ""$libs $deplib"" } setvar deplibs = '' setvar newdependency_libs = '' setvar newlib_search_path = '' setvar need_relink = 'no' # whether we're linking any uninstalled libtool libraries setvar notinst_deplibs = '' # not-installed libtool libraries setvar notinst_path = '' # paths that contain not-installed libtool libraries case (linkmode) { lib { setvar passes = ""conv link"" for file in $dlfiles $dlprefiles { case (file) { *.la { } * { $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 } } } } prog { setvar compile_deplibs = '' setvar finalize_deplibs = '' setvar alldeplibs = 'no' setvar newdlfiles = '' setvar newdlprefiles = '' setvar passes = ""conv scan dlopen dlpreopen link"" } * { setvar passes = ""conv"" } } for pass in $passes { if test $linkmode = prog { # Determine which files to process case (pass) { dlopen { setvar libs = "$dlfiles" setvar save_deplibs = "$deplibs" # Collect dlpreopened libraries setvar deplibs = '' } dlpreopen { setvar libs = "$dlprefiles" } link { setvar libs = ""$deplibs %DEPLIBS% $dependency_libs"" } } } for deplib in $libs { setvar lib = '' setvar found = 'no' case (deplib) { -l* { if test $linkmode = oldlib && test $linkmode = obj { $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue } if test $pass = conv { setvar deplibs = ""$deplib $deplibs"" continue } setvar name = $($echo "X$deplib" | $Xsed -e 's/^-l//) for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path { # Search the libtool library setvar lib = ""$searchdir/lib${name}.la"" if test -f $lib { setvar found = 'yes' break } } if test $found != yes { # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link" { setvar compile_deplibs = ""$deplib $compile_deplibs"" setvar finalize_deplibs = ""$deplib $finalize_deplibs"" } else { setvar deplibs = ""$deplib $deplibs"" test $linkmode = lib && setvar newdependency_libs = ""$deplib $newdependency_libs"" } continue } } # -l -L* { case (linkmode) { lib { setvar deplibs = ""$deplib $deplibs"" test $pass = conv && continue setvar newdependency_libs = ""$deplib $newdependency_libs"" setvar newlib_search_path = ""$newlib_search_path "$($echo "X$deplib" | $Xsed -e 's/^-L//)" } prog { if test $pass = conv { setvar deplibs = ""$deplib $deplibs"" continue } if test $pass = scan { setvar deplibs = ""$deplib $deplibs"" setvar newlib_search_path = ""$newlib_search_path "$($echo "X$deplib" | $Xsed -e 's/^-L//)" } else { setvar compile_deplibs = ""$deplib $compile_deplibs"" setvar finalize_deplibs = ""$deplib $finalize_deplibs"" } } * { $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 } } # linkmode continue } # -L -R* { if test $pass = link { setvar dir = $($echo "X$deplib" | $Xsed -e 's/^-R//) # Make sure the xrpath contains only unique directories. case{ *" $dir "* { } * { setvar xrpath = ""$xrpath $dir"" } } } setvar deplibs = ""$deplib $deplibs"" continue } *.la { setvar lib = "$deplib" } *.$libext { if test $pass = conv { setvar deplibs = ""$deplib $deplibs"" continue } case (linkmode) { lib { if test $deplibs_check_method != pass_all { echo echo "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not used here." } else { echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" setvar deplibs = ""$deplib $deplibs"" } continue } prog { if test $pass != link { setvar deplibs = ""$deplib $deplibs"" } else { setvar compile_deplibs = ""$deplib $compile_deplibs"" setvar finalize_deplibs = ""$deplib $finalize_deplibs"" } continue } } # linkmode } # *.$libext *.lo | *.$objext { if test $pass = dlpreopen || test $dlopen_support != yes || test $build_libtool_libs = no { # If there is no dlopen support or we're linking statically, # we need to preload. setvar newdlprefiles = ""$newdlprefiles $deplib"" setvar compile_deplibs = ""$deplib $compile_deplibs"" setvar finalize_deplibs = ""$deplib $finalize_deplibs"" } else { setvar newdlfiles = ""$newdlfiles $deplib"" } continue } %DEPLIBS% { setvar alldeplibs = 'yes' continue } } # case $deplib if test $found = yes || test -f $lib { : } else { $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 } # Check to see that this really is a libtool archive. if shell {${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE"} >/dev/null 2>&1 { : } else { $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 } setvar ladir = $($echo "X$lib" | $Xsed -e 's%/[^/]*$%%) test "X$ladir" = "X$lib" && setvar ladir = ""."" setvar dlname = '' setvar dlopen = '' setvar dlpreopen = '' setvar libdir = '' setvar library_names = '' setvar old_library = '' # If the library was installed with an old release of libtool, # it will not redefine variable installed. setvar installed = 'yes' # Read the .la file case (lib) { */* | *\\* { source $lib } * { source ./$lib } } if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || do { test $linkmode = oldlib && test $linkmode = obj; } { # Add dl[pre]opened files of deplib test -n $dlopen && setvar dlfiles = ""$dlfiles $dlopen"" test -n $dlpreopen && setvar dlprefiles = ""$dlprefiles $dlpreopen"" } if test $pass = conv { # Only check for convenience libraries setvar deplibs = ""$lib $deplibs"" if test -z $libdir { if test -z $old_library { $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 } # It is a libtool convenience library, so add in its objects. setvar convenience = ""$convenience $ladir/$objdir/$old_library"" setvar old_convenience = ""$old_convenience $ladir/$objdir/$old_library"" setvar tmp_libs = '' for deplib in $dependency_libs { setvar deplibs = ""$deplib $deplibs"" if test "X$duplicate_deps" = "Xyes" { case{ *" $deplib "* { setvar specialdeplibs = ""$specialdeplibs $deplib"" } } } setvar tmp_libs = ""$tmp_libs $deplib"" } } elif test $linkmode != prog && test $linkmode != lib { $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 } continue } # $pass = conv # Get the name of the library we link against. setvar linklib = '' for l in $old_library $library_names { setvar linklib = "$l" } if test -z $linklib { $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 } # This library was specified with -dlopen. if test $pass = dlopen { if test -z $libdir { $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 } if test -z $dlname || test $dlopen_support != yes || test $build_libtool_libs = no { # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. setvar dlprefiles = ""$dlprefiles $lib"" } else { setvar newdlfiles = ""$newdlfiles $lib"" } continue } # $pass = dlopen # We need an absolute path. case (ladir) { [\\/]* | [A-Za-z]:[\\/]* { setvar abs_ladir = "$ladir" } * { setvar abs_ladir = $(cd $ladir && pwd) if test -z $abs_ladir { $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 setvar abs_ladir = "$ladir" } } } setvar laname = $($echo "X$lib" | $Xsed -e 's%^.*/%%) # Find the relevant object directory and library name. if test "X$installed" = Xyes { if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib" { $echo "$modename: warning: library \`$lib' was moved." 1>&2 setvar dir = "$ladir" setvar absdir = "$abs_ladir" setvar libdir = "$abs_ladir" } else { setvar dir = "$libdir" setvar absdir = "$libdir" } } else { setvar dir = ""$ladir/$objdir"" setvar absdir = ""$abs_ladir/$objdir"" # Remove this search path later setvar notinst_path = ""$notinst_path $abs_ladir"" } # $installed = yes setvar name = $($echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//) # This library was specified with -dlpreopen. if test $pass = dlpreopen { if test -z $libdir { $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 } # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n $old_library { setvar newdlprefiles = ""$newdlprefiles $dir/$old_library"" # Otherwise, use the dlname, so that lt_dlopen finds it. } elif test -n $dlname { setvar newdlprefiles = ""$newdlprefiles $dir/$dlname"" } else { setvar newdlprefiles = ""$newdlprefiles $dir/$linklib"" } } # $pass = dlpreopen if test -z $libdir { # Link the convenience library if test $linkmode = lib { setvar deplibs = ""$dir/$old_library $deplibs"" } elif test "$linkmode,$pass" = "prog,link" { setvar compile_deplibs = ""$dir/$old_library $compile_deplibs"" setvar finalize_deplibs = ""$dir/$old_library $finalize_deplibs"" } else { setvar deplibs = ""$lib $deplibs"" } continue } if test $linkmode = prog && test $pass != link { setvar newlib_search_path = ""$newlib_search_path $ladir"" setvar deplibs = ""$lib $deplibs"" setvar linkalldeplibs = 'no' if test $link_all_deplibs != no || test -z $library_names || test $build_libtool_libs = no { setvar linkalldeplibs = 'yes' } setvar tmp_libs = '' for deplib in $dependency_libs { case (deplib) { -L* { setvar newlib_search_path = ""$newlib_search_path "$($echo "X$deplib" | $Xsed -e 's/^-L//)"} ### testsuite: skip nested quoting test } # Need to link against all dependency_libs? if test $linkalldeplibs = yes { setvar deplibs = ""$deplib $deplibs"" } else { # Need to hardcode shared library paths # or/and link against static libraries setvar newdependency_libs = ""$deplib $newdependency_libs"" } if test "X$duplicate_deps" = "Xyes" { case{ *" $deplib "* { setvar specialdeplibs = ""$specialdeplibs $deplib"" } } } setvar tmp_libs = ""$tmp_libs $deplib"" } # for deplib continue } # $linkmode = prog... setvar link_static = 'no' # Whether the deplib will be linked statically if test -n $library_names && do { test $prefer_static_libs = no || test -z $old_library; } { # Link against this shared library if test "$linkmode,$pass" = "prog,link" || do { test $linkmode = lib && test $hardcode_into_libs = yes; } { # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case{ *" $absdir "* { } * { case{ *" $absdir "* { } * { setvar compile_rpath = ""$compile_rpath $absdir"" } } } } case{ *" $libdir "* { } * { case{ *" $libdir "* { } * { setvar finalize_rpath = ""$finalize_rpath $libdir"" } } } } if test $linkmode = prog { # We need to hardcode the library path if test -n $shlibpath_var { # Make sure the rpath contains only unique directories. case{ *" $dir "* { } *" $absdir "* { } * { setvar temp_rpath = ""$temp_rpath $dir"" } } } } } # $linkmode,$pass = prog,link... if test $alldeplibs = yes && do { test $deplibs_check_method = pass_all || do { test $build_libtool_libs = yes && test -n $library_names; }; } { # We only need to search for static libraries continue } if test $installed = no { setvar notinst_deplibs = ""$notinst_deplibs $lib"" setvar need_relink = 'yes' } if test -n $old_archive_from_expsyms_cmds { # figure out the soname set dummy $library_names setvar realname = "$2" shift; shift setvar libname = $(eval '\'$echo '"'$libname_spec'"') # use dlname if we got it. it's perfectly good, no? if test -n $dlname { setvar soname = "$dlname" } elif test -n $soname_spec { # bleh windows case (host) { *cygwin* { setvar major = $(expr $current - $age) setvar versuffix = ""-$major"" } } eval soname='"'$soname_spec'"' } else { setvar soname = "$realname" } # Make a new name for the extract_expsyms_cmds to use setvar soroot = "$soname" setvar soname = $(echo $soroot | ${SED} -e 's/^.*\///) setvar newlib = ""libimp-$(echo $soname | ${SED} 's/^lib//;s/\.dll$//).a"" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def" { : } else { $show "extracting exported symbol list from \`$soname'" setvar save_ifs = "$IFS"; setvar IFS = ''~'' eval cmds='"'$extract_expsyms_cmds'"' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" } # Create $newlib if test -f "$output_objdir/$newlib" { :; } else { $show "generating import library for \`$soname'" setvar save_ifs = "$IFS"; setvar IFS = ''~'' eval cmds='"'$old_archive_from_expsyms_cmds'"' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" } # make sure the library variables are pointing to the new library setvar dir = "$output_objdir" setvar linklib = "$newlib" } # test -n $old_archive_from_expsyms_cmds if test $linkmode = prog || test $mode != relink { setvar add_shlibpath = '' setvar add_dir = '' setvar add = '' setvar lib_linked = 'yes' case (hardcode_action) { immediate | unsupported { if test $hardcode_direct = no { setvar add = ""$dir/$linklib"" } elif test $hardcode_minus_L = no { case (host) { *-*-sunos* { setvar add_shlibpath = "$dir" } } setvar add_dir = ""-L$dir"" setvar add = ""-l$name"" } elif test $hardcode_shlibpath_var = no { setvar add_shlibpath = "$dir" setvar add = ""-l$name"" } else { setvar lib_linked = 'no' } } relink { if test $hardcode_direct = yes { setvar add = ""$dir/$linklib"" } elif test $hardcode_minus_L = yes { setvar add_dir = ""-L$dir"" # Try looking first in the location we're being installed to. if test -n $inst_prefix_dir { case (libdir) { [\/]* { setvar add_dir = ""-L$inst_prefix_dir$libdir $add_dir"" } } } setvar add = ""-l$name"" } elif test $hardcode_shlibpath_var = yes { setvar add_shlibpath = "$dir" setvar add = ""-l$name"" } else { setvar lib_linked = 'no' } } * { setvar lib_linked = 'no' } } if test $lib_linked != yes { $echo "$modename: configuration error: unsupported hardcode properties" exit 1 } if test -n $add_shlibpath { case{ *":$add_shlibpath:"* { } * { setvar compile_shlibpath = ""$compile_shlibpath$add_shlibpath:"" } } } if test $linkmode = prog { test -n $add_dir && setvar compile_deplibs = ""$add_dir $compile_deplibs"" test -n $add && setvar compile_deplibs = ""$add $compile_deplibs"" } else { test -n $add_dir && setvar deplibs = ""$add_dir $deplibs"" test -n $add && setvar deplibs = ""$add $deplibs"" if test $hardcode_direct != yes && \ test $hardcode_minus_L != yes && \ test $hardcode_shlibpath_var = yes { case{ *":$libdir:"* { } * { setvar finalize_shlibpath = ""$finalize_shlibpath$libdir:"" } } } } } if test $linkmode = prog || test $mode = relink { setvar add_shlibpath = '' setvar add_dir = '' setvar add = '' # Finalize command for both is simple: just hardcode it. if test $hardcode_direct = yes { setvar add = ""$libdir/$linklib"" } elif test $hardcode_minus_L = yes { setvar add_dir = ""-L$libdir"" setvar add = ""-l$name"" } elif test $hardcode_shlibpath_var = yes { case{ *":$libdir:"* { } * { setvar finalize_shlibpath = ""$finalize_shlibpath$libdir:"" } } setvar add = ""-l$name"" } else { # We cannot seem to hardcode it, guess we'll fake it. setvar add_dir = ""-L$libdir"" # Try looking first in the location we're being installed to. if test -n $inst_prefix_dir { case (libdir) { [\/]* { setvar add_dir = ""-L$inst_prefix_dir$libdir $add_dir"" } } } setvar add = ""-l$name"" } if test $linkmode = prog { test -n $add_dir && setvar finalize_deplibs = ""$add_dir $finalize_deplibs"" test -n $add && setvar finalize_deplibs = ""$add $finalize_deplibs"" } else { test -n $add_dir && setvar deplibs = ""$add_dir $deplibs"" test -n $add && setvar deplibs = ""$add $deplibs"" } } } elif test $linkmode = prog { if test $alldeplibs = yes && do { test $deplibs_check_method = pass_all || do { test $build_libtool_libs = yes && test -n $library_names; }; } { # We only need to search for static libraries continue } # Try to link the static library # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test $hardcode_direct != unsupported { test -n $old_library && setvar linklib = "$old_library" setvar compile_deplibs = ""$dir/$linklib $compile_deplibs"" setvar finalize_deplibs = ""$dir/$linklib $finalize_deplibs"" } else { setvar compile_deplibs = ""-l$name -L$dir $compile_deplibs"" setvar finalize_deplibs = ""-l$name -L$dir $finalize_deplibs"" } } elif test $build_libtool_libs = yes { # Not a shared library if test $deplibs_check_method != pass_all { # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test $module = yes { echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z $global_symbol_pipe { echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." } if test $build_old_libs = no { setvar build_libtool_libs = 'module' setvar build_old_libs = 'yes' } else { setvar build_libtool_libs = 'no' } } } else { setvar convenience = ""$convenience $dir/$old_library"" setvar old_convenience = ""$old_convenience $dir/$old_library"" setvar deplibs = ""$dir/$old_library $deplibs"" setvar link_static = 'yes' } } # link shared/static library? if test $linkmode = lib { if test -n $dependency_libs && do { test $hardcode_into_libs != yes || test $build_old_libs = yes || test $link_static = yes; } { # Extract -R from dependency_libs setvar temp_deplibs = '' for libdir in $dependency_libs { case (libdir) { -R* { setvar temp_xrpath = $($echo "X$libdir" | $Xsed -e 's/^-R//) case{ *" $temp_xrpath "* { } * { setvar xrpath = ""$xrpath $temp_xrpath""} }} * { setvar temp_deplibs = ""$temp_deplibs $libdir""} } } setvar dependency_libs = "$temp_deplibs" } setvar newlib_search_path = ""$newlib_search_path $absdir"" # Link against this library test $link_static = no && setvar newdependency_libs = ""$abs_ladir/$laname $newdependency_libs"" # ... and its dependency_libs setvar tmp_libs = '' for deplib in $dependency_libs { setvar newdependency_libs = ""$deplib $newdependency_libs"" if test "X$duplicate_deps" = "Xyes" { case{ *" $deplib "* { setvar specialdeplibs = ""$specialdeplibs $deplib"" } } } setvar tmp_libs = ""$tmp_libs $deplib"" } if test $link_all_deplibs != no { # Add the search paths of all dependency libraries for deplib in $dependency_libs { case (deplib) { -L* { setvar path = "$deplib" } *.la { setvar dir = $($echo "X$deplib" | $Xsed -e 's%/[^/]*$%%) test "X$dir" = "X$deplib" && setvar dir = ""."" # We need an absolute path. case (dir) { [\\/]* | [A-Za-z]:[\\/]* { setvar absdir = "$dir" } * { setvar absdir = $(cd $dir && pwd) if test -z $absdir { $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 setvar absdir = "$dir" } } } if grep "^installed=no" $deplib > /dev/null { setvar path = ""-L$absdir/$objdir"" } else { eval libdir=$(${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib) if test -z $libdir { $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 } if test $absdir != $libdir { $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 } setvar path = ""-L$absdir"" } } * { continue } } case{ *" $path "* { } * { setvar deplibs = ""$deplibs $path"" } } } } # link_all_deplibs != no } # linkmode = lib } # for deplib in $libs if test $pass = dlpreopen { # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs { setvar deplibs = ""$deplib $deplibs"" } } if test $pass != dlopen { test $pass != scan && setvar dependency_libs = "$newdependency_libs" if test $pass != conv { # Make sure lib_search_path contains only unique directories. setvar lib_search_path = '' for dir in $newlib_search_path { case{ *" $dir "* { } * { setvar lib_search_path = ""$lib_search_path $dir"" } } } setvar newlib_search_path = '' } if test "$linkmode,$pass" != "prog,link" { setvar vars = ""deplibs"" } else { setvar vars = ""compile_deplibs finalize_deplibs"" } for var in $vars dependency_libs { # Add libraries to $var in reverse order eval tmp_libs='"''$'$var'"' setvar new_libs = '' for deplib in $tmp_libs { case (deplib) { -L* { setvar new_libs = ""$deplib $new_libs"" } * { case{ *" $deplib "* { setvar new_libs = ""$deplib $new_libs"" } * { case{ *" $deplib "* { } * { setvar new_libs = ""$deplib $new_libs"" } } } } } } } setvar tmp_libs = '' for deplib in $new_libs { case (deplib) { -L* { case{ *" $deplib "* { } * { setvar tmp_libs = ""$tmp_libs $deplib"" } } } * { setvar tmp_libs = ""$tmp_libs $deplib"" } } } eval $var='"'$tmp_libs'"' } # for var } if test $pass = "conv" && do { test $linkmode = "lib" || test $linkmode = "prog"; } { setvar libs = "$deplibs" # reset libs setvar deplibs = '' } } # for pass if test $linkmode = prog { setvar dlfiles = "$newdlfiles" setvar dlprefiles = "$newdlprefiles" } case (linkmode) { oldlib { if test -n "$dlfiles$dlprefiles" || test $dlself != no { $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 } if test -n $rpath { $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 } if test -n $xrpath { $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 } if test -n $vinfo { $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 } if test -n $release { $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 } if test -n $export_symbols || test -n $export_symbols_regex { $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 } # Now set the variables for building old libraries. setvar build_libtool_libs = 'no' setvar oldlibs = "$output" setvar objs = ""$objs$old_deplibs"" } lib { # Make sure we only generate libraries of the form `libNAME.la'. case (outputname) { lib* { setvar name = $($echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//) eval libname='"'$libname_spec'"' } * { if test $module = no { $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo $help 1>&2 exit 1 } if test $need_lib_prefix != no { # Add the "lib" prefix for modules if required setvar name = $($echo "X$outputname" | $Xsed -e 's/\.la$//) eval libname='"'$libname_spec'"' } else { setvar libname = $($echo "X$outputname" | $Xsed -e 's/\.la$//) } } } if test -n $objs { if test $deplibs_check_method != pass_all { $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 } else { echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" setvar libobjs = ""$libobjs $objs"" } } if test $dlself != no { $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 } set dummy $rpath if test $Argc -gt 2 { $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 } setvar install_libdir = "$2" setvar oldlibs = '' if test -z $rpath { if test $build_libtool_libs = yes { # Building a libtool convenience library. setvar libext = 'al' setvar oldlibs = ""$output_objdir/$libname.$libext $oldlibs"" setvar build_libtool_libs = 'convenience' setvar build_old_libs = 'yes' } if test -n $vinfo { $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 } if test -n $release { $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 } } else { # Parse the version information argument. setvar save_ifs = "$IFS"; setvar IFS = '':'' set dummy $vinfo 0 0 0 setvar IFS = "$save_ifs" if test -n $8 { $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo $help 1>&2 exit 1 } setvar current = "$2" setvar revision = "$3" setvar age = "$4" # Check that each of the things are valid numbers. case (current) { 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9] { } * { $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 } } case (revision) { 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9] { } * { $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 } } case (age) { 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9] { } * { $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 } } if test $age -gt $current { $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit 1 } # Calculate the version variables. setvar major = '' setvar versuffix = '' setvar verstring = '' case (version_type) { none { } darwin { # Like Linux, but with the current version available in # verstring for coding it into the library header setvar major = ".$(expr $current - $age)" setvar versuffix = ""$major.$age.$revision"" # Darwin ld doesn't like 0 for these options... setvar minor_current = $(expr $current + 1) setvar verstring = ""-compatibility_version $minor_current -current_version $minor_current.$revision"" } freebsd-aout { setvar major = "".$current"" setvar versuffix = "".$current.$revision""; } freebsd-elf { setvar major = "".$current"" setvar versuffix = "".$current""; } irix | nonstopux { setvar major = $(expr $current - $age + 1) case (version_type) { nonstopux { setvar verstring_prefix = 'nonstopux' } * { setvar verstring_prefix = 'sgi' } } setvar verstring = ""$verstring_prefix$major.$revision"" # Add in all the interfaces that we are compatible with. setvar loop = "$revision" while test $loop != 0 { setvar iface = $(expr $revision - $loop) setvar loop = $(expr $loop - 1) setvar verstring = ""$verstring_prefix$major.$iface:$verstring"" } # Before this point, $major must not contain `.'. setvar major = ".$major" setvar versuffix = ""$major.$revision"" } linux { setvar major = ".$(expr $current - $age)" setvar versuffix = ""$major.$age.$revision"" } osf { setvar major = ".$(expr $current - $age)" setvar versuffix = "".$current.$age.$revision"" setvar verstring = ""$current.$age.$revision"" # Add in all the interfaces that we are compatible with. setvar loop = "$age" while test $loop != 0 { setvar iface = $(expr $current - $loop) setvar loop = $(expr $loop - 1) setvar verstring = ""$verstring:${iface}.0"" } # Make executables depend on our current version. setvar verstring = ""$verstring:${current}.0"" } sunos { setvar major = "".$current"" setvar versuffix = "".$current.$revision"" } windows { # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. setvar major = $(expr $current - $age) setvar versuffix = ""-$major"" } * { $echo "$modename: unknown library version type \`$version_type'" 1>&2 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit 1 } } # Clear the version info if we defaulted, and they specified a release. if test -z $vinfo && test -n $release { setvar major = '' setvar verstring = ""0.0"" case (version_type) { darwin { # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely setvar verstring = """" } * { setvar verstring = ""0.0"" } } if test $need_version = no { setvar versuffix = '' } else { setvar versuffix = "".0.0"" } } # Remove version info from name if versioning should be avoided if test $avoid_version = yes && test $need_version = no { setvar major = '' setvar versuffix = '' setvar verstring = """" } # Check to see if the archive will have undefined symbols. if test $allow_undefined = yes { if test $allow_undefined_flag = unsupported { $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 setvar build_libtool_libs = 'no' setvar build_old_libs = 'yes' } } else { # Don't allow undefined symbols. setvar allow_undefined_flag = "$no_undefined_flag" } } if test $mode != relink { # Remove our outputs. $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* } # Now set the variables for building old libraries. if test $build_old_libs = yes && test $build_libtool_libs != convenience { setvar oldlibs = ""$oldlibs $output_objdir/$libname.$libext"" # Transform .lo files to .o files. setvar oldobjs = ""$objs "$($echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e $lo2o | $NL2SP)" } # Eliminate all temporary directories. for path in $notinst_path { setvar lib_search_path = $(echo "$lib_search_path " | ${SED} -e 's% $path % %g) setvar deplibs = $(echo "$deplibs " | ${SED} -e 's% -L$path % %g) setvar dependency_libs = $(echo "$dependency_libs " | ${SED} -e 's% -L$path % %g) } if test -n $xrpath { # If the user specified any rpath flags, then add them. setvar temp_xrpath = '' for libdir in $xrpath { setvar temp_xrpath = ""$temp_xrpath -R$libdir"" case{ *" $libdir "* { } * { setvar finalize_rpath = ""$finalize_rpath $libdir"" } } } if test $hardcode_into_libs != yes || test $build_old_libs = yes { setvar dependency_libs = ""$temp_xrpath $dependency_libs"" } } # Make sure dlfiles contains only unique files that won't be dlpreopened setvar old_dlfiles = "$dlfiles" setvar dlfiles = '' for lib in $old_dlfiles { case{ *" $lib "* { } * { setvar dlfiles = ""$dlfiles $lib"" } } } # Make sure dlprefiles contains only unique files setvar old_dlprefiles = "$dlprefiles" setvar dlprefiles = '' for lib in $old_dlprefiles { case{ *" $lib "* { } * { setvar dlprefiles = ""$dlprefiles $lib"" } } } if test $build_libtool_libs = yes { if test -n $rpath { case (host) { *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* { # these systems don't actually have a c library (as such)! } *-*-rhapsody* | *-*-darwin1.[012] { # Rhapsody C library is in the System framework setvar deplibs = ""$deplibs -framework System"" } *-*-netbsd* { # Don't link with libc until the a.out ld.so is fixed. } *-*-openbsd* | *-*-freebsd* { # Do not include libc due to us having libc/libc_r. } * { # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes" { setvar deplibs = ""$deplibs -lc"" } } } } # Transform deplibs into only deplibs that can be linked in shared. setvar name_save = "$name" setvar libname_save = "$libname" setvar release_save = "$release" setvar versuffix_save = "$versuffix" setvar major_save = "$major" # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? setvar release = """" setvar versuffix = """" setvar major = """" setvar newdeplibs = '' setvar droppeddeps = 'no' case (deplibs_check_method) { pass_all { # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behaviour. setvar newdeplibs = "$deplibs" } test_compile { # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c <<< """ int main() { return 0; } """ $rm conftest $CC -o conftest conftest.c $deplibs if test $? -eq 0 { setvar ldd_output = $(ldd conftest) for i in $deplibs { setvar name = "$(expr $i : '-l\(.*\))" # If $name is empty we are operating on a -L argument. if test -n $name && test $name != "0" { setvar libname = $(eval '\'$echo '"'$libname_spec'"') setvar deplib_matches = $(eval '\'$echo '"'$library_names_spec'"') set dummy $deplib_matches setvar deplib_match = "$2" if test $(expr $ldd_output : ".*$deplib_match) -ne 0 { setvar newdeplibs = ""$newdeplibs $i"" } else { setvar droppeddeps = 'yes' echo echo "*** Warning: dynamic linker does not accept needed library $i." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which I believe you do not have" echo "*** because a test_compile did reveal that the linker did not use it for" echo "*** its dynamic dependency list that programs get resolved with at runtime." } } else { setvar newdeplibs = ""$newdeplibs $i"" } } } else { # Error occured in the first compile. Let's try to salvage # the situation: Compile a separate program for each library. for i in $deplibs { setvar name = "$(expr $i : '-l\(.*\))" # If $name is empty we are operating on a -L argument. if test -n $name && test $name != "0" { $rm conftest $CC -o conftest conftest.c $i # Did it work? if test $? -eq 0 { setvar ldd_output = $(ldd conftest) setvar libname = $(eval '\'$echo '"'$libname_spec'"') setvar deplib_matches = $(eval '\'$echo '"'$library_names_spec'"') set dummy $deplib_matches setvar deplib_match = "$2" if test $(expr $ldd_output : ".*$deplib_match) -ne 0 { setvar newdeplibs = ""$newdeplibs $i"" } else { setvar droppeddeps = 'yes' echo echo "*** Warning: dynamic linker does not accept needed library $i." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because a test_compile did reveal that the linker did not use this one" echo "*** as a dynamic dependency that programs can get resolved with at runtime." } } else { setvar droppeddeps = 'yes' echo echo "*** Warning! Library $i is needed by this library but I was not able to" echo "*** make it link in! You will probably need to install it or some" echo "*** library that it depends on before this library will be fully" echo "*** functional. Installing it before continuing would be even better." } } else { setvar newdeplibs = ""$newdeplibs $i"" } } } } file_magic* { set dummy $deplibs_check_method setvar file_magic_regex = $(expr $deplibs_check_method : "$2 \(.*\)) for a_deplib in $deplibs { setvar name = "$(expr $a_deplib : '-l\(.*\))" # If $name is empty we are operating on a -L argument. if test -n $name && test $name != "0" { setvar libname = $(eval '\'$echo '"'$libname_spec'"') for i in $lib_search_path $sys_lib_search_path $shlib_search_path { setvar potential_libs = $(ls $i/$libname[.-]* ) for potent_lib in $potential_libs { # Follow soft links. if ls -lLd $potent_lib 2>/dev/null \ | grep " -> " >/dev/null { continue } # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? setvar potlib = "$potent_lib" while test -h $potlib { setvar potliblink = $(ls -ld $potlib | ${SED} 's/.* -> //) case (potliblink) { [\\/]* | [A-Za-z]:[\\/]* { setvar potlib = "$potliblink"} * { setvar potlib = "$($echo "X$potlib" | $Xsed -e 's,[^/]*$,,)"$potliblink""} } } if eval $file_magic_cmd '"''$'potlib'"' 2>/dev/null \ | ${SED} 10q \ | egrep $file_magic_regex > /dev/null { setvar newdeplibs = ""$newdeplibs $a_deplib"" setvar a_deplib = """" break 2 } } } if test -n $a_deplib { setvar droppeddeps = 'yes' echo echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z $potlib { echo "*** with $libname but no candidates were found. (...for file magic test)" } else { echo "*** with $libname and none of the candidates passed a file format test" echo "*** using a file magic. Last file checked: $potlib" } } } else { # Add a -L argument. setvar newdeplibs = ""$newdeplibs $a_deplib"" } } # Gone through all deplibs. } match_pattern* { set dummy $deplibs_check_method setvar match_pattern_regex = $(expr $deplibs_check_method : "$2 \(.*\)) for a_deplib in $deplibs { setvar name = "$(expr $a_deplib : '-l\(.*\))" # If $name is empty we are operating on a -L argument. if test -n $name && test $name != "0" { setvar libname = $(eval '\'$echo '"'$libname_spec'"') for i in $lib_search_path $sys_lib_search_path $shlib_search_path { setvar potential_libs = $(ls $i/$libname[.-]* ) for potent_lib in $potential_libs { setvar potlib = "$potent_lib" # see symlink-check below in file_magic test if eval echo '"'$potent_lib'"' 2>/dev/null \ | ${SED} 10q \ | egrep $match_pattern_regex > /dev/null { setvar newdeplibs = ""$newdeplibs $a_deplib"" setvar a_deplib = """" break 2 } } } if test -n $a_deplib { setvar droppeddeps = 'yes' echo echo "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z $potlib { echo "*** with $libname but no candidates were found. (...for regex pattern test)" } else { echo "*** with $libname and none of the candidates passed a file format test" echo "*** using a regex pattern. Last file checked: $potlib" } } } else { # Add a -L argument. setvar newdeplibs = ""$newdeplibs $a_deplib"" } } # Gone through all deplibs. } none | unknown | * { setvar newdeplibs = """" if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | grep . >/dev/null { echo if test "X$deplibs_check_method" = "Xnone" { echo "*** Warning: inter-library dependencies are not supported in this platform." } else { echo "*** Warning: inter-library dependencies are not known to be supported." } echo "*** All declared inter-library dependencies are being dropped." setvar droppeddeps = 'yes' } } } setvar versuffix = "$versuffix_save" setvar major = "$major_save" setvar release = "$release_save" setvar libname = "$libname_save" setvar name = "$name_save" case (host) { *-*-rhapsody* | *-*-darwin1.[012] { # On Rhapsody replace the C library is the System framework setvar newdeplibs = $($echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /) } } if test $droppeddeps = yes { if test $module = yes { echo echo "*** Warning: libtool could not satisfy all declared inter-library" echo "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z $global_symbol_pipe { echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." } if test $build_old_libs = no { setvar oldlibs = ""$output_objdir/$libname.$libext"" setvar build_libtool_libs = 'module' setvar build_old_libs = 'yes' } else { setvar build_libtool_libs = 'no' } } else { echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test $allow_undefined = no { echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test $build_old_libs = no { setvar oldlibs = ""$output_objdir/$libname.$libext"" setvar build_libtool_libs = 'module' setvar build_old_libs = 'yes' } else { setvar build_libtool_libs = 'no' } } } } # Done checking deplibs! setvar deplibs = "$newdeplibs" } # All the library-specific variables (install_libdir is set above). setvar library_names = '' setvar old_library = '' setvar dlname = '' # Test again, we may have decided not to build it any more if test $build_libtool_libs = yes { if test $hardcode_into_libs = yes { # Hardcode the library paths setvar hardcode_libdirs = '' setvar dep_rpath = '' setvar rpath = "$finalize_rpath" test $mode != relink && setvar rpath = ""$compile_rpath$rpath"" for libdir in $rpath { if test -n $hardcode_libdir_flag_spec { if test -n $hardcode_libdir_separator { if test -z $hardcode_libdirs { setvar hardcode_libdirs = "$libdir" } else { # Just accumulate the unique libdirs. case (hardcode_libdir_separator) { *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"* { } * { setvar hardcode_libdirs = ""$hardcode_libdirs$hardcode_libdir_separator$libdir"" } } } } else { eval flag='"'$hardcode_libdir_flag_spec'"' setvar dep_rpath = ""$dep_rpath $flag"" } } elif test -n $runpath_var { case{ *" $libdir "* { } * { setvar perm_rpath = ""$perm_rpath $libdir"" } } } } # Substitute the hardcoded libdirs into the rpath. if test -n $hardcode_libdir_separator && test -n $hardcode_libdirs { setvar libdir = "$hardcode_libdirs" eval dep_rpath='"'$hardcode_libdir_flag_spec'"' } if test -n $runpath_var && test -n $perm_rpath { # We should set the runpath_var. setvar rpath = '' for dir in $perm_rpath { setvar rpath = ""$rpath$dir:"" } eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" } test -n $dep_rpath && setvar deplibs = ""$dep_rpath $deplibs"" } setvar shlibpath = "$finalize_shlibpath" test $mode != relink && setvar shlibpath = ""$compile_shlibpath$shlibpath"" if test -n $shlibpath { eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" } # Get the real and link names of the library. eval library_names='"'$library_names_spec'"' set dummy $library_names setvar realname = "$2" shift; shift if test -n $soname_spec { eval soname='"'$soname_spec'"' } else { setvar soname = "$realname" } test -z $dlname && setvar dlname = "$soname" setvar lib = ""$output_objdir/$realname"for link in @ARGV { setvar linknames = ""$linknames $link"" } # Ensure that we have .o objects for linkers which dislike .lo # (e.g. aix) in case we are running --disable-static for obj in $libobjs { setvar xdir = $($echo "X$obj" | $Xsed -e 's%/[^/]*$%%) if test "X$xdir" = "X$obj" { setvar xdir = ""."" } else { setvar xdir = "$xdir" } setvar baseobj = $($echo "X$obj" | $Xsed -e 's%^.*/%%) setvar oldobj = $($echo "X$baseobj" | $Xsed -e $lo2o) if test ! -f $xdir/$oldobj { $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? } } # Use standard objects if they are pic test -z $pic_flag && setvar libobjs = $($echo "X$libobjs" | $SP2NL | $Xsed -e $lo2o | $NL2SP) # Prepare the list of exported symbols if test -z $export_symbols { if test $always_export_symbols = yes || test -n $export_symbols_regex { $show "generating symbol list for \`$libname.la'" setvar export_symbols = ""$output_objdir/$libname.exp"" $run $rm $export_symbols eval cmds='"'$export_symbols_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" if test -n $export_symbols_regex { $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' } } } if test -n $export_symbols && test -n $include_expsyms { $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' } if test -n $convenience { if test -n $whole_archive_flag_spec { eval libobjs='"''$'libobjs $whole_archive_flag_spec'"' } else { setvar gentop = ""$output_objdir/${outputname}x"" $show "${rm}r $gentop" $run ${rm}r $gentop $show "mkdir $gentop" $run mkdir $gentop setvar status = ""$? if test $status -ne 0 && test ! -d $gentop { exit $status } setvar generated = ""$generated $gentop"" for xlib in $convenience { # Extract the objects. case (xlib) { [\\/]* | [A-Za-z]:[\\/]* { setvar xabs = "$xlib" } * { setvar xabs = "$(pwd)"/$xlib"" } } setvar xlib = $($echo "X$xlib" | $Xsed -e 's%^.*/%%) setvar xdir = ""$gentop/$xlib"" $show "${rm}r $xdir" $run ${rm}r $xdir $show "mkdir $xdir" $run mkdir $xdir setvar status = ""$? if test $status -ne 0 && test ! -d $xdir { exit $status } $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? setvar libobjs = ""$libobjs "$(find $xdir -name '*'.o -print -o -name '*'.lo -print | $NL2SP)" } } } if test $thread_safe = yes && test -n $thread_safe_flag_spec { eval flag='"'$thread_safe_flag_spec'"' setvar linker_flags = ""$linker_flags $flag"" } # Make a backup of the uninstalled library when relinking if test $mode = relink { $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? } # Do each of the archive commands. if test -n $export_symbols && test -n $archive_expsym_cmds { eval cmds='"'$archive_expsym_cmds'"' } else { setvar save_deplibs = "$deplibs" for conv in $convenience { setvar tmp_deplibs = '' for test_deplib in $deplibs { if test $test_deplib != $conv { setvar tmp_deplibs = ""$tmp_deplibs $test_deplib"" } } setvar deplibs = "$tmp_deplibs" } eval cmds='"'$archive_cmds'"' setvar deplibs = "$save_deplibs" } setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" # Restore the uninstalled library and exit if test $mode = relink { $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 } # Create links to the real library. for linkname in $linknames { if test $realname != $linkname { $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? } } # If -module or -export-dynamic was specified, set the dlname. if test $module = yes || test $export_dynamic = yes { # On all known operating systems, these are identical. setvar dlname = "$soname" } } } obj { if test -n $deplibs { $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 } if test -n "$dlfiles$dlprefiles" || test $dlself != no { $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 } if test -n $rpath { $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 } if test -n $xrpath { $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 } if test -n $vinfo { $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 } if test -n $release { $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 } case (output) { *.lo { if test -n "$objs$old_deplibs" { $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit 1 } setvar libobj = "$output" setvar obj = $($echo "X$output" | $Xsed -e $lo2o) } * { setvar libobj = '' setvar obj = "$output" } } # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. setvar reload_conv_objs = '' setvar gentop = '' # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec setvar wl = '' if test -n $convenience { if test -n $whole_archive_flag_spec { eval reload_conv_objs='"''$'reload_objs $whole_archive_flag_spec'"' } else { setvar gentop = ""$output_objdir/${obj}x"" $show "${rm}r $gentop" $run ${rm}r $gentop $show "mkdir $gentop" $run mkdir $gentop setvar status = ""$? if test $status -ne 0 && test ! -d $gentop { exit $status } setvar generated = ""$generated $gentop"" for xlib in $convenience { # Extract the objects. case (xlib) { [\\/]* | [A-Za-z]:[\\/]* { setvar xabs = "$xlib" } * { setvar xabs = "$(pwd)"/$xlib"" } } setvar xlib = $($echo "X$xlib" | $Xsed -e 's%^.*/%%) setvar xdir = ""$gentop/$xlib"" $show "${rm}r $xdir" $run ${rm}r $xdir $show "mkdir $xdir" $run mkdir $xdir setvar status = ""$? if test $status -ne 0 && test ! -d $xdir { exit $status } $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? setvar reload_conv_objs = ""$reload_objs "$(find $xdir -name '*'.o -print -o -name '*'.lo -print | $NL2SP)" } } } # Create the old-style object. setvar 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 setvar output = "$obj" eval cmds='"'$reload_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" # Exit if we aren't doing a library object file. if test -z $libobj { if test -n $gentop { $show "${rm}r $gentop" $run ${rm}r $gentop } exit 0 } if test $build_libtool_libs != yes { if test -n $gentop { $show "${rm}r $gentop" $run ${rm}r $gentop } # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. $show "echo timestamp > $libobj" $run eval "echo timestamp > $libobj" || exit $? exit 0 } if test -n $pic_flag || test $pic_mode != default { # Only do commands if we really have different PIC objects. setvar reload_objs = ""$libobjs $reload_conv_objs"" setvar output = "$libobj" eval cmds='"'$reload_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" } else { # Just create a symlink. $show $rm $libobj $run $rm $libobj setvar xdir = $($echo "X$libobj" | $Xsed -e 's%/[^/]*$%%) if test "X$xdir" = "X$libobj" { setvar xdir = ""."" } else { setvar xdir = "$xdir" } setvar baseobj = $($echo "X$libobj" | $Xsed -e 's%^.*/%%) setvar oldobj = $($echo "X$baseobj" | $Xsed -e $lo2o) $show "(cd $xdir && $LN_S $oldobj $baseobj)" $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? } if test -n $gentop { $show "${rm}r $gentop" $run ${rm}r $gentop } exit 0 } prog { case (host) { *cygwin* { setvar output = $(echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,) } } if test -n $vinfo { $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 } if test -n $release { $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 } if test $preload = yes { if test $dlopen_support = unknown && test $dlopen_self = unknown && test $dlopen_self_static = unknown { $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." } } case (host) { *-*-rhapsody* | *-*-darwin1.[012] { # On Rhapsody replace the C library is the System framework setvar compile_deplibs = $($echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /) setvar finalize_deplibs = $($echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /) case (host) { *darwin* { # Don't allow lazy linking, it breaks C++ global constructors setvar compile_command = ""$compile_command ${wl}-bind_at_load"" setvar finalize_command = ""$finalize_command ${wl}-bind_at_load"" } } } } setvar compile_command = ""$compile_command $compile_deplibs"" setvar finalize_command = ""$finalize_command $finalize_deplibs"" if test -n "$rpath$xrpath" { # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath { # This is the magic to use -rpath. case{ *" $libdir "* { } * { setvar finalize_rpath = ""$finalize_rpath $libdir"" } } } } # Now hardcode the library paths setvar rpath = '' setvar hardcode_libdirs = '' for libdir in $compile_rpath $finalize_rpath { if test -n $hardcode_libdir_flag_spec { if test -n $hardcode_libdir_separator { if test -z $hardcode_libdirs { setvar hardcode_libdirs = "$libdir" } else { # Just accumulate the unique libdirs. case (hardcode_libdir_separator) { *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"* { } * { setvar hardcode_libdirs = ""$hardcode_libdirs$hardcode_libdir_separator$libdir"" } } } } else { eval flag='"'$hardcode_libdir_flag_spec'"' setvar rpath = ""$rpath $flag"" } } elif test -n $runpath_var { case{ *" $libdir "* { } * { setvar perm_rpath = ""$perm_rpath $libdir"" } } } case (host) { *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* { case{ *":$libdir:"* { } * { setvar dllsearchpath = ""$dllsearchpath:$libdir""} } } } } # Substitute the hardcoded libdirs into the rpath. if test -n $hardcode_libdir_separator && test -n $hardcode_libdirs { setvar libdir = "$hardcode_libdirs" eval rpath='"' $hardcode_libdir_flag_spec'"' } setvar compile_rpath = "$rpath" setvar rpath = '' setvar hardcode_libdirs = '' for libdir in $finalize_rpath { if test -n $hardcode_libdir_flag_spec { if test -n $hardcode_libdir_separator { if test -z $hardcode_libdirs { setvar hardcode_libdirs = "$libdir" } else { # Just accumulate the unique libdirs. case (hardcode_libdir_separator) { *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"* { } * { setvar hardcode_libdirs = ""$hardcode_libdirs$hardcode_libdir_separator$libdir"" } } } } else { eval flag='"'$hardcode_libdir_flag_spec'"' setvar rpath = ""$rpath $flag"" } } elif test -n $runpath_var { case{ *" $libdir "* { } * { setvar finalize_perm_rpath = ""$finalize_perm_rpath $libdir"" } } } } # Substitute the hardcoded libdirs into the rpath. if test -n $hardcode_libdir_separator && test -n $hardcode_libdirs { setvar libdir = "$hardcode_libdirs" eval rpath='"' $hardcode_libdir_flag_spec'"' } setvar finalize_rpath = "$rpath" if test -n $libobjs && test $build_old_libs = yes { # Transform all the library objects into standard objects. setvar compile_command = $($echo "X$compile_command" | $SP2NL | $Xsed -e $lo2o | $NL2SP) setvar finalize_command = $($echo "X$finalize_command" | $SP2NL | $Xsed -e $lo2o | $NL2SP) } setvar dlsyms = '' if test -n "$dlfiles$dlprefiles" || test $dlself != no { if test -n $NM && test -n $global_symbol_pipe { setvar dlsyms = ""${outputname}S.c"" } else { $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 } } if test -n $dlsyms { case (dlsyms) { "" { } *.c { # Discover the nlist of each of the dlfiles. setvar nlist = ""$output_objdir/${outputname}.nm"" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm $nlist "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z $run && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */> "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test $dlself = yes { $show "generating symbol list for \`$output'" test -z $run && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. setvar progfiles = $($echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e $lo2o | $NL2SP) for arg in $progfiles { $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" } if test -n $exclude_expsyms { $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' } if test -n $export_symbols_regex { $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' } # Prepare the list of exported symbols if test -z $export_symbols { setvar export_symbols = ""$output_objdir/$output.exp"" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' } else { $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' } } for arg in $dlprefiles { $show "extracting global C symbols from \`$arg'" setvar name = $(echo $arg | ${SED} -e 's%^.*/%%) $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" } if test -z $run { # Make sure we have at least an empty file. test -f $nlist || : > "$nlist" if test -n $exclude_expsyms { egrep -v " ($exclude_expsyms)$" $nlist > "$nlist"T $mv "$nlist"T $nlist } # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1 { sort -k 3 } else { sort +2 } | uniq > "$nlist"S { : } else { grep -v "^: " < "$nlist" > "$nlist"S } if test -f "$nlist"S { eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' } else { echo '/* NONE */' >> "$output_objdir/$dlsyms" } $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {>> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval $global_symbol_to_c_name_address < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif>> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } setvar pic_flag_for_symtable = '' case (host) { # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0* { case{ *" -static "* { } * { setvar pic_flag_for_symtable = "" $pic_flag -DPIC -DFREEBSD_WORKAROUND""} }} *-*-hpux* { case{ *" -static "* { } * { setvar pic_flag_for_symtable = "" $pic_flag -DPIC""} } } } # Now compile the dynamic symbol file. $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" $nlist "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. setvar compile_command = $($echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%) setvar finalize_command = $($echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%) } * { $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit 1 } } } else { # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. setvar compile_command = $($echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%) setvar finalize_command = $($echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%) } if test $need_relink = no || test $build_libtool_libs != yes { # Replace the output file specification. setvar compile_command = $($echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g) setvar link_command = ""$compile_command$compile_rpath"" # We have no uninstalled library dependencies, so finalize right now. $show $link_command $run eval $link_command setvar status = ""$? # Delete the generated files. if test -n $dlsyms { $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" } exit $status } if test -n $shlibpath_var { # We should set the shlibpath_var setvar rpath = '' for dir in $temp_rpath { case (dir) { [\\/]* | [A-Za-z]:[\\/]* { # Absolute path. setvar rpath = ""$rpath$dir:"" } * { # Relative path: add a thisdir entry. setvar rpath = ""$rpath\$thisdir/$dir:"" } } } setvar temp_rpath = "$rpath" } if test -n "$compile_shlibpath$finalize_shlibpath" { setvar compile_command = ""$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"" } if test -n $finalize_shlibpath { setvar finalize_command = ""$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"" } setvar compile_var = '' setvar finalize_var = '' if test -n $runpath_var { if test -n $perm_rpath { # We should set the runpath_var. setvar rpath = '' for dir in $perm_rpath { setvar rpath = ""$rpath$dir:"" } setvar compile_var = ""$runpath_var=\"$rpath\$$runpath_var\" "" } if test -n $finalize_perm_rpath { # We should set the runpath_var. setvar rpath = '' for dir in $finalize_perm_rpath { setvar rpath = ""$rpath$dir:"" } setvar finalize_var = ""$runpath_var=\"$rpath\$$runpath_var\" "" } } if test $no_install = yes { # We don't need to create a wrapper script. setvar link_command = ""$compile_var$compile_command$compile_rpath"" # Replace the output file specification. setvar link_command = $($echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g) # Delete the old output file. $run $rm $output # Link the executable and exit $show $link_command $run eval $link_command || exit $? exit 0 } if test $hardcode_action = relink { # Fast installation is not supported setvar link_command = ""$compile_var$compile_command$compile_rpath"" setvar relink_command = ""$finalize_var$finalize_command$finalize_rpath"" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 } else { if test $fast_install != no { setvar link_command = ""$finalize_var$compile_command$finalize_rpath"" if test $fast_install = yes { setvar relink_command = $($echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g) } else { # fast_install is set to needless setvar relink_command = '' } } else { setvar link_command = ""$compile_var$compile_command$compile_rpath"" setvar relink_command = ""$finalize_var$finalize_command$finalize_rpath"" } } # Replace the output file specification. setvar link_command = $($echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g) # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show $link_command $run eval $link_command || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n $relink_command { # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink { if eval test -z '"''$'{$var+set}'"' { setvar relink_command = ""{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"" } elif eval var_value='$'$var; test -z $var_value; { setvar relink_command = ""$var=; export $var; $relink_command"" } else { setvar var_value = $($echo "X$var_value" | $Xsed -e $sed_quote_subst) setvar relink_command = ""$var=\"$var_value\"; export $var; $relink_command"" } } setvar relink_command = ""(cd $(pwd); $relink_command)"" setvar relink_command = $($echo "X$relink_command" | $Xsed -e $sed_quote_subst) } # Quote $echo for shipping. if test "X$echo" = "X$SHELL $0 --fallback-echo" { case (0) { [\\/]* | [A-Za-z]:[\\/]* { setvar qecho = ""$SHELL $0 --fallback-echo""} * { setvar qecho = ""$SHELL $(pwd)/$0 --fallback-echo""} } setvar qecho = $($echo "X$qecho" | $Xsed -e $sed_quote_subst) } else { setvar qecho = $($echo "X$echo" | $Xsed -e $sed_quote_subst) } # Only actually do things if our run command is non-null. if test -z $run { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case (output) { *.exe { setvar output = $(echo $output|${SED} 's,.exe$,,) } } # test for cygwin because mv fails w/o .exe extensions case (host) { *cygwin* { setvar exeext = '.exe' } * { setvar exeext = '' } } $rm $output trap "$rm $output; exit 1" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi> $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test $fast_install = yes { echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi>> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi>> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit 1 fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" } else { echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " } echo >> $output "\ if test -f \"\$progdir/\$program\"; then>> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test $shlibpath_overrides_runpath = yes && test -n $shlibpath_var && test -n $temp_rpath { $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 ${SED} $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 ${SED} $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " } # fixup the dll searchpath if we need to. if test -n $dllsearchpath { $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " } $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case (host) { # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32* { $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " } # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* { $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " } * { $echo >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} >> $output "\ # Export the path to the program. PATH=\"\$progdir:\$PATH\" export PATH exec \$program \${1+\"\$@\"} " } } $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi>> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit 1 fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " chmod +x $output } exit 0 } } # See if we need to build an old-fashioned archive. for oldlib in $oldlibs { if test $build_libtool_libs = convenience { setvar oldobjs = "$libobjs_save" setvar addlibs = "$convenience" setvar build_libtool_libs = 'no' } else { if test $build_libtool_libs = module { setvar oldobjs = "$libobjs_save" setvar build_libtool_libs = 'no' } else { setvar oldobjs = ""$objs$old_deplibs "$($echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e $lo2o | $NL2SP)" } setvar addlibs = "$old_convenience" } if test -n $addlibs { setvar gentop = ""$output_objdir/${outputname}x"" $show "${rm}r $gentop" $run ${rm}r $gentop $show "mkdir $gentop" $run mkdir $gentop setvar status = ""$? if test $status -ne 0 && test ! -d $gentop { exit $status } setvar generated = ""$generated $gentop"" # Add in members from convenience archives. for xlib in $addlibs { # Extract the objects. case (xlib) { [\\/]* | [A-Za-z]:[\\/]* { setvar xabs = "$xlib" } * { setvar xabs = "$(pwd)"/$xlib"" } } setvar xlib = $($echo "X$xlib" | $Xsed -e 's%^.*/%%) setvar xdir = ""$gentop/$xlib"" $show "${rm}r $xdir" $run ${rm}r $xdir $show "mkdir $xdir" $run mkdir $xdir setvar status = ""$? if test $status -ne 0 && test ! -d $xdir { exit $status } $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? setvar oldobjs = ""$oldobjs "$(find $xdir -name '*'.${objext} -print -o -name '*'.lo -print | $NL2SP)" } } # Do each command in the archive commands. if test -n $old_archive_from_new_cmds && test $build_libtool_libs = yes { eval cmds='"'$old_archive_from_new_cmds'"' } else { # Ensure that we have .o objects in place in case we decided # not to build a shared library, and have fallen back to building # static libs even though --disable-static was passed! for oldobj in $oldobjs { if test ! -f $oldobj { setvar xdir = $($echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%) if test "X$xdir" = "X$oldobj" { setvar xdir = ""."" } else { setvar xdir = "$xdir" } setvar baseobj = $($echo "X$oldobj" | $Xsed -e 's%^.*/%%) setvar obj = $($echo "X$baseobj" | $Xsed -e $o2lo) $show "(cd $xdir && ${LN_S} $obj $baseobj)" $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? } } eval cmds='"'$old_archive_cmds'"' } setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" } if test -n $generated { $show "${rm}r$generated" $run ${rm}r$generated } # Now create the libtool archive. case (output) { *.la { setvar old_library = '' test $build_old_libs = yes && setvar old_library = ""$libname.$libext"" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink { if eval test -z '"''$'{$var+set}'"' { setvar relink_command = ""{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"" } elif eval var_value='$'$var; test -z $var_value; { setvar relink_command = ""$var=; export $var; $relink_command"" } else { setvar var_value = $($echo "X$var_value" | $Xsed -e $sed_quote_subst) setvar relink_command = ""$var=\"$var_value\"; export $var; $relink_command"" } } # Quote the link command for shipping. setvar relink_command = ""(cd $(pwd); $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"" setvar relink_command = $($echo "X$relink_command" | $Xsed -e $sed_quote_subst) # Only create the output if not a dry run. if test -z $run { for installed in no yes { if test $installed = yes { if test -z $install_libdir { break } setvar output = ""$output_objdir/$outputname"i" # Replace all uninstalled libtool libraries with the installed ones setvar newdependency_libs = '' for deplib in $dependency_libs { case (deplib) { *.la { setvar name = $($echo "X$deplib" | $Xsed -e 's%^.*/%%) eval libdir=$(${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib) if test -z $libdir { $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 } setvar newdependency_libs = ""$newdependency_libs $libdir/$name"" } * { setvar newdependency_libs = ""$newdependency_libs $deplib"" } } } setvar dependency_libs = "$newdependency_libs" setvar newdlfiles = '' for lib in $dlfiles { setvar name = $($echo "X$lib" | $Xsed -e 's%^.*/%%) eval libdir=$(${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib) if test -z $libdir { $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 } setvar newdlfiles = ""$newdlfiles $libdir/$name"" } setvar dlfiles = "$newdlfiles" setvar newdlprefiles = '' for lib in $dlprefiles { setvar name = $($echo "X$lib" | $Xsed -e 's%^.*/%%) eval libdir=$(${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib) if test -z $libdir { $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 } setvar newdlprefiles = ""$newdlprefiles $libdir/$name"" } setvar dlprefiles = "$newdlprefiles" } $rm $output # place dlname in correct position for cygwin setvar tdlname = "$dlname" case (host) { *cygwin*,*lai,yes,no,*.dll { setvar tdlname = "../bin/$dlname" } } $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'> $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test $installed = no && test $need_relink = yes { $echo >> $output "\ relink_command=\"$relink_command>> $output "\ relink_command=\"$relink_command\"" } } } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? } } exit 0 } # libtool install mode install { setvar modename = ""$modename: install"" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test $nonopt = $SHELL || test $nonopt = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null { # Aesthetically quote it. setvar arg = $($echo "X$nonopt" | $Xsed -e $sed_quote_subst) case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]* { setvar arg = ""\"$arg"\"" } } setvar install_prog = ""$arg "" setvar arg = "$1" shift } else { setvar install_prog = '' setvar arg = "$nonopt" } # The real first argument should be the name of the installation program. # Aesthetically quote it. setvar arg = $($echo "X$arg" | $Xsed -e $sed_quote_subst) case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]* { setvar arg = ""\"$arg"\"" } } setvar install_prog = ""$install_prog$arg"" # We need to accept at least all the BSD install flags. setvar dest = '' setvar files = '' setvar opts = '' setvar prev = '' setvar install_type = '' setvar isdir = 'no' setvar stripme = ''for arg in @ARGV { if test -n $dest { setvar files = ""$files $dest"" setvar dest = "$arg" continue } case (arg) { -d { setvar isdir = 'yes' } -f { setvar prev = ""-f"" } -g { setvar prev = ""-g"" } -m { setvar prev = ""-m"" } -o { setvar prev = ""-o"" } -s { setvar stripme = "" -s"" continue } -* { } * { # If the previous option needed an argument, then skip it. if test -n $prev { setvar prev = '' } else { setvar dest = "$arg" continue } } } # Aesthetically quote the argument. setvar arg = $($echo "X$arg" | $Xsed -e $sed_quote_subst) case (arg) { *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]* { setvar arg = ""\"$arg"\"" } } setvar install_prog = ""$install_prog $arg"" } if test -z $install_prog { $echo "$modename: you must specify an install program" 1>&2 $echo $help 1>&2 exit 1 } if test -n $prev { $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo $help 1>&2 exit 1 } if test -z $files { if test -z $dest { $echo "$modename: no file or destination specified" 1>&2 } else { $echo "$modename: you must specify a destination" 1>&2 } $echo $help 1>&2 exit 1 } # Strip any trailing slash from the destination. setvar dest = $($echo "X$dest" | $Xsed -e 's%/$%%) # Check to see that the destination is a directory. test -d $dest && setvar isdir = 'yes' if test $isdir = yes { setvar destdir = "$dest" setvar destname = '' } else { setvar destdir = $($echo "X$dest" | $Xsed -e 's%/[^/]*$%%) test "X$destdir" = "X$dest" && setvar destdir = '.' setvar destname = $($echo "X$dest" | $Xsed -e 's%^.*/%%) # Not a directory, so check to see that there is only one file specified. set dummy $files if test $Argc -gt 2 { $echo "$modename: \`$dest' is not a directory" 1>&2 $echo $help 1>&2 exit 1 } } case (destdir) { [\\/]* | [A-Za-z]:[\\/]* { } * { for file in $files { case (file) { *.lo { } * { $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo $help 1>&2 exit 1 } } } } } # This variable tells wrapper scripts just to set variables rather # than running their programs. setvar libtool_install_magic = "$magic" setvar staticlibs = '' setvar future_libdirs = '' setvar current_libdirs = '' for file in $files { # Do each installation. case (file) { *.$libext { # Do the static libraries later. setvar staticlibs = ""$staticlibs $file"" } *.la { # Check to see that this really is a libtool archive. if shell {${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE"} >/dev/null 2>&1 { : } else { $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo $help 1>&2 exit 1 } setvar library_names = '' setvar old_library = '' setvar relink_command = '' # If there is no directory component, then add one. case (file) { */* | *\\* { source $file } * { source ./$file } } # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir" { case{ *" $libdir "* { } * { setvar current_libdirs = ""$current_libdirs $libdir"" } } } else { # Note the libdir as a future libdir. case{ *" $libdir "* { } * { setvar future_libdirs = ""$future_libdirs $libdir"" } } } setvar dir = "$($echo "X$file" | $Xsed -e 's%/[^/]*$%%)/" test "X$dir" = "X$file/" && setvar dir = '' setvar dir = ""$dir$objdir"" if test -n $relink_command { # Determine the prefix the user has applied to our future dir. setvar inst_prefix_dir = $($echo $destdir | sed "s%$libdir\$%%) # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. if test $inst_prefix_dir = $destdir { $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit 1 } if test -n $inst_prefix_dir { # Stick the inst_prefix_dir data into the link command. setvar relink_command = $($echo $relink_command | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%) } else { setvar relink_command = $($echo $relink_command | sed "s%@inst_prefix_dir@%%) } $echo "$modename: warning: relinking \`$file'" 1>&2 $show $relink_command if $run eval $relink_command { : } else { $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit 1 } } # See the names of the shared library. set dummy $library_names if test -n $2 { setvar realname = "$2" shift shift setvar srcname = "$realname" test -n $relink_command && setvar srcname = ""$realname"T" # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n $stripme && test -n $striplib { $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? } if test $Argc -gt 0 {for linkname in @ARGV { if test $linkname != $realname { $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" } } } # Do each command in the postinstall commands. setvar lib = ""$destdir/$realname"" eval cmds='"'$postinstall_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" } # Install the pseudo-library for information purposes. setvar name = $($echo "X$file" | $Xsed -e 's%^.*/%%) setvar instname = ""$dir/$name"i" $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n $old_library && setvar staticlibs = ""$staticlibs $dir/$old_library"" } *.lo { # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n $destname { setvar destfile = ""$destdir/$destname"" } else { setvar destfile = $($echo "X$file" | $Xsed -e 's%^.*/%%) setvar destfile = ""$destdir/$destfile"" } # Deduce the name of the destination old-style object file. case (destfile) { *.lo { setvar staticdest = $($echo "X$destfile" | $Xsed -e $lo2o) } *.$objext { setvar staticdest = "$destfile" setvar destfile = '' } * { $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo $help 1>&2 exit 1 } } # Install the libtool object if requested. if test -n $destfile { $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? } # Install the old object if enabled. if test $build_old_libs = yes { # Deduce the name of the old-style object file. setvar staticobj = $($echo "X$file" | $Xsed -e $lo2o) $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? } exit 0 } * { # Figure out destination file name, if it wasn't already specified. if test -n $destname { setvar destfile = ""$destdir/$destname"" } else { setvar destfile = $($echo "X$file" | $Xsed -e 's%^.*/%%) setvar destfile = ""$destdir/$destfile"" } # Do a test to see if this is really a libtool program. case (host) { *cygwin*|*mingw* { setvar wrapper = $(echo $file | ${SED} -e 's,.exe$,,) } * { setvar wrapper = "$file" } } if shell {${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE"}>/dev/null 2>&1 { setvar notinst_deplibs = '' setvar relink_command = '' # If there is no directory component, then add one. case (file) { */* | *\\* { source $wrapper } * { source ./$wrapper } } # Check the variables that should have been set. if test -z $notinst_deplibs { $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 } setvar finalize = 'yes' for lib in $notinst_deplibs { # Check to see that each library is installed. setvar libdir = '' if test -f $lib { # If there is no directory component, then add one. case (lib) { */* | *\\* { source $lib } * { source ./$lib } } } setvar libfile = ""$libdir/"$($echo "X$lib" | $Xsed -e 's%^.*/%%g)" ### testsuite: skip nested quoting test if test -n $libdir && test ! -f $libfile { $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 setvar finalize = 'no' } } setvar relink_command = '' # If there is no directory component, then add one. case (file) { */* | *\\* { source $wrapper } * { source ./$wrapper } } setvar outputname = '' if test $fast_install = no && test -n $relink_command { if test $finalize = yes && test -z $run { setvar tmpdir = ""/tmp"" test -n $TMPDIR && setvar tmpdir = "$TMPDIR" setvar tmpdir = ""$tmpdir/libtool-"$$" if $mkdir -p $tmpdir && chmod 700 $tmpdir { : } else { $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue } setvar file = $($echo "X$file" | $Xsed -e 's%^.*/%%) setvar outputname = ""$tmpdir/$file"" # Replace the output file specification. setvar relink_command = $($echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g) $show $relink_command if $run eval $relink_command { : } else { $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r $tmpdir continue } setvar file = "$outputname" } else { $echo "$modename: warning: cannot relink \`$file'" 1>&2 } } else { # Install the binary that we compiled earlier. setvar file = $($echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%) } } # remove .exe since cygwin /usr/bin/install will append another # one anyways case (install_prog) { /usr/bin/install*,*cygwin* { case (file) { *.exe:*.exe { # this is ok } *.exe:* { setvar destfile = "$destfile.exe" } *:*.exe { setvar destfile = $(echo $destfile | ${SED} -e 's,.exe$,,) } } } } $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n $outputname && ${rm}r $tmpdir } } } for file in $staticlibs { setvar name = $($echo "X$file" | $Xsed -e 's%^.*/%%) # Set up the ranlib parameters. setvar oldlib = ""$destdir/$name"" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n $stripme && test -n $striplib { $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? } # Do each command in the postinstall commands. eval cmds='"'$old_postinstall_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || exit $? } setvar IFS = "$save_ifs" } if test -n $future_libdirs { $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 } if test -n $current_libdirs { # Maybe just do a dry run. test -n $run && setvar current_libdirs = "" -n$current_libdirs"" setvar exec_cmd = ''$SHELL $0 --finish$current_libdirs'' } else { exit 0 } } # libtool finish mode finish { setvar modename = ""$modename: finish"" setvar libdirs = "$nonopt" setvar admincmds = '' if test -n "$finish_cmds$finish_eval" && test -n $libdirs {for dir in @ARGV { setvar libdirs = ""$libdirs $dir"" } for libdir in $libdirs { if test -n $finish_cmds { # Do each command in the finish commands. eval cmds='"'$finish_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd || setvar admincmds = ""$admincmds $cmd"" } setvar IFS = "$save_ifs" } if test -n $finish_eval { # Do the single finish_eval. eval cmds='"'$finish_eval'"' $run eval $cmds || setvar admincmds = ""$admincmds $cmds"" } } } # Exit here if they wanted silent mode. test $show = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs { echo " $libdir" } echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n $shlibpath_var { echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" } if test -n $runpath_var { echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" } if test -n $hardcode_libdir_flag_spec { setvar libdir = 'LIBDIR' eval flag='"'$hardcode_libdir_flag_spec'"' echo " - use the \`$flag' linker flag" } if test -n $admincmds { echo " - have your system administrator run these commands:$admincmds" } if test -f /etc/ld.so.conf { echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" } echo echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" exit 0 } # libtool execute mode execute { setvar modename = ""$modename: execute"" # The first argument is the command name. setvar cmd = "$nonopt" if test -z $cmd { $echo "$modename: you must specify a COMMAND" 1>&2 $echo $help exit 1 } # Handle -dlopen flags immediately. for file in $execute_dlfiles { if test ! -f $file { $echo "$modename: \`$file' is not a file" 1>&2 $echo $help 1>&2 exit 1 } setvar dir = '' case (file) { *.la { # Check to see that this really is a libtool archive. if shell {${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE"} >/dev/null 2>&1 { : } else { $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo $help 1>&2 exit 1 } # Read the libtool library. setvar dlname = '' setvar library_names = '' # If there is no directory component, then add one. case (file) { */* | *\\* { source $file } * { source ./$file } } # Skip this library if it cannot be dlopened. if test -z $dlname { # Warn if it was a shared library. test -n $library_names && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue } setvar dir = $($echo "X$file" | $Xsed -e 's%/[^/]*$%%) test "X$dir" = "X$file" && setvar dir = '.' if test -f "$dir/$objdir/$dlname" { setvar dir = ""$dir/$objdir"" } else { $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit 1 } } *.lo { # Just add the directory containing the .lo file. setvar dir = $($echo "X$file" | $Xsed -e 's%/[^/]*$%%) test "X$dir" = "X$file" && setvar dir = '.' } * { $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue } } # Get the absolute pathname. setvar absdir = $(cd $dir && pwd) test -n $absdir && setvar dir = "$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\"" { eval "$shlibpath_var=\"\$dir\"" } else { eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" } } # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. setvar libtool_execute_magic = "$magic" # Check if any of the arguments is a wrapper script. setvar args = ''for file in @ARGV { case (file) { -* { } * { # Do a test to see if this is really a libtool program. if shell {${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE"} >/dev/null 2>&1 { # If there is no directory component, then add one. case (file) { */* | *\\* { source $file } * { source ./$file } } # Transform arg to wrapped name. setvar file = ""$progdir/$program"" } } } # Quote arguments (to preserve shell metacharacters). setvar file = $($echo "X$file" | $Xsed -e $sed_quote_subst) setvar args = ""$args \"$file"\"" } if test -z $run { if test -n $shlibpath_var { # Export the shlibpath_var. eval "export $shlibpath_var" } # Restore saved enviroment variables if test ${save_LC_ALL+set} = set { setvar LC_ALL = "$save_LC_ALL"; export LC_ALL } if test ${save_LANG+set} = set { setvar LANG = "$save_LANG"; export LANG } # Now prepare to actually exec the command. setvar exec_cmd = ""\$cmd$args"" } else { # Display what would be done. if test -n $shlibpath_var { eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" } $echo "$cmd$args" exit 0 } } # libtool clean and uninstall mode clean | uninstall { setvar modename = ""$modename: $mode"" setvar rm = "$nonopt" setvar files = '' setvar rmforce = '' setvar exit_status = '0' # This variable tells wrapper scripts just to set variables rather # than running their programs. setvar libtool_install_magic = "$magic"for arg in @ARGV { case (arg) { -f { setvar rm = ""$rm $arg""; setvar rmforce = 'yes' } -* { setvar rm = ""$rm $arg"" } * { setvar files = ""$files $arg"" } } } if test -z $rm { $echo "$modename: you must specify an RM program" 1>&2 $echo $help 1>&2 exit 1 } setvar rmdirs = '' for file in $files { setvar dir = $($echo "X$file" | $Xsed -e 's%/[^/]*$%%) if test "X$dir" = "X$file" { setvar dir = '.' setvar objdir = "$objdir" } else { setvar objdir = ""$dir/$objdir"" } setvar name = $($echo "X$file" | $Xsed -e 's%^.*/%%) test $mode = uninstall && setvar objdir = "$dir" # Remember objdir for removal later, being careful to avoid duplicates if test $mode = clean { case{ *" $objdir "* { } * { setvar rmdirs = ""$rmdirs $objdir"" } } } # Don't error if the file doesn't exist and rm -f was used. if shell {test -L $file} >/dev/null 2>&1 \ || shell {test -h $file} >/dev/null 2>&1 \ || test -f $file { : } elif test -d $file { setvar exit_status = '1' continue } elif test $rmforce = yes { continue } setvar rmfiles = "$file" case (name) { *.la { # Possibly a libtool archive, so verify it. if shell {${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE"} >/dev/null 2>&1 { source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names { setvar rmfiles = ""$rmfiles $objdir/$n"" } test -n $old_library && setvar rmfiles = ""$rmfiles $objdir/$old_library"" test $mode = clean && setvar rmfiles = ""$rmfiles $objdir/$name $objdir/${name}i"" if test $mode = uninstall { if test -n $library_names { # Do each command in the postuninstall commands. eval cmds='"'$postuninstall_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd if test $? != 0 && test $rmforce != yes { setvar exit_status = '1' } } setvar IFS = "$save_ifs" } if test -n $old_library { # Do each command in the old_postuninstall commands. eval cmds='"'$old_postuninstall_cmds'"' setvar save_ifs = "$IFS"; setvar IFS = ''~'' for cmd in $cmds { setvar IFS = "$save_ifs" $show $cmd $run eval $cmd if test $? != 0 && test $rmforce != yes { setvar exit_status = '1' } } setvar IFS = "$save_ifs" } # FIXME: should reinstall the best remaining shared library. } } } *.lo { if test $build_old_libs = yes { setvar oldobj = $($echo "X$name" | $Xsed -e $lo2o) setvar rmfiles = ""$rmfiles $dir/$oldobj"" } } * { # Do a test to see if this is a libtool program. if test $mode = clean && shell {${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE"} >/dev/null 2>&1 { setvar relink_command = '' source $dir/$file setvar rmfiles = ""$rmfiles $objdir/$name $objdir/${name}S.${objext}"" if test $fast_install = yes && test -n $relink_command { setvar rmfiles = ""$rmfiles $objdir/lt-$name"" } } } } $show "$rm $rmfiles" $run $rm $rmfiles || setvar exit_status = '1' } # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs { if test -d $dir { $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 } } exit $exit_status } "" { $echo "$modename: you must specify a MODE" 1>&2 $echo $generic_help 1>&2 exit 1 } } if test -z $exec_cmd { $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo $generic_help 1>&2 exit 1 } } # test -z "$show_help" if test -n $exec_cmd { eval exec $exec_cmd exit 1 } # We need to display help for each of the modes. case (mode) { "" { $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE." exit 0 } clean { $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." } compile { $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." } execute { $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." } finish { $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." } install { $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." } link { $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." } uninstall { $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." } * { $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo $help 1>&2 exit 1 } } echo $echo "Try \`$modename --help' for more information about other modes." exit 0 # Local Variables: # mode:shell-script # sh-indentation:2 # End: