*** mysql-4.0.7-gamma/ltmain.sh Fri Dec 20 07:25:10 2002 --- mysql40/ltmain.sh Mon Jan 6 09:26:55 2003 *************** *** 49,62 **** fi # The name of this program. ! progname=`$echo "$0" | sed 's%^.*/%%'` modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool ! VERSION=1.4.2 ! TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)" default_mode= help="Try \`$progname --help' for more information." --- 49,62 ---- fi # The name of this program. ! progname=`$echo "$0" | ${SED} 's%^.*/%%'` modename="$progname" # Constants. PROGRAM=ltmain.sh PACKAGE=libtool ! VERSION=1.4e ! TIMESTAMP=" (1.1125 2002/06/26 07:15:36)" default_mode= help="Try \`$progname --help' for more information." *************** *** 67,76 **** # 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='s/\([\\`\\"$\\\\]\)/\\\1/g' ! SP2NL='tr \040 \012' ! NL2SP='tr \015\012 \040\040' # NLS nuisances. # Only set LANG and LC_ALL to C if already set. --- 67,85 ---- # 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='s/\([\\`\\"$\\\\]\)/\\\1/g' ! # test EBCDIC or ASCII ! case `echo A|od -x` in ! *[Cc]1*) # EBCDIC based system ! SP2NL="tr '\100' '\n'" ! NL2SP="tr '\r\n' '\100\100'" ! ;; ! *) # Assume ASCII based system ! SP2NL="tr '\040' '\012'" ! NL2SP="tr '\015\012' '\040\040'" ! ;; ! esac # NLS nuisances. # Only set LANG and LC_ALL to C if already set. *************** *** 106,112 **** o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. ! while test $# -gt 0 do arg="$1" shift --- 115,121 ---- o2lo="s/\\.${objext}\$/.lo/" # Parse our command line options once, thoroughly. ! while test "$#" -gt 0 do arg="$1" shift *************** *** 122,127 **** --- 131,163 ---- execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; + tag) + tagname="$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + echo "$progname: invalid tag name: $tagname" 1>&2 + exit 1 + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" + else + echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; *) eval "$prev=\$arg" ;; *************** *** 140,150 **** --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 ;; --- 176,195 ---- --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + echo + echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001" + echo "Free Software Foundation, Inc." + echo "This is free software; see the source for copying conditions. There is NO" + echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit 0 ;; --config) ! ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 ! # Now print the configurations for the tags. ! for tagname in $taglist; do ! ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" ! done exit 0 ;; *************** *** 177,186 **** --- 222,240 ---- --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; + --preserve-dup-deps) duplicate_deps="yes" ;; + --quiet | --silent) show=: ;; + --tag) prevopt="--tag" prev=tag ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + ;; + -dlopen) prevopt="-dlopen" prev=execute_dlfiles *************** *** 270,317 **** modename="$modename: compile" # Get the compilation command and the source file. base_compile= ! prev= ! lastarg= ! srcfile="$nonopt" suppress_output= - user_target=no for arg do ! case $prev in ! "") ;; ! xcompiler) ! # Aesthetically quote the previous argument. ! prev= ! lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` ! ! case $arg in ! # Double-quote args containing other shell metacharacters. ! # Many Bourne shells cannot handle close brackets correctly ! # in scan sets, so we specify it separately. ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") ! arg="\"$arg\"" ;; - esac ! # Add the previous argument to base_compile. ! if test -z "$base_compile"; then ! base_compile="$lastarg" ! else ! base_compile="$base_compile $lastarg" ! fi continue ;; - esac # Accept any command-line options. case $arg in -o) ! if test "$user_target" != "no"; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi ! user_target=next ;; -static) --- 324,359 ---- modename="$modename: compile" # Get the compilation command and the source file. base_compile= ! srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_output= + arg_mode=normal + libobj= for arg do ! case "$arg_mode" in ! arg ) ! # do not "continue". Instead, add this to base_compile ! lastarg="$arg" ! arg_mode=normal ;; ! target ) ! libobj="$arg" ! arg_mode=normal continue ;; + normal ) # Accept any command-line options. case $arg in -o) ! if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit 1 fi ! arg_mode=target ! continue ;; -static) *************** *** 330,338 **** ;; -Xcompiler) ! prev=xcompiler ! continue ! ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` --- 372,380 ---- ;; -Xcompiler) ! arg_mode=arg # the next one goes into the "base_compile" arg list ! continue # The current "srcfile" will either be retained or ! ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` *************** *** 355,427 **** lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else base_compile="$base_compile $lastarg" - fi continue ;; - esac - - case $user_target in - next) - # The next one is the -o target name - user_target=yes - continue - ;; - yes) - # We got the output file - user_target=set - libobj="$arg" - continue - ;; - esac # Accept the current argument as the source file. lastarg="$srcfile" 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. 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 in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac - # Add the previous argument to base_compile. - if test -z "$base_compile"; then - base_compile="$lastarg" - else base_compile="$base_compile $lastarg" ! fi ! done ! case $user_target in ! set) ! ;; ! no) ! # Get the name of the library object. ! libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; ! *) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo ! xform='[cCFSfmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; --- 397,450 ---- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; + * ) # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # lastarg="$srcfile" srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" ! done # for arg ! case $arg_mode in ! arg) ! $echo "$modename: you must specify an argument for -Xcompile" ! exit 1 ;; ! target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit 1 ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo ! xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *************** *** 429,438 **** --- 452,464 ---- *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; + *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` *************** *** 445,450 **** --- 471,526 ---- ;; esac + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. + # Only attempt this if the compiler in the base compile + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when ltconfig was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case "$base_compile " in + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + echo "$modename: unable to infer tagged configuration" + echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 + # else + # echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 *************** *** 453,461 **** # Delete any leftover library objects. if test "$build_old_libs" = yes; then ! removelist="$obj $libobj" else ! removelist="$libobj" fi $run $rm $removelist --- 529,537 ---- # Delete any leftover library objects. if test "$build_old_libs" = yes; then ! removelist="$obj $lobj $libobj ${libobj}T" else ! removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist *************** *** 467,473 **** pic_mode=default ;; esac ! if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi --- 543,549 ---- pic_mode=default ;; esac ! if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi *************** *** 480,485 **** --- 556,562 ---- removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit 1" 1 2 15 else + output_obj= need_locks=no lockfile= fi *************** *** 514,562 **** eval srcfile=\"$fix_srcfile_path\" fi # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then ! # All platforms use -DPIC, to notify preprocessed assembler code. ! command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi - if test "$build_old_libs" = yes; then - lo_libobj="$libobj" - dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$libobj"; then - dir="$objdir" - else - dir="$dir/$objdir" - fi - libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` ! if test -d "$dir"; then ! $show "$rm $libobj" ! $run $rm $libobj ! else ! $show "$mkdir $dir" ! $run $mkdir $dir status=$? ! if test $status -ne 0 && test ! -d $dir; then exit $status fi fi ! fi ! if test "$compiler_o_lo" = yes; then ! output_obj="$libobj" ! command="$command -o $output_obj" ! elif test "$compiler_c_o" = yes; then ! output_obj="$obj" ! command="$command -o $output_obj" fi ! $run $rm "$output_obj" $show "$command" if $run eval "$command"; then : else --- 591,638 ---- eval srcfile=\"$fix_srcfile_path\" fi + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` --- 641,647 ---- fi if test "$need_locks" = warn && ! test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` *************** *** 585,593 **** fi # Just move the object if needed, then go on to compile the next one ! if test x"$output_obj" != x"$libobj"; then ! $show "$mv $output_obj $libobj" ! if $run $mv $output_obj $libobj; then : else error=$? $run $rm $removelist --- 661,669 ---- fi # Just move the object if needed, then go on to compile the next one ! if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then ! $show "$mv $output_obj $lobj" ! if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist *************** *** 595,642 **** fi fi ! # If we have no pic_flag, then copy the object into place and finish. ! if (test -z "$pic_flag" || test "$pic_mode" != default) && ! test "$build_old_libs" = yes; then ! # Rename the .lo from within objdir to obj ! if test -f $obj; then ! $show $rm $obj ! $run $rm $obj ! fi ! $show "$mv $libobj $obj" ! if $run $mv $libobj $obj; then : ! else ! error=$? ! $run $rm $removelist ! exit $error ! fi ! ! xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` ! if test "X$xdir" = "X$obj"; then ! xdir="." ! else ! xdir="$xdir" ! fi ! baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` ! 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)'; then ! # Unlock the critical section if it was locked ! if test "$need_locks" != no; then ! $run $rm "$lockfile" ! fi ! exit 0 ! else ! error=$? ! $run $rm $removelist ! exit $error ! fi ! fi # Allow error messages only from the first compilation. suppress_output=' >/dev/null 2>&1' fi # Only build a position-dependent object if we build old libraries. --- 671,691 ---- fi fi ! # Append the name of the PIC object to the libtool object file. ! test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != x"$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` --- 711,717 ---- fi if test "$need_locks" = warn && ! test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` *************** *** 684,690 **** fi # Just move the object if needed ! if test x"$output_obj" != x"$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else --- 731,737 ---- fi # Just move the object if needed ! if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else *************** *** 694,716 **** fi fi ! # 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; then ! $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; then : else ! error=$? ! $run $rm $removelist ! exit $error ! fi ! fi fi # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" --- 741,765 ---- fi fi ! # Append the name of the non-PIC object the libtool object file. ! # Only append if the libtool object file exists. ! test -z "$run" && cat >> ${libobj}T <> ${libobj}T <\?\'\ \ ]*|*]*|"") --- 863,871 ---- test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. ! while test "$#" -gt 0; do arg="$1" + base_compile="$base_compile $arg" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") *************** *** 892,897 **** --- 944,1056 ---- prev= continue ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do + # moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit 1 + fi + arg=$save_arg + prev= + continue + ;; rpath | xrpath) # We need an absolute path. case $arg in *************** *** 936,945 **** continue ;; esac ! fi # test -n $prev prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then --- 1095,1122 ---- continue ;; esac ! fi # test -n "$prev" prevarg="$arg" + # Pass Metrowerks x86 NLM linker flags to linker. + case "$LD" in + mwldnlm) + case "$arg" in + -check | -commandfile | -entry | -exit | -flags | -map) + linker_flags="$linker_flags $qarg" + prev=xlinker + ;; + -nocheck | -zerobss | -nozerobss) + linker_flags="$linker_flags $qarg" + ;; + -g) + # If -g then include symbols for NetWare internal debugger + linker_flags="$linker_flags -sym internal" + ;; + esac + ;; + esac case $arg in -all-static) if test -n "$link_static_flag"; then *************** *** 992,998 **** # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in ! no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; --- 1169,1175 ---- # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in ! no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; *************** *** 1043,1056 **** # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; ! *-*-openbsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in ! *-*-openbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; --- 1220,1237 ---- # 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 ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue esac elif test "X$arg" = "X-lc_r"; then case $host in ! *-*-openbsd* | *-*-freebsd*) # Do not include libc_r directly, use -pthread flag. continue ;; *************** *** 1089,1094 **** --- 1270,1280 ---- continue ;; + -objectlist) + prev=objectlist + continue + ;; + -o) prev=output ;; -release) *************** *** 1201,1212 **** esac ;; ! *.lo | *.$objext) ! # A library or standard object. if test "$prev" = dlfiles; then - # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then ! dlfiles="$dlfiles $arg" prev= continue else --- 1387,1435 ---- esac ;; ! *.$objext) ! # A standard object. ! objs="$objs $arg" ! ;; ! ! *.lo) ! # A libtool-controlled object. ! ! # Check to see that this really is a libtool object. ! if (${SED} -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then ! pic_object= ! non_pic_object= ! ! # Read the .lo file ! # If there is no directory component, then add one. ! case $arg in ! */* | *\\*) . $arg ;; ! *) . ./$arg ;; ! esac ! ! if test -z "$pic_object" || \ ! test -z "$non_pic_object" || ! test "$pic_object" = none && \ ! test "$non_pic_object" = none; then ! $echo "$modename: cannot find name of object for \`$arg'" 1>&2 ! exit 1 ! fi ! ! # Extract subdirectory from the argument. ! xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` ! if test "X$xdir" = "X$arg"; then ! xdir= ! else ! xdir="$xdir/" ! fi ! ! if test "$pic_object" != none; then ! # Prepend the subdirectory the object is found in. ! pic_object="$xdir$pic_object" ! if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then ! dlfiles="$dlfiles $pic_object" prev= continue else *************** *** 1215,1229 **** fi fi if test "$prev" = dlprefiles; then # Preload the old-style object. ! dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` prev= else ! case $arg in ! *.lo) libobjs="$libobjs $arg" ;; ! *) objs="$objs $arg" ;; ! esac fi ;; --- 1438,1487 ---- fi fi + # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. ! dlprefiles="$dlprefiles $pic_object" prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi else ! # Only an error if not doing a dry-run. ! if test -z "$run"; then ! $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 ! exit 1 ! else ! # Dry-run case. ! ! # Extract subdirectory from the argument. ! xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` ! if test "X$xdir" = "X$arg"; then ! xdir= ! else ! xdir="$xdir/" ! fi ! ! pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` ! non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` ! libobjs="$libobjs $pic_object" ! non_pic_objects="$non_pic_objects $non_pic_object" ! fi fi ;; *************** *** 1277,1288 **** --- 1535,1617 ---- exit 1 fi + # Special handling for Metrowerks compiler for NetWare + case "$LD" in + mwldnlm) + # If building debug (-g) add internal debug symbols. + compile_command=`echo $compile_command | ${SED} -e 's/ -g / -g -sym internal /'` + + # When using the Metrowerks linker for NetWare, if there is a + # .def or .exp file with the same filename as the $output file, + # add it as a -commandfile to $compile_command and $linker_flags + # (if no -commandfile yet) + base=`echo $output | ${SED} 's,\(.*\)\..*$,\1,'` + cmd_file= + for ext in def exp; do + if test -f "$base.$ext"; then + cmd_file="$base.$ext" + break + fi + done + if test -n "$cmd_file"; then + if ! ( expr "$compile_command" : ".*-commandfile.*" > /dev/null ); then + compile_command="$compile_command -commandfile $cmd_file" + fi + if ! ( expr "$linker_flags" : ".*-commandfile.*" > /dev/null ); then + linker_flags="$linker_flags -commandfile $cmd_file" + fi + fi + ;; + esac + + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. + # Only attempt this if the compiler in the base link + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when ltconfig was run. + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case $base_compile in + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) + # The compiler in $compile_command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + echo "$modename: unable to infer tagged configuration" + echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 + # else + # echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi + oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" *************** *** 1303,1313 **** output_objdir="$output_objdir/$objdir" fi # Create the object directory. ! if test ! -d $output_objdir; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? ! if test $status -ne 0 && test ! -d $output_objdir; then exit $status fi fi --- 1632,1642 ---- output_objdir="$output_objdir/$objdir" fi # Create the object directory. ! if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? ! if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi *************** *** 1325,1340 **** --- 1654,1713 ---- *) linkmode=prog ;; # Anything else should be a program. esac + case $host in + *cygwin*) + # This is a hack, but we run into problems on cygwin. + # libgcc.a depends on libcygwin, but gcc puts -lgcc onto + # the link line twice: once before the "normal" libs + # (-lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32) and + # once AFTER those. However, the "eliminate dup deps" + # proceedure keeps only the LAST duplicate -- thus + # messing up the order, since after dup elimination + # -lgcc comes AFTER -lcygwin. In normal C operation, + # you don't notice the problem, because -lgcc isn't + # really used. However, now that C++ libraries are + # libtool-able, you DO see the problem. So, it must + # be fixed. We could always force "--preserve-dup-deps" + # but that could lead to other problems. So, on cygwin, + # always preserve dups of -lgcc...but only -lgcc. That + # way, the dependency order won't get corrupted. + specialdeplibs="-lgcc" + ;; + *) specialdeplibs= + ;; + esac + libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac + fi libs="$libs $deplib" done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + deplibs= newdependency_libs= newlib_search_path= *************** *** 1366,1393 **** ;; esac for pass in $passes; do ! if test $linkmode = prog; then ! # Determine which files to process ! case $pass in ! dlopen) ! libs="$dlfiles" ! save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ! ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) ! if test $linkmode = oldlib && test $linkmode = obj; then ! $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi ! if test $pass = conv; then deplibs="$deplib $deplibs" continue fi --- 1739,1771 ---- ;; esac for pass in $passes; do ! if test "$linkmode,$pass" = "lib,link" || ! test "$linkmode,$pass" = "prog,scan"; then ! libs="$deplibs" deplibs= ! fi ! if test "$linkmode" = prog; then ! case $pass in ! dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi for deplib in $libs; do lib= found=no case $deplib in -l*) ! if test "$linkmode" != lib && test "$linkmode" != prog; then ! $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi ! if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi *************** *** 1407,1413 **** finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" ! test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi --- 1785,1791 ---- finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" ! test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi *************** *** 1416,1431 **** case $linkmode in lib) deplibs="$deplib $deplibs" ! test $pass = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) ! if test $pass = conv; then deplibs="$deplib $deplibs" continue fi ! if test $pass = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else --- 1794,1809 ---- case $linkmode in lib) deplibs="$deplib $deplibs" ! test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) ! if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi ! if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else *************** *** 1434,1446 **** fi ;; *) ! $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) ! if test $pass = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in --- 1812,1824 ---- fi ;; *) ! $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) ! if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *************** *** 1453,1459 **** ;; *.la) lib="$deplib" ;; *.$libext) ! if test $pass = conv; then deplibs="$deplib $deplibs" continue fi --- 1831,1837 ---- ;; *.la) lib="$deplib" ;; *.$libext) ! if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi *************** *** 1461,1470 **** lib) if test "$deplibs_check_method" != pass_all; then echo ! echo "*** Warning: This library needs some functionality provided by $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." else echo echo "*** Warning: Linking the shared library $output against the" --- 1839,1850 ---- lib) if test "$deplibs_check_method" != pass_all; then 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" *************** *** 1474,1480 **** continue ;; prog) ! if test $pass != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" --- 1854,1860 ---- continue ;; prog) ! if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" *************** *** 1485,1491 **** esac # linkmode ;; # *.$libext *.lo | *.$objext) ! if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" --- 1865,1874 ---- esac # linkmode ;; # *.$libext *.lo | *.$objext) ! if test "$pass" = conv; then ! deplibs="$deplib $deplibs" ! elif test "$linkmode" = prog; then ! if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" *************** *** 1494,1499 **** --- 1877,1883 ---- else newdlfiles="$newdlfiles $deplib" fi + fi continue ;; %DEPLIBS%) *************** *** 1501,1514 **** continue ;; esac # case $deplib ! if test $found = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. ! if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 --- 1885,1898 ---- continue ;; esac # case $deplib ! if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. ! if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 *************** *** 1535,1547 **** if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || ! { test $linkmode = oldlib && test $linkmode = obj; }; then ! # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi ! if test $pass = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then --- 1919,1930 ---- if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || ! { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi ! if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then *************** *** 1555,1566 **** tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done ! elif test $linkmode != prog && test $linkmode != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi --- 1938,1951 ---- tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac + fi tmp_libs="$tmp_libs $deplib" done ! elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi *************** *** 1578,1592 **** fi # This library was specified with -dlopen. ! if test $pass = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking ! # statically, we need to preload. ! dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi --- 1963,1979 ---- fi # This library was specified with -dlopen. ! if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking ! # statically, we need to preload. We also need to preload any ! # dependent libraries so libltdl's deplib preloader doesn't ! # bomb out in the load deplibs phase. ! dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi *************** *** 1627,1633 **** name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. ! if test $pass = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 --- 2014,2020 ---- name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. ! if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 *************** *** 1646,1663 **** if test -z "$libdir"; then # Link the convenience library ! if test $linkmode = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else ! deplibs="$lib $deplibs" fi continue fi ! if test $linkmode = prog && test $pass != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" --- 2033,2050 ---- if test -z "$libdir"; then # Link the convenience library ! if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else ! deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi ! if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" *************** *** 1673,1700 **** -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? ! if test $linkalldeplibs = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... ! link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then ! # Link against this shared library - if test "$linkmode,$pass" = "prog,link" || - { test $linkmode = lib && test $hardcode_into_libs = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. --- 2060,2095 ---- -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? ! if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi + if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac + fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... ! if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then ! # We need to hardcode the library path ! if test -n "$shlibpath_var"; then ! # Make sure the rpath contains only unique directories. ! case "$temp_rpath " in ! *" $dir "*) ;; ! *" $absdir "*) ;; ! *) temp_rpath="$temp_rpath $dir" ;; ! esac ! fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. *************** *** 1716,1732 **** esac ;; esac - if test $linkmode = prog; then - # We need to hardcode the library path - if test -n "$shlibpath_var"; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $dir" ;; - esac - fi - fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && --- 2111,2116 ---- *************** *** 1736,1746 **** --- 2120,2159 ---- # We only need to search for static libraries continue fi + fi + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi + # This is a shared library + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname *************** *** 1766,1773 **** # Make a new name for the extract_expsyms_cmds to use soroot="$soname" ! soname=`echo $soroot | sed -e 's/^.*\///'` ! 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"; then : --- 2179,2186 ---- # Make a new name for the extract_expsyms_cmds to use soroot="$soname" ! soname=`echo $soroot | ${SED} -e 's/^.*\///'` ! 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"; then : *************** *** 1798,1806 **** # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib ! fi # test -n $old_archive_from_expsyms_cmds ! if test $linkmode = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= --- 2211,2219 ---- # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib ! fi # test -n "$old_archive_from_expsyms_cmds" ! if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= *************** *** 1808,1813 **** --- 2221,2229 ---- case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then + case $host in + *-*-sco3.2v5* ) add_dir="-L$dir" ;; + esac add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *************** *** 1849,1855 **** *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi ! if test $linkmode = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else --- 2265,2271 ---- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi ! if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else *************** *** 1866,1872 **** fi fi ! if test $linkmode = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= --- 2282,2288 ---- fi fi ! if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= *************** *** 1884,1898 **** add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. - if test "X$installed" = Xyes; then add_dir="-L$libdir" - else - add_dir="-L$DESTDIR$libdir" - fi add="-l$name" fi ! if test $linkmode = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else --- 2300,2310 ---- add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" add="-l$name" fi ! if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else *************** *** 1900,1915 **** test -n "$add" && deplibs="$add $deplibs" fi fi ! elif test $linkmode = prog; then ! if test "$alldeplibs" = yes && ! { test "$deplibs_check_method" = pass_all || ! { test "$build_libtool_libs" = yes && ! test -n "$library_names"; }; }; then ! # We only need to search for static libraries ! continue ! fi ! ! # 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. --- 2312,2318 ---- test -n "$add" && deplibs="$add $deplibs" fi fi ! elif test "$linkmode" = prog; then # 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. *************** *** 1930,1942 **** # 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 library needs some functionality provided by $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; then ! echo "*** Therefore, libtool will create a static module, that should work " ! echo "*** as long as the dlopening application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" --- 2333,2346 ---- # 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; then ! 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"; then echo echo "*** However, this would only work if libtool was able to extract symbol" *************** *** 1959,1968 **** fi fi # link shared/static library? ! if test $linkmode = lib; then if test -n "$dependency_libs" && ! { test $hardcode_into_libs != yes || test $build_old_libs = yes || ! test $link_static = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do --- 2363,2372 ---- fi fi # link shared/static library? ! if test "$linkmode" = lib; then if test -n "$dependency_libs" && ! { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || ! test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do *************** *** 1985,1997 **** tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done ! if test $link_all_deplibs != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in --- 2389,2403 ---- tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac + fi tmp_libs="$tmp_libs $deplib" done ! if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in *************** *** 2013,2019 **** if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else ! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 --- 2419,2425 ---- if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else ! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 *************** *** 2034,2048 **** fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs ! if test $pass = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi ! if test $pass != dlopen; then ! test $pass != scan && dependency_libs="$newdependency_libs" ! if test $pass != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do --- 2440,2454 ---- fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs ! dependency_libs="$newdependency_libs" ! if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi ! if test "$pass" != dlopen; then ! if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do *************** *** 2064,2072 **** --- 2470,2498 ---- eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) *************** *** 2094,2112 **** eval $var=\"$tmp_libs\" done # for var fi - if test "$pass" = "conv" && - { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then - libs="$deplibs" # reset libs - deplibs= - fi done # for pass ! if test $linkmode = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi --- 2520,2537 ---- eval $var=\"$tmp_libs\" done # for var fi done # for pass ! if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi *************** *** 2177,2183 **** fi set dummy $rpath ! if test $# -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" --- 2602,2608 ---- fi set dummy $rpath ! if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" *************** *** 2186,2192 **** if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. ! libext=al oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes --- 2611,2619 ---- if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. ! # Some compilers have problems with a `.al' extension so ! # convenience libraries should have the same extension an ! # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes *************** *** 2244,2250 **** ;; esac ! if test $age -gt $current; then $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 --- 2671,2677 ---- ;; esac ! if test "$age" -gt "$current"; then $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 *************** *** 2277,2292 **** versuffix=".$current"; ;; ! irix) major=`expr $current - $age + 1` ! verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision ! while test $loop != 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` ! verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. --- 2704,2724 ---- versuffix=".$current"; ;; ! irix | nonstopux) major=`expr $current - $age + 1` ! ! case $version_type in ! nonstopux) verstring_prefix=nonstopux ;; ! *) verstring_prefix=sgi ;; ! esac ! verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision ! while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` ! verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. *************** *** 2306,2312 **** # Add in all the interfaces that we are compatible with. loop=$age ! while test $loop != 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" --- 2738,2744 ---- # Add in all the interfaces that we are compatible with. loop=$age ! while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" *************** *** 2338,2349 **** # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= - verstring="0.0" case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely ! verstring="" ;; *) verstring="0.0" --- 2770,2780 ---- # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely ! verstring= ;; *) verstring="0.0" *************** *** 2377,2385 **** fi if test "$mode" != relink; then ! # 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}.* fi # Now set the variables for building old libraries. --- 2808,2831 ---- fi if test "$mode" != relink; then ! # Remove our outputs, but don't remove object files since they ! # may have been created when compiling PIC objects. ! removelist= ! tempremovelist=`echo "$output_objdir/*"` ! for p in $tempremovelist; do ! case $p in ! *.$objext) ! ;; ! $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) ! removelist="$removelist $p" ! ;; ! *) ;; ! esac ! done ! if test -n "$removelist"; then ! $show "${rm}r $removelist" ! $run ${rm}r $removelist ! fi fi # Now set the variables for building old libraries. *************** *** 2392,2400 **** # Eliminate all temporary directories. for path in $notinst_path; do ! lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` ! deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` ! dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then --- 2838,2846 ---- # Eliminate all temporary directories. for path in $notinst_path; do ! lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'` ! deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'` ! dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then *************** *** 2407,2413 **** *) finalize_rpath="$finalize_rpath $libdir" ;; esac done ! if test $hardcode_into_libs != yes || test $build_old_libs = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi --- 2853,2859 ---- *) finalize_rpath="$finalize_rpath $libdir" ;; esac done ! if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi *************** *** 2445,2456 **** *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; ! *-*-openbsd*) # 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"; then deplibs="$deplibs -lc" fi ;; --- 2891,2903 ---- *-*-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. + test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. ! if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; *************** *** 2490,2502 **** int main() { return 0; } EOF $rm conftest ! $CC -o conftest conftest.c $deplibs ! if test $? -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. ! if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches --- 2937,2949 ---- int main() { return 0; } EOF $rm conftest ! $LTCC -o conftest conftest.c $deplibs ! if test "$?" -eq 0 ; then ldd_output=`ldd conftest` for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. ! if test "$name" != "" && test "$name" -ne "0"; then libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` set dummy $deplib_matches *************** *** 2506,2531 **** else droppeddeps=yes echo ! echo "*** Warning: This library needs some functionality provided by $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." fi else newdeplibs="$newdeplibs $i" fi done else ! # Error occured in the first compile. Let's try to salvage the situation: ! # Compile a seperate program for each library. for i in $deplibs; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. ! if test -n "$name" && test "$name" != "0"; then $rm conftest ! $CC -o conftest conftest.c $i # Did it work? ! if test $? -eq 0 ; then ldd_output=`ldd conftest` libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` --- 2953,2980 ---- else 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." fi else newdeplibs="$newdeplibs $i" fi done 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; do name="`expr $i : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. ! if test "$name" != "" && test "$name" != "0"; then $rm conftest ! $LTCC -o conftest conftest.c $i # Did it work? ! if test "$?" -eq 0 ; then ldd_output=`ldd conftest` libname=`eval \\$echo \"$libname_spec\"` deplib_matches=`eval \\$echo \"$library_names_spec\"` *************** *** 2536,2545 **** else droppeddeps=yes echo ! echo "*** Warning: This library needs some functionality provided by $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." fi else droppeddeps=yes --- 2985,2996 ---- else 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." fi else droppeddeps=yes *************** *** 2561,2567 **** for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. ! if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` --- 3012,3018 ---- for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. ! if test "$name" != "" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` *************** *** 2578,2591 **** # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do ! potliblink=`ls -ld $potlib | sed 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ ! | sed 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" --- 3029,3042 ---- # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do ! potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ ! | ${SED} 10q \ | egrep "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" *************** *** 2596,2605 **** if test -n "$a_deplib" ; then droppeddeps=yes echo ! echo "*** Warning: This library needs some functionality provided by $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." fi else # Add a -L argument. --- 3047,3063 ---- if test -n "$a_deplib" ; then 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" ; then ! 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" ! fi fi else # Add a -L argument. *************** *** 2618,2625 **** for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do if eval echo \"$potent_lib\" 2>/dev/null \ ! | sed 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" --- 3076,3084 ---- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test if eval echo \"$potent_lib\" 2>/dev/null \ ! | ${SED} 10q \ | egrep "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" *************** *** 2630,2639 **** if test -n "$a_deplib" ; then droppeddeps=yes echo ! echo "*** Warning: This library needs some functionality provided by $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." fi else # Add a -L argument. --- 3089,3105 ---- if test -n "$a_deplib" ; then 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" ; then ! 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" ! fi fi else # Add a -L argument. *************** *** 2696,2702 **** echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." ! if test $allow_undefined = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" --- 3162,3168 ---- echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." ! if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" *************** *** 2723,2729 **** # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then ! if test $hardcode_into_libs = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= --- 3189,3195 ---- # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then ! if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= *************** *** 2789,2795 **** else soname="$realname" fi ! test -z "$dlname" && dlname=$soname lib="$output_objdir/$realname" for link --- 3255,3263 ---- else soname="$realname" fi ! if test -z "$dlname"; then ! dlname=$soname ! fi lib="$output_objdir/$realname" for link *************** *** 2797,2819 **** linknames="$linknames $link" done - # 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; do - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - if test ! -f $xdir/$oldobj; then - $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" - $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? - fi - done - # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` --- 3265,3270 ---- *************** *** 2827,2834 **** --- 3278,3293 ---- save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then *************** *** 2846,2860 **** if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" ! $show "mkdir $gentop" ! $run mkdir "$gentop" status=$? ! if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" --- 3305,3320 ---- if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" ! $show "$mkdir $gentop" ! $run $mkdir "$gentop" status=$? ! if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" *************** *** 2870,2885 **** $show "${rm}r $xdir" $run ${rm}r "$xdir" ! $show "mkdir $xdir" ! $run mkdir "$xdir" status=$? ! if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi --- 3330,3345 ---- $show "${rm}r $xdir" $run ${rm}r "$xdir" ! $show "$mkdir $xdir" ! $run $mkdir "$xdir" status=$? ! if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi *************** *** 2898,2905 **** --- 3358,3488 ---- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else + save_deplibs="$deplibs" + for conv in $convenience; do + tmp_deplibs= + for test_deplib in $deplibs; do + if test "$test_deplib" != "$conv"; then + tmp_deplibs="$tmp_deplibs $test_deplib" + fi + done + deplibs="$tmp_deplibs" + done + eval cmds=\"$archive_cmds\" + deplibs="$save_deplibs" + fi + + if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$save_output-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$save_output-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$save_output-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadale object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else eval cmds=\"$archive_cmds\" fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~$rm $delfiles\" + fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" *************** *** 2990,2999 **** gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" ! $show "mkdir $gentop" ! $run mkdir "$gentop" status=$? ! if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" --- 3573,3582 ---- gentop="$output_objdir/${obj}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" ! $show "$mkdir $gentop" ! $run $mkdir "$gentop" status=$? ! if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" *************** *** 3009,3024 **** $show "${rm}r $xdir" $run ${rm}r "$xdir" ! $show "mkdir $xdir" ! $run mkdir "$xdir" status=$? ! if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` done fi fi --- 3592,3607 ---- $show "${rm}r $xdir" $run ${rm}r "$xdir" ! $show "$mkdir $xdir" ! $run $mkdir "$xdir" status=$? ! if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done fi fi *************** *** 3054,3061 **** # 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 fi --- 3637,3644 ---- # 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 fi *************** *** 3071,3090 **** $run eval "$cmd" || exit $? done IFS="$save_ifs" - else - # Just create a symlink. - $show $rm $libobj - $run $rm $libobj - xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$libobj"; then - xdir="." - else - xdir="$xdir" - fi - baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` - oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` - $show "(cd $xdir && $LN_S $oldobj $baseobj)" - $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? fi if test -n "$gentop"; then --- 3654,3659 ---- *************** *** 3097,3103 **** prog) case $host in ! *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 --- 3666,3672 ---- prog) case $host in ! *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 *************** *** 3285,3293 **** if test -z "$export_symbols"; then 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"' fi --- 3854,3862 ---- if test -z "$export_symbols"; then 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"' fi *************** *** 3295,3301 **** for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" ! name=`echo "$arg" | sed -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done --- 3864,3870 ---- for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" ! name=`echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval 'echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done *************** *** 3310,3316 **** fi # Try sorting and uniquifying the output. ! if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S --- 3879,3891 ---- fi # Try sorting and uniquifying the output. ! if grep -v "^: " < "$nlist" | ! if sort -k 3 /dev/null 2>&1; then ! sort -k 3 ! else ! sort +2 ! fi | ! uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S *************** *** 3371,3388 **** *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; ! *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; ! *) pic_flag_for_symtable=" $pic_flag -DPIC";; esac esac # 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" --- 3946,3963 ---- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; ! *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; ! *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. ! $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" ! $run eval '(cd $output_objdir && $LTCC -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" *************** *** 3407,3413 **** finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi ! if test $need_relink = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" --- 3982,3988 ---- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi ! if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" *************** *** 3532,3538 **** relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done ! relink_command="cd `pwd`; $relink_command" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi --- 4107,4113 ---- relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done ! relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi *************** *** 3552,3562 **** # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in ! *.exe) output=`echo $output|sed 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in ! *cygwin*) exeext=.exe ;; *) exeext= ;; esac $rm $output --- 4127,4139 ---- # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in ! *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in ! *cygwin*) ! exeext=.exe ! outputname=`echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac $rm $output *************** *** 3576,3582 **** # 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 --- 4153,4159 ---- # 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 *************** *** 3614,3620 **** 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%/[^/]*\$%%'\` --- 4191,4197 ---- 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%/[^/]*\$%%'\` *************** *** 3627,3633 **** 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. --- 4204,4210 ---- 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. *************** *** 3641,3647 **** 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\" --- 4218,4224 ---- 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\" *************** *** 3763,3769 **** oldobjs="$libobjs_save" build_libtool_libs=no else ! oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` fi addlibs="$old_convenience" fi --- 4340,4346 ---- oldobjs="$libobjs_save" build_libtool_libs=no else ! oldobjs="$oldobjs$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi *************** *** 3772,3781 **** gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" ! $show "mkdir $gentop" ! $run mkdir "$gentop" status=$? ! if test $status -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" --- 4349,4358 ---- gentop="$output_objdir/${outputname}x" $show "${rm}r $gentop" $run ${rm}r "$gentop" ! $show "$mkdir $gentop" ! $run $mkdir "$gentop" status=$? ! if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi generated="$generated $gentop" *************** *** 3792,3801 **** $show "${rm}r $xdir" $run ${rm}r "$xdir" ! $show "mkdir $xdir" ! $run mkdir "$xdir" status=$? ! if test $status -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" --- 4369,4378 ---- $show "${rm}r $xdir" $run ${rm}r "$xdir" ! $show "$mkdir $xdir" ! $run $mkdir "$xdir" status=$? ! if test "$status" -ne 0 && test ! -d "$xdir"; then exit $status fi $show "(cd $xdir && $AR x $xabs)" *************** *** 3809,3833 **** if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then 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; do ! if test ! -f $oldobj; then ! xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` ! if test "X$xdir" = "X$oldobj"; then ! xdir="." ! else ! xdir="$xdir" ! fi ! baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` ! obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` ! $show "(cd $xdir && ${LN_S} $obj $baseobj)" ! $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? fi done ! ! eval cmds=\"$old_archive_cmds\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do --- 4386,4438 ---- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then eval cmds=\"$old_archive_from_new_cmds\" else ! eval cmds=\"$old_archive_cmds\" ! ! if len=`expr "X$cmds" : ".*"` && ! test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then ! : ! else ! # the command line is too long to link in one step, link in parts ! $echo "using piecewise archive linking..." ! save_RANLIB=$RANLIB ! RANLIB=: ! objlist= ! concat_cmds= ! save_oldobjs=$oldobjs ! # GNU ar 2.10+ was changed to match POSIX; thus no paths are ! # encoded into archives. This makes 'ar r' malfunction in ! # this piecewise linking case whenever conflicting object ! # names appear in distinct ar calls; check, warn and compensate. ! if (for obj in $save_oldobjs ! do ! $echo "X$obj" | $Xsed -e 's%^.*/%%' ! done | sort | sort -uc >/dev/null 2>&1); then ! : ! else ! $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 ! $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 ! AR_FLAGS=cq ! fi ! for obj in $save_oldobjs ! do ! oldobjs="$objlist $obj" ! objlist="$objlist $obj" ! eval test_cmds=\"$old_archive_cmds\" ! if len=`expr "X$test_cmds" : ".*"` && ! test "$len" -le "$max_cmd_len"; then ! : ! else ! # the above command should be used before it gets too long ! oldobjs=$objlist ! test -z "$concat_cmds" || concat_cmds=$concat_cmds~ ! eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" ! objlist= fi done ! RANLIB=$save_RANLIB ! oldobjs=$objlist ! eval cmds=\"\$concat_cmds~$old_archive_cmds\" ! fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do *************** *** 3862,3868 **** fi done # Quote the link command for shipping. ! relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. --- 4467,4473 ---- fi done # Quote the link command for shipping. ! relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # Only create the output if not a dry run. *************** *** 3879,3885 **** case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` ! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 --- 4484,4490 ---- case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` ! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 *************** *** 3893,3899 **** newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` ! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 --- 4498,4504 ---- newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` ! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 *************** *** 3904,3910 **** newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` ! eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 --- 4509,4515 ---- newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` ! eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 *************** *** 3952,3958 **** # Directory that this library needs to be installed in: libdir='$install_libdir'" ! if test "$installed" = no && test $need_relink = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi --- 4557,4563 ---- # Directory that this library needs to be installed in: libdir='$install_libdir'" ! if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi *************** *** 4088,4094 **** # Not a directory, so check to see that there is only one file specified. set dummy $files ! if test $# -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 --- 4693,4699 ---- # Not a directory, so check to see that there is only one file specified. set dummy $files ! if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit 1 *************** *** 4128,4134 **** *.la) # Check to see that this really is a libtool archive. ! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 --- 4733,4739 ---- *.la) # Check to see that this really is a libtool archive. ! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 *************** *** 4145,4165 **** esac # Add the libdir to current_libdirs if it is the destination. - DESTDIR= if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else - case "$destdir" in - *"$libdir") - DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'` - if test "X$destdir" != "X$DESTDIR$libdir"; then - DESTDIR= - fi - ;; - esac # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; --- 4750,4761 ---- *************** *** 4173,4179 **** if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 - export DESTDIR $show "$relink_command" if $run eval "$relink_command"; then : else --- 4769,4774 ---- *************** *** 4181,4187 **** continue fi fi - unset DESTDIR # See the names of the shared library. set dummy $library_names --- 4776,4781 ---- *************** *** 4201,4207 **** $run eval "$striplib $destdir/$realname" || exit $? fi ! if test $# -gt 0; then # Delete the old symlinks, and create new ones. for linkname do --- 4795,4801 ---- $run eval "$striplib $destdir/$realname" || exit $? fi ! if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do *************** *** 4287,4306 **** destfile="$destdir/$destfile" fi # Do a test to see if this is really a libtool program. ! if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in ! */* | *\\*) . $file ;; ! *) . ./$file ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then ! $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi --- 4881,4921 ---- destfile="$destdir/$destfile" fi + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + # Do a test to see if this is really a libtool program. ! case $host in ! *cygwin*|*mingw*) ! wrapper=`echo $file | ${SED} -e 's,.exe$,,'` ! ;; ! *) ! wrapper=$file ! ;; ! esac ! if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # If there is no directory component, then add one. case $file in ! */* | *\\*) . $wrapper ;; ! *) . ./$wrapper ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then ! $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit 1 fi *************** *** 4340,4346 **** $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi ! file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` --- 4955,4961 ---- $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi ! file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` *************** *** 4358,4371 **** fi else # Install the binary that we compiled earlier. ! file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in ! /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok --- 4973,4986 ---- fi else # Install the binary that we compiled earlier. ! file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in ! */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok *************** *** 4374,4380 **** destfile=$destfile.exe ;; *:*.exe) ! destfile=`echo $destfile | sed -e 's,.exe$,,'` ;; esac ;; --- 4989,4995 ---- destfile=$destfile.exe ;; *:*.exe) ! destfile=`echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; *************** *** 4459,4465 **** fi # Exit here if they wanted silent mode. ! test "$show" = ":" && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" --- 5074,5080 ---- fi # Exit here if they wanted silent mode. ! test "$show" = : && exit 0 echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" *************** *** 4522,4528 **** case $file in *.la) # Check to see that this really is a libtool archive. ! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 --- 5137,5143 ---- case $file in *.la) # Check to see that this really is a libtool archive. ! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 *************** *** 4593,4599 **** -*) ;; *) # Do a test to see if this is really a libtool program. ! if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; --- 5208,5214 ---- -*) ;; *) # Do a test to see if this is really a libtool program. ! if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *************** *** 4625,4631 **** fi # Now prepare to actually exec the command. ! exec_cmd='"$cmd"$args' else # Display what would be done. if test -n "$shlibpath_var"; then --- 5240,5246 ---- fi # Now prepare to actually exec the command. ! exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then *************** *** 4675,4684 **** objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` ! test $mode = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates ! if test $mode = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; --- 5290,5299 ---- objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` ! test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates ! if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; *************** *** 4702,4708 **** case $name in *.la) # Possibly a libtool archive, so verify it. ! if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. --- 5317,5323 ---- case $name in *.la) # Possibly a libtool archive, so verify it. ! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. *************** *** 4710,4718 **** rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" ! test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ! if test $mode = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" --- 5325,5333 ---- rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" ! test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ! if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" *************** *** 4721,4727 **** IFS="$save_ifs" $show "$cmd" $run eval "$cmd" ! if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done --- 5336,5342 ---- IFS="$save_ifs" $show "$cmd" $run eval "$cmd" ! if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done *************** *** 4736,4742 **** IFS="$save_ifs" $show "$cmd" $run eval "$cmd" ! if test $? != 0 && test "$rmforce" != yes; then exit_status=1 fi done --- 5351,5357 ---- IFS="$save_ifs" $show "$cmd" $run eval "$cmd" ! if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done *************** *** 4748,4763 **** ;; *.lo) ! if test "$build_old_libs" = yes; then ! oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` ! rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. ! if test $mode = clean && ! (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file --- 5363,5392 ---- ;; *.lo) ! # Possibly a libtool object, so verify it. ! if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then ! ! # Read the .lo file ! . $dir/$name ! ! # Add PIC object to the list of files to remove. ! if test -n "$pic_object" \ ! && test "$pic_object" != none; then ! rmfiles="$rmfiles $dir/$pic_object" ! fi ! ! # Add non-PIC object to the list of files to remove. ! if test -n "$non_pic_object" \ ! && test "$non_pic_object" != none; then ! rmfiles="$rmfiles $dir/$non_pic_object" ! fi fi ;; *) # Do a test to see if this is a libtool program. ! if test "$mode" = clean && ! (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file *************** *** 4818,4823 **** --- 5447,5453 ---- --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: *************** *** 4943,4948 **** --- 5573,5579 ---- -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 + -objectlist FILE Use a list of object files found in FILE to specify 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 *************** *** 4993,4998 **** --- 5624,5649 ---- exit 0 + # The TAGs below are defined such that we never get into a situation + # in which we disable both kinds of libraries. Given conflicting + # choices, we go for a static library, that is the most portable, + # since we can't tell whether shared libraries were disabled because + # the user asked for that or because the platform doesn't support + # them. This is particularly important on AIX, because we don't + # support having both static and shared libraries enabled at the same + # time on that platform, so we default to a shared-only configuration. + # If a disable-shared tag is given, we'll fallback to a static-only + # configuration. But we'll never go from static-only to shared-only. + + # ### BEGIN LIBTOOL TAG CONFIG: disable-shared + build_libtool_libs=no + build_old_libs=yes + # ### END LIBTOOL TAG CONFIG: disable-shared + + # ### BEGIN LIBTOOL TAG CONFIG: disable-static + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + # ### END LIBTOOL TAG CONFIG: disable-static + # Local Variables: # mode:shell-script # sh-indentation:2