PageRenderTime 228ms CodeModel.GetById 184ms app.highlight 33ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/sdcc-290-pre1/binutils-avr/ltconfig

#
Shell | 2048 lines | 1587 code | 188 blank | 273 comment | 198 complexity | b33ab01beba17a9741a4fb7ce45703c9 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1#! /bin/sh
   2
   3# ltconfig - Create a system-specific libtool.
   4# Copyright (C) 1996-1999 Free Software Foundation, Inc.
   5# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
   6#
   7# This file is free software; you can redistribute it and/or modify it
   8# under the terms of the GNU General Public License as published by
   9# the Free Software Foundation; either version 2 of the License, or
  10# (at your option) any later version.
  11#
  12# This program is distributed in the hope that it will be useful, but
  13# WITHOUT ANY WARRANTY; without even the implied warranty of
  14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15# General Public License for more details.
  16#
  17# You should have received a copy of the GNU General Public License
  18# along with this program; if not, write to the Free Software
  19# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20#
  21# As a special exception to the GNU General Public License, if you
  22# distribute this file as part of a program that contains a
  23# configuration script generated by Autoconf, you may include it under
  24# the same distribution terms that you use for the rest of that program.
  25
  26# A lot of this script is taken from autoconf-2.10.
  27
  28# Check that we are running under the correct shell.
  29SHELL=${CONFIG_SHELL-/bin/sh}
  30echo=echo
  31if test "X$1" = X--no-reexec; then
  32  # Discard the --no-reexec flag, and continue.
  33  shift
  34elif test "X$1" = X--fallback-echo; then
  35  # Avoid inline document here, it may be left over
  36  :
  37elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  38  # Yippee, $echo works!
  39  :
  40else
  41  # Restart under the correct shell.
  42  exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  43fi
  44
  45if test "X$1" = X--fallback-echo; then
  46  # used as fallback echo
  47  shift
  48  cat <<EOF
  49$*
  50EOF
  51  exit 0
  52fi
  53
  54# Find the correct PATH separator.  Usually this is `:', but
  55# DJGPP uses `;' like DOS.
  56if test "X${PATH_SEPARATOR+set}" != "Xset"; then
  57  UNAME=${UNAME-`uname 2>/dev/null`}
  58  case X$UNAME in
  59    *-DOS) PATH_SEPARATOR=';' ;;
  60    *)     PATH_SEPARATOR=':' ;;
  61  esac
  62fi
  63
  64# The HP-UX ksh and POSIX shell print the target directory to stdout
  65# if CDPATH is set.
  66if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  67
  68if test "X${echo_test_string+set}" != "Xset"; then
  69  # find a string as large as possible, as long as the shell can cope with it
  70  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
  71    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  72    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  73       echo_test_string="`eval $cmd`" &&
  74       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
  75      break
  76    fi
  77  done
  78fi
  79
  80if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
  81   test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
  82  # The Solaris, AIX, and Digital Unix default echo programs unquote
  83  # backslashes.  This makes it impossible to quote backslashes using
  84  #   echo "$something" | sed 's/\\/\\\\/g'
  85  #
  86  # So, first we look for a working echo in the user's PATH.
  87
  88  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  89  for dir in $PATH /usr/ucb; do
  90    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  91       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  92       test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  93      echo="$dir/echo"
  94      break
  95    fi
  96  done
  97  IFS="$save_ifs"
  98
  99  if test "X$echo" = Xecho; then
 100    # We didn't find a better echo, so look for alternatives.
 101    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
 102       test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
 103      # This shell has a builtin print -r that does the trick.
 104      echo='print -r'
 105    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
 106	 test "X$CONFIG_SHELL" != X/bin/ksh; then
 107      # If we have ksh, try running ltconfig again with it.
 108      ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
 109      export ORIGINAL_CONFIG_SHELL
 110      CONFIG_SHELL=/bin/ksh
 111      export CONFIG_SHELL
 112      exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
 113    else
 114      # Try using printf.
 115      echo='printf "%s\n"'
 116      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
 117	 test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
 118	# Cool, printf works
 119	:
 120      elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
 121	   test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
 122	CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
 123	export CONFIG_SHELL
 124	SHELL="$CONFIG_SHELL"
 125	export SHELL
 126	echo="$CONFIG_SHELL $0 --fallback-echo"
 127      elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
 128	   test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
 129	echo="$CONFIG_SHELL $0 --fallback-echo"
 130      else
 131	# maybe with a smaller string...
 132	prev=:
 133
 134	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
 135	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
 136	    break
 137	  fi
 138	  prev="$cmd"
 139	done
 140
 141	if test "$prev" != 'sed 50q "$0"'; then
 142	  echo_test_string=`eval $prev`
 143	  export echo_test_string
 144	  exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
 145	else
 146	  # Oops.  We lost completely, so just stick with echo.
 147	  echo=echo
 148	fi
 149      fi
 150    fi
 151  fi
 152fi
 153
 154# Sed substitution that helps us do robust quoting.  It backslashifies
 155# metacharacters that are still active within double-quoted strings.
 156Xsed='sed -e s/^X//'
 157sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
 158
 159# Same as above, but do not quote variable references.
 160double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
 161
 162# Sed substitution to delay expansion of an escaped shell variable in a
 163# double_quote_subst'ed string.
 164delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 165
 166# The name of this program.
 167progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
 168
 169# Constants:
 170PROGRAM=ltconfig
 171PACKAGE=libtool
 172VERSION=1.3.2
 173TIMESTAMP=" (1.385.2.150 1999/05/26 00:28:32)"
 174ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
 175ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
 176rm="rm -f"
 177
 178help="Try \`$progname --help' for more information."
 179
 180# Global variables:
 181default_ofile=libtool
 182can_build_shared=yes
 183enable_shared=yes
 184# All known linkers require a `.a' archive for static linking.
 185enable_static=yes
 186enable_fast_install=yes
 187enable_dlopen=unknown
 188enable_win32_dll=no
 189ltmain=
 190silent=
 191srcdir=
 192ac_config_guess=
 193ac_config_sub=
 194host=
 195nonopt=
 196ofile="$default_ofile"
 197verify_host=yes
 198with_gcc=no
 199with_gnu_ld=no
 200need_locks=yes
 201ac_ext=c
 202objext=o
 203libext=a
 204cache_file=
 205
 206old_AR="$AR"
 207old_CC="$CC"
 208old_CFLAGS="$CFLAGS"
 209old_CPPFLAGS="$CPPFLAGS"
 210old_LDFLAGS="$LDFLAGS"
 211old_LD="$LD"
 212old_LN_S="$LN_S"
 213old_LIBS="$LIBS"
 214old_NM="$NM"
 215old_RANLIB="$RANLIB"
 216old_DLLTOOL="$DLLTOOL"
 217old_OBJDUMP="$OBJDUMP"
 218old_AS="$AS"
 219
 220# Parse the command line options.
 221args=
 222prev=
 223for option
 224do
 225  case "$option" in
 226  -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
 227  *) optarg= ;;
 228  esac
 229
 230  # If the previous option needs an argument, assign it.
 231  if test -n "$prev"; then
 232    eval "$prev=\$option"
 233    prev=
 234    continue
 235  fi
 236
 237  case "$option" in
 238  --help) cat <<EOM
 239Usage: $progname [OPTION]... [HOST [LTMAIN]]
 240
 241Generate a system-specific libtool script.
 242
 243    --debug                enable verbose shell tracing
 244    --disable-shared       do not build shared libraries
 245    --disable-static       do not build static libraries
 246    --disable-fast-install do not optimize for fast installation
 247    --enable-dlopen        enable dlopen support
 248    --enable-win32-dll     enable building dlls on win32 hosts
 249    --help                 display this help and exit
 250    --no-verify            do not verify that HOST is a valid host type
 251-o, --output=FILE          specify the output file [default=$default_ofile]
 252    --quiet                same as \`--silent'
 253    --silent               do not print informational messages
 254    --srcdir=DIR           find \`config.guess' in DIR
 255    --version              output version information and exit
 256    --with-gcc             assume that the GNU C compiler will be used
 257    --with-gnu-ld          assume that the C compiler uses the GNU linker
 258    --disable-lock         disable file locking
 259    --cache-file=FILE      configure cache file
 260
 261LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
 262that provides basic libtool functionality.
 263
 264HOST is the canonical host system name [default=guessed].
 265EOM
 266  exit 0
 267  ;;
 268
 269  --debug)
 270    echo "$progname: enabling shell trace mode"
 271    set -x
 272    ;;
 273
 274  --disable-shared) enable_shared=no ;;
 275
 276  --disable-static) enable_static=no ;;
 277
 278  --disable-fast-install) enable_fast_install=no ;;
 279
 280  --enable-dlopen) enable_dlopen=yes ;;
 281
 282  --enable-win32-dll) enable_win32_dll=yes ;;
 283
 284  --quiet | --silent) silent=yes ;;
 285
 286  --srcdir) prev=srcdir ;;
 287  --srcdir=*) srcdir="$optarg" ;;
 288
 289  --no-verify) verify_host=no ;;
 290
 291  --output | -o) prev=ofile ;;
 292  --output=*) ofile="$optarg" ;;
 293
 294  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
 295
 296  --with-gcc) with_gcc=yes ;;
 297  --with-gnu-ld) with_gnu_ld=yes ;;
 298
 299  --disable-lock) need_locks=no ;;
 300
 301  --cache-file=*) cache_file="$optarg" ;;
 302
 303  -*)
 304    echo "$progname: unrecognized option \`$option'" 1>&2
 305    echo "$help" 1>&2
 306    exit 1
 307    ;;
 308
 309  *)
 310    if test -z "$ltmain"; then
 311      ltmain="$option"
 312    elif test -z "$host"; then
 313# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
 314#      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
 315#        echo "$progname: warning \`$option' is not a valid host type" 1>&2
 316#      fi
 317      host="$option"
 318    else
 319      echo "$progname: too many arguments" 1>&2
 320      echo "$help" 1>&2
 321      exit 1
 322    fi ;;
 323  esac
 324done
 325
 326if test -z "$ltmain"; then
 327  echo "$progname: you must specify a LTMAIN file" 1>&2
 328  echo "$help" 1>&2
 329  exit 1
 330fi
 331
 332if test ! -f "$ltmain"; then
 333  echo "$progname: \`$ltmain' does not exist" 1>&2
 334  echo "$help" 1>&2
 335  exit 1
 336fi
 337
 338# Quote any args containing shell metacharacters.
 339ltconfig_args=
 340for arg
 341do
 342  case "$arg" in
 343  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
 344  ltconfig_args="$ltconfig_args '$arg'" ;;
 345  *) ltconfig_args="$ltconfig_args $arg" ;;
 346  esac
 347done
 348
 349# A relevant subset of AC_INIT.
 350
 351# File descriptor usage:
 352# 0 standard input
 353# 1 file creation
 354# 2 errors and warnings
 355# 3 some systems may open it to /dev/tty
 356# 4 used on the Kubota Titan
 357# 5 compiler messages saved in config.log
 358# 6 checking for... messages and results
 359if test "$silent" = yes; then
 360  exec 6>/dev/null
 361else
 362  exec 6>&1
 363fi
 364exec 5>>./config.log
 365
 366# NLS nuisances.
 367# Only set LANG and LC_ALL to C if already set.
 368# These must not be set unconditionally because not all systems understand
 369# e.g. LANG=C (notably SCO).
 370if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
 371if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
 372
 373if test -n "$cache_file" && test -r "$cache_file"; then
 374  echo "loading cache $cache_file within ltconfig"
 375  . $cache_file
 376fi
 377
 378if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
 379  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
 380  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
 381    ac_n= ac_c='
 382' ac_t='	'
 383  else
 384    ac_n=-n ac_c= ac_t=
 385  fi
 386else
 387  ac_n= ac_c='\c' ac_t=
 388fi
 389
 390if test -z "$srcdir"; then
 391  # Assume the source directory is the same one as the path to LTMAIN.
 392  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
 393  test "$srcdir" = "$ltmain" && srcdir=.
 394fi
 395
 396trap "$rm conftest*; exit 1" 1 2 15
 397if test "$verify_host" = yes; then
 398  # Check for config.guess and config.sub.
 399  ac_aux_dir=
 400  for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
 401    if test -f $ac_dir/config.guess; then
 402      ac_aux_dir=$ac_dir
 403      break
 404    fi
 405  done
 406  if test -z "$ac_aux_dir"; then
 407    echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
 408    echo "$help" 1>&2
 409    exit 1
 410  fi
 411  ac_config_guess=$ac_aux_dir/config.guess
 412  ac_config_sub=$ac_aux_dir/config.sub
 413
 414  # Make sure we can run config.sub.
 415  if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
 416  else
 417    echo "$progname: cannot run $ac_config_sub" 1>&2
 418    echo "$help" 1>&2
 419    exit 1
 420  fi
 421
 422  echo $ac_n "checking host system type""... $ac_c" 1>&6
 423
 424  host_alias=$host
 425  case "$host_alias" in
 426  "")
 427    if host_alias=`$SHELL $ac_config_guess`; then :
 428    else
 429      echo "$progname: cannot guess host type; you must specify one" 1>&2
 430      echo "$help" 1>&2
 431      exit 1
 432    fi ;;
 433  esac
 434  host=`$SHELL $ac_config_sub $host_alias`
 435  echo "$ac_t$host" 1>&6
 436
 437  # Make sure the host verified.
 438  test -z "$host" && exit 1
 439
 440elif test -z "$host"; then
 441  echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
 442  echo "$help" 1>&2
 443  exit 1
 444else
 445  host_alias=$host
 446fi
 447
 448# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
 449case "$host_os" in
 450linux-gnu*) ;;
 451linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
 452esac
 453
 454host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 455host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 456host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 457
 458case "$host_os" in
 459aix3*)
 460  # AIX sometimes has problems with the GCC collect2 program.  For some
 461  # reason, if we set the COLLECT_NAMES environment variable, the problems
 462  # vanish in a puff of smoke.
 463  if test "${COLLECT_NAMES+set}" != set; then
 464    COLLECT_NAMES=
 465    export COLLECT_NAMES
 466  fi
 467  ;;
 468esac
 469
 470# Determine commands to create old-style static archives.
 471old_archive_cmds='$AR cru $oldlib$oldobjs'
 472old_postinstall_cmds='chmod 644 $oldlib'
 473old_postuninstall_cmds=
 474
 475# Set a sane default for `AR'.
 476test -z "$AR" && AR=ar
 477
 478# Set a sane default for `OBJDUMP'.
 479test -z "$OBJDUMP" && OBJDUMP=objdump
 480
 481# If RANLIB is not set, then run the test.
 482if test "${RANLIB+set}" != "set"; then
 483  result=no
 484
 485  echo $ac_n "checking for ranlib... $ac_c" 1>&6
 486  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
 487  for dir in $PATH; do
 488    test -z "$dir" && dir=.
 489    if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then
 490      RANLIB="ranlib"
 491      result="ranlib"
 492      break
 493    fi
 494  done
 495  IFS="$save_ifs"
 496
 497  echo "$ac_t$result" 1>&6
 498fi
 499
 500if test -n "$RANLIB"; then
 501  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 502  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
 503fi
 504
 505# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin.
 506test -z "$DLLTOOL" && DLLTOOL=dlltool
 507test -z "$OBJDUMP" && OBJDUMP=objdump
 508test -z "$AS" && AS=as
 509
 510# Check to see if we are using GCC.
 511if test "$with_gcc" != yes || test -z "$CC"; then
 512  # If CC is not set, then try to find GCC or a usable CC.
 513  if test -z "$CC"; then
 514    echo $ac_n "checking for gcc... $ac_c" 1>&6
 515    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
 516    for dir in $PATH; do
 517      test -z "$dir" && dir=.
 518      if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
 519	CC="gcc"
 520	break
 521      fi
 522    done
 523    IFS="$save_ifs"
 524
 525    if test -n "$CC"; then
 526      echo "$ac_t$CC" 1>&6
 527    else
 528      echo "$ac_t"no 1>&6
 529    fi
 530  fi
 531
 532  # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
 533  if test -z "$CC"; then
 534    echo $ac_n "checking for cc... $ac_c" 1>&6
 535    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
 536    cc_rejected=no
 537    for dir in $PATH; do
 538      test -z "$dir" && dir=.
 539      if test -f $dir/cc || test -f $dir/cc$ac_exeext; then
 540	if test "$dir/cc" = "/usr/ucb/cc"; then
 541	  cc_rejected=yes
 542	  continue
 543	fi
 544	CC="cc"
 545	break
 546      fi
 547    done
 548    IFS="$save_ifs"
 549    if test $cc_rejected = yes; then
 550      # We found a bogon in the path, so make sure we never use it.
 551      set dummy $CC
 552      shift
 553      if test $# -gt 0; then
 554	# We chose a different compiler from the bogus one.
 555	# However, it has the same name, so the bogon will be chosen
 556	# first if we set CC to just the name; use the full file name.
 557	shift
 558	set dummy "$dir/cc" "$@"
 559	shift
 560	CC="$@"
 561      fi
 562    fi
 563
 564    if test -n "$CC"; then
 565      echo "$ac_t$CC" 1>&6
 566    else
 567      echo "$ac_t"no 1>&6
 568    fi
 569
 570    if test -z "$CC"; then
 571      echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
 572      exit 1
 573    fi
 574  fi
 575
 576  # Now see if the compiler is really GCC.
 577  with_gcc=no
 578  echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
 579  echo "$progname:579: checking whether we are using GNU C" >&5
 580
 581  $rm conftest.c
 582  cat > conftest.c <<EOF
 583#ifdef __GNUC__
 584  yes;
 585#endif
 586EOF
 587  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:587: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
 588    with_gcc=yes
 589  fi
 590  $rm conftest.c
 591  echo "$ac_t$with_gcc" 1>&6
 592fi
 593
 594# Allow CC to be a program name with arguments.
 595set dummy $CC
 596compiler="$2"
 597
 598echo $ac_n "checking for object suffix... $ac_c" 1>&6
 599$rm conftest*
 600echo 'int i = 1;' > conftest.c
 601echo "$progname:601: checking for object suffix" >& 5
 602if { (eval echo $progname:602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
 603  # Append any warnings to the config.log.
 604  cat conftest.err 1>&5
 605
 606  for ac_file in conftest.*; do
 607    case $ac_file in
 608    *.c) ;;
 609    *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
 610    esac
 611  done
 612else
 613  cat conftest.err 1>&5
 614  echo "$progname: failed program was:" >&5
 615  cat conftest.c >&5
 616fi
 617$rm conftest*
 618echo "$ac_t$objext" 1>&6
 619
 620echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
 621pic_flag=
 622special_shlib_compile_flags=
 623wl=
 624link_static_flag=
 625no_builtin_flag=
 626
 627if test "$with_gcc" = yes; then
 628  wl='-Wl,'
 629  link_static_flag='-static'
 630
 631  case "$host_os" in
 632  beos* | irix5* | irix6* | osf3* | osf4*)
 633    # PIC is the default for these OSes.
 634    ;;
 635  aix*)
 636    # Below there is a dirty hack to force normal static linking with -ldl
 637    # The problem is because libdl dynamically linked with both libc and
 638    # libC (AIX C++ library), which obviously doesn't included in libraries
 639    # list by gcc. This cause undefined symbols with -static flags.
 640    # This hack allows C programs to be linked with "-static -ldl", but
 641    # we not sure about C++ programs.
 642    link_static_flag="$link_static_flag ${wl}-lC"
 643    ;;
 644  cygwin* | mingw* | os2*)
 645    # We can build DLLs from non-PIC.
 646    ;;
 647  amigaos*)
 648    # FIXME: we need at least 68020 code to build shared libraries, but
 649    # adding the `-m68020' flag to GCC prevents building anything better,
 650    # like `-m68040'.
 651    pic_flag='-m68020 -resident32 -malways-restore-a4'
 652    ;;
 653  sysv4*MP*)
 654    if test -d /usr/nec; then
 655       pic_flag=-Kconform_pic
 656    fi
 657    ;;
 658  *)
 659    pic_flag='-fPIC'
 660    ;;
 661  esac
 662else
 663  # PORTME Check for PIC flags for the system compiler.
 664  case "$host_os" in
 665  aix3* | aix4*)
 666    # All AIX code is PIC.
 667    link_static_flag='-bnso -bI:/lib/syscalls.exp'
 668    ;;
 669
 670  hpux9* | hpux10* | hpux11*)
 671    # Is there a better link_static_flag that works with the bundled CC?
 672    wl='-Wl,'
 673    link_static_flag="${wl}-a ${wl}archive"
 674    pic_flag='+Z'
 675    ;;
 676
 677  irix5* | irix6*)
 678    wl='-Wl,'
 679    link_static_flag='-non_shared'
 680    # PIC (with -KPIC) is the default.
 681    ;;
 682
 683  cygwin* | mingw* | os2*)
 684    # We can build DLLs from non-PIC.
 685    ;;
 686
 687  osf3* | osf4*)
 688    # All OSF/1 code is PIC.
 689    wl='-Wl,'
 690    link_static_flag='-non_shared'
 691    ;;
 692
 693  sco3.2v5*)
 694    pic_flag='-Kpic'
 695    link_static_flag='-dn'
 696    special_shlib_compile_flags='-belf'
 697    ;;
 698
 699  solaris*)
 700    pic_flag='-KPIC'
 701    link_static_flag='-Bstatic'
 702    wl='-Wl,'
 703    ;;
 704
 705  sunos4*)
 706    pic_flag='-PIC'
 707    link_static_flag='-Bstatic'
 708    wl='-Qoption ld '
 709    ;;
 710
 711  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
 712    pic_flag='-KPIC'
 713    link_static_flag='-Bstatic'
 714    wl='-Wl,'
 715    ;;
 716
 717  uts4*)
 718    pic_flag='-pic'
 719    link_static_flag='-Bstatic'
 720    ;;
 721  sysv4*MP*)
 722    if test -d /usr/nec ;then
 723      pic_flag='-Kconform_pic'
 724      link_static_flag='-Bstatic'
 725    fi
 726    ;;
 727  *)
 728    can_build_shared=no
 729    ;;
 730  esac
 731fi
 732
 733if test -n "$pic_flag"; then
 734  echo "$ac_t$pic_flag" 1>&6
 735
 736  # Check to make sure the pic_flag actually works.
 737  echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
 738  $rm conftest*
 739  echo "int some_variable = 0;" > conftest.c
 740  save_CFLAGS="$CFLAGS"
 741  CFLAGS="$CFLAGS $pic_flag -DPIC"
 742  echo "$progname:742: checking if $compiler PIC flag $pic_flag works" >&5
 743  if { (eval echo $progname:743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
 744    # Append any warnings to the config.log.
 745    cat conftest.err 1>&5
 746    
 747    case "$host_os" in
 748    hpux9* | hpux10* | hpux11*)
 749      # On HP-UX, both CC and GCC only warn that PIC is supported... then they
 750      # create non-PIC objects.  So, if there were any warnings, we assume that
 751      # PIC is not supported.
 752      if test -s conftest.err; then
 753	echo "$ac_t"no 1>&6
 754	can_build_shared=no
 755	pic_flag=
 756      else
 757	echo "$ac_t"yes 1>&6
 758	pic_flag=" $pic_flag"
 759      fi
 760      ;;
 761    *)
 762      echo "$ac_t"yes 1>&6
 763      pic_flag=" $pic_flag"
 764      ;;
 765    esac
 766  else
 767    # Append any errors to the config.log.
 768    cat conftest.err 1>&5
 769    can_build_shared=no
 770    pic_flag=
 771    echo "$ac_t"no 1>&6
 772  fi
 773  CFLAGS="$save_CFLAGS"
 774  $rm conftest*
 775else
 776  echo "$ac_t"none 1>&6
 777fi
 778
 779# Check to see if options -o and -c are simultaneously supported by compiler
 780echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
 781$rm -r conftest 2>/dev/null
 782mkdir conftest
 783cd conftest
 784$rm conftest*
 785echo "int some_variable = 0;" > conftest.c
 786mkdir out
 787# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
 788# that will create temporary files in the current directory regardless of
 789# the output directory.  Thus, making CWD read-only will cause this test
 790# to fail, enabling locking or at least warning the user not to do parallel
 791# builds.
 792chmod -w .
 793save_CFLAGS="$CFLAGS"
 794CFLAGS="$CFLAGS -o out/conftest2.o"
 795echo "$progname:795: checking if $compiler supports -c -o file.o" >&5
 796if { (eval echo $progname:796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then
 797
 798  # The compiler can only warn and ignore the option if not recognized
 799  # So say no if there are warnings
 800    if test -s out/conftest.err; then
 801      echo "$ac_t"no 1>&6
 802      compiler_c_o=no
 803    else
 804      echo "$ac_t"yes 1>&6
 805      compiler_c_o=yes
 806    fi
 807else
 808  # Append any errors to the config.log.
 809  cat out/conftest.err 1>&5
 810  compiler_c_o=no
 811  echo "$ac_t"no 1>&6
 812fi
 813CFLAGS="$save_CFLAGS"
 814chmod u+w .
 815$rm conftest* out/*
 816rmdir out
 817cd ..
 818rmdir conftest
 819$rm -r conftest 2>/dev/null
 820
 821if test x"$compiler_c_o" = x"yes"; then
 822  # Check to see if we can write to a .lo
 823  echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
 824  $rm conftest*
 825  echo "int some_variable = 0;" > conftest.c
 826  save_CFLAGS="$CFLAGS"
 827  CFLAGS="$CFLAGS -c -o conftest.lo"
 828  echo "$progname:828: checking if $compiler supports -c -o file.lo" >&5
 829if { (eval echo $progname:829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
 830
 831    # The compiler can only warn and ignore the option if not recognized
 832    # So say no if there are warnings
 833      if test -s conftest.err; then
 834	echo "$ac_t"no 1>&6
 835	compiler_o_lo=no
 836      else
 837	echo "$ac_t"yes 1>&6
 838	compiler_o_lo=yes
 839      fi
 840  else
 841    # Append any errors to the config.log.
 842    cat conftest.err 1>&5
 843    compiler_o_lo=no
 844    echo "$ac_t"no 1>&6
 845  fi
 846  CFLAGS="$save_CFLAGS"
 847  $rm conftest*
 848else
 849  compiler_o_lo=no
 850fi
 851
 852# Check to see if we can do hard links to lock some files if needed
 853hard_links="nottested"
 854if test "$compiler_c_o" = no && test "$need_locks" != no; then
 855  # do not overwrite the value of need_locks provided by the user
 856  echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
 857  hard_links=yes
 858  $rm conftest*
 859  ln conftest.a conftest.b 2>/dev/null && hard_links=no
 860  touch conftest.a
 861  ln conftest.a conftest.b 2>&5 || hard_links=no
 862  ln conftest.a conftest.b 2>/dev/null && hard_links=no
 863  echo "$ac_t$hard_links" 1>&6
 864  $rm conftest*
 865  if test "$hard_links" = no; then
 866    echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
 867    need_locks=warn
 868  fi
 869else
 870  need_locks=no
 871fi
 872
 873if test "$with_gcc" = yes; then
 874  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
 875  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
 876  $rm conftest*
 877  echo "int some_variable = 0;" > conftest.c
 878  save_CFLAGS="$CFLAGS"
 879  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
 880  echo "$progname:880: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
 881  if { (eval echo $progname:881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
 882
 883    # The compiler can only warn and ignore the option if not recognized
 884    # So say no if there are warnings
 885      if test -s conftest.err; then
 886	echo "$ac_t"no 1>&6
 887	compiler_rtti_exceptions=no
 888      else
 889	echo "$ac_t"yes 1>&6
 890	compiler_rtti_exceptions=yes
 891      fi
 892  else
 893    # Append any errors to the config.log.
 894    cat conftest.err 1>&5
 895    compiler_rtti_exceptions=no
 896    echo "$ac_t"no 1>&6
 897  fi
 898  CFLAGS="$save_CFLAGS"
 899  $rm conftest*
 900
 901  if test "$compiler_rtti_exceptions" = "yes"; then
 902    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
 903  else
 904    no_builtin_flag=' -fno-builtin'
 905  fi
 906  
 907fi
 908
 909# Check for any special shared library compilation flags.
 910if test -n "$special_shlib_compile_flags"; then
 911  echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
 912  if echo "$old_CC $old_CFLAGS " | egrep -e "[ 	]$special_shlib_compile_flags[ 	]" >/dev/null; then :
 913  else
 914    echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
 915    can_build_shared=no
 916  fi
 917fi
 918
 919echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
 920$rm conftest*
 921echo 'main(){return(0);}' > conftest.c
 922save_LDFLAGS="$LDFLAGS"
 923LDFLAGS="$LDFLAGS $link_static_flag"
 924echo "$progname:924: checking if $compiler static flag $link_static_flag works" >&5
 925if { (eval echo $progname:925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
 926  echo "$ac_t$link_static_flag" 1>&6
 927else
 928  echo "$ac_t"none 1>&6
 929  link_static_flag=
 930fi
 931LDFLAGS="$save_LDFLAGS"
 932$rm conftest*
 933
 934if test -z "$LN_S"; then
 935  # Check to see if we can use ln -s, or we need hard links.
 936  echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
 937  $rm conftest.dat
 938  if ln -s X conftest.dat 2>/dev/null; then
 939    $rm conftest.dat
 940    LN_S="ln -s"
 941  else
 942    LN_S=ln
 943  fi
 944  if test "$LN_S" = "ln -s"; then
 945    echo "$ac_t"yes 1>&6
 946  else
 947    echo "$ac_t"no 1>&6
 948  fi
 949fi
 950
 951# Make sure LD is an absolute path.
 952if test -z "$LD"; then
 953  ac_prog=ld
 954  if test "$with_gcc" = yes; then
 955    # Check if gcc -print-prog-name=ld gives a path.
 956    echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
 957    echo "$progname:957: checking for ld used by GCC" >&5
 958    ac_prog=`($CC -print-prog-name=ld) 2>&5`
 959    case "$ac_prog" in
 960    # Accept absolute paths.
 961    [\\/]* | [A-Za-z]:[\\/]*)
 962      re_direlt='/[^/][^/]*/\.\./'
 963      # Canonicalize the path of ld
 964      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 965      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 966	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 967      done
 968      test -z "$LD" && LD="$ac_prog"
 969      ;;
 970    "")
 971      # If it fails, then pretend we are not using GCC.
 972      ac_prog=ld
 973      ;;
 974    *)
 975      # If it is relative, then search for the first ld in PATH.
 976      with_gnu_ld=unknown
 977      ;;
 978    esac
 979  elif test "$with_gnu_ld" = yes; then
 980    echo $ac_n "checking for GNU ld... $ac_c" 1>&6
 981    echo "$progname:981: checking for GNU ld" >&5
 982  else
 983    echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
 984    echo "$progname:984: checking for non-GNU ld" >&5
 985  fi
 986
 987  if test -z "$LD"; then
 988    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
 989    for ac_dir in $PATH; do
 990      test -z "$ac_dir" && ac_dir=.
 991      if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 992	LD="$ac_dir/$ac_prog"
 993	# Check to see if the program is GNU ld.  I'd rather use --version,
 994	# but apparently some GNU ld's only accept -v.
 995	# Break only if it was the GNU/non-GNU ld that we prefer.
 996	if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 997	  test "$with_gnu_ld" != no && break
 998	else
 999	  test "$with_gnu_ld" != yes && break
