ltmain.sh
changeset 947 3bb035750537
parent 886 05c551e5bc64
equal deleted inserted replaced
946:8520712f8ef0 947:3bb035750537
       
     1 # Based on libtool-1.5.8
     1 # ltmain.sh - Provide generalized library-building support services.
     2 # ltmain.sh - Provide generalized library-building support services.
     2 # NOTE: Changing this file will not affect anything until you rerun configure.
     3 # NOTE: Changing this file will not affect anything until you rerun configure.
     3 #
     4 #
     4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
     5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
     5 # Free Software Foundation, Inc.
     6 # Free Software Foundation, Inc.
     6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
     7 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
     7 #
     8 #
     8 # This program is free software; you can redistribute it and/or modify
     9 # This program is free software; you can redistribute it and/or modify
     9 # it under the terms of the GNU General Public License as published by
    10 # it under the terms of the GNU General Public License as published by
    22 # As a special exception to the GNU General Public License, if you
    23 # As a special exception to the GNU General Public License, if you
    23 # distribute this file as part of a program that contains a
    24 # distribute this file as part of a program that contains a
    24 # configuration script generated by Autoconf, you may include it under
    25 # configuration script generated by Autoconf, you may include it under
    25 # the same distribution terms that you use for the rest of that program.
    26 # the same distribution terms that you use for the rest of that program.
    26 
    27 
       
    28 basename="s,^.*/,,g"
       
    29 
       
    30 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
       
    31 # is ksh but when the shell is invoked as "sh" and the current value of
       
    32 # the _XPG environment variable is not equal to 1 (one), the special
       
    33 # positional parameter $0, within a function call, is the name of the
       
    34 # function.
       
    35 progpath="$0"
       
    36 
       
    37 # The name of this program:
       
    38 progname=`echo "$progpath" | $SED $basename`
       
    39 modename="$progname"
       
    40 
       
    41 # Global variables:
       
    42 EXIT_SUCCESS=0
       
    43 EXIT_FAILURE=1
       
    44 
       
    45 PROGRAM=ltmain.sh
       
    46 PACKAGE=libtool
       
    47 VERSION=1.5.8
       
    48 TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
       
    49 
       
    50 # See if we are running on zsh, and set the options which allow our
       
    51 # commands through without removal of \ escapes.
       
    52 if test -n "${ZSH_VERSION+set}" ; then
       
    53   setopt NO_GLOB_SUBST
       
    54 fi
       
    55 
    27 # Check that we have a working $echo.
    56 # Check that we have a working $echo.
    28 if test "X$1" = X--no-reexec; then
    57 if test "X$1" = X--no-reexec; then
    29   # Discard the --no-reexec flag, and continue.
    58   # Discard the --no-reexec flag, and continue.
    30   shift
    59   shift
    31 elif test "X$1" = X--fallback-echo; then
    60 elif test "X$1" = X--fallback-echo; then
    34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
    63 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
    35   # Yippee, $echo works!
    64   # Yippee, $echo works!
    36   :
    65   :
    37 else
    66 else
    38   # Restart under the correct shell, and then maybe $echo will work.
    67   # Restart under the correct shell, and then maybe $echo will work.
    39   exec $SHELL "$0" --no-reexec ${1+"$@"}
    68   exec $SHELL "$progpath" --no-reexec ${1+"$@"}
    40 fi
    69 fi
    41 
    70 
    42 if test "X$1" = X--fallback-echo; then
    71 if test "X$1" = X--fallback-echo; then
    43   # used as fallback echo
    72   # used as fallback echo
    44   shift
    73   shift
    45   cat <<EOF
    74   cat <<EOF
    46 $*
    75 $*
    47 EOF
    76 EOF
    48   exit 0
    77   exit $EXIT_SUCCESS
    49 fi
    78 fi
    50 
       
    51 # The name of this program.
       
    52 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
       
    53 modename="$progname"
       
    54 
       
    55 # Constants.
       
    56 PROGRAM=ltmain.sh
       
    57 PACKAGE=libtool
       
    58 VERSION=1.5
       
    59 TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
       
    60 
    79 
    61 default_mode=
    80 default_mode=
    62 help="Try \`$progname --help' for more information."
    81 help="Try \`$progname --help' for more information."
    63 magic="%%%MAGIC variable%%%"
    82 magic="%%%MAGIC variable%%%"
    64 mkdir="mkdir"
    83 mkdir="mkdir"
    68 # Sed substitution that helps us do robust quoting.  It backslashifies
    87 # Sed substitution that helps us do robust quoting.  It backslashifies
    69 # metacharacters that are still active within double-quoted strings.
    88 # metacharacters that are still active within double-quoted strings.
    70 Xsed="${SED}"' -e 1s/^X//'
    89 Xsed="${SED}"' -e 1s/^X//'
    71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    90 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
    72 # test EBCDIC or ASCII
    91 # test EBCDIC or ASCII
    73 case `echo A|od -x` in
    92 case `echo A|tr A '\301'` in
    74  *[Cc]1*) # EBCDIC based system
    93  A) # EBCDIC based system
    75   SP2NL="tr '\100' '\n'"
    94   SP2NL="tr '\100' '\n'"
    76   NL2SP="tr '\r\n' '\100\100'"
    95   NL2SP="tr '\r\n' '\100\100'"
    77   ;;
    96   ;;
    78  *) # Assume ASCII based system
    97  *) # Assume ASCII based system
    79   SP2NL="tr '\040' '\012'"
    98   SP2NL="tr '\040' '\012'"
    92 if test "${LANG+set}" = set; then
   111 if test "${LANG+set}" = set; then
    93   save_LANG="$LANG"; LANG=C; export LANG
   112   save_LANG="$LANG"; LANG=C; export LANG
    94 fi
   113 fi
    95 
   114 
    96 # Make sure IFS has a sensible default
   115 # Make sure IFS has a sensible default
    97 : ${IFS=" 	"}
   116 : ${IFS=" 	
       
   117 "}
    98 
   118 
    99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   119 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
   100   $echo "$modename: not configured to build any kind of library" 1>&2
   120   $echo "$modename: not configured to build any kind of library" 1>&2
   101   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
   121   $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
   102   exit 1
   122   exit $EXIT_FAILURE
   103 fi
   123 fi
   104 
   124 
   105 # Global variables.
   125 # Global variables.
   106 mode=$default_mode
   126 mode=$default_mode
   107 nonopt=
   127 nonopt=
   116 
   136 
   117 #####################################
   137 #####################################
   118 # Shell function definitions:
   138 # Shell function definitions:
   119 # This seems to be the best place for them
   139 # This seems to be the best place for them
   120 
   140 
       
   141 # func_win32_libid arg
       
   142 # return the library type of file 'arg'
       
   143 #
   121 # Need a lot of goo to handle *both* DLLs and import libs
   144 # Need a lot of goo to handle *both* DLLs and import libs
   122 # Has to be a shell function in order to 'eat' the argument
   145 # Has to be a shell function in order to 'eat' the argument
   123 # that is supplied when $file_magic_command is called.
   146 # that is supplied when $file_magic_command is called.
   124 win32_libid () {
   147 func_win32_libid () {
   125   win32_libid_type="unknown"
   148   win32_libid_type="unknown"
   126   win32_fileres=`file -L $1 2>/dev/null`
   149   win32_fileres=`file -L $1 2>/dev/null`
   127   case $win32_fileres in
   150   case $win32_fileres in
   128   *ar\ archive\ import\ library*) # definitely import
   151   *ar\ archive\ import\ library*) # definitely import
   129     win32_libid_type="x86 archive import"
   152     win32_libid_type="x86 archive import"
   130     ;;
   153     ;;
   131   *ar\ archive*) # could be an import, or static
   154   *ar\ archive*) # could be an import, or static
   132     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
   155     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
   133       grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
   156       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
   134       win32_nmres=`eval $NM -f posix -A $1 | \
   157       win32_nmres=`eval $NM -f posix -A $1 | \
   135 	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
   158 	sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
   136       if test "X$win32_nmres" = "Ximport" ; then
   159       if test "X$win32_nmres" = "Ximport" ; then
   137         win32_libid_type="x86 archive import"
   160         win32_libid_type="x86 archive import"
   138       else
   161       else
   139         win32_libid_type="x86 archive static"
   162         win32_libid_type="x86 archive static"
   140       fi
   163       fi
   141     fi
   164     fi
   142     ;;
   165     ;;
   143   *DLL*) 
   166   *DLL*)
   144     win32_libid_type="x86 DLL"
   167     win32_libid_type="x86 DLL"
   145     ;;
   168     ;;
   146   *executable*) # but shell scripts are "executable" too...
   169   *executable*) # but shell scripts are "executable" too...
   147     case $win32_fileres in
   170     case $win32_fileres in
   148     *MS\ Windows\ PE\ Intel*)
   171     *MS\ Windows\ PE\ Intel*)
   152     ;;
   175     ;;
   153   esac
   176   esac
   154   $echo $win32_libid_type
   177   $echo $win32_libid_type
   155 }
   178 }
   156 
   179 
       
   180 
       
   181 # func_infer_tag arg
       
   182 # Infer tagged configuration to use if any are available and
       
   183 # if one wasn't chosen via the "--tag" command line option.
       
   184 # Only attempt this if the compiler in the base compile
       
   185 # command doesn't match the default compiler.
       
   186 # arg is usually of the form 'gcc ...'
       
   187 func_infer_tag () {
       
   188     if test -n "$available_tags" && test -z "$tagname"; then
       
   189       CC_quoted=
       
   190       for arg in $CC; do
       
   191 	case $arg in
       
   192 	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
       
   193 	  arg="\"$arg\""
       
   194 	  ;;
       
   195 	esac
       
   196 	CC_quoted="$CC_quoted $arg"
       
   197       done
       
   198       case $@ in
       
   199       # Blanks in the command may have been stripped by the calling shell,
       
   200       # but not from the CC environment variable when configure was run.
       
   201       " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
       
   202       # Blanks at the start of $base_compile will cause this to fail
       
   203       # if we don't check for them as well.
       
   204       *)
       
   205 	for z in $available_tags; do
       
   206 	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
       
   207 	    # Evaluate the configuration.
       
   208 	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
       
   209 	    CC_quoted=
       
   210 	    for arg in $CC; do
       
   211 	    # Double-quote args containing other shell metacharacters.
       
   212 	    case $arg in
       
   213 	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
       
   214 	      arg="\"$arg\""
       
   215 	      ;;
       
   216 	    esac
       
   217 	    CC_quoted="$CC_quoted $arg"
       
   218 	  done
       
   219 	    case "$@ " in
       
   220 	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
       
   221 	      # The compiler in the base compile command matches
       
   222 	      # the one in the tagged configuration.
       
   223 	      # Assume this is the tagged configuration we want.
       
   224 	      tagname=$z
       
   225 	      break
       
   226 	      ;;
       
   227 	    esac
       
   228 	  fi
       
   229 	done
       
   230 	# If $tagname still isn't set, then no tagged configuration
       
   231 	# was found and let the user know that the "--tag" command
       
   232 	# line option must be used.
       
   233 	if test -z "$tagname"; then
       
   234 	  $echo "$modename: unable to infer tagged configuration"
       
   235 	  $echo "$modename: specify a tag with \`--tag'" 1>&2
       
   236 	  exit $EXIT_FAILURE
       
   237 #        else
       
   238 #          $echo "$modename: using $tagname tagged configuration"
       
   239 	fi
       
   240 	;;
       
   241       esac
       
   242     fi
       
   243 }
       
   244 
       
   245 
       
   246 # func_extract_archives gentop oldlib ...
       
   247 func_extract_archives () {
       
   248     my_gentop="$1"; shift
       
   249     my_oldlibs=${1+"$@"}
       
   250     my_oldobjs=""
       
   251     my_xlib=""
       
   252     my_xabs=""
       
   253     my_xdir=""
       
   254     my_status=""
       
   255 
       
   256     $show "${rm}r $my_gentop"
       
   257     $run ${rm}r "$my_gentop"
       
   258     $show "$mkdir $my_gentop"
       
   259     $run $mkdir "$my_gentop"
       
   260     my_status=$?
       
   261     if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
       
   262       exit $my_status
       
   263     fi
       
   264 
       
   265     for my_xlib in $my_oldlibs; do
       
   266       # Extract the objects.
       
   267       case $my_xlib in
       
   268 	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
       
   269 	*) my_xabs=`pwd`"/$my_xlib" ;;
       
   270       esac
       
   271       my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
       
   272       my_xdir="$my_gentop/$my_xlib"
       
   273 
       
   274       $show "${rm}r $my_xdir"
       
   275       $run ${rm}r "$my_xdir"
       
   276       $show "$mkdir $my_xdir"
       
   277       $run $mkdir "$my_xdir"
       
   278       status=$?
       
   279       if test "$status" -ne 0 && test ! -d "$my_xdir"; then
       
   280 	exit $status
       
   281       fi
       
   282       case $host in
       
   283       *-darwin*)
       
   284 	$show "Extracting $my_xabs"
       
   285 	# Do not bother doing anything if just a dry run
       
   286 	if test -z "$run"; then
       
   287 	  darwin_orig_dir=`pwd`
       
   288 	  cd $my_xdir || exit $?
       
   289 	  darwin_archive=$my_xabs
       
   290 	  darwin_curdir=`pwd`
       
   291 	  darwin_base_archive=`basename $darwin_archive`
       
   292 	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
       
   293 	  if test -n "$darwin_arches"; then 
       
   294 	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
       
   295 	    darwin_arch=
       
   296 	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
       
   297 	    for darwin_arch in  $darwin_arches ; do
       
   298 	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
       
   299 	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
       
   300 	      # Remove the table of contents from the thin files.
       
   301 	      $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
       
   302 	      $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
       
   303 	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
       
   304 	      $AR -xo "${darwin_base_archive}"
       
   305 	      rm "${darwin_base_archive}"
       
   306 	      cd "$darwin_curdir"
       
   307 	    done # $darwin_arches
       
   308       ## Okay now we have a bunch of thin objects, gotta fatten them up :)
       
   309 	    darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
       
   310 	    darwin_file=
       
   311 	    darwin_files=
       
   312 	    for darwin_file in $darwin_filelist; do
       
   313 	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
       
   314 	      lipo -create -output "$darwin_file" $darwin_files
       
   315 	    done # $darwin_filelist
       
   316 	    rm -rf unfat-$$
       
   317 	    cd "$darwin_orig_dir"
       
   318 	  else
       
   319 	    cd $darwin_orig_dir
       
   320 	    (cd $my_xdir && $AR x $my_xabs) || exit $?
       
   321 	  fi # $darwin_arches
       
   322 	fi # $run
       
   323       ;;
       
   324       *)
       
   325 	# We will extract separately just the conflicting names and we will
       
   326 	# no longer touch any unique names. It is faster to leave these
       
   327 	# extract automatically by $AR in one run.
       
   328 	$show "(cd $my_xdir && $AR x $my_xabs)"
       
   329 	$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
       
   330 	if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
       
   331 	  :
       
   332 	else
       
   333 	  $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
       
   334 	  $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
       
   335 	  $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
       
   336 	  do
       
   337 	    i=1
       
   338 	    while test "$i" -le "$count"
       
   339 	    do
       
   340 	      # Put our $i before any first dot (extension)
       
   341 	      # Never overwrite any file
       
   342 	      name_to="$name"
       
   343 	      while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
       
   344 	      do
       
   345 		name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
       
   346 	      done
       
   347 	      $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
       
   348 	      $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
       
   349 	      i=`expr $i + 1`
       
   350 	    done
       
   351 	  done
       
   352 	fi
       
   353 	;;
       
   354       esac
       
   355       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
       
   356     done
       
   357 
       
   358     func_extract_archives_result="$my_oldobjs"
       
   359 }
   157 # End of Shell function definitions
   360 # End of Shell function definitions
   158 #####################################
   361 #####################################
       
   362 
       
   363 # Darwin sucks
       
   364 eval std_shrext=\"$shrext_cmds\"
   159 
   365 
   160 # Parse our command line options once, thoroughly.
   366 # Parse our command line options once, thoroughly.
   161 while test "$#" -gt 0
   367 while test "$#" -gt 0
   162 do
   368 do
   163   arg="$1"
   369   arg="$1"
   174     execute_dlfiles)
   380     execute_dlfiles)
   175       execute_dlfiles="$execute_dlfiles $arg"
   381       execute_dlfiles="$execute_dlfiles $arg"
   176       ;;
   382       ;;
   177     tag)
   383     tag)
   178       tagname="$arg"
   384       tagname="$arg"
       
   385       preserve_args="${preserve_args}=$arg"
   179 
   386 
   180       # Check whether tagname contains only valid characters
   387       # Check whether tagname contains only valid characters
   181       case $tagname in
   388       case $tagname in
   182       *[!-_A-Za-z0-9,/]*)
   389       *[!-_A-Za-z0-9,/]*)
   183 	$echo "$progname: invalid tag name: $tagname" 1>&2
   390 	$echo "$progname: invalid tag name: $tagname" 1>&2
   184 	exit 1
   391 	exit $EXIT_FAILURE
   185 	;;
   392 	;;
   186       esac
   393       esac
   187 
   394 
   188       case $tagname in
   395       case $tagname in
   189       CC)
   396       CC)
   190 	# Don't test for the "default" C tag, as we know, it's there, but
   397 	# Don't test for the "default" C tag, as we know, it's there, but
   191 	# not specially marked.
   398 	# not specially marked.
   192 	;;
   399 	;;
   193       *)
   400       *)
   194 	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
   401 	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
   195 	  taglist="$taglist $tagname"
   402 	  taglist="$taglist $tagname"
   196 	  # Evaluate the configuration.
   403 	  # Evaluate the configuration.
   197 	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
   404 	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
   198 	else
   405 	else
   199 	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
   406 	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
   200 	fi
   407 	fi
   201 	;;
   408 	;;
   202       esac
   409       esac
   221     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
   428     $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
   222     $echo
   429     $echo
   223     $echo "Copyright (C) 2003  Free Software Foundation, Inc."
   430     $echo "Copyright (C) 2003  Free Software Foundation, Inc."
   224     $echo "This is free software; see the source for copying conditions.  There is NO"
   431     $echo "This is free software; see the source for copying conditions.  There is NO"
   225     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   432     $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   226     exit 0
   433     exit $EXIT_SUCCESS
   227     ;;
   434     ;;
   228 
   435 
   229   --config)
   436   --config)
   230     ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
   437     ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
   231     # Now print the configurations for the tags.
   438     # Now print the configurations for the tags.
   232     for tagname in $taglist; do
   439     for tagname in $taglist; do
   233       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
   440       ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
   234     done
   441     done
   235     exit 0
   442     exit $EXIT_SUCCESS
   236     ;;
   443     ;;
   237 
   444 
   238   --debug)
   445   --debug)
   239     $echo "$progname: enabling shell trace mode"
   446     $echo "$progname: enabling shell trace mode"
   240     set -x
   447     set -x
       
   448     preserve_args="$preserve_args $arg"
   241     ;;
   449     ;;
   242 
   450 
   243   --dry-run | -n)
   451   --dry-run | -n)
   244     run=:
   452     run=:
   245     ;;
   453     ;;
   254     if test "$build_old_libs" = yes; then
   462     if test "$build_old_libs" = yes; then
   255       $echo "enable static libraries"
   463       $echo "enable static libraries"
   256     else
   464     else
   257       $echo "disable static libraries"
   465       $echo "disable static libraries"
   258     fi
   466     fi
   259     exit 0
   467     exit $EXIT_SUCCESS
   260     ;;
   468     ;;
   261 
   469 
   262   --finish) mode="finish" ;;
   470   --finish) mode="finish" ;;
   263 
   471 
   264   --mode) prevopt="--mode" prev=mode ;;
   472   --mode) prevopt="--mode" prev=mode ;;
   266 
   474 
   267   --preserve-dup-deps) duplicate_deps="yes" ;;
   475   --preserve-dup-deps) duplicate_deps="yes" ;;
   268 
   476 
   269   --quiet | --silent)
   477   --quiet | --silent)
   270     show=:
   478     show=:
       
   479     preserve_args="$preserve_args $arg"
   271     ;;
   480     ;;
   272 
   481 
   273   --tag) prevopt="--tag" prev=tag ;;
   482   --tag) prevopt="--tag" prev=tag ;;
   274   --tag=*)
   483   --tag=*)
   275     set tag "$optarg" ${1+"$@"}
   484     set tag "$optarg" ${1+"$@"}
   276     shift
   485     shift
   277     prev=tag
   486     prev=tag
       
   487     preserve_args="$preserve_args --tag"
   278     ;;
   488     ;;
   279 
   489 
   280   -dlopen)
   490   -dlopen)
   281     prevopt="-dlopen"
   491     prevopt="-dlopen"
   282     prev=execute_dlfiles
   492     prev=execute_dlfiles
   283     ;;
   493     ;;
   284 
   494 
   285   -*)
   495   -*)
   286     $echo "$modename: unrecognized option \`$arg'" 1>&2
   496     $echo "$modename: unrecognized option \`$arg'" 1>&2
   287     $echo "$help" 1>&2
   497     $echo "$help" 1>&2
   288     exit 1
   498     exit $EXIT_FAILURE
   289     ;;
   499     ;;
   290 
   500 
   291   *)
   501   *)
   292     nonopt="$arg"
   502     nonopt="$arg"
   293     break
   503     break
   296 done
   506 done
   297 
   507 
   298 if test -n "$prevopt"; then
   508 if test -n "$prevopt"; then
   299   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
   509   $echo "$modename: option \`$prevopt' requires an argument" 1>&2
   300   $echo "$help" 1>&2
   510   $echo "$help" 1>&2
   301   exit 1
   511   exit $EXIT_FAILURE
   302 fi
   512 fi
   303 
   513 
   304 # If this variable is set in any of the actions, the command in it
   514 # If this variable is set in any of the actions, the command in it
   305 # will be execed at the end.  This prevents here-documents from being
   515 # will be execed at the end.  This prevents here-documents from being
   306 # left over by shells.
   516 # left over by shells.
   352 
   562 
   353   # Only execute mode is allowed to have -dlopen flags.
   563   # Only execute mode is allowed to have -dlopen flags.
   354   if test -n "$execute_dlfiles" && test "$mode" != execute; then
   564   if test -n "$execute_dlfiles" && test "$mode" != execute; then
   355     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
   565     $echo "$modename: unrecognized option \`-dlopen'" 1>&2
   356     $echo "$help" 1>&2
   566     $echo "$help" 1>&2
   357     exit 1
   567     exit $EXIT_FAILURE
   358   fi
   568   fi
   359 
   569 
   360   # Change the help message to a mode-specific one.
   570   # Change the help message to a mode-specific one.
   361   generic_help="$help"
   571   generic_help="$help"
   362   help="Try \`$modename --help --mode=$mode' for more information."
   572   help="Try \`$modename --help --mode=$mode' for more information."
   367   compile)
   577   compile)
   368     modename="$modename: compile"
   578     modename="$modename: compile"
   369     # Get the compilation command and the source file.
   579     # Get the compilation command and the source file.
   370     base_compile=
   580     base_compile=
   371     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
   581     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
       
   582     suppress_opt=yes
   372     suppress_output=
   583     suppress_output=
   373     arg_mode=normal
   584     arg_mode=normal
   374     libobj=
   585     libobj=
       
   586     later=
   375 
   587 
   376     for arg
   588     for arg
   377     do
   589     do
   378       case "$arg_mode" in
   590       case "$arg_mode" in
   379       arg  )
   591       arg  )
   392 	# Accept any command-line options.
   604 	# Accept any command-line options.
   393 	case $arg in
   605 	case $arg in
   394 	-o)
   606 	-o)
   395 	  if test -n "$libobj" ; then
   607 	  if test -n "$libobj" ; then
   396 	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
   608 	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
   397 	    exit 1
   609 	    exit $EXIT_FAILURE
   398 	  fi
   610 	  fi
   399 	  arg_mode=target
   611 	  arg_mode=target
   400 	  continue
   612 	  continue
   401 	  ;;
   613 	  ;;
   402 
   614 
   403 	-static)
   615 	-static | -prefer-pic | -prefer-non-pic)
   404 	  build_old_libs=yes
   616 	  later="$later $arg"
   405 	  continue
   617 	  continue
   406 	  ;;
   618 	  ;;
   407 
   619 
   408 	-prefer-pic)
   620 	-no-suppress)
   409 	  pic_mode=yes
   621 	  suppress_opt=no
   410 	  continue
       
   411 	  ;;
       
   412 
       
   413 	-prefer-non-pic)
       
   414 	  pic_mode=no
       
   415 	  continue
   622 	  continue
   416 	  ;;
   623 	  ;;
   417 
   624 
   418 	-Xcompiler)
   625 	-Xcompiler)
   419 	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
   626 	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
   422 
   629 
   423 	-Wc,*)
   630 	-Wc,*)
   424 	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
   631 	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
   425 	  lastarg=
   632 	  lastarg=
   426 	  save_ifs="$IFS"; IFS=','
   633 	  save_ifs="$IFS"; IFS=','
   427 	  for arg in $args; do
   634  	  for arg in $args; do
   428 	    IFS="$save_ifs"
   635 	    IFS="$save_ifs"
   429 
   636 
   430 	    # Double-quote args containing other shell metacharacters.
   637 	    # Double-quote args containing other shell metacharacters.
   431 	    # Many Bourne shells cannot handle close brackets correctly
   638 	    # Many Bourne shells cannot handle close brackets correctly
   432 	    # in scan sets, so we specify it separately.
   639 	    # in scan sets, so we specify it separately.
   472     done # for arg
   679     done # for arg
   473 
   680 
   474     case $arg_mode in
   681     case $arg_mode in
   475     arg)
   682     arg)
   476       $echo "$modename: you must specify an argument for -Xcompile"
   683       $echo "$modename: you must specify an argument for -Xcompile"
   477       exit 1
   684       exit $EXIT_FAILURE
   478       ;;
   685       ;;
   479     target)
   686     target)
   480       $echo "$modename: you must specify a target with \`-o'" 1>&2
   687       $echo "$modename: you must specify a target with \`-o'" 1>&2
   481       exit 1
   688       exit $EXIT_FAILURE
   482       ;;
   689       ;;
   483     *)
   690     *)
   484       # Get the name of the library object.
   691       # Get the name of the library object.
   485       [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
   692       [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
   486       ;;
   693       ;;
   509 
   716 
   510     case $libobj in
   717     case $libobj in
   511     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
   718     *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
   512     *)
   719     *)
   513       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
   720       $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
   514       exit 1
   721       exit $EXIT_FAILURE
   515       ;;
   722       ;;
   516     esac
   723     esac
   517 
   724 
   518     # Infer tagged configuration to use if any are available and
   725     func_infer_tag $base_compile
   519     # if one wasn't chosen via the "--tag" command line option.
   726 
   520     # Only attempt this if the compiler in the base compile
   727     for arg in $later; do
   521     # command doesn't match the default compiler.
   728       case $arg in
   522     if test -n "$available_tags" && test -z "$tagname"; then
   729       -static)
   523       case $base_compile in
   730 	build_old_libs=yes
   524       # Blanks in the command may have been stripped by the calling shell,
   731 	continue
   525       # but not from the CC environment variable when configure was run.
   732 	;;
   526       " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
   733 
   527       # Blanks at the start of $base_compile will cause this to fail
   734       -prefer-pic)
   528       # if we don't check for them as well.
   735 	pic_mode=yes
   529       *)
   736 	continue
   530 	for z in $available_tags; do
   737 	;;
   531 	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
   738 
   532 	    # Evaluate the configuration.
   739       -prefer-non-pic)
   533 	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
   740 	pic_mode=no
   534 	    case "$base_compile " in
   741 	continue
   535 	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
       
   536 	      # The compiler in the base compile command matches
       
   537 	      # the one in the tagged configuration.
       
   538 	      # Assume this is the tagged configuration we want.
       
   539 	      tagname=$z
       
   540 	      break
       
   541 	      ;;
       
   542 	    esac
       
   543 	  fi
       
   544 	done
       
   545 	# If $tagname still isn't set, then no tagged configuration
       
   546 	# was found and let the user know that the "--tag" command
       
   547 	# line option must be used.
       
   548 	if test -z "$tagname"; then
       
   549 	  $echo "$modename: unable to infer tagged configuration"
       
   550 	  $echo "$modename: specify a tag with \`--tag'" 1>&2
       
   551 	  exit 1
       
   552 #        else
       
   553 #          $echo "$modename: using $tagname tagged configuration"
       
   554 	fi
       
   555 	;;
   742 	;;
   556       esac
   743       esac
   557     fi
   744     done
   558 
   745 
   559     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
   746     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
   560     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
   747     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
   561     if test "X$xdir" = "X$obj"; then
   748     if test "X$xdir" = "X$obj"; then
   562       xdir=
   749       xdir=
   566     lobj=${xdir}$objdir/$objname
   753     lobj=${xdir}$objdir/$objname
   567 
   754 
   568     if test -z "$base_compile"; then
   755     if test -z "$base_compile"; then
   569       $echo "$modename: you must specify a compilation command" 1>&2
   756       $echo "$modename: you must specify a compilation command" 1>&2
   570       $echo "$help" 1>&2
   757       $echo "$help" 1>&2
   571       exit 1
   758       exit $EXIT_FAILURE
   572     fi
   759     fi
   573 
   760 
   574     # Delete any leftover library objects.
   761     # Delete any leftover library objects.
   575     if test "$build_old_libs" = yes; then
   762     if test "$build_old_libs" = yes; then
   576       removelist="$obj $lobj $libobj ${libobj}T"
   763       removelist="$obj $lobj $libobj ${libobj}T"
   577     else
   764     else
   578       removelist="$lobj $libobj ${libobj}T"
   765       removelist="$lobj $libobj ${libobj}T"
   579     fi
   766     fi
   580 
   767 
   581     $run $rm $removelist
   768     $run $rm $removelist
   582     trap "$run $rm $removelist; exit 1" 1 2 15
   769     trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
   583 
   770 
   584     # On Cygwin there's no "real" PIC flag so we must build both object types
   771     # On Cygwin there's no "real" PIC flag so we must build both object types
   585     case $host_os in
   772     case $host_os in
   586     cygwin* | mingw* | pw32* | os2*)
   773     cygwin* | mingw* | pw32* | os2*)
   587       pic_mode=default
   774       pic_mode=default
   596     # not support -o with -c
   783     # not support -o with -c
   597     if test "$compiler_c_o" = no; then
   784     if test "$compiler_c_o" = no; then
   598       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
   785       output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
   599       lockfile="$output_obj.lock"
   786       lockfile="$output_obj.lock"
   600       removelist="$removelist $output_obj $lockfile"
   787       removelist="$removelist $output_obj $lockfile"
   601       trap "$run $rm $removelist; exit 1" 1 2 15
   788       trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
   602     else
   789     else
   603       output_obj=
   790       output_obj=
   604       need_locks=no
   791       need_locks=no
   605       lockfile=
   792       lockfile=
   606     fi
   793     fi
   607 
   794 
   608     # Lock this critical section if it is needed
   795     # Lock this critical section if it is needed
   609     # We use this script file to make the link, it avoids creating a new file
   796     # We use this script file to make the link, it avoids creating a new file
   610     if test "$need_locks" = yes; then
   797     if test "$need_locks" = yes; then
   611       until $run ln "$0" "$lockfile" 2>/dev/null; do
   798       until $run ln "$progpath" "$lockfile" 2>/dev/null; do
   612 	$show "Waiting for $lockfile to be removed"
   799 	$show "Waiting for $lockfile to be removed"
   613 	sleep 2
   800 	sleep 2
   614       done
   801       done
   615     elif test "$need_locks" = warn; then
   802     elif test "$need_locks" = warn; then
   616       if test -f "$lockfile"; then
   803       if test -f "$lockfile"; then
   624 repeat this compilation, it may succeed, by chance, but you had better
   811 repeat this compilation, it may succeed, by chance, but you had better
   625 avoid parallel builds (make -j) in this platform, or get a better
   812 avoid parallel builds (make -j) in this platform, or get a better
   626 compiler."
   813 compiler."
   627 
   814 
   628 	$run $rm $removelist
   815 	$run $rm $removelist
   629 	exit 1
   816 	exit $EXIT_FAILURE
   630       fi
   817       fi
   631       $echo $srcfile > "$lockfile"
   818       $echo $srcfile > "$lockfile"
   632     fi
   819     fi
   633 
   820 
   634     if test -n "$fix_srcfile_path"; then
   821     if test -n "$fix_srcfile_path"; then
   679 
   866 
   680       $show "$command"
   867       $show "$command"
   681       if $run eval "$command"; then :
   868       if $run eval "$command"; then :
   682       else
   869       else
   683 	test -n "$output_obj" && $run $rm $removelist
   870 	test -n "$output_obj" && $run $rm $removelist
   684 	exit 1
   871 	exit $EXIT_FAILURE
   685       fi
   872       fi
   686 
   873 
   687       if test "$need_locks" = warn &&
   874       if test "$need_locks" = warn &&
   688 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
   875 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
   689 	$echo "\
   876 	$echo "\
   699 repeat this compilation, it may succeed, by chance, but you had better
   886 repeat this compilation, it may succeed, by chance, but you had better
   700 avoid parallel builds (make -j) in this platform, or get a better
   887 avoid parallel builds (make -j) in this platform, or get a better
   701 compiler."
   888 compiler."
   702 
   889 
   703 	$run $rm $removelist
   890 	$run $rm $removelist
   704 	exit 1
   891 	exit $EXIT_FAILURE
   705       fi
   892       fi
   706 
   893 
   707       # Just move the object if needed, then go on to compile the next one
   894       # Just move the object if needed, then go on to compile the next one
   708       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
   895       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
   709 	$show "$mv $output_obj $lobj"
   896 	$show "$mv $output_obj $lobj"
   720 pic_object='$objdir/$objname'
   907 pic_object='$objdir/$objname'
   721 
   908 
   722 EOF
   909 EOF
   723 
   910 
   724       # Allow error messages only from the first compilation.
   911       # Allow error messages only from the first compilation.
   725       suppress_output=' >/dev/null 2>&1'
   912       if test "$suppress_opt" = yes; then
       
   913         suppress_output=' >/dev/null 2>&1'
       
   914       fi
   726     else
   915     else
   727       # No PIC object so indicate it doesn't exist in the libtool
   916       # No PIC object so indicate it doesn't exist in the libtool
   728       # object file.
   917       # object file.
   729       test -z "$run" && cat >> ${libobj}T <<EOF
   918       test -z "$run" && cat >> ${libobj}T <<EOF
   730 pic_object=none
   919 pic_object=none
   749       $run $rm "$obj" "$output_obj"
   938       $run $rm "$obj" "$output_obj"
   750       $show "$command"
   939       $show "$command"
   751       if $run eval "$command"; then :
   940       if $run eval "$command"; then :
   752       else
   941       else
   753 	$run $rm $removelist
   942 	$run $rm $removelist
   754 	exit 1
   943 	exit $EXIT_FAILURE
   755       fi
   944       fi
   756 
   945 
   757       if test "$need_locks" = warn &&
   946       if test "$need_locks" = warn &&
   758 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
   947 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
   759 	$echo "\
   948 	$echo "\
   769 repeat this compilation, it may succeed, by chance, but you had better
   958 repeat this compilation, it may succeed, by chance, but you had better
   770 avoid parallel builds (make -j) in this platform, or get a better
   959 avoid parallel builds (make -j) in this platform, or get a better
   771 compiler."
   960 compiler."
   772 
   961 
   773 	$run $rm $removelist
   962 	$run $rm $removelist
   774 	exit 1
   963 	exit $EXIT_FAILURE
   775       fi
   964       fi
   776 
   965 
   777       # Just move the object if needed
   966       # Just move the object if needed
   778       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
   967       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
   779 	$show "$mv $output_obj $obj"
   968 	$show "$mv $output_obj $obj"
   807     # Unlock the critical section if it was locked
   996     # Unlock the critical section if it was locked
   808     if test "$need_locks" != no; then
   997     if test "$need_locks" != no; then
   809       $run $rm "$lockfile"
   998       $run $rm "$lockfile"
   810     fi
   999     fi
   811 
  1000 
   812     exit 0
  1001     exit $EXIT_SUCCESS
   813     ;;
  1002     ;;
   814 
  1003 
   815   # libtool link mode
  1004   # libtool link mode
   816   link | relink)
  1005   link | relink)
   817     modename="$modename: link"
  1006     modename="$modename: link"
   833     *)
  1022     *)
   834       allow_undefined=yes
  1023       allow_undefined=yes
   835       ;;
  1024       ;;
   836     esac
  1025     esac
   837     libtool_args="$nonopt"
  1026     libtool_args="$nonopt"
   838     base_compile="$nonopt"
  1027     base_compile="$nonopt $@"
   839     compile_command="$nonopt"
  1028     compile_command="$nonopt"
   840     finalize_command="$nonopt"
  1029     finalize_command="$nonopt"
   841 
  1030 
   842     compile_rpath=
  1031     compile_rpath=
   843     finalize_rpath=
  1032     finalize_rpath=
   865     ltlibs=
  1054     ltlibs=
   866     module=no
  1055     module=no
   867     no_install=no
  1056     no_install=no
   868     objs=
  1057     objs=
   869     non_pic_objects=
  1058     non_pic_objects=
       
  1059     precious_files_regex=
   870     prefer_static_libs=no
  1060     prefer_static_libs=no
   871     preload=no
  1061     preload=no
   872     prev=
  1062     prev=
   873     prevarg=
  1063     prevarg=
   874     release=
  1064     release=
   878     temp_rpath=
  1068     temp_rpath=
   879     thread_safe=no
  1069     thread_safe=no
   880     vinfo=
  1070     vinfo=
   881     vinfo_number=no
  1071     vinfo_number=no
   882 
  1072 
       
  1073     func_infer_tag $base_compile
       
  1074 
   883     # We need to know -static, to get the right output filenames.
  1075     # We need to know -static, to get the right output filenames.
   884     for arg
  1076     for arg
   885     do
  1077     do
   886       case $arg in
  1078       case $arg in
   887       -all-static | -static)
  1079       -all-static | -static)
   909     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1101     test -n "$old_archive_from_new_cmds" && build_old_libs=yes
   910 
  1102 
   911     # Go through the arguments, transforming them on the way.
  1103     # Go through the arguments, transforming them on the way.
   912     while test "$#" -gt 0; do
  1104     while test "$#" -gt 0; do
   913       arg="$1"
  1105       arg="$1"
   914       base_compile="$base_compile $arg"
       
   915       shift
  1106       shift
   916       case $arg in
  1107       case $arg in
   917       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
  1108       *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
   918 	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  1109 	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
   919 	;;
  1110 	;;
   973 	  ;;
  1164 	  ;;
   974 	expsyms)
  1165 	expsyms)
   975 	  export_symbols="$arg"
  1166 	  export_symbols="$arg"
   976 	  if test ! -f "$arg"; then
  1167 	  if test ! -f "$arg"; then
   977 	    $echo "$modename: symbol file \`$arg' does not exist"
  1168 	    $echo "$modename: symbol file \`$arg' does not exist"
   978 	    exit 1
  1169 	    exit $EXIT_FAILURE
   979 	  fi
  1170 	  fi
   980 	  prev=
  1171 	  prev=
   981 	  continue
  1172 	  continue
   982 	  ;;
  1173 	  ;;
   983 	expsyms_regex)
  1174 	expsyms_regex)
   985 	  prev=
  1176 	  prev=
   986 	  continue
  1177 	  continue
   987 	  ;;
  1178 	  ;;
   988 	inst_prefix)
  1179 	inst_prefix)
   989 	  inst_prefix_dir="$arg"
  1180 	  inst_prefix_dir="$arg"
       
  1181 	  prev=
       
  1182 	  continue
       
  1183 	  ;;
       
  1184 	precious_regex)
       
  1185 	  precious_files_regex="$arg"
   990 	  prev=
  1186 	  prev=
   991 	  continue
  1187 	  continue
   992 	  ;;
  1188 	  ;;
   993 	release)
  1189 	release)
   994 	  release="-$arg"
  1190 	  release="-$arg"
  1020 		if test -z "$pic_object" || \
  1216 		if test -z "$pic_object" || \
  1021 		   test -z "$non_pic_object" ||
  1217 		   test -z "$non_pic_object" ||
  1022 		   test "$pic_object" = none && \
  1218 		   test "$pic_object" = none && \
  1023 		   test "$non_pic_object" = none; then
  1219 		   test "$non_pic_object" = none; then
  1024 		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1220 		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1025 		  exit 1
  1221 		  exit $EXIT_FAILURE
  1026 		fi
  1222 		fi
  1027 
  1223 
  1028 		# Extract subdirectory from the argument.
  1224 		# Extract subdirectory from the argument.
  1029 		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1225 		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1030 		if test "X$xdir" = "X$arg"; then
  1226 		if test "X$xdir" = "X$arg"; then
  1073 		fi
  1269 		fi
  1074 	      else
  1270 	      else
  1075 		# Only an error if not doing a dry-run.
  1271 		# Only an error if not doing a dry-run.
  1076 		if test -z "$run"; then
  1272 		if test -z "$run"; then
  1077 		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1273 		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1078 		  exit 1
  1274 		  exit $EXIT_FAILURE
  1079 		else
  1275 		else
  1080 		  # Dry-run case.
  1276 		  # Dry-run case.
  1081 
  1277 
  1082 		  # Extract subdirectory from the argument.
  1278 		  # Extract subdirectory from the argument.
  1083 		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1279 		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1094 		fi
  1290 		fi
  1095 	      fi
  1291 	      fi
  1096 	    done
  1292 	    done
  1097 	  else
  1293 	  else
  1098 	    $echo "$modename: link input file \`$save_arg' does not exist"
  1294 	    $echo "$modename: link input file \`$save_arg' does not exist"
  1099 	    exit 1
  1295 	    exit $EXIT_FAILURE
  1100 	  fi
  1296 	  fi
  1101 	  arg=$save_arg
  1297 	  arg=$save_arg
  1102 	  prev=
  1298 	  prev=
  1103 	  continue
  1299 	  continue
  1104 	  ;;
  1300 	  ;;
  1106 	  # We need an absolute path.
  1302 	  # We need an absolute path.
  1107 	  case $arg in
  1303 	  case $arg in
  1108 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
  1304 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
  1109 	  *)
  1305 	  *)
  1110 	    $echo "$modename: only absolute run-paths are allowed" 1>&2
  1306 	    $echo "$modename: only absolute run-paths are allowed" 1>&2
  1111 	    exit 1
  1307 	    exit $EXIT_FAILURE
  1112 	    ;;
  1308 	    ;;
  1113 	  esac
  1309 	  esac
  1114 	  if test "$prev" = rpath; then
  1310 	  if test "$prev" = rpath; then
  1115 	    case "$rpath " in
  1311 	    case "$rpath " in
  1116 	    *" $arg "*) ;;
  1312 	    *" $arg "*) ;;
  1156 		*) deplibs="$deplibs $qarg.framework" # this is fixed later
  1352 		*) deplibs="$deplibs $qarg.framework" # this is fixed later
  1157 		   ;;
  1353 		   ;;
  1158               esac
  1354               esac
  1159               ;;
  1355               ;;
  1160    	  esac
  1356    	  esac
       
  1357  	  prev=
       
  1358  	  continue
       
  1359  	  ;;
       
  1360 	shrext)
       
  1361   	  shrext_cmds="$arg"
  1161 	  prev=
  1362 	  prev=
  1162 	  continue
  1363 	  continue
  1163 	  ;;
  1364 	  ;;
  1164 	*)
  1365 	*)
  1165 	  eval "$prev=\"\$arg\""
  1366 	  eval "$prev=\"\$arg\""
  1207 	;;
  1408 	;;
  1208 
  1409 
  1209       -export-symbols | -export-symbols-regex)
  1410       -export-symbols | -export-symbols-regex)
  1210 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1411 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1211 	  $echo "$modename: more than one -exported-symbols argument is not allowed"
  1412 	  $echo "$modename: more than one -exported-symbols argument is not allowed"
  1212 	  exit 1
  1413 	  exit $EXIT_FAILURE
  1213 	fi
  1414 	fi
  1214 	if test "X$arg" = "X-export-symbols"; then
  1415 	if test "X$arg" = "X-export-symbols"; then
  1215 	  prev=expsyms
  1416 	  prev=expsyms
  1216 	else
  1417 	else
  1217 	  prev=expsyms_regex
  1418 	  prev=expsyms_regex
  1243 	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1444 	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1244 	*)
  1445 	*)
  1245 	  absdir=`cd "$dir" && pwd`
  1446 	  absdir=`cd "$dir" && pwd`
  1246 	  if test -z "$absdir"; then
  1447 	  if test -z "$absdir"; then
  1247 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1448 	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1248 	    exit 1
  1449 	    exit $EXIT_FAILURE
  1249 	  fi
  1450 	  fi
  1250 	  dir="$absdir"
  1451 	  dir="$absdir"
  1251 	  ;;
  1452 	  ;;
  1252 	esac
  1453 	esac
  1253 	case "$deplibs " in
  1454 	case "$deplibs " in
  1298 	fi
  1499 	fi
  1299 	deplibs="$deplibs $arg"
  1500 	deplibs="$deplibs $arg"
  1300 	continue
  1501 	continue
  1301 	;;
  1502 	;;
  1302 
  1503 
       
  1504      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
       
  1505 	deplibs="$deplibs $arg"
       
  1506 	continue
       
  1507 	;;
       
  1508 
  1303       -module)
  1509       -module)
  1304 	module=yes
  1510 	module=yes
  1305 	continue
  1511 	continue
  1306 	;;
  1512 	;;
  1307 
  1513 
  1362 	continue
  1568 	continue
  1363 	;;
  1569 	;;
  1364 
  1570 
  1365       -o) prev=output ;;
  1571       -o) prev=output ;;
  1366 
  1572 
       
  1573       -precious-files-regex)
       
  1574 	prev=precious_regex
       
  1575 	continue
       
  1576 	;;
       
  1577 
  1367       -release)
  1578       -release)
  1368 	prev=release
  1579 	prev=release
  1369 	continue
  1580 	continue
  1370 	;;
  1581 	;;
  1371 
  1582 
  1384 	# We need an absolute path.
  1595 	# We need an absolute path.
  1385 	case $dir in
  1596 	case $dir in
  1386 	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1597 	[\\/]* | [A-Za-z]:[\\/]*) ;;
  1387 	*)
  1598 	*)
  1388 	  $echo "$modename: only absolute run-paths are allowed" 1>&2
  1599 	  $echo "$modename: only absolute run-paths are allowed" 1>&2
  1389 	  exit 1
  1600 	  exit $EXIT_FAILURE
  1390 	  ;;
  1601 	  ;;
  1391 	esac
  1602 	esac
  1392 	case "$xrpath " in
  1603 	case "$xrpath " in
  1393 	*" $dir "*) ;;
  1604 	*" $dir "*) ;;
  1394 	*) xrpath="$xrpath $dir" ;;
  1605 	*) xrpath="$xrpath $dir" ;;
  1512 	  if test -z "$pic_object" || \
  1723 	  if test -z "$pic_object" || \
  1513 	     test -z "$non_pic_object" ||
  1724 	     test -z "$non_pic_object" ||
  1514 	     test "$pic_object" = none && \
  1725 	     test "$pic_object" = none && \
  1515 	     test "$non_pic_object" = none; then
  1726 	     test "$non_pic_object" = none; then
  1516 	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1727 	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1517 	    exit 1
  1728 	    exit $EXIT_FAILURE
  1518 	  fi
  1729 	  fi
  1519 
  1730 
  1520 	  # Extract subdirectory from the argument.
  1731 	  # Extract subdirectory from the argument.
  1521 	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1732 	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1522 	  if test "X$xdir" = "X$arg"; then
  1733 	  if test "X$xdir" = "X$arg"; then
  1565 	  fi
  1776 	  fi
  1566 	else
  1777 	else
  1567 	  # Only an error if not doing a dry-run.
  1778 	  # Only an error if not doing a dry-run.
  1568 	  if test -z "$run"; then
  1779 	  if test -z "$run"; then
  1569 	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1780 	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1570 	    exit 1
  1781 	    exit $EXIT_FAILURE
  1571 	  else
  1782 	  else
  1572 	    # Dry-run case.
  1783 	    # Dry-run case.
  1573 
  1784 
  1574 	    # Extract subdirectory from the argument.
  1785 	    # Extract subdirectory from the argument.
  1575 	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1786 	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1632     done # argument parsing loop
  1843     done # argument parsing loop
  1633 
  1844 
  1634     if test -n "$prev"; then
  1845     if test -n "$prev"; then
  1635       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1846       $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1636       $echo "$help" 1>&2
  1847       $echo "$help" 1>&2
  1637       exit 1
  1848       exit $EXIT_FAILURE
  1638     fi
       
  1639 
       
  1640     # Infer tagged configuration to use if any are available and
       
  1641     # if one wasn't chosen via the "--tag" command line option.
       
  1642     # Only attempt this if the compiler in the base link
       
  1643     # command doesn't match the default compiler.
       
  1644     if test -n "$available_tags" && test -z "$tagname"; then
       
  1645       case $base_compile in
       
  1646       # Blanks in the command may have been stripped by the calling shell,
       
  1647       # but not from the CC environment variable when configure was run.
       
  1648       "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
       
  1649       # Blanks at the start of $base_compile will cause this to fail
       
  1650       # if we don't check for them as well.
       
  1651       *)
       
  1652 	for z in $available_tags; do
       
  1653 	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
       
  1654 	    # Evaluate the configuration.
       
  1655 	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
       
  1656 	    case $base_compile in
       
  1657 	    "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
       
  1658 	      # The compiler in $compile_command matches
       
  1659 	      # the one in the tagged configuration.
       
  1660 	      # Assume this is the tagged configuration we want.
       
  1661 	      tagname=$z
       
  1662 	      break
       
  1663 	      ;;
       
  1664 	    esac
       
  1665 	  fi
       
  1666 	done
       
  1667 	# If $tagname still isn't set, then no tagged configuration
       
  1668 	# was found and let the user know that the "--tag" command
       
  1669 	# line option must be used.
       
  1670 	if test -z "$tagname"; then
       
  1671 	  $echo "$modename: unable to infer tagged configuration"
       
  1672 	  $echo "$modename: specify a tag with \`--tag'" 1>&2
       
  1673 	  exit 1
       
  1674 #       else
       
  1675 #         $echo "$modename: using $tagname tagged configuration"
       
  1676 	fi
       
  1677 	;;
       
  1678       esac
       
  1679     fi
  1849     fi
  1680 
  1850 
  1681     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1851     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1682       eval arg=\"$export_dynamic_flag_spec\"
  1852       eval arg=\"$export_dynamic_flag_spec\"
  1683       compile_command="$compile_command $arg"
  1853       compile_command="$compile_command $arg"
  1717     # Determine the type of output
  1887     # Determine the type of output
  1718     case $output in
  1888     case $output in
  1719     "")
  1889     "")
  1720       $echo "$modename: you must specify an output file" 1>&2
  1890       $echo "$modename: you must specify an output file" 1>&2
  1721       $echo "$help" 1>&2
  1891       $echo "$help" 1>&2
  1722       exit 1
  1892       exit $EXIT_FAILURE
  1723       ;;
  1893       ;;
  1724     *.$libext) linkmode=oldlib ;;
  1894     *.$libext) linkmode=oldlib ;;
  1725     *.lo | *.$objext) linkmode=obj ;;
  1895     *.lo | *.$objext) linkmode=obj ;;
  1726     *.la) linkmode=lib ;;
  1896     *.la) linkmode=lib ;;
  1727     *) linkmode=prog ;; # Anything else should be a program.
  1897     *) linkmode=prog ;; # Anything else should be a program.
  1728     esac
  1898     esac
  1729 
  1899 
  1730     case $host in
  1900     case $host in
  1731     *cygwin* | *mingw* | *pw32*)
  1901     *cygwin* | *mingw* | *pw32*)
  1732       # don't eliminate duplcations in $postdeps and $predeps
  1902       # don't eliminate duplications in $postdeps and $predeps
  1733       duplicate_compiler_generated_deps=yes
  1903       duplicate_compiler_generated_deps=yes
  1734       ;;
  1904       ;;
  1735     *)
  1905     *)
  1736       duplicate_compiler_generated_deps=$duplicate_deps
  1906       duplicate_compiler_generated_deps=$duplicate_deps
  1737       ;;
  1907       ;;
  1780 	for file in $dlfiles $dlprefiles; do
  1950 	for file in $dlfiles $dlprefiles; do
  1781 	  case $file in
  1951 	  case $file in
  1782 	  *.la) ;;
  1952 	  *.la) ;;
  1783 	  *)
  1953 	  *)
  1784 	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1954 	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1785 	    exit 1
  1955 	    exit $EXIT_FAILURE
  1786 	    ;;
  1956 	    ;;
  1787 	  esac
  1957 	  esac
  1788 	done
  1958 	done
  1789 	;;
  1959 	;;
  1790     prog)
  1960     prog)
  1818       fi
  1988       fi
  1819       for deplib in $libs; do
  1989       for deplib in $libs; do
  1820 	lib=
  1990 	lib=
  1821 	found=no
  1991 	found=no
  1822 	case $deplib in
  1992 	case $deplib in
       
  1993 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
       
  1994 	  if test "$linkmode,$pass" = "prog,link"; then
       
  1995 	    compile_deplibs="$deplib $compile_deplibs"
       
  1996 	    finalize_deplibs="$deplib $finalize_deplibs"
       
  1997 	  else
       
  1998 	    deplibs="$deplib $deplibs"
       
  1999 	  fi
       
  2000 	  continue
       
  2001 	  ;;
  1823 	-l*)
  2002 	-l*)
  1824 	  if test "$linkmode" != lib && test "$linkmode" != prog; then
  2003 	  if test "$linkmode" != lib && test "$linkmode" != prog; then
  1825 	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  2004 	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  1826 	    continue
  2005 	    continue
  1827 	  fi
  2006 	  fi
  1829 	    deplibs="$deplib $deplibs"
  2008 	    deplibs="$deplib $deplibs"
  1830 	    continue
  2009 	    continue
  1831 	  fi
  2010 	  fi
  1832 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  2011 	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1833 	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2012 	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1834 	    # Search the libtool library
  2013 	    for search_ext in .la $std_shrext .so .a; do
  1835 	    lib="$searchdir/lib${name}.la"
  2014 	      # Search the libtool library
  1836 	    if test -f "$lib"; then
  2015 	      lib="$searchdir/lib${name}${search_ext}"
  1837 	      found=yes
  2016 	      if test -f "$lib"; then
  1838 	      break
  2017 		if test "$search_ext" = ".la"; then
  1839 	    fi
  2018 		  found=yes
       
  2019 		else
       
  2020 		  found=no
       
  2021 		fi
       
  2022 		break 2
       
  2023 	      fi
       
  2024 	    done
  1840 	  done
  2025 	  done
  1841 	  if test "$found" != yes; then
  2026 	  if test "$found" != yes; then
  1842 	    # deplib doesn't seem to be a libtool library
  2027 	    # deplib doesn't seem to be a libtool library
  1843 	    if test "$linkmode,$pass" = "prog,link"; then
  2028 	    if test "$linkmode,$pass" = "prog,link"; then
  1844 	      compile_deplibs="$deplib $compile_deplibs"
  2029 	      compile_deplibs="$deplib $compile_deplibs"
  1911 	      deplibs="$deplib $deplibs"
  2096 	      deplibs="$deplib $deplibs"
  1912 	      continue
  2097 	      continue
  1913 	    fi
  2098 	    fi
  1914 	    if test "$pass" = scan; then
  2099 	    if test "$pass" = scan; then
  1915 	      deplibs="$deplib $deplibs"
  2100 	      deplibs="$deplib $deplibs"
  1916 	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
       
  1917 	    else
  2101 	    else
  1918 	      compile_deplibs="$deplib $compile_deplibs"
  2102 	      compile_deplibs="$deplib $compile_deplibs"
  1919 	      finalize_deplibs="$deplib $finalize_deplibs"
  2103 	      finalize_deplibs="$deplib $finalize_deplibs"
  1920 	    fi
  2104 	    fi
       
  2105 	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1921 	    ;;
  2106 	    ;;
  1922 	  *)
  2107 	  *)
  1923 	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  2108 	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  1924 	    ;;
  2109 	    ;;
  1925 	  esac # linkmode
  2110 	  esac # linkmode
  1943 	    deplibs="$deplib $deplibs"
  2128 	    deplibs="$deplib $deplibs"
  1944 	    continue
  2129 	    continue
  1945 	  fi
  2130 	  fi
  1946 	  case $linkmode in
  2131 	  case $linkmode in
  1947 	  lib)
  2132 	  lib)
  1948 	    if test "$deplibs_check_method" != pass_all; then
  2133 	    valid_a_lib=no
       
  2134 	    case $deplibs_check_method in
       
  2135 	      match_pattern*)
       
  2136 		set dummy $deplibs_check_method
       
  2137 	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
       
  2138 		if eval $echo \"$deplib\" 2>/dev/null \
       
  2139 		    | $SED 10q \
       
  2140 		    | $EGREP "$match_pattern_regex" > /dev/null; then
       
  2141 		  valid_a_lib=yes
       
  2142 		fi
       
  2143 		;;
       
  2144 	      pass_all)
       
  2145 		valid_a_lib=yes
       
  2146 		;;
       
  2147             esac
       
  2148 	    if test "$valid_a_lib" != yes; then
  1949 	      $echo
  2149 	      $echo
  1950 	      $echo "*** Warning: Trying to link with static lib archive $deplib."
  2150 	      $echo "*** Warning: Trying to link with static lib archive $deplib."
  1951 	      $echo "*** I have the capability to make that library automatically link in when"
  2151 	      $echo "*** I have the capability to make that library automatically link in when"
  1952 	      $echo "*** you link to this library.  But I can only do this if you have a"
  2152 	      $echo "*** you link to this library.  But I can only do this if you have a"
  1953 	      $echo "*** shared version of the library, which you do not appear to have"
  2153 	      $echo "*** shared version of the library, which you do not appear to have"
  1994 	  ;;
  2194 	  ;;
  1995 	esac # case $deplib
  2195 	esac # case $deplib
  1996 	if test "$found" = yes || test -f "$lib"; then :
  2196 	if test "$found" = yes || test -f "$lib"; then :
  1997 	else
  2197 	else
  1998 	  $echo "$modename: cannot find the library \`$lib'" 1>&2
  2198 	  $echo "$modename: cannot find the library \`$lib'" 1>&2
  1999 	  exit 1
  2199 	  exit $EXIT_FAILURE
  2000 	fi
  2200 	fi
  2001 
  2201 
  2002 	# Check to see that this really is a libtool archive.
  2202 	# Check to see that this really is a libtool archive.
  2003 	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2203 	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2004 	else
  2204 	else
  2005 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2205 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2006 	  exit 1
  2206 	  exit $EXIT_FAILURE
  2007 	fi
  2207 	fi
  2008 
  2208 
  2009 	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2209 	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2010 	test "X$ladir" = "X$lib" && ladir="."
  2210 	test "X$ladir" = "X$lib" && ladir="."
  2011 
  2211 
  2044 	  # Only check for convenience libraries
  2244 	  # Only check for convenience libraries
  2045 	  deplibs="$lib $deplibs"
  2245 	  deplibs="$lib $deplibs"
  2046 	  if test -z "$libdir"; then
  2246 	  if test -z "$libdir"; then
  2047 	    if test -z "$old_library"; then
  2247 	    if test -z "$old_library"; then
  2048 	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2248 	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2049 	      exit 1
  2249 	      exit $EXIT_FAILURE
  2050 	    fi
  2250 	    fi
  2051 	    # It is a libtool convenience library, so add in its objects.
  2251 	    # It is a libtool convenience library, so add in its objects.
  2052 	    convenience="$convenience $ladir/$objdir/$old_library"
  2252 	    convenience="$convenience $ladir/$objdir/$old_library"
  2053 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
  2253 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
  2054 	    tmp_libs=
  2254 	    tmp_libs=
  2061               fi
  2261               fi
  2062 	      tmp_libs="$tmp_libs $deplib"
  2262 	      tmp_libs="$tmp_libs $deplib"
  2063 	    done
  2263 	    done
  2064 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2264 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2065 	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2265 	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2066 	    exit 1
  2266 	    exit $EXIT_FAILURE
  2067 	  fi
  2267 	  fi
  2068 	  continue
  2268 	  continue
  2069 	fi # $pass = conv
  2269 	fi # $pass = conv
  2070 
  2270 
  2071     
  2271 
  2072 	# Get the name of the library we link against.
  2272 	# Get the name of the library we link against.
  2073 	linklib=
  2273 	linklib=
  2074 	for l in $old_library $library_names; do
  2274 	for l in $old_library $library_names; do
  2075 	  linklib="$l"
  2275 	  linklib="$l"
  2076 	done
  2276 	done
  2077 	if test -z "$linklib"; then
  2277 	if test -z "$linklib"; then
  2078 	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2278 	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2079 	  exit 1
  2279 	  exit $EXIT_FAILURE
  2080 	fi
  2280 	fi
  2081 
  2281 
  2082 	# This library was specified with -dlopen.
  2282 	# This library was specified with -dlopen.
  2083 	if test "$pass" = dlopen; then
  2283 	if test "$pass" = dlopen; then
  2084 	  if test -z "$libdir"; then
  2284 	  if test -z "$libdir"; then
  2085 	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2285 	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2086 	    exit 1
  2286 	    exit $EXIT_FAILURE
  2087 	  fi
  2287 	  fi
  2088 	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  2288 	  if test -z "$dlname" ||
       
  2289 	     test "$dlopen_support" != yes ||
       
  2290 	     test "$build_libtool_libs" = no; then
  2089 	    # If there is no dlname, no dlopen support or we're linking
  2291 	    # If there is no dlname, no dlopen support or we're linking
  2090 	    # statically, we need to preload.  We also need to preload any
  2292 	    # statically, we need to preload.  We also need to preload any
  2091 	    # dependent libraries so libltdl's deplib preloader doesn't
  2293 	    # dependent libraries so libltdl's deplib preloader doesn't
  2092 	    # bomb out in the load deplibs phase.
  2294 	    # bomb out in the load deplibs phase.
  2093 	    dlprefiles="$dlprefiles $lib $dependency_libs"
  2295 	    dlprefiles="$dlprefiles $lib $dependency_libs"
  2121 	  else
  2323 	  else
  2122 	    dir="$libdir"
  2324 	    dir="$libdir"
  2123 	    absdir="$libdir"
  2325 	    absdir="$libdir"
  2124 	  fi
  2326 	  fi
  2125 	else
  2327 	else
  2126 	  dir="$ladir/$objdir"
  2328 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2127 	  absdir="$abs_ladir/$objdir"
  2329 	    dir="$ladir"
  2128 	  # Remove this search path later
  2330 	    absdir="$abs_ladir"
  2129 	  notinst_path="$notinst_path $abs_ladir"
  2331 	    # Remove this search path later
       
  2332 	    notinst_path="$notinst_path $abs_ladir"
       
  2333 	  else
       
  2334 	    dir="$ladir/$objdir"
       
  2335 	    absdir="$abs_ladir/$objdir"
       
  2336 	    # Remove this search path later
       
  2337 	    notinst_path="$notinst_path $abs_ladir"
       
  2338 	  fi
  2130 	fi # $installed = yes
  2339 	fi # $installed = yes
  2131 	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2340 	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2132 
  2341 
  2133 	# This library was specified with -dlpreopen.
  2342 	# This library was specified with -dlpreopen.
  2134 	if test "$pass" = dlpreopen; then
  2343 	if test "$pass" = dlpreopen; then
  2135 	  if test -z "$libdir"; then
  2344 	  if test -z "$libdir"; then
  2136 	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2345 	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2137 	    exit 1
  2346 	    exit $EXIT_FAILURE
  2138 	  fi
  2347 	  fi
  2139 	  # Prefer using a static library (so that no silly _DYNAMIC symbols
  2348 	  # Prefer using a static library (so that no silly _DYNAMIC symbols
  2140 	  # are required to link).
  2349 	  # are required to link).
  2141 	  if test -n "$old_library"; then
  2350 	  if test -n "$old_library"; then
  2142 	    newdlprefiles="$newdlprefiles $dir/$old_library"
  2351 	    newdlprefiles="$newdlprefiles $dir/$old_library"
  2159 	    deplibs="$lib $deplibs" # used for prog,scan pass
  2368 	    deplibs="$lib $deplibs" # used for prog,scan pass
  2160 	  fi
  2369 	  fi
  2161 	  continue
  2370 	  continue
  2162 	fi
  2371 	fi
  2163 
  2372 
  2164     
  2373 
  2165 	if test "$linkmode" = prog && test "$pass" != link; then
  2374 	if test "$linkmode" = prog && test "$pass" != link; then
  2166 	  newlib_search_path="$newlib_search_path $ladir"
  2375 	  newlib_search_path="$newlib_search_path $ladir"
  2167 	  deplibs="$lib $deplibs"
  2376 	  deplibs="$lib $deplibs"
  2168 
  2377 
  2169 	  linkalldeplibs=no
  2378 	  linkalldeplibs=no
  2246 	  if test "$installed" = no; then
  2455 	  if test "$installed" = no; then
  2247 	    notinst_deplibs="$notinst_deplibs $lib"
  2456 	    notinst_deplibs="$notinst_deplibs $lib"
  2248 	    need_relink=yes
  2457 	    need_relink=yes
  2249 	  fi
  2458 	  fi
  2250 	  # This is a shared library
  2459 	  # This is a shared library
  2251 	
  2460 
  2252       # Warn about portability, can't link against -module's on some systems (darwin)
  2461 	  # Warn about portability, can't link against -module's on
  2253       if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2462 	  # some systems (darwin)
       
  2463 	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2254 	    $echo
  2464 	    $echo
  2255 	    if test "$linkmode" = prog; then
  2465 	    if test "$linkmode" = prog; then
  2256 	      $echo "*** Warning: Linking the executable $output against the loadable module"
  2466 	      $echo "*** Warning: Linking the executable $output against the loadable module"
  2257 	    else
  2467 	    else
  2258 	      $echo "*** Warning: Linking the shared library $output against the loadable module"
  2468 	      $echo "*** Warning: Linking the shared library $output against the loadable module"
  2259 	    fi
  2469 	    fi
  2260 	    $echo "*** $linklib is not portable!"    
  2470 	    $echo "*** $linklib is not portable!"
  2261       fi	  
  2471 	  fi
  2262 	  if test "$linkmode" = lib &&
  2472 	  if test "$linkmode" = lib &&
  2263 	     test "$hardcode_into_libs" = yes; then
  2473 	     test "$hardcode_into_libs" = yes; then
  2264 	    # Hardcode the library path.
  2474 	    # Hardcode the library path.
  2265 	    # Skip directories that are in the system default run-time
  2475 	    # Skip directories that are in the system default run-time
  2266 	    # search path.
  2476 	    # search path.
  2314 	    # If the library has no export list, then create one now
  2524 	    # If the library has no export list, then create one now
  2315 	    if test -f "$output_objdir/$soname-def"; then :
  2525 	    if test -f "$output_objdir/$soname-def"; then :
  2316 	    else
  2526 	    else
  2317 	      $show "extracting exported symbol list from \`$soname'"
  2527 	      $show "extracting exported symbol list from \`$soname'"
  2318 	      save_ifs="$IFS"; IFS='~'
  2528 	      save_ifs="$IFS"; IFS='~'
  2319 	      eval cmds=\"$extract_expsyms_cmds\"
  2529 	      cmds=$extract_expsyms_cmds
  2320 	      for cmd in $cmds; do
  2530 	      for cmd in $cmds; do
  2321 		IFS="$save_ifs"
  2531 		IFS="$save_ifs"
       
  2532 		eval cmd=\"$cmd\"
  2322 		$show "$cmd"
  2533 		$show "$cmd"
  2323 		$run eval "$cmd" || exit $?
  2534 		$run eval "$cmd" || exit $?
  2324 	      done
  2535 	      done
  2325 	      IFS="$save_ifs"
  2536 	      IFS="$save_ifs"
  2326 	    fi
  2537 	    fi
  2327 
  2538 
  2328 	    # Create $newlib
  2539 	    # Create $newlib
  2329 	    if test -f "$output_objdir/$newlib"; then :; else
  2540 	    if test -f "$output_objdir/$newlib"; then :; else
  2330 	      $show "generating import library for \`$soname'"
  2541 	      $show "generating import library for \`$soname'"
  2331 	      save_ifs="$IFS"; IFS='~'
  2542 	      save_ifs="$IFS"; IFS='~'
  2332 	      eval cmds=\"$old_archive_from_expsyms_cmds\"
  2543 	      cmds=$old_archive_from_expsyms_cmds
  2333 	      for cmd in $cmds; do
  2544 	      for cmd in $cmds; do
  2334 		IFS="$save_ifs"
  2545 		IFS="$save_ifs"
       
  2546 		eval cmd=\"$cmd\"
  2335 		$show "$cmd"
  2547 		$show "$cmd"
  2336 		$run eval "$cmd" || exit $?
  2548 		$run eval "$cmd" || exit $?
  2337 	      done
  2549 	      done
  2338 	      IFS="$save_ifs"
  2550 	      IFS="$save_ifs"
  2339 	    fi
  2551 	    fi
  2352 	      if test "$hardcode_direct" = no; then
  2564 	      if test "$hardcode_direct" = no; then
  2353 		add="$dir/$linklib"
  2565 		add="$dir/$linklib"
  2354 		case $host in
  2566 		case $host in
  2355 		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
  2567 		  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
  2356 		  *-*-darwin* )
  2568 		  *-*-darwin* )
  2357 		    # if the lib is a module then we can not link against it, someone
  2569 		    # if the lib is a module then we can not link against
  2358 		    # is ignoring the new warnings I added
  2570 		    # it, someone is ignoring the new warnings I added
  2359 		    if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
  2571 		    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
  2360 		      $echo "** Warning, lib $linklib is a module, not a shared library"
  2572 		      $echo "** Warning, lib $linklib is a module, not a shared library"
  2361 		      if test -z "$old_library" ; then
  2573 		      if test -z "$old_library" ; then
  2362 		        $echo
  2574 		        $echo
  2363 		        $echo "** And there doesn't seem to be a static archive available"
  2575 		        $echo "** And there doesn't seem to be a static archive available"
  2364 		        $echo "** The link will probably fail, sorry"
  2576 		        $echo "** The link will probably fail, sorry"
  2365 		      else
  2577 		      else
  2366 		        add="$dir/$old_library"
  2578 		        add="$dir/$old_library"
  2367 		      fi 
  2579 		      fi
  2368 		    fi
  2580 		    fi
  2369 		esac
  2581 		esac
  2370 	      elif test "$hardcode_minus_L" = no; then
  2582 	      elif test "$hardcode_minus_L" = no; then
  2371 		case $host in
  2583 		case $host in
  2372 		*-*-sunos*) add_shlibpath="$dir" ;;
  2584 		*-*-sunos*) add_shlibpath="$dir" ;;
  2387 		add_dir="-L$dir"
  2599 		add_dir="-L$dir"
  2388 		# Try looking first in the location we're being installed to.
  2600 		# Try looking first in the location we're being installed to.
  2389 		if test -n "$inst_prefix_dir"; then
  2601 		if test -n "$inst_prefix_dir"; then
  2390 		  case "$libdir" in
  2602 		  case "$libdir" in
  2391 		    [\\/]*)
  2603 		    [\\/]*)
  2392 		      add_dir="-L$inst_prefix_dir$libdir $add_dir"
  2604 		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2393 		      ;;
  2605 		      ;;
  2394 		  esac
  2606 		  esac
  2395 		fi
  2607 		fi
  2396 		add="-l$name"
  2608 		add="-l$name"
  2397 	      elif test "$hardcode_shlibpath_var" = yes; then
  2609 	      elif test "$hardcode_shlibpath_var" = yes; then
  2404 	    *) lib_linked=no ;;
  2616 	    *) lib_linked=no ;;
  2405 	    esac
  2617 	    esac
  2406 
  2618 
  2407 	    if test "$lib_linked" != yes; then
  2619 	    if test "$lib_linked" != yes; then
  2408 	      $echo "$modename: configuration error: unsupported hardcode properties"
  2620 	      $echo "$modename: configuration error: unsupported hardcode properties"
  2409 	      exit 1
  2621 	      exit $EXIT_FAILURE
  2410 	    fi
  2622 	    fi
  2411 
  2623 
  2412 	    if test -n "$add_shlibpath"; then
  2624 	    if test -n "$add_shlibpath"; then
  2413 	      case :$compile_shlibpath: in
  2625 	      case :$compile_shlibpath: in
  2414 	      *":$add_shlibpath:"*) ;;
  2626 	      *":$add_shlibpath:"*) ;;
  2447 	      *":$libdir:"*) ;;
  2659 	      *":$libdir:"*) ;;
  2448 	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2660 	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2449 	      esac
  2661 	      esac
  2450 	      add="-l$name"
  2662 	      add="-l$name"
  2451 	    elif test "$hardcode_automatic" = yes; then
  2663 	    elif test "$hardcode_automatic" = yes; then
  2452 	      if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2664 	      if test -n "$inst_prefix_dir" &&
       
  2665 		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2453 	        add="$inst_prefix_dir$libdir/$linklib"
  2666 	        add="$inst_prefix_dir$libdir/$linklib"
  2454 	      else
  2667 	      else
  2455 	        add="$libdir/$linklib"
  2668 	        add="$libdir/$linklib"
  2456 	      fi
  2669 	      fi
  2457 	    else
  2670 	    else
  2459 	      add_dir="-L$libdir"
  2672 	      add_dir="-L$libdir"
  2460 	      # Try looking first in the location we're being installed to.
  2673 	      # Try looking first in the location we're being installed to.
  2461 	      if test -n "$inst_prefix_dir"; then
  2674 	      if test -n "$inst_prefix_dir"; then
  2462 		case "$libdir" in
  2675 		case "$libdir" in
  2463 		  [\\/]*)
  2676 		  [\\/]*)
  2464 		    add_dir="-L$inst_prefix_dir$libdir $add_dir"
  2677 		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2465 		    ;;
  2678 		    ;;
  2466 		esac
  2679 		esac
  2467 	      fi
  2680 	      fi
  2468 	      add="-l$name"
  2681 	      add="-l$name"
  2469 	    fi
  2682 	    fi
  2527 	  fi
  2740 	  fi
  2528 	fi # link shared/static library?
  2741 	fi # link shared/static library?
  2529 
  2742 
  2530 	if test "$linkmode" = lib; then
  2743 	if test "$linkmode" = lib; then
  2531 	  if test -n "$dependency_libs" &&
  2744 	  if test -n "$dependency_libs" &&
  2532 	     { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
  2745 	     { test "$hardcode_into_libs" != yes ||
       
  2746 	       test "$build_old_libs" = yes ||
  2533 	       test "$link_static" = yes; }; then
  2747 	       test "$link_static" = yes; }; then
  2534 	    # Extract -R from dependency_libs
  2748 	    # Extract -R from dependency_libs
  2535 	    temp_deplibs=
  2749 	    temp_deplibs=
  2536 	    for libdir in $dependency_libs; do
  2750 	    for libdir in $dependency_libs; do
  2537 	      case $libdir in
  2751 	      case $libdir in
  2584 		  path="$absdir/$objdir"
  2798 		  path="$absdir/$objdir"
  2585 		else
  2799 		else
  2586 		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2800 		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2587 		  if test -z "$libdir"; then
  2801 		  if test -z "$libdir"; then
  2588 		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2802 		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2589 		    exit 1
  2803 		    exit $EXIT_FAILURE
  2590 		  fi
  2804 		  fi
  2591 		  if test "$absdir" != "$libdir"; then
  2805 		  if test "$absdir" != "$libdir"; then
  2592 		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2806 		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2593 		  fi
  2807 		  fi
  2594 		  path="$absdir"
  2808 		  path="$absdir"
  2595 		fi
  2809 		fi
  2596 		depdepl=
  2810 		depdepl=
  2597 		case $host in
  2811 		case $host in
  2598 		*-*-darwin*)
  2812 		*-*-darwin*)
  2599 		  # we do not want to link against static libs, but need to link against shared
  2813 		  # we do not want to link against static libs,
       
  2814 		  # but need to link against shared
  2600 		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2815 		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2601 		  if test -n "$deplibrary_names" ; then
  2816 		  if test -n "$deplibrary_names" ; then
  2602 		    for tmp in $deplibrary_names ; do
  2817 		    for tmp in $deplibrary_names ; do
  2603 		      depdepl=$tmp
  2818 		      depdepl=$tmp
  2604 		    done
  2819 		    done
  2605 		    if test -f "$path/$depdepl" ; then
  2820 		    if test -f "$path/$depdepl" ; then
  2606 		      depdepl="$path/$depdepl"
  2821 		      depdepl="$path/$depdepl"
  2607 		   fi
  2822 		    fi
  2608 		    # do not add paths which are already there
  2823 		    # do not add paths which are already there
  2609 		    case " $newlib_search_path " in
  2824 		    case " $newlib_search_path " in
  2610 		    *" $path "*) ;;
  2825 		    *" $path "*) ;;
  2611 		    *) newlib_search_path="$newlib_search_path $path";;
  2826 		    *) newlib_search_path="$newlib_search_path $path";;
  2612 		    esac
  2827 		    esac
  2613 		  fi
  2828 		  fi
  2614 		  path=""
  2829 		  path=""
  2615 		  ;;
  2830 		  ;;
  2616 		*)
  2831 		*)
  2617 		path="-L$path"
  2832 		  path="-L$path"
       
  2833 		  ;;
       
  2834 		esac
  2618 		;;
  2835 		;;
  2619 		esac
  2836 	      -l*)
  2620 		
       
  2621 		;;
       
  2622 		  -l*)
       
  2623 		case $host in
  2837 		case $host in
  2624 		*-*-darwin*)
  2838 		*-*-darwin*)
  2625 		 # Again, we only want to link against shared libraries
  2839 		  # Again, we only want to link against shared libraries
  2626 		 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2840 		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2627 		 for tmp in $newlib_search_path ; do
  2841 		  for tmp in $newlib_search_path ; do
  2628 		     if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2842 		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2629 		       eval depdepl="$tmp/lib$tmp_libs.dylib"
  2843 		      eval depdepl="$tmp/lib$tmp_libs.dylib"
  2630 		       break
  2844 		      break
  2631 		     fi  
  2845 		    fi
  2632          done
  2846 		  done
  2633          path=""
  2847 		  path=""
  2634 		  ;;
  2848 		  ;;
  2635 		*) continue ;;
       
  2636 		esac  		  
       
  2637 		;;
       
  2638 
       
  2639 	      *.framework)
  2849 	      *.framework)
  2640 		case $host in
  2850 		case $host in
  2641 		  *-*-darwin*)
  2851 		  *-*-darwin*)
  2642 		    depdepl="$deplib"
  2852 		    depdepl="$deplib"
  2643 		    ;;
  2853 		    ;;
  2644 		esac
  2854 		esac
  2645 		;;
  2855 		;;
  2646 
  2856 		*) continue ;;
       
  2857 		esac
       
  2858 		;;
  2647 	      *) continue ;;
  2859 	      *) continue ;;
  2648 	      esac
  2860 	      esac
  2649 	      case " $deplibs " in
  2861 	      case " $deplibs " in
  2650 	      *" $depdepl "*) ;;
  2862 	      *" $depdepl "*) ;;
  2651 	      *) deplibs="$deplibs $depdepl" ;;
  2863 	      *) deplibs="$depdepl $deplibs" ;;
  2652 	      esac	      
  2864 	      esac
  2653 	      case " $deplibs " in
  2865 	      case " $deplibs " in
  2654 	      *" $path "*) ;;
  2866 	      *" $path "*) ;;
  2655 	      *) deplibs="$deplibs $path" ;;
  2867 	      *) deplibs="$deplibs $path" ;;
  2656 	      esac
  2868 	      esac
  2657 	    done
  2869 	    done
  2737 	    esac
  2949 	    esac
  2738 	  done
  2950 	  done
  2739 	  eval $var=\"$tmp_libs\"
  2951 	  eval $var=\"$tmp_libs\"
  2740 	done # for var
  2952 	done # for var
  2741       fi
  2953       fi
  2742       # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
  2954       # Last step: remove runtime libs from dependency_libs
       
  2955       # (they stay in deplibs)
  2743       tmp_libs=
  2956       tmp_libs=
  2744       for i in $dependency_libs ; do
  2957       for i in $dependency_libs ; do
  2745 	case " $predeps $postdeps $compiler_lib_search_path " in
  2958 	case " $predeps $postdeps $compiler_lib_search_path " in
  2746 	*" $i "*)
  2959 	*" $i "*)
  2747 	  i=""
  2960 	  i=""
  2797     lib)
  3010     lib)
  2798       # Make sure we only generate libraries of the form `libNAME.la'.
  3011       # Make sure we only generate libraries of the form `libNAME.la'.
  2799       case $outputname in
  3012       case $outputname in
  2800       lib*)
  3013       lib*)
  2801 	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  3014 	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2802 	eval shared_ext=\"$shrext\"
  3015 	eval shared_ext=\"$shrext_cmds\"
  2803 	eval libname=\"$libname_spec\"
  3016 	eval libname=\"$libname_spec\"
  2804 	;;
  3017 	;;
  2805       *)
  3018       *)
  2806 	if test "$module" = no; then
  3019 	if test "$module" = no; then
  2807 	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  3020 	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2808 	  $echo "$help" 1>&2
  3021 	  $echo "$help" 1>&2
  2809 	  exit 1
  3022 	  exit $EXIT_FAILURE
  2810 	fi
  3023 	fi
  2811 	if test "$need_lib_prefix" != no; then
  3024 	if test "$need_lib_prefix" != no; then
  2812 	  # Add the "lib" prefix for modules if required
  3025 	  # Add the "lib" prefix for modules if required
  2813 	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  3026 	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2814 	  eval shared_ext=\"$shrext\"
  3027 	  eval shared_ext=\"$shrext_cmds\"
  2815 	  eval libname=\"$libname_spec\"
  3028 	  eval libname=\"$libname_spec\"
  2816 	else
  3029 	else
  2817 	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  3030 	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2818 	fi
  3031 	fi
  2819 	;;
  3032 	;;
  2820       esac
  3033       esac
  2821 
  3034 
  2822       if test -n "$objs"; then
  3035       if test -n "$objs"; then
  2823 	if test "$deplibs_check_method" != pass_all; then
  3036 	if test "$deplibs_check_method" != pass_all; then
  2824 	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  3037 	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2825 	  exit 1
  3038 	  exit $EXIT_FAILURE
  2826 	else
  3039 	else
  2827 	  $echo
  3040 	  $echo
  2828 	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
  3041 	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
  2829 	  $echo "*** objects $objs is not portable!"
  3042 	  $echo "*** objects $objs is not portable!"
  2830 	  libobjs="$libobjs $objs"
  3043 	  libobjs="$libobjs $objs"
  2868 	IFS="$save_ifs"
  3081 	IFS="$save_ifs"
  2869 
  3082 
  2870 	if test -n "$8"; then
  3083 	if test -n "$8"; then
  2871 	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
  3084 	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2872 	  $echo "$help" 1>&2
  3085 	  $echo "$help" 1>&2
  2873 	  exit 1
  3086 	  exit $EXIT_FAILURE
  2874 	fi
  3087 	fi
  2875 
  3088 
  2876 	# convert absolute version numbers to libtool ages
  3089 	# convert absolute version numbers to libtool ages
  2877 	# this retains compatibility with .la files and attempts
  3090 	# this retains compatibility with .la files and attempts
  2878 	# to make the code below a bit more comprehensible
  3091 	# to make the code below a bit more comprehensible
  2879 	
  3092 
  2880 	case $vinfo_number in
  3093 	case $vinfo_number in
  2881 	yes)
  3094 	yes)
  2882 	  number_major="$2"
  3095 	  number_major="$2"
  2883 	  number_minor="$3"
  3096 	  number_minor="$3"
  2884 	  number_revision="$4"
  3097 	  number_revision="$4"
  2918 	case $current in
  3131 	case $current in
  2919 	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  3132 	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  2920 	*)
  3133 	*)
  2921 	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  3134 	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  2922 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3135 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2923 	  exit 1
  3136 	  exit $EXIT_FAILURE
  2924 	  ;;
  3137 	  ;;
  2925 	esac
  3138 	esac
  2926 
  3139 
  2927 	case $revision in
  3140 	case $revision in
  2928 	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  3141 	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  2929 	*)
  3142 	*)
  2930 	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  3143 	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  2931 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3144 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2932 	  exit 1
  3145 	  exit $EXIT_FAILURE
  2933 	  ;;
  3146 	  ;;
  2934 	esac
  3147 	esac
  2935 
  3148 
  2936 	case $age in
  3149 	case $age in
  2937 	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  3150 	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
  2938 	*)
  3151 	*)
  2939 	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  3152 	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  2940 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3153 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2941 	  exit 1
  3154 	  exit $EXIT_FAILURE
  2942 	  ;;
  3155 	  ;;
  2943 	esac
  3156 	esac
  2944 
  3157 
  2945 	if test "$age" -gt "$current"; then
  3158 	if test "$age" -gt "$current"; then
  2946 	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  3159 	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2947 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3160 	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2948 	  exit 1
  3161 	  exit $EXIT_FAILURE
  2949 	fi
  3162 	fi
  2950 
  3163 
  2951 	# Calculate the version variables.
  3164 	# Calculate the version variables.
  2952 	major=
  3165 	major=
  2953 	versuffix=
  3166 	versuffix=
  2960 	  # verstring for coding it into the library header
  3173 	  # verstring for coding it into the library header
  2961 	  major=.`expr $current - $age`
  3174 	  major=.`expr $current - $age`
  2962 	  versuffix="$major.$age.$revision"
  3175 	  versuffix="$major.$age.$revision"
  2963 	  # Darwin ld doesn't like 0 for these options...
  3176 	  # Darwin ld doesn't like 0 for these options...
  2964 	  minor_current=`expr $current + 1`
  3177 	  minor_current=`expr $current + 1`
  2965 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  3178 	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  2966 	  ;;
  3179 	  ;;
  2967 
  3180 
  2968 	freebsd-aout)
  3181 	freebsd-aout)
  2969 	  major=".$current"
  3182 	  major=".$current"
  2970 	  versuffix=".$current.$revision";
  3183 	  versuffix=".$current.$revision";
  2972 
  3185 
  2973 	freebsd-elf)
  3186 	freebsd-elf)
  2974 	  major=".$current"
  3187 	  major=".$current"
  2975 	  versuffix=".$current";
  3188 	  versuffix=".$current";
  2976 	  ;;
  3189 	  ;;
  2977 
       
  2978         qnx)
       
  2979           major=".$current"
       
  2980           versuffix=".$current"
       
  2981           deplibs_check_method="pass_all"
       
  2982           ;;
       
  2983 
  3190 
  2984 	irix | nonstopux)
  3191 	irix | nonstopux)
  2985 	  major=`expr $current - $age + 1`
  3192 	  major=`expr $current - $age + 1`
  2986 
  3193 
  2987 	  case $version_type in
  3194 	  case $version_type in
  3038 	  ;;
  3245 	  ;;
  3039 
  3246 
  3040 	*)
  3247 	*)
  3041 	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
  3248 	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
  3042 	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  3249 	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  3043 	  exit 1
  3250 	  exit $EXIT_FAILURE
  3044 	  ;;
  3251 	  ;;
  3045 	esac
  3252 	esac
  3046 
  3253 
  3047 	# Clear the version info if we defaulted, and they specified a release.
  3254 	# Clear the version info if we defaulted, and they specified a release.
  3048 	if test -z "$vinfo" && test -n "$release"; then
  3255 	if test -z "$vinfo" && test -n "$release"; then
  3092 	for p in $tempremovelist; do
  3299 	for p in $tempremovelist; do
  3093 	  case $p in
  3300 	  case $p in
  3094 	    *.$objext)
  3301 	    *.$objext)
  3095 	       ;;
  3302 	       ;;
  3096 	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  3303 	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
       
  3304 	       if test "X$precious_files_regex" != "X"; then
       
  3305 	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
       
  3306 	         then
       
  3307 		   continue
       
  3308 		 fi
       
  3309 	       fi
  3097 	       removelist="$removelist $p"
  3310 	       removelist="$removelist $p"
  3098 	       ;;
  3311 	       ;;
  3099 	    *) ;;
  3312 	    *) ;;
  3100 	  esac
  3313 	  esac
  3101 	done
  3314 	done
  3578 	if test -n "$shlibpath"; then
  3791 	if test -n "$shlibpath"; then
  3579 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  3792 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  3580 	fi
  3793 	fi
  3581 
  3794 
  3582 	# Get the real and link names of the library.
  3795 	# Get the real and link names of the library.
  3583 	eval shared_ext=\"$shrext\"
  3796 	eval shared_ext=\"$shrext_cmds\"
  3584 	eval library_names=\"$library_names_spec\"
  3797 	eval library_names=\"$library_names_spec\"
  3585 	set dummy $library_names
  3798 	set dummy $library_names
  3586 	realname="$2"
  3799 	realname="$2"
  3587 	shift; shift
  3800 	shift; shift
  3588 
  3801 
  3608 	if test -z "$export_symbols"; then
  3821 	if test -z "$export_symbols"; then
  3609 	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  3822 	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  3610 	    $show "generating symbol list for \`$libname.la'"
  3823 	    $show "generating symbol list for \`$libname.la'"
  3611 	    export_symbols="$output_objdir/$libname.exp"
  3824 	    export_symbols="$output_objdir/$libname.exp"
  3612 	    $run $rm $export_symbols
  3825 	    $run $rm $export_symbols
  3613 	    eval cmds=\"$export_symbols_cmds\"
  3826 	    cmds=$export_symbols_cmds
  3614 	    save_ifs="$IFS"; IFS='~'
  3827 	    save_ifs="$IFS"; IFS='~'
  3615 	    for cmd in $cmds; do
  3828 	    for cmd in $cmds; do
  3616 	      IFS="$save_ifs"
  3829 	      IFS="$save_ifs"
       
  3830 	      eval cmd=\"$cmd\"
  3617 	      if len=`expr "X$cmd" : ".*"` &&
  3831 	      if len=`expr "X$cmd" : ".*"` &&
  3618 	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3832 	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3619 	        $show "$cmd"
  3833 	        $show "$cmd"
  3620 	        $run eval "$cmd" || exit $?
  3834 	        $run eval "$cmd" || exit $?
  3621 	        skipped_export=false
  3835 	        skipped_export=false
  3641 
  3855 
  3642 	tmp_deplibs=
  3856 	tmp_deplibs=
  3643 	for test_deplib in $deplibs; do
  3857 	for test_deplib in $deplibs; do
  3644 		case " $convenience " in
  3858 		case " $convenience " in
  3645 		*" $test_deplib "*) ;;
  3859 		*" $test_deplib "*) ;;
  3646 		*) 
  3860 		*)
  3647 			tmp_deplibs="$tmp_deplibs $test_deplib"
  3861 			tmp_deplibs="$tmp_deplibs $test_deplib"
  3648 			;;
  3862 			;;
  3649 		esac
  3863 		esac
  3650 	done
  3864 	done
  3651 	deplibs="$tmp_deplibs" 
  3865 	deplibs="$tmp_deplibs"
  3652 
  3866 
  3653 	if test -n "$convenience"; then
  3867 	if test -n "$convenience"; then
  3654 	  if test -n "$whole_archive_flag_spec"; then
  3868 	  if test -n "$whole_archive_flag_spec"; then
  3655 	    save_libobjs=$libobjs
  3869 	    save_libobjs=$libobjs
  3656 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3870 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3657 	  else
  3871 	  else
  3658 	    gentop="$output_objdir/${outputname}x"
  3872 	    gentop="$output_objdir/${outputname}x"
  3659 	    $show "${rm}r $gentop"
       
  3660 	    $run ${rm}r "$gentop"
       
  3661 	    $show "$mkdir $gentop"
       
  3662 	    $run $mkdir "$gentop"
       
  3663 	    status=$?
       
  3664 	    if test "$status" -ne 0 && test ! -d "$gentop"; then
       
  3665 	      exit $status
       
  3666 	    fi
       
  3667 	    generated="$generated $gentop"
  3873 	    generated="$generated $gentop"
  3668 
  3874 
  3669 	    for xlib in $convenience; do
  3875 	    func_extract_archives $gentop $convenience
  3670 	      # Extract the objects.
  3876 	    libobjs="$libobjs $func_extract_archives_result"
  3671 	      case $xlib in
  3877 	  fi
  3672 	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
  3878 	fi
  3673 	      *) xabs=`pwd`"/$xlib" ;;
  3879 	
  3674 	      esac
       
  3675 	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
       
  3676 	      xdir="$gentop/$xlib"
       
  3677 
       
  3678 	      $show "${rm}r $xdir"
       
  3679 	      $run ${rm}r "$xdir"
       
  3680 	      $show "$mkdir $xdir"
       
  3681 	      $run $mkdir "$xdir"
       
  3682 	      status=$?
       
  3683 	      if test "$status" -ne 0 && test ! -d "$xdir"; then
       
  3684 		exit $status
       
  3685 	      fi
       
  3686 	      # We will extract separately just the conflicting names and we will no
       
  3687 	      # longer touch any unique names. It is faster to leave these extract
       
  3688 	      # automatically by $AR in one run.
       
  3689 	      $show "(cd $xdir && $AR x $xabs)"
       
  3690 	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
       
  3691 	      if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
       
  3692 		:
       
  3693 	      else
       
  3694 		$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
       
  3695 		$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
       
  3696 		$AR t "$xabs" | sort | uniq -cd | while read -r count name
       
  3697 		do
       
  3698 		  i=1
       
  3699 		  while test "$i" -le "$count"
       
  3700 		  do
       
  3701 		   # Put our $i before any first dot (extension)
       
  3702 		   # Never overwrite any file
       
  3703 		   name_to="$name"
       
  3704 		   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
       
  3705 		   do
       
  3706 		     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
       
  3707 		   done
       
  3708 		   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
       
  3709 		   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
       
  3710 		   i=`expr $i + 1`
       
  3711 		  done
       
  3712 		done
       
  3713 	      fi
       
  3714 
       
  3715 	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
       
  3716 	    done
       
  3717 	  fi
       
  3718 	fi
       
  3719 
       
  3720 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  3880 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  3721 	  eval flag=\"$thread_safe_flag_spec\"
  3881 	  eval flag=\"$thread_safe_flag_spec\"
  3722 	  linker_flags="$linker_flags $flag"
  3882 	  linker_flags="$linker_flags $flag"
  3723 	fi
  3883 	fi
  3724 
  3884 
  3728 	fi
  3888 	fi
  3729 
  3889 
  3730 	# Do each of the archive commands.
  3890 	# Do each of the archive commands.
  3731 	if test "$module" = yes && test -n "$module_cmds" ; then
  3891 	if test "$module" = yes && test -n "$module_cmds" ; then
  3732 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3892 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3733 	    eval cmds=\"$module_expsym_cmds\"
  3893 	    eval test_cmds=\"$module_expsym_cmds\"
       
  3894 	    cmds=$module_expsym_cmds
  3734 	  else
  3895 	  else
  3735 	    eval cmds=\"$module_cmds\"
  3896 	    eval test_cmds=\"$module_cmds\"
       
  3897 	    cmds=$module_cmds
  3736 	  fi
  3898 	  fi
  3737 	else
  3899 	else
  3738 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3900 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3739 	  eval cmds=\"$archive_expsym_cmds\"
  3901 	  eval test_cmds=\"$archive_expsym_cmds\"
       
  3902 	  cmds=$archive_expsym_cmds
  3740 	else
  3903 	else
  3741 	  eval cmds=\"$archive_cmds\"
  3904 	  eval test_cmds=\"$archive_cmds\"
  3742 	  fi
  3905 	  cmds=$archive_cmds
  3743 	fi
  3906 	  fi
  3744 
  3907 	fi
  3745 	if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
  3908 
       
  3909 	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
  3746 	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3910 	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3747 	  :
  3911 	  :
  3748 	else
  3912 	else
  3749 	  # The command line is too long to link in one step, link piecewise.
  3913 	  # The command line is too long to link in one step, link piecewise.
  3750 	  $echo "creating reloadable object files..."
  3914 	  $echo "creating reloadable object files..."
  3841 	  fi
  4005 	  fi
  3842 	  # Expand the library linking commands again to reset the
  4006 	  # Expand the library linking commands again to reset the
  3843 	  # value of $libobjs for piecewise linking.
  4007 	  # value of $libobjs for piecewise linking.
  3844 
  4008 
  3845 	  # Do each of the archive commands.
  4009 	  # Do each of the archive commands.
       
  4010 	  if test "$module" = yes && test -n "$module_cmds" ; then
       
  4011 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
       
  4012 	      cmds=$module_expsym_cmds
       
  4013 	    else
       
  4014 	      cmds=$module_cmds
       
  4015 	    fi
       
  4016 	  else
  3846 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  4017 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3847 	    eval cmds=\"$archive_expsym_cmds\"
  4018 	    cmds=$archive_expsym_cmds
  3848 	  else
  4019 	  else
  3849 	    eval cmds=\"$archive_cmds\"
  4020 	    cmds=$archive_cmds
       
  4021 	    fi
  3850 	  fi
  4022 	  fi
  3851 
  4023 
  3852 	  # Append the command to remove the reloadable object files
  4024 	  # Append the command to remove the reloadable object files
  3853 	  # to the just-reset $cmds.
  4025 	  # to the just-reset $cmds.
  3854 	  eval cmds=\"\$cmds~$rm $delfiles\"
  4026 	  eval cmds=\"\$cmds~\$rm $delfiles\"
  3855 	fi
  4027 	fi
  3856 	save_ifs="$IFS"; IFS='~'
  4028 	save_ifs="$IFS"; IFS='~'
  3857 	for cmd in $cmds; do
  4029 	for cmd in $cmds; do
  3858 	  IFS="$save_ifs"
  4030 	  IFS="$save_ifs"
       
  4031 	  eval cmd=\"$cmd\"
  3859 	  $show "$cmd"
  4032 	  $show "$cmd"
  3860 	  $run eval "$cmd" || exit $?
  4033 	  $run eval "$cmd" || exit $?
  3861 	done
  4034 	done
  3862 	IFS="$save_ifs"
  4035 	IFS="$save_ifs"
  3863 
  4036 
  3864 	# Restore the uninstalled library and exit
  4037 	# Restore the uninstalled library and exit
  3865 	if test "$mode" = relink; then
  4038 	if test "$mode" = relink; then
  3866 	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  4039 	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  3867 	  exit 0
  4040 	  exit $EXIT_SUCCESS
  3868 	fi
  4041 	fi
  3869 
  4042 
  3870 	# Create links to the real library.
  4043 	# Create links to the real library.
  3871 	for linkname in $linknames; do
  4044 	for linkname in $linknames; do
  3872 	  if test "$realname" != "$linkname"; then
  4045 	  if test "$realname" != "$linkname"; then
  3910 
  4083 
  3911       case $output in
  4084       case $output in
  3912       *.lo)
  4085       *.lo)
  3913 	if test -n "$objs$old_deplibs"; then
  4086 	if test -n "$objs$old_deplibs"; then
  3914 	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  4087 	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  3915 	  exit 1
  4088 	  exit $EXIT_FAILURE
  3916 	fi
  4089 	fi
  3917 	libobj="$output"
  4090 	libobj="$output"
  3918 	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  4091 	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  3919 	;;
  4092 	;;
  3920       *)
  4093       *)
  3939       if test -n "$convenience"; then
  4112       if test -n "$convenience"; then
  3940 	if test -n "$whole_archive_flag_spec"; then
  4113 	if test -n "$whole_archive_flag_spec"; then
  3941 	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  4114 	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  3942 	else
  4115 	else
  3943 	  gentop="$output_objdir/${obj}x"
  4116 	  gentop="$output_objdir/${obj}x"
  3944 	  $show "${rm}r $gentop"
       
  3945 	  $run ${rm}r "$gentop"
       
  3946 	  $show "$mkdir $gentop"
       
  3947 	  $run $mkdir "$gentop"
       
  3948 	  status=$?
       
  3949 	  if test "$status" -ne 0 && test ! -d "$gentop"; then
       
  3950 	    exit $status
       
  3951 	  fi
       
  3952 	  generated="$generated $gentop"
  4117 	  generated="$generated $gentop"
  3953 
  4118 
  3954 	  for xlib in $convenience; do
  4119 	  func_extract_archives $gentop $convenience
  3955 	    # Extract the objects.
  4120 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
  3956 	    case $xlib in
       
  3957 	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
       
  3958 	    *) xabs=`pwd`"/$xlib" ;;
       
  3959 	    esac
       
  3960 	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
       
  3961 	    xdir="$gentop/$xlib"
       
  3962 
       
  3963 	    $show "${rm}r $xdir"
       
  3964 	    $run ${rm}r "$xdir"
       
  3965 	    $show "$mkdir $xdir"
       
  3966 	    $run $mkdir "$xdir"
       
  3967 	    status=$?
       
  3968 	    if test "$status" -ne 0 && test ! -d "$xdir"; then
       
  3969 	      exit $status
       
  3970 	    fi
       
  3971 	    # We will extract separately just the conflicting names and we will no
       
  3972 	    # longer touch any unique names. It is faster to leave these extract
       
  3973 	    # automatically by $AR in one run.
       
  3974 	    $show "(cd $xdir && $AR x $xabs)"
       
  3975 	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
       
  3976 	    if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
       
  3977 	      :
       
  3978 	    else
       
  3979 	      $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
       
  3980 	      $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
       
  3981 	      $AR t "$xabs" | sort | uniq -cd | while read -r count name
       
  3982 	      do
       
  3983 		i=1
       
  3984 		while test "$i" -le "$count"
       
  3985 		do
       
  3986 		 # Put our $i before any first dot (extension)
       
  3987 		 # Never overwrite any file
       
  3988 		 name_to="$name"
       
  3989 		 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
       
  3990 		 do
       
  3991 		   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
       
  3992 		 done
       
  3993 		 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
       
  3994 		 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
       
  3995 		 i=`expr $i + 1`
       
  3996 		done
       
  3997 	      done
       
  3998 	    fi
       
  3999 
       
  4000 	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
       
  4001 	  done
       
  4002 	fi
  4121 	fi
  4003       fi
  4122       fi
  4004 
  4123 
  4005       # Create the old-style object.
  4124       # Create the old-style object.
  4006       reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  4125       reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  4007 
  4126 
  4008       output="$obj"
  4127       output="$obj"
  4009       eval cmds=\"$reload_cmds\"
  4128       cmds=$reload_cmds
  4010       save_ifs="$IFS"; IFS='~'
  4129       save_ifs="$IFS"; IFS='~'
  4011       for cmd in $cmds; do
  4130       for cmd in $cmds; do
  4012 	IFS="$save_ifs"
  4131 	IFS="$save_ifs"
       
  4132 	eval cmd=\"$cmd\"
  4013 	$show "$cmd"
  4133 	$show "$cmd"
  4014 	$run eval "$cmd" || exit $?
  4134 	$run eval "$cmd" || exit $?
  4015       done
  4135       done
  4016       IFS="$save_ifs"
  4136       IFS="$save_ifs"
  4017 
  4137 
  4020 	if test -n "$gentop"; then
  4140 	if test -n "$gentop"; then
  4021 	  $show "${rm}r $gentop"
  4141 	  $show "${rm}r $gentop"
  4022 	  $run ${rm}r $gentop
  4142 	  $run ${rm}r $gentop
  4023 	fi
  4143 	fi
  4024 
  4144 
  4025 	exit 0
  4145 	exit $EXIT_SUCCESS
  4026       fi
  4146       fi
  4027 
  4147 
  4028       if test "$build_libtool_libs" != yes; then
  4148       if test "$build_libtool_libs" != yes; then
  4029 	if test -n "$gentop"; then
  4149 	if test -n "$gentop"; then
  4030 	  $show "${rm}r $gentop"
  4150 	  $show "${rm}r $gentop"
  4033 
  4153 
  4034 	# Create an invalid libtool object if no PIC, so that we don't
  4154 	# Create an invalid libtool object if no PIC, so that we don't
  4035 	# accidentally link it into a program.
  4155 	# accidentally link it into a program.
  4036 	# $show "echo timestamp > $libobj"
  4156 	# $show "echo timestamp > $libobj"
  4037 	# $run eval "echo timestamp > $libobj" || exit $?
  4157 	# $run eval "echo timestamp > $libobj" || exit $?
  4038 	exit 0
  4158 	exit $EXIT_SUCCESS
  4039       fi
  4159       fi
  4040 
  4160 
  4041       if test -n "$pic_flag" || test "$pic_mode" != default; then
  4161       if test -n "$pic_flag" || test "$pic_mode" != default; then
  4042 	# Only do commands if we really have different PIC objects.
  4162 	# Only do commands if we really have different PIC objects.
  4043 	reload_objs="$libobjs $reload_conv_objs"
  4163 	reload_objs="$libobjs $reload_conv_objs"
  4044 	output="$libobj"
  4164 	output="$libobj"
  4045 	eval cmds=\"$reload_cmds\"
  4165 	cmds=$reload_cmds
  4046 	save_ifs="$IFS"; IFS='~'
  4166 	save_ifs="$IFS"; IFS='~'
  4047 	for cmd in $cmds; do
  4167 	for cmd in $cmds; do
  4048 	  IFS="$save_ifs"
  4168 	  IFS="$save_ifs"
       
  4169 	  eval cmd=\"$cmd\"
  4049 	  $show "$cmd"
  4170 	  $show "$cmd"
  4050 	  $run eval "$cmd" || exit $?
  4171 	  $run eval "$cmd" || exit $?
  4051 	done
  4172 	done
  4052 	IFS="$save_ifs"
  4173 	IFS="$save_ifs"
  4053       fi
  4174       fi
  4055       if test -n "$gentop"; then
  4176       if test -n "$gentop"; then
  4056 	$show "${rm}r $gentop"
  4177 	$show "${rm}r $gentop"
  4057 	$run ${rm}r $gentop
  4178 	$run ${rm}r $gentop
  4058       fi
  4179       fi
  4059 
  4180 
  4060       exit 0
  4181       exit $EXIT_SUCCESS
  4061       ;;
  4182       ;;
  4062 
  4183 
  4063     prog)
  4184     prog)
  4064       case $host in
  4185       case $host in
  4065 	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  4186 	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  4376 	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4497 	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4377 	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4498 	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4378 	  ;;
  4499 	  ;;
  4379 	*)
  4500 	*)
  4380 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  4501 	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  4381 	  exit 1
  4502 	  exit $EXIT_FAILURE
  4382 	  ;;
  4503 	  ;;
  4383 	esac
  4504 	esac
  4384       else
  4505       else
  4385 	# We keep going just in case the user didn't refer to
  4506 	# We keep going just in case the user didn't refer to
  4386 	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  4507 	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  4464 	# Delete the old output file.
  4585 	# Delete the old output file.
  4465 	$run $rm $output
  4586 	$run $rm $output
  4466 	# Link the executable and exit
  4587 	# Link the executable and exit
  4467 	$show "$link_command"
  4588 	$show "$link_command"
  4468 	$run eval "$link_command" || exit $?
  4589 	$run eval "$link_command" || exit $?
  4469 	exit 0
  4590 	exit $EXIT_SUCCESS
  4470       fi
  4591       fi
  4471 
  4592 
  4472       if test "$hardcode_action" = relink; then
  4593       if test "$hardcode_action" = relink; then
  4473 	# Fast installation is not supported
  4594 	# Fast installation is not supported
  4474 	link_command="$compile_var$compile_command$compile_rpath"
  4595 	link_command="$compile_var$compile_command$compile_rpath"
  4519 	relink_command="(cd `pwd`; $relink_command)"
  4640 	relink_command="(cd `pwd`; $relink_command)"
  4520 	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4641 	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4521       fi
  4642       fi
  4522 
  4643 
  4523       # Quote $echo for shipping.
  4644       # Quote $echo for shipping.
  4524       if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  4645       if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  4525 	case $0 in
  4646 	case $progpath in
  4526 	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
  4647 	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  4527 	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  4648 	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  4528 	esac
  4649 	esac
  4529 	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  4650 	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  4530       else
  4651       else
  4531 	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  4652 	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  4532       fi
  4653       fi
  4548 	case $host in
  4669 	case $host in
  4549 	  *cygwin* | *mingw* )
  4670 	  *cygwin* | *mingw* )
  4550 	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
  4671 	    cwrappersource=`$echo ${objdir}/lt-${output}.c`
  4551 	    cwrapper=`$echo ${output}.exe`
  4672 	    cwrapper=`$echo ${output}.exe`
  4552 	    $rm $cwrappersource $cwrapper
  4673 	    $rm $cwrappersource $cwrapper
  4553 	    trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
  4674 	    trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  4554 
  4675 
  4555 	    cat > $cwrappersource <<EOF
  4676 	    cat > $cwrappersource <<EOF
  4556 
  4677 
  4557 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  4678 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  4558    Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4679    Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4559 
  4680 
  4560    The $output program cannot be directly executed until all the libtool
  4681    The $output program cannot be directly executed until all the libtool
  4561    libraries that it depends on are installed.
  4682    libraries that it depends on are installed.
  4562    
  4683 
  4563    This wrapper executable should never be moved out of the build directory.
  4684    This wrapper executable should never be moved out of the build directory.
  4564    If it is, it will not operate correctly.
  4685    If it is, it will not operate correctly.
  4565 
  4686 
  4566    Currently, it simply execs the wrapper *script* "/bin/sh $output",
  4687    Currently, it simply execs the wrapper *script* "/bin/sh $output",
  4567    but could eventually absorb all of the scripts functionality and
  4688    but could eventually absorb all of the scripts functionality and
  4573 #include <stdlib.h>
  4694 #include <stdlib.h>
  4574 #include <unistd.h>
  4695 #include <unistd.h>
  4575 #include <malloc.h>
  4696 #include <malloc.h>
  4576 #include <stdarg.h>
  4697 #include <stdarg.h>
  4577 #include <assert.h>
  4698 #include <assert.h>
  4578 #include <sys/stat.h>
       
  4579 
  4699 
  4580 #if defined(PATH_MAX)
  4700 #if defined(PATH_MAX)
  4581 # define LT_PATHMAX PATH_MAX
  4701 # define LT_PATHMAX PATH_MAX
  4582 #elif defined(MAXPATHLEN)
  4702 #elif defined(MAXPATHLEN)
  4583 # define LT_PATHMAX MAXPATHLEN
  4703 # define LT_PATHMAX MAXPATHLEN
  4584 #else
  4704 #else
  4585 # define LT_PATHMAX 1024
  4705 # define LT_PATHMAX 1024
  4586 #endif
  4706 #endif
  4587 
  4707 
  4588 #ifndef DIR_SEPARATOR
  4708 #ifndef DIR_SEPARATOR
  4589 # define DIR_SEPARATOR '/'
  4709 #define DIR_SEPARATOR '/'
  4590 # define PATH_SEPARATOR ':'
       
  4591 #endif
  4710 #endif
  4592 
  4711 
  4593 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  4712 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  4594   defined (__OS2__)
  4713   defined (__OS2__)
  4595 # define HAVE_DOS_BASED_FILE_SYSTEM
  4714 #define HAVE_DOS_BASED_FILE_SYSTEM
  4596 # ifndef DIR_SEPARATOR_2 
  4715 #ifndef DIR_SEPARATOR_2
  4597 #  define DIR_SEPARATOR_2 '\\'
  4716 #define DIR_SEPARATOR_2 '\\'
  4598 # endif
  4717 #endif
  4599 # ifndef PATH_SEPARATOR_2 
       
  4600 #  define PATH_SEPARATOR_2 ';'
       
  4601 # endif
       
  4602 #endif
  4718 #endif
  4603 
  4719 
  4604 #ifndef DIR_SEPARATOR_2
  4720 #ifndef DIR_SEPARATOR_2
  4605 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  4721 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  4606 #else /* DIR_SEPARATOR_2 */
  4722 #else /* DIR_SEPARATOR_2 */
  4607 # define IS_DIR_SEPARATOR(ch) \
  4723 # define IS_DIR_SEPARATOR(ch) \
  4608         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  4724         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  4609 #endif /* DIR_SEPARATOR_2 */
  4725 #endif /* DIR_SEPARATOR_2 */
  4610 
  4726 
  4611 #ifndef PATH_SEPARATOR_2
       
  4612 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
       
  4613 #else /* PATH_SEPARATOR_2 */
       
  4614 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
       
  4615 #endif /* PATH_SEPARATOR_2 */
       
  4616 
       
  4617 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
  4727 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
  4618 #define XFREE(stale) do { \
  4728 #define XFREE(stale) do { \
  4619   if (stale) { free ((void *) stale); stale = 0; } \
  4729   if (stale) { free ((void *) stale); stale = 0; } \
  4620 } while (0)
  4730 } while (0)
  4621 
  4731 
  4622 #if defined DEBUGWRAPPER
       
  4623 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
       
  4624 #else
       
  4625 # define DEBUG(format, ...) 
       
  4626 #endif
       
  4627 
       
  4628 const char *program_name = NULL;
  4732 const char *program_name = NULL;
  4629 
  4733 
  4630 void * xmalloc (size_t num);
  4734 void * xmalloc (size_t num);
  4631 char * xstrdup (const char *string);
  4735 char * xstrdup (const char *string);
  4632 char * basename (const char *name);
  4736 char * basename (const char *name);
  4633 char * find_executable(const char *wrapper);
  4737 char * fnqualify(const char *path);
  4634 int    check_executable(const char *path);
       
  4635 char * strendzap(char *str, const char *pat);
  4738 char * strendzap(char *str, const char *pat);
  4636 void lt_fatal (const char *message, ...);
  4739 void lt_fatal (const char *message, ...);
  4637 
  4740 
  4638 int
  4741 int
  4639 main (int argc, char *argv[])
  4742 main (int argc, char *argv[])
  4640 {
  4743 {
  4641   char **newargz;
  4744   char **newargz;
  4642   int i;
  4745   int i;
  4643   
  4746 
  4644   program_name = (char *) xstrdup ((char *) basename (argv[0]));
  4747   program_name = (char *) xstrdup ((char *) basename (argv[0]));
  4645   DEBUG("(main) argv[0]      : %s\n",argv[0]);
       
  4646   DEBUG("(main) program_name : %s\n",program_name);
       
  4647   newargz = XMALLOC(char *, argc+2);
  4748   newargz = XMALLOC(char *, argc+2);
  4648 EOF
  4749 EOF
  4649 
  4750 
  4650 	    cat >> $cwrappersource <<EOF
  4751 	    cat >> $cwrappersource <<EOF
  4651   newargz[0] = "$SHELL";
  4752   newargz[0] = "$SHELL";
  4652 EOF
  4753 EOF
  4653 
  4754 
  4654 	    cat >> $cwrappersource <<"EOF"
  4755 	    cat >> $cwrappersource <<"EOF"
  4655   newargz[1] = find_executable(argv[0]);
  4756   newargz[1] = fnqualify(argv[0]);
  4656   if (newargz[1] == NULL)
       
  4657     lt_fatal("Couldn't find %s", argv[0]);
       
  4658   DEBUG("(main) found exe at : %s\n",newargz[1]);
       
  4659   /* we know the script has the same name, without the .exe */
  4757   /* we know the script has the same name, without the .exe */
  4660   /* so make sure newargz[1] doesn't end in .exe */
  4758   /* so make sure newargz[1] doesn't end in .exe */
  4661   strendzap(newargz[1],".exe"); 
  4759   strendzap(newargz[1],".exe");
  4662   for (i = 1; i < argc; i++)
  4760   for (i = 1; i < argc; i++)
  4663     newargz[i+1] = xstrdup(argv[i]);
  4761     newargz[i+1] = xstrdup(argv[i]);
  4664   newargz[argc+1] = NULL;
  4762   newargz[argc+1] = NULL;
  4665 
       
  4666   for (i=0; i<argc+1; i++)
       
  4667   {
       
  4668     DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
       
  4669     ;
       
  4670   }
       
  4671 
       
  4672 EOF
  4763 EOF
  4673 
  4764 
  4674 	    cat >> $cwrappersource <<EOF
  4765 	    cat >> $cwrappersource <<EOF
  4675   execv("$SHELL",newargz);
  4766   execv("$SHELL",newargz);
  4676 EOF
  4767 EOF
  4686     lt_fatal ("Memory exhausted");
  4777     lt_fatal ("Memory exhausted");
  4687 
  4778 
  4688   return p;
  4779   return p;
  4689 }
  4780 }
  4690 
  4781 
  4691 char * 
  4782 char *
  4692 xstrdup (const char *string)
  4783 xstrdup (const char *string)
  4693 {
  4784 {
  4694   return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  4785   return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  4695 ;
  4786 ;
  4696 }
  4787 }
  4700 {
  4791 {
  4701   const char *base;
  4792   const char *base;
  4702 
  4793 
  4703 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4794 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4704   /* Skip over the disk name in MSDOS pathnames. */
  4795   /* Skip over the disk name in MSDOS pathnames. */
  4705   if (isalpha (name[0]) && name[1] == ':') 
  4796   if (isalpha (name[0]) && name[1] == ':')
  4706     name += 2;
  4797     name += 2;
  4707 #endif
  4798 #endif
  4708 
  4799 
  4709   for (base = name; *name; name++)
  4800   for (base = name; *name; name++)
  4710     if (IS_DIR_SEPARATOR (*name))
  4801     if (IS_DIR_SEPARATOR (*name))
  4711       base = name + 1;
  4802       base = name + 1;
  4712   return (char *) base;
  4803   return (char *) base;
  4713 }
  4804 }
  4714 
  4805 
  4715 int
  4806 char *
  4716 check_executable(const char * path)
  4807 fnqualify(const char *path)
  4717 {
  4808 {
  4718   struct stat st;
  4809   size_t size;
  4719 
  4810   char *p;
  4720   DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
  4811   char tmp[LT_PATHMAX + 1];
  4721   if ((!path) || (!*path))
  4812 
  4722     return 0;
  4813   assert(path != NULL);
  4723 
  4814 
  4724   if ((stat (path, &st) >= 0) &&
  4815   /* Is it qualified already? */
  4725       (
  4816 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4726 #ifdef S_IXOTH
  4817   if (isalpha (path[0]) && path[1] == ':')
  4727        ((st.st_mode & S_IXOTH) == S_IXOTH) ||
  4818     return xstrdup (path);
  4728 #endif
  4819 #endif
  4729 #ifdef S_IXGRP
  4820   if (IS_DIR_SEPARATOR (path[0]))
  4730        ((st.st_mode & S_IXGRP) == S_IXGRP) ||
  4821     return xstrdup (path);
  4731 #endif
  4822 
  4732        ((st.st_mode & S_IXUSR) == S_IXUSR)))
  4823   /* prepend the current directory */
  4733     return 1;
  4824   /* doesn't handle '~' */
  4734   else
       
  4735     return 0;
       
  4736 }
       
  4737 
       
  4738 /* Searches for the full path of the wrapper.  Returns
       
  4739    newly allocated full path name if found, NULL otherwise */
       
  4740 char *
       
  4741 find_executable (const char* wrapper)
       
  4742 {
       
  4743   int has_slash = 0;
       
  4744   const char* p;
       
  4745   const char* p_next;
       
  4746   struct stat st;
       
  4747   /* static buffer for getcwd */
       
  4748   char tmp[LT_PATHMAX + 1];
       
  4749   int tmp_len;
       
  4750   char* concat_name;
       
  4751 
       
  4752   DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
       
  4753   
       
  4754   if ((wrapper == NULL) || (*wrapper == '\0'))
       
  4755     return NULL;
       
  4756 
       
  4757   /* Absolute path? */
       
  4758 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
       
  4759   if (isalpha (wrapper[0]) && wrapper[1] == ':')
       
  4760   {
       
  4761     concat_name = xstrdup (wrapper);
       
  4762     if (check_executable(concat_name))
       
  4763       return concat_name;
       
  4764     XFREE(concat_name);
       
  4765   }
       
  4766   else
       
  4767   {
       
  4768 #endif
       
  4769     if (IS_DIR_SEPARATOR (wrapper[0]))
       
  4770     {
       
  4771       concat_name = xstrdup (wrapper);
       
  4772       if (check_executable(concat_name))
       
  4773         return concat_name;
       
  4774       XFREE(concat_name);
       
  4775     }
       
  4776 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
       
  4777   }
       
  4778 #endif
       
  4779 
       
  4780   for (p = wrapper; *p; p++)
       
  4781     if (*p == '/')
       
  4782     {
       
  4783       has_slash = 1;
       
  4784       break;
       
  4785     }
       
  4786   if (!has_slash)
       
  4787   {
       
  4788     /* no slashes; search PATH */
       
  4789     const char* path = getenv ("PATH");
       
  4790     if (path != NULL)
       
  4791     {
       
  4792       for (p = path; *p; p = p_next)
       
  4793       {
       
  4794         const char* q;
       
  4795         size_t p_len;
       
  4796         for (q = p; *q; q++)
       
  4797           if (IS_PATH_SEPARATOR(*q))
       
  4798             break;
       
  4799         p_len = q - p;
       
  4800         p_next = (*q == '\0' ? q : q + 1);
       
  4801         if (p_len == 0)
       
  4802         {
       
  4803           /* empty path: current directory */
       
  4804           if (getcwd (tmp, LT_PATHMAX) == NULL)
       
  4805             lt_fatal ("getcwd failed");
       
  4806           tmp_len = strlen(tmp);
       
  4807           concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
       
  4808           memcpy (concat_name, tmp, tmp_len);
       
  4809           concat_name[tmp_len] = '/';
       
  4810           strcpy (concat_name + tmp_len + 1, wrapper);
       
  4811         }
       
  4812         else
       
  4813         {
       
  4814           concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
       
  4815           memcpy (concat_name, p, p_len);
       
  4816           concat_name[p_len] = '/';
       
  4817           strcpy (concat_name + p_len + 1, wrapper);
       
  4818         }
       
  4819         if (check_executable(concat_name))
       
  4820           return concat_name;
       
  4821         XFREE(concat_name);
       
  4822       }
       
  4823     }
       
  4824     /* not found in PATH; assume curdir */
       
  4825   }
       
  4826   /* Relative path | not found in path: prepend cwd */
       
  4827   if (getcwd (tmp, LT_PATHMAX) == NULL)
  4825   if (getcwd (tmp, LT_PATHMAX) == NULL)
  4828     lt_fatal ("getcwd failed");
  4826     lt_fatal ("getcwd failed");
  4829   tmp_len = strlen(tmp);
  4827   size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
  4830   concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  4828   p = XMALLOC(char, size);
  4831   memcpy (concat_name, tmp, tmp_len);
  4829   sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
  4832   concat_name[tmp_len] = '/';
  4830   return p;
  4833   strcpy (concat_name + tmp_len + 1, wrapper);
       
  4834 
       
  4835   if (check_executable(concat_name))
       
  4836     return concat_name;
       
  4837   XFREE(concat_name);
       
  4838   return NULL;
       
  4839 }
  4831 }
  4840 
  4832 
  4841 char *
  4833 char *
  4842 strendzap(char *str, const char *pat) 
  4834 strendzap(char *str, const char *pat)
  4843 {
  4835 {
  4844   size_t len, patlen;
  4836   size_t len, patlen;
  4845 
  4837 
  4846   assert(str != NULL);
  4838   assert(str != NULL);
  4847   assert(pat != NULL);
  4839   assert(pat != NULL);
  4857   }
  4849   }
  4858   return str;
  4850   return str;
  4859 }
  4851 }
  4860 
  4852 
  4861 static void
  4853 static void
  4862 lt_error_core (int exit_status, const char * mode, 
  4854 lt_error_core (int exit_status, const char * mode,
  4863           const char * message, va_list ap)
  4855           const char * message, va_list ap)
  4864 {
  4856 {
  4865   fprintf (stderr, "%s: %s: ", program_name, mode);
  4857   fprintf (stderr, "%s: %s: ", program_name, mode);
  4866   vfprintf (stderr, message, ap);
  4858   vfprintf (stderr, message, ap);
  4867   fprintf (stderr, ".\n");
  4859   fprintf (stderr, ".\n");
  4886 	  # wrapper might as well be built for $host, too.
  4878 	  # wrapper might as well be built for $host, too.
  4887 	  $run $LTCC -s -o $cwrapper $cwrappersource
  4879 	  $run $LTCC -s -o $cwrapper $cwrappersource
  4888 	  ;;
  4880 	  ;;
  4889 	esac
  4881 	esac
  4890 	$rm $output
  4882 	$rm $output
  4891 	trap "$rm $output; exit 1" 1 2 15
  4883 	trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  4892 
  4884 
  4893 	$echo > $output "\
  4885 	$echo > $output "\
  4894 #! $SHELL
  4886 #! $SHELL
  4895 
  4887 
  4896 # $output - temporary wrapper script for $objdir/$outputname
  4888 # $output - temporary wrapper script for $objdir/$outputname
  4907 Xsed='${SED} -e 1s/^X//'
  4899 Xsed='${SED} -e 1s/^X//'
  4908 sed_quote_subst='$sed_quote_subst'
  4900 sed_quote_subst='$sed_quote_subst'
  4909 
  4901 
  4910 # The HP-UX ksh and POSIX shell print the target directory to stdout
  4902 # The HP-UX ksh and POSIX shell print the target directory to stdout
  4911 # if CDPATH is set.
  4903 # if CDPATH is set.
  4912 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
  4904 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  4913 
  4905 
  4914 relink_command=\"$relink_command\"
  4906 relink_command=\"$relink_command\"
  4915 
  4907 
  4916 # This environment variable determines our operation mode.
  4908 # This environment variable determines our operation mode.
  4917 if test \"\$libtool_install_magic\" = \"$magic\"; then
  4909 if test \"\$libtool_install_magic\" = \"$magic\"; then
  4986     if test -n \"\$relink_command\"; then
  4978     if test -n \"\$relink_command\"; then
  4987       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  4979       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  4988       else
  4980       else
  4989 	$echo \"\$relink_command_output\" >&2
  4981 	$echo \"\$relink_command_output\" >&2
  4990 	$rm \"\$progdir/\$file\"
  4982 	$rm \"\$progdir/\$file\"
  4991 	exit 1
  4983 	exit $EXIT_FAILURE
  4992       fi
  4984       fi
  4993     fi
  4985     fi
  4994 
  4986 
  4995     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  4987     $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  4996     { $rm \"\$progdir/\$program\";
  4988     { $rm \"\$progdir/\$program\";
  5048 "
  5040 "
  5049 	  ;;
  5041 	  ;;
  5050 	esac
  5042 	esac
  5051 	$echo >> $output "\
  5043 	$echo >> $output "\
  5052       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  5044       \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  5053       exit 1
  5045       exit $EXIT_FAILURE
  5054     fi
  5046     fi
  5055   else
  5047   else
  5056     # The program doesn't exist.
  5048     # The program doesn't exist.
  5057     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  5049     \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  5058     \$echo \"This script is just a wrapper for \$program.\" 1>&2
  5050     \$echo \"This script is just a wrapper for \$program.\" 1>&2
  5059     $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  5051     $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  5060     exit 1
  5052     exit $EXIT_FAILURE
  5061   fi
  5053   fi
  5062 fi\
  5054 fi\
  5063 "
  5055 "
  5064 	chmod +x $output
  5056 	chmod +x $output
  5065       fi
  5057       fi
  5066       exit 0
  5058       exit $EXIT_SUCCESS
  5067       ;;
  5059       ;;
  5068     esac
  5060     esac
  5069 
  5061 
  5070     # See if we need to build an old-fashioned archive.
  5062     # See if we need to build an old-fashioned archive.
  5071     for oldlib in $oldlibs; do
  5063     for oldlib in $oldlibs; do
  5084 	addlibs="$old_convenience"
  5076 	addlibs="$old_convenience"
  5085       fi
  5077       fi
  5086 
  5078 
  5087       if test -n "$addlibs"; then
  5079       if test -n "$addlibs"; then
  5088 	gentop="$output_objdir/${outputname}x"
  5080 	gentop="$output_objdir/${outputname}x"
  5089 	$show "${rm}r $gentop"
       
  5090 	$run ${rm}r "$gentop"
       
  5091 	$show "$mkdir $gentop"
       
  5092 	$run $mkdir "$gentop"
       
  5093 	status=$?
       
  5094 	if test "$status" -ne 0 && test ! -d "$gentop"; then
       
  5095 	  exit $status
       
  5096 	fi
       
  5097 	generated="$generated $gentop"
  5081 	generated="$generated $gentop"
  5098 
  5082 
  5099 	# Add in members from convenience archives.
  5083 	func_extract_archives $gentop $addlibs
  5100 	for xlib in $addlibs; do
  5084 	oldobjs="$oldobjs $func_extract_archives_result"
  5101 	  # Extract the objects.
       
  5102 	  case $xlib in
       
  5103 	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
       
  5104 	  *) xabs=`pwd`"/$xlib" ;;
       
  5105 	  esac
       
  5106 	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
       
  5107 	  xdir="$gentop/$xlib"
       
  5108 
       
  5109 	  $show "${rm}r $xdir"
       
  5110 	  $run ${rm}r "$xdir"
       
  5111 	  $show "$mkdir $xdir"
       
  5112 	  $run $mkdir "$xdir"
       
  5113 	  status=$?
       
  5114 	  if test "$status" -ne 0 && test ! -d "$xdir"; then
       
  5115 	    exit $status
       
  5116 	  fi
       
  5117 	  # We will extract separately just the conflicting names and we will no
       
  5118 	  # longer touch any unique names. It is faster to leave these extract
       
  5119 	  # automatically by $AR in one run.
       
  5120 	  $show "(cd $xdir && $AR x $xabs)"
       
  5121 	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
       
  5122 	  if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
       
  5123 	    :
       
  5124 	  else
       
  5125 	    $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
       
  5126 	    $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
       
  5127 	    $AR t "$xabs" | sort | uniq -cd | while read -r count name
       
  5128 	    do
       
  5129 	      i=1
       
  5130 	      while test "$i" -le "$count"
       
  5131 	      do
       
  5132 	       # Put our $i before any first dot (extension)
       
  5133 	       # Never overwrite any file
       
  5134 	       name_to="$name"
       
  5135 	       while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
       
  5136 	       do
       
  5137 		 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
       
  5138 	       done
       
  5139 	       $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
       
  5140 	       $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
       
  5141 	       i=`expr $i + 1`
       
  5142 	      done
       
  5143 	    done
       
  5144 	  fi
       
  5145 
       
  5146 	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
       
  5147 	done
       
  5148       fi
  5085       fi
  5149 
  5086 
  5150       # Do each command in the archive commands.
  5087       # Do each command in the archive commands.
  5151       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  5088       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  5152 	eval cmds=\"$old_archive_from_new_cmds\"
  5089        cmds=$old_archive_from_new_cmds
  5153       else
  5090       else
  5154 	eval cmds=\"$old_archive_cmds\"
  5091 	eval cmds=\"$old_archive_cmds\"
  5155 
  5092 
  5156 	if len=`expr "X$cmds" : ".*"` &&
  5093 	if len=`expr "X$cmds" : ".*"` &&
  5157 	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  5094 	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  5158 	  :
  5095 	  cmds=$old_archive_cmds
  5159 	else
  5096 	else
  5160 	  # the command line is too long to link in one step, link in parts
  5097 	  # the command line is too long to link in one step, link in parts
  5161 	  $echo "using piecewise archive linking..."
  5098 	  $echo "using piecewise archive linking..."
  5162 	  save_RANLIB=$RANLIB
  5099 	  save_RANLIB=$RANLIB
  5163 	  RANLIB=:
  5100 	  RANLIB=:
  5180 	  fi
  5117 	  fi
  5181 	  # Is there a better way of finding the last object in the list?
  5118 	  # Is there a better way of finding the last object in the list?
  5182 	  for obj in $save_oldobjs
  5119 	  for obj in $save_oldobjs
  5183 	  do
  5120 	  do
  5184 	    last_oldobj=$obj
  5121 	    last_oldobj=$obj
  5185 	  done  
  5122 	  done
  5186 	  for obj in $save_oldobjs
  5123 	  for obj in $save_oldobjs
  5187 	  do
  5124 	  do
  5188 	    oldobjs="$objlist $obj"
  5125 	    oldobjs="$objlist $obj"
  5189 	    objlist="$objlist $obj"
  5126 	    objlist="$objlist $obj"
  5190 	    eval test_cmds=\"$old_archive_cmds\"
  5127 	    eval test_cmds=\"$old_archive_cmds\"
  5194 	    else
  5131 	    else
  5195 	      # the above command should be used before it gets too long
  5132 	      # the above command should be used before it gets too long
  5196 	      oldobjs=$objlist
  5133 	      oldobjs=$objlist
  5197 	      if test "$obj" = "$last_oldobj" ; then
  5134 	      if test "$obj" = "$last_oldobj" ; then
  5198 	        RANLIB=$save_RANLIB
  5135 	        RANLIB=$save_RANLIB
  5199 	      fi  
  5136 	      fi
  5200 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  5137 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  5201 	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  5138 	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  5202 	      objlist=
  5139 	      objlist=
  5203 	    fi
  5140 	    fi
  5204 	  done
  5141 	  done
  5205 	  RANLIB=$save_RANLIB
  5142 	  RANLIB=$save_RANLIB
  5206 	  oldobjs=$objlist
  5143 	  oldobjs=$objlist
  5207 	  if test "X$oldobjs" = "X" ; then
  5144 	  if test "X$oldobjs" = "X" ; then
  5208 	    eval cmds=\"\$concat_cmds\"
  5145 	    eval cmds=\"\$concat_cmds\"
  5209 	  else
  5146 	  else
  5210 	    eval cmds=\"\$concat_cmds~$old_archive_cmds\"
  5147 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  5211 	  fi
  5148 	  fi
  5212 	fi
  5149 	fi
  5213       fi
  5150       fi
  5214       save_ifs="$IFS"; IFS='~'
  5151       save_ifs="$IFS"; IFS='~'
  5215       for cmd in $cmds; do
  5152       for cmd in $cmds; do
       
  5153         eval cmd=\"$cmd\"
  5216 	IFS="$save_ifs"
  5154 	IFS="$save_ifs"
  5217 	$show "$cmd"
  5155 	$show "$cmd"
  5218 	$run eval "$cmd" || exit $?
  5156 	$run eval "$cmd" || exit $?
  5219       done
  5157       done
  5220       IFS="$save_ifs"
  5158       IFS="$save_ifs"
  5242 	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  5180 	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  5243 	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
  5181 	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
  5244 	fi
  5182 	fi
  5245       done
  5183       done
  5246       # Quote the link command for shipping.
  5184       # Quote the link command for shipping.
  5247       relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
  5185       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  5248       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  5186       relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       
  5187       if test "$hardcode_automatic" = yes ; then
       
  5188 	relink_command=
       
  5189       fi
       
  5190 
  5249 
  5191 
  5250       # Only create the output if not a dry run.
  5192       # Only create the output if not a dry run.
  5251       if test -z "$run"; then
  5193       if test -z "$run"; then
  5252 	for installed in no yes; do
  5194 	for installed in no yes; do
  5253 	  if test "$installed" = yes; then
  5195 	  if test "$installed" = yes; then
  5262 	      *.la)
  5204 	      *.la)
  5263 		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  5205 		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  5264 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  5206 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  5265 		if test -z "$libdir"; then
  5207 		if test -z "$libdir"; then
  5266 		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  5208 		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  5267 		  exit 1
  5209 		  exit $EXIT_FAILURE
  5268 		fi
  5210 		fi
  5269 		newdependency_libs="$newdependency_libs $libdir/$name"
  5211 		newdependency_libs="$newdependency_libs $libdir/$name"
  5270 		;;
  5212 		;;
  5271 	      *) newdependency_libs="$newdependency_libs $deplib" ;;
  5213 	      *) newdependency_libs="$newdependency_libs $deplib" ;;
  5272 	      esac
  5214 	      esac
  5276 	    for lib in $dlfiles; do
  5218 	    for lib in $dlfiles; do
  5277 	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5219 	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5278 	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5220 	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5279 	      if test -z "$libdir"; then
  5221 	      if test -z "$libdir"; then
  5280 		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5222 		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5281 		exit 1
  5223 		exit $EXIT_FAILURE
  5282 	      fi
  5224 	      fi
  5283 	      newdlfiles="$newdlfiles $libdir/$name"
  5225 	      newdlfiles="$newdlfiles $libdir/$name"
  5284 	    done
  5226 	    done
  5285 	    dlfiles="$newdlfiles"
  5227 	    dlfiles="$newdlfiles"
  5286 	    newdlprefiles=
  5228 	    newdlprefiles=
  5287 	    for lib in $dlprefiles; do
  5229 	    for lib in $dlprefiles; do
  5288 	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5230 	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5289 	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5231 	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5290 	      if test -z "$libdir"; then
  5232 	      if test -z "$libdir"; then
  5291 		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5233 		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5292 		exit 1
  5234 		exit $EXIT_FAILURE
  5293 	      fi
  5235 	      fi
  5294 	      newdlprefiles="$newdlprefiles $libdir/$name"
  5236 	      newdlprefiles="$newdlprefiles $libdir/$name"
       
  5237 	    done
       
  5238 	    dlprefiles="$newdlprefiles"
       
  5239 	  else
       
  5240 	    newdlfiles=
       
  5241 	    for lib in $dlfiles; do
       
  5242 	      case $lib in
       
  5243 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
       
  5244 		*) abs=`pwd`"/$lib" ;;
       
  5245 	      esac
       
  5246 	      newdlfiles="$newdlfiles $abs"
       
  5247 	    done
       
  5248 	    dlfiles="$newdlfiles"
       
  5249 	    newdlprefiles=
       
  5250 	    for lib in $dlprefiles; do
       
  5251 	      case $lib in
       
  5252 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
       
  5253 		*) abs=`pwd`"/$lib" ;;
       
  5254 	      esac
       
  5255 	      newdlprefiles="$newdlprefiles $abs"
  5295 	    done
  5256 	    done
  5296 	    dlprefiles="$newdlprefiles"
  5257 	    dlprefiles="$newdlprefiles"
  5297 	  fi
  5258 	  fi
  5298 	  $rm $output
  5259 	  $rm $output
  5299 	  # place dlname in correct position for cygwin
  5260 	  # place dlname in correct position for cygwin
  5348       # LD_LIBRARY_PATH before the program is installed.
  5309       # LD_LIBRARY_PATH before the program is installed.
  5349       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  5310       $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  5350       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  5311       $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  5351       ;;
  5312       ;;
  5352     esac
  5313     esac
  5353     exit 0
  5314     exit $EXIT_SUCCESS
  5354     ;;
  5315     ;;
  5355 
  5316 
  5356   # libtool install mode
  5317   # libtool install mode
  5357   install)
  5318   install)
  5358     modename="$modename: install"
  5319     modename="$modename: install"
  5437     done
  5398     done
  5438 
  5399 
  5439     if test -z "$install_prog"; then
  5400     if test -z "$install_prog"; then
  5440       $echo "$modename: you must specify an install program" 1>&2
  5401       $echo "$modename: you must specify an install program" 1>&2
  5441       $echo "$help" 1>&2
  5402       $echo "$help" 1>&2
  5442       exit 1
  5403       exit $EXIT_FAILURE
  5443     fi
  5404     fi
  5444 
  5405 
  5445     if test -n "$prev"; then
  5406     if test -n "$prev"; then
  5446       $echo "$modename: the \`$prev' option requires an argument" 1>&2
  5407       $echo "$modename: the \`$prev' option requires an argument" 1>&2
  5447       $echo "$help" 1>&2
  5408       $echo "$help" 1>&2
  5448       exit 1
  5409       exit $EXIT_FAILURE
  5449     fi
  5410     fi
  5450 
  5411 
  5451     if test -z "$files"; then
  5412     if test -z "$files"; then
  5452       if test -z "$dest"; then
  5413       if test -z "$dest"; then
  5453 	$echo "$modename: no file or destination specified" 1>&2
  5414 	$echo "$modename: no file or destination specified" 1>&2
  5454       else
  5415       else
  5455 	$echo "$modename: you must specify a destination" 1>&2
  5416 	$echo "$modename: you must specify a destination" 1>&2
  5456       fi
  5417       fi
  5457       $echo "$help" 1>&2
  5418       $echo "$help" 1>&2
  5458       exit 1
  5419       exit $EXIT_FAILURE
  5459     fi
  5420     fi
  5460 
  5421 
  5461     # Strip any trailing slash from the destination.
  5422     # Strip any trailing slash from the destination.
  5462     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  5423     dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  5463 
  5424 
  5474       # Not a directory, so check to see that there is only one file specified.
  5435       # Not a directory, so check to see that there is only one file specified.
  5475       set dummy $files
  5436       set dummy $files
  5476       if test "$#" -gt 2; then
  5437       if test "$#" -gt 2; then
  5477 	$echo "$modename: \`$dest' is not a directory" 1>&2
  5438 	$echo "$modename: \`$dest' is not a directory" 1>&2
  5478 	$echo "$help" 1>&2
  5439 	$echo "$help" 1>&2
  5479 	exit 1
  5440 	exit $EXIT_FAILURE
  5480       fi
  5441       fi
  5481     fi
  5442     fi
  5482     case $destdir in
  5443     case $destdir in
  5483     [\\/]* | [A-Za-z]:[\\/]*) ;;
  5444     [\\/]* | [A-Za-z]:[\\/]*) ;;
  5484     *)
  5445     *)
  5486 	case $file in
  5447 	case $file in
  5487 	*.lo) ;;
  5448 	*.lo) ;;
  5488 	*)
  5449 	*)
  5489 	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  5450 	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  5490 	  $echo "$help" 1>&2
  5451 	  $echo "$help" 1>&2
  5491 	  exit 1
  5452 	  exit $EXIT_FAILURE
  5492 	  ;;
  5453 	  ;;
  5493 	esac
  5454 	esac
  5494       done
  5455       done
  5495       ;;
  5456       ;;
  5496     esac
  5457     esac
  5515 	# Check to see that this really is a libtool archive.
  5476 	# Check to see that this really is a libtool archive.
  5516 	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5477 	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5517 	else
  5478 	else
  5518 	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  5479 	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  5519 	  $echo "$help" 1>&2
  5480 	  $echo "$help" 1>&2
  5520 	  exit 1
  5481 	  exit $EXIT_FAILURE
  5521 	fi
  5482 	fi
  5522 
  5483 
  5523 	library_names=
  5484 	library_names=
  5524 	old_library=
  5485 	old_library=
  5525 	relink_command=
  5486 	relink_command=
  5557 	  # At present, this check doesn't affect windows .dll's that
  5518 	  # At present, this check doesn't affect windows .dll's that
  5558 	  # are installed into $libdir/../bin (currently, that works fine)
  5519 	  # are installed into $libdir/../bin (currently, that works fine)
  5559 	  # but it's something to keep an eye on.
  5520 	  # but it's something to keep an eye on.
  5560 	  if test "$inst_prefix_dir" = "$destdir"; then
  5521 	  if test "$inst_prefix_dir" = "$destdir"; then
  5561 	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  5522 	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  5562 	    exit 1
  5523 	    exit $EXIT_FAILURE
  5563 	  fi
  5524 	  fi
  5564 
  5525 
  5565 	  if test -n "$inst_prefix_dir"; then
  5526 	  if test -n "$inst_prefix_dir"; then
  5566 	    # Stick the inst_prefix_dir data into the link command.
  5527 	    # Stick the inst_prefix_dir data into the link command.
  5567 	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  5528 	    relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  5572 	  $echo "$modename: warning: relinking \`$file'" 1>&2
  5533 	  $echo "$modename: warning: relinking \`$file'" 1>&2
  5573 	  $show "$relink_command"
  5534 	  $show "$relink_command"
  5574 	  if $run eval "$relink_command"; then :
  5535 	  if $run eval "$relink_command"; then :
  5575 	  else
  5536 	  else
  5576 	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5537 	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5577 	    exit 1
  5538 	    exit $EXIT_FAILURE
  5578 	  fi
  5539 	  fi
  5579 	fi
  5540 	fi
  5580 
  5541 
  5581 	# See the names of the shared library.
  5542 	# See the names of the shared library.
  5582 	set dummy $library_names
  5543 	set dummy $library_names
  5607 	    done
  5568 	    done
  5608 	  fi
  5569 	  fi
  5609 
  5570 
  5610 	  # Do each command in the postinstall commands.
  5571 	  # Do each command in the postinstall commands.
  5611 	  lib="$destdir/$realname"
  5572 	  lib="$destdir/$realname"
  5612 	  eval cmds=\"$postinstall_cmds\"
  5573 	  cmds=$postinstall_cmds
  5613 	  save_ifs="$IFS"; IFS='~'
  5574 	  save_ifs="$IFS"; IFS='~'
  5614 	  for cmd in $cmds; do
  5575 	  for cmd in $cmds; do
  5615 	    IFS="$save_ifs"
  5576 	    IFS="$save_ifs"
       
  5577 	    eval cmd=\"$cmd\"
  5616 	    $show "$cmd"
  5578 	    $show "$cmd"
  5617 	    $run eval "$cmd" || exit $?
  5579 	    $run eval "$cmd" || exit $?
  5618 	  done
  5580 	  done
  5619 	  IFS="$save_ifs"
  5581 	  IFS="$save_ifs"
  5620 	fi
  5582 	fi
  5650 	  destfile=
  5612 	  destfile=
  5651 	  ;;
  5613 	  ;;
  5652 	*)
  5614 	*)
  5653 	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  5615 	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  5654 	  $echo "$help" 1>&2
  5616 	  $echo "$help" 1>&2
  5655 	  exit 1
  5617 	  exit $EXIT_FAILURE
  5656 	  ;;
  5618 	  ;;
  5657 	esac
  5619 	esac
  5658 
  5620 
  5659 	# Install the libtool object if requested.
  5621 	# Install the libtool object if requested.
  5660 	if test -n "$destfile"; then
  5622 	if test -n "$destfile"; then
  5668 	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  5630 	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  5669 
  5631 
  5670 	  $show "$install_prog $staticobj $staticdest"
  5632 	  $show "$install_prog $staticobj $staticdest"
  5671 	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  5633 	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  5672 	fi
  5634 	fi
  5673 	exit 0
  5635 	exit $EXIT_SUCCESS
  5674 	;;
  5636 	;;
  5675 
  5637 
  5676       *)
  5638       *)
  5677 	# Figure out destination file name, if it wasn't already specified.
  5639 	# Figure out destination file name, if it wasn't already specified.
  5678 	if test -n "$destname"; then
  5640 	if test -n "$destname"; then
  5722 	  esac
  5684 	  esac
  5723 
  5685 
  5724 	  # Check the variables that should have been set.
  5686 	  # Check the variables that should have been set.
  5725 	  if test -z "$notinst_deplibs"; then
  5687 	  if test -z "$notinst_deplibs"; then
  5726 	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  5688 	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  5727 	    exit 1
  5689 	    exit $EXIT_FAILURE
  5728 	  fi
  5690 	  fi
  5729 
  5691 
  5730 	  finalize=yes
  5692 	  finalize=yes
  5731 	  for lib in $notinst_deplibs; do
  5693 	  for lib in $notinst_deplibs; do
  5732 	    # Check to see that each library is installed.
  5694 	    # Check to see that each library is installed.
  5763 	  if test "$fast_install" = no && test -n "$relink_command"; then
  5725 	  if test "$fast_install" = no && test -n "$relink_command"; then
  5764 	    if test "$finalize" = yes && test -z "$run"; then
  5726 	    if test "$finalize" = yes && test -z "$run"; then
  5765 	      tmpdir="/tmp"
  5727 	      tmpdir="/tmp"
  5766 	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
  5728 	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
  5767 	      tmpdir="$tmpdir/libtool-$$"
  5729 	      tmpdir="$tmpdir/libtool-$$"
  5768 	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
  5730 	      save_umask=`umask`
       
  5731 	      umask 0077
       
  5732 	      if $mkdir "$tmpdir"; then
       
  5733 	        umask $save_umask
  5769 	      else
  5734 	      else
       
  5735 	        umask $save_umask
  5770 		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  5736 		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  5771 		continue
  5737 		continue
  5772 	      fi
  5738 	      fi
  5773 	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  5739 	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  5774 	      outputname="$tmpdir/$file"
  5740 	      outputname="$tmpdir/$file"
  5823       oldlib="$destdir/$name"
  5789       oldlib="$destdir/$name"
  5824 
  5790 
  5825       $show "$install_prog $file $oldlib"
  5791       $show "$install_prog $file $oldlib"
  5826       $run eval "$install_prog \$file \$oldlib" || exit $?
  5792       $run eval "$install_prog \$file \$oldlib" || exit $?
  5827 
  5793 
  5828       if test -n "$stripme" && test -n "$striplib"; then
  5794       if test -n "$stripme" && test -n "$old_striplib"; then
  5829 	$show "$old_striplib $oldlib"
  5795 	$show "$old_striplib $oldlib"
  5830 	$run eval "$old_striplib $oldlib" || exit $?
  5796 	$run eval "$old_striplib $oldlib" || exit $?
  5831       fi
  5797       fi
  5832 
  5798 
  5833       # Do each command in the postinstall commands.
  5799       # Do each command in the postinstall commands.
  5834       eval cmds=\"$old_postinstall_cmds\"
  5800       cmds=$old_postinstall_cmds
  5835       save_ifs="$IFS"; IFS='~'
  5801       save_ifs="$IFS"; IFS='~'
  5836       for cmd in $cmds; do
  5802       for cmd in $cmds; do
  5837 	IFS="$save_ifs"
  5803 	IFS="$save_ifs"
       
  5804 	eval cmd=\"$cmd\"
  5838 	$show "$cmd"
  5805 	$show "$cmd"
  5839 	$run eval "$cmd" || exit $?
  5806 	$run eval "$cmd" || exit $?
  5840       done
  5807       done
  5841       IFS="$save_ifs"
  5808       IFS="$save_ifs"
  5842     done
  5809     done
  5846     fi
  5813     fi
  5847 
  5814 
  5848     if test -n "$current_libdirs"; then
  5815     if test -n "$current_libdirs"; then
  5849       # Maybe just do a dry run.
  5816       # Maybe just do a dry run.
  5850       test -n "$run" && current_libdirs=" -n$current_libdirs"
  5817       test -n "$run" && current_libdirs=" -n$current_libdirs"
  5851       exec_cmd='$SHELL $0 --finish$current_libdirs'
  5818       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  5852     else
  5819     else
  5853       exit 0
  5820       exit $EXIT_SUCCESS
  5854     fi
  5821     fi
  5855     ;;
  5822     ;;
  5856 
  5823 
  5857   # libtool finish mode
  5824   # libtool finish mode
  5858   finish)
  5825   finish)
  5867       done
  5834       done
  5868 
  5835 
  5869       for libdir in $libdirs; do
  5836       for libdir in $libdirs; do
  5870 	if test -n "$finish_cmds"; then
  5837 	if test -n "$finish_cmds"; then
  5871 	  # Do each command in the finish commands.
  5838 	  # Do each command in the finish commands.
  5872 	  eval cmds=\"$finish_cmds\"
  5839 	  cmds=$finish_cmds
  5873 	  save_ifs="$IFS"; IFS='~'
  5840 	  save_ifs="$IFS"; IFS='~'
  5874 	  for cmd in $cmds; do
  5841 	  for cmd in $cmds; do
  5875 	    IFS="$save_ifs"
  5842 	    IFS="$save_ifs"
       
  5843 	    eval cmd=\"$cmd\"
  5876 	    $show "$cmd"
  5844 	    $show "$cmd"
  5877 	    $run eval "$cmd" || admincmds="$admincmds
  5845 	    $run eval "$cmd" || admincmds="$admincmds
  5878        $cmd"
  5846        $cmd"
  5879 	  done
  5847 	  done
  5880 	  IFS="$save_ifs"
  5848 	  IFS="$save_ifs"
  5887 	fi
  5855 	fi
  5888       done
  5856       done
  5889     fi
  5857     fi
  5890 
  5858 
  5891     # Exit here if they wanted silent mode.
  5859     # Exit here if they wanted silent mode.
  5892     test "$show" = : && exit 0
  5860     test "$show" = : && exit $EXIT_SUCCESS
  5893 
  5861 
  5894     $echo "----------------------------------------------------------------------"
  5862     $echo "----------------------------------------------------------------------"
  5895     $echo "Libraries have been installed in:"
  5863     $echo "Libraries have been installed in:"
  5896     for libdir in $libdirs; do
  5864     for libdir in $libdirs; do
  5897       $echo "   $libdir"
  5865       $echo "   $libdir"
  5923     fi
  5891     fi
  5924     $echo
  5892     $echo
  5925     $echo "See any operating system documentation about shared libraries for"
  5893     $echo "See any operating system documentation about shared libraries for"
  5926     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  5894     $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  5927     $echo "----------------------------------------------------------------------"
  5895     $echo "----------------------------------------------------------------------"
  5928     exit 0
  5896     exit $EXIT_SUCCESS
  5929     ;;
  5897     ;;
  5930 
  5898 
  5931   # libtool execute mode
  5899   # libtool execute mode
  5932   execute)
  5900   execute)
  5933     modename="$modename: execute"
  5901     modename="$modename: execute"
  5935     # The first argument is the command name.
  5903     # The first argument is the command name.
  5936     cmd="$nonopt"
  5904     cmd="$nonopt"
  5937     if test -z "$cmd"; then
  5905     if test -z "$cmd"; then
  5938       $echo "$modename: you must specify a COMMAND" 1>&2
  5906       $echo "$modename: you must specify a COMMAND" 1>&2
  5939       $echo "$help"
  5907       $echo "$help"
  5940       exit 1
  5908       exit $EXIT_FAILURE
  5941     fi
  5909     fi
  5942 
  5910 
  5943     # Handle -dlopen flags immediately.
  5911     # Handle -dlopen flags immediately.
  5944     for file in $execute_dlfiles; do
  5912     for file in $execute_dlfiles; do
  5945       if test ! -f "$file"; then
  5913       if test ! -f "$file"; then
  5946 	$echo "$modename: \`$file' is not a file" 1>&2
  5914 	$echo "$modename: \`$file' is not a file" 1>&2
  5947 	$echo "$help" 1>&2
  5915 	$echo "$help" 1>&2
  5948 	exit 1
  5916 	exit $EXIT_FAILURE
  5949       fi
  5917       fi
  5950 
  5918 
  5951       dir=
  5919       dir=
  5952       case $file in
  5920       case $file in
  5953       *.la)
  5921       *.la)
  5954 	# Check to see that this really is a libtool archive.
  5922 	# Check to see that this really is a libtool archive.
  5955 	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5923 	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5956 	else
  5924 	else
  5957 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5925 	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5958 	  $echo "$help" 1>&2
  5926 	  $echo "$help" 1>&2
  5959 	  exit 1
  5927 	  exit $EXIT_FAILURE
  5960 	fi
  5928 	fi
  5961 
  5929 
  5962 	# Read the libtool library.
  5930 	# Read the libtool library.
  5963 	dlname=
  5931 	dlname=
  5964 	library_names=
  5932 	library_names=
  5981 
  5949 
  5982 	if test -f "$dir/$objdir/$dlname"; then
  5950 	if test -f "$dir/$objdir/$dlname"; then
  5983 	  dir="$dir/$objdir"
  5951 	  dir="$dir/$objdir"
  5984 	else
  5952 	else
  5985 	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  5953 	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  5986 	  exit 1
  5954 	  exit $EXIT_FAILURE
  5987 	fi
  5955 	fi
  5988 	;;
  5956 	;;
  5989 
  5957 
  5990       *.lo)
  5958       *.lo)
  5991 	# Just add the directory containing the .lo file.
  5959 	# Just add the directory containing the .lo file.
  6061       if test -n "$shlibpath_var"; then
  6029       if test -n "$shlibpath_var"; then
  6062 	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  6030 	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  6063 	$echo "export $shlibpath_var"
  6031 	$echo "export $shlibpath_var"
  6064       fi
  6032       fi
  6065       $echo "$cmd$args"
  6033       $echo "$cmd$args"
  6066       exit 0
  6034       exit $EXIT_SUCCESS
  6067     fi
  6035     fi
  6068     ;;
  6036     ;;
  6069 
  6037 
  6070   # libtool clean and uninstall mode
  6038   # libtool clean and uninstall mode
  6071   clean | uninstall)
  6039   clean | uninstall)
  6089     done
  6057     done
  6090 
  6058 
  6091     if test -z "$rm"; then
  6059     if test -z "$rm"; then
  6092       $echo "$modename: you must specify an RM program" 1>&2
  6060       $echo "$modename: you must specify an RM program" 1>&2
  6093       $echo "$help" 1>&2
  6061       $echo "$help" 1>&2
  6094       exit 1
  6062       exit $EXIT_FAILURE
  6095     fi
  6063     fi
  6096 
  6064 
  6097     rmdirs=
  6065     rmdirs=
  6098 
  6066 
  6099     origobjdir="$objdir"
  6067     origobjdir="$objdir"
  6144 	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  6112 	  test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  6145 
  6113 
  6146 	  if test "$mode" = uninstall; then
  6114 	  if test "$mode" = uninstall; then
  6147 	    if test -n "$library_names"; then
  6115 	    if test -n "$library_names"; then
  6148 	      # Do each command in the postuninstall commands.
  6116 	      # Do each command in the postuninstall commands.
  6149 	      eval cmds=\"$postuninstall_cmds\"
  6117 	      cmds=$postuninstall_cmds
  6150 	      save_ifs="$IFS"; IFS='~'
  6118 	      save_ifs="$IFS"; IFS='~'
  6151 	      for cmd in $cmds; do
  6119 	      for cmd in $cmds; do
  6152 		IFS="$save_ifs"
  6120 		IFS="$save_ifs"
       
  6121 		eval cmd=\"$cmd\"
  6153 		$show "$cmd"
  6122 		$show "$cmd"
  6154 		$run eval "$cmd"
  6123 		$run eval "$cmd"
  6155 		if test "$?" -ne 0 && test "$rmforce" != yes; then
  6124 		if test "$?" -ne 0 && test "$rmforce" != yes; then
  6156 		  exit_status=1
  6125 		  exit_status=1
  6157 		fi
  6126 		fi
  6159 	      IFS="$save_ifs"
  6128 	      IFS="$save_ifs"
  6160 	    fi
  6129 	    fi
  6161 
  6130 
  6162 	    if test -n "$old_library"; then
  6131 	    if test -n "$old_library"; then
  6163 	      # Do each command in the old_postuninstall commands.
  6132 	      # Do each command in the old_postuninstall commands.
  6164 	      eval cmds=\"$old_postuninstall_cmds\"
  6133 	      cmds=$old_postuninstall_cmds
  6165 	      save_ifs="$IFS"; IFS='~'
  6134 	      save_ifs="$IFS"; IFS='~'
  6166 	      for cmd in $cmds; do
  6135 	      for cmd in $cmds; do
  6167 		IFS="$save_ifs"
  6136 		IFS="$save_ifs"
       
  6137 		eval cmd=\"$cmd\"
  6168 		$show "$cmd"
  6138 		$show "$cmd"
  6169 		$run eval "$cmd"
  6139 		$run eval "$cmd"
  6170 		if test "$?" -ne 0 && test "$rmforce" != yes; then
  6140 		if test "$?" -ne 0 && test "$rmforce" != yes; then
  6171 		  exit_status=1
  6141 		  exit_status=1
  6172 		fi
  6142 		fi
  6201 
  6171 
  6202       *)
  6172       *)
  6203 	if test "$mode" = clean ; then
  6173 	if test "$mode" = clean ; then
  6204 	  noexename=$name
  6174 	  noexename=$name
  6205 	  case $file in
  6175 	  case $file in
  6206 	  *.exe) 
  6176 	  *.exe)
  6207 	    file=`$echo $file|${SED} 's,.exe$,,'`
  6177 	    file=`$echo $file|${SED} 's,.exe$,,'`
  6208 	    noexename=`$echo $name|${SED} 's,.exe$,,'`
  6178 	    noexename=`$echo $name|${SED} 's,.exe$,,'`
  6209 	    # $file with .exe has already been added to rmfiles,
  6179 	    # $file with .exe has already been added to rmfiles,
  6210 	    # add $file without .exe
  6180 	    # add $file without .exe
  6211 	    rmfiles="$rmfiles $file"
  6181 	    rmfiles="$rmfiles $file"
  6246     ;;
  6216     ;;
  6247 
  6217 
  6248   "")
  6218   "")
  6249     $echo "$modename: you must specify a MODE" 1>&2
  6219     $echo "$modename: you must specify a MODE" 1>&2
  6250     $echo "$generic_help" 1>&2
  6220     $echo "$generic_help" 1>&2
  6251     exit 1
  6221     exit $EXIT_FAILURE
  6252     ;;
  6222     ;;
  6253   esac
  6223   esac
  6254 
  6224 
  6255   if test -z "$exec_cmd"; then
  6225   if test -z "$exec_cmd"; then
  6256     $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6226     $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6257     $echo "$generic_help" 1>&2
  6227     $echo "$generic_help" 1>&2
  6258     exit 1
  6228     exit $EXIT_FAILURE
  6259   fi
  6229   fi
  6260 fi # test -z "$show_help"
  6230 fi # test -z "$show_help"
  6261 
  6231 
  6262 if test -n "$exec_cmd"; then
  6232 if test -n "$exec_cmd"; then
  6263   eval exec $exec_cmd
  6233   eval exec $exec_cmd
  6264   exit 1
  6234   exit $EXIT_FAILURE
  6265 fi
  6235 fi
  6266 
  6236 
  6267 # We need to display help for each of the modes.
  6237 # We need to display help for each of the modes.
  6268 case $mode in
  6238 case $mode in
  6269 "") $echo \
  6239 "") $echo \
  6295 
  6265 
  6296 MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
  6266 MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
  6297 a more detailed description of MODE.
  6267 a more detailed description of MODE.
  6298 
  6268 
  6299 Report bugs to <bug-libtool@gnu.org>."
  6269 Report bugs to <bug-libtool@gnu.org>."
  6300   exit 0
  6270   exit $EXIT_SUCCESS
  6301   ;;
  6271   ;;
  6302 
  6272 
  6303 clean)
  6273 clean)
  6304   $echo \
  6274   $echo \
  6305 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  6275 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  6407   -no-fast-install  disable the fast-install mode
  6377   -no-fast-install  disable the fast-install mode
  6408   -no-install       link a not-installable executable
  6378   -no-install       link a not-installable executable
  6409   -no-undefined     declare that a library does not refer to external symbols
  6379   -no-undefined     declare that a library does not refer to external symbols
  6410   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  6380   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  6411   -objectlist FILE  Use a list of object files found in FILE to specify objects
  6381   -objectlist FILE  Use a list of object files found in FILE to specify objects
       
  6382   -precious-files-regex REGEX
       
  6383                     don't remove output files matching REGEX
  6412   -release RELEASE  specify package release information
  6384   -release RELEASE  specify package release information
  6413   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  6385   -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  6414   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  6386   -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  6415   -static           do not do any dynamic linking of libtool libraries
  6387   -static           do not do any dynamic linking of libtool libraries
  6416   -version-info CURRENT[:REVISION[:AGE]]
  6388   -version-info CURRENT[:REVISION[:AGE]]
  6448   ;;
  6420   ;;
  6449 
  6421 
  6450 *)
  6422 *)
  6451   $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6423   $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6452   $echo "$help" 1>&2
  6424   $echo "$help" 1>&2
  6453   exit 1
  6425   exit $EXIT_FAILURE
  6454   ;;
  6426   ;;
  6455 esac
  6427 esac
  6456 
  6428 
  6457 $echo
  6429 $echo
  6458 $echo "Try \`$modename --help' for more information about other modes."
  6430 $echo "Try \`$modename --help' for more information about other modes."
  6459 
  6431 
  6460 exit 0
  6432 exit $EXIT_SUCCESS
  6461 
  6433 
  6462 # The TAGs below are defined such that we never get into a situation
  6434 # The TAGs below are defined such that we never get into a situation
  6463 # in which we disable both kinds of libraries.  Given conflicting
  6435 # in which we disable both kinds of libraries.  Given conflicting
  6464 # choices, we go for a static library, that is the most portable,
  6436 # choices, we go for a static library, that is the most portable,
  6465 # since we can't tell whether shared libraries were disabled because
  6437 # since we can't tell whether shared libraries were disabled because