Skip to content
Snippets Groups Projects
ltconfig 85 KiB
Newer Older
jason's avatar
jason committed
#! /bin/sh

# ltconfig - Create a system-specific libtool.
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
jason's avatar
jason committed
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
jason's avatar
jason committed
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
jason's avatar
jason committed
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.

# A lot of this script is taken from autoconf-2.10.

law's avatar
#  
law committed
# Check that we are running under the correct shell.
SHELL=${CONFIG_SHELL-/bin/sh}
echo=echo
if test "X$1" = X--no-reexec; then
law's avatar
#  
law committed
  # Discard the --no-reexec flag, and continue.
  shift
elif test "X$1" = X--fallback-echo; then
jason's avatar
jason committed
  # Avoid inline document here, it may be left over
  :
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  # Yippee, $echo works!
  :
else
law's avatar
#  
law committed
  # Restart under the correct shell.
  exec "$SHELL" "$0" --no-reexec ${1+"$@"}
fi

jason's avatar
jason committed
if test "X$1" = X--fallback-echo; then
  # used as fallback echo
  shift
  cat <<EOF
$*
EOF
  exit 0
fi

# Find the correct PATH separator.  Usually this is `:', but
# DJGPP uses `;' like DOS.
jason's avatar
jason committed
if test "X${PATH_SEPARATOR+set}" != Xset; then
  UNAME=${UNAME-`uname 2>/dev/null`}
  case X$UNAME in
    *-DOS) PATH_SEPARATOR=';' ;;
    *)     PATH_SEPARATOR=':' ;;
  esac
fi

law's avatar
#  
law committed
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
jason's avatar
jason committed
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
law's avatar
#  
law committed

jason's avatar
jason committed
if test "X${echo_test_string+set}" != Xset; then
  # find a string as large as possible, as long as the shell can cope with it
  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
       echo_test_string="`eval $cmd`" &&
       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
      break
    fi
  done
fi

bkoz's avatar
 
bkoz committed
if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
   test "X$echo_testing_string" = "X$echo_test_string"; then
  :
else
law's avatar
#  
law committed
  # The Solaris, AIX, and Digital Unix default echo programs unquote
  # backslashes.  This makes it impossible to quote backslashes using
  #   echo "$something" | sed 's/\\/\\\\/g'
  #
  # So, first we look for a working echo in the user's PATH.

  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
law's avatar
#  
law committed
  for dir in $PATH /usr/ucb; do
jason's avatar
jason committed
    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
bkoz's avatar
 
bkoz committed
       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
       test "X$echo_testing_string" = "X$echo_test_string"; then
law's avatar
#  
law committed
      echo="$dir/echo"
      break
    fi
  done
  IFS="$save_ifs"

  if test "X$echo" = Xecho; then
    # We didn't find a better echo, so look for alternatives.
    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
bkoz's avatar
 
bkoz committed
       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
       test "X$echo_testing_string" = "X$echo_test_string"; then
law's avatar
#  
law committed
      # This shell has a builtin print -r that does the trick.
      echo='print -r'
jason's avatar
jason committed
    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
	 test "X$CONFIG_SHELL" != X/bin/ksh; then
      # If we have ksh, try running ltconfig again with it.
      ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
      export ORIGINAL_CONFIG_SHELL
      CONFIG_SHELL=/bin/ksh
      export CONFIG_SHELL
      exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
law's avatar
#  
law committed
    else
      # Try using printf.
bkoz's avatar
 
bkoz committed
      echo='printf %s\n'
      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
bkoz's avatar
 
bkoz committed
	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
	 test "X$echo_testing_string" = "X$echo_test_string"; then
	# Cool, printf works
	:
bkoz's avatar
 
