Deleted Added
full compact
4c4
< # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
---
> # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
26a27,54
> basename="s,^.*/,,g"
>
> # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
> # is ksh but when the shell is invoked as "sh" and the current value of
> # the _XPG environment variable is not equal to 1 (one), the special
> # positional parameter $0, within a function call, is the name of the
> # function.
> progpath="$0"
>
> # The name of this program:
> progname=`echo "$progpath" | $SED $basename`
> modename="$progname"
>
> # Global variables:
> EXIT_SUCCESS=0
> EXIT_FAILURE=1
>
> PROGRAM=ltmain.sh
> PACKAGE=libtool
> VERSION=1.5.10
> TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)"
>
> # 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
>
39c67
< exec $SHELL "$0" --no-reexec ${1+"$@"}
---
> exec $SHELL "$progpath" --no-reexec ${1+"$@"}
48c76
< exit 0
---
> exit $EXIT_SUCCESS
51,60d78
< # The name of this program.
< progname=`$echo "$0" | ${SED} 's%^.*/%%'`
< modename="$progname"
<
< # Constants.
< PROGRAM=ltmain.sh
< PACKAGE=libtool
< VERSION=1.4.3
< TIMESTAMP=" (1.922.2.110 2002/10/23 01:39:54)"
<
72,82c90,100
< # 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
---
> # 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
97c115,116
< : ${IFS=" "}
---
> : ${IFS="
> "}
100,102c119,121
< echo "$modename: not configured to build any kind of library" 1>&2
< echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
< exit 1
---
> $echo "$modename: not configured to build any kind of library" 1>&2
> $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
> exit $EXIT_FAILURE
116a136,364
> #####################################
> # 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
> *ar\ archive\ import\ library*) # definitely import
> win32_libid_type="x86 archive import"
> ;;
> *ar\ archive*) # could be an import, or static
> 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*)
> win32_libid_type="x86 DLL"
> ;;
> *executable*) # but shell scripts are "executable" too...
> case $win32_fileres in
> *MS\ Windows\ PE\ Intel*)
> win32_libid_type="x86 DLL"
> ;;
> esac
> ;;
> esac
> $echo $win32_libid_type
> }
>
>
> # func_infer_tag arg
> # 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.
> # 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
> case $arg in
> *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
> arg="\"$arg\""
> ;;
> esac
> CC_quoted="$CC_quoted $arg"
> done
> case $@ in
> # Blanks in the command may have been stripped by the calling shell,
> # but not from the CC environment variable when configure was run.
> " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
> # 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$" < "$progpath" > /dev/null; then
> # Evaluate the configuration.
> eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
> CC_quoted=
> for arg in $CC; do
> # Double-quote args containing other shell metacharacters.
> case $arg in
> *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
> arg="\"$arg\""
> ;;
> esac
> CC_quoted="$CC_quoted $arg"
> done
> case "$@ " in
> " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
> # 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 $EXIT_FAILURE
> # else
> # $echo "$modename: using $tagname tagged configuration"
> fi
> ;;
> esac
> 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"
> status=$?
> if test "$status" -ne 0 && test ! -d "$my_xdir"; then
> 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=`basename $darwin_archive`
> 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}"
> # Remove the table of contents from the thin files.
> $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
> $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
> cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
> $AR -xo "${darwin_base_archive}"
> rm "${darwin_base_archive}"
> cd "$darwin_curdir"
> done # $darwin_arches
> ## Okay now we have a bunch of thin objects, gotta fatten them up :)
> darwin_filelist=`find unfat-$$ -type f | 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 -rf unfat-$$
> cd "$darwin_orig_dir"
> else
> cd $darwin_orig_dir
> (cd $my_xdir && $AR x $my_xabs) || exit $?
> fi # $darwin_arches
> fi # $run
> ;;
> *)
> # 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 $my_xdir && $AR x $my_xabs)"
> $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
> if ($AR t "$my_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 "$my_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 "$my_xdir/$name_to"
> do
> name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
> done
> $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
> $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
> i=`expr $i + 1`
> done
> done
> fi
> ;;
> 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\"
>
118c366
< while test $# -gt 0
---
> while test "$#" -gt 0
133a382,409
> tag)
> tagname="$arg"
> preserve_args="${preserve_args}=$arg"
>
> # Check whether tagname contains only valid characters
> case $tagname in
> *[!-_A-Za-z0-9,/]*)
> $echo "$progname: invalid tag name: $tagname" 1>&2
> exit $EXIT_FAILURE
> ;;
> 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$" < "$progpath" > /dev/null; then
> taglist="$taglist $tagname"
> # Evaluate the configuration.
> eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
> else
> $echo "$progname: ignoring unknown tag $tagname" 1>&2
> fi
> ;;
> esac
> ;;
151,152c427,432
< echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
< exit 0
---
> $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
156,157c436,441
< ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
< exit 0
---
> ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
> # 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" < "$progpath"
> done
> exit $EXIT_SUCCESS
161c445
< echo "$progname: enabling shell trace mode"
---
> $echo "$progname: enabling shell trace mode"
162a447
> preserve_args="$preserve_args $arg"
170c455
< echo "host: $host"
---
> $echo "host: $host"
172c457
< echo "enable shared libraries"
---
> $echo "enable shared libraries"
174c459
< echo "disable shared libraries"
---
> $echo "disable shared libraries"
177c462
< echo "enable static libraries"
---
> $echo "enable static libraries"
179c464
< echo "disable static libraries"
---
> $echo "disable static libraries"
181c466
< exit 0
---
> exit $EXIT_SUCCESS
192a478
> preserve_args="$preserve_args $arg"
194a481,488
> --tag) prevopt="--tag" prev=tag ;;
> --tag=*)
> set tag "$optarg" ${1+"$@"}
> shift
> prev=tag
> preserve_args="$preserve_args --tag"
> ;;
>
203c497
< exit 1
---
> exit $EXIT_FAILURE
216c510
< exit 1
---
> exit $EXIT_FAILURE
227a522,523
> $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
> $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
229c525
< *cc | *++ | gcc* | *-gcc* | xlc*)
---
> *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
270c566
< exit 1
---
> exit $EXIT_FAILURE
284,286c580,581
< prev=
< lastarg=
< srcfile="$nonopt"
---
> srcfile="$nonopt" # always keep a non-empty value in "srcfile"
> suppress_opt=yes
287a583,585
> arg_mode=normal
> libobj=
> later=
289d586
< user_target=no
292,297c589,594
< case $prev in
< "") ;;
< xcompiler)
< # Aesthetically quote the previous argument.
< prev=
< lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
---
> case "$arg_mode" in
> arg )
> # do not "continue". Instead, add this to base_compile
> lastarg="$arg"
> arg_mode=normal
> ;;
299,313c596,598
< 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
---
> target )
> libobj="$arg"
> arg_mode=normal
316d600
< esac
318,326c602,612
< # 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
< ;;
---
> 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 $EXIT_FAILURE
> fi
> arg_mode=target
> continue
> ;;
328,331c614,617
< -static)
< build_old_libs=yes
< continue
< ;;
---
> -static | -prefer-pic | -prefer-non-pic)
> later="$later $arg"
> continue
> ;;
333,336c619,622
< -prefer-pic)
< pic_mode=yes
< continue
< ;;
---
> -no-suppress)
> suppress_opt=no
> continue
> ;;
338,341c624,627
< -prefer-non-pic)
< pic_mode=no
< continue
< ;;
---
> -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.
343,346c629,634
< -Xcompiler)
< prev=xcompiler
< continue
< ;;
---
> -Wc,*)
> args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
> lastarg=
> save_ifs="$IFS"; IFS=','
> for arg in $args; do
> IFS="$save_ifs"
348,352c636,645
< -Wc,*)
< args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
< lastarg=
< save_ifs="$IFS"; IFS=','
< for arg in $args; do
---
> # Double-quote args containing other shell metacharacters.
> # Many Bourne shells cannot handle close brackets correctly
> # in scan sets, so we specify it separately.
> case $arg in
> *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
> arg="\"$arg\""
> ;;
> esac
> lastarg="$lastarg $arg"
> done
353a647
> lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
355,371c649
< # Double-quote args containing other shell metacharacters.
< # Many Bourne shells cannot handle close brackets correctly
< # in scan sets, so we specify it separately.
< case $arg in
< *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
< arg="\"$arg\""
< ;;
< esac
< lastarg="$lastarg $arg"
< done
< IFS="$save_ifs"
< lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
<
< # Add the arguments to base_compile.
< if test -z "$base_compile"; then
< base_compile="$lastarg"
< else
---
> # Add the arguments to base_compile.
373,376c651,652
< fi
< continue
< ;;
< esac
---
> continue
> ;;
378,382c654,661
< case $user_target in
< next)
< # The next one is the -o target name
< user_target=yes
< continue
---
> * )
> # Accept the current argument as the source file.
> # The previous "srcfile" becomes the current argument.
> #
> lastarg="$srcfile"
> srcfile="$arg"
> ;;
> esac # case $arg
384,390c663
< yes)
< # We got the output file
< user_target=set
< libobj="$arg"
< continue
< ;;
< esac
---
> esac # case $arg_mode
392,395d664
< # Accept the current argument as the source file.
< lastarg="$srcfile"
< srcfile="$arg"
<
397,400d665
<
< # Backslashify any backslashes, double quotes, and dollar signs.
< # These are the only characters that are still specially
< # interpreted inside of double-quoted scrings.
402a668
> case $lastarg in
406d671
< case $lastarg in
412,418c677,678
< # Add the previous argument to base_compile.
< if test -z "$base_compile"; then
< base_compile="$lastarg"
< else
< base_compile="$base_compile $lastarg"
< fi
< done
---
> base_compile="$base_compile $lastarg"
> done # for arg
420,421c680,683
< case $user_target in
< set)
---
> case $arg_mode in
> arg)
> $echo "$modename: you must specify an argument for -Xcompile"
> exit $EXIT_FAILURE
423,425c685,687
< no)
< # Get the name of the library object.
< libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
---
> target)
> $echo "$modename: you must specify a target with \`-o'" 1>&2
> exit $EXIT_FAILURE
428,429c690,691
< $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%^.*/%%'`
435c697
< xform='[cCFSfmso]'
---
> xform='[cCFSifmso]'
442a705,706
> *.ii) xform=ii ;;
> *.class) xform=class ;;
446a711
> *.java) xform=java ;;
455c720
< exit 1
---
> exit $EXIT_FAILURE
458a724,753
> func_infer_tag $base_compile
>
> for arg in $later; do
> case $arg in
> -static)
> build_old_libs=yes
> continue
> ;;
>
> -prefer-pic)
> pic_mode=yes
> continue
> ;;
>
> -prefer-non-pic)
> pic_mode=no
> continue
> ;;
> esac
> done
>
> 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
>
462c757
< exit 1
---
> exit $EXIT_FAILURE
467c762
< removelist="$obj $libobj"
---
> removelist="$obj $lobj $libobj ${libobj}T"
469c764
< removelist="$libobj"
---
> removelist="$lobj $libobj ${libobj}T"
473c768
< trap "$run $rm $removelist; exit 1" 1 2 15
---
> trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
492c787
< trap "$run $rm $removelist; exit 1" 1 2 15
---
> trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
493a789
> output_obj=
501c797
< until $run ln "$0" "$lockfile" 2>/dev/null; do
---
> until $run ln "$progpath" "$lockfile" 2>/dev/null; do
507c803
< echo "\
---
> $echo "\
519c815
< exit 1
---
> exit $EXIT_FAILURE
521c817
< echo $srcfile > "$lockfile"
---
> $echo $srcfile > "$lockfile"
527a824,837
> $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 <<EOF
> # $libobj - a libtool object file
> # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
> #
> # Please DO NOT delete this file!
> # It is necessary for linking the library.
>
> # Name of the PIC object.
> EOF
>
534,535c844
< # All platforms use -DPIC, to notify preprocessed assembler code.
< command="$base_compile $srcfile $pic_flag -DPIC"
---
> command="$base_compile $srcfile $pic_flag"
540,548d848
< 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%^.*/%%'`
550,559c850,855
< 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
---
> 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
562,567c858,861
< 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"
---
>
> if test -z "$output_obj"; then
> # Place PIC objects in $objdir
> command="$command -o $lobj"
570c864,865
< $run $rm "$output_obj"
---
> $run $rm "$lobj" "$output_obj"
>
575c870
< exit 1
---
> exit $EXIT_FAILURE
579,580c874,875
< test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
< echo "\
---
> test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
> $echo "\
595c890
< exit 1
---
> exit $EXIT_FAILURE
599,601c894,896
< if test x"$output_obj" != x"$libobj"; then
< $show "$mv $output_obj $libobj"
< if $run $mv $output_obj $libobj; then :
---
> if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
> $show "$mv $output_obj $lobj"
> if $run $mv $output_obj $lobj; then :
609,616c904,906
< # 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
---
> # Append the name of the PIC object to the libtool object file.
> test -z "$run" && cat >> ${libobj}T <<EOF
> pic_object='$objdir/$objname'
618,624c908
< $show "$mv $libobj $obj"
< if $run $mv $libobj $obj; then :
< else
< error=$?
< $run $rm $removelist
< exit $error
< fi
---
> EOF
626,646c910,912
< 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
---
> # Allow error messages only from the first compilation.
> if test "$suppress_opt" = yes; then
> suppress_output=' >/dev/null 2>&1'
647a914,918
> else
> # No PIC object so indicate it doesn't exist in the libtool
> # object file.
> test -z "$run" && cat >> ${libobj}T <<EOF
> pic_object=none
649,650c920
< # Allow error messages only from the first compilation.
< suppress_output=' >/dev/null 2>&1'
---
> EOF
659,660c929
< # All platforms use -DPIC, to notify preprocessed assembler code.
< command="$base_compile $srcfile $pic_flag -DPIC"
---
> command="$base_compile $srcfile $pic_flag"
664d932
< output_obj="$obj"
669c937
< $run $rm "$output_obj"
---
> $run $rm "$obj" "$output_obj"
674c942
< exit 1
---
> exit $EXIT_FAILURE
678,679c946,947
< test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
< echo "\
---
> test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
> $echo "\
694c962
< exit 1
---
> exit $EXIT_FAILURE
698c966
< if test x"$output_obj" != x"$obj"; then
---
> if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
708,722c976,990
< # 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
---
> # 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 <<EOF
> # Name of the non-PIC object.
> non_pic_object='$objname'
>
> EOF
> else
> # 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 <<EOF
> # Name of the non-PIC object.
> non_pic_object=none
>
> EOF
724a993,994
> $run $mv "${libobj}T" "${libobj}"
>
730c1000
< exit 0
---
> exit $EXIT_SUCCESS
741c1011
< # flag for every libtool invokation.
---
> # flag for every libtool invocation.
755a1026
> base_compile="$nonopt $@"
770a1042
> inst_prefix_dir=
784a1057,1058
> non_pic_objects=
> precious_files_regex=
795a1070
> vinfo_number=no
796a1072,1073
> func_infer_tag $base_compile
>
826c1103
< while test $# -gt 0; do
---
> while test "$#" -gt 0; do
891c1168
< exit 1
---
> exit $EXIT_FAILURE
900a1178,1187
> inst_prefix)
> inst_prefix_dir="$arg"
> prev=
> continue
> ;;
> precious_regex)
> precious_files_regex="$arg"
> prev=
> continue
> ;;
905a1193,1299
> 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 | grep "^# 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 $EXIT_FAILURE
> 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 $EXIT_FAILURE
> 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 $EXIT_FAILURE
> fi
> arg=$save_arg
> prev=
> continue
> ;;
912c1306
< exit 1
---
> exit $EXIT_FAILURE
943a1338,1350
> xcclinker)
> linker_flags="$linker_flags $qarg"
> compiler_flags="$compiler_flags $qarg"
> prev=
> compile_command="$compile_command $qarg"
> finalize_command="$finalize_command $qarg"
> continue
> ;;
> shrext)
> shrext_cmds="$arg"
> prev=
> continue
> ;;
950c1357
< fi # test -n $prev
---
> fi # test -n "$prev"
992c1399
< exit 1
---
> exit $EXIT_FAILURE
1001a1409,1413
> -inst-prefix-dir)
> prev=inst_prefix
> continue
> ;;
>
1006c1418
< no/*-*-irix* | no/*-*-nonstopux*)
---
> no/*-*-irix* | /*-*-irix*)
1023c1435
< exit 1
---
> exit $EXIT_FAILURE
1061,1065c1473,1475
< esac
< elif test "X$arg" = "X-lc_r"; then
< case $host in
< *-*-openbsd* | *-*-freebsd4*)
< # Do not include libc_r directly, use -pthread flag.
---
> *-*-rhapsody* | *-*-darwin1.[012])
> # Rhapsody C and math libraries are in the System framework
> deplibs="$deplibs -framework System"
1067d1476
< ;;
1068a1478,1484
> elif test "X$arg" = "X-lc_r"; then
> case $host in
> *-*-openbsd* | *-*-freebsd*)
> # Do not include libc_r directly, use -pthread flag.
> continue
> ;;
> esac
1073a1490,1494
> -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
> deplibs="$deplibs $arg"
> continue
> ;;
>
1076,1079c1497,1512
< case $host in
< *-*-freebsd*)
< # Do not build the useless static library
< build_old_libs=no
---
> 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"`
> case $arg in
> *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
> arg="\"$arg\""
1081a1515,1524
> compile_command="$compile_command $arg"
> finalize_command="$finalize_command $arg"
> if test "$with_gcc" = "yes" ; then
> compiler_flags="$compiler_flags $arg"
> fi
> continue
> ;;
>
> -shrext)
> prev=shrext
1108a1552,1556
> -objectlist)
> prev=objectlist
> continue
> ;;
>
1110a1559,1563
> -precious-files-regex)
> prev=precious_regex
> continue
> ;;
>
1133c1586
< exit 1
---
> exit $EXIT_FAILURE
1160a1614,1618
> -version-number)
> prev=vinfo
> vinfo_number=yes
> continue
> ;;
1208a1667,1671
> -XCClinker)
> prev=xcclinker
> continue
> ;;
>
1221,1233c1684,1687
< *.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
< # If libtool objects are unsupported, then we need to preload.
< prev=dlprefiles
< fi
< fi
---
> *.$objext)
> # A standard object.
> objs="$objs $arg"
> ;;
1235,1239c1689,1698
< if test "$prev" = dlprefiles; then
< # Preload the old-style object.
< dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
< prev=
< else
---
> *.lo)
> # A libtool-controlled object.
>
> # Check to see that this really is a libtool object.
> if (${SED} -e '2q' $arg | grep "^# 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.
1241,1242c1700,1701
< *.lo) libobjs="$libobjs $arg" ;;
< *) objs="$objs $arg" ;;
---
> */* | *\\*) . $arg ;;
> *) . ./$arg ;;
1243a1703,1778
>
> 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 $EXIT_FAILURE
> 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 $EXIT_FAILURE
> 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
1294c1829
< exit 1
---
> exit $EXIT_FAILURE
1302a1838
> oldlibs=
1323c1859
< if test ! -d $output_objdir; then
---
> if test ! -d "$output_objdir"; then
1327c1863
< if test $status -ne 0 && test ! -d $output_objdir; then
---
> if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1337c1873
< exit 1
---
> exit $EXIT_FAILURE
1344a1881,1889
> case $host in
> *cygwin* | *mingw* | *pw32*)
> # don't eliminate duplications in $postdeps and $predeps
> duplicate_compiler_generated_deps=yes
> ;;
> *)
> duplicate_compiler_generated_deps=$duplicate_deps
> ;;
> esac
1345a1891
>
1356a1903,1921
>
> 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_compiler_generated_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
>
1371c1936
< exit 1
---
> exit $EXIT_FAILURE
1388,1389c1953,1958
< if test $linkmode = prog; then
< # Determine which files to process
---
> if test "$linkmode,$pass" = "lib,link" ||
> test "$linkmode,$pass" = "prog,scan"; then
> libs="$deplibs"
> deplibs=
> fi
> if test "$linkmode" = prog; then
1391,1395c1960
< dlopen)
< libs="$dlfiles"
< save_deplibs="$deplibs" # Collect dlpreopened libraries
< deplibs=
< ;;
---
> dlopen) libs="$dlfiles" ;;
1399a1965,1969
> if test "$pass" = dlopen; then
> # Collect dlpreopened libraries
> save_deplibs="$deplibs"
> deplibs=
> fi
1403a1974,1982
> -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
> if test "$linkmode,$pass" = "prog,link"; then
> compile_deplibs="$deplib $compile_deplibs"
> finalize_deplibs="$deplib $finalize_deplibs"
> else
> deplibs="$deplib $deplibs"
> fi
> continue
> ;;
1405,1406c1984,1985
< if test $linkmode = oldlib && test $linkmode = obj; then
< $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
---
> if test "$linkmode" != lib && test "$linkmode" != prog; then
> $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1409c1988
< if test $pass = conv; then
---
> if test "$pass" = conv; then
1415,1420c1994,2005
< # Search the libtool library
< lib="$searchdir/lib${name}.la"
< if test -f "$lib"; then
< found=yes
< break
< fi
---
> for search_ext in .la $std_shrext .so .a; do
> # Search the libtool library
> lib="$searchdir/lib${name}${search_ext}"
> if test -f "$lib"; then
> if test "$search_ext" = ".la"; then
> found=yes
> else
> found=no
> fi
> break 2
> fi
> done
1429c2014
< test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
---
> test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1431a2017,2052
> else # deplib is a libtool library
> # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
> # We need to do some special things here, and not later.
> if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
> case " $predeps $postdeps " in
> *" $deplib "*)
> if (${SED} -e '2q' $lib |
> grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
> library_names=
> old_library=
> case $lib in
> */* | *\\*) . $lib ;;
> *) . ./$lib ;;
> esac
> for l in $old_library $library_names; do
> ll="$l"
> done
> if test "X$ll" = "X$old_library" ; then # only static version available
> found=no
> ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
> test "X$ladir" = "X$lib" && ladir="."
> lib=$ladir/$old_library
> if test "$linkmode,$pass" = "prog,link"; then
> compile_deplibs="$deplib $compile_deplibs"
> finalize_deplibs="$deplib $finalize_deplibs"
> else
> deplibs="$deplib $deplibs"
> test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
> fi
> continue
> fi
> fi
> ;;
> *) ;;
> esac
> fi
1438c2059
< test $pass = conv && continue
---
> test "$pass" = conv && continue
1443c2064
< if test $pass = conv; then
---
> if test "$pass" = conv; then
1447c2068
< if test $pass = scan; then
---
> if test "$pass" = scan; then
1449d2069
< newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1453a2074
> newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1456c2077
< $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
---
> $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1462c2083
< if test $pass = link; then
---
> if test "$pass" = link; then
1475c2096
< if test $pass = conv; then
---
> if test "$pass" = conv; then
1481,1488c2102,2124
< 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."
---
> 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"
> $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."
1490,1492c2126,2128
< echo
< echo "*** Warning: Linking the shared library $output against the"
< echo "*** static library $deplib is not portable!"
---
> $echo
> $echo "*** Warning: Linking the shared library $output against the"
> $echo "*** static library $deplib is not portable!"
1498c2134
< if test $pass != link; then
---
> if test "$pass" != link; then
1509,1516c2145,2156
< 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"
< compile_deplibs="$deplib $compile_deplibs"
< finalize_deplibs="$deplib $finalize_deplibs"
< else
< newdlfiles="$newdlfiles $deplib"
---
> 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"
> compile_deplibs="$deplib $compile_deplibs"
> finalize_deplibs="$deplib $finalize_deplibs"
> else
> newdlfiles="$newdlfiles $deplib"
> fi
1525c2165
< if test $found = yes || test -f "$lib"; then :
---
> if test "$found" = yes || test -f "$lib"; then :
1528c2168
< exit 1
---
> exit $EXIT_FAILURE
1532c2172
< if (${SED} -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
---
> if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1535c2175
< exit 1
---
> exit $EXIT_FAILURE
1548c2188
< # it will not redefine variable installed.
---
> # it will not redefine variables installed, or shouldnotlink
1549a2190
> shouldnotlink=no
1559,1560c2200
< { test $linkmode = oldlib && test $linkmode = obj; }; then
< # Add dl[pre]opened files of deplib
---
> { test "$linkmode" != prog && test "$linkmode" != lib; }; then
1565c2205
< if test $pass = conv; then
---
> if test "$pass" = conv; then
1571c2211
< exit 1
---
> exit $EXIT_FAILURE
1586c2226
< elif test $linkmode != prog && test $linkmode != lib; then
---
> elif test "$linkmode" != prog && test "$linkmode" != lib; then
1588c2228
< exit 1
---
> exit $EXIT_FAILURE
1592a2233
>
1600c2241
< exit 1
---
> exit $EXIT_FAILURE
1604c2245
< if test $pass = dlopen; then
---
> if test "$pass" = dlopen; then
1607c2248
< exit 1
---
> exit $EXIT_FAILURE
1609c2250,2252
< if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
---
> if test -z "$dlname" ||
> test "$dlopen_support" != yes ||
> test "$build_libtool_libs" = no; then
1611,1612c2254,2257
< # statically, we need to preload.
< dlprefiles="$dlprefiles $lib"
---
> # 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"
1645,1648c2290,2300
< dir="$ladir/$objdir"
< absdir="$abs_ladir/$objdir"
< # Remove this search path later
< notinst_path="$notinst_path $abs_ladir"
---
> 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
1653c2305
< if test $pass = dlpreopen; then
---
> if test "$pass" = dlpreopen; then
1656c2308
< exit 1
---
> exit $EXIT_FAILURE
1672c2324
< if test $linkmode = lib; then
---
> if test "$linkmode" = lib; then
1678c2330
< deplibs="$lib $deplibs"
---
> deplibs="$lib $deplibs" # used for prog,scan pass
1683c2335,2336
< if test $linkmode = prog && test $pass != link; then
---
>
> if test "$linkmode" = prog && test "$pass" != link; then
1699c2352
< if test $linkalldeplibs = yes; then
---
> if test "$linkalldeplibs" = yes; then
1716,1719c2369,2380
< 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"; 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
1721,1722d2381
< if test "$linkmode,$pass" = "prog,link" ||
< { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
1744,1754d2402
< 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
1763a2412
> fi
1764a2414,2416
> 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
1768a2421
> # This is a shared library
1769a2423,2458
> # Warn about portability, can't link against -module's on
> # some systems (darwin)
> if test "$shouldnotlink" = yes && test "$pass" = link ; then
> $echo
> if test "$linkmode" = prog; then
> $echo "*** Warning: Linking the executable $output against the loadable module"
> else
> $echo "*** Warning: Linking the shared library $output against the loadable module"
> fi
> $echo "*** $linklib is not portable!"
> fi
> 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
>
1782c2471
< *cygwin*)
---
> *cygwin* | mingw*)
1794,1795c2483,2484
< soname=`echo $soroot | ${SED} -e 's/^.*\///'`
< newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
---
> soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
> newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
1802c2491
< eval cmds=\"$extract_expsyms_cmds\"
---
> cmds=$extract_expsyms_cmds
1804a2494
> eval cmd=\"$cmd\"
1815c2505
< eval cmds=\"$old_archive_from_expsyms_cmds\"
---
> cmds=$old_archive_from_expsyms_cmds
1817a2508
> eval cmd=\"$cmd\"
1826c2517
< fi # test -n $old_archive_from_expsyms_cmds
---
> fi # test -n "$old_archive_from_expsyms_cmds"
1828c2519
< if test $linkmode = prog || test "$mode" != relink; then
---
> if test "$linkmode" = prog || test "$mode" != relink; then
1836a2528,2543
> 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
> $echo "** And there doesn't seem to be a static archive available"
> $echo "** The link will probably fail, sorry"
> else
> add="$dir/$old_library"
> fi
> fi
> esac
1854a2562,2569
> # 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"
> ;;
> esac
> fi
1868c2583
< exit 1
---
> exit $EXIT_FAILURE
1877c2592
< if test $linkmode = prog; then
---
> if test "$linkmode" = prog; then
1894c2609
< if test $linkmode = prog || test "$mode" = relink; then
---
> if test "$linkmode" = prog || test "$mode" = relink; then
1909a2625,2631
> elif test "$hardcode_automatic" = yes; then
> if test -n "$inst_prefix_dir" &&
> test -f "$inst_prefix_dir$libdir/$linklib" ; then
> add="$inst_prefix_dir$libdir/$linklib"
> else
> add="$libdir/$linklib"
> fi
1912a2635,2642
> # 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"
> ;;
> esac
> fi
1916c2646
< if test $linkmode = prog; then
---
> if test "$linkmode" = prog; then
1924,1933c2654
< 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
---
> elif test "$linkmode" = prog; then
1953,1957c2674,2678
< 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."
---
> $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."
1959,1961c2680,2682
< 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."
---
> $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."
1963,1967c2684,2688
< echo
< echo "*** However, this would only work if libtool was able to extract symbol"
< echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
< echo "*** not find such a program. So, this module is probably useless."
< echo "*** \`nm' from GNU binutils and a full rebuild may help."
---
> $echo
> $echo "*** However, this would only work if libtool was able to extract symbol"
> $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
> $echo "*** not find such a program. So, this module is probably useless."
> $echo "*** \`nm' from GNU binutils and a full rebuild may help."
1984c2705
< if test $linkmode = lib; then
---
> if test "$linkmode" = lib; then
1986,1987c2707,2709
< { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
< test $link_static = yes; }; then
---
> { test "$hardcode_into_libs" != yes ||
> test "$build_old_libs" = yes ||
> test "$link_static" = yes; }; then
2018c2740
< if test $link_all_deplibs != no; then
---
> if test "$link_all_deplibs" != no; then
2038c2760
< path="-L$absdir/$objdir"
---
> path="$absdir/$objdir"
2043c2765
< exit 1
---
> exit $EXIT_FAILURE
2048c2770
< path="-L$absdir"
---
> path="$absdir"
2049a2772,2796
> depdepl=
> case $host in
> *-*-darwin*)
> # we do not want to link against static libs,
> # but need to link against shared
> eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
> if test -n "$deplibrary_names" ; then
> for tmp in $deplibrary_names ; do
> depdepl=$tmp
> done
> if test -f "$path/$depdepl" ; then
> depdepl="$path/$depdepl"
> fi
> # do not add paths which are already there
> case " $newlib_search_path " in
> *" $path "*) ;;
> *) newlib_search_path="$newlib_search_path $path";;
> esac
> fi
> path=""
> ;;
> *)
> path="-L$path"
> ;;
> esac
2050a2798,2813
> -l*)
> case $host in
> *-*-darwin*)
> # Again, we only want to link against shared libraries
> eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
> for tmp in $newlib_search_path ; do
> if test -f "$tmp/lib$tmp_libs.dylib" ; then
> eval depdepl="$tmp/lib$tmp_libs.dylib"
> break
> fi
> done
> path=""
> ;;
> *) continue ;;
> esac
> ;;
2053a2817,2820
> *" $depdepl "*) ;;
> *) deplibs="$depdepl $deplibs" ;;
> esac
> case " $deplibs " in
2061c2828,2829
< if test $pass = dlpreopen; then
---
> dependency_libs="$newdependency_libs"
> if test "$pass" = dlpreopen; then
2067,2069c2835,2836
< if test $pass != dlopen; then
< test $pass != scan && dependency_libs="$newdependency_libs"
< if test $pass != conv; then
---
> if test "$pass" != dlopen; then
> if test "$pass" != conv; then
2090a2858,2863
> # 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:
2092a2866
> -R*) ;;
2093a2868,2881
> # 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.
2121,2125c2909,2922
< if test "$pass" = "conv" &&
< { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
< libs="$deplibs" # reset libs
< deplibs=
< fi
---
> # Last step: remove runtime libs from dependency_libs
> # (they stay in deplibs)
> tmp_libs=
> for i in $dependency_libs ; do
> case " $predeps $postdeps $compiler_lib_search_path " in
> *" $i "*)
> i=""
> ;;
> esac
> if test -n "$i" ; then
> tmp_libs="$tmp_libs $i"
> fi
> done
> dependency_libs=$tmp_libs
2127c2924
< if test $linkmode = prog; then
---
> if test "$linkmode" = prog; then
2133a2931,2934
> if test -n "$deplibs"; then
> $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
> fi
>
2147c2948
< $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
---
> $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2168a2970
> eval shared_ext=\"$shrext_cmds\"
2175c2977
< exit 1
---
> exit $EXIT_FAILURE
2179a2982
> eval shared_ext=\"$shrext_cmds\"
2190c2993
< exit 1
---
> exit $EXIT_FAILURE
2192,2194c2995,2997
< echo
< echo "*** Warning: Linking the shared library $output against the non-libtool"
< echo "*** objects $objs is not portable!"
---
> $echo
> $echo "*** Warning: Linking the shared library $output against the non-libtool"
> $echo "*** objects $objs is not portable!"
2204c3007
< if test $# -gt 2; then
---
> if test "$#" -gt 2; then
2213c3016,3018
< libext=al
---
> # Some compilers have problems with a `.al' extension so
> # convenience libraries should have the same extension an
> # archive normally would.
2220c3025
< $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
---
> $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
2236c3041
< exit 1
---
> exit $EXIT_FAILURE
2239,2241c3044,3046
< current="$2"
< revision="$3"
< age="$4"
---
> # convert absolute version numbers to libtool ages
> # this retains compatibility with .la files and attempts
> # to make the code below a bit more comprehensible
2242a3048,3084
> case $vinfo_number in
> yes)
> number_major="$2"
> number_minor="$3"
> number_revision="$4"
> #
> # There are really only two kinds -- those that
> # use the current revision as the major version
> # and those that subtract age and use age as
> # a minor version. But, then there is irix
> # which has an extra 1 added just for fun
> #
> case $version_type in
> darwin|linux|osf|windows)
> current=`expr $number_major + $number_minor`
> age="$number_minor"
> revision="$number_revision"
> ;;
> freebsd-aout|freebsd-elf|sunos)
> current="$number_major"
> revision="$number_minor"
> age="0"
> ;;
> irix|nonstopux)
> current=`expr $number_major + $number_minor - 1`
> age="$number_minor"
> revision="$number_minor"
> ;;
> esac
> ;;
> no)
> current="$2"
> revision="$3"
> age="$4"
> ;;
> esac
>
2249c3091
< exit 1
---
> exit $EXIT_FAILURE
2258c3100
< exit 1
---
> exit $EXIT_FAILURE
2267c3109
< exit 1
---
> exit $EXIT_FAILURE
2271c3113
< if test $age -gt $current; then
---
> if test "$age" -gt "$current"; then
2274c3116
< exit 1
---
> exit $EXIT_FAILURE
2291c3133
< verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
---
> verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
2315c3157
< while test $loop != 0; do
---
> while test "$loop" -ne 0; do
2338c3180
< while test $loop != 0; do
---
> while test "$loop" -ne 0; do
2362,2363c3204,3205
< echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
< exit 1
---
> $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
> exit $EXIT_FAILURE
2370d3211
< verstring="0.0"
2375c3216
< verstring=""
---
> verstring=
2409,2411c3250,3273
< # 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}.*
---
> # 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}.*)
> if test "X$precious_files_regex" != "X"; then
> if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
> then
> continue
> fi
> fi
> removelist="$removelist $p"
> ;;
> *) ;;
> esac
> done
> if test -n "$removelist"; then
> $show "${rm}r $removelist"
> $run ${rm}r $removelist
> fi
2424,2426c3286,3288
< 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'`
---
> 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'`
2439c3301
< if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
---
> if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2478a3341
> test "X$arg" = "X-lc" && continue
2480c3343
< *)
---
> *)
2482c3345
< if test $build_libtool_need_lc = "yes"; then
---
> if test "$build_libtool_need_lc" = "yes"; then
2509c3372
< # implementing what was already the behaviour.
---
> # implementing what was already the behavior.
2522,2523c3385,3386
< $CC -o conftest conftest.c $deplibs
< if test $? -eq 0 ; then
---
> $LTCC -o conftest conftest.c $deplibs
> if test "$?" -eq 0 ; then
2528,2543c3391,3416
< if test -n "$name" && test "$name" != "0"; then
< libname=`eval \\$echo \"$libname_spec\"`
< deplib_matches=`eval \\$echo \"$library_names_spec\"`
< set dummy $deplib_matches
< deplib_match=$2
< if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
< newdeplibs="$newdeplibs $i"
< 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."
---
> if test "$name" != "" && test "$name" -ne "0"; then
> if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
> case " $predeps $postdeps " in
> *" $i "*)
> newdeplibs="$newdeplibs $i"
> i=""
> ;;
> esac
> fi
> if test -n "$i" ; then
> libname=`eval \\$echo \"$libname_spec\"`
> deplib_matches=`eval \\$echo \"$library_names_spec\"`
> set dummy $deplib_matches
> deplib_match=$2
> if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
> newdeplibs="$newdeplibs $i"
> 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
2550c3423
< # Error occured in the first compile. Let's try to salvage
---
> # Error occurred in the first compile. Let's try to salvage
2554,2555c3427,3428
< # If $name is empty we are operating on a -L argument.
< if test -n "$name" && test "$name" != "0"; then
---
> # If $name is empty we are operating on a -L argument.
> if test "$name" != "" && test "$name" != "0"; then
2557c3430
< $CC -o conftest conftest.c $i
---
> $LTCC -o conftest conftest.c $i
2559c3432
< if test $? -eq 0 ; then
---
> if test "$?" -eq 0 ; then
2561,2575c3434,3440
< libname=`eval \\$echo \"$libname_spec\"`
< deplib_matches=`eval \\$echo \"$library_names_spec\"`
< set dummy $deplib_matches
< deplib_match=$2
< if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
< newdeplibs="$newdeplibs $i"
< 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."
---
> if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
> case " $predeps $postdeps " in
> *" $i "*)
> newdeplibs="$newdeplibs $i"
> i=""
> ;;
> esac
2576a3442,3459
> if test -n "$i" ; then
> libname=`eval \\$echo \"$libname_spec\"`
> deplib_matches=`eval \\$echo \"$library_names_spec\"`
> set dummy $deplib_matches
> deplib_match=$2
> if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
> newdeplibs="$newdeplibs $i"
> 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
> fi
2579,2583c3462,3466
< echo
< echo "*** Warning! Library $i is needed by this library but I was not able to"
< echo "*** make it link in! You will probably need to install it or some"
< echo "*** library that it depends on before this library will be fully"
< echo "*** functional. Installing it before continuing would be even better."
---
> $echo
> $echo "*** Warning! Library $i is needed by this library but I was not able to"
> $echo "*** make it link in! You will probably need to install it or some"
> $echo "*** library that it depends on before this library will be fully"
> $echo "*** functional. Installing it before continuing would be even better."
2597,2601c3480,3493
< 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`
< for potent_lib in $potential_libs; do
---
> if test "$name" != "" && test "$name" != "0"; then
> if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
> case " $predeps $postdeps " in
> *" $a_deplib "*)
> newdeplibs="$newdeplibs $a_deplib"
> a_deplib=""
> ;;
> esac
> fi
> if test -n "$a_deplib" ; 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`
> for potent_lib in $potential_libs; do
2622c3514
< | egrep "$file_magic_regex" > /dev/null; then
---
> | $EGREP "$file_magic_regex" > /dev/null; then
2627,2628c3519,3521
< done
< done
---
> done
> done
> fi
2631,2636c3524,3529
< 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"
---
> $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"
2638c3531
< echo "*** with $libname but no candidates were found. (...for file magic test)"
---
> $echo "*** with $libname but no candidates were found. (...for file magic test)"
2640,2641c3533,3534
< echo "*** with $libname and none of the candidates passed a file format test"
< echo "*** using a file magic. Last file checked: $potlib"
---
> $echo "*** with $libname and none of the candidates passed a file format test"
> $echo "*** using a file magic. Last file checked: $potlib"
2657,2668c3550,3571
< 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`
< for potent_lib in $potential_libs; do
< potlib="$potent_lib" # see symlink-check below in file_magic test
< if eval echo \"$potent_lib\" 2>/dev/null \
< | ${SED} 10q \
< | egrep "$match_pattern_regex" > /dev/null; then
< newdeplibs="$newdeplibs $a_deplib"
< a_deplib=""
< break 2
< fi
---
> if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
> case " $predeps $postdeps " in
> *" $a_deplib "*)
> newdeplibs="$newdeplibs $a_deplib"
> a_deplib=""
> ;;
> esac
> fi
> if test -n "$a_deplib" ; 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`
> 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=""
> break 2
> fi
> done
2670c3573
< done
---
> fi
2673,2678c3576,3581
< 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"
---
> $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"
2680c3583
< echo "*** with $libname but no candidates were found. (...for regex pattern test)"
---
> $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
2682,2683c3585,3586
< echo "*** with $libname and none of the candidates passed a file format test"
< echo "*** using a regex pattern. Last file checked: $potlib"
---
> $echo "*** with $libname and none of the candidates passed a file format test"
> $echo "*** using a regex pattern. Last file checked: $potlib"
2694,2697c3597,3607
< if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
< -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
< grep . >/dev/null; then
< echo
---
> tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
> -e 's/ -[LR][^ ]*//g'`
> if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
> for i in $predeps $postdeps ; do
> # can't use Xsed below, because $i might contain '/'
> tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
> done
> fi
> if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
> | grep . >/dev/null; then
> $echo
2699c3609
< echo "*** Warning: inter-library dependencies are not supported in this platform."
---
> $echo "*** Warning: inter-library dependencies are not supported in this platform."
2701c3611
< echo "*** Warning: inter-library dependencies are not known to be supported."
---
> $echo "*** Warning: inter-library dependencies are not known to be supported."
2703c3613
< echo "*** All declared inter-library dependencies are being dropped."
---
> $echo "*** All declared inter-library dependencies are being dropped."
2723,2727c3633,3637
< echo
< echo "*** Warning: libtool could not satisfy all declared inter-library"
< echo "*** dependencies of module $libname. Therefore, libtool will create"
< echo "*** a static module, that should work as long as the dlopening"
< echo "*** application is linked with the -dlopen flag."
---
> $echo
> $echo "*** Warning: libtool could not satisfy all declared inter-library"
> $echo "*** dependencies of module $libname. Therefore, libtool will create"
> $echo "*** a static module, that should work as long as the dlopening"
> $echo "*** application is linked with the -dlopen flag."
2729,2733c3639,3643
< echo
< echo "*** However, this would only work if libtool was able to extract symbol"
< echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
< echo "*** not find such a program. So, this module is probably useless."
< echo "*** \`nm' from GNU binutils and a full rebuild may help."
---
> $echo
> $echo "*** However, this would only work if libtool was able to extract symbol"
> $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
> $echo "*** not find such a program. So, this module is probably useless."
> $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2743,2745c3653,3655
< echo "*** The inter-library dependencies that have been dropped here will be"
< echo "*** automatically added whenever a program is linked with this library"
< echo "*** or is declared to -dlopen it."
---
> $echo "*** The inter-library dependencies that have been dropped here will be"
> $echo "*** automatically added whenever a program is linked with this library"
> $echo "*** or is declared to -dlopen it."
2747,2752c3657,3662
< 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"
< echo "*** it was explicitly requested with -no-undefined,"
< echo "*** libtool will only create a static version of 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"
> $echo "*** it was explicitly requested with -no-undefined,"
> $echo "*** libtool will only create a static version of it."
2774c3684
< if test $hardcode_into_libs = yes; then
---
> if test "$hardcode_into_libs" = yes; then
2810c3720,3724
< eval dep_rpath=\"$hardcode_libdir_flag_spec\"
---
> if test -n "$hardcode_libdir_flag_spec_ld"; then
> eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
> else
> eval dep_rpath=\"$hardcode_libdir_flag_spec\"
> fi
2829a3744
> eval shared_ext=\"$shrext_cmds\"
2840c3755,3757
< test -z "$dlname" && dlname=$soname
---
> if test -z "$dlname"; then
> dlname=$soname
> fi
2848,2864d3764
< # 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
<
2874c3774
< eval cmds=\"$export_symbols_cmds\"
---
> cmds=$export_symbols_cmds
2878,2879c3778,3788
< $show "$cmd"
< $run eval "$cmd" || exit $?
---
> eval cmd=\"$cmd\"
> 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
2883,2884c3792,3793
< $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
< $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
---
> $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
> $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2894a3804,3814
> tmp_deplibs=
> for test_deplib in $deplibs; do
> case " $convenience " in
> *" $test_deplib "*) ;;
> *)
> tmp_deplibs="$tmp_deplibs $test_deplib"
> ;;
> esac
> done
> deplibs="$tmp_deplibs"
>
2896a3817
> save_libobjs=$libobjs
2900,2907d3820
< $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
2910,2931c3823,3824
< 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
< $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
---
> func_extract_archives $gentop $convenience
> libobjs="$libobjs $func_extract_archives_result"
2934c3827
<
---
>
2945a3839,3847
> if test "$module" = yes && test -n "$module_cmds" ; then
> if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
> eval test_cmds=\"$module_expsym_cmds\"
> cmds=$module_expsym_cmds
> else
> eval test_cmds=\"$module_cmds\"
> cmds=$module_cmds
> fi
> else
2947c3849,3850
< eval cmds=\"$archive_expsym_cmds\"
---
> eval test_cmds=\"$archive_expsym_cmds\"
> cmds=$archive_expsym_cmds
2949,2954c3852,3903
< 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"
---
> eval test_cmds=\"$archive_cmds\"
> cmds=$archive_cmds
> 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
> # 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\"
2956,2957c3905,3910
< done
< deplibs="$tmp_deplibs"
---
> last_robj=$output_objdir/$save_output-${k}.$objext
> k=`expr $k + 1`
> output=$output_objdir/$save_output-${k}.$objext
> objlist=$obj
> len=1
> fi
2959,2960c3912,3974
< eval cmds=\"$archive_cmds\"
< deplibs="$save_deplibs"
---
> # 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 "$module" = yes && test -n "$module_cmds" ; then
> if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
> cmds=$module_expsym_cmds
> else
> cmds=$module_cmds
> fi
> else
> if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
> cmds=$archive_expsym_cmds
> else
> cmds=$archive_cmds
> fi
> fi
>
> # Append the command to remove the reloadable object files
> # to the just-reset $cmds.
> eval cmds=\"\$cmds~\$rm $delfiles\"
2964a3979
> eval cmd=\"$cmd\"
2973c3988
< exit 0
---
> exit $EXIT_SUCCESS
3021c4036
< exit 1
---
> exit $EXIT_FAILURE
3050,3057d4064
< $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
3060,3081c4067,4068
< 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
< $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
---
> func_extract_archives $gentop $convenience
> reload_conv_objs="$reload_objs $func_extract_archives_result"
3089c4076
< eval cmds=\"$reload_cmds\"
---
> cmds=$reload_cmds
3092a4080
> eval cmd=\"$cmd\"
3105c4093
< exit 0
---
> exit $EXIT_SUCCESS
3116,3118c4104,4106
< $show "echo timestamp > $libobj"
< $run eval "echo timestamp > $libobj" || exit $?
< exit 0
---
> # $show "echo timestamp > $libobj"
> # $run eval "echo timestamp > $libobj" || exit $?
> exit $EXIT_SUCCESS
3125c4113
< eval cmds=\"$reload_cmds\"
---
> cmds=$reload_cmds
3128a4117
> eval cmd=\"$cmd\"
3133,3146d4121
< 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 $?
3154c4129
< exit 0
---
> exit $EXIT_SUCCESS
3159c4134
< *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
---
> *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
3181,3187d4155
< case $host in
< *darwin*)
< # Don't allow lazy linking, it breaks C++ global constructors
< compile_command="$compile_command ${wl}-bind_at_load"
< finalize_command="$finalize_command ${wl}-bind_at_load"
< ;;
< esac
3190a4159,4168
> case $host in
> *darwin*)
> # Don't allow lazy linking, it breaks C++ global constructors
> if test "$tagname" = CXX ; then
> compile_command="$compile_command ${wl}-bind_at_load"
> finalize_command="$finalize_command ${wl}-bind_at_load"
> fi
> ;;
> esac
>
3341c4319
< $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
---
> $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3346c4324
< $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
---
> $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3364,3365c4342,4343
< name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
< $run eval 'echo ": $name " >> "$nlist"'
---
> name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
> $run eval '$echo ": $name " >> "$nlist"'
3374c4352
< egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
---
> $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3394c4372
< echo '/* NONE */' >> "$output_objdir/$dlsyms"
---
> $echo '/* NONE */' >> "$output_objdir/$dlsyms"
3446c4424
< *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
---
> *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
3451c4429
< *) pic_flag_for_symtable=" $pic_flag -DPIC";;
---
> *) pic_flag_for_symtable=" $pic_flag";;
3456,3457c4434,4435
< $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 $?
---
> $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 $?
3467,3469d4444
< *-*-freebsd*)
< # FreeBSD doesn't need this...
< ;;
3472c4447
< exit 1
---
> exit $EXIT_FAILURE
3485c4460
< if test $need_relink = no || test "$build_libtool_libs" != yes; then
---
> if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3560c4535
< exit 0
---
> exit $EXIT_SUCCESS
3615,3618c4590,4593
< if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
< case $0 in
< [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
< *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
---
> if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
> case $progpath in
> [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
> *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
3630c4605
< *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
---
> *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
3634c4609,4611
< *cygwin*) exeext=.exe ;;
---
> *cygwin*)
> exeext=.exe
> outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
3636a4614,4826
> 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 <<EOF
>
> /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
> Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
>
> The $output program cannot be directly executed until all the libtool
> libraries that it depends on are installed.
>
> This wrapper executable should never be moved out of the build directory.
> If it is, it will not operate correctly.
>
> Currently, it simply execs the wrapper *script* "/bin/sh $output",
> but could eventually absorb all of the scripts functionality and
> exec $objdir/$outputname directly.
> */
> EOF
> cat >> $cwrappersource<<"EOF"
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <malloc.h>
> #include <stdarg.h>
> #include <assert.h>
>
> #if defined(PATH_MAX)
> # define LT_PATHMAX PATH_MAX
> #elif defined(MAXPATHLEN)
> # define LT_PATHMAX MAXPATHLEN
> #else
> # define LT_PATHMAX 1024
> #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
> # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
> #else /* DIR_SEPARATOR_2 */
> # define IS_DIR_SEPARATOR(ch) \
> (((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, ...);
>
> int
> main (int argc, char *argv[])
> {
> char **newargz;
> int i;
>
> program_name = (char *) xstrdup ((char *) basename (argv[0]));
> newargz = XMALLOC(char *, argc+2);
> EOF
>
> cat >> $cwrappersource <<EOF
> newargz[0] = "$SHELL";
> EOF
>
> cat >> $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 <<EOF
> execv("$SHELL",newargz);
> EOF
>
> cat >> $cwrappersource <<"EOF"
> }
>
> void *
> xmalloc (size_t num)
> {
> void * p = (void *) malloc (num);
> if (!p)
> lt_fatal ("Memory exhausted");
>
> return p;
> }
>
> char *
> xstrdup (const char *string)
> {
> return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
> ;
> }
>
> 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 *
> strendzap(char *str, const char *pat)
> {
> size_t len, patlen;
>
> assert(str != NULL);
> assert(pat != NULL);
>
> len = strlen(str);
> patlen = strlen(pat);
>
> if (patlen <= len)
> {
> str += len - patlen;
> if (strcmp(str, pat) == 0)
> *str = '\0';
> }
> return str;
> }
>
> static void
> lt_error_core (int exit_status, const char * mode,
> const char * message, va_list ap)
> {
> fprintf (stderr, "%s: %s: ", program_name, mode);
> vfprintf (stderr, message, ap);
> fprintf (stderr, ".\n");
>
> if (exit_status >= 0)
> exit (exit_status);
> }
>
> void
> lt_fatal (const char *message, ...)
> {
> va_list ap;
> va_start (ap, message);
> lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
> 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
3638c4828
< trap "$rm $output; exit 1" 1 2 15
---
> trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
3654c4844
< Xsed="${SED}"' -e 1s/^X//'
---
> Xsed='${SED} -e 1s/^X//'
3659c4849
< if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
---
> (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3714c4904
< echo >> $output "\
---
> $echo >> $output "\
3730c4920
< echo >> $output "\
---
> $echo >> $output "\
3738c4928
< exit 1
---
> exit $EXIT_FAILURE
3748c4938
< echo >> $output "\
---
> $echo >> $output "\
3754c4944
< echo >> $output "\
---
> $echo >> $output "\
3765c4955
< # The second colon is a workaround for a bug in BeOS R4 ${SED}
---
> # The second colon is a workaround for a bug in BeOS R4 sed
3785,3792d4974
< # win32 systems need to use the prog path for dll
< # lookup to work
< *-*-cygwin* | *-*-pw32*)
< $echo >> $output "\
< exec \$progdir/\$program \${1+\"\$@\"}
< "
< ;;
<
3802,3806c4984
< # Export the path to the program.
< PATH=\"\$progdir:\$PATH\"
< export PATH
<
< exec \$program \${1+\"\$@\"}
---
> exec \$progdir/\$program \${1+\"\$@\"}
3812c4990
< exit 1
---
> exit $EXIT_FAILURE
3818,3819c4996,4997
< echo \"See the $PACKAGE documentation for more information.\" 1>&2
< exit 1
---
> $echo \"See the $PACKAGE documentation for more information.\" 1>&2
> exit $EXIT_FAILURE
3825c5003
< exit 0
---
> exit $EXIT_SUCCESS
3841c5019
< oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
---
> oldobjs="$old_deplibs $non_pic_objects"
3848,3855d5025
< $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
3858,3880c5028,5029
< # 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
< $show "(cd $xdir && $AR x $xabs)"
< $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
<
< oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
< done
---
> func_extract_archives $gentop $addlibs
> oldobjs="$oldobjs $func_extract_archives_result"
3885c5034
< eval cmds=\"$old_archive_from_new_cmds\"
---
> cmds=$old_archive_from_new_cmds
3887,3894c5036,5075
< # 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="."
---
> eval cmds=\"$old_archive_cmds\"
>
> if len=`expr "X$cmds" : ".*"` &&
> test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
> cmds=$old_archive_cmds
> 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
> # Is there a better way of finding the last object in the list?
> for obj in $save_oldobjs
> do
> last_oldobj=$obj
> done
> 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
> :
3896c5077,5084
< xdir="$xdir"
---
> # the above command should be used before it gets too long
> oldobjs=$objlist
> if test "$obj" = "$last_oldobj" ; then
> RANLIB=$save_RANLIB
> fi
> test -z "$concat_cmds" || concat_cmds=$concat_cmds~
> eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
> objlist=
3898,3901c5086,5092
< 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 $?
---
> done
> RANLIB=$save_RANLIB
> oldobjs=$objlist
> if test "X$oldobjs" = "X" ; then
> eval cmds=\"\$concat_cmds\"
> else
> eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
3903,3905c5094
< done
<
< eval cmds=\"$old_archive_cmds\"
---
> fi
3908a5098
> eval cmd=\"$cmd\"
3940c5130
< relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
---
> relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
3941a5132,5134
> if test "$hardcode_automatic" = yes ; then
> relink_command=
> fi
3942a5136
>
3960c5154
< exit 1
---
> exit $EXIT_FAILURE
3974c5168
< exit 1
---
> exit $EXIT_FAILURE
3985c5179
< exit 1
---
> exit $EXIT_FAILURE
3989a5184,5202
> else
> newdlfiles=
> for lib in $dlfiles; do
> case $lib in
> [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
> *) abs=`pwd`"/$lib" ;;
> esac
> newdlfiles="$newdlfiles $abs"
> done
> dlfiles="$newdlfiles"
> newdlprefiles=
> for lib in $dlprefiles; do
> case $lib in
> [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
> *) abs=`pwd`"/$lib" ;;
> esac
> newdlprefiles="$newdlprefiles $abs"
> done
> dlprefiles="$newdlprefiles"
3995c5208
< *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
---
> *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4023a5237,5239
> # Should we warn about portability when linking against -modules?
> shouldnotlink=$module
>
4030c5246
< if test "$installed" = no && test $need_relink = yes; then
---
> if test "$installed" = no && test "$need_relink" = yes; then
4043c5259
< exit 0
---
> exit $EXIT_SUCCESS
4132c5348
< exit 1
---
> exit $EXIT_FAILURE
4138c5354
< exit 1
---
> exit $EXIT_FAILURE
4148c5364
< exit 1
---
> exit $EXIT_FAILURE
4166c5382
< if test $# -gt 2; then
---
> if test "$#" -gt 2; then
4169c5385
< exit 1
---
> exit $EXIT_FAILURE
4181c5397
< exit 1
---
> exit $EXIT_FAILURE
4206c5422
< if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
---
> if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4210c5426
< exit 1
---
> exit $EXIT_FAILURE
4240a5457,5477
> # Determine the prefix the user has applied to our future dir.
> inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
>
> # Don't allow the user to place us outside of our expected
> # location b/c this prevents finding dependent libraries that
> # are installed to the same prefix.
> # At present, this check doesn't affect windows .dll's that
> # are installed into $libdir/../bin (currently, that works fine)
> # but it's something to keep an eye on.
> if test "$inst_prefix_dir" = "$destdir"; then
> $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
> exit $EXIT_FAILURE
> fi
>
> if test -n "$inst_prefix_dir"; then
> # Stick the inst_prefix_dir data into the link command.
> relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
> else
> relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
> fi
>
4246c5483
< continue
---
> exit $EXIT_FAILURE
4268c5505
< if test $# -gt 0; then
---
> if test "$#" -gt 0; then
4281c5518
< eval cmds=\"$postinstall_cmds\"
---
> cmds=$postinstall_cmds
4284a5522
> eval cmd=\"$cmd\"
4292,4302c5530,5533
< case $host in
< *-*-freebsd*)
< # Do not install the useless pseudo-library
< ;;
< *)
< name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
< instname="$dir/$name"i
< $show "$install_prog $instname $destdir/$name"
< $run eval "$install_prog $instname $destdir/$name" || exit $?
< ;;
< esac
---
> name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
> instname="$dir/$name"i
> $show "$install_prog $instname $destdir/$name"
> $run eval "$install_prog $instname $destdir/$name" || exit $?
4331c5562
< exit 1
---
> exit $EXIT_FAILURE
4349c5580
< exit 0
---
> exit $EXIT_SUCCESS
4360a5592,5604
> # 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
>
4364c5608
< wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
---
> wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
4370c5614
< if (${SED} -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
---
> if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4373a5618,5624
> # 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
4376,4377c5627,5628
< */* | *\\*) . $wrapper ;;
< *) . ./$wrapper ;;
---
> */* | *\\*) . ${wrapperdot} ;;
> *) . ./${wrapperdot} ;;
4383c5634
< exit 1
---
> exit $EXIT_FAILURE
4404a5656,5662
> # 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
4407,4408c5665,5666
< */* | *\\*) . $wrapper ;;
< *) . ./$wrapper ;;
---
> */* | *\\*) . ${wrapperdot} ;;
> *) . ./${wrapperdot} ;;
4417c5675,5678
< if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
---
> save_umask=`umask`
> umask 0077
> if $mkdir "$tmpdir"; then
> umask $save_umask
4418a5680
> umask $save_umask
4422c5684
< file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
---
> file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
4440c5702
< file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
---
> file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4447c5709
< /usr/bin/install*,*cygwin*)
---
> */usr/bin/install*,*cygwin*)
4456c5718
< destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
---
> destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
4477c5739
< if test -n "$stripme" && test -n "$striplib"; then
---
> if test -n "$stripme" && test -n "$old_striplib"; then
4483c5745
< eval cmds=\"$old_postinstall_cmds\"
---
> cmds=$old_postinstall_cmds
4486a5749
> eval cmd=\"$cmd\"
4500c5763
< exec_cmd='$SHELL $0 --finish$current_libdirs'
---
> exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
4502c5765
< exit 0
---
> exit $EXIT_SUCCESS
4521c5784
< eval cmds=\"$finish_cmds\"
---
> cmds=$finish_cmds
4524a5788
> eval cmd=\"$cmd\"
4541c5805
< test "$show" = ":" && exit 0
---
> test "$show" = : && exit $EXIT_SUCCESS
4543,4544c5807,5808
< echo "----------------------------------------------------------------------"
< echo "Libraries have been installed in:"
---
> $echo "----------------------------------------------------------------------"
> $echo "Libraries have been installed in:"
4546c5810
< echo " $libdir"
---
> $echo " $libdir"
4548,4552c5812,5816
< echo
< echo "If you ever happen to want to link against installed libraries"
< echo "in a given directory, LIBDIR, you must either use libtool, and"
< echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
< echo "flag during linking and do at least one of the following:"
---
> $echo
> $echo "If you ever happen to want to link against installed libraries"
> $echo "in a given directory, LIBDIR, you must either use libtool, and"
> $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
> $echo "flag during linking and do at least one of the following:"
4554,4555c5818,5819
< echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
< echo " during execution"
---
> $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
> $echo " during execution"
4558,4559c5822,5823
< echo " - add LIBDIR to the \`$runpath_var' environment variable"
< echo " during linking"
---
> $echo " - add LIBDIR to the \`$runpath_var' environment variable"
> $echo " during linking"
4565c5829
< echo " - use the \`$flag' linker flag"
---
> $echo " - use the \`$flag' linker flag"
4568c5832
< echo " - have your system administrator run these commands:$admincmds"
---
> $echo " - have your system administrator run these commands:$admincmds"
4571c5835
< echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
---
> $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4573,4577c5837,5841
< echo
< echo "See any operating system documentation about shared libraries for"
< echo "more information, such as the ld(1) and ld.so(8) manual pages."
< echo "----------------------------------------------------------------------"
< exit 0
---
> $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
4589c5853
< exit 1
---
> exit $EXIT_FAILURE
4597c5861
< exit 1
---
> exit $EXIT_FAILURE
4604c5868
< if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
---
> if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4608c5872
< exit 1
---
> exit $EXIT_FAILURE
4635c5899
< exit 1
---
> exit $EXIT_FAILURE
4675c5939
< if (${SED} -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
---
> if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4698c5962
< # Restore saved enviroment variables
---
> # Restore saved environment variables
4715c5979
< exit 0
---
> exit $EXIT_SUCCESS
4743c6007
< exit 1
---
> exit $EXIT_FAILURE
4747a6012
> origobjdir="$objdir"
4752c6017
< objdir="$objdir"
---
> objdir="$origobjdir"
4754c6019
< objdir="$dir/$objdir"
---
> objdir="$dir/$origobjdir"
4757c6022
< test $mode = uninstall && objdir="$dir"
---
> test "$mode" = uninstall && objdir="$dir"
4760c6025
< if test $mode = clean; then
---
> if test "$mode" = clean; then
4784c6049
< if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
---
> if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4792c6057
< test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
---
> test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4794c6059
< if test $mode = uninstall; then
---
> if test "$mode" = uninstall; then
4797c6062
< eval cmds=\"$postuninstall_cmds\"
---
> cmds=$postuninstall_cmds
4800a6066
> eval cmd=\"$cmd\"
4803c6069
< if test $? != 0 && test "$rmforce" != yes; then
---
> if test "$?" -ne 0 && test "$rmforce" != yes; then
4812c6078
< eval cmds=\"$old_postuninstall_cmds\"
---
> cmds=$old_postuninstall_cmds
4815a6082
> eval cmd=\"$cmd\"
4818c6085
< if test $? != 0 && test "$rmforce" != yes; then
---
> if test "$?" -ne 0 && test "$rmforce" != yes; then
4830,4832c6097,6113
< if test "$build_old_libs" = yes; then
< oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
< rmfiles="$rmfiles $dir/$oldobj"
---
> # Possibly a libtool object, so verify it.
> if (${SED} -e '2q' $file | grep "^# 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
4837,4841c6118,6132
< # 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
---
> if test "$mode" = clean ; then
> noexename=$name
> case $file in
> *.exe)
> file=`$echo $file|${SED} 's,.exe$,,'`
> noexename=`$echo $name|${SED} 's,.exe$,,'`
> # $file with .exe has already been added to rmfiles,
> # add $file without .exe
> rmfiles="$rmfiles $file"
> ;;
> esac
> # Do a test to see if this is a libtool program.
> if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
> relink_command=
> . $dir/$noexename
4843,4845c6134,6142
< rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
< if test "$fast_install" = yes && test -n "$relink_command"; then
< rmfiles="$rmfiles $objdir/lt-$name"
---
> # note $name still contains .exe if it was in $file originally
> # as does the version of $file that was added into $rmfiles
> rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
> if test "$fast_install" = yes && test -n "$relink_command"; then
> rmfiles="$rmfiles $objdir/lt-$name"
> fi
> if test "X$noexename" != "X$name" ; then
> rmfiles="$rmfiles $objdir/lt-${noexename}.c"
> fi
4852a6150
> objdir="$origobjdir"
4868c6166
< exit 1
---
> exit $EXIT_FAILURE
4875c6173
< exit 1
---
> exit $EXIT_FAILURE
4881c6179
< exit 1
---
> exit $EXIT_FAILURE
4899a6198
> --tag=TAG use configuration variables from tag TAG
4913,4914c6212,6215
< a more detailed description of MODE."
< exit 0
---
> a more detailed description of MODE.
>
> Report bugs to <bug-libtool@gnu.org>."
> exit $EXIT_SUCCESS
5024a6326,6328
> -objectlist FILE Use a list of object files found in FILE to specify objects
> -precious-files-regex REGEX
> don't remove output files matching REGEX
5066c6370
< exit 1
---
> exit $EXIT_FAILURE
5070c6374
< echo
---
> $echo
5073c6377
< exit 0
---
> exit $EXIT_SUCCESS
5074a6379,6398
> # 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
>