1#! /bin/sh 2 3# ltconfig - Create a system-specific libtool. 4# Copyright (C) 1996-1999 Free Software Foundation, Inc. 5# 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 # used as fallback echo 36 shift 37 cat <<EOF 38$* 39EOF 40 exit 0 41elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then 42 # Yippee, $echo works! 43 : 44else 45 # Restart under the correct shell. 46 exec "$SHELL" "$0" --no-reexec ${1+"$@"} 47fi 48 49# Find the correct PATH separator. Usually this is `:', but 50# DJGPP uses `;' like DOS. 51if test "X${PATH_SEPARATOR+set}" != "Xset"; then 52 UNAME=${UNAME-`uname 2>/dev/null`} 53 case X$UNAME in 54 *-DOS) PATH_SEPARATOR=';' ;; 55 *) PATH_SEPARATOR=':' ;; 56 esac 57fi 58 59# The HP-UX ksh and POSIX shell print the target directory to stdout 60# if CDPATH is set. 61if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi 62 63if test "X${echo_test_string+set}" != "Xset"; then 64 # find a string as large as possible, as long as the shell can cope with it 65 for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do 66 # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... 67 if (echo_test_string="`eval $cmd`") 2>/dev/null && 68 echo_test_string="`eval $cmd`" && 69 (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then 70 break 71 fi 72 done 73fi 74 75if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || 76 test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then 77 # The Solaris, AIX, and Digital Unix default echo programs unquote 78 # backslashes. This makes it impossible to quote backslashes using 79 # echo "$something" | sed 's/\\/\\\\/g' 80 # 81 # So, first we look for a working echo in the user's PATH. 82 83 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 84 for dir in $PATH /usr/ucb; do 85 if test -f $dir/echo && 86 test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && 87 test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then 88 echo="$dir/echo" 89 break 90 fi 91 done 92 IFS="$save_ifs" 93 94 if test "X$echo" = Xecho; then 95 # We didn't find a better echo, so look for alternatives. 96 if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && 97 test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then 98 # This shell has a builtin print -r that does the trick. 99 echo='print -r' 100 elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then 101 # If we have ksh, try running ltconfig again with it. 102 ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" 103 export ORIGINAL_CONFIG_SHELL 104 CONFIG_SHELL=/bin/ksh 105 export CONFIG_SHELL 106 exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} 107 else 108 # Try using printf. 109 echo='printf "%s\n"' 110 if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && 111 test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then 112 # Cool, printf works 113 : 114 elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && 115 test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then 116 CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" 117 export CONFIG_SHELL 118 SHELL="$CONFIG_SHELL" 119 export SHELL 120 echo="$CONFIG_SHELL $0 --fallback-echo" 121 elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && 122 test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then 123 echo="$CONFIG_SHELL $0 --fallback-echo" 124 else 125 # maybe with a smaller string... 126 prev=: 127 128 for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do 129 if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then 130 break 131 fi 132 prev="$cmd" 133 done 134 135 if test "$prev" != 'sed 50q "$0"'; then 136 echo_test_string=`eval $prev` 137 export echo_test_string 138 exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} 139 else 140 # Oops. We lost completely, so just stick with echo. 141 echo=echo 142 fi 143 fi 144 fi 145 fi 146fi 147 148# Sed substitution that helps us do robust quoting. It backslashifies 149# metacharacters that are still active within double-quoted strings. 150Xsed='sed -e s/^X//' 151sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' 152 153# Same as above, but do not quote variable references. 154double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' 155 156# Sed substitution to delay expansion of an escaped shell variable in a 157# double_quote_subst'ed string. 158delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' 159 160# The name of this program. 161progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` 162 163# Constants: 164PROGRAM=ltconfig 165PACKAGE=libtool 166VERSION=1.2f 167TIMESTAMP=" (1.385 1999/03/15 17:24:54)" 168ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' 169ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' 170rm="rm -f" 171 172help="Try \`$progname --help' for more information." 173 174# Global variables: 175default_ofile=libtool 176can_build_shared=yes 177enable_shared=yes 178# All known linkers require a `.a' archive for static linking. 179enable_static=yes 180enable_fast_install=yes 181enable_dlopen=unknown 182ltmain= 183silent= 184srcdir= 185ac_config_guess= 186ac_config_sub= 187host= 188nonopt= 189ofile="$default_ofile" 190verify_host=yes 191with_gcc=no 192with_gnu_ld=no 193need_locks=yes 194ac_ext=c 195objext=o 196libext=a 197cache_file= 198 199old_AR="$AR" 200old_CC="$CC" 201old_CFLAGS="$CFLAGS" 202old_CPPFLAGS="$CPPFLAGS" 203old_LD="$LD" 204old_LN_S="$LN_S" 205old_NM="$NM" 206old_RANLIB="$RANLIB" 207old_DLLTOOL="$DLLTOOL" 208old_AS="$AS" 209 210# Parse the command line options. 211args= 212prev= 213for option 214do 215 case "$option" in 216 -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 217 *) optarg= ;; 218 esac 219 220 # If the previous option needs an argument, assign it. 221 if test -n "$prev"; then 222 eval "$prev=\$option" 223 prev= 224 continue 225 fi 226 227 case "$option" in 228 --help) cat <<EOM 229Usage: $progname [OPTION]... [HOST [LTMAIN]] 230 231Generate a system-specific libtool script. 232 233 --debug enable verbose shell tracing 234 --disable-shared do not build shared libraries 235 --disable-static do not build static libraries 236 --disable-fast-install do not optimize for fast installation 237 --enable-dlopen enable dlopen support 238 --enable-dlopen-self enable support for dlopening programs 239 --help display this help and exit 240 --no-verify do not verify that HOST is a valid host type 241-o, --output=FILE specify the output file [default=$default_ofile] 242 --quiet same as \`--silent' 243 --silent do not print informational messages 244 --srcdir=DIR find \`config.guess' in DIR 245 --version output version information and exit 246 --with-gcc assume that the GNU C compiler will be used 247 --with-gnu-ld assume that the C compiler uses the GNU linker 248 --disable-lock disable file locking 249 --cache-file=FILE configure cache file 250 251LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program 252that provides basic libtool functionality. 253 254HOST is the canonical host system name [default=guessed]. 255EOM 256 exit 0 257 ;; 258 259 --debug) 260 echo "$progname: enabling shell trace mode" 261 set -x 262 ;; 263 264 --disable-shared) enable_shared=no ;; 265 266 --disable-static) enable_static=no ;; 267 268 --disable-fast-install) enable_fast_install=no ;; 269 270 --enable-dlopen) enable_dlopen=yes ;; 271 272 --quiet | --silent) silent=yes ;; 273 274 --srcdir) prev=srcdir ;; 275 --srcdir=*) srcdir="$optarg" ;; 276 277 --no-verify) verify_host=no ;; 278 279 --output | -o) prev=ofile ;; 280 --output=*) ofile="$optarg" ;; 281 282 --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;; 283 284 --with-gcc) with_gcc=yes ;; 285 --with-gnu-ld) with_gnu_ld=yes ;; 286 287 --disable-lock) need_locks=no ;; 288 289 --cache-file=*) cache_file="$optarg" ;; 290 291 -*) 292 echo "$progname: unrecognized option \`$option'" 1>&2 293 echo "$help" 1>&2 294 exit 1 295 ;; 296 297 *) 298 if test -z "$ltmain"; then 299 ltmain="$option" 300 elif test -z "$host"; then 301# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 302# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then 303# echo "$progname: warning \`$option' is not a valid host type" 1>&2 304# fi 305 host="$option" 306 else 307 echo "$progname: too many arguments" 1>&2 308 echo "$help" 1>&2 309 exit 1 310 fi ;; 311 esac 312done 313 314if test -z "$ltmain"; then 315 echo "$progname: you must specify a LTMAIN file" 1>&2 316 echo "$help" 1>&2 317 exit 1 318fi 319 320if test ! -f "$ltmain"; then 321 echo "$progname: \`$ltmain' does not exist" 1>&2 322 echo "$help" 1>&2 323 exit 1 324fi 325 326# Quote any args containing shell metacharacters. 327ltconfig_args= 328for arg 329do 330 case "$arg" in 331 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) 332 ltconfig_args="$ltconfig_args '$arg'" ;; 333 *) ltconfig_args="$ltconfig_args $arg" ;; 334 esac 335done 336 337# A relevant subset of AC_INIT. 338 339# File descriptor usage: 340# 0 standard input 341# 1 file creation 342# 2 errors and warnings 343# 3 some systems may open it to /dev/tty 344# 4 used on the Kubota Titan 345# 5 compiler messages saved in config.log 346# 6 checking for... messages and results 347if test "$silent" = yes; then 348 exec 6>/dev/null 349else 350 exec 6>&1 351fi 352exec 5>>./config.log 353 354# NLS nuisances. 355# Only set LANG and LC_ALL to C if already set. 356# These must not be set unconditionally because not all systems understand 357# e.g. LANG=C (notably SCO). 358if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi 359if test "${LANG+set}" = set; then LANG=C; export LANG; fi 360 361if test -n "$cache_file" && test -r "$cache_file"; then 362 echo "loading cache $cache_file within ltconfig" 363 . $cache_file 364fi 365 366if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then 367 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. 368 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then 369 ac_n= ac_c=' 370' ac_t=' ' 371 else 372 ac_n=-n ac_c= ac_t= 373 fi 374else 375 ac_n= ac_c='\c' ac_t= 376fi 377 378if test -z "$srcdir"; then 379 # Assume the source directory is the same one as the path to LTMAIN. 380 srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` 381 test "$srcdir" = "$ltmain" && srcdir=. 382fi 383 384trap "$rm conftest*; exit 1" 1 2 15 385if test "$verify_host" = yes; then 386 # Check for config.guess and config.sub. 387 ac_aux_dir= 388 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do 389 if test -f $ac_dir/config.guess; then 390 ac_aux_dir=$ac_dir 391 break 392 fi 393 done 394 if test -z "$ac_aux_dir"; then 395 echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 396 echo "$help" 1>&2 397 exit 1 398 fi 399 ac_config_guess=$ac_aux_dir/config.guess 400 ac_config_sub=$ac_aux_dir/config.sub 401 402 # Make sure we can run config.sub. 403 if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : 404 else 405 echo "$progname: cannot run $ac_config_sub" 1>&2 406 echo "$help" 1>&2 407 exit 1 408 fi 409 410 echo $ac_n "checking host system type""... $ac_c" 1>&6 411 412 host_alias=$host 413 case "$host_alias" in 414 "") 415 if host_alias=`$SHELL $ac_config_guess`; then : 416 else 417 echo "$progname: cannot guess host type; you must specify one" 1>&2 418 echo "$help" 1>&2 419 exit 1 420 fi ;; 421 esac 422 host=`$SHELL $ac_config_sub $host_alias` 423 echo "$ac_t$host" 1>&6 424 425 # Make sure the host verified. 426 test -z "$host" && exit 1 427 428elif test -z "$host"; then 429 echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 430 echo "$help" 1>&2 431 exit 1 432else 433 host_alias=$host 434fi 435 436# Transform linux* to *-*-linux-gnu*, to support old configure scripts. 437case "$host_os" in 438linux-gnu*) ;; 439linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` 440esac 441 442host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 443host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 444host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 445 446case "$host_os" in 447aix3*) 448 # AIX sometimes has problems with the GCC collect2 program. For some 449 # reason, if we set the COLLECT_NAMES environment variable, the problems 450 # vanish in a puff of smoke. 451 if test "${COLLECT_NAMES+set}" != set; then 452 COLLECT_NAMES= 453 export COLLECT_NAMES 454 fi 455 ;; 456esac 457 458# Determine commands to create old-style static archives. 459old_archive_cmds='$AR cru $oldlib$oldobjs' 460old_postinstall_cmds='chmod 644 $oldlib' 461old_postuninstall_cmds= 462 463# Set a sane default for `AR'. 464test -z "$AR" && AR=ar 465 466# If RANLIB is not set, then run the test. 467if test "${RANLIB+set}" != "set"; then 468 result=no 469 470 echo $ac_n "checking for ranlib... $ac_c" 1>&6 471 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 472 for dir in $PATH; do 473 test -z "$dir" && dir=. 474 if test -f $dir/ranlib; then 475 RANLIB="ranlib" 476 result="ranlib" 477 break 478 fi 479 done 480 IFS="$save_ifs" 481 482 echo "$ac_t$result" 1>&6 483fi 484 485if test -n "$RANLIB"; then 486 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" 487 old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" 488fi 489 490# Set sane defaults for `DLLTOOL' and `AS', used on cygwin. 491test -z "$DLLTOOL" && DLLTOOL=dlltool 492test -z "$AS" && AS=as 493 494# Check to see if we are using GCC. 495if test "$with_gcc" != yes || test -z "$CC"; then 496 # If CC is not set, then try to find GCC or a usable CC. 497 if test -z "$CC"; then 498 echo $ac_n "checking for gcc... $ac_c" 1>&6 499 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 500 for dir in $PATH; do 501 IFS="$save_ifs" 502 test -z "$dir" && dir=. 503 if test -f $dir/gcc; then 504 CC="gcc" 505 break 506 fi 507 done 508 IFS="$save_ifs" 509 510 if test -n "$CC"; then 511 echo "$ac_t$CC" 1>&6 512 else 513 echo "$ac_t"no 1>&6 514 fi 515 fi 516 517 # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". 518 if test -z "$CC"; then 519 echo $ac_n "checking for cc... $ac_c" 1>&6 520 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 521 cc_rejected=no 522 for dir in $PATH; do 523 test -z "$dir" && dir=. 524 if test -f $dir/cc; then 525 if test "$dir/cc" = "/usr/ucb/cc"; then 526 cc_rejected=yes 527 continue 528 fi 529 CC="cc" 530 break 531 fi 532 done 533 IFS="$save_ifs" 534 if test $cc_rejected = yes; then 535 # We found a bogon in the path, so make sure we never use it. 536 set dummy $CC 537 shift 538 if test $# -gt 0; then 539 # We chose a different compiler from the bogus one. 540 # However, it has the same name, so the bogon will be chosen 541 # first if we set CC to just the name; use the full file name. 542 shift 543 set dummy "$dir/cc" "$@" 544 shift 545 CC="$@" 546 fi 547 fi 548 549 if test -n "$CC"; then 550 echo "$ac_t$CC" 1>&6 551 else 552 echo "$ac_t"no 1>&6 553 fi 554 555 if test -z "$CC"; then 556 echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 557 exit 1 558 fi 559 fi 560 561 # Now see if the compiler is really GCC. 562 with_gcc=no 563 echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 564 echo "$progname:564: checking whether we are using GNU C" >&5 565 566 $rm conftest.c 567 cat > conftest.c <<EOF 568#ifdef __GNUC__ 569 yes; 570#endif 571EOF 572 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then 573 with_gcc=yes 574 fi 575 $rm conftest.c 576 echo "$ac_t$with_gcc" 1>&6 577fi 578 579# Allow CC to be a program name with arguments. 580set dummy $CC 581compiler="$2" 582 583echo $ac_n "checking for object suffix... $ac_c" 1>&6 584$rm conftest* 585echo 'int i = 1;' > conftest.c 586echo "$progname:586: checking for object suffix" >& 5 587if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then 588 # Append any warnings to the config.log. 589 cat conftest.err 1>&5 590 591 for ac_file in conftest.*; do 592 case $ac_file in 593 *.c) ;; 594 *) objext=`echo $ac_file | sed -e s/conftest.//` ;; 595 esac 596 done 597else 598 cat conftest.err 1>&5 599 echo "$progname: failed program was:" >&5 600 cat conftest.c >&5 601fi 602$rm conftest* 603echo "$ac_t$objext" 1>&6 604 605echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 606pic_flag= 607special_shlib_compile_flags= 608wl= 609link_static_flag= 610no_builtin_flag= 611 612if test "$with_gcc" = yes; then 613 wl='-Wl,' 614 link_static_flag='-static' 615 616 case "$host_os" in 617 beos* | irix5* | irix6* | osf3* | osf4* | haiku*) 618 # PIC is the default for these OSes. 619 ;; 620 aix*) 621 # Below there is a dirty hack to force normal static linking with -ldl 622 # The problem is because libdl dynamically linked with both libc and 623 # libC (AIX C++ library), which obviously doesn't included in libraries 624 # list by gcc. This cause undefined symbols with -static flags. 625 # This hack allows C programs to be linked with "-static -ldl", but 626 # we not sure about C++ programs. 627 link_static_flag="$link_static_flag ${wl}-lC" 628 ;; 629 cygwin* | mingw* | os2*) 630 # We can build DLLs from non-PIC. 631 ;; 632 amigaos*) 633 # FIXME: we need at least 68020 code to build shared libraries, but 634 # adding the `-m68020' flag to GCC prevents building anything better, 635 # like `-m68040'. 636 pic_flag='-m68020 -resident32 -malways-restore-a4' 637 ;; 638 *) 639 pic_flag='-fPIC' 640 ;; 641 esac 642else 643 # PORTME Check for PIC flags for the system compiler. 644 case "$host_os" in 645 aix3* | aix4*) 646 # All AIX code is PIC. 647 link_static_flag='-bnso -bI:/lib/syscalls.exp' 648 ;; 649 650 hpux9* | hpux10* | hpux11*) 651 # Is there a better link_static_flag that works with the bundled CC? 652 wl='-Wl,' 653 link_static_flag="${wl}-a ${wl}archive" 654 pic_flag='+Z' 655 ;; 656 657 irix5* | irix6*) 658 wl='-Wl,' 659 link_static_flag='-non_shared' 660 # PIC (with -KPIC) is the default. 661 ;; 662 663 cygwin* | mingw* | os2*) 664 # We can build DLLs from non-PIC. 665 ;; 666 667 osf3* | osf4*) 668 # All OSF/1 code is PIC. 669 wl='-Wl,' 670 link_static_flag='-non_shared' 671 ;; 672 673 sco3.2v5*) 674 pic_flag='-Kpic' 675 link_static_flag='-dn' 676 special_shlib_compile_flags='-belf' 677 ;; 678 679 solaris*) 680 pic_flag='-KPIC' 681 link_static_flag='-Bstatic' 682 wl='-Wl,' 683 ;; 684 685 sunos4*) 686 pic_flag='-PIC' 687 link_static_flag='-Bstatic' 688 wl='-Qoption ld ' 689 ;; 690 691 sysv4.2uw2* | sysv4.3* | sysv5*) 692 pic_flag='-KPIC' 693 link_static_flag='-Bstatic' 694 wl='-Wl,' 695 ;; 696 697 uts4*) 698 pic_flag='-pic' 699 link_static_flag='-Bstatic' 700 ;; 701 702 *) 703 can_build_shared=no 704 ;; 705 esac 706fi 707 708if test -n "$pic_flag"; then 709 echo "$ac_t$pic_flag" 1>&6 710 711 # Check to make sure the pic_flag actually works. 712 echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 713 $rm conftest* 714 echo "int some_variable = 0;" > conftest.c 715 save_CFLAGS="$CFLAGS" 716 CFLAGS="$CFLAGS $pic_flag -DPIC" 717 echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5 718 if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then 719 # Append any warnings to the config.log. 720 cat conftest.err 1>&5 721 722 case "$host_os" in 723 hpux9* | hpux10* | hpux11*) 724 # On HP-UX, both CC and GCC only warn that PIC is supported... then they 725 # create non-PIC objects. So, if there were any warnings, we assume that 726 # PIC is not supported. 727 if test -s conftest.err; then 728 echo "$ac_t"no 1>&6 729 can_build_shared=no 730 pic_flag= 731 else 732 echo "$ac_t"yes 1>&6 733 pic_flag=" $pic_flag" 734 fi 735 ;; 736 *) 737 echo "$ac_t"yes 1>&6 738 pic_flag=" $pic_flag" 739 ;; 740 esac 741 else 742 # Append any errors to the config.log. 743 cat conftest.err 1>&5 744 can_build_shared=no 745 pic_flag= 746 echo "$ac_t"no 1>&6 747 fi 748 CFLAGS="$save_CFLAGS" 749 $rm conftest* 750else 751 echo "$ac_t"none 1>&6 752fi 753 754# Check to see if options -o and -c are simultaneously supported by compiler 755echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 756$rm conftest* 757echo "int some_variable = 0;" > conftest.c 758save_CFLAGS="$CFLAGS" 759CFLAGS="$CFLAGS -c -o conftest2.o" 760echo "$progname:760: checking if $compiler supports -c -o file.o" >&5 761if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then 762 763 # The compiler can only warn and ignore the option if not recognized 764 # So say no if there are warnings 765 if test -s conftest.err; then 766 echo "$ac_t"no 1>&6 767 compiler_c_o=no 768 else 769 echo "$ac_t"yes 1>&6 770 compiler_c_o=yes 771 fi 772else 773 # Append any errors to the config.log. 774 cat conftest.err 1>&5 775 compiler_c_o=no 776 echo "$ac_t"no 1>&6 777fi 778CFLAGS="$save_CFLAGS" 779$rm conftest* 780 781if test x"$compiler_c_o" = x"yes"; then 782 # Check to see if we can write to a .lo 783 echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 784 $rm conftest* 785 echo "int some_variable = 0;" > conftest.c 786 save_CFLAGS="$CFLAGS" 787 CFLAGS="$CFLAGS -c -o conftest.lo" 788 echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5 789if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then 790 791 # The compiler can only warn and ignore the option if not recognized 792 # So say no if there are warnings 793 if test -s conftest.err; then 794 echo "$ac_t"no 1>&6 795 compiler_o_lo=no 796 else 797 echo "$ac_t"yes 1>&6 798 compiler_o_lo=yes 799 fi 800 else 801 # Append any errors to the config.log. 802 cat conftest.err 1>&5 803 compiler_o_lo=no 804 echo "$ac_t"no 1>&6 805 fi 806 CFLAGS="$save_CFLAGS" 807 $rm conftest* 808else 809 compiler_o_lo=no 810fi 811 812# Check to see if we can do hard links to lock some files if needed 813hard_links="nottested" 814if test "$compiler_c_o" = no && test "$need_locks" != no; then 815 # do not overwrite the value of need_locks provided by the user 816 echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 817 hard_links=yes 818 $rm conftest* 819 ln conftest.a conftest.b 2>/dev/null && hard_links=no 820 touch conftest.a 821 ln conftest.a conftest.b 2>&5 || hard_links=no 822 ln conftest.a conftest.b 2>/dev/null && hard_links=no 823 echo "$ac_t$hard_links" 1>&6 824 $rm conftest* 825 if test "$hard_links" = no; then 826 echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 827 need_locks=warn 828 fi 829else 830 need_locks=no 831fi 832 833if test "$with_gcc" = yes; then 834 # Check to see if options -fno-rtti -fno-exceptions are supported by compiler 835 echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 836 $rm conftest* 837 echo "int some_variable = 0;" > conftest.c 838 save_CFLAGS="$CFLAGS" 839 CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" 840 echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 841 if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then 842 843 # The compiler can only warn and ignore the option if not recognized 844 # So say no if there are warnings 845 if test -s conftest.err; then 846 echo "$ac_t"no 1>&6 847 compiler_rtti_exceptions=no 848 else 849 echo "$ac_t"yes 1>&6 850 compiler_rtti_exceptions=yes 851 fi 852 else 853 # Append any errors to the config.log. 854 cat conftest.err 1>&5 855 compiler_rtti_exceptions=no 856 echo "$ac_t"no 1>&6 857 fi 858 CFLAGS="$save_CFLAGS" 859 $rm conftest* 860 861 if test "$compiler_rtti_exceptions" = "yes"; then 862 no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' 863 else 864 no_builtin_flag=' -fno-builtin' 865 fi 866 867fi 868 869# Check for any special shared library compilation flags. 870if test -n "$special_shlib_compile_flags"; then 871 echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 872 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : 873 else 874 echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 875 can_build_shared=no 876 fi 877fi 878 879echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 880$rm conftest* 881echo 'main(){return(0);}' > conftest.c 882save_LDFLAGS="$LDFLAGS" 883LDFLAGS="$LDFLAGS $link_static_flag" 884echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5 885if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 886 echo "$ac_t$link_static_flag" 1>&6 887else 888 echo "$ac_t"none 1>&6 889 link_static_flag= 890fi 891LDFLAGS="$save_LDFLAGS" 892$rm conftest* 893 894if test -z "$LN_S"; then 895 # Check to see if we can use ln -s, or we need hard links. 896 echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 897 $rm conftestdata 898 if ln -s X conftestdata 2>/dev/null; then 899 $rm conftestdata 900 LN_S="ln -s" 901 else 902 LN_S=ln 903 fi 904 if test "$LN_S" = "ln -s"; then 905 echo "$ac_t"yes 1>&6 906 else 907 echo "$ac_t"no 1>&6 908 fi 909fi 910 911# Make sure LD is an absolute path. 912if test -z "$LD"; then 913 ac_prog=ld 914 if test "$with_gcc" = yes; then 915 # Check if gcc -print-prog-name=ld gives a path. 916 echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 917 echo "$progname:917: checking for ld used by GCC" >&5 918 ac_prog=`($CC -print-prog-name=ld) 2>&5` 919 case "$ac_prog" in 920 # Accept absolute paths. 921 /* | [A-Za-z]:[\\/]*) 922 re_direlt='/[^/][^/]*/\.\./' 923 # Canonicalize the path of ld 924 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` 925 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do 926 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` 927 done 928 test -z "$LD" && LD="$ac_prog" 929 ;; 930 "") 931 # If it fails, then pretend we are not using GCC. 932 ac_prog=ld 933 ;; 934 *) 935 # If it is relative, then search for the first ld in PATH. 936 with_gnu_ld=unknown 937 ;; 938 esac 939 elif test "$with_gnu_ld" = yes; then 940 echo $ac_n "checking for GNU ld... $ac_c" 1>&6 941 echo "$progname:941: checking for GNU ld" >&5 942 else 943 echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 944 echo "$progname:944: checking for non-GNU ld" >&5 945 fi 946 947 if test -z "$LD"; then 948 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 949 for ac_dir in $PATH; do 950 test -z "$ac_dir" && ac_dir=. 951 if test -f "$ac_dir/$ac_prog"; then 952 LD="$ac_dir/$ac_prog" 953 # Check to see if the program is GNU ld. I'd rather use --version, 954 # but apparently some GNU ld's only accept -v. 955 # Break only if it was the GNU/non-GNU ld that we prefer. 956 if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then 957 test "$with_gnu_ld" != no && break 958 else 959 test "$with_gnu_ld" != yes && break 960 fi 961 fi 962 done 963 IFS="$ac_save_ifs" 964 fi 965 966 if test -n "$LD"; then 967 echo "$ac_t$LD" 1>&6 968 else 969 echo "$ac_t"no 1>&6 970 fi 971 972 if test -z "$LD"; then 973 echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 974 exit 1 975 fi 976fi 977 978# Check to see if it really is or is not GNU ld. 979echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 980# I'd rather use --version here, but apparently some GNU ld's only accept -v. 981if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then 982 with_gnu_ld=yes 983else 984 with_gnu_ld=no 985fi 986echo "$ac_t$with_gnu_ld" 1>&6 987 988# See if the linker supports building shared libraries. 989echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 990 991allow_undefined_flag= 992no_undefined_flag= 993need_lib_prefix=unknown 994need_version=unknown 995# when you set need_version to no, make sure it does not cause -set_version 996# flags to be left without arguments 997archive_cmds= 998archive_expsym_cmds= 999old_archive_from_new_cmds= 1000export_dynamic_flag_spec= 1001whole_archive_flag_spec= 1002thread_safe_flag_spec= 1003hardcode_libdir_flag_spec= 1004hardcode_libdir_separator= 1005hardcode_direct=no 1006hardcode_minus_L=no 1007hardcode_shlibpath_var=unsupported 1008runpath_var= 1009always_export_symbols=no 1010export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' 1011# include_expsyms should be a list of space-separated symbols to be *always* 1012# included in the symbol list 1013include_expsyms= 1014# exclude_expsyms can be an egrep regular expression of symbols to exclude 1015# it will be wrapped by ` (' and `)$', so one must not match beginning or 1016# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', 1017# as well as any symbol that contains `d'. 1018exclude_expsyms= 1019 1020case "$host_os" in 1021cygwin* | mingw*) 1022 # FIXME: the MSVC++ port hasn't been tested in a loooong time 1023 # When not using gcc, we currently assume that we are using 1024 # Microsoft Visual C++. 1025 if test "$with_gcc" != yes; then 1026 with_gnu_ld=no 1027 fi 1028 ;; 1029 1030freebsd2* | sunos4*) 1031 exclude_expsyms="_GLOBAL_OFFSET_TABLE_" 1032 ;; 1033 1034esac 1035 1036ld_shlibs=yes 1037if test "$with_gnu_ld" = yes; then 1038 # If archive_cmds runs LD, not CC, wlarc should be empty 1039 wlarc='${wl}' 1040 1041 # See if GNU ld supports shared libraries. 1042 case "$host_os" in 1043 aix3* | aix4*) 1044 # On AIX, the GNU linker is very broken 1045 ld_shlibs=no 1046 cat <<EOF 1>&2 1047 1048*** Warning: the GNU linker, at least up to release 2.9.1, is reported 1049*** to be unable to reliably create shared libraries on AIX. 1050*** Therefore, libtool is disabling shared libraries support. If you 1051*** really care for shared libraries, you may want to modify your PATH 1052*** so that a non-GNU linker is found, and then restart. 1053 1054EOF 1055 ;; 1056 1057 amigaos*) 1058 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)' 1059 hardcode_libdir_flag_spec='-L$libdir' 1060 hardcode_minus_L=yes 1061 ;; 1062 1063 sunos4*) 1064 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' 1065 wlarc= 1066 hardcode_direct=yes 1067 hardcode_minus_L=yes 1068 hardcode_shlibpath_var=no 1069 ;; 1070 1071 beos*) 1072 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 1073 archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' 1074 else 1075 ld_shlibs=no 1076 fi 1077 ;; 1078 1079 haiku*) 1080 archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' 1081 fi 1082 ;; 1083 1084 cygwin* | mingw*) 1085 # hardcode_libdir_flag_spec is actually meaningless, as there is 1086 # no search path for DLLs. 1087 hardcode_libdir_flag_spec='-L$libdir' 1088 allow_undefined_flag=unsupported 1089 always_export_symbols=yes 1090 1091 # Extract the symbol export list from an `--export-all' def file, 1092 # then regenerate the def file from the symbol export list, so that 1093 # the compiled dll only exports the symbol export list. 1094 export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~ 1095 sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ 1096 (cd $objdir && $CC -c $soname-ltdll.c)~ 1097 $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~ 1098 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols' 1099 1100 archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ 1101 _lt_hint=1; 1102 for symbol in `cat $export_symbols`; do 1103 echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def; 1104 _lt_hint=`expr 1 + \$_lt_hint`; 1105 done~ 1106 $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~ 1107 $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~ 1108 $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~ 1109 $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~ 1110 $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' 1111 1112 old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' 1113 ;; 1114 1115 *) 1116 if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then 1117 archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' 1118 archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 1119 else 1120 ld_shlibs=no 1121 fi 1122 ;; 1123 esac 1124 1125 if test "$ld_shlibs" = yes; then 1126 runpath_var=LD_RUN_PATH 1127 hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' 1128 export_dynamic_flag_spec='${wl}--export-dynamic' 1129 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' 1130 fi 1131else 1132 # PORTME fill in a description of your system's linker (not GNU ld) 1133 case "$host_os" in 1134 aix3*) 1135 allow_undefined_flag=unsupported 1136 always_export_symbols=yes 1137 archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' 1138 # Note: this linker hardcodes the directories in LIBPATH if there 1139 # are no directories specified by -L. 1140 hardcode_minus_L=yes 1141 if test "$with_gcc" = yes && test -z "$link_static_flag"; then 1142 # Neither direct hardcoding nor static linking is supported with a 1143 # broken collect2. 1144 hardcode_direct=unsupported 1145 fi 1146 ;; 1147 1148 aix4*) 1149 allow_undefined_flag= 1150 if test "$with_gcc" = yes; then 1151 if strings `${CC} -print-prog-name=collect2` | \ 1152 grep resolve_lib_name >/dev/null 1153 then 1154 # We have reworked collect2 1155 hardcode_direct=yes 1156 else 1157 # We have old collect2 1158 hardcode_direct=unsupported 1159 fi 1160 archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts' 1161 else 1162 always_export_symbols=yes 1163 archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry' 1164 hardcode_direct=yes 1165 fi 1166 hardcode_minus_L=yes 1167 # Though LIBPATH variable hardcodes shlibpath into executable, 1168 # it doesn't affect searching for -l* libraries; this confuses 1169 # tests in mdemo. 1170 hardcode_shlibpath_var=unsupported 1171 hardcode_libdir_flag_spec='-L$libdir' 1172 ;; 1173 1174 amigaos*) 1175 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)' 1176 hardcode_libdir_flag_spec='-L$libdir' 1177 hardcode_minus_L=yes 1178 ;; 1179 1180 cygwin* | mingw*) 1181 # When not using gcc, we currently assume that we are using 1182 # Microsoft Visual C++. 1183 # hardcode_libdir_flag_spec is actually meaningless, as there is 1184 # no search path for DLLs. 1185 hardcode_libdir_flag_spec=' ' 1186 allow_undefined_flag=unsupported 1187 # Tell ltmain to make .lib files, not .a files. 1188 libext=lib 1189 # FIXME: Setting linknames here is a bad hack. 1190 archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' 1191 # The linker will automatically build a .lib file if we build a DLL. 1192 old_archive_from_new_cmds='true' 1193 # FIXME: Should let the user specify the lib program. 1194 old_archive_cmds='lib /OUT:$oldlib$oldobjs' 1195 fix_srcfile_path='`cygpath -w $srcfile`' 1196 ;; 1197 1198 freebsd1*) 1199 ld_shlibs=no 1200 can_build_shared=no 1201 ;; 1202 1203 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor 1204 # support. Future versions do this automatically, but an explicit c++rt0.o 1205 # does not break anything, and helps significantly (at the cost of a little 1206 # extra space). 1207 freebsd2.2*) 1208 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' 1209 hardcode_libdir_flag_spec='-R$libdir' 1210 hardcode_direct=yes 1211 hardcode_minus_L=no # verified on 2.2.6 1212 hardcode_shlibpath_var=no 1213 ;; 1214 1215 # Unfortunately, older versions of FreeBSD 2 do not have this feature. 1216 freebsd2*) 1217 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' 1218 hardcode_direct=yes 1219 hardcode_minus_L=yes 1220 hardcode_shlibpath_var=no 1221 ;; 1222 1223 # FreeBSD 3 and greater uses gcc -shared to do shared libraries. 1224 freebsd*) 1225 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' 1226 hardcode_libdir_flag_spec='-R$libdir' 1227 hardcode_direct=yes 1228 hardcode_minus_L=no 1229 hardcode_shlibpath_var=no 1230 ;; 1231 1232 hpux9*) 1233 archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' 1234 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 1235 hardcode_direct=yes 1236 hardcode_minus_L=yes 1237 export_dynamic_flag_spec='${wl}-E' 1238 ;; 1239 1240 hpux10* | hpux11*) 1241 archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts' 1242 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' 1243 hardcode_direct=yes 1244 hardcode_minus_L=yes 1245 export_dynamic_flag_spec='${wl}-E' 1246 ;; 1247 1248 irix5* | irix6*) 1249 if test "$with_gcc" = yes; then 1250 archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' 1251 else 1252 archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' 1253 fi 1254 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 1255 hardcode_libdir_separator=: 1256 ;; 1257 1258 netbsd*) 1259 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 1260 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out 1261 else 1262 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF 1263 fi 1264 hardcode_libdir_flag_spec='${wl}-R$libdir' 1265 hardcode_direct=yes 1266 hardcode_shlibpath_var=no 1267 ;; 1268 1269 openbsd*) 1270 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' 1271 hardcode_libdir_flag_spec='-R$libdir' 1272 hardcode_direct=yes 1273 hardcode_shlibpath_var=no 1274 ;; 1275 1276 os2*) 1277 hardcode_libdir_flag_spec='-L$libdir' 1278 hardcode_minus_L=yes 1279 allow_undefined_flag=unsupported 1280 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' 1281 old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' 1282 ;; 1283 1284 osf3* | osf4*) 1285 if test "$with_gcc" = yes; then 1286 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' 1287 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' 1288 else 1289 allow_undefined_flag=' -expect_unresolved \*' 1290 archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib' 1291 fi 1292 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 1293 hardcode_libdir_separator=: 1294 ;; 1295 1296 sco3.2v5*) 1297 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' 1298 hardcode_direct=yes 1299 ;; 1300 1301 solaris*) 1302 no_undefined_flag=' -z text' 1303 # $CC -shared without GNU ld will not create a library from C++ 1304 # object files and a static libstdc++, better avoid it by now 1305 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' 1306 archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ 1307 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' 1308 hardcode_libdir_flag_spec='-R$libdir' 1309 hardcode_shlibpath_var=no 1310 ;; 1311 1312 sunos4*) 1313 # Why do we need -Bstatic? To avoid inter-library dependencies, maybe... 1314 if test "$with_gcc" = yes; then 1315 # Use -fPIC here because libgcc is multilibbed 1316 archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts' 1317 else 1318 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' 1319 fi 1320 hardcode_libdir_flag_spec='-L$libdir' 1321 hardcode_direct=yes 1322 hardcode_minus_L=yes 1323 hardcode_shlibpath_var=no 1324 ;; 1325 1326 sysv4.3*) 1327 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' 1328 hardcode_direct=no 1329 hardcode_minus_L=no 1330 hardcode_shlibpath_var=no 1331 export_dynamic_flag_spec='-Bexport' 1332 ;; 1333 1334 uts4*) 1335 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' 1336 hardcode_libdir_flag_spec='-L$libdir' 1337 hardcode_direct=no 1338 hardcode_minus_L=no 1339 hardcode_shlibpath_var=no 1340 ;; 1341 1342 dgux*) 1343 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' 1344 hardcode_libdir_flag_spec='-L$libdir' 1345 hardcode_direct=no 1346 hardcode_minus_L=no 1347 hardcode_shlibpath_var=no 1348 ;; 1349 1350 *) 1351 ld_shlibs=no 1352 can_build_shared=no 1353 ;; 1354 esac 1355fi 1356echo "$ac_t$ld_shlibs" 1>&6 1357 1358if test -z "$NM"; then 1359 echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 1360 case "$NM" in 1361 /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path. 1362 *) 1363 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 1364 for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do 1365 test -z "$ac_dir" && ac_dir=. 1366 if test -f $ac_dir/nm; then 1367 # Check to see if the nm accepts a BSD-compat flag. 1368 # Adding the `sed 1q' prevents false positives on HP-UX, which says: 1369 # nm: unknown option "B" ignored 1370 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then 1371 NM="$ac_dir/nm -B" 1372 break 1373 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then 1374 NM="$ac_dir/nm -p" 1375 break 1376 else 1377 NM=${NM="$ac_dir/nm"} # keep the first match, but 1378 continue # so that we can try to find one that supports BSD flags 1379 fi 1380 fi 1381 done 1382 IFS="$ac_save_ifs" 1383 test -z "$NM" && NM=nm 1384 ;; 1385 esac 1386 echo "$ac_t$NM" 1>&6 1387fi 1388 1389# Check for command to grab the raw symbol name followed by C symbol from nm. 1390echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 1391 1392# These are sane defaults that work on at least a few old systems. 1393# [They come from Ultrix. What could be older than Ultrix?!! ;)] 1394 1395# Character class describing NM global symbol codes. 1396symcode='[BCDEGRST]' 1397 1398# Regexp to match symbols that can be accessed directly from C. 1399sympat='\([_A-Za-z][_A-Za-z0-9]*\)' 1400 1401# Transform the above into a raw symbol and a C symbol. 1402symxfrm='\1 \2\3 \3' 1403 1404# Transform an extracted symbol line into a proper C declaration 1405global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" 1406 1407# Define system-specific variables. 1408case "$host_os" in 1409aix*) 1410 symcode='[BCDT]' 1411 ;; 1412cygwin* | mingw*) 1413 symcode='[ABCDGISTW]' 1414 ;; 1415hpux*) # Its linker distinguishes data from code symbols 1416 global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" 1417 ;; 1418irix*) 1419 symcode='[BCDEGRST]' 1420 ;; 1421solaris*) 1422 symcode='[BDT]' 1423 ;; 1424esac 1425 1426# If we're using GNU nm, then use its standard symbol codes. 1427if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then 1428 symcode='[ABCDGISTW]' 1429fi 1430 1431# Try without a prefix undercore, then with it. 1432for ac_symprfx in "" "_"; do 1433 1434 # Write the raw and C identifiers. 1435 global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" 1436 1437 # Check to see that the pipe works correctly. 1438 pipe_works=no 1439 $rm conftest* 1440 cat > conftest.c <<EOF 1441#ifdef __cplusplus 1442extern "C" { 1443#endif 1444char nm_test_var; 1445void nm_test_func(){} 1446#ifdef __cplusplus 1447} 1448#endif 1449main(){nm_test_var='a';nm_test_func();return(0);} 1450EOF 1451 1452 echo "$progname:1447: checking if global_symbol_pipe works" >&5 1453 if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then 1454 # Now try to grab the symbols. 1455 nlist=conftest.nm 1456 if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then 1457 1458 # Try sorting and uniquifying the output. 1459 if sort "$nlist" | uniq > "$nlist"T; then 1460 mv -f "$nlist"T "$nlist" 1461 else 1462 rm -f "$nlist"T 1463 fi 1464 1465 # Make sure that we snagged all the symbols we need. 1466 if egrep ' nm_test_var$' "$nlist" >/dev/null; then 1467 if egrep ' nm_test_func$' "$nlist" >/dev/null; then 1468 cat <<EOF > conftest.c 1469#ifdef __cplusplus 1470extern "C" { 1471#endif 1472 1473EOF 1474 # Now generate the symbol file. 1475 eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' 1476 1477 cat <<EOF >> conftest.c 1478#if defined (__STDC__) && __STDC__ 1479# define lt_ptr_t void * 1480#else 1481# define lt_ptr_t char * 1482# define const 1483#endif 1484 1485/* The mapping between symbol names and symbols. */ 1486const struct { 1487 const char *name; 1488 lt_ptr_t address; 1489} 1490lt_preloaded_symbols[] = 1491{ 1492EOF 1493 sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c 1494 cat <<\EOF >> conftest.c 1495 {0, (lt_ptr_t) 0} 1496}; 1497 1498#ifdef __cplusplus 1499} 1500#endif 1501EOF 1502 # Now try linking the two files. 1503 mv conftest.$objext conftestm.$objext 1504 save_LIBS="$LIBS" 1505 save_CFLAGS="$CFLAGS" 1506 LIBS="conftestm.$objext" 1507 CFLAGS="$CFLAGS$no_builtin_flag" 1508 if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1509 pipe_works=yes 1510 else 1511 echo "$progname: failed program was:" >&5 1512 cat conftest.c >&5 1513 fi 1514 LIBS="$save_LIBS" 1515 else 1516 echo "cannot find nm_test_func in $nlist" >&5 1517 fi 1518 else 1519 echo "cannot find nm_test_var in $nlist" >&5 1520 fi 1521 else 1522 echo "cannot run $global_symbol_pipe" >&5 1523 fi 1524 else 1525 echo "$progname: failed program was:" >&5 1526 cat conftest.c >&5 1527 fi 1528 $rm conftest* 1529 1530 # Do not use the global_symbol_pipe unless it works. 1531 if test "$pipe_works" = yes; then 1532 break 1533 else 1534 global_symbol_pipe= 1535 fi 1536done 1537echo "$ac_t$pipe_works" 1>&6 1538 1539if test -z "$global_symbol_pipe"; then 1540 global_symbol_to_cdecl= 1541fi 1542 1543# Check hardcoding attributes. 1544echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 1545hardcode_action= 1546if test -n "$hardcode_libdir_flag_spec" || \ 1547 test -n "$runpath_var"; then 1548 1549 # We can hardcode non-existant directories. 1550 if test "$hardcode_direct" != no && \ 1551 test "$hardcode_minus_L" != no && \ 1552 test "$hardcode_shlibpath_var" != no; then 1553 1554 # Linking always hardcodes the temporary library directory. 1555 hardcode_action=relink 1556 else 1557 # We can link without hardcoding, and we can hardcode nonexisting dirs. 1558 hardcode_action=immediate 1559 fi 1560else 1561 # We cannot hardcode anything, or else we can only hardcode existing 1562 # directories. 1563 hardcode_action=unsupported 1564fi 1565echo "$ac_t$hardcode_action" 1>&6 1566 1567 1568reload_flag= 1569reload_cmds='$LD$reload_flag -o $output$reload_objs' 1570echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 1571# PORTME Some linkers may need a different reload flag. 1572reload_flag='-r' 1573echo "$ac_t$reload_flag" 1>&6 1574test -n "$reload_flag" && reload_flag=" $reload_flag" 1575 1576# PORTME Fill in your ld.so characteristics 1577library_names_spec= 1578libname_spec='lib$name' 1579soname_spec= 1580postinstall_cmds= 1581postuninstall_cmds= 1582finish_cmds= 1583finish_eval= 1584shlibpath_var= 1585shlibpath_overrides_runpath=unknown 1586version_type=none 1587dynamic_linker="$host_os ld.so" 1588sys_lib_dlsearch_path_spec="/lib /usr/lib" 1589sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" 1590file_magic_cmd= 1591file_magic_test_file= 1592deplibs_check_method='unknown' 1593# Need to set the preceding variable on all platforms that support 1594# interlibrary dependencies. 1595# 'none' -- dependencies not supported. 1596# `unknown' -- same as none, but documents that we really don't know. 1597# 'pass_all' -- all dependencies passed with no checks. 1598# 'test_compile' -- check by making test program. 1599# 'file_magic [regex]' -- check by looking for files in library path 1600# which responds to the $file_magic_cmd with a given egrep regex. 1601# If you have `file' or equivalent on your system and you're not sure 1602# whether `pass_all' will *always* work, you probably want this one. 1603echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 1604case "$host_os" in 1605aix3*) 1606 version_type=linux 1607 library_names_spec='${libname}${release}.so$versuffix $libname.a' 1608 shlibpath_var=LIBPATH 1609 1610 # AIX has no versioning support, so we append a major version to the name. 1611 soname_spec='${libname}${release}.so$major' 1612 ;; 1613 1614aix4*) 1615 version_type=linux 1616 # AIX has no versioning support, so currently we can not hardcode correct 1617 # soname into executable. Probably we can add versioning support to 1618 # collect2, so additional links can be useful in future. 1619 # We preserve .a as extension for shared libraries though AIX4.2 1620 # and later linker supports .so 1621 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' 1622 shlibpath_var=LIBPATH 1623 deplibs_check_method=pass_all 1624 ;; 1625 1626amigaos*) 1627 library_names_spec='$libname.ixlibrary $libname.a' 1628 # Create ${libname}_ixlibrary.a entries in /sys/libs. 1629 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' 1630 ;; 1631 1632beos*) 1633 library_names_spec='${libname}.so' 1634 dynamic_linker="$host_os ld.so" 1635 shlibpath_var=LIBRARY_PATH 1636 ;; 1637 1638haiku*) 1639 library_names_spec='${libname}.so' 1640 dynamic_linker="$host_os runtime_loader" 1641 shlibpath_var=LIBRARY_PATH 1642 ;; 1643 1644bsdi4*) 1645 version_type=linux 1646 library_names_spec='${libname}.so$major ${libname}.so' 1647 soname_spec='${libname}.so' 1648 finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir' 1649 shlibpath_var=LD_LIBRARY_PATH 1650 deplibs_check_method='file_magic ELF 32-bit LSB shared object' 1651 file_magic_cmd=/usr/bin/file 1652 file_magic_test_file=/shlib/libc.so 1653 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" 1654 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" 1655 # the default ld.so.conf also contains /usr/contrib/lib and 1656 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow 1657 # libtool to hard-code these into programs 1658 ;; 1659 1660cygwin* | mingw*) 1661 version_type=windows 1662 if test "$with_gcc" = yes; then 1663 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' 1664 else 1665 library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' 1666 fi 1667 dynamic_linker='Win32 ld.exe' 1668 deplibs_check_method='file_magic file format pei*-i386.*architecture: i386' 1669 file_magic_cmd='objdump -f' 1670 need_lib_prefix=no 1671 # FIXME: first we should search . and the directory the executable is in 1672 shlibpath_var=PATH 1673 ;; 1674 1675freebsd1*) 1676 dynamic_linker=no 1677 ;; 1678 1679freebsd*) 1680 objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` 1681 version_type=freebsd-$objformat 1682 case "$version_type" in 1683 freebsd-elf*) 1684 deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' 1685 file_magic_cmd=/usr/bin/file 1686 file_magic_test_file=`echo /usr/lib/libc.so*` 1687 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' 1688 need_version=no 1689 need_lib_prefix=no 1690 ;; 1691 freebsd-*) 1692 deplibs_check_method=unknown 1693 library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' 1694 need_version=yes 1695 ;; 1696 esac 1697 finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir' 1698 shlibpath_var=LD_LIBRARY_PATH 1699 ;; 1700 1701gnu*) 1702 version_type=linux 1703 library_names_spec='${libname}${release}.so$versuffix ${libname}.so' 1704 shlibpath_var=LD_LIBRARY_PATH 1705 ;; 1706 1707hpux9* | hpux10* | hpux11*) 1708 # Give a soname corresponding to the major version so that dld.sl refuses to 1709 # link against other versions. 1710 dynamic_linker="$host_os dld.sl" 1711 version_type=sunos 1712 need_lib_prefix=no 1713 need_version=no 1714 shlibpath_var=SHLIB_PATH 1715 library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' 1716 soname_spec='${libname}${release}.sl$major' 1717 # HP-UX runs *really* slowly unless shared libraries are mode 555. 1718 postinstall_cmds='chmod 555 $lib' 1719 ;; 1720 1721irix5*) 1722 version_type=irix 1723 soname_spec='${libname}${release}.so' 1724 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' 1725 shlibpath_var=LD_LIBRARY_PATH 1726 deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" # or should it be pass_all? 1727 file_magic_cmd=/usr/bin/file 1728 file_magic_test_file=`echo /lib/libc.so*` 1729 shlibpath_overrides_runpath=no 1730 ;; 1731 1732irix6*) 1733 version_type=irix 1734 need_lib_prefix=no 1735 need_version=no 1736 soname_spec='${libname}${release}.so' 1737 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' 1738 case "$LD" in # libtool.m4 will add one of these switches to LD 1739 *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; 1740 *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; 1741 *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; 1742 *) libsuff= shlibsuff= libmagic=never-match;; 1743 esac 1744 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH 1745 shlibpath_overrides_runpath=no 1746 # even though /usr/local/lib is always searched, the man-page says 1747 # shared libraries should not be installed there if they use an ABI 1748 # different from -32, so we'd better not search for shared libraries 1749 # there either 1750 sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" 1751 sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" 1752 deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" # or should it be pass_all? 1753 file_magic_cmd=/usr/bin/file 1754 file_magic_test_file=`echo /lib${libsuff}/libc.so*` 1755 ;; 1756 1757# No shared lib support for Linux oldld, aout, or coff. 1758linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) 1759 dynamic_linker=no 1760 ;; 1761 1762# This must be Linux ELF. 1763linux-gnu*) 1764 version_type=linux 1765 need_lib_prefix=no 1766 need_version=no 1767 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 1768 soname_spec='${libname}${release}.so$major' 1769 finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir' 1770 shlibpath_var=LD_LIBRARY_PATH 1771 shlibpath_overrides_runpath=no 1772 deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' 1773 file_magic_cmd=/usr/bin/file 1774 file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` 1775 1776 if test -f /lib/ld.so.1; then 1777 dynamic_linker='GNU ld.so' 1778 else 1779 # Only the GNU ld.so supports shared libraries on MkLinux. 1780 case "$host_cpu" in 1781 powerpc*) dynamic_linker=no ;; 1782 *) dynamic_linker='Linux ld.so' ;; 1783 esac 1784 fi 1785 ;; 1786 1787netbsd*) 1788 version_type=sunos 1789 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then 1790 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' 1791 finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir' 1792 dynamic_linker='NetBSD (a.out) ld.so' 1793 else 1794 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' 1795 soname_spec='${libname}${release}.so$major' 1796 dynamic_linker='NetBSD ld.elf_so' 1797 fi 1798 shlibpath_var=LD_LIBRARY_PATH 1799 ;; 1800 1801openbsd*) 1802 version_type=sunos 1803 if test "$with_gnu_ld" = yes; then 1804 need_lib_prefix=no 1805 need_version=no 1806 fi 1807 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' 1808 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' 1809 shlibpath_var=LD_LIBRARY_PATH 1810 ;; 1811 1812os2*) 1813 libname_spec='$name' 1814 need_lib_prefix=no 1815 library_names_spec='$libname.dll $libname.a' 1816 dynamic_linker='OS/2 ld.exe' 1817 shlibpath_var=LIBPATH 1818 ;; 1819 1820osf3* | osf4*) 1821 version_type=osf 1822 soname_spec='${libname}${release}.so' 1823 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' 1824 shlibpath_var=LD_LIBRARY_PATH 1825 # deplibs_check_method='pass_all' 1826 # Although pass_all appears to work, it copies symbols from static libraries 1827 # into shared ones and exports them. So, when a program is linked with two 1828 # or more libraries that have got copies of the same symbols, link fails 1829 # This was only tested on osf4: 1830 deplibs_check_method='file_magic COFF format alpha shared library' 1831 file_magic_cmd=/usr/bin/file 1832 file_magic_test_file=/shlib/libc.so 1833 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" 1834 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" 1835 ;; 1836 1837sco3.2v5*) 1838 version_type=osf 1839 soname_spec='${libname}${release}.so$major' 1840 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 1841 shlibpath_var=LD_LIBRARY_PATH 1842 ;; 1843 1844solaris*) 1845 version_type=linux 1846 need_lib_prefix=no 1847 need_version=no 1848 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 1849 soname_spec='${libname}${release}.so$major' 1850 shlibpath_var=LD_LIBRARY_PATH 1851 shlibpath_overrides_runpath=yes 1852 # ldd complains unless libraries are executable 1853 postinstall_cmds='chmod +x $lib' 1854 deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" 1855 file_magic_cmd=/usr/bin/file 1856 file_magic_test_file=/lib/libc.so 1857 ;; 1858 1859sunos4*) 1860 version_type=sunos 1861 library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' 1862 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' 1863 shlibpath_var=LD_LIBRARY_PATH 1864 shlibpath_overrides_runpath=yes 1865 if test "$with_gnu_ld" = yes; then 1866 need_lib_prefix=no 1867 fi 1868 need_version=yes 1869 ;; 1870 1871sysv4.2uw2* | sysv4.3* | sysv5*) 1872 version_type=linux 1873 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 1874 soname_spec='${libname}${release}.so$major' 1875 shlibpath_var=LD_LIBRARY_PATH 1876 case "$host_vendor" in 1877 ncr) 1878 deplibs_check_method='pass_all' 1879 ;; 1880 esac 1881 ;; 1882 1883uts4*) 1884 version_type=linux 1885 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 1886 soname_spec='${libname}${release}.so$major' 1887 shlibpath_var=LD_LIBRARY_PATH 1888 ;; 1889 1890dgux*) 1891 version_type=linux 1892 need_lib_prefix=no 1893 need_version=no 1894 library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' 1895 soname_spec='${libname}${release}.so$major' 1896 shlibpath_var=LD_LIBRARY_PATH 1897 ;; 1898 1899*) 1900 dynamic_linker=no 1901 ;; 1902esac 1903echo "$ac_t$dynamic_linker" 1>&6 1904test "$dynamic_linker" = no && can_build_shared=no 1905 1906# Report the final consequences. 1907echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 1908 1909if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then 1910 case "$deplibs_check_method" in 1911 "file_magic "*) 1912 file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" 1913 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | 1914 egrep "$file_magic_regex" > /dev/null; then 1915 : 1916 else 1917 cat <<EOF 1>&2 1918 1919*** Warning: the command libtool uses to detect shared libraries, 1920*** $file_magic_cmd, produces output that libtool cannot recognize. 1921*** The result is that libtool may fail to recognize shared libraries 1922*** as such. This will affect the creation of libtool libraries that 1923*** depend on shared libraries, but programs linked with such libtool 1924*** libraries will work regardless of this problem. Nevertheless, you 1925*** may want to report the problem to your system manager and/or to 1926*** bug-libtool@gnu.org 1927 1928EOF 1929 fi ;; 1930 esac 1931fi 1932 1933echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 1934test "$can_build_shared" = "no" && enable_shared=no 1935 1936# On AIX, shared libraries and static libraries use the same namespace, and 1937# are all built from PIC. 1938case "$host_os" in 1939aix3*) 1940 test "$enable_shared" = yes && enable_static=no 1941 if test -n "$RANLIB"; then 1942 archive_cmds="$archive_cmds~\$RANLIB \$lib" 1943 postinstall_cmds='$RANLIB $lib' 1944 fi 1945 ;; 1946 1947aix4*) 1948 test "$enable_shared" = yes && enable_static=no 1949 ;; 1950esac 1951 1952echo "$ac_t$enable_shared" 1>&6 1953 1954# Make sure either enable_shared or enable_static is yes. 1955test "$enable_shared" = yes || enable_static=yes 1956 1957echo "checking whether to build static libraries... $enable_static" 1>&6 1958 1959if test "$hardcode_action" = relink; then 1960 # Fast installation is not supported 1961 enable_fast_install=no 1962elif test "$shlibpath_overrides_runpath" = yes || 1963 test "$enable_shared" = no; then 1964 # Fast installation is not necessary 1965 enable_fast_install=needless 1966fi 1967 1968echo $ac_n "checking for objdir... $ac_c" 1>&6 1969rm -f .libs 2>/dev/null 1970mkdir .libs 2>/dev/null 1971if test -d .libs; then 1972 objdir=.libs 1973else 1974 # MS-DOS does not allow filenames that begin with a dot. 1975 objdir=_libs 1976fi 1977rmdir .libs 2>/dev/null 1978echo "$ac_t$objdir" 1>&6 1979 1980if test "x$enable_dlopen" != xyes; then 1981 enable_dlopen=unknown 1982 enable_dlopen_self=unknown 1983 enable_dlopen_self_static=unknown 1984else 1985if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then 1986 lt_cv_dlopen=no lt_cv_dlopen_libs= 1987echo $ac_n "checking for dlopen""... $ac_c" 1>&6 1988echo "$progname:1977: checking for dlopen" >&5 1989if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then 1990 echo $ac_n "(cached) $ac_c" 1>&6 1991else 1992 cat > conftest.$ac_ext <<EOF 1993#line 1982 "ltconfig" 1994/* System header to define __stub macros and hopefully few prototypes, 1995 which can conflict with char dlopen(); below. */ 1996#include <assert.h> 1997/* Override any gcc2 internal prototype to avoid an error. */ 1998/* We use char because int might match the return type of a gcc2 1999 builtin and then its argument prototype would still apply. */ 2000char dlopen(); 2001 2002int main() { 2003 2004/* The GNU C library defines this for functions which it implements 2005 to always fail with ENOSYS. Some functions are actually named 2006 something starting with __ and the normal name is an alias. */ 2007#if defined (__stub_dlopen) || defined (__stub___dlopen) 2008choke me 2009#else 2010dlopen(); 2011#endif 2012 2013; return 0; } 2014EOF 2015if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2016 rm -rf conftest* 2017 eval "ac_cv_func_dlopen=yes" 2018else 2019 echo "$progname: failed program was:" >&5 2020 cat conftest.$ac_ext >&5 2021 rm -rf conftest* 2022 eval "ac_cv_func_dlopen=no" 2023fi 2024rm -f conftest* 2025fi 2026 2027if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then 2028 echo "$ac_t""yes" 1>&6 2029 lt_cv_dlopen="dlopen" 2030else 2031 echo "$ac_t""no" 1>&6 2032echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 2033echo "$progname:2022: checking for dlopen in -ldl" >&5 2034ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` 2035if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 2036 echo $ac_n "(cached) $ac_c" 1>&6 2037else 2038 ac_save_LIBS="$LIBS" 2039LIBS="-ldl $LIBS" 2040cat > conftest.$ac_ext <<EOF 2041#line 2030 "ltconfig" 2042/* Override any gcc2 internal prototype to avoid an error. */ 2043/* We use char because int might match the return type of a gcc2 2044 builtin and then its argument prototype would still apply. */ 2045char dlopen(); 2046 2047int main() { 2048dlopen() 2049; return 0; } 2050EOF 2051if { (eval echo $progname:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2052 rm -rf conftest* 2053 eval "ac_cv_lib_$ac_lib_var=yes" 2054else 2055 echo "$progname: failed program was:" >&5 2056 cat conftest.$ac_ext >&5 2057 rm -rf conftest* 2058 eval "ac_cv_lib_$ac_lib_var=no" 2059fi 2060rm -f conftest* 2061LIBS="$ac_save_LIBS" 2062 2063fi 2064if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 2065 echo "$ac_t""yes" 1>&6 2066 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" 2067else 2068 echo "$ac_t""no" 1>&6 2069echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 2070echo "$progname:2059: checking for dld_link in -ldld" >&5 2071ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'` 2072if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 2073 echo $ac_n "(cached) $ac_c" 1>&6 2074else 2075 ac_save_LIBS="$LIBS" 2076LIBS="-ldld $LIBS" 2077cat > conftest.$ac_ext <<EOF 2078#line 2067 "ltconfig" 2079/* Override any gcc2 internal prototype to avoid an error. */ 2080/* We use char because int might match the return type of a gcc2 2081 builtin and then its argument prototype would still apply. */ 2082char dld_link(); 2083 2084int main() { 2085dld_link() 2086; return 0; } 2087EOF 2088if { (eval echo $progname:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2089 rm -rf conftest* 2090 eval "ac_cv_lib_$ac_lib_var=yes" 2091else 2092 echo "$progname: failed program was:" >&5 2093 cat conftest.$ac_ext >&5 2094 rm -rf conftest* 2095 eval "ac_cv_lib_$ac_lib_var=no" 2096fi 2097rm -f conftest* 2098LIBS="$ac_save_LIBS" 2099 2100fi 2101if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 2102 echo "$ac_t""yes" 1>&6 2103 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" 2104else 2105 echo "$ac_t""no" 1>&6 2106echo $ac_n "checking for shl_load""... $ac_c" 1>&6 2107echo "$progname:2096: checking for shl_load" >&5 2108if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then 2109 echo $ac_n "(cached) $ac_c" 1>&6 2110else 2111 cat > conftest.$ac_ext <<EOF 2112#line 2101 "ltconfig" 2113/* System header to define __stub macros and hopefully few prototypes, 2114 which can conflict with char shl_load(); below. */ 2115#include <assert.h> 2116/* Override any gcc2 internal prototype to avoid an error. */ 2117/* We use char because int might match the return type of a gcc2 2118 builtin and then its argument prototype would still apply. */ 2119char shl_load(); 2120 2121int main() { 2122 2123/* The GNU C library defines this for functions which it implements 2124 to always fail with ENOSYS. Some functions are actually named 2125 something starting with __ and the normal name is an alias. */ 2126#if defined (__stub_shl_load) || defined (__stub___shl_load) 2127choke me 2128#else 2129shl_load(); 2130#endif 2131 2132; return 0; } 2133EOF 2134if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2135 rm -rf conftest* 2136 eval "ac_cv_func_shl_load=yes" 2137else 2138 echo "$progname: failed program was:" >&5 2139 cat conftest.$ac_ext >&5 2140 rm -rf conftest* 2141 eval "ac_cv_func_shl_load=no" 2142fi 2143rm -f conftest* 2144fi 2145 2146if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then 2147 echo "$ac_t""yes" 1>&6 2148 lt_cv_dlopen="shl_load" 2149else 2150 echo "$ac_t""no" 1>&6 2151echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6 2152echo "$progname:2141: checking for LoadLibrary" >&5 2153if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then 2154 echo $ac_n "(cached) $ac_c" 1>&6 2155else 2156 cat > conftest.$ac_ext <<EOF 2157#line 2146 "ltconfig" 2158/* System header to define __stub macros and hopefully few prototypes, 2159 which can conflict with char LoadLibrary(); below. */ 2160#include <assert.h> 2161/* Override any gcc2 internal prototype to avoid an error. */ 2162/* We use char because int might match the return type of a gcc2 2163 builtin and then its argument prototype would still apply. */ 2164char LoadLibrary(); 2165 2166int main() { 2167 2168/* The GNU C library defines this for functions which it implements 2169 to always fail with ENOSYS. Some functions are actually named 2170 something starting with __ and the normal name is an alias. */ 2171#if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary) 2172choke me 2173#else 2174LoadLibrary(); 2175#endif 2176 2177; return 0; } 2178EOF 2179if { (eval echo $progname:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 2180 rm -rf conftest* 2181 eval "ac_cv_func_LoadLibrary=yes" 2182else 2183 echo "$progname: failed program was:" >&5 2184 cat conftest.$ac_ext >&5 2185 rm -rf conftest* 2186 eval "ac_cv_func_LoadLibrary=no" 2187fi 2188rm -f conftest* 2189fi 2190 2191if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then 2192 echo "$ac_t""yes" 1>&6 2193 lt_cv_dlopen="LoadLibrary" 2194else 2195 echo "$ac_t""no" 1>&6 2196fi 2197 2198 2199fi 2200 2201 2202fi 2203 2204 2205fi 2206 2207 2208fi 2209 2210fi 2211 2212 if test "x$lt_cv_dlopen" != xno; then 2213 enable_dlopen=yes 2214 fi 2215 2216 case "$lt_cv_dlopen" in 2217 dlopen) 2218for ac_hdr in dlfcn.h; do 2219ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 2220echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 2221echo "$progname:2210: checking for $ac_hdr" >&5 2222if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2223 echo $ac_n "(cached) $ac_c" 1>&6 2224else 2225 cat > conftest.$ac_ext <<EOF 2226#line 2215 "ltconfig" 2227#include <$ac_hdr> 2228int fnord = 0; 2229EOF 2230ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out" 2231{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2232ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 2233if test -z "$ac_err"; then 2234 rm -rf conftest* 2235 eval "ac_cv_header_$ac_safe=yes" 2236else 2237 echo "$ac_err" >&5 2238 echo "$progname: failed program was:" >&5 2239 cat conftest.$ac_ext >&5 2240 rm -rf conftest* 2241 eval "ac_cv_header_$ac_safe=no" 2242fi 2243rm -f conftest* 2244fi 2245if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then 2246 echo "$ac_t""yes" 1>&6 2247else 2248 echo "$ac_t""no" 1>&6 2249fi 2250done 2251 2252 if test "x$ac_cv_header_dlfcn_h" = xyes; then 2253 CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" 2254 fi 2255 eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" 2256 LIBS="$lt_cv_dlopen_libs $LIBS" 2257 2258 echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 2259echo "$progname:2248: checking whether a program can dlopen itself" >&5 2260if test "${lt_cv_dlopen_self+set}" = set; then 2261 echo $ac_n "(cached) $ac_c" 1>&6 2262else 2263 if test "$cross_compiling" = yes; then 2264 lt_cv_dlopen_self=cross 2265 else 2266 cat > conftest.c <<EOF 2267#line 2256 "ltconfig" 2268 2269#if HAVE_DLFCN_H 2270#include <dlfcn.h> 2271#endif 2272 2273#include <stdio.h> 2274 2275#ifdef RTLD_GLOBAL 2276# define LTDL_GLOBAL RTLD_GLOBAL 2277#else 2278# ifdef DL_GLOBAL 2279# define LTDL_GLOBAL DL_GLOBAL 2280# else 2281# define LTDL_GLOBAL 0 2282# endif 2283#endif 2284 2285/* We may have to define LTDL_LAZY_OR_NOW in the command line if we 2286 find out it does not work in some platform. */ 2287#ifndef LTDL_LAZY_OR_NOW 2288# ifdef RTLD_LAZY 2289# define LTDL_LAZY_OR_NOW RTLD_LAZY 2290# else 2291# ifdef DL_LAZY 2292# define LTDL_LAZY_OR_NOW DL_LAZY 2293# else 2294# ifdef RTLD_NOW 2295# define LTDL_LAZY_OR_NOW RTLD_NOW 2296# else 2297# ifdef DL_NOW 2298# define LTDL_LAZY_OR_NOW DL_NOW 2299# else 2300# define LTDL_LAZY_OR_NOW 0 2301# endif 2302# endif 2303# endif 2304# endif 2305#endif 2306 2307fnord() { int i=42;} 2308main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); 2309 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); 2310 if(ptr1 || ptr2) exit(0); } exit(1); } 2311 2312EOF 2313if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 2314then 2315 lt_cv_dlopen_self=yes 2316else 2317 echo "$progname: failed program was:" >&5 2318 cat conftest.$ac_ext >&5 2319 rm -fr conftest* 2320 lt_cv_dlopen_self=no 2321fi 2322rm -fr conftest* 2323fi 2324 2325fi 2326 2327echo "$ac_t""$lt_cv_dlopen_self" 1>&6 2328 2329 if test "$lt_cv_dlopen_self" = yes; then 2330 LDFLAGS="$LDFLAGS $link_static_flag" 2331 echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 2332echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5 2333if test "${lt_cv_dlopen_self_static+set}" = set; then 2334 echo $ac_n "(cached) $ac_c" 1>&6 2335else 2336 if test "$cross_compiling" = yes; then 2337 lt_cv_dlopen_self_static=cross 2338 else 2339 cat > conftest.c <<EOF 2340#line 2329 "ltconfig" 2341 2342#if HAVE_DLFCN_H 2343#include <dlfcn.h> 2344#endif 2345 2346#include <stdio.h> 2347 2348#ifdef RTLD_GLOBAL 2349# define LTDL_GLOBAL RTLD_GLOBAL 2350#else 2351# ifdef DL_GLOBAL 2352# define LTDL_GLOBAL DL_GLOBAL 2353# else 2354# define LTDL_GLOBAL 0 2355# endif 2356#endif 2357 2358/* We may have to define LTDL_LAZY_OR_NOW in the command line if we 2359 find out it does not work in some platform. */ 2360#ifndef LTDL_LAZY_OR_NOW 2361# ifdef RTLD_LAZY 2362# define LTDL_LAZY_OR_NOW RTLD_LAZY 2363# else 2364# ifdef DL_LAZY 2365# define LTDL_LAZY_OR_NOW DL_LAZY 2366# else 2367# ifdef RTLD_NOW 2368# define LTDL_LAZY_OR_NOW RTLD_NOW 2369# else 2370# ifdef DL_NOW 2371# define LTDL_LAZY_OR_NOW DL_NOW 2372# else 2373# define LTDL_LAZY_OR_NOW 0 2374# endif 2375# endif 2376# endif 2377# endif 2378#endif 2379 2380fnord() { int i=42;} 2381main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); 2382 if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); 2383 if(ptr1 || ptr2) exit(0); } exit(1); } 2384 2385EOF 2386if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 2387then 2388 lt_cv_dlopen_self_static=yes 2389else 2390 echo "$progname: failed program was:" >&5 2391 cat conftest.$ac_ext >&5 2392 rm -fr conftest* 2393 lt_cv_dlopen_self_static=no 2394fi 2395rm -fr conftest* 2396fi 2397 2398fi 2399 2400echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 2401fi 2402 ;; 2403 esac 2404 2405 case "$lt_cv_dlopen_self" in 2406 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; 2407 *) enable_dlopen_self=unknown ;; 2408 esac 2409 2410 case "$lt_cv_dlopen_self_static" in 2411 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; 2412 *) enable_dlopen_self_static=unknown ;; 2413 esac 2414fi 2415 2416# Copy echo and quote the copy, instead of the original, because it is 2417# used later. 2418ltecho="$echo" 2419if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then 2420 ltecho="$CONFIG_SHELL \$0 --fallback-echo" 2421fi 2422LTSHELL="$SHELL" 2423 2424LTCONFIG_VERSION="$VERSION" 2425 2426# Only quote variables if we're using ltmain.sh. 2427case "$ltmain" in 2428*.sh) 2429 # Now quote all the things that may contain metacharacters. 2430 for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ 2431 old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ 2432 reload_flag reload_cmds wl \ 2433 pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ 2434 thread_safe_flag_spec whole_archive_flag_spec libname_spec \ 2435 library_names_spec soname_spec \ 2436 RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ 2437 old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ 2438 file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ 2439 finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ 2440 hardcode_libdir_flag_spec hardcode_libdir_separator \ 2441 sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ 2442 compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do 2443 2444 case "$var" in 2445 reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ 2446 old_postinstall_cmds | old_postuninstall_cmds | \ 2447 export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ 2448 postinstall_cmds | postuninstall_cmds | \ 2449 finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) 2450 # Double-quote double-evaled strings. 2451 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" 2452 ;; 2453 *) 2454 eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" 2455 ;; 2456 esac 2457 done 2458 2459 case "$ltecho" in 2460 *'\$0 --fallback-echo"') 2461 ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` 2462 ;; 2463 esac 2464 2465 trap "$rm \"$ofile\"; exit 1" 1 2 15 2466 echo "creating $ofile" 2467 $rm "$ofile" 2468 cat <<EOF > "$ofile" 2469#! $SHELL 2470 2471# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. 2472# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) 2473# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. 2474# 2475# Copyright (C) 1996-1999 Free Software Foundation, Inc. 2476# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 2477# 2478# This program is free software; you can redistribute it and/or modify 2479# it under the terms of the GNU General Public License as published by 2480# the Free Software Foundation; either version 2 of the License, or 2481# (at your option) any later version. 2482# 2483# This program is distributed in the hope that it will be useful, but 2484# WITHOUT ANY WARRANTY; without even the implied warranty of 2485# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 2486# General Public License for more details. 2487# 2488# You should have received a copy of the GNU General Public License 2489# along with this program; if not, write to the Free Software 2490# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2491# 2492# As a special exception to the GNU General Public License, if you 2493# distribute this file as part of a program that contains a 2494# configuration script generated by Autoconf, you may include it under 2495# the same distribution terms that you use for the rest of that program. 2496 2497# Sed that helps us avoid accidentally triggering echo(1) options like -n. 2498Xsed="sed -e s/^X//" 2499 2500# The HP-UX ksh and POSIX shell print the target directory to stdout 2501# if CDPATH is set. 2502if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi 2503 2504### BEGIN LIBTOOL CONFIG 2505EOF 2506 cfgfile="$ofile" 2507 ;; 2508 2509*) 2510 # Double-quote the variables that need it (for aesthetics). 2511 for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ 2512 old_LN_S old_DLLTOOL old_AS; do 2513 eval "$var=\\\"\$var\\\"" 2514 done 2515 2516 # Just create a config file. 2517 cfgfile="$ofile.cfg" 2518 trap "$rm \"$cfgfile\"; exit 1" 1 2 15 2519 echo "creating $cfgfile" 2520 $rm "$cfgfile" 2521 cat <<EOF > "$cfgfile" 2522# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. 2523# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) 2524EOF 2525 ;; 2526esac 2527 2528cat <<EOF >> "$cfgfile" 2529# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: 2530# 2531# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ 2532# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ 2533# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\ 2534# $0$ltconfig_args 2535# 2536# Compiler and other test output produced by $progname, useful for 2537# debugging $progname, is in ./config.log if it exists. 2538 2539# The version of $progname that generated this script. 2540LTCONFIG_VERSION=$LTCONFIG_VERSION 2541 2542# Shell to use when invoking shell scripts. 2543SHELL=$LTSHELL 2544 2545# Whether or not to build shared libraries. 2546build_libtool_libs=$enable_shared 2547 2548# Whether or not to build static libraries. 2549build_old_libs=$enable_static 2550 2551# Whether or not to optimize for fast installation. 2552fast_install=$enable_fast_install 2553 2554# The host system. 2555host_alias=$host_alias 2556host=$host 2557 2558# An echo program that does not interpret backslashes. 2559echo=$ltecho 2560 2561# The archiver. 2562AR=$AR 2563 2564# The default C compiler. 2565CC=$CC 2566 2567# The linker used to build libraries. 2568LD=$LD 2569 2570# Whether we need hard or soft links. 2571LN_S=$LN_S 2572 2573# A BSD-compatible nm program. 2574NM=$NM 2575 2576# Used on cygwin: DLL creation program. 2577DLLTOOL="$DLLTOOL" 2578 2579# Used on cygwin: assembler. 2580AS="$AS" 2581 2582# The name of the directory that contains temporary libtool files. 2583objdir=$objdir 2584 2585# How to create reloadable object files. 2586reload_flag=$reload_flag 2587reload_cmds=$reload_cmds 2588 2589# How to pass a linker flag through the compiler. 2590wl=$wl 2591 2592# Object file suffix (normally "o"). 2593objext="$objext" 2594 2595# Old archive suffix (normally "a"). 2596libext="$libext" 2597 2598# Additional compiler flags for building library objects. 2599pic_flag=$pic_flag 2600 2601# Does compiler simultaneously support -c and -o options 2602compiler_c_o=$compiler_c_o 2603 2604# Can we write directly to a .lo ? 2605compiler_o_lo=$compiler_o_lo 2606 2607# Must we lock files when doing compilation ? 2608need_locks=$need_locks 2609 2610# Do we need the lib prefix for modules? 2611need_lib_prefix=$need_lib_prefix 2612 2613# Do we need a version for libraries? 2614need_version=$need_version 2615 2616# Whether dlopen is supported. 2617dlopen=$enable_dlopen 2618 2619# Whether dlopen of programs is supported. 2620dlopen_self=$enable_dlopen_self 2621 2622# Whether dlopen of statically linked programs is supported. 2623dlopen_self_static=$enable_dlopen_self_static 2624 2625# Compiler flag to prevent dynamic linking. 2626link_static_flag=$link_static_flag 2627 2628# Compiler flag to turn off builtin functions. 2629no_builtin_flag=$no_builtin_flag 2630 2631# Compiler flag to allow reflexive dlopens. 2632export_dynamic_flag_spec=$export_dynamic_flag_spec 2633 2634# Compiler flag to generate shared objects directly from archives. 2635whole_archive_flag_spec=$whole_archive_flag_spec 2636 2637# Compiler flag to generate thread-safe objects. 2638thread_safe_flag_spec=$thread_safe_flag_spec 2639 2640# Library versioning type. 2641version_type=$version_type 2642 2643# Format of library name prefix. 2644libname_spec=$libname_spec 2645 2646# List of archive names. First name is the real one, the rest are links. 2647# The last name is the one that the linker finds with -lNAME. 2648library_names_spec=$library_names_spec 2649 2650# The coded name of the library, if different from the real name. 2651soname_spec=$soname_spec 2652 2653# Commands used to build and install an old-style archive. 2654RANLIB=$RANLIB 2655old_archive_cmds=$old_archive_cmds 2656old_postinstall_cmds=$old_postinstall_cmds 2657old_postuninstall_cmds=$old_postuninstall_cmds 2658 2659# Create an old-style archive from a shared archive. 2660old_archive_from_new_cmds=$old_archive_from_new_cmds 2661 2662# Commands used to build and install a shared archive. 2663archive_cmds=$archive_cmds 2664archive_expsym_cmds=$archive_expsym_cmds 2665postinstall_cmds=$postinstall_cmds 2666postuninstall_cmds=$postuninstall_cmds 2667 2668# Method to check whether dependent libraries are shared objects. 2669deplibs_check_method=$deplibs_check_method 2670 2671# Command to use when deplibs_check_method == file_magic 2672file_magic_cmd=$file_magic_cmd 2673 2674# Flag that allows shared libraries with undefined symbols to be built. 2675allow_undefined_flag=$allow_undefined_flag 2676 2677# Flag that forces no undefined symbols. 2678no_undefined_flag=$no_undefined_flag 2679 2680# Commands used to finish a libtool library installation in a directory. 2681finish_cmds=$finish_cmds 2682 2683# Same as above, but a single script fragment to be evaled but not shown. 2684finish_eval=$finish_eval 2685 2686# Take the output of nm and produce a listing of raw symbols and C names. 2687global_symbol_pipe=$global_symbol_pipe 2688 2689# Transform the output of nm in a proper C declaration 2690global_symbol_to_cdecl=$global_symbol_to_cdecl 2691 2692# This is the shared library runtime path variable. 2693runpath_var=$runpath_var 2694 2695# This is the shared library path variable. 2696shlibpath_var=$shlibpath_var 2697 2698# Is shlibpath searched before the hard-coded library search path? 2699shlibpath_overrides_runpath=$shlibpath_overrides_runpath 2700 2701# How to hardcode a shared library path into an executable. 2702hardcode_action=$hardcode_action 2703 2704# Flag to hardcode \$libdir into a binary during linking. 2705# This must work even if \$libdir does not exist. 2706hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec 2707 2708# Whether we need a single -rpath flag with a separated argument. 2709hardcode_libdir_separator=$hardcode_libdir_separator 2710 2711# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the 2712# resulting binary. 2713hardcode_direct=$hardcode_direct 2714 2715# Set to yes if using the -LDIR flag during linking hardcodes DIR into the 2716# resulting binary. 2717hardcode_minus_L=$hardcode_minus_L 2718 2719# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into 2720# the resulting binary. 2721hardcode_shlibpath_var=$hardcode_shlibpath_var 2722 2723# Compile-time system search path for libraries 2724sys_lib_search_path_spec=$sys_lib_search_path_spec 2725 2726# Run-time system search path for libraries 2727sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec 2728 2729# Fix the shell variable \$srcfile for the compiler. 2730fix_srcfile_path="$fix_srcfile_path" 2731 2732# Set to yes if exported symbols are required 2733always_export_symbols=$always_export_symbols 2734 2735# The command to extract exported symbols 2736export_symbols_cmds=$export_symbols_cmds 2737 2738# Symbols that should not be listed in the preloaded symbols 2739exclude_expsyms=$exclude_expsyms 2740 2741# Symbols that must always be exported 2742include_expsyms=$include_expsyms 2743 2744EOF 2745 2746case "$ltmain" in 2747*.sh) 2748 echo '### END LIBTOOL CONFIG' >> "$ofile" 2749 echo >> "$ofile" 2750 case "$host_os" in 2751 aix3*) 2752 cat <<\EOF >> "$ofile" 2753 2754# AIX sometimes has problems with the GCC collect2 program. For some 2755# reason, if we set the COLLECT_NAMES environment variable, the problems 2756# vanish in a puff of smoke. 2757if test "${COLLECT_NAMES+set}" != set; then 2758 COLLECT_NAMES= 2759 export COLLECT_NAMES 2760fi 2761EOF 2762 ;; 2763 esac 2764 2765 # Append the ltmain.sh script. 2766 cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) 2767 2768 chmod +x "$ofile" 2769 ;; 2770 2771*) 2772 # Compile the libtool program. 2773 echo "FIXME: would compile $ltmain" 2774 ;; 2775esac 2776 2777test -n "$cache_file" || exit 0 2778 2779# AC_CACHE_SAVE 2780trap '' 1 2 15 2781cat > confcache <<\EOF 2782# This file is a shell script that caches the results of configure 2783# tests run on this system so they can be shared between configure 2784# scripts and configure runs. It is not useful on other systems. 2785# If it contains results you don't want to keep, you may remove or edit it. 2786# 2787# By default, configure uses ./config.cache as the cache file, 2788# creating it if it does not exist already. You can give configure 2789# the --cache-file=FILE option to use a different cache file; that is 2790# what configure does when it calls configure scripts in 2791# subdirectories, so they share the cache. 2792# Giving --cache-file=/dev/null disables caching, for debugging configure. 2793# config.status only pays attention to the cache file if you give it the 2794# --recheck option to rerun configure. 2795# 2796EOF 2797# The following way of writing the cache mishandles newlines in values, 2798# but we know of no workaround that is simple, portable, and efficient. 2799# So, don't put newlines in cache variables' values. 2800# Ultrix sh set writes to stderr and can't be redirected directly, 2801# and sets the high bit in the cache file unless we assign to the vars. 2802(set) 2>&1 | 2803 case `(ac_space=' '; set | grep ac_space) 2>&1` in 2804 *ac_space=\ *) 2805 # `set' does not quote correctly, so add quotes (double-quote substitution 2806 # turns \\\\ into \\, and sed turns \\ into \). 2807 sed -n \ 2808 -e "s/'/'\\\\''/g" \ 2809 -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" 2810 ;; 2811 *) 2812 # `set' quotes correctly as required by POSIX, so do not add quotes. 2813 sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' 2814 ;; 2815 esac >> confcache 2816if cmp -s $cache_file confcache; then 2817 : 2818else 2819 if test -w $cache_file; then 2820 echo "updating cache $cache_file" 2821 cat confcache > $cache_file 2822 else 2823 echo "not updating unwritable cache $cache_file" 2824 fi 2825fi 2826rm -f confcache 2827 2828exit 0 2829 2830# Local Variables: 2831# mode:shell-script 2832# sh-indentation:2 2833# End: 2834