bkoz committed
      elif echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
	   test "X$echo_testing_string" = 'X\t' &&
	   echo_testing_string=`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
	   test "X$echo_testing_string" = "X$echo_test_string"; then
	CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
	export CONFIG_SHELL
	SHELL="$CONFIG_SHELL"
	export SHELL
	echo="$CONFIG_SHELL $0 --fallback-echo"
bkoz's avatar
 
bkoz committed
      elif echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null` &&
	   test "X$echo_testing_string" = 'X\t' &&
	   echo_testing_string=`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
	   test "X$echo_testing_string" = "X$echo_test_string"; then
	echo="$CONFIG_SHELL $0 --fallback-echo"
      else
	# maybe with a smaller string...
	prev=:

	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
	    break
	  fi
	  prev="$cmd"
	done

	if test "$prev" != 'sed 50q "$0"'; then
	  echo_test_string=`eval $prev`
bkoz's avatar
 
bkoz committed
	  
	  export echo_test_string
bkoz's avatar
 
bkoz committed
	  exec "${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}}" "$0" ${1+"$@"}
	else
	  # Oops.  We lost completely, so just stick with echo.
	  echo=echo
	fi
law's avatar
#  
law committed
      fi
    fi
  fi
fi

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='sed -e s/^X//'
sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'

# Same as above, but do not quote variable references.
double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'

# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'

jason's avatar
jason committed
# The name of this program.
law's avatar
#  
law committed
progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
jason's avatar
jason committed

# Constants:
PROGRAM=ltconfig
PACKAGE=libtool
aoliva's avatar
aoliva committed
VERSION=1.4a-GCC3.0
TIMESTAMP=" (1.641.2.256 2001/05/28 20:09:07 with GCC-local changes)"
jason's avatar
jason committed
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
jason's avatar
jason committed
rm="rm -f"

help="Try \`$progname --help' for more information."

# Global variables:
law's avatar
#  
law committed
default_ofile=libtool
jason's avatar
jason committed
can_build_shared=yes
enable_shared=yes
jason's avatar
jason committed
# All known linkers require a `.a' archive for static linking (except M$VC,
# which needs '.lib').
jason's avatar
jason committed
enable_static=yes
enable_fast_install=yes
enable_dlopen=unknown
jason's avatar
jason committed
enable_win32_dll=no
bkoz's avatar
 
bkoz committed
pic_mode=default
jason's avatar
jason committed
ltmain=
silent=
srcdir=
ac_config_guess=
ac_config_sub=
host=
bkoz's avatar
 
bkoz committed
build=NONE
nonopt=NONE
law's avatar
#  
law committed
ofile="$default_ofile"
jason's avatar
jason committed
verify_host=yes
bkoz's avatar
 
bkoz committed
tagname=
jason's avatar
jason committed
with_gcc=no
with_gnu_ld=no
need_locks=yes
ac_ext=c
jason's avatar
jason committed

bkoz's avatar
 
bkoz committed
## Dependencies to place before and after the object being linked:
predep_objects=
postdep_objects=
predeps=
postdeps=
compiler_lib_search_path=

## Link characteristics:
allow_undefined_flag=
no_undefined_flag=
need_lib_prefix=unknown
need_version=unknown
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
archive_cmds=
archive_expsym_cmds=
old_archive_from_new_cmds=
old_archive_from_expsyms_cmds=
striplib=
old_striplib=
export_dynamic_flag_spec=
whole_archive_flag_spec=
thread_safe_flag_spec=
hardcode_into_libs=no
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
runpath_var=
link_all_deplibs=unknown
always_export_symbols=no
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an egrep regular expression of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced.  Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
extract_expsyms_cmds=
bkoz's avatar
 
bkoz committed

## Tools:
jason's avatar
jason committed
old_AR="$AR"
bkoz's avatar
 
bkoz committed
old_AR_FLAGS="$AR_FLAGS"
jason's avatar
jason committed
old_CC="$CC"
old_CFLAGS="$CFLAGS"
old_CPPFLAGS="$CPPFLAGS"
jason's avatar
jason committed
old_LDFLAGS="$LDFLAGS"
bkoz's avatar
 
bkoz committed
old_LIBS="$LIBS"
jason's avatar
jason committed
old_LD="$LD"
old_LN_S="$LN_S"
bkoz's avatar
 
bkoz committed
old_LTCC="$LTCC"
law's avatar
#  
law committed
old_NM="$NM"
jason's avatar
jason committed
old_RANLIB="$RANLIB"
bkoz's avatar
 
bkoz committed
old_STRIP="$STRIP"
old_AS="$AS"
law's avatar
#  
law committed
old_DLLTOOL="$DLLTOOL"
jason's avatar
jason committed
old_OBJDUMP="$OBJDUMP"
bkoz's avatar
 
bkoz committed
old_OBJEXT="$OBJEXT"
old_EXEEXT="$EXEEXT"
old_reload_flag="$reload_flag"
old_deplibs_check_method="$deplibs_check_method"
old_file_magic_cmd="$file_magic_cmd"
jason's avatar
jason committed

# Parse the command line options.
args=
prev=
for option
do
jason's avatar
jason committed
  -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  # If the previous option needs an argument, assign it.
  if test -n "$prev"; then
    eval "$prev=\$option"
    prev=
    continue
  fi

jason's avatar
jason committed
  --help) cat <<EOM
bkoz's avatar
 
bkoz committed
Usage: $progname [OPTION]... LTMAIN [HOST]
jason's avatar
jason committed

Generate a system-specific libtool script.

bkoz's avatar
 
bkoz committed
    --build                configure for building on BUILD [BUILD=HOST]
law's avatar
#  
law committed
    --debug                enable verbose shell tracing
jason's avatar
jason committed
    --disable-shared       do not build shared libraries
    --disable-static       do not build static libraries
    --disable-fast-install do not optimize for fast installation
    --enable-dlopen        enable dlopen support
jason's avatar
jason committed
    --enable-win32-dll     enable building dlls on win32 hosts
jason's avatar
jason committed
    --help                 display this help and exit
    --no-verify            do not verify that HOST is a valid host type
law's avatar
#  
law committed
-o, --output=FILE          specify the output file [default=$default_ofile]
jason's avatar
jason committed
    --quiet                same as \`--silent'
law's avatar
#  
law committed
    --silent               do not print informational messages
jason's avatar
jason committed
    --srcdir=DIR           find \`config.guess' in DIR
    --version              output version information and exit
bkoz's avatar
 
bkoz committed
    --add-tag=TAG          append an alternate configuration
jason's avatar
jason committed
    --with-gcc             assume that the GNU C compiler will be used
    --with-gnu-ld          assume that the C compiler uses the GNU linker
bkoz's avatar
 
bkoz committed
    --prefer-pic           try to use only PIC objects
    --prefer-non-pic       try to use only non-PIC objects
    --disable-lock         disable file locking
    --cache-file=FILE      configure cache file
jason's avatar
jason committed

LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
that provides basic libtool functionality.
jason's avatar
jason committed

HOST is the canonical host system name [default=guessed].
EOM
  exit 0
  ;;

bkoz's avatar
 
bkoz committed
  --build) prev=build ;;
  --build=*) build="$optarg" ;;

law's avatar
#  
law committed
  --debug)
    echo "$progname: enabling shell trace mode"
    set -x
    ;;

jason's avatar
jason committed
  --disable-shared) enable_shared=no ;;

  --disable-static) enable_static=no ;;

  --disable-fast-install) enable_fast_install=no ;;

  --enable-dlopen) enable_dlopen=yes ;;

jason's avatar
jason committed
  --enable-win32-dll) enable_win32_dll=yes ;;

jason's avatar
jason committed
  --quiet | --silent) silent=yes ;;

  --srcdir) prev=srcdir ;;
  --srcdir=*) srcdir="$optarg" ;;

  --no-verify) verify_host=no ;;

law's avatar
#  
law committed
  --output | -o) prev=ofile ;;
  --output=*) ofile="$optarg" ;;

  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
jason's avatar
jason committed

bkoz's avatar
 
bkoz committed
  --add-tag) prev=tagname ;;
  --add-tag=*) tagname="$optarg" ;;

jason's avatar
jason committed
  --with-gcc) with_gcc=yes ;;
  --with-gnu-ld) with_gnu_ld=yes ;;

bkoz's avatar
 
bkoz committed
  --prefer-pic) pic_mode=yes ;;
  --prefer-non-pic) pic_mode=no ;;

  --disable-lock) need_locks=no ;;

  --cache-file=*) cache_file="$optarg" ;;

jason's avatar
jason committed
  -*)
    echo "$progname: unrecognized option \`$option'" 1>&2
    echo "$help" 1>&2
    exit 1
    ;;

  *)
    if test -z "$ltmain"; then
      ltmain="$option"
    elif test -z "$host"; then
law's avatar
#  
law committed
# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
jason's avatar
jason committed
#      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
#        echo "$progname: warning \`$option' is not a valid host type" 1>&2
#      fi
      host="$option"
    else
      echo "$progname: too many arguments" 1>&2
      echo "$help" 1>&2
      exit 1
    fi ;;
  esac
done

if test -z "$ltmain"; then
  echo "$progname: you must specify a LTMAIN file" 1>&2
  echo "$help" 1>&2
  exit 1
fi

if test ! -f "$ltmain"; then
law's avatar
#  
law committed
  echo "$progname: \`$ltmain' does not exist" 1>&2
  echo "$help" 1>&2
  exit 1
jason's avatar
jason committed
fi

bkoz's avatar
 
bkoz committed
if test -n "$tagname"; then
  # Check whether tagname contains only valid characters
  case `$echo "X$tagname" | $Xsed -e 's/[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]//g'` in
bkoz's avatar
 
bkoz committed
    echo "$progname: invalid tag name: $tagname" 1>&2
    exit 1
    ;;
  esac

  if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$ofile" > /dev/null; then
    echo "$progname: tag name $tagname already exists" 1>&2
    exit 1
  fi

  if test ! -f "$ofile"; then
    echo "$progname: warning: output file \`$ofile' does not exist" 1>&2
  fi

  if test -z "$LTCC"; then
    eval "`$SHELL $ofile --config | grep '^LTCC='`"
    if test -z "$LTCC"; then
      echo "$progname: warning: output file \`$ofile' does not look like a libtool script" 1>&2
    else
      echo "$progname: warning: using \`LTCC=$LTCC', extracted from \`$ofile'" 1>&2
    fi
  fi
fi

jason's avatar
jason committed
# Quote any args containing shell metacharacters.
ltconfig_args=
for arg
do
jason's avatar
jason committed
  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  ltconfig_args="$ltconfig_args '$arg'" ;;
  *) ltconfig_args="$ltconfig_args $arg" ;;
  esac
done

# A relevant subset of AC_INIT.

# File descriptor usage:
# 0 standard input
# 1 file creation
# 2 errors and warnings
# 3 some systems may open it to /dev/tty
# 4 used on the Kubota Titan
# 5 compiler messages saved in config.log
# 6 checking for... messages and results
if test "$silent" = yes; then
  exec 6>/dev/null
else
  exec 6>&1
fi
exec 5>>./config.log

# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
jason's avatar
jason committed
if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi
if test "X${LANG+set}"   = Xset; then LANG=C;   export LANG;   fi
jason's avatar
jason committed

if test -n "$cache_file" && test -r "$cache_file" && test -f "$cache_file"; then
  echo "loading cache $cache_file within ltconfig"
  . $cache_file
fi

jason's avatar
jason committed
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
    ac_n= ac_c='
' ac_t='	'
  else
    ac_n=-n ac_c= ac_t=
  fi
else
  ac_n= ac_c='\c' ac_t=
fi

if test -z "$srcdir"; then
  # Assume the source directory is the same one as the path to LTMAIN.
  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
jason's avatar
jason committed
  test "$srcdir" = "$ltmain" && srcdir=.
fi

law's avatar
#  
law committed
trap "$rm conftest*; exit 1" 1 2 15
jason's avatar
jason committed
if test "$verify_host" = yes; then
  # Check for config.guess and config.sub.
  ac_aux_dir=
  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
    if test -f $ac_dir/config.guess; then
      ac_aux_dir=$ac_dir
      break
    fi
  done
  if test -z "$ac_aux_dir"; then
    echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
    echo "$help" 1>&2
    exit 1
  fi
  ac_config_guess=$ac_aux_dir/config.guess
  ac_config_sub=$ac_aux_dir/config.sub

  # Make sure we can run config.sub.
  if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
jason's avatar
jason committed
  else
    echo "$progname: cannot run $ac_config_sub" 1>&2
    echo "$help" 1>&2
    exit 1
  fi

  echo $ac_n "checking host system type""... $ac_c" 1>&6

  host_alias=$host
jason's avatar
jason committed
  "")
bkoz's avatar
 
bkoz committed
    # Force config.guess to use the C compiler.
    # CC_FOR_BUILD overrides the CC variable in config.guess but I had
    # problems with it so do it this way for now.
    CC="$LTCC"

    if host_alias=`$SHELL $ac_config_guess`; then :
jason's avatar
jason committed
    else
      echo "$progname: cannot guess host type; you must specify one" 1>&2
      echo "$help" 1>&2
      exit 1
bkoz's avatar
 
bkoz committed
    fi

    # Restore the C compiler.
    CC="$old_CC"
    ;;
jason's avatar
jason committed
  esac
  host=`$SHELL $ac_config_sub $host_alias`
law's avatar
#  
law committed
  echo "$ac_t$host" 1>&6

  # Make sure the host verified.
  test -z "$host" && exit 1
jason's avatar
jason committed

bkoz's avatar
 
bkoz committed
  # Check for the build system type
  echo $ac_n "checking build system type... $ac_c" 1>&6

  build_alias=$build
bkoz's avatar
 
bkoz committed
  NONE)
    case $nonopt in
    NONE) build_alias=$host_alias ;;
    *) build_alias=$nonopt ;;
    esac ;;
  esac

  build=`$SHELL $ac_config_sub $build_alias`
  build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
  build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
  echo "$ac_t""$build" 1>&6

jason's avatar
jason committed
elif test -z "$host"; then
  echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
  echo "$help" 1>&2
  exit 1
else
  host_alias=$host
bkoz's avatar
 
bkoz committed
  build_alias=$host_alias
  build=$host
fi

if test x"$host" != x"$build"; then
  ac_tool_prefix=${host_alias}-
else
  ac_tool_prefix=
jason's avatar
jason committed
fi

bkoz's avatar
 
bkoz committed
host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`

law's avatar
#  
law committed
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
law's avatar
#  
law committed
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
jason's avatar
jason committed
esac

law's avatar
#  
law committed
aix3*)
  # AIX sometimes has problems with the GCC collect2 program.  For some
  # reason, if we set the COLLECT_NAMES environment variable, the problems
  # vanish in a puff of smoke.
jason's avatar
jason committed
  if test "X${COLLECT_NAMES+set}" != Xset; then
law's avatar
#  
law committed
    COLLECT_NAMES=
    export COLLECT_NAMES
  fi
  ;;
esac

jason's avatar
jason committed
# Determine commands to create old-style static archives.
bkoz's avatar
 
bkoz committed
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
jason's avatar
jason committed
old_postinstall_cmds='chmod 644 $oldlib'
law's avatar
#  
law committed
old_postuninstall_cmds=

if test -n "$RANLIB"; then
  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
fi

bkoz's avatar
 
bkoz committed
# Source the script associated with the $tagname tag configuration.
if test -n "$tagname"; then
  . $ltmain
else
  # FIXME:  We should use a variable here
  # Configure for a C compiler
  . $srcdir/ltcf-c.sh
jason's avatar
jason committed
fi

bkoz's avatar
 
bkoz committed
# Set sane defaults for various variables
test -z "$AR" && AR=ar
test -z "$AR_FLAGS" && AR_FLAGS=cru
test -z "$AS" && AS=as
test -z "$CC" && CC=cc
law's avatar
#  
law committed
test -z "$DLLTOOL" && DLLTOOL=dlltool
test -z "$MAGIC_CMD" && MAGIC_CMD=file
bkoz's avatar
 
