Index: ltmain.sh =================================================================== RCS file: /scotty/triggers/ltmain.sh,v retrieving revision 1.1 diff -c -r1.1 ltmain.sh *** ltmain.sh 13 Jul 2005 09:58:52 -0000 1.1 --- ltmain.sh 4 Jun 2009 05:57:39 -0000 *************** *** 1,7 **** # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # ! # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # --- 1,7 ---- # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # ! # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # *************** *** 17,23 **** # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a --- 17,23 ---- # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software ! # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a *************** *** 43,51 **** PROGRAM=ltmain.sh PACKAGE=libtool ! VERSION=1.5.6 ! TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 224 $" # Check that we have a working $echo. if test "X$1" = X--no-reexec; then --- 43,56 ---- PROGRAM=ltmain.sh PACKAGE=libtool ! VERSION="1.5.22 Debian 1.5.22-4" ! TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then *************** *** 83,96 **** Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' # test EBCDIC or ASCII ! case `echo A|tr A '\301'` in ! A) # 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 --- 88,102 ---- Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' # test EBCDIC or ASCII ! case `echo X|tr X '\101'` in ! A) # ASCII based system ! # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr ! SP2NL='tr \040 \012' ! NL2SP='tr \015\012 \040\040' ;; ! *) # EBCDIC based system ! SP2NL='tr \100 \n' ! NL2SP='tr \r\n \100\100' ;; esac *************** *** 107,114 **** fi # Make sure IFS has a sensible default ! : ${IFS=" ! "} if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then $echo "$modename: not configured to build any kind of library" 1>&2 --- 113,121 ---- fi # Make sure IFS has a sensible default ! lt_nl=' ! ' ! IFS=" $lt_nl" if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then $echo "$modename: not configured to build any kind of library" 1>&2 *************** *** 125,130 **** --- 132,139 ---- show="$echo" show_help= execute_dlfiles= + duplicate_deps=no + preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" *************** *** 132,144 **** # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. ! func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in --- 141,191 ---- # Shell function definitions: # This seems to be the best place for them + # func_mktempdir [string] + # Make a temporary directory that won't clash with other running + # libtool processes, and avoids race conditions if possible. If + # given, STRING is the basename for that directory. + func_mktempdir () + { + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $mkdir "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || { + $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 + exit $EXIT_FAILURE + } + fi + + $echo "X$my_tmpdir" | $Xsed + } + + # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. ! func_win32_libid () ! { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *************** *** 149,160 **** if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ ! sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` ! if test "X$win32_nmres" = "Ximport" ; then ! win32_libid_type="x86 archive import" ! else ! win32_libid_type="x86 archive static" ! fi fi ;; *DLL*) --- 196,206 ---- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ ! $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` ! case $win32_nmres in ! import*) win32_libid_type="x86 archive import";; ! *) win32_libid_type="x86 archive static";; ! esac fi ;; *DLL*) *************** *** 178,184 **** # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' ! func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do --- 224,231 ---- # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' ! func_infer_tag () ! { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do *************** *** 235,246 **** --- 282,397 ---- esac fi } + + + # func_extract_an_archive dir oldlib + func_extract_an_archive () + { + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + + $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" + $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 + exit $EXIT_FAILURE + fi + } + + # func_extract_archives gentop oldlib ... + func_extract_archives () + { + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + my_status="" + + $show "${rm}r $my_gentop" + $run ${rm}r "$my_gentop" + $show "$mkdir $my_gentop" + $run $mkdir "$my_gentop" + my_status=$? + if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then + exit $my_status + fi + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` + my_xdir="$my_gentop/$my_xlib" + + $show "${rm}r $my_xdir" + $run ${rm}r "$my_xdir" + $show "$mkdir $my_xdir" + $run $mkdir "$my_xdir" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then + exit $exit_status + fi + case $host in + *-darwin*) + $show "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + if test -z "$run"; then + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` + darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` + if test -n "$darwin_arches"; then + darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + $show "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we have a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + ${rm}r unfat-$$ + cd "$darwin_orig_dir" + else + cd "$darwin_orig_dir" + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + fi # $run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + func_extract_archives_result="$my_oldobjs" + } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" + disable_libs=no + # Parse our command line options once, thoroughly. while test "$#" -gt 0 do *************** *** 305,314 **** --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo ! $echo "Copyright (C) 2003 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 $EXIT_SUCCESS ;; --config) --- 456,465 ---- --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo ! $echo "Copyright (C) 2005 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 $? ;; --config) *************** *** 317,323 **** for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done ! exit $EXIT_SUCCESS ;; --debug) --- 468,474 ---- for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done ! exit $? ;; --debug) *************** *** 342,348 **** else $echo "disable static libraries" fi ! exit $EXIT_SUCCESS ;; --finish) mode="finish" ;; --- 493,499 ---- else $echo "disable static libraries" fi ! exit $? ;; --finish) mode="finish" ;; *************** *** 357,363 **** preserve_args="$preserve_args $arg" ;; ! --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift --- 508,518 ---- preserve_args="$preserve_args $arg" ;; ! --tag) ! prevopt="--tag" ! prev=tag ! preserve_args="$preserve_args --tag" ! ;; --tag=*) set tag "$optarg" ${1+"$@"} shift *************** *** 389,394 **** --- 544,561 ---- exit $EXIT_FAILURE fi + case $disable_libs in + no) + ;; + shared) + build_libtool_libs=no + build_old_libs=yes + ;; + static) + build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` + ;; + esac + # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. *************** *** 399,405 **** # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 ! $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link --- 566,572 ---- # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 ! $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link *************** *** 465,471 **** for arg do ! case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" --- 632,638 ---- for arg do ! case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" *************** *** 547,553 **** 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\"" ;; --- 714,723 ---- case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly ! # in scan sets, and some SunOS ksh mistreat backslash-escaping ! # in scan sets (worked around with variable expansion), ! # and furthermore cannot handle '|' '&' '(' ')' in scan sets ! # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; *************** *** 621,626 **** --- 791,804 ---- esac done + qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` + case $qlibobj in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qlibobj="\"$qlibobj\"" ;; + esac + test "X$libobj" != "X$qlibobj" \ + && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then *************** *** 693,704 **** $run $rm $removelist exit $EXIT_FAILURE fi ! $echo $srcfile > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi $run $rm "$libobj" "${libobj}T" --- 871,887 ---- $run $rm $removelist exit $EXIT_FAILURE fi ! $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi + qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` + case $qsrcfile in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qsrcfile="\"$qsrcfile\"" ;; + esac $run $rm "$libobj" "${libobj}T" *************** *** 720,737 **** fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then ! command="$base_compile $srcfile $pic_flag" else # Don't build PIC code ! command="$base_compile $srcfile" fi if test ! -d "${xdir}$objdir"; then $show "$mkdir ${xdir}$objdir" $run $mkdir ${xdir}$objdir ! status=$? ! if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then ! exit $status fi fi --- 903,920 ---- fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then ! command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code ! command="$base_compile $qsrcfile" fi if test ! -d "${xdir}$objdir"; then $show "$mkdir ${xdir}$objdir" $run $mkdir ${xdir}$objdir ! exit_status=$? ! if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then ! exit $exit_status fi fi *************** *** 803,811 **** if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code ! command="$base_compile $srcfile" else ! command="$base_compile $srcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" --- 986,994 ---- if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code ! command="$base_compile $qsrcfile" else ! command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" *************** *** 934,939 **** --- 1117,1123 ---- no_install=no objs= non_pic_objects= + notinst_path= # paths that contain not-installed libtool libraries precious_files_regex= prefer_static_libs=no preload=no *************** *** 962,975 **** if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes - prefer_static_libs=yes break ;; esac --- 1146,1160 ---- if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi + prefer_static_libs=yes else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi + prefer_static_libs=built fi build_libtool_libs=no build_old_libs=yes break ;; esac *************** *** 1144,1149 **** --- 1329,1339 ---- if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. *************** *** 1227,1232 **** --- 1417,1429 ---- prev= continue ;; + darwin_framework|darwin_framework_skip) + test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + prev= + continue + ;; *) eval "$prev=\"\$arg\"" prev= *************** *** 1285,1290 **** --- 1482,1499 ---- continue ;; + -framework|-arch|-isysroot) + case " $CC " in + *" ${arg} ${1} "* | *" ${arg} ${1} "*) + prev=darwin_framework_skip ;; + *) compiler_flags="$compiler_flags $arg" + prev=darwin_framework ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + continue + ;; + -inst-prefix-dir) prev=inst_prefix continue *************** *** 1311,1317 **** absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 ! exit $EXIT_FAILURE fi dir="$absdir" ;; --- 1520,1527 ---- absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 ! absdir="$dir" ! notinst_path="$notinst_path $dir" fi dir="$absdir" ;; *************** *** 1325,1334 **** --- 1535,1549 ---- esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac ;; esac continue *************** *** 1337,1351 **** -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in ! *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; ! *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; ! *-*-openbsd* | *-*-freebsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; --- 1552,1566 ---- -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in ! *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; ! *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; ! *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *************** *** 1353,1362 **** # 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 ;; --- 1568,1586 ---- # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; esac elif test "X$arg" = "X-lc_r"; then case $host in ! *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; *************** *** 1366,1373 **** continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) ! deplibs="$deplibs $arg" continue ;; --- 1590,1609 ---- continue ;; + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + -model) + compile_command="$compile_command $arg" + compiler_flags="$compiler_flags $arg" + finalize_command="$finalize_command $arg" + prev=xcompiler + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) ! compiler_flags="$compiler_flags $arg" ! compile_command="$compile_command $arg" ! finalize_command="$finalize_command $arg" continue ;; *************** *** 1376,1388 **** continue ;; ! # gcc -m* arguments should be passed to the linker via $compiler_flags ! # in order to pass architecture information to the linker ! # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo ! # but this is not reliable with gcc because gcc may use -mfoo to ! # select a different linker, different libraries, etc, while ! # -Wl,-mfoo simply passes -mfoo to the linker. ! -m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` --- 1612,1630 ---- continue ;; ! # -64, -mips[0-9] enable 64-bit mode on the SGI compiler ! # -r[0-9][0-9]* specifies the processor on the SGI compiler ! # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler ! # +DA*, +DD* enable 64-bit mode on the HP compiler ! # -q* pass through compiler args for the IBM compiler ! # -m* pass through architecture-specific compiler args for GCC ! # -m*, -t[45]*, -txscale* pass through architecture-specific ! # compiler args for GCC ! # -pg pass through profiling flag for GCC ! # @file GCC response files ! -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ ! -t[45]*|-txscale*|@*) ! # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` *************** *** 1393,1401 **** esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ! if test "$with_gcc" = "yes" ; then ! compiler_flags="$compiler_flags $arg" ! fi continue ;; --- 1635,1641 ---- esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ! compiler_flags="$compiler_flags $arg" continue ;; *************** *** 1633,1638 **** --- 1873,1883 ---- if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. *************** *** 1738,1746 **** 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 --- 1983,1991 ---- if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir ! exit_status=$? ! if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then ! exit $exit_status fi fi *************** *** 1803,1809 **** newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" --- 2048,2053 ---- *************** *** 1858,1864 **** compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else ! deplibs="$deplib $deplibs" fi continue ;; --- 2102,2108 ---- compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else ! compiler_flags="$compiler_flags $deplib" fi continue ;; *************** *** 1977,1983 **** fi case $linkmode in 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" --- 2221,2242 ---- fi case $linkmode in lib) ! valid_a_lib=no ! case $deplibs_check_method in ! match_pattern*) ! set dummy $deplibs_check_method ! match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` ! if eval $echo \"$deplib\" 2>/dev/null \ ! | $SED 10q \ ! | $EGREP "$match_pattern_regex" > /dev/null; then ! valid_a_lib=yes ! fi ! ;; ! pass_all) ! valid_a_lib=yes ! ;; ! esac ! if test "$valid_a_lib" != yes; 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" *************** *** 2027,2033 **** esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else ! $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi --- 2286,2292 ---- esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else ! $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi *************** *** 2051,2056 **** --- 2310,2317 ---- # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no + avoidtemprpath= + # Read the .la file case $lib in *************** *** 2149,2159 **** dir="$libdir" absdir="$libdir" fi else ! dir="$ladir/$objdir" ! absdir="$abs_ladir/$objdir" ! # Remove this search path later ! notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` --- 2410,2428 ---- dir="$libdir" absdir="$libdir" fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else ! if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then ! dir="$ladir" ! absdir="$abs_ladir" ! # Remove this search path later ! notinst_path="$notinst_path $abs_ladir" ! else ! dir="$ladir/$objdir" ! absdir="$abs_ladir/$objdir" ! # Remove this search path later ! notinst_path="$notinst_path $abs_ladir" ! fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` *************** *** 2226,2237 **** 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 --- 2495,2506 ---- 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" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; ! *) temp_rpath="$temp_rpath $absdir" ;; esac fi *************** *** 2268,2275 **** 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 --- 2537,2548 ---- fi link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes ; then + use_static_libs=no + fi if test -n "$library_names" && ! { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes *************** *** 2382,2392 **** if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in ! *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added ! if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo --- 2655,2669 ---- if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in ! *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; ! *-*-sysv4*uw2*) add_dir="-L$dir" ;; ! *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ ! *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added ! if /usr/bin/file -L $add 2> /dev/null | ! $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo *************** *** 2417,2423 **** add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then ! case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; --- 2694,2700 ---- add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then ! case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; *************** *** 2490,2496 **** add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then ! case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; --- 2767,2773 ---- add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then ! case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; *************** *** 2551,2558 **** fi fi else - convenience="$convenience $dir/$old_library" - old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi --- 2828,2833 ---- *************** *** 2670,2681 **** *) continue ;; esac case " $deplibs " in ! *" $depdepl "*) ;; ! *) deplibs="$depdepl $deplibs" ;; esac case " $deplibs " in ! *" $path "*) ;; ! *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no --- 2945,2956 ---- *) continue ;; esac case " $deplibs " in ! *" $path "*) ;; ! *) deplibs="$path $deplibs" ;; esac case " $deplibs " in ! *" $depdepl "*) ;; ! *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no *************** *** 2947,2953 **** case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) ! $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; --- 3222,3228 ---- case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) ! $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; *************** *** 2956,2962 **** case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) ! $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; --- 3231,3237 ---- case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) ! $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; *************** *** 2965,2971 **** case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) ! $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; --- 3240,3246 ---- case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) ! $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; *************** *** 2991,2997 **** versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` ! verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) --- 3266,3272 ---- versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` ! verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) *************** *** 3144,3152 **** # 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 --- 3419,3427 ---- # 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 *************** *** 3197,3205 **** *-*-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. --- 3472,3485 ---- *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; ! *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ! ;; ! *-*-sco3.2v5* | *-*-sco5v6*) ! # Causes problems with __ctype ! ;; ! *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) ! # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. *************** *** 3243,3253 **** 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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then --- 3523,3533 ---- int main() { return 0; } EOF $rm conftest ! $LTCC $LTCFLAGS -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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then *************** *** 3284,3294 **** # Error occurred 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` --- 3564,3574 ---- # Error occurred 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 $LTCFLAGS -o conftest conftest.c $i # Did it work? if test "$?" -eq 0 ; then ldd_output=`ldd conftest` *************** *** 3336,3342 **** set dummy $deplibs_check_method file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then --- 3616,3622 ---- set dummy $deplibs_check_method file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then *************** *** 3405,3411 **** set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then --- 3685,3691 ---- set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` 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 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then *************** *** 3535,3540 **** --- 3815,3849 ---- deplibs=$newdeplibs fi + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). library_names= old_library= *************** *** 3618,3623 **** --- 3927,3933 ---- fi lib="$output_objdir/$realname" + linknames= for link do linknames="$linknames $link" *************** *** 3646,3651 **** --- 3956,3964 ---- # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break fi done IFS="$save_ifs" *************** *** 3679,3745 **** 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" ! for xlib in $convenience; do ! # Extract the objects. ! case $xlib in ! [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; ! *) xabs=`pwd`"/$xlib" ;; ! esac ! xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` ! xdir="$gentop/$xlib" ! ! $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 ! # We will extract separately just the conflicting names and we will no ! # longer touch any unique names. It is faster to leave these extract ! # automatically by $AR in one run. ! $show "(cd $xdir && $AR x $xabs)" ! $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then ! : ! else ! $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 ! $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 ! $AR t "$xabs" | sort | uniq -cd | while read -r count name ! do ! i=1 ! while test "$i" -le "$count" ! do ! # Put our $i before any first dot (extension) ! # Never overwrite any file ! name_to="$name" ! while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" ! do ! name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` ! done ! $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" ! $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? ! i=`expr $i + 1` ! done ! done ! fi ! ! libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` ! done fi fi ! if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" --- 3992,4004 ---- eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" ! func_extract_archives $gentop $convenience ! libobjs="$libobjs $func_extract_archives_result" fi fi ! if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" *************** *** 3769,3775 **** fi fi ! if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else --- 4028,4035 ---- fi fi ! if test "X$skipped_export" != "X:" && ! len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else *************** *** 3788,3793 **** --- 4048,4054 ---- save_libobjs=$libobjs fi save_output=$output + output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. *************** *** 3797,3809 **** 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 --- 4058,4070 ---- delfiles= last_robj= k=1 ! output=$output_objdir/$output_la-${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" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else *************** *** 3817,3825 **** # 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 --- 4078,4086 ---- # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi ! last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` ! output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi *************** *** 3839,3851 **** 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" --- 4100,4112 ---- eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi ! # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` ! delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" *************** *** 3893,3905 **** IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" ! $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi --- 4154,4183 ---- IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" ! $run eval "$cmd" || { ! lt_exit=$? ! ! # Restore the uninstalled library and exit ! if test "$mode" = relink; then ! $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' ! fi ! ! exit $lt_exit ! } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + fi + fi + exit $EXIT_SUCCESS fi *************** *** 3977,4040 **** eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else 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" ! for xlib in $convenience; do ! # Extract the objects. ! case $xlib in ! [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; ! *) xabs=`pwd`"/$xlib" ;; ! esac ! xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` ! xdir="$gentop/$xlib" ! ! $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 ! # We will extract separately just the conflicting names and we will no ! # longer touch any unique names. It is faster to leave these extract ! # automatically by $AR in one run. ! $show "(cd $xdir && $AR x $xabs)" ! $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then ! : ! else ! $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 ! $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 ! $AR t "$xabs" | sort | uniq -cd | while read -r count name ! do ! i=1 ! while test "$i" -le "$count" ! do ! # Put our $i before any first dot (extension) ! # Never overwrite any file ! name_to="$name" ! while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" ! do ! name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` ! done ! $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" ! $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? ! i=`expr $i + 1` ! done ! done ! fi ! ! reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` ! done fi fi --- 4255,4264 ---- eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" ! func_extract_archives $gentop $convenience ! reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi *************** *** 4135,4140 **** --- 4359,4393 ---- ;; esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" *************** *** 4179,4188 **** --- 4432,4446 ---- fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac ;; esac done *************** *** 4296,4308 **** # Prepare the list of exported symbols 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 fi --- 4554,4578 ---- # Prepare the list of exported symbols if test -z "$export_symbols"; then ! export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols ! $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' ! case $host in ! *cygwin* | *mingw* ) ! $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' ! $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ! ;; ! esac else ! $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' ! $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* ) + $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac fi fi *************** *** 4353,4359 **** --- 4623,4648 ---- #endif /* The mapping between symbol names and symbols. */ + " + + case $host in + *cygwin* | *mingw* ) + $echo >> "$output_objdir/$dlsyms" "\ + /* DATA imports from DLLs on WIN32 can't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs */ + struct { + " + ;; + * ) + $echo >> "$output_objdir/$dlsyms" "\ const struct { + " + ;; + esac + + + $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } *************** *** 4400,4415 **** 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" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. ! compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ! finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 --- 4689,4717 ---- esac # Now compile the dynamic symbol file. ! $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" ! $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. ! case $host in ! *cygwin* | *mingw* ) ! if test -f "$output_objdir/${outputname}.def" ; then ! compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` ! finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` ! else ! compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ! finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ! fi ! ;; ! * ) ! compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ! finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ! ;; ! esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 *************** *** 4434,4440 **** # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" ! status=$? # Delete the generated files. if test -n "$dlsyms"; then --- 4736,4742 ---- # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" ! exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then *************** *** 4442,4448 **** $run $rm "$output_objdir/${outputname}S.${objext}" fi ! exit $status fi if test -n "$shlibpath_var"; then --- 4744,4750 ---- $run $rm "$output_objdir/${outputname}S.${objext}" fi ! exit $exit_status fi if test -n "$shlibpath_var"; then *************** *** 4582,4591 **** esac case $host in *cygwin* | *mingw* ) ! cwrappersource=`$echo ${objdir}/lt-${output}.c` ! cwrapper=`$echo ${output}.exe` ! $rm $cwrappersource $cwrapper ! trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource < $cwrappersource < #include #include + #include + #include + #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX *************** *** 4620,4634 **** #endif #ifndef DIR_SEPARATOR ! #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) ! #define HAVE_DOS_BASED_FILE_SYSTEM ! #ifndef DIR_SEPARATOR_2 ! #define DIR_SEPARATOR_2 '\\' ! #endif #endif #ifndef DIR_SEPARATOR_2 --- 4927,4945 ---- #endif #ifndef DIR_SEPARATOR ! # define DIR_SEPARATOR '/' ! # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) ! # define HAVE_DOS_BASED_FILE_SYSTEM ! # ifndef DIR_SEPARATOR_2 ! # define DIR_SEPARATOR_2 '\\' ! # endif ! # ifndef PATH_SEPARATOR_2 ! # define PATH_SEPARATOR_2 ';' ! # endif #endif #ifndef DIR_SEPARATOR_2 *************** *** 4638,4654 **** (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); ! char * basename (const char *name); ! char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); --- 4949,4980 ---- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ + #ifndef PATH_SEPARATOR_2 + # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) + #else /* PATH_SEPARATOR_2 */ + # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) + #endif /* PATH_SEPARATOR_2 */ + #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) + /* -DDEBUG is fairly common in CFLAGS. */ + #undef DEBUG + #if defined DEBUGWRAPPER + # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) + #else + # define DEBUG(format, ...) + #endif + const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); ! const char * base_name (const char *name); ! char * find_executable(const char *wrapper); ! int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); *************** *** 4658,4686 **** char **newargz; int i; ! program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF ! cat >> $cwrappersource <> $cwrappersource <<"EOF" ! newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF ! cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * --- 4984,5034 ---- char **newargz; int i; ! program_name = (char *) xstrdup (base_name (argv[0])); ! DEBUG("(main) argv[0] : %s\n",argv[0]); ! DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF ! cat >> $cwrappersource <> $cwrappersource <<"EOF" ! newargz[1] = find_executable(argv[0]); ! if (newargz[1] == NULL) ! lt_fatal("Couldn't find %s", argv[0]); ! DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; + + for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" ! return 127; } void * *************** *** 4700,4747 **** ; } ! char * ! basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ ! if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; ! return (char *) base; } char * ! fnqualify(const char *path) { ! size_t size; ! char *p; char tmp[LT_PATHMAX + 1]; ! assert(path != NULL); ! /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) ! if (isalpha (path[0]) && path[1] == ':') ! return xstrdup (path); #endif - if (IS_DIR_SEPARATOR (path[0])) - return xstrdup (path); ! /* prepend the current directory */ ! /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); ! size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ ! p = XMALLOC(char, size); ! sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); ! return p; } char * --- 5048,5195 ---- ; } ! const char * ! base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ ! if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; ! return base; } + int + check_executable(const char * path) + { + struct stat st; + + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); + if ((!path) || (!*path)) + return 0; + + if ((stat (path, &st) >= 0) && + ( + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ + #if defined (S_IXOTH) + ((st.st_mode & S_IXOTH) == S_IXOTH) || + #endif + #if defined (S_IXGRP) + ((st.st_mode & S_IXGRP) == S_IXGRP) || + #endif + ((st.st_mode & S_IXUSR) == S_IXUSR)) + ) + return 1; + else + return 0; + } + + /* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise */ char * ! find_executable (const char* wrapper) { ! int has_slash = 0; ! const char* p; ! const char* p_next; ! /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; + int tmp_len; + char* concat_name; ! DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); ! if ((wrapper == NULL) || (*wrapper == '\0')) ! return NULL; ! ! /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) ! if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') ! { ! concat_name = xstrdup (wrapper); ! if (check_executable(concat_name)) ! return concat_name; ! XFREE(concat_name); ! } ! else ! { ! #endif ! if (IS_DIR_SEPARATOR (wrapper[0])) ! { ! concat_name = xstrdup (wrapper); ! if (check_executable(concat_name)) ! return concat_name; ! XFREE(concat_name); ! } ! #if defined (HAVE_DOS_BASED_FILE_SYSTEM) ! } #endif ! for (p = wrapper; *p; p++) ! if (*p == '/') ! { ! has_slash = 1; ! break; ! } ! if (!has_slash) ! { ! /* no slashes; search PATH */ ! const char* path = getenv ("PATH"); ! if (path != NULL) ! { ! for (p = path; *p; p = p_next) ! { ! const char* q; ! size_t p_len; ! for (q = p; *q; q++) ! if (IS_PATH_SEPARATOR(*q)) ! break; ! p_len = q - p; ! p_next = (*q == '\0' ? q : q + 1); ! if (p_len == 0) ! { ! /* empty path: current directory */ ! if (getcwd (tmp, LT_PATHMAX) == NULL) ! lt_fatal ("getcwd failed"); ! tmp_len = strlen(tmp); ! concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); ! memcpy (concat_name, tmp, tmp_len); ! concat_name[tmp_len] = '/'; ! strcpy (concat_name + tmp_len + 1, wrapper); ! } ! else ! { ! concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); ! memcpy (concat_name, p, p_len); ! concat_name[p_len] = '/'; ! strcpy (concat_name + p_len + 1, wrapper); ! } ! if (check_executable(concat_name)) ! return concat_name; ! XFREE(concat_name); ! } ! } ! /* not found in PATH; assume curdir */ ! } ! /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); ! tmp_len = strlen(tmp); ! concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); ! memcpy (concat_name, tmp, tmp_len); ! concat_name[tmp_len] = '/'; ! strcpy (concat_name + tmp_len + 1, wrapper); ! ! if (check_executable(concat_name)) ! return concat_name; ! XFREE(concat_name); ! return NULL; } char * *************** *** 4785,4800 **** va_end (ap); } EOF ! # we should really use a build-platform specific compiler ! # here, but OTOH, the wrappers (shell script and this C one) ! # are only useful if you want to execute the "real" binary. ! # Since the "real" binary is built for $host, then this ! # wrapper might as well be built for $host, too. ! $run $LTCC -s -o $cwrapper $cwrappersource ! ;; ! esac ! $rm $output ! trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL --- 5233,5248 ---- va_end (ap); } EOF ! # we should really use a build-platform specific compiler ! # here, but OTOH, the wrappers (shell script and this C one) ! # are only useful if you want to execute the "real" binary. ! # Since the "real" binary is built for $host, then this ! # wrapper might as well be built for $host, too. ! $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ! ;; ! esac ! $rm $output ! trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL *************** *** 4815,4821 **** # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. ! if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi relink_command=\"$relink_command\" --- 5263,5269 ---- # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. ! (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" *************** *** 4944,4956 **** # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ ! exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ ! exec \$progdir/\$program \${1+\"\$@\"} " ;; esac --- 5392,5404 ---- # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ ! exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ ! exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac *************** *** 4960,4966 **** fi else # The program doesn't exist. ! \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE --- 5408,5414 ---- fi else # The program doesn't exist. ! \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE *************** *** 4992,5062 **** if test -n "$addlibs"; then 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" ! # Add in members from convenience archives. ! for xlib in $addlibs; do ! # Extract the objects. ! case $xlib in ! [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; ! *) xabs=`pwd`"/$xlib" ;; ! esac ! xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` ! xdir="$gentop/$xlib" ! ! $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 ! # We will extract separately just the conflicting names and we will no ! # longer touch any unique names. It is faster to leave these extract ! # automatically by $AR in one run. ! $show "(cd $xdir && $AR x $xabs)" ! $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? ! if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then ! : ! else ! $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 ! $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 ! $AR t "$xabs" | sort | uniq -cd | while read -r count name ! do ! i=1 ! while test "$i" -le "$count" ! do ! # Put our $i before any first dot (extension) ! # Never overwrite any file ! name_to="$name" ! while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" ! do ! name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` ! done ! $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" ! $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? ! i=`expr $i + 1` ! done ! done ! fi ! ! oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` ! done fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && --- 5440,5512 ---- if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" ! func_extract_archives $gentop $addlibs ! oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "copying selected object files to avoid basename conflicts..." + + if test -z "$gentop"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + exit_status=$? + if test "$exit_status" -ne 0 && test ! -d "$gentop"; then + exit $exit_status + fi + fi + + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + counter=`expr $counter + 1` + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + $run ln "$obj" "$gentop/$newobj" || + $run cp "$obj" "$gentop/$newobj" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && *************** *** 5070,5089 **** 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 # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do --- 5520,5526 ---- objlist= concat_cmds= save_oldobjs=$oldobjs ! # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do *************** *** 5094,5100 **** 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 --- 5531,5537 ---- oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" ! if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else *************** *** 5291,5301 **** # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. ! $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac --- 5728,5738 ---- # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. ! $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac *************** *** 5304,5317 **** shift else install_prog= ! arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac --- 5741,5754 ---- shift else install_prog= ! arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac *************** *** 5329,5356 **** do if test -n "$dest"; then files="$files $dest" ! dest="$arg" continue fi case $arg in -d) isdir=yes ;; ! -f) prev="-f" ;; ! -g) prev="-g" ;; ! -m) prev="-m" ;; ! -o) prev="-o" ;; -s) stripme=" -s" continue ;; ! -*) ;; ! *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else ! dest="$arg" continue fi ;; --- 5766,5796 ---- do if test -n "$dest"; then files="$files $dest" ! dest=$arg continue fi case $arg in -d) isdir=yes ;; ! -f) ! case " $install_prog " in ! *[\\\ /]cp\ *) ;; ! *) prev=$arg ;; ! esac ! ;; ! -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; ! -*) ! ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else ! dest=$arg continue fi ;; *************** *** 5359,5365 **** # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) arg="\"$arg\"" ;; esac --- 5799,5805 ---- # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in ! *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac *************** *** 5528,5538 **** if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then ! $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" ! $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi --- 5968,5981 ---- if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then ! $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" ! $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi *************** *** 5545,5551 **** IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" ! $run eval "$cmd" || exit $? done IFS="$save_ifs" fi --- 5988,6003 ---- IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" ! $run eval "$cmd" || { ! lt_exit=$? ! ! # Restore the uninstalled library and exit ! if test "$mode" = relink; then ! $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' ! fi ! ! exit $lt_exit ! } done IFS="$save_ifs" fi *************** *** 5639,5655 **** notinst_deplibs= relink_command= ! # To insure that "foo" is sourced, and not "foo.exe", ! # finese the cygwin/MSYS system by explicitly sourcing "foo." ! # which disallows the automatic-append-.exe behavior. ! case $build in ! *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; ! *) wrapperdot=${wrapper} ;; ! esac # If there is no directory component, then add one. ! case $file in ! */* | *\\*) . ${wrapperdot} ;; ! *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. --- 6091,6105 ---- notinst_deplibs= relink_command= ! # Note that it is not necessary on cygwin/mingw to append a dot to ! # foo even if both foo and FILE.exe exist: automatic-append-.exe ! # behavior happens only for exec(3), not for open(2)! Also, sourcing ! # `FILE.' does not work on cygwin managed mounts. ! # # If there is no directory component, then add one. ! case $wrapper in ! */* | *\\*) . ${wrapper} ;; ! *) . ./${wrapper} ;; esac # Check the variables that should have been set. *************** *** 5677,5710 **** done relink_command= ! # To insure that "foo" is sourced, and not "foo.exe", ! # finese the cygwin/MSYS system by explicitly sourcing "foo." ! # which disallows the automatic-append-.exe behavior. ! case $build in ! *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; ! *) wrapperdot=${wrapper} ;; ! esac # If there is no directory component, then add one. ! case $file in ! */* | *\\*) . ${wrapperdot} ;; ! *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then ! tmpdir="/tmp" ! test -n "$TMPDIR" && tmpdir="$TMPDIR" ! tmpdir="$tmpdir/libtool-$$" ! save_umask=`umask` ! umask 0077 ! if $mkdir "$tmpdir"; then ! umask $save_umask ! else ! umask $save_umask ! $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. --- 6127,6147 ---- done relink_command= ! # Note that it is not necessary on cygwin/mingw to append a dot to ! # foo even if both foo and FILE.exe exist: automatic-append-.exe ! # behavior happens only for exec(3), not for open(2)! Also, sourcing ! # `FILE.' does not work on cygwin managed mounts. ! # # If there is no directory component, then add one. ! case $wrapper in ! */* | *\\*) . ${wrapper} ;; ! *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then ! tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. *************** *** 5728,5734 **** 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 --- 6165,6171 ---- fi # remove .exe since cygwin /usr/bin/install will append another ! # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *************** *** 5828,5834 **** # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS ! $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" --- 6265,6271 ---- # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS ! $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" *************** *** 5861,5867 **** $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." ! $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; --- 6298,6304 ---- $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." ! $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; *************** *** 6078,6086 **** 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. cmds=$postuninstall_cmds --- 6515,6531 ---- rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" ! case "$mode" in ! clean) ! case " $library_names " in ! # " " in the beginning catches empty $dlname ! *" $dlname "*) ;; ! *) rmfiles="$rmfiles $objdir/$dlname" ;; ! esac ! test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ! ;; ! uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds *************** *** 6113,6119 **** IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ! fi fi ;; --- 6558,6565 ---- IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ! ;; ! esac fi ;; *************** *** 6398,6404 **** $echo $echo "Try \`$modename --help' for more information about other modes." ! exit $EXIT_SUCCESS # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting --- 6844,6850 ---- $echo $echo "Try \`$modename --help' for more information about other modes." ! exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting *************** *** 6412,6423 **** # 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: --- 6858,6868 ---- # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared ! disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static ! disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: