Skip to content
Snippets Groups Projects
ltmain.sh 179 KiB
Newer Older
  • Learn to ignore specific revisions
  • 	  $echo
    	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
    	  $echo "*** objects $objs is not portable!"
    	  libobjs="$libobjs $objs"
    	fi
          fi
    
          if test "$dlself" != no; then
    	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
          fi
    
          set dummy $rpath
          if test "$#" -gt 2; then
    	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
          fi
          install_libdir="$2"
    
          oldlibs=
          if test -z "$rpath"; then
    	if test "$build_libtool_libs" = yes; then
    	  # Building a libtool convenience library.
    	  # Some compilers have problems with a `.al' extension so
    	  # convenience libraries should have the same extension an
    	  # archive normally would.
    	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
    	  build_libtool_libs=convenience
    	  build_old_libs=yes
    	fi
    
    	if test -n "$vinfo"; then
    	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
    
    	if test -n "$release"; then
    	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
    
    	# Parse the version information argument.
    	save_ifs="$IFS"; IFS=':'
    	set dummy $vinfo 0 0 0
    	IFS="$save_ifs"
    
    	if test -n "$8"; then
    	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
    	  $echo "$help" 1>&2
    	  exit $EXIT_FAILURE
    	fi
    
    	# convert absolute version numbers to libtool ages
    	# this retains compatibility with .la files and attempts
    	# to make the code below a bit more comprehensible
    
    	case $vinfo_number in
    	yes)
    	  number_major="$2"
    	  number_minor="$3"
    	  number_revision="$4"
    	  #
    	  # There are really only two kinds -- those that
    	  # use the current revision as the major version
    	  # and those that subtract age and use age as
    	  # a minor version.  But, then there is irix
    	  # which has an extra 1 added just for fun
    	  #
    	  case $version_type in
    
    	  darwin|linux|osf|windows)
    
    	    current=`expr $number_major + $number_minor`
    	    age="$number_minor"
    	    revision="$number_revision"
    	    ;;
    	  freebsd-aout|freebsd-elf|sunos)
    	    current="$number_major"
    	    revision="$number_minor"
    	    age="0"
    	    ;;
    	  irix|nonstopux)
    	    current=`expr $number_major + $number_minor - 1`
    	    age="$number_minor"
    	    revision="$number_minor"
    	    ;;
    	  esac
    	  ;;
    	no)
    	  current="$2"
    	  revision="$3"
    	  age="$4"
    
    	# Check that each of the things are valid numbers.
    	case $current in
    
    	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    
    	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
    
    	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    	  exit $EXIT_FAILURE
    
    	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    
    	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
    
    	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    	  exit $EXIT_FAILURE
    	  ;;
    	esac
    
    	0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
    
    	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
    
    	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    	  exit $EXIT_FAILURE
    	  ;;
    	esac
    
    	if test "$age" -gt "$current"; then
    	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
    	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
    	  exit $EXIT_FAILURE
    
    	# Calculate the version variables.
    	major=
    	versuffix=
    	verstring=
    	case $version_type in
    	none) ;;
    
    	darwin)
    	  # Like Linux, but with the current version available in
    	  # verstring for coding it into the library header
    	  major=.`expr $current - $age`
    	  versuffix="$major.$age.$revision"
    	  # Darwin ld doesn't like 0 for these options...
    	  minor_current=`expr $current + 1`
    	  verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
    	  ;;
    
    	freebsd-aout)
    	  major=".$current"
    	  versuffix=".$current.$revision";
    	  ;;
    
    	freebsd-elf)
    	  major=".$current"
    	  versuffix=".$current";
    	  ;;
    
    	irix | nonstopux)
    	  major=`expr $current - $age + 1`
    
    	  case $version_type in
    	    nonstopux) verstring_prefix=nonstopux ;;
    	    *)         verstring_prefix=sgi ;;
    	  esac
    	  verstring="$verstring_prefix$major.$revision"
    
    	  # Add in all the interfaces that we are compatible with.
    	  loop=$revision
    	  while test "$loop" -ne 0; do
    	    iface=`expr $revision - $loop`
    	    loop=`expr $loop - 1`
    	    verstring="$verstring_prefix$major.$iface:$verstring"
    	  done
    
    	  # Before this point, $major must not contain `.'.
    	  major=.$major
    	  versuffix="$major.$revision"
    	  ;;
    
    	linux)
    	  major=.`expr $current - $age`
    	  versuffix="$major.$age.$revision"
    	  ;;
    
    	osf)
    	  major=.`expr $current - $age`
    	  versuffix=".$current.$age.$revision"
    	  verstring="$current.$age.$revision"
    
    	  # Add in all the interfaces that we are compatible with.
    	  loop=$age
    	  while test "$loop" -ne 0; do
    	    iface=`expr $current - $loop`
    	    loop=`expr $loop - 1`
    	    verstring="$verstring:${iface}.0"
    	  done
    
    	  # Make executables depend on our current version.
    	  verstring="$verstring:${current}.0"
    	  ;;
    
    	sunos)
    	  major=".$current"
    	  versuffix=".$current.$revision"
    	  ;;
    
    	windows)
    	  # Use '-' rather than '.', since we only want one
    	  # extension on DOS 8.3 filesystems.
    	  major=`expr $current - $age`
    	  versuffix="-$major"
    	  ;;
    
    	*)
    	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
    	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
    	  exit $EXIT_FAILURE
    	  ;;
    	esac
    
    	# Clear the version info if we defaulted, and they specified a release.
    	if test -z "$vinfo" && test -n "$release"; then
    	  major=
    	  case $version_type in
    	  darwin)
    	    # we can't check for "0.0" in archive_cmds due to quoting
    	    # problems, so we reset it completely
    	    verstring=
    	    ;;
    	  *)
    	    verstring="0.0"
    	    ;;
    	  esac
    	  if test "$need_version" = no; then
    	    versuffix=
    	  else
    	    versuffix=".0.0"
    	  fi
    	fi
    
    	# Remove version info from name if versioning should be avoided
    	if test "$avoid_version" = yes && test "$need_version" = no; then
    	  major=
    	  versuffix=
    	  verstring=""
    	fi
    
    	# Check to see if the archive will have undefined symbols.
    	if test "$allow_undefined" = yes; then
    	  if test "$allow_undefined_flag" = unsupported; then
    	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
    	    build_libtool_libs=no
    	    build_old_libs=yes
    	  fi
    	else
    	  # Don't allow undefined symbols.
    	  allow_undefined_flag="$no_undefined_flag"
    	fi
          fi
    
          if test "$mode" != relink; then
    	# Remove our outputs, but don't remove object files since they
    	# may have been created when compiling PIC objects.
    	removelist=
    	tempremovelist=`$echo "$output_objdir/*"`
    	for p in $tempremovelist; do
    	  case $p in
    	    *.$objext)
    	       ;;
    	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
    	       if test "X$precious_files_regex" != "X"; then
    	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
    	         then
    		   continue
    		 fi
    	       fi
    	       removelist="$removelist $p"
    	       ;;
    	    *) ;;
    	  esac
    	done
    	if test -n "$removelist"; then
    	  $show "${rm}r $removelist"
    	  $run ${rm}r $removelist
    	fi
          fi
    
          # Now set the variables for building old libraries.
          if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
    	oldlibs="$oldlibs $output_objdir/$libname.$libext"
    
    	# Transform .lo files to .o files.
    	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
          fi
    
          # Eliminate all temporary directories.
    
          for path in $notinst_path; do
    	lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
    	deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
    	dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
          done
    
          if test -n "$xrpath"; then
    	# If the user specified any rpath flags, then add them.
    	temp_xrpath=
    	for libdir in $xrpath; do
    	  temp_xrpath="$temp_xrpath -R$libdir"
    	  case "$finalize_rpath " in
    	  *" $libdir "*) ;;
    	  *) finalize_rpath="$finalize_rpath $libdir" ;;
    	  esac
    	done
    	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
    	  dependency_libs="$temp_xrpath $dependency_libs"
    	fi
          fi
    
          # Make sure dlfiles contains only unique files that won't be dlpreopened
          old_dlfiles="$dlfiles"
          dlfiles=
          for lib in $old_dlfiles; do
    	case " $dlprefiles $dlfiles " in
    	*" $lib "*) ;;
    	*) dlfiles="$dlfiles $lib" ;;
    	esac
          done
    
          # Make sure dlprefiles contains only unique files
          old_dlprefiles="$dlprefiles"
          dlprefiles=
          for lib in $old_dlprefiles; do
    	case "$dlprefiles " in
    	*" $lib "*) ;;
    	*) dlprefiles="$dlprefiles $lib" ;;
    	esac
          done
    
          if test "$build_libtool_libs" = yes; then
    	if test -n "$rpath"; then
    	  case $host in
    	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
    	    # these systems don't actually have a c library (as such)!
    	    ;;
    	  *-*-rhapsody* | *-*-darwin1.[012])
    	    # Rhapsody C library is in the System framework
    	    deplibs="$deplibs -framework System"
    	    ;;
    	  *-*-netbsd*)
    	    # Don't link with libc until the a.out ld.so is fixed.
    	    ;;
    
    	  *-*-openbsd* | *-*-freebsd*)
    
    	    # Do not include libc due to us having libc/libc_r.
    
    	    test "X$arg" = "X-lc" && continue
    
    	    ;;
     	  *)
    	    # Add libc to deplibs on all other systems if necessary.
    	    if test "$build_libtool_need_lc" = "yes"; then
    	      deplibs="$deplibs -lc"
    	    fi
    	    ;;
    	  esac
    	fi
    
    	# Transform deplibs into only deplibs that can be linked in shared.
    	name_save=$name
    	libname_save=$libname
    	release_save=$release
    	versuffix_save=$versuffix
    	major_save=$major
    	# I'm not sure if I'm treating the release correctly.  I think
    	# release should show up in the -l (ie -lgmp5) so we don't want to
    	# add it in twice.  Is that correct?
    	release=""
    	versuffix=""
    	major=""
    	newdeplibs=
    	droppeddeps=no
    	case $deplibs_check_method in
    	pass_all)
    	  # Don't check for shared/static.  Everything works.
    	  # This might be a little naive.  We might want to check
    	  # whether the library exists or not.  But this is on
    	  # osf3 & osf4 and I'm not really sure... Just
    	  # implementing what was already the behavior.
    	  newdeplibs=$deplibs
    	  ;;
    	test_compile)
    	  # This code stresses the "libraries are programs" paradigm to its
    	  # limits. Maybe even breaks it.  We compile a program, linking it
    	  # against the deplibs as a proxy for the library.  Then we can check
    	  # whether they linked in statically or dynamically with ldd.
    	  $rm conftest.c
    	  cat > conftest.c <<EOF
    	  int main() { return 0; }
    
    	  $LTCC -o conftest conftest.c $deplibs
    	  if test "$?" -eq 0 ; then
    
    	    ldd_output=`ldd conftest`
    	    for i in $deplibs; do
    
    	      name="`expr $i : '-l\(.*\)'`"
    
    	      # If $name is empty we are operating on a -L argument.
    
                  if test "$name" != "" && test "$name" -ne "0"; then
    
    		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    		  case " $predeps $postdeps " in
    		  *" $i "*)
    		    newdeplibs="$newdeplibs $i"
    		    i=""
    		    ;;
    		  esac
    	        fi
    		if test -n "$i" ; then
    		  libname=`eval \\$echo \"$libname_spec\"`
    		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
    		  set dummy $deplib_matches
    		  deplib_match=$2
    		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
    		    newdeplibs="$newdeplibs $i"
    		  else
    		    droppeddeps=yes
    		    $echo
    		    $echo "*** Warning: dynamic linker does not accept needed library $i."
    		    $echo "*** I have the capability to make that library automatically link in when"
    		    $echo "*** you link to this library.  But I can only do this if you have a"
    		    $echo "*** shared version of the library, which I believe you do not have"
    		    $echo "*** because a test_compile did reveal that the linker did not use it for"
    		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
    		  fi
    		fi
    	      else
    		newdeplibs="$newdeplibs $i"
    	      fi
    	    done
    	  else
    	    # Error occurred in the first compile.  Let's try to salvage
    	    # the situation: Compile a separate program for each library.
    	    for i in $deplibs; do
    
    	      name="`expr $i : '-l\(.*\)'`"
    
    	      # If $name is empty we are operating on a -L argument.
                  if test "$name" != "" && test "$name" != "0"; then
    		$rm conftest
    
    		$LTCC -o conftest conftest.c $i
    		# Did it work?
    		if test "$?" -eq 0 ; then
    
    		  ldd_output=`ldd conftest`
    		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    		    case " $predeps $postdeps " in
    		    *" $i "*)
    		      newdeplibs="$newdeplibs $i"
    		      i=""
    		      ;;
    		    esac
    		  fi
    		  if test -n "$i" ; then
    		    libname=`eval \\$echo \"$libname_spec\"`
    		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
    		    set dummy $deplib_matches
    		    deplib_match=$2
    		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
    		      newdeplibs="$newdeplibs $i"
    		    else
    		      droppeddeps=yes
    		      $echo
    		      $echo "*** Warning: dynamic linker does not accept needed library $i."
    		      $echo "*** I have the capability to make that library automatically link in when"
    		      $echo "*** you link to this library.  But I can only do this if you have a"
    		      $echo "*** shared version of the library, which you do not appear to have"
    		      $echo "*** because a test_compile did reveal that the linker did not use this one"
    		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
    		    fi
    		  fi
    		else
    		  droppeddeps=yes
    		  $echo
    		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
    
    		  $echo "***  make it link in!  You will probably need to install it or some"
    
    		  $echo "*** library that it depends on before this library will be fully"
    		  $echo "*** functional.  Installing it before continuing would be even better."
    		fi
    	      else
    		newdeplibs="$newdeplibs $i"
    	      fi
    	    done
    	  fi
    	  ;;
    	file_magic*)
    	  set dummy $deplibs_check_method
    	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
    	  for a_deplib in $deplibs; do
    
    	    name="`expr $a_deplib : '-l\(.*\)'`"
    
    	    # If $name is empty we are operating on a -L argument.
                if test "$name" != "" && test  "$name" != "0"; then
    	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    		case " $predeps $postdeps " in
    		*" $a_deplib "*)
    		  newdeplibs="$newdeplibs $a_deplib"
    		  a_deplib=""
    		  ;;
    		esac
    	      fi
    	      if test -n "$a_deplib" ; then
    		libname=`eval \\$echo \"$libname_spec\"`
    		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    		  for potent_lib in $potential_libs; do
    		      # Follow soft links.
    		      if ls -lLd "$potent_lib" 2>/dev/null \
    			 | grep " -> " >/dev/null; then
    			continue
    		      fi
    		      # The statement above tries to avoid entering an
    		      # endless loop below, in case of cyclic links.
    		      # We might still enter an endless loop, since a link
    		      # loop can be closed while we follow links,
    		      # but so what?
    		      potlib="$potent_lib"
    		      while test -h "$potlib" 2>/dev/null; do
    			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
    			case $potliblink in
    			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
    			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
    			esac
    		      done
    		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
    			 | ${SED} 10q \
    			 | $EGREP "$file_magic_regex" > /dev/null; then
    			newdeplibs="$newdeplibs $a_deplib"
    			a_deplib=""
    			break 2
    		      fi
    		  done
    		done
    	      fi
    	      if test -n "$a_deplib" ; then
    		droppeddeps=yes
    		$echo
    		$echo "*** Warning: linker path does not have real file for library $a_deplib."
    		$echo "*** I have the capability to make that library automatically link in when"
    		$echo "*** you link to this library.  But I can only do this if you have a"
    		$echo "*** shared version of the library, which you do not appear to have"
    		$echo "*** because I did check the linker path looking for a file starting"
    		if test -z "$potlib" ; then
    		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
    		else
    		  $echo "*** with $libname and none of the candidates passed a file format test"
    		  $echo "*** using a file magic. Last file checked: $potlib"
    		fi
    	      fi
    
    	      # Add a -L argument.
    	      newdeplibs="$newdeplibs $a_deplib"
    
    	  done # Gone through all deplibs.
    	  ;;
    	match_pattern*)
    	  set dummy $deplibs_check_method
    	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
    	  for a_deplib in $deplibs; do
    
    	    name="`expr $a_deplib : '-l\(.*\)'`"
    
    	    # If $name is empty we are operating on a -L argument.
    	    if test -n "$name" && test "$name" != "0"; then
    	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    		case " $predeps $postdeps " in
    		*" $a_deplib "*)
    		  newdeplibs="$newdeplibs $a_deplib"
    		  a_deplib=""
    		  ;;
    		esac
    	      fi
    	      if test -n "$a_deplib" ; then
    		libname=`eval \\$echo \"$libname_spec\"`
    		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
    		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
    		  for potent_lib in $potential_libs; do
    		    potlib="$potent_lib" # see symlink-check above in file_magic test
    		    if eval $echo \"$potent_lib\" 2>/dev/null \
    		        | ${SED} 10q \
    		        | $EGREP "$match_pattern_regex" > /dev/null; then
    		      newdeplibs="$newdeplibs $a_deplib"
    		      a_deplib=""
    		      break 2
    		    fi
    		  done
    		done
    	      fi
    	      if test -n "$a_deplib" ; then
    		droppeddeps=yes
    		$echo
    		$echo "*** Warning: linker path does not have real file for library $a_deplib."
    		$echo "*** I have the capability to make that library automatically link in when"
    		$echo "*** you link to this library.  But I can only do this if you have a"
    		$echo "*** shared version of the library, which you do not appear to have"
    		$echo "*** because I did check the linker path looking for a file starting"
    		if test -z "$potlib" ; then
    		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
    		else
    		  $echo "*** with $libname and none of the candidates passed a file format test"
    		  $echo "*** using a regex pattern. Last file checked: $potlib"
    		fi
    	      fi
    	    else
    	      # Add a -L argument.
    	      newdeplibs="$newdeplibs $a_deplib"
    	    fi
    	  done # Gone through all deplibs.
    	  ;;
    	none | unknown | *)
    	  newdeplibs=""
    	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
    	    -e 's/ -[LR][^ ]*//g'`
    	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
    	    for i in $predeps $postdeps ; do
    	      # can't use Xsed below, because $i might contain '/'
    	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
    	    done
    	  fi
    	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
    	    | grep . >/dev/null; then
    	    $echo
    	    if test "X$deplibs_check_method" = "Xnone"; then
    	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
    	    else
    	      $echo "*** Warning: inter-library dependencies are not known to be supported."
    	    fi
    	    $echo "*** All declared inter-library dependencies are being dropped."
    	    droppeddeps=yes
    	  fi
    	  ;;
    	esac
    	versuffix=$versuffix_save
    	major=$major_save
    	release=$release_save
    	libname=$libname_save
    	name=$name_save
    
    	case $host in
    	*-*-rhapsody* | *-*-darwin1.[012])
    	  # On Rhapsody replace the C library is the System framework
    	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
    	  ;;
    	esac
    
    	if test "$droppeddeps" = yes; then
    	  if test "$module" = yes; then
    	    $echo
    	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
    	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
    	    $echo "*** a static module, that should work as long as the dlopening"
    	    $echo "*** application is linked with the -dlopen flag."
    	    if test -z "$global_symbol_pipe"; then
    	      $echo
    	      $echo "*** However, this would only work if libtool was able to extract symbol"
    	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
    	      $echo "*** not find such a program.  So, this module is probably useless."
    	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
    	    fi
    	    if test "$build_old_libs" = no; then
    	      oldlibs="$output_objdir/$libname.$libext"
    	      build_libtool_libs=module
    	      build_old_libs=yes
    	    else
    	      build_libtool_libs=no
    	    fi
    	  else
    	    $echo "*** The inter-library dependencies that have been dropped here will be"
    	    $echo "*** automatically added whenever a program is linked with this library"
    	    $echo "*** or is declared to -dlopen it."
    
    	    if test "$allow_undefined" = no; then
    	      $echo
    	      $echo "*** Since this library must not contain undefined symbols,"
    	      $echo "*** because either the platform does not support them or"
    	      $echo "*** it was explicitly requested with -no-undefined,"
    	      $echo "*** libtool will only create a static version of it."
    	      if test "$build_old_libs" = no; then
    		oldlibs="$output_objdir/$libname.$libext"
    		build_libtool_libs=module
    		build_old_libs=yes
    	      else
    		build_libtool_libs=no
    	      fi
    	    fi
    	  fi
    	fi
    	# Done checking deplibs!
    	deplibs=$newdeplibs
          fi
    
          # All the library-specific variables (install_libdir is set above).
          library_names=
          old_library=
          dlname=
    
          # Test again, we may have decided not to build it any more
          if test "$build_libtool_libs" = yes; then
    	if test "$hardcode_into_libs" = yes; then
    	  # Hardcode the library paths
    	  hardcode_libdirs=
    	  dep_rpath=
    	  rpath="$finalize_rpath"
    	  test "$mode" != relink && rpath="$compile_rpath$rpath"
    	  for libdir in $rpath; do
    	    if test -n "$hardcode_libdir_flag_spec"; then
    	      if test -n "$hardcode_libdir_separator"; then
    		if test -z "$hardcode_libdirs"; then
    		  hardcode_libdirs="$libdir"
    		else
    		  # Just accumulate the unique libdirs.
    		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
    		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
    		    ;;
    		  *)
    		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
    		    ;;
    		  esac
    		fi
    	      else
    		eval flag=\"$hardcode_libdir_flag_spec\"
    		dep_rpath="$dep_rpath $flag"
    	      fi
    	    elif test -n "$runpath_var"; then
    	      case "$perm_rpath " in
    	      *" $libdir "*) ;;
    	      *) perm_rpath="$perm_rpath $libdir" ;;
    	      esac
    	    fi
    	  done
    	  # Substitute the hardcoded libdirs into the rpath.
    	  if test -n "$hardcode_libdir_separator" &&
    	     test -n "$hardcode_libdirs"; then
    	    libdir="$hardcode_libdirs"
    	    if test -n "$hardcode_libdir_flag_spec_ld"; then
    	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
    	    else
    	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
    	    fi
    	  fi
    	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
    	    # We should set the runpath_var.
    	    rpath=
    	    for dir in $perm_rpath; do
    	      rpath="$rpath$dir:"
    	    done
    	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
    	  fi
    	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
    	fi
    
    	shlibpath="$finalize_shlibpath"
    	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
    	if test -n "$shlibpath"; then
    	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
    	fi
    
    	# Get the real and link names of the library.
    	eval shared_ext=\"$shrext_cmds\"
    	eval library_names=\"$library_names_spec\"
    	set dummy $library_names
    	realname="$2"
    	shift; shift
    
    	if test -n "$soname_spec"; then
    	  eval soname=\"$soname_spec\"
    	else
    	  soname="$realname"
    	fi
    	if test -z "$dlname"; then
    	  dlname=$soname
    	fi
    
    	lib="$output_objdir/$realname"
    	for link
    	do
    	  linknames="$linknames $link"
    	done
    
    	# Use standard objects if they are pic
    	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
    
    	# Prepare the list of exported symbols
    	if test -z "$export_symbols"; then
    	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
    	    $show "generating symbol list for \`$libname.la'"
    	    export_symbols="$output_objdir/$libname.exp"
    	    $run $rm $export_symbols
    	    cmds=$export_symbols_cmds
    	    save_ifs="$IFS"; IFS='~'
    	    for cmd in $cmds; do
    	      IFS="$save_ifs"
    	      eval cmd=\"$cmd\"
    	      if len=`expr "X$cmd" : ".*"` &&
    	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    	        $show "$cmd"
    	        $run eval "$cmd" || exit $?
    	        skipped_export=false
    	      else
    	        # The command line is too long to execute in one step.
    	        $show "using reloadable object file for export list..."
    	        skipped_export=:
    	      fi
    	    done
    	    IFS="$save_ifs"
    	    if test -n "$export_symbols_regex"; then
    	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
    	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
    	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
    	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
    	    fi
    	  fi
    	fi
    
    	if test -n "$export_symbols" && test -n "$include_expsyms"; then
    	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
    	fi
    
    	tmp_deplibs=
    	for test_deplib in $deplibs; do
    		case " $convenience " in
    		*" $test_deplib "*) ;;
    		*)
    			tmp_deplibs="$tmp_deplibs $test_deplib"
    			;;
    		esac
    	done
    	deplibs="$tmp_deplibs"
    
    	if test -n "$convenience"; then
    	  if test -n "$whole_archive_flag_spec"; then
    	    save_libobjs=$libobjs
    	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    	  else
    	    gentop="$output_objdir/${outputname}x"
    	    generated="$generated $gentop"
    
    	    func_extract_archives $gentop $convenience
    	    libobjs="$libobjs $func_extract_archives_result"
    	  fi
    	fi
    	
    	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
    	  eval flag=\"$thread_safe_flag_spec\"
    	  linker_flags="$linker_flags $flag"
    	fi
    
    	# Make a backup of the uninstalled library when relinking
    	if test "$mode" = relink; then
    	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
    	fi
    
    	# Do each of the archive commands.
    	if test "$module" = yes && test -n "$module_cmds" ; then
    	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
    	    eval test_cmds=\"$module_expsym_cmds\"
    	    cmds=$module_expsym_cmds
    	  else
    	    eval test_cmds=\"$module_cmds\"
    	    cmds=$module_cmds
    	  fi
    	else
    	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    	  eval test_cmds=\"$archive_expsym_cmds\"
    	  cmds=$archive_expsym_cmds
    	else
    	  eval test_cmds=\"$archive_cmds\"
    	  cmds=$archive_cmds
    	  fi
    	fi
    
    	if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
    
    	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
    	  :
    	else
    	  # The command line is too long to link in one step, link piecewise.
    	  $echo "creating reloadable object files..."
    
    	  # Save the value of $output and $libobjs because we want to
    	  # use them later.  If we have whole_archive_flag_spec, we
    	  # want to use save_libobjs as it was before
    	  # whole_archive_flag_spec was expanded, because we can't
    	  # assume the linker understands whole_archive_flag_spec.
    	  # This may have to be revisited, in case too many
    	  # convenience libraries get linked in and end up exceeding
    	  # the spec.
    	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
    	    save_libobjs=$libobjs
    	  fi
    	  save_output=$output
    
    	  # Clear the reloadable object creation command queue and
    	  # initialize k to one.
    	  test_cmds=
    	  concat_cmds=
    	  objlist=
    	  delfiles=
    	  last_robj=
    	  k=1
    
    	  output=$output_objdir/$save_output-${k}.$objext
    
    	  # Loop over the list of objects to be linked.
    	  for obj in $save_libobjs
    	  do
    	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
    	    if test "X$objlist" = X ||
    
    	       { len=`expr "X$test_cmds" : ".*"` &&
    
    		 test "$len" -le "$max_cmd_len"; }; then
    	      objlist="$objlist $obj"
    	    else
    	      # The command $test_cmds is almost too long, add a
    	      # command to the queue.
    	      if test "$k" -eq 1 ; then
    		# The first file doesn't have a previous command to add.
    		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
    	      else
    		# All subsequent reloadable object files will link in
    		# the last one created.
    		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
    	      fi
    
    	      last_robj=$output_objdir/$save_output-${k}.$objext
    
    	      output=$output_objdir/$save_output-${k}.$objext
    
    	      objlist=$obj
    	      len=1
    	    fi
    	  done
    	  # Handle the remaining objects by creating one last
    	  # reloadable object file.  All subsequent reloadable object
    	  # files will link in the last one created.
    	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
    	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
    
    	  if ${skipped_export-false}; then
    	    $show "generating symbol list for \`$libname.la'"
    	    export_symbols="$output_objdir/$libname.exp"
    	    $run $rm $export_symbols
    	    libobjs=$output
    	    # Append the command to create the export file.
    	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
              fi
    
    
    	  # Set up a command to remove the reloadale object files
    
    	  # after they are used.
    	  i=0
    	  while test "$i" -lt "$k"
    	  do
    	    i=`expr $i + 1`
    
    	    delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
    
    	  $echo "creating a temporary reloadable object file: $output"
    
    	  # Loop through the commands generated above and execute them.
    	  save_ifs="$IFS"; IFS='~'
    	  for cmd in $concat_cmds; do
    	    IFS="$save_ifs"
    	    $show "$cmd"
    	    $run eval "$cmd" || exit $?
    	  done
    	  IFS="$save_ifs"
    
    	  libobjs=$output
    	  # Restore the value of output.
    	  output=$save_output
    
    	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
    	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
    	  fi
    	  # Expand the library linking commands again to reset the
    	  # value of $libobjs for piecewise linking.
    
    	  # Do each of the archive commands.
    	  if test "$module" = yes && test -n "$module_cmds" ; then
    	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
    	      cmds=$module_expsym_cmds
    	    else
    	      cmds=$module_cmds
    	    fi
    	  else
    	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
    	    cmds=$archive_expsym_cmds
    	  else
    	    cmds=$archive_cmds
    	    fi
    	  fi
    
    	  # Append the command to remove the reloadable object files
    	  # to the just-reset $cmds.
    	  eval cmds=\"\$cmds~\$rm $delfiles\"
    	fi
    	save_ifs="$IFS"; IFS='~'
    	for cmd in $cmds; do
    	  IFS="$save_ifs"
    	  eval cmd=\"$cmd\"
    	  $show "$cmd"
    
    	  $run eval "$cmd" || exit $?
    
    	# Restore the uninstalled library and exit
    	if test "$mode" = relink; then
    	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
    	  exit $EXIT_SUCCESS
    	fi
    
    	# Create links to the real library.
    	for linkname in $linknames; do
    	  if test "$realname" != "$linkname"; then
    	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"