bkoz committed
test -z "$LD" && LD=ld
test -z "$LN_S" && LN_S="ln -s"
test -z "$NM" && NM=nm
jason's avatar
jason committed
test -z "$OBJDUMP" && OBJDUMP=objdump
bkoz's avatar
 
bkoz committed
test -z "$RANLIB" && RANLIB=:
test -z "$STRIP" && STRIP=:
test -z "$objext" && objext=o
jason's avatar
jason committed

bkoz's avatar
 
bkoz committed
echo $ac_n "checking for objdir... $ac_c" 1>&6
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
  objdir=.libs
else
  # MS-DOS does not allow filenames that begin with a dot.
  objdir=_libs
jason's avatar
jason committed
fi
bkoz's avatar
 
bkoz committed
rmdir .libs 2>/dev/null
echo "$ac_t$objdir" 1>&6

# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
jason's avatar
jason committed

# Allow CC to be a program name with arguments.
set dummy $CC
compiler="$2"

bkoz's avatar
 
bkoz committed
# We assume here that the value for ac_cv_prog_cc_pic will not be cached
# in isolation, and that seeing it set (from the cache) indicates that
# the associated values are set (in the cache) correctly too.
echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
echo "$progname:678:checking for $compiler option to produce PIC" 1>&5
bkoz's avatar
 
bkoz committed
if test -z "$ac_cv_prog_cc_pic"; then
  echo "$ac_t"none 1>&6
jason's avatar
jason committed
else
bkoz's avatar
 