1000	fi
1001      fi
1002    done
1003    IFS="$ac_save_ifs"
1004  fi
1005
1006  if test -n "$LD"; then
1007    echo "$ac_t$LD" 1>&6
1008  else
1009    echo "$ac_t"no 1>&6
1010  fi
1011
1012  if test -z "$LD"; then
1013    echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
1014    exit 1
1015  fi
1016fi
1017
1018# Check to see if it really is or is not GNU ld.
1019echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
1020# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1021if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1022  with_gnu_ld=yes
1023else
1024  with_gnu_ld=no
1025fi
1026echo "$ac_t$with_gnu_ld" 1>&6
1027
1028# See if the linker supports building shared libraries.
1029echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
1030
1031allow_undefined_flag=
1032no_undefined_flag=
1033need_lib_prefix=unknown
1034need_version=unknown
1035# when you set need_version to no, make sure it does not cause -set_version
1036# flags to be left without arguments
1037archive_cmds=
1038archive_expsym_cmds=
1039old_archive_from_new_cmds=
1040export_dynamic_flag_spec=
1041whole_archive_flag_spec=
1042thread_safe_flag_spec=
1043hardcode_libdir_flag_spec=
1044hardcode_libdir_separator=
1045hardcode_direct=no
1046hardcode_minus_L=no
1047hardcode_shlibpath_var=unsupported
1048runpath_var=
1049always_export_symbols=no
1050export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
1051# include_expsyms should be a list of space-separated symbols to be *always*
1052# included in the symbol list
1053include_expsyms=
1054# exclude_expsyms can be an egrep regular expression of symbols to exclude
1055# it will be wrapped by ` (' and `)$', so one must not match beginning or
1056# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
1057# as well as any symbol that contains `d'.
1058exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
1059# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
1060# platforms (ab)use it in PIC code, but their linkers get confused if
1061# the symbol is explicitly referenced.  Since portable code cannot
1062# rely on this symbol name, it's probably fine to never include it in
1063# preloaded symbol tables.
1064
1065case "$host_os" in
1066cygwin* | mingw*)
1067  # FIXME: the MSVC++ port hasn't been tested in a loooong time
1068  # When not using gcc, we currently assume that we are using
1069  # Microsoft Visual C++.
1070  if test "$with_gcc" != yes; then
1071    with_gnu_ld=no
1072  fi
1073  ;;
1074
1075esac
1076
1077ld_shlibs=yes
1078if test "$with_gnu_ld" = yes; then
1079  # If archive_cmds runs LD, not CC, wlarc should be empty
1080  wlarc='${wl}'
1081
1082  # See if GNU ld supports shared libraries.
1083  case "$host_os" in
1084  aix3* | aix4*)
1085    # On AIX, the GNU linker is very broken
1086    ld_shlibs=no
1087    cat <<EOF 1>&2
1088
1089*** Warning: the GNU linker, at least up to release 2.9.1, is reported
1090*** to be unable to reliably create shared libraries on AIX.
1091*** Therefore, libtool is disabling shared libraries support.  If you
1092*** really care for shared libraries, you may want to modify your PATH
1093*** so that a non-GNU linker is found, and then restart.
1094
1095EOF
1096    ;;
1097
1098  amigaos*)
1099    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
1100    hardcode_libdir_flag_spec='-L$libdir'
1101    hardcode_minus_L=yes
1102
1103    # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
1104    # that the semantics of dynamic libraries on AmigaOS, at least up
1105    # to version 4, is to share data among multiple programs linked
1106    # with the same dynamic library.  Since this doesn't match the
1107    # behavior of shared libraries on other platforms, we can use
1108    # them.
1109    ld_shlibs=no
1110    ;;
1111
1112  beos*)
1113    $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
1114    if test $? != 0; then
1115      $LD -V 2>&1 | egrep elf > /dev/null
1116    fi
1117    if test $? = 0; then
1118      allow_undefined_flag=unsupported
1119      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
1120      # support --undefined.  This deserves some investigation.  FIXME
1121      archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1122    else
1123      ld_shlibs=no
1124    fi
1125    ;;
1126
1127  cygwin* | mingw*)
1128    # hardcode_libdir_flag_spec is actually meaningless, as there is
1129    # no search path for DLLs.
1130    hardcode_libdir_flag_spec='-L$libdir'
1131    allow_undefined_flag=unsupported
1132    always_export_symbols=yes
1133
1134    # Extract the symbol export list from an `--export-all' def file,
1135    # then regenerate the def file from the symbol export list, so that
1136    # the compiled dll only exports the symbol export list.
1137    export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
1138      sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
1139      (cd $objdir && $CC -c $soname-ltdll.c)~
1140      $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs~
1141      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
1142
1143    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
1144      _lt_hint=1;
1145      for symbol in `cat $export_symbols`; do
1146	echo "	\$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
1147	_lt_hint=`expr 1 + \$_lt_hint`;
1148      done~
1149      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
1150      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
1151      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
1152      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
1153      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
1154
1155      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
1156    ;;
1157
1158  netbsd*)
1159    $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
1160    if test $? != 0; then
1161      $LD -V 2>&1 | egrep elf > /dev/null
1162    fi
1163    if test $? = 0; then
1164      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1165      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1166    else
1167      archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib'
1168      # can we support soname and/or expsyms with a.out? -oliva
1169    fi
1170    ;;
1171
1172  solaris*)
1173    if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
1174      ld_shlibs=no
1175      cat <<EOF 1>&2
1176
1177*** Warning: The releases 2.8.* of the GNU linker cannot reliably
1178*** create shared libraries on Solaris systems.  Therefore, libtool
1179*** is disabling shared libraries support.  We urge you to upgrade GNU
1180*** binutils to release 2.9.1 or newer.  Another option is to modify
1181*** your PATH or compiler configuration so that the native linker is
1182*** used, and then restart.
1183
1184EOF
1185    else
1186      $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
1187      if test $? != 0; then
1188	$LD -V 2>&1 | egrep elf > /dev/null
1189      fi
1190      if test $? = 0; then
1191	archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1192	archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1193      else
1194	ld_shlibs=no
1195      fi
1196    fi
1197    ;;      
1198
1199  sunos4*)
1200    archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts'
1201    wlarc=
1202    hardcode_direct=yes
1203    hardcode_shlibpath_var=no
1204    ;;
1205
1206  *)
1207    $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null
1208    if test $? != 0; then
1209      $LD -V 2>&1 | egrep elf > /dev/null
1210    fi
1211    if test $? = 0; then
1212      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
1213      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1214    else
1215      ld_shlibs=no
1216    fi
1217    ;;
1218  esac
1219
1220  if test "$ld_shlibs" = yes; then
1221    runpath_var=LD_RUN_PATH
1222    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1223    export_dynamic_flag_spec='${wl}--export-dynamic'
1224    case $host_os in
1225    cygwin* | mingw*)
1226      # dlltool doesn't understand --whole-archive et. al.
1227      whole_archive_flag_spec=
1228      ;;
1229    *)
1230      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1231      ;;
1232    esac
1233  fi
1234else
1235  # PORTME fill in a description of your system's linker (not GNU ld)
1236  case "$host_os" in
1237  aix3*)
1238    allow_undefined_flag=unsupported
1239    always_export_symbols=yes
1240    archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
1241    # Note: this linker hardcodes the directories in LIBPATH if there
1242    # are no directories specified by -L.
1243    hardcode_minus_L=yes
1244    if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1245      # Neither direct hardcoding nor static linking is supported with a
1246      # broken collect2.
1247      hardcode_direct=unsupported
1248    fi
1249    ;;
1250
1251  aix4*)
1252    hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib'
1253    hardcode_libdir_separator=':'
1254    if test "$with_gcc" = yes; then
1255      collect2name=`${CC} -print-prog-name=collect2`
1256      if test -f "$collect2name" && \
1257	 strings "$collect2name" | grep resolve_lib_name >/dev/null
1258      then
1259	# We have reworked collect2
1260	hardcode_direct=yes
1261      else
1262	# We have old collect2
1263	hardcode_direct=unsupported
1264	# It fails to find uninstalled libraries when the uninstalled
1265	# path is not listed in the libpath.  Setting hardcode_minus_L
1266	# to unsupported forces relinking
1267	hardcode_minus_L=yes
1268	hardcode_libdir_flag_spec='-L$libdir'
1269	hardcode_libdir_separator=
1270      fi
1271      shared_flag='-shared'
1272    else
1273      shared_flag='${wl}-bM:SRE'
1274      hardcode_direct=yes
1275    fi
1276    allow_undefined_flag=' ${wl}-berok'
1277    archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}'
1278    archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}'
1279    case "$host_os" in aix4.[01]|aix4.[01].*)
1280      # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on
1281      always_export_symbols=yes ;;
1282    esac
1283   ;;
1284
1285  amigaos*)
1286    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
1287    hardcode_libdir_flag_spec='-L$libdir'
1288    hardcode_minus_L=yes
1289    # see comment about different semantics on the GNU ld section
1290    ld_shlibs=no
1291    ;;
1292
1293  cygwin* | mingw*)
1294    # When not using gcc, we currently assume that we are using
1295    # Microsoft Visual C++.
1296    # hardcode_libdir_flag_spec is actually meaningless, as there is
1297    # no search path for DLLs.
1298    hardcode_libdir_flag_spec=' '
1299    allow_undefined_flag=unsupported
1300    # Tell ltmain to make .lib files, not .a files.
1301    libext=lib
1302    # FIXME: Setting linknames here is a bad hack.
1303    archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
1304    # The linker will automatically build a .lib file if we build a DLL.
1305    old_archive_from_new_cmds='true'
1306    # FIXME: Should let the user specify the lib program.
1307    old_archive_cmds='lib /OUT:$oldlib$oldobjs'
1308    fix_srcfile_path='`cygpath -w $srcfile`'
1309    ;;
1310
1311  freebsd1*)
1312    ld_shlibs=no
1313    ;;
1314
1315  # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1316  # support.  Future versions do this automatically, but an explicit c++rt0.o
1317  # does not break anything, and helps significantly (at the cost of a little
1318  # extra space).
1319  freebsd2.2*)
1320    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
1321    hardcode_libdir_flag_spec='-R$libdir'
1322    hardcode_direct=yes
1323    hardcode_shlibpath_var=no
1324    ;;
1325
1326  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1327  freebsd2*)
1328    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
1329    hardcode_direct=yes
1330    hardcode_minus_L=yes
1331    hardcode_shlibpath_var=no
1332    ;;
1333
1334  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
1335  freebsd*)
1336    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
1337    hardcode_libdir_flag_spec='-R$libdir'
1338    hardcode_direct=yes
1339    hardcode_shlibpath_var=no
1340    ;;
1341
1342  hpux9* | hpux10* | hpux11*)
1343    case "$host_os" in
1344    hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
1345    *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;;
1346    esac
1347    hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1348    hardcode_libdir_separator=:
1349    hardcode_direct=yes
1350    hardcode_minus_L=yes # Not in the search PATH, but as the default
1351			 # location of the library.
1352    export_dynamic_flag_spec='${wl}-E'
1353    ;;
1354
1355  irix5* | irix6*)
1356    if test "$with_gcc" = yes; then
1357      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
1358    else
1359      archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
1360    fi
1361    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1362    hardcode_libdir_separator=:
1363    ;;
1364
1365  netbsd*)
1366    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1367      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
1368    else
1369      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts'      # ELF
1370    fi
1371    hardcode_libdir_flag_spec='${wl}-R$libdir'
1372    hardcode_direct=yes
1373    hardcode_shlibpath_var=no
1374    ;;
1375
1376  openbsd*)
1377    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
1378    hardcode_libdir_flag_spec='-R$libdir'
1379    hardcode_direct=yes
1380    hardcode_shlibpath_var=no
1381    ;;
1382
1383  os2*)
1384    hardcode_libdir_flag_spec='-L$libdir'
1385    hardcode_minus_L=yes
1386    allow_undefined_flag=unsupported
1387    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
1388    old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
1389    ;;
1390
1391  osf3* | osf4*)
1392    if test "$with_gcc" = yes; then
1393      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
1394      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib'
1395    else
1396      allow_undefined_flag=' -expect_unresolved \*'
1397      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
1398    fi
1399    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1400    hardcode_libdir_separator=:
1401    ;;
1402
1403  sco3.2v5*)
1404    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1405    hardcode_shlibpath_var=no
1406    runpath_var=LD_RUN_PATH
1407    hardcode_runpath_var=yes
1408    ;;
1409
1410  solaris*)
1411    no_undefined_flag=' -z text'
1412    # $CC -shared without GNU ld will not create a library from C++
1413    # object files and a static libstdc++, better avoid it by now
1414    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
1415    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
1416		$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
1417    hardcode_libdir_flag_spec='-R$libdir'
1418    hardcode_shlibpath_var=no
1419    case "$host_os" in
1420    solaris2.[0-5] | solaris2.[0-5].*) ;;
1421    *) # Supported since Solaris 2.6 (maybe 2.5.1?)
1422      whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
1423    esac
1424    ;;
1425
1426  sunos4*)
1427    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
1428    hardcode_libdir_flag_spec='-L$libdir'
1429    hardcode_direct=yes
1430    hardcode_minus_L=yes
1431    hardcode_shlibpath_var=no
1432    ;;
1433
1434  sysv4)
1435    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1436    runpath_var='LD_RUN_PATH'
1437    hardcode_shlibpath_var=no
1438    hardcode_direct=no #Motorola manual says yes, but my tests say they lie 
1439    ;;  
1440
1441  sysv4.3*)
1442    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1443    hardcode_shlibpath_var=no
1444    export_dynamic_flag_spec='-Bexport'
1445    ;;
1446
1447  uts4*)
1448    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1449    hardcode_libdir_flag_spec='-L$libdir'
1450    hardcode_shlibpath_var=no
1451    ;;
1452
1453  dgux*)
1454    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
1455    hardcode_libdir_flag_spec='-L$libdir'
1456    hardcode_shlibpath_var=no
1457    ;;
1458
1459  sysv4*MP*)
1460    if test -d /usr/nec ;then
1461    # archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs'
1462    archive_cmds='$LD -G -h $soname -o $lib$libobjs$deplibs'
1463    hardcode_shlibpath_var=no
1464    runpath_var=LD_RUN_PATH
1465    hardcode_runpath_var=yes
1466    ld_shlibs=yes
1467    fi
1468    ;;
1469
1470  *)
1471    ld_shlibs=no
1472    ;;
1473  esac
1474fi
1475echo "$ac_t$ld_shlibs" 1>&6
1476test "$ld_shlibs" = no && can_build_shared=no
1477
1478if test -z "$NM"; then
1479  echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
1480  case "$NM" in
1481  [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path.
1482  *)
1483    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1484    for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
1485      test -z "$ac_dir" && ac_dir=.
1486      if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then
1487	# Check to see if the nm accepts a BSD-compat flag.
1488	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
1489	#   nm: unknown option "B" ignored
1490	if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1491	  NM="$ac_dir/nm -B"
1492	  break
1493	elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1494	  NM="$ac_dir/nm -p"
1495	  break
1496	else
1497	  NM=${NM="$ac_dir/nm"} # keep the first match, but
1498	  continue # so that we can try to find one that supports BSD flags
1499	fi
1500      fi
1501    done
1502    IFS="$ac_save_ifs"
1503    test -z "$NM" && NM=nm
1504    ;;
1505  esac
1506  echo "$ac_t$NM" 1>&6
1507fi
1508
1509# Check for command to grab the raw symbol name followed by C symbol from nm.
1510echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1511
1512# These are sane defaults that work on at least a few old systems.
1513# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
1514
1515# Character class describing NM global symbol codes.
1516symcode='[BCDEGRST]'
1517
1518# Regexp to match symbols that can be accessed directly from C.
1519sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1520
1521# Transform the above into a raw symbol and a C symbol.
1522symxfrm='\1 \2\3 \3'
1523
1524# Transform an extracted symbol line into a proper C declaration
1525global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
1526
1527# Define system-specific variables.
1528case "$host_os" in
1529aix*)
1530  symcode='[BCDT]'
1531  ;;
1532cygwin* | mingw*)
1533  symcode='[ABCDGISTW]'
1534  ;;
1535hpux*) # Its linker distinguishes data from code symbols
1536  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
1537  ;;
1538irix*)
1539  symcode='[BCDEGRST]'
1540  ;;
1541solaris*)
1542  symcode='[BDT]'
1543  ;;
1544sysv4)
1545  symcode='[DFNSTU]'
1546  ;;
1547esac
1548
1549# If we're using GNU nm, then use its standard symbol codes.
1550if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1551  symcode='[ABCDGISTW]'
1552fi
1553
1554# Try without a prefix undercore, then with it.
1555for ac_symprfx in "" "_"; do
1556
1557  # Write the raw and C identifiers.
1558  global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode\)[ 	][ 	]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
1559
1560  # Check to see that the pipe works correctly.
1561  pipe_works=no
1562  $rm conftest*
1563  cat > conftest.c <<EOF
1564#ifdef __cplusplus
1565extern "C" {
1566#endif
1567char nm_test_var;
1568void nm_test_fun…

Large files files are truncated, but you can click here to view the full file