bkoz committed
  echo "$ac_t""$ac_cv_prog_cc_pic" 1>&6

  # Check to make sure the pic_flag actually works.
  echo $ac_n "checking if $compiler PIC flag $ac_cv_prog_cc_pic works... $ac_c" 1>&6
  echo "$progname:687:checking that $compiler PIC flag $ac_cv_prog_cc_pic works." 1>&5
bkoz's avatar
 
bkoz committed
  if test "X${ac_cv_prog_cc_pic_works+set}" = Xset && \
     test "X${ac_cv_prog_cc_pic_works}" != X; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    ac_cv_prog_cc_pic_works=yes
jason's avatar
jason committed
    $rm conftest*
bkoz's avatar
 
bkoz committed
    echo $lt_simple_compile_test_code > conftest.$ac_ext
    save_CFLAGS="$CFLAGS"
    CFLAGS="$CFLAGS $ac_cv_prog_cc_pic -DPIC"
    if { (eval echo $progname:697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
jason's avatar
jason committed
      # Append any warnings to the config.log.
      cat conftest.err 1>&5

bkoz's avatar
 
bkoz committed
      hpux9* | hpux10* | hpux11*)
	# On HP-UX, both CC and GCC only warn that PIC is supported... then
	# they create non-PIC objects.  So, if there were any warnings, we
	# assume that PIC is not supported.
	if test -s conftest.err; then
	  ac_cv_prog_cc_pic_works=no
	  ac_cv_prog_cc_can_build_shared=no
	  ac_cv_prog_cc_pic=
	else
	  ac_cv_prog_cc_pic_works=yes
	  ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
	fi
	;;
      *)
	ac_cv_prog_cc_pic_works=yes
	ac_cv_prog_cc_pic=" $ac_cv_prog_cc_pic"
	;;
      esac
jason's avatar
jason committed
    else
bkoz's avatar
 
bkoz committed
      # Append any errors to the config.log.
jason's avatar
jason committed
      cat conftest.err 1>&5
bkoz's avatar
 
bkoz committed
      ac_cv_prog_cc_pic_works=no
      ac_cv_prog_cc_can_build_shared=no
      ac_cv_prog_cc_pic=
jason's avatar
jason committed
    fi
bkoz's avatar
 
bkoz committed
    CFLAGS="$save_CFLAGS"
jason's avatar
jason committed
    $rm conftest*
bkoz's avatar
 
bkoz committed
  fi
  # Belt *and* braces to stop my trousers falling down:
  if test "X$ac_cv_prog_cc_pic_works" = Xno; then
    ac_cv_prog_cc_pic=
    ac_cv_prog_cc_can_build_shared=no
  fi
  echo "$ac_t""$ac_cv_prog_cc_pic_works" 1>&6
jason's avatar
jason committed
fi
law's avatar
#  
law committed

bkoz's avatar
 
bkoz committed
# Check for any special shared library compilation flags.
if test -n "$ac_cv_prog_cc_shlib"; then
  echo "$progname: warning: \`$CC' requires \`$ac_cv_prog_cc_shlib' to build shared libraries" 1>&2
  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$ac_cv_prog_cc_shlib[ 	]" >/dev/null; then :
  else
    echo "$progname: add \`$ac_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2
    ac_cv_prog_cc_can_build_shared=no
  fi
jason's avatar
jason committed
fi

bkoz's avatar
 
bkoz committed
echo $ac_n "checking if $compiler static flag $ac_cv_prog_cc_static works... $ac_c" 1>&6
echo "$progname:749: checking if $compiler static flag $ac_cv_prog_cc_static works" >&5
bkoz's avatar
 
bkoz committed
if test "X${ac_cv_prog_cc_static_works+set}" = Xset && \
   test "X${ac_cv_prog_cc_static_works}" != X; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
law's avatar
#  
law committed
  $rm conftest*
bkoz's avatar
 
bkoz committed
  echo $lt_simple_link_test_code > conftest.$ac_ext
  save_LDFLAGS="$LDFLAGS"
  LDFLAGS="$LDFLAGS $ac_cv_prog_cc_static"
  if { (eval echo $progname:758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
bkoz's avatar
 
bkoz committed
    ac_cv_prog_cc_static_works=yes
bkoz's avatar
 
bkoz committed
    ac_cv_prog_cc_static_works=no
    ac_cv_prog_cc_static=
bkoz's avatar
 
bkoz committed
  LDFLAGS="$save_LDFLAGS"
bkoz's avatar
 
bkoz committed
# Belt *and* braces to stop my trousers falling down:
if test "X$ac_cv_prog_cc_static_works" = Xno; then
  ac_cv_prog_cc_static=
fi
echo "$ac_t""$ac_cv_prog_cc_static_works" 1>&6
pic_flag="$ac_cv_prog_cc_pic"
special_shlib_compile_flags="$ac_cv_prog_cc_shlib"
wl="$ac_cv_prog_cc_wl"
link_static_flag="$ac_cv_prog_cc_static"
no_builtin_flag="$ac_cv_prog_cc_no_builtin"
can_build_shared="$ac_cv_prog_cc_can_build_shared"
law's avatar
#  
law committed

# find the maximum length of command line arguments
echo "$progname:780: finding the maximum length of command line arguments" 1>&5
echo $ac_n "finding the maximum length of command line arguments... $ac_c" 1>&6
if test "${lt_cv_sys_max_cmd_len+set}" = set; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  i=0
  testring="ABCD"
  # If test is not a shell built-in, we'll probably end up computing a
  # maximum length that is only half of the actual maximum length, but
  # we can't tell.
  while test "X"`$CONFIG_SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \
             = "XX$testring" &&
          new_result=`expr "X$testring" : ".*" 2>&1` &&
          lt_cv_sys_max_cmd_len=$new_result &&
aoliva's avatar
aoliva committed
          test $i != 17 # 1/2 MB should be enough
  do
    i=`expr $i + 1`
    testring=$testring$testring
  done
  testring=
  # add a significant safety factor because C++ compilers can tack on massive amounts
  # of additional arguments before passing them to the linker.  1/4 should be good.
  len=`expr $lt_cv_sys_max_cmd_len \/ 4`
  lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len - $len`
fi
echo "$progname:@lineno@: result: $lt_cv_sys_max_cmd_len" 1>&5
echo "${ac_t}$lt_cv_sys_max_cmd_len" 1>&6

if test -n $lt_cv_sys_max_cmd_len ; then
  max_cmd_len=$lt_cv_sys_max_cmd_len
else
  max_cmd_len=none
fi

# Check to see if options -o and -c are simultaneously supported by compiler
bkoz's avatar
 
bkoz committed
echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6
if test "${lt_cv_compiler_c_o+set}" = set; then
  echo $ac_n "(cached) $ac_c" 1>&6
  $rm -r conftest 2>/dev/null
  mkdir conftest
  cd conftest
  $rm conftest*
  echo $lt_simple_compile_test_code > conftest.$ac_ext
  mkdir out
  # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  # that will create temporary files in the current directory regardless of
  # the output directory.  Thus, making CWD read-only will cause this test
  # to fail, enabling locking or at least warning the user not to do parallel
  # builds.
  chmod -w .
  save_CFLAGS="$CFLAGS"
  CFLAGS="$CFLAGS -o out/conftest2.$objext"
  echo "$progname:833: checking if $compiler supports -c -o file.$objext" >&5
  if { (eval echo $progname:834: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then

    # The compiler can only warn and ignore the option if not recognized
    # So say no if there are warnings
      if test -s out/conftest.err; then
        lt_cv_compiler_c_o=no
      else
        lt_cv_compiler_c_o=yes
      fi
  else
    # Append any errors to the config.log.
    cat out/conftest.err 1>&5
    lt_cv_compiler_c_o=no
  fi
  CFLAGS="$save_CFLAGS"
  chmod u+w .
  $rm conftest* out/*
  rmdir out
  cd ..
  rmdir conftest
  $rm -r conftest 2>/dev/null
fi
compiler_c_o=$lt_cv_compiler_c_o
echo "${ac_t}$compiler_c_o" 1>&6

# Check to see if we can do hard links to lock some files if needed
hard_links="nottested"
if test "$compiler_c_o" = no && test "$need_locks" != no; then
  # do not overwrite the value of need_locks provided by the user
  echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
  hard_links=yes
  $rm conftest*
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  touch conftest.a
  ln conftest.a conftest.b 2>&5 || hard_links=no
  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  echo "$ac_t$hard_links" 1>&6
  $rm conftest*
  if test "$hard_links" = no; then
    echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
    need_locks=warn
  fi
else
  need_locks=no
fi

if test "$with_gcc" = yes; then
  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
  $rm conftest*
bkoz's avatar
 
bkoz committed
  echo $lt_simple_compile_test_code > conftest.$ac_ext
  save_CFLAGS="$CFLAGS"
bkoz's avatar
 
bkoz committed
  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
  echo "$progname:887: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  if { (eval echo $progname:888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then

    # The compiler can only warn and ignore the option if not recognized
    # So say no if there are warnings
      if test -s conftest.err; then
	echo "$ac_t"no 1>&6
	compiler_rtti_exceptions=no
      else
	echo "$ac_t"yes 1>&6
	compiler_rtti_exceptions=yes
      fi
  else
    # Append any errors to the config.log.
    cat conftest.err 1>&5
    compiler_rtti_exceptions=no
    echo "$ac_t"no 1>&6
  fi
  CFLAGS="$save_CFLAGS"
  $rm conftest*

  if test "$compiler_rtti_exceptions" = "yes"; then
    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  else
    no_builtin_flag=' -fno-builtin'
  fi
  
jason's avatar
jason committed
fi

bkoz's avatar
 
bkoz committed
# See if the linker supports building shared libraries.
echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
jason's avatar
jason committed

bkoz's avatar
 
bkoz committed
echo "$ac_t$ld_shlibs" 1>&6
test "$ld_shlibs" = no && can_build_shared=no
jason's avatar
jason committed

# Check hardcoding attributes.
echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" || \
law's avatar
#  
law committed
   test -n "$runpath_var"; then
jason's avatar
jason committed

  # We can hardcode non-existant directories.
jason's avatar
jason committed
  if test "$hardcode_direct" != no &&
     # If the only mechanism to avoid hardcoding is shlibpath_var, we
     # have to relink, otherwise we might link with an installed library
     # when we should be linking with a yet-to-be-installed one
     ## test "$hardcode_shlibpath_var" != no &&
     test "$hardcode_minus_L" != no; then
jason's avatar
jason committed
    # Linking always hardcodes the temporary library directory.
    hardcode_action=relink
  else
    # We can link without hardcoding, and we can hardcode nonexisting dirs.
    hardcode_action=immediate
  fi
else
law's avatar
#  
law committed
  # We cannot hardcode anything, or else we can only hardcode existing
  # directories.
  hardcode_action=unsupported
jason's avatar
jason committed
fi
law's avatar
#  
law committed
echo "$ac_t$hardcode_action" 1>&6
jason's avatar
jason committed

bkoz's avatar
 
bkoz committed
echo $ac_n "checking whether stripping libraries is possible... $ac_c" 1>&6
if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  echo "${ac_t}yes" 1>&6
else
  echo "${ac_t}no" 1>&6
fi
jason's avatar
jason committed

case $reload_flag in
"" | " "*) ;;
*) reload_flag=" $reload_flag" ;;
esac
jason's avatar
jason committed
reload_cmds='$LD$reload_flag -o $output$reload_objs'
bkoz's avatar
 
bkoz committed
test -z "$deplibs_check_method" && deplibs_check_method=unknown
jason's avatar
jason committed

# PORTME Fill in your ld.so characteristics
library_names_spec=
law's avatar
#  
law committed
libname_spec='lib$name'
jason's avatar
jason committed
soname_spec=
jason's avatar
jason committed
postinstall_cmds=
law's avatar
#  
law committed
postuninstall_cmds=
jason's avatar
jason committed
finish_cmds=
law's avatar
#  
law committed
finish_eval=
jason's avatar
jason committed
shlibpath_var=
shlibpath_overrides_runpath=unknown
jason's avatar
jason committed
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
bkoz's avatar
 
bkoz committed

jason's avatar
jason committed
echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
jason's avatar
jason committed
  version_type=linux
law's avatar
#  
law committed
  library_names_spec='${libname}${release}.so$versuffix $libname.a'
jason's avatar
jason committed
  shlibpath_var=LIBPATH

  # AIX 3 has no versioning support, so we append a major version to the name.
law's avatar
#  
law committed
  soname_spec='${libname}${release}.so$major'
  ;;

aix4* | aix5*)
  if test "$host_cpu" = ia64; then
    # AIX 5 supports IA64
    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
    shlibpath_var=LD_LIBRARY_PATH
  else
    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
    # soname into executable. Probably we can add versioning support to