Annotation of libwww/config/ltconfig, revision 1.4
1.1 frystyk 1: #! /bin/sh
2:
3: # ltconfig - Create a system-specific libtool.
1.4 ! frystyk 4: # Copyright (C) 1996-1999 Free Software Foundation, Inc.
1.1 frystyk 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:
1.3 frystyk 28: # Check that we are running under the correct shell.
29: SHELL=${CONFIG_SHELL-/bin/sh}
30: echo=echo
31: if test "X$1" = X--no-reexec; then
32: # Discard the --no-reexec flag, and continue.
33: shift
1.4 ! frystyk 34: elif test "X$1" = X--fallback-echo; then
! 35: # used as fallback echo
! 36: shift
! 37: cat <<EOF
! 38: $*
! 39: EOF
! 40: exit 0
1.3 frystyk 41: elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
42: # Yippee, $echo works!
43: :
44: else
45: # Restart under the correct shell.
46: exec "$SHELL" "$0" --no-reexec ${1+"$@"}
47: fi
48:
1.4 ! frystyk 49: # Find the correct PATH separator. Usually this is `:', but
! 50: # DJGPP uses `;' like DOS.
! 51: if 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
! 57: fi
! 58:
1.2 frystyk 59: # The HP-UX ksh and POSIX shell print the target directory to stdout
60: # if CDPATH is set.
61: if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
62:
1.4 ! frystyk 63: if 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
! 73: fi
! 74:
! 75: if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
! 76: test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
1.3 frystyk 77: # The Solaris, AIX, and Digital Unix default echo programs unquote
78: # backslashes. This makes it impossible to quote backslashes using
1.2 frystyk 79: # echo "$something" | sed 's/\\/\\\\/g'
1.3 frystyk 80: #
81: # So, first we look for a working echo in the user's PATH.
1.4 ! frystyk 82:
! 83: IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1.3 frystyk 84: for dir in $PATH /usr/ucb; do
1.4 ! frystyk 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
1.3 frystyk 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.
1.4 ! frystyk 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
1.3 frystyk 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.
1.4 ! frystyk 102: ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
! 103: export ORIGINAL_CONFIG_SHELL
1.3 frystyk 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'
1.4 ! frystyk 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
1.2 frystyk 143: fi
1.3 frystyk 144: fi
1.2 frystyk 145: fi
146: fi
147:
148: # Sed substitution that helps us do robust quoting. It backslashifies
149: # metacharacters that are still active within double-quoted strings.
150: Xsed='sed -e s/^X//'
151: sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
152:
153: # Same as above, but do not quote variable references.
154: double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
155:
1.1 frystyk 156: # The name of this program.
1.2 frystyk 157: progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
1.1 frystyk 158:
159: # Constants:
160: PROGRAM=ltconfig
161: PACKAGE=libtool
1.4 ! frystyk 162: VERSION=1.2e
! 163: TIMESTAMP=" (1.222 1999/01/24 20:43:44)"
1.1 frystyk 164: ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
1.2 frystyk 165: ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
1.1 frystyk 166: rm="rm -f"
167:
168: help="Try \`$progname --help' for more information."
169:
170: # Global variables:
1.3 frystyk 171: default_ofile=libtool
1.1 frystyk 172: can_build_shared=yes
173: enable_shared=yes
174: # All known linkers require a `.a' archive for static linking.
175: enable_static=yes
176: ltmain=
177: silent=
178: srcdir=
179: ac_config_guess=
180: ac_config_sub=
181: host=
182: nonopt=
1.3 frystyk 183: ofile="$default_ofile"
1.1 frystyk 184: verify_host=yes
185: with_gcc=no
186: with_gnu_ld=no
1.4 ! frystyk 187: need_locks=yes
! 188: objext=o
! 189: libext=a
1.1 frystyk 190:
191: old_AR="$AR"
192: old_CC="$CC"
193: old_CFLAGS="$CFLAGS"
194: old_CPPFLAGS="$CPPFLAGS"
195: old_LD="$LD"
196: old_LN_S="$LN_S"
1.2 frystyk 197: old_NM="$NM"
1.1 frystyk 198: old_RANLIB="$RANLIB"
1.4 ! frystyk 199: old_DLLTOOL="$DLLTOOL"
! 200: old_AS="$AS"
1.1 frystyk 201:
202: # Parse the command line options.
203: args=
204: prev=
205: for option
206: do
207: case "$option" in
208: -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
209: *) optarg= ;;
210: esac
211:
212: # If the previous option needs an argument, assign it.
213: if test -n "$prev"; then
214: eval "$prev=\$option"
215: prev=
216: continue
217: fi
218:
219: case "$option" in
220: --help) cat <<EOM
1.4 ! frystyk 221: Usage: $progname [OPTION]... [HOST [LTMAIN]]
1.1 frystyk 222:
223: Generate a system-specific libtool script.
224:
1.3 frystyk 225: --debug enable verbose shell tracing
1.1 frystyk 226: --disable-shared do not build shared libraries
227: --disable-static do not build static libraries
228: --help display this help and exit
229: --no-verify do not verify that HOST is a valid host type
1.3 frystyk 230: -o, --output=FILE specify the output file [default=$default_ofile]
1.1 frystyk 231: --quiet same as \`--silent'
1.2 frystyk 232: --silent do not print informational messages
1.1 frystyk 233: --srcdir=DIR find \`config.guess' in DIR
234: --version output version information and exit
235: --with-gcc assume that the GNU C compiler will be used
236: --with-gnu-ld assume that the C compiler uses the GNU linker
1.4 ! frystyk 237: --disable-lock disable file locking
1.1 frystyk 238:
1.4 ! frystyk 239: LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
! 240: that provides basic libtool functionality.
1.1 frystyk 241:
242: HOST is the canonical host system name [default=guessed].
243: EOM
244: exit 0
245: ;;
246:
1.3 frystyk 247: --debug)
248: echo "$progname: enabling shell trace mode"
249: set -x
250: ;;
251:
1.1 frystyk 252: --disable-shared) enable_shared=no ;;
253:
254: --disable-static) enable_static=no ;;
255:
256: --quiet | --silent) silent=yes ;;
257:
258: --srcdir) prev=srcdir ;;
259: --srcdir=*) srcdir="$optarg" ;;
260:
261: --no-verify) verify_host=no ;;
262:
1.3 frystyk 263: --output | -o) prev=ofile ;;
264: --output=*) ofile="$optarg" ;;
265:
1.4 ! frystyk 266: --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
1.1 frystyk 267:
268: --with-gcc) with_gcc=yes ;;
269: --with-gnu-ld) with_gnu_ld=yes ;;
270:
1.4 ! frystyk 271: --disable-lock) need_locks=no ;;
! 272:
1.1 frystyk 273: -*)
274: echo "$progname: unrecognized option \`$option'" 1>&2
275: echo "$help" 1>&2
276: exit 1
277: ;;
278:
279: *)
280: if test -z "$ltmain"; then
281: ltmain="$option"
282: elif test -z "$host"; then
1.2 frystyk 283: # This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
1.1 frystyk 284: # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
285: # echo "$progname: warning \`$option' is not a valid host type" 1>&2
286: # fi
287: host="$option"
288: else
289: echo "$progname: too many arguments" 1>&2
290: echo "$help" 1>&2
291: exit 1
292: fi ;;
293: esac
294: done
295:
296: if test -z "$ltmain"; then
297: echo "$progname: you must specify a LTMAIN file" 1>&2
298: echo "$help" 1>&2
299: exit 1
300: fi
301:
1.3 frystyk 302: if test ! -f "$ltmain"; then
1.2 frystyk 303: echo "$progname: \`$ltmain' does not exist" 1>&2
304: echo "$help" 1>&2
305: exit 1
1.1 frystyk 306: fi
307:
308: # Quote any args containing shell metacharacters.
309: ltconfig_args=
310: for arg
311: do
312: case "$arg" in
313: *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
314: ltconfig_args="$ltconfig_args '$arg'" ;;
315: *) ltconfig_args="$ltconfig_args $arg" ;;
316: esac
317: done
318:
319: # A relevant subset of AC_INIT.
320:
321: # File descriptor usage:
322: # 0 standard input
323: # 1 file creation
324: # 2 errors and warnings
325: # 3 some systems may open it to /dev/tty
326: # 4 used on the Kubota Titan
327: # 5 compiler messages saved in config.log
328: # 6 checking for... messages and results
329: if test "$silent" = yes; then
330: exec 6>/dev/null
331: else
332: exec 6>&1
333: fi
334: exec 5>>./config.log
335:
336: # NLS nuisances.
337: # Only set LANG and LC_ALL to C if already set.
338: # These must not be set unconditionally because not all systems understand
339: # e.g. LANG=C (notably SCO).
340: if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
341: if test "${LANG+set}" = set; then LANG=C; export LANG; fi
342:
343: if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
344: # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
345: if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
346: ac_n= ac_c='
347: ' ac_t=' '
348: else
349: ac_n=-n ac_c= ac_t=
350: fi
351: else
352: ac_n= ac_c='\c' ac_t=
353: fi
354:
355: if test -z "$srcdir"; then
1.4 ! frystyk 356: # Assume the source directory is the same one as the path to LTMAIN.
1.2 frystyk 357: srcdir=`$echo "$ltmain" | $Xsed -e 's%/[^/]*$%%'`
1.1 frystyk 358: test "$srcdir" = "$ltmain" && srcdir=.
359: fi
360:
1.2 frystyk 361: trap "$rm conftest*; exit 1" 1 2 15
1.1 frystyk 362: if test "$verify_host" = yes; then
363: # Check for config.guess and config.sub.
364: ac_aux_dir=
365: for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
366: if test -f $ac_dir/config.guess; then
367: ac_aux_dir=$ac_dir
368: break
369: fi
370: done
371: if test -z "$ac_aux_dir"; then
372: echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2
373: echo "$help" 1>&2
374: exit 1
375: fi
376: ac_config_guess=$ac_aux_dir/config.guess
377: ac_config_sub=$ac_aux_dir/config.sub
378:
379: # Make sure we can run config.sub.
1.3 frystyk 380: if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
1.1 frystyk 381: else
382: echo "$progname: cannot run $ac_config_sub" 1>&2
383: echo "$help" 1>&2
384: exit 1
385: fi
386:
387: echo $ac_n "checking host system type""... $ac_c" 1>&6
388:
389: host_alias=$host
390: case "$host_alias" in
391: "")
1.3 frystyk 392: if host_alias=`$SHELL $ac_config_guess`; then :
1.1 frystyk 393: else
394: echo "$progname: cannot guess host type; you must specify one" 1>&2
395: echo "$help" 1>&2
396: exit 1
397: fi ;;
398: esac
1.3 frystyk 399: host=`$SHELL $ac_config_sub $host_alias`
1.2 frystyk 400: echo "$ac_t$host" 1>&6
401:
402: # Make sure the host verified.
403: test -z "$host" && exit 1
1.1 frystyk 404:
405: elif test -z "$host"; then
406: echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2
407: echo "$help" 1>&2
408: exit 1
409: else
410: host_alias=$host
411: fi
412:
1.2 frystyk 413: # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
414: case "$host_os" in
415: linux-gnu*) ;;
416: linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1.1 frystyk 417: esac
418:
419: host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
420: host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
421: host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
422:
1.2 frystyk 423: case "$host_os" in
424: aix3*)
425: # AIX sometimes has problems with the GCC collect2 program. For some
426: # reason, if we set the COLLECT_NAMES environment variable, the problems
427: # vanish in a puff of smoke.
428: if test "${COLLECT_NAMES+set}" != set; then
429: COLLECT_NAMES=
430: export COLLECT_NAMES
431: fi
432: ;;
433: esac
434:
1.1 frystyk 435: # Determine commands to create old-style static archives.
436: old_archive_cmds='$AR cru $oldlib$oldobjs'
437: old_postinstall_cmds='chmod 644 $oldlib'
1.2 frystyk 438: old_postuninstall_cmds=
439:
440: # Set a sane default for `AR'.
441: test -z "$AR" && AR=ar
1.1 frystyk 442:
443: # If RANLIB is not set, then run the test.
444: if test "${RANLIB+set}" != "set"; then
445: result=no
446:
447: echo $ac_n "checking for ranlib... $ac_c" 1>&6
1.4 ! frystyk 448: IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1.1 frystyk 449: for dir in $PATH; do
450: test -z "$dir" && dir=.
451: if test -f $dir/ranlib; then
452: RANLIB="ranlib"
453: result="ranlib"
454: break
455: fi
456: done
457: IFS="$save_ifs"
458:
1.2 frystyk 459: echo "$ac_t$result" 1>&6
1.1 frystyk 460: fi
461:
462: if test -n "$RANLIB"; then
1.4 ! frystyk 463: old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
! 464: old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
1.1 frystyk 465: fi
466:
1.4 ! frystyk 467: # Set sane defaults for `DLLTOOL' and `AS', used on cygwin32.
! 468: test -z "$DLLTOOL" && DLLTOOL=dlltool
! 469: test -z "$AS" && AS=as
! 470:
1.1 frystyk 471: # Check to see if we are using GCC.
472: if test "$with_gcc" != yes || test -z "$CC"; then
473: # If CC is not set, then try to find GCC or a usable CC.
474: if test -z "$CC"; then
475: echo $ac_n "checking for gcc... $ac_c" 1>&6
1.4 ! frystyk 476: IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1.1 frystyk 477: for dir in $PATH; do
478: IFS="$save_ifs"
479: test -z "$dir" && dir=.
480: if test -f $dir/gcc; then
481: CC="gcc"
482: break
483: fi
484: done
485: IFS="$save_ifs"
486:
487: if test -n "$CC"; then
1.2 frystyk 488: echo "$ac_t$CC" 1>&6
1.1 frystyk 489: else
1.2 frystyk 490: echo "$ac_t"no 1>&6
1.1 frystyk 491: fi
492: fi
493:
494: # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
495: if test -z "$CC"; then
496: echo $ac_n "checking for cc... $ac_c" 1>&6
1.4 ! frystyk 497: IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1.1 frystyk 498: cc_rejected=no
499: for dir in $PATH; do
500: test -z "$dir" && dir=.
501: if test -f $dir/cc; then
502: if test "$dir/cc" = "/usr/ucb/cc"; then
503: cc_rejected=yes
504: continue
505: fi
506: CC="cc"
507: break
508: fi
509: done
510: IFS="$save_ifs"
511: if test $cc_rejected = yes; then
512: # We found a bogon in the path, so make sure we never use it.
513: set dummy $CC
514: shift
515: if test $# -gt 0; then
516: # We chose a different compiler from the bogus one.
517: # However, it has the same name, so the bogon will be chosen
518: # first if we set CC to just the name; use the full file name.
519: shift
520: set dummy "$dir/cc" "$@"
521: shift
522: CC="$@"
523: fi
524: fi
525:
526: if test -n "$CC"; then
1.2 frystyk 527: echo "$ac_t$CC" 1>&6
1.1 frystyk 528: else
1.2 frystyk 529: echo "$ac_t"no 1>&6
1.1 frystyk 530: fi
531:
532: if test -z "$CC"; then
533: echo "$progname: error: no acceptable cc found in \$PATH" 1>&2
534: exit 1
535: fi
536: fi
537:
538: # Now see if the compiler is really GCC.
539: with_gcc=no
540: echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
1.4 ! frystyk 541: echo "$progname:541: checking whether we are using GNU C" >&5
1.1 frystyk 542:
543: $rm conftest.c
544: cat > conftest.c <<EOF
545: #ifdef __GNUC__
546: yes;
547: #endif
548: EOF
1.4 ! frystyk 549: if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1.1 frystyk 550: with_gcc=yes
551: fi
552: $rm conftest.c
1.2 frystyk 553: echo "$ac_t$with_gcc" 1>&6
1.1 frystyk 554: fi
555:
556: # Allow CC to be a program name with arguments.
557: set dummy $CC
558: compiler="$2"
559:
1.4 ! frystyk 560: echo $ac_n "checking for object suffix... $ac_c" 1>&6
! 561: $rm conftest*
! 562: echo 'int i = 1;' > conftest.c
! 563: echo "$progname:563: checking for object suffix" >& 5
! 564: if { (eval echo $progname:564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
! 565: # Append any warnings to the config.log.
! 566: cat conftest.err 1>&5
! 567:
! 568: for ac_file in conftest.*; do
! 569: case $ac_file in
! 570: *.c) ;;
! 571: *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
! 572: esac
! 573: done
! 574: else
! 575: cat conftest.err 1>&5
! 576: echo "$progname: failed program was:" >&5
! 577: cat conftest.c >&5
! 578: fi
! 579: $rm conftest*
! 580: echo "$ac_t$objext" 1>&6
! 581:
1.1 frystyk 582: echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
583: pic_flag=
584: special_shlib_compile_flags=
585: wl=
586: link_static_flag=
1.2 frystyk 587: no_builtin_flag=
1.1 frystyk 588:
589: if test "$with_gcc" = yes; then
590: wl='-Wl,'
591: link_static_flag='-static'
1.2 frystyk 592:
593: case "$host_os" in
1.4 ! frystyk 594: beos* | irix5* | irix6* | osf3* | osf4*)
1.2 frystyk 595: # PIC is the default for these OSes.
596: ;;
1.4 ! frystyk 597: aix*)
! 598: # Below there is a dirty hack to force normal static linking with -ldl
! 599: # The problem is because libdl dynamically linked with both libc and
! 600: # libC (AIX C++ library), which obviously doesn't included in libraries
! 601: # list by gcc. This cause undefined symbols with -static flags.
! 602: # This hack allows C programs to be linked with "-static -ldl", but
! 603: # we not sure about C++ programs.
! 604: link_static_flag="$link_static_flag ${wl}-lC"
! 605: ;;
! 606: cygwin32* | mingw32* | os2*)
1.2 frystyk 607: # We can build DLLs from non-PIC.
608: ;;
609: amigaos*)
610: # FIXME: we need at least 68020 code to build shared libraries, but
611: # adding the `-m68020' flag to GCC prevents building anything better,
612: # like `-m68040'.
613: pic_flag='-m68020 -resident32 -malways-restore-a4'
614: ;;
615: *)
616: pic_flag='-fPIC'
617: ;;
618: esac
1.1 frystyk 619: else
620: # PORTME Check for PIC flags for the system compiler.
621: case "$host_os" in
622: aix3* | aix4*)
1.2 frystyk 623: # All AIX code is PIC.
1.1 frystyk 624: link_static_flag='-bnso -bI:/lib/syscalls.exp'
625: ;;
626:
1.3 frystyk 627: hpux9* | hpux10* | hpux11*)
1.2 frystyk 628: # Is there a better link_static_flag that works with the bundled CC?
1.1 frystyk 629: wl='-Wl,'
1.2 frystyk 630: link_static_flag="${wl}-a ${wl}archive"
1.1 frystyk 631: pic_flag='+Z'
632: ;;
633:
634: irix5* | irix6*)
635: wl='-Wl,'
636: link_static_flag='-non_shared'
637: # PIC (with -KPIC) is the default.
1.2 frystyk 638: ;;
639:
1.4 ! frystyk 640: cygwin32* | mingw32* | os2*)
1.2 frystyk 641: # We can build DLLs from non-PIC.
1.1 frystyk 642: ;;
643:
644: osf3* | osf4*)
1.2 frystyk 645: # All OSF/1 code is PIC.
1.1 frystyk 646: wl='-Wl,'
647: link_static_flag='-non_shared'
648: ;;
649:
650: sco3.2v5*)
651: pic_flag='-Kpic'
652: link_static_flag='-dn'
653: special_shlib_compile_flags='-belf'
654: ;;
655:
1.4 ! frystyk 656: solaris*)
1.1 frystyk 657: pic_flag='-KPIC'
658: link_static_flag='-Bstatic'
659: wl='-Wl,'
660: ;;
661:
662: sunos4*)
663: pic_flag='-PIC'
664: link_static_flag='-Bstatic'
665: wl='-Qoption ld '
666: ;;
667:
1.4 ! frystyk 668: sysv4.2uw2* | sysv4.3* | sysv5*)
1.2 frystyk 669: pic_flag='-KPIC'
670: link_static_flag='-Bstatic'
671: wl='-Wl,'
672: ;;
673:
674: uts4*)
675: pic_flag='-pic'
676: link_static_flag='-Bstatic'
677: ;;
678:
1.1 frystyk 679: *)
680: can_build_shared=no
681: ;;
682: esac
683: fi
684:
1.2 frystyk 685: if test -n "$pic_flag"; then
686: echo "$ac_t$pic_flag" 1>&6
1.1 frystyk 687:
1.2 frystyk 688: # Check to make sure the pic_flag actually works.
689: echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
690: $rm conftest*
1.3 frystyk 691: echo "int some_variable = 0;" > conftest.c
1.2 frystyk 692: save_CFLAGS="$CFLAGS"
693: CFLAGS="$CFLAGS $pic_flag -DPIC"
1.4 ! frystyk 694: echo "$progname:694: checking if $compiler PIC flag $pic_flag works" >&5
! 695: if { (eval echo $progname:695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
1.3 frystyk 696: # Append any warnings to the config.log.
1.2 frystyk 697: cat conftest.err 1>&5
1.4 ! frystyk 698:
! 699: case "$host_os" in
! 700: hpux9* | hpux10* | hpux11*)
! 701: # On HP-UX, both CC and GCC only warn that PIC is supported... then they
! 702: # create non-PIC objects. So, if there were any warnings, we assume that
! 703: # PIC is not supported.
! 704: if test -s conftest.err; then
! 705: echo "$ac_t"no 1>&6
! 706: can_build_shared=no
! 707: pic_flag=
! 708: else
! 709: echo "$ac_t"yes 1>&6
! 710: pic_flag=" $pic_flag"
! 711: fi
! 712: ;;
! 713: *)
! 714: echo "$ac_t"yes 1>&6
! 715: pic_flag=" $pic_flag"
! 716: ;;
! 717: esac
! 718: else
! 719: # Append any errors to the config.log.
! 720: cat conftest.err 1>&5
! 721: can_build_shared=no
! 722: pic_flag=
! 723: echo "$ac_t"no 1>&6
! 724: fi
! 725: CFLAGS="$save_CFLAGS"
! 726: $rm conftest*
! 727: else
! 728: echo "$ac_t"none 1>&6
! 729: fi
1.2 frystyk 730:
1.4 ! frystyk 731: # Check to see if options -o and -c are simultaneously supported by compiler
! 732: echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
! 733: $rm conftest*
! 734: echo "int some_variable = 0;" > conftest.c
! 735: save_CFLAGS="$CFLAGS"
! 736: CFLAGS="$CFLAGS -c -o conftest2.o"
! 737: echo "$progname:737: checking if $compiler supports -c -o file.o" >&5
! 738: if { (eval echo $progname:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
! 739:
! 740: # The compiler can only warn and ignore the option if not recognized
! 741: # So say no if there are warnings
1.3 frystyk 742: if test -s conftest.err; then
1.2 frystyk 743: echo "$ac_t"no 1>&6
1.4 ! frystyk 744: compiler_c_o=no
1.2 frystyk 745: else
746: echo "$ac_t"yes 1>&6
1.4 ! frystyk 747: compiler_c_o=yes
1.2 frystyk 748: fi
1.4 ! frystyk 749: else
! 750: # Append any errors to the config.log.
! 751: cat conftest.err 1>&5
! 752: compiler_c_o=no
! 753: echo "$ac_t"no 1>&6
! 754: fi
! 755: CFLAGS="$save_CFLAGS"
! 756: $rm conftest*
! 757:
! 758: if test x"$compiler_c_o" = x"yes"; then
! 759: # Check to see if we can write to a .lo
! 760: echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
! 761: $rm conftest*
! 762: echo "int some_variable = 0;" > conftest.c
! 763: save_CFLAGS="$CFLAGS"
! 764: CFLAGS="$CFLAGS -c -o conftest.lo"
! 765: echo "$progname:765: checking if $compiler supports -c -o file.lo" >&5
! 766: if { (eval echo $progname:766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
! 767:
! 768: # The compiler can only warn and ignore the option if not recognized
! 769: # So say no if there are warnings
! 770: if test -s conftest.err; then
! 771: echo "$ac_t"no 1>&6
! 772: compiler_o_lo=no
! 773: else
! 774: echo "$ac_t"yes 1>&6
! 775: compiler_o_lo=yes
! 776: fi
1.2 frystyk 777: else
778: # Append any errors to the config.log.
779: cat conftest.err 1>&5
1.4 ! frystyk 780: compiler_o_lo=no
1.2 frystyk 781: echo "$ac_t"no 1>&6
782: fi
783: CFLAGS="$save_CFLAGS"
784: $rm conftest*
1.1 frystyk 785: else
1.4 ! frystyk 786: compiler_o_lo=no
! 787: fi
! 788:
! 789: # Check to see if we can do hard links to lock some files if needed
! 790: hard_links="nottested"
! 791: if test "$compiler_c_o" = no && test "$need_locks" != no; then
! 792: # do not overwrite the value of need_locks provided by the user
! 793: echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
! 794: hard_links=yes
! 795: $rm conftest*
! 796: ln conftest.a conftest.b 2>/dev/null && hard_links=no
! 797: touch conftest.a
! 798: ln conftest.a conftest.b 2>&5 || hard_links=no
! 799: ln conftest.a conftest.b 2>/dev/null && hard_links=no
! 800: echo "$ac_t$hard_links" 1>&6
! 801: $rm conftest*
! 802: if test "$hard_links" = no; then
! 803: echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
! 804: need_locks=warn
! 805: fi
! 806: else
! 807: need_locks=no
! 808: fi
! 809:
! 810: if test "$with_gcc" = yes; then
! 811: # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
! 812: echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
! 813: $rm conftest*
! 814: echo "int some_variable = 0;" > conftest.c
! 815: save_CFLAGS="$CFLAGS"
! 816: CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
! 817: echo "$progname:817: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
! 818: if { (eval echo $progname:818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
! 819:
! 820: # The compiler can only warn and ignore the option if not recognized
! 821: # So say no if there are warnings
! 822: if test -s conftest.err; then
! 823: echo "$ac_t"no 1>&6
! 824: compiler_rtti_exceptions=no
! 825: else
! 826: echo "$ac_t"yes 1>&6
! 827: compiler_rtti_exceptions=yes
! 828: fi
! 829: else
! 830: # Append any errors to the config.log.
! 831: cat conftest.err 1>&5
! 832: compiler_rtti_exceptions=no
! 833: echo "$ac_t"no 1>&6
! 834: fi
! 835: CFLAGS="$save_CFLAGS"
! 836: $rm conftest*
! 837:
! 838: if test "$compiler_rtti_exceptions" = "yes"; then
! 839: no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
! 840: else
! 841: no_builtin_flag=' -fno-builtin'
! 842: fi
! 843:
1.1 frystyk 844: fi
845:
846: # Check for any special shared library compilation flags.
847: if test -n "$special_shlib_compile_flags"; then
848: echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2
849: if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then :
850: else
851: echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2
852: can_build_shared=no
853: fi
854: fi
855:
1.2 frystyk 856: echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6
857: $rm conftest*
858: echo 'main(){return(0);}' > conftest.c
859: save_LDFLAGS="$LDFLAGS"
860: LDFLAGS="$LDFLAGS $link_static_flag"
1.4 ! frystyk 861: echo "$progname:861: checking if $compiler static flag $link_static_flag works" >&5
! 862: if { (eval echo $progname:862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
1.2 frystyk 863: echo "$ac_t$link_static_flag" 1>&6
1.1 frystyk 864: else
1.2 frystyk 865: echo "$ac_t"none 1>&6
866: link_static_flag=
1.1 frystyk 867: fi
1.2 frystyk 868: LDFLAGS="$save_LDFLAGS"
869: $rm conftest*
1.1 frystyk 870:
871: if test -z "$LN_S"; then
872: # Check to see if we can use ln -s, or we need hard links.
873: echo $ac_n "checking whether ln -s works... $ac_c" 1>&6
1.2 frystyk 874: $rm conftestdata
1.1 frystyk 875: if ln -s X conftestdata 2>/dev/null; then
1.2 frystyk 876: $rm conftestdata
1.1 frystyk 877: LN_S="ln -s"
878: else
879: LN_S=ln
880: fi
881: if test "$LN_S" = "ln -s"; then
882: echo "$ac_t"yes 1>&6
883: else
884: echo "$ac_t"no 1>&6
885: fi
886: fi
887:
1.2 frystyk 888: # Make sure LD is an absolute path.
889: if test -z "$LD"; then
890: ac_prog=ld
891: if test "$with_gcc" = yes; then
892: # Check if gcc -print-prog-name=ld gives a path.
893: echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
1.4 ! frystyk 894: echo "$progname:894: checking for ld used by GCC" >&5
1.2 frystyk 895: ac_prog=`($CC -print-prog-name=ld) 2>&5`
896: case "$ac_prog" in
897: # Accept absolute paths.
1.4 ! frystyk 898: /* | [A-Za-z]:/*)
! 899: re_direlt='/[^/][^/]*/\.\./'
! 900: sub_uncdrive='s%^\([A-Za-z]\):/%//\1/%'
! 901: # Canonicalize the path of ld
! 902: while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
! 903: ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
! 904: done
! 905: case "$host_os" in
! 906: cygwin*)
! 907: # Convert to a UNC path for cygwin
! 908: test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive"`
! 909: ;;
! 910: *)
! 911: test -z "$LD" && LD="$ac_prog"
! 912: ;;
! 913: esac
! 914: ;;
! 915: ##
! 916: ## FIXME: The code fails later on if we try to use an $LD with
! 917: ## '\\' path separators.
! 918: ##
! 919: [A-Za-z]:[\\]*)
! 920: re_direlt='\\[^\\][^\\]*\\\.\.\(\\\)'
! 921: sub_uncdrive='s%^\([A-Za-z]\):\\%//\1/%'
! 922: sub_uncdir='s%\\%/%g'
! 923: # Canonicalize the path of ld
! 924: while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
! 925: ac_prog=`echo $ac_prog| sed "s%$re_direlt%\1%"`
! 926: done
! 927: case "$host_os" in
! 928: cygwin*)
! 929: # Convert to a UNC path for cygwin
! 930: test -z "$LD" && LD=`echo X$ac_prog | $Xsed -e "$sub_uncdrive" -e "$sub_uncdir"`
! 931: ;;
! 932: *)
! 933: test -z "$LD" && LD="$ac_prog"
! 934: ;;
! 935: esac
1.2 frystyk 936: ;;
937: "")
938: # If it fails, then pretend we are not using GCC.
939: ac_prog=ld
940: ;;
941: *)
942: # If it is relative, then search for the first ld in PATH.
943: with_gnu_ld=unknown
944: ;;
945: esac
946: elif test "$with_gnu_ld" = yes; then
947: echo $ac_n "checking for GNU ld... $ac_c" 1>&6
1.4 ! frystyk 948: echo "$progname:948: checking for GNU ld" >&5
1.2 frystyk 949: else
950: echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
1.4 ! frystyk 951: echo "$progname:951: checking for non-GNU ld" >&5
1.2 frystyk 952: fi
953:
1.1 frystyk 954: if test -z "$LD"; then
1.4 ! frystyk 955: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
1.1 frystyk 956: for ac_dir in $PATH; do
957: test -z "$ac_dir" && ac_dir=.
1.2 frystyk 958: if test -f "$ac_dir/$ac_prog"; then
959: LD="$ac_dir/$ac_prog"
1.1 frystyk 960: # Check to see if the program is GNU ld. I'd rather use --version,
961: # but apparently some GNU ld's only accept -v.
962: # Break only if it was the GNU/non-GNU ld that we prefer.
1.2 frystyk 963: if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
964: test "$with_gnu_ld" != no && break
1.1 frystyk 965: else
966: test "$with_gnu_ld" != yes && break
967: fi
968: fi
969: done
970: IFS="$ac_save_ifs"
1.2 frystyk 971: fi
1.1 frystyk 972:
1.2 frystyk 973: if test -n "$LD"; then
974: echo "$ac_t$LD" 1>&6
975: else
976: echo "$ac_t"no 1>&6
977: fi
1.1 frystyk 978:
1.2 frystyk 979: if test -z "$LD"; then
980: echo "$progname: error: no acceptable ld found in \$PATH" 1>&2
981: exit 1
1.1 frystyk 982: fi
1.2 frystyk 983: fi
1.1 frystyk 984:
1.2 frystyk 985: # Check to see if it really is or is not GNU ld.
986: echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
987: # I'd rather use --version here, but apparently some GNU ld's only accept -v.
988: if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
989: with_gnu_ld=yes
990: else
991: with_gnu_ld=no
1.1 frystyk 992: fi
1.2 frystyk 993: echo "$ac_t$with_gnu_ld" 1>&6
1.1 frystyk 994:
995: # See if the linker supports building shared libraries.
996: echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
997:
998: allow_undefined_flag=
1.2 frystyk 999: no_undefined_flag=
1.4 ! frystyk 1000: need_lib_prefix=unknown
! 1001: need_version=unknown
1.1 frystyk 1002: archive_cmds=
1.4 ! frystyk 1003: archive_sym_cmds=
1.2 frystyk 1004: old_archive_from_new_cmds=
1005: export_dynamic_flag_spec=
1.3 frystyk 1006: whole_archive_flag_spec=
1.1 frystyk 1007: hardcode_libdir_flag_spec=
1008: hardcode_libdir_separator=
1009: hardcode_direct=no
1010: hardcode_minus_L=no
1011: hardcode_shlibpath_var=unsupported
1012: runpath_var=
1013:
1.4 ! frystyk 1014: case "$host_os" in
! 1015: aix3* | aix4*)
! 1016: # On AIX, the GNU linker works like the native linker.
! 1017: with_gnu_ld=no
! 1018: ;;
! 1019: esac
! 1020:
1.1 frystyk 1021: ld_shlibs=yes
1.3 frystyk 1022: if test "$with_gnu_ld" = yes; then
1.4 ! frystyk 1023: # If archive_cmds runs LD, not CC, wlarc should be empty
! 1024: wlarc='${wl}'
1.2 frystyk 1025:
1.1 frystyk 1026: # See if GNU ld supports shared libraries.
1.3 frystyk 1027: case "$host_os" in
1028: amigaos*)
1.4 ! frystyk 1029: 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)'
1.3 frystyk 1030: hardcode_libdir_flag_spec='-L$libdir'
1031: hardcode_minus_L=yes
1032: ;;
1033:
1034: sunos4*)
1.4 ! frystyk 1035: archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs'
! 1036: wlarc=
1.3 frystyk 1037: hardcode_direct=yes
1038: hardcode_minus_L=yes
1039: hardcode_shlibpath_var=no
1040: ;;
1041:
1.4 ! frystyk 1042: beos*)
! 1043: if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
! 1044: archive_cmds='$CC -nostart ${wl}-soname $wl$soname -o $lib $libobjs $deplibs'
! 1045: else
! 1046: ld_shlibs=no
! 1047: fi
! 1048: ;;
! 1049:
! 1050: cygwin32* | mingw32*)
! 1051: if test "$with_gcc" = yes; then
! 1052: # hardcode_libdir_flag_spec is actually meaningless, as there is
! 1053: # no search path for DLLs.
! 1054: hardcode_libdir_flag_spec='-L$libdir'
! 1055: allow_undefined_flag=unsupported
! 1056: # Very, very bogus.
! 1057:
! 1058: archive_cmds='rm -f $objdir/$soname-ltdll.c~
! 1059: sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
! 1060: (cd $objdir && $CC -c $soname-ltdll.c)~
! 1061: echo EXPORTS > $objdir/$soname-def~
! 1062: $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
! 1063: $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
! 1064: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1065: $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~
! 1066: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1067: $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs'
! 1068:
! 1069: archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
! 1070: sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
! 1071: (cd $objdir && $CC -c $soname-ltdll.c)~
! 1072: echo EXPORTS > $objdir/$soname-def~
! 1073: cat "$export_symbols" >> $objdir/$soname-def~
! 1074: $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
! 1075: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1076: $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~
! 1077: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1078: $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs'
! 1079:
! 1080: old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
! 1081: else
! 1082: # When not using gcc, we currently assume that we are using
! 1083: # Microsoft Visual C++.
! 1084: with_gnu_ld=no
! 1085: # hardcode_libdir_flag_spec is actually meaningless, as there is
! 1086: # no search path for DLLs.
! 1087: hardcode_libdir_flag_spec=' '
! 1088: allow_undefined_flag=unsupported
! 1089: # Tell ltmain to make .lib files, not .a files.
! 1090: libext=lib
! 1091: # FIXME: Setting linknames here is a bad hack.
! 1092: archive_cmds='$CC -o $lib $libobjs `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
! 1093: # The linker will automatically build a .lib file if we build a DLL.
! 1094: old_archive_from_new_cmds='true'
! 1095: # FIXME: Should let the user specify the lib program.
! 1096: old_archive_cmds='lib /OUT:$oldlib$oldobjs'
! 1097: fix_srcfile_path='`cygpath -w $srcfile`'
! 1098: fi
! 1099: ;;
! 1100:
1.3 frystyk 1101: *)
1102: if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
1.4 ! frystyk 1103: archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib $libobjs $deplibs'
! 1104: archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib $libobjs $deplibs'
1.3 frystyk 1105: else
1106: ld_shlibs=no
1107: fi
1108: ;;
1109: esac
1.1 frystyk 1110:
1111: if test "$ld_shlibs" = yes; then
1.3 frystyk 1112: runpath_var=LD_RUN_PATH
1.2 frystyk 1113: hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
1114: export_dynamic_flag_spec='${wl}--export-dynamic'
1.4 ! frystyk 1115: whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
1.1 frystyk 1116: fi
1117: else
1118: # PORTME fill in a description of your system's linker (not GNU ld)
1119: case "$host_os" in
1120: aix3*)
1121: allow_undefined_flag=unsupported
1.4 ! frystyk 1122: archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
! 1123: $LD -o $objdir/$soname $libobjs $deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
! 1124: archive_sym_cmds='$LD -o $objdir/$soname $libobjs $deplibs -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
1.1 frystyk 1125: # Note: this linker hardcodes the directories in LIBPATH if there
1126: # are no directories specified by -L.
1127: hardcode_minus_L=yes
1.2 frystyk 1128: if test "$with_gcc" = yes && test -z "$link_static_flag"; then
1129: # Neither direct hardcoding nor static linking is supported with a
1130: # broken collect2.
1131: hardcode_direct=unsupported
1132: fi
1.1 frystyk 1133: ;;
1134:
1135: aix4*)
1.4 ! frystyk 1136: allow_undefined_flag=
! 1137: if test "$with_gcc" = yes; then
! 1138: if strings `${CC} -print-prog-name=collect2` | \
! 1139: grep resolve_lib_name >/dev/null
! 1140: then
! 1141: # We have reworked collect2
! 1142: hardcode_direct=yes
! 1143: else
! 1144: # We have old collect2
! 1145: hardcode_direct=unsupported
! 1146: fi
! 1147: archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs'
! 1148: else
! 1149: archive_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
! 1150: $CC -o $objdir/$soname $libobjs $deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry'
! 1151: archive_sym_cmds='$CC -o $objdir/$soname $libobjs $deplibs ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
! 1152: hardcode_direct=yes
! 1153: fi
1.1 frystyk 1154: hardcode_minus_L=yes
1.4 ! frystyk 1155: # Though LIBPATH variable hardcodes shlibpath into executable,
! 1156: # it doesn't affect searching for -l* libraries; this confuses
! 1157: # tests in mdemo.
! 1158: hardcode_shlibpath_var=unsupported
! 1159: hardcode_libdir_flag_spec='-L$libdir'
! 1160: ;;
1.1 frystyk 1161:
1.2 frystyk 1162: amigaos*)
1.4 ! frystyk 1163: 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)'
1.2 frystyk 1164: hardcode_libdir_flag_spec='-L$libdir'
1165: hardcode_minus_L=yes
1166: ;;
1167:
1.4 ! frystyk 1168: cygwin32* | mingw32*)
! 1169: if test "$with_gcc" = yes; then
! 1170: # hardcode_libdir_flag_spec is actually meaningless, as there is
! 1171: # no search path for DLLs.
! 1172: hardcode_libdir_flag_spec='-L$libdir'
! 1173: allow_undefined_flag=unsupported
! 1174: # Very, very bogus.
! 1175:
! 1176: archive_cmds='rm -f $objdir/$soname-ltdll.c~
! 1177: sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
! 1178: (cd $objdir && $CC -c $soname-ltdll.c)~
! 1179: echo EXPORTS > $objdir/$soname-def~
! 1180: $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
! 1181: $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
! 1182: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1183: $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~
! 1184: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1185: $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs'
! 1186:
! 1187: archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
! 1188: sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
! 1189: (cd $objdir && $CC -c $soname-ltdll.c)~
! 1190: echo EXPORTS > $objdir/$soname-def~
! 1191: cat "$export_symbols" >> $objdir/$soname-def~
! 1192: $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs~
! 1193: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1194: $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~
! 1195: $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
! 1196: $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs'
! 1197:
! 1198: old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
! 1199: else
! 1200: # When not using gcc, we currently assume that we are using
! 1201: # Microsoft Visual C++.
! 1202: # hardcode_libdir_flag_spec is actually meaningless, as there is
! 1203: # no search path for DLLs.
! 1204: hardcode_libdir_flag_spec=' '
! 1205: allow_undefined_flag=unsupported
! 1206: # Tell ltmain to make .lib files, not .a files.
! 1207: libext=lib
! 1208: # FIXME: Setting linknames here is a bad hack.
! 1209: archive_cmds='$CC -o $lib $libobjs `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
! 1210: # The linker will automatically build a .lib file if we build a DLL.
! 1211: old_archive_from_new_cmds='true'
! 1212: # FIXME: Should let the user specify the lib program.
! 1213: old_archive_cmds='lib /OUT:$oldlib$oldobjs'
! 1214: fix_srcfile_path='`cygpath -w $srcfile`'
! 1215: fi
! 1216: ;;
! 1217:
! 1218: freebsd1*)
! 1219: ld_shlibs=no
! 1220: can_build_shared=no
! 1221: ;;
! 1222:
1.1 frystyk 1223: # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
1224: # support. Future versions do this automatically, but an explicit c++rt0.o
1.2 frystyk 1225: # does not break anything, and helps significantly (at the cost of a little
1.1 frystyk 1226: # extra space).
1227: freebsd2.2*)
1.4 ! frystyk 1228: archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs /usr/lib/c++rt0.o'
1.2 frystyk 1229: hardcode_libdir_flag_spec='-R$libdir'
1.1 frystyk 1230: hardcode_direct=yes
1231: hardcode_minus_L=yes
1232: hardcode_shlibpath_var=no
1233: ;;
1234:
1.2 frystyk 1235: # Unfortunately, older versions of FreeBSD 2 do not have this feature.
1.1 frystyk 1236: freebsd2*)
1.4 ! frystyk 1237: archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs'
1.1 frystyk 1238: hardcode_direct=yes
1239: hardcode_minus_L=yes
1240: hardcode_shlibpath_var=no
1241: ;;
1242:
1.4 ! frystyk 1243: # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
! 1244: freebsd*)
! 1245: archive_cmds='$CC -shared -o $lib $libobjs $deplibs'
1.2 frystyk 1246: hardcode_libdir_flag_spec='-R$libdir'
1.1 frystyk 1247: hardcode_direct=yes
1.3 frystyk 1248: hardcode_minus_L=no
1.1 frystyk 1249: hardcode_shlibpath_var=no
1250: ;;
1251:
1252: hpux9*)
1.4 ! frystyk 1253: archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
1.1 frystyk 1254: hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1255: hardcode_direct=yes
1256: hardcode_minus_L=yes
1.2 frystyk 1257: export_dynamic_flag_spec='${wl}-E'
1.1 frystyk 1258: ;;
1259:
1.3 frystyk 1260: hpux10* | hpux11*)
1.4 ! frystyk 1261: archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs'
1.1 frystyk 1262: hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
1263: hardcode_direct=yes
1264: hardcode_minus_L=yes
1.2 frystyk 1265: export_dynamic_flag_spec='${wl}-E'
1.1 frystyk 1266: ;;
1267:
1268: irix5* | irix6*)
1.3 frystyk 1269: if test "$with_gcc" = yes; then
1.4 ! frystyk 1270: archive_cmds='$CC -shared -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring $libobjs $deplibs'
1.3 frystyk 1271: else
1.4 ! frystyk 1272: archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring $libobjs $deplibs'
1.3 frystyk 1273: fi
1.1 frystyk 1274: hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1275: ;;
1276:
1.2 frystyk 1277: netbsd*)
1.4 ! frystyk 1278: if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
! 1279: archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs' # a.out
! 1280: else
! 1281: archive_cmds='$LD -shared -o $lib $libobjs $deplibs' # ELF
! 1282: fi
! 1283: hardcode_libdir_flag_spec='${wl}-R$libdir'
1.2 frystyk 1284: hardcode_direct=yes
1285: hardcode_shlibpath_var=no
1286: ;;
1287:
1288: openbsd*)
1.4 ! frystyk 1289: archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs'
1.1 frystyk 1290: hardcode_libdir_flag_spec='-R$libdir'
1291: hardcode_direct=yes
1292: hardcode_shlibpath_var=no
1293: ;;
1294:
1.2 frystyk 1295: os2*)
1296: hardcode_libdir_flag_spec='-L$libdir'
1297: hardcode_minus_L=yes
1298: allow_undefined_flag=unsupported
1.4 ! frystyk 1299: 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 $objdir/$libname.def'
1.2 frystyk 1300: old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
1301: ;;
1302:
1.1 frystyk 1303: osf3* | osf4*)
1.4 ! frystyk 1304: if test "$with_gcc" = yes; then
! 1305: allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
! 1306: archive_cmds='$CC -shared${allow_undefined_flag} -o $lib ${wl}-soname ${wl}$soname ${wl}-set_version ${wl}$verstring $libobjs $deplibs'
! 1307: else
! 1308: allow_undefined_flag=' -expect_unresolved \*'
! 1309: archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring $libobjs $deplibs'
! 1310: fi
1.1 frystyk 1311: hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
1312: hardcode_libdir_separator=:
1313: ;;
1314:
1315: sco3.2v5*)
1.4 ! frystyk 1316: archive_cmds='$LD -G -o $lib $libobjs $deplibs'
1.1 frystyk 1317: hardcode_direct=yes
1318: ;;
1319:
1.4 ! frystyk 1320: solaris*)
1.2 frystyk 1321: no_undefined_flag=' -z text'
1.4 ! frystyk 1322: # $CC -shared without GNU ld will not create a library from C++
! 1323: # object files and a static libstdc++, better avoid it by now
! 1324: archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs'
! 1325: archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" >> $lib.exp~
! 1326: $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib $libobjs $deplibs~$rm $lib.exp'
1.1 frystyk 1327: hardcode_libdir_flag_spec='-R$libdir'
1328: hardcode_shlibpath_var=no
1329: ;;
1330:
1331: sunos4*)
1.4 ! frystyk 1332: # Why do we need -Bstatic? To avoid inter-library dependencies, maybe...
! 1333: if test "$with_gcc" = yes; then
! 1334: # Use -fPIC here because libgcc is multilibbed
! 1335: archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs'
! 1336: else
! 1337: archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs'
! 1338: fi
1.1 frystyk 1339: hardcode_libdir_flag_spec='-L$libdir'
1340: hardcode_direct=yes
1341: hardcode_minus_L=yes
1342: hardcode_shlibpath_var=no
1343: ;;
1344:
1.4 ! frystyk 1345: sysv4.3*)
! 1346: archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs'
! 1347: hardcode_direct=no
! 1348: hardcode_minus_L=no
! 1349: hardcode_shlibpath_var=no
! 1350: export_dynamic_flag_spec='-Bexport'
! 1351: ;;
! 1352:
1.2 frystyk 1353: uts4*)
1.4 ! frystyk 1354: archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs'
! 1355: hardcode_libdir_flag_spec='-L$libdir'
! 1356: hardcode_direct=no
! 1357: hardcode_minus_L=no
! 1358: hardcode_shlibpath_var=no
! 1359: ;;
! 1360:
! 1361: dgux*)
! 1362: archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs'
1.2 frystyk 1363: hardcode_libdir_flag_spec='-L$libdir'
1364: hardcode_direct=no
1365: hardcode_minus_L=no
1366: hardcode_shlibpath_var=no
1367: ;;
1368:
1.1 frystyk 1369: *)
1370: ld_shlibs=no
1371: can_build_shared=no
1372: ;;
1373: esac
1374: fi
1.2 frystyk 1375: echo "$ac_t$ld_shlibs" 1>&6
1376:
1377: if test -z "$NM"; then
1378: echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
1379: case "$NM" in
1.3 frystyk 1380: /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
1.2 frystyk 1381: *)
1.4 ! frystyk 1382: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
! 1383: for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
1.2 frystyk 1384: test -z "$ac_dir" && ac_dir=.
1385: if test -f $ac_dir/nm; then
1.4 ! frystyk 1386: # Check to see if the nm accepts a BSD-compat flag.
! 1387: # Adding the `sed 1q' prevents false positives on HP-UX, which says:
! 1388: # nm: unknown option "B" ignored
! 1389: if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
! 1390: NM="$ac_dir/nm -B"
! 1391: break
! 1392: elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
! 1393: NM="$ac_dir/nm -p"
! 1394: break
1.2 frystyk 1395: else
1.4 ! frystyk 1396: NM=${NM="$ac_dir/nm"} # keep the first match, but
! 1397: continue # so that we can try to find one that supports BSD flags
1.2 frystyk 1398: fi
1399: fi
1400: done
1401: IFS="$ac_save_ifs"
1402: test -z "$NM" && NM=nm
1403: ;;
1404: esac
1405: echo "$ac_t$NM" 1>&6
1406: fi
1407:
1408: # Check for command to grab the raw symbol name followed by C symbol from nm.
1409: echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
1410:
1411: # These are sane defaults that work on at least a few old systems.
1412: # [They come from Ultrix. What could be older than Ultrix?!! ;)]
1413:
1414: # Character class describing NM global symbol codes.
1.4 ! frystyk 1415: symcode='[BCDEGRST]'
1.2 frystyk 1416:
1417: # Regexp to match symbols that can be accessed directly from C.
1418: sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
1419:
1420: # Transform the above into a raw symbol and a C symbol.
1421: symxfrm='\1 \1'
1422:
1423: # Define system-specific variables.
1424: case "$host_os" in
1425: aix*)
1.4 ! frystyk 1426: symcode='[BCDT]'
! 1427: ;;
! 1428: cygwin32* | mingw32*)
! 1429: symcode='[ABCDGISTW]'
1.2 frystyk 1430: ;;
1431: irix*)
1432: symcode='[BCDEGRST]'
1433: ;;
1.4 ! frystyk 1434: solaris*)
! 1435: symcode='[BDT]'
1.2 frystyk 1436: ;;
1437: esac
1438:
1439: # If we're using GNU nm, then use its standard symbol codes.
1440: if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
1.4 ! frystyk 1441: symcode='[ABCDGISTW]'
1.2 frystyk 1442: fi
1443:
1.4 ! frystyk 1444: # Try without a prefix undercore, then with it.
! 1445: for ac_symprfx in "" "_"; do
! 1446:
! 1447: # Write the raw and C identifiers.
! 1448: global_symbol_pipe="sed -n -e 's/^.* $symcode $ac_symprfx$sympat$/$symxfrm/p'"
1.2 frystyk 1449:
1.4 ! frystyk 1450: # Check to see that the pipe works correctly.
! 1451: pipe_works=no
! 1452: $rm conftest*
! 1453: cat > conftest.c <<EOF
1.2 frystyk 1454: #ifdef __cplusplus
1455: extern "C" {
1456: #endif
1457: char nm_test_var;
1458: void nm_test_func(){}
1459: #ifdef __cplusplus
1460: }
1461: #endif
1462: main(){nm_test_var='a';nm_test_func();return(0);}
1463: EOF
1464:
1.4 ! frystyk 1465: echo "$progname:1465: checking if global_symbol_pipe works" >&5
! 1466: if { (eval echo $progname:1466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
! 1467: # Now try to grab the symbols.
! 1468: nlist=conftest.nm
! 1469: if { echo "$progname:1469: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
! 1470:
! 1471: # Try sorting and uniquifying the output.
! 1472: if sort "$nlist" | uniq > "$nlist"T; then
! 1473: mv -f "$nlist"T "$nlist"
! 1474: else
! 1475: rm -f "$nlist"T
! 1476: fi
1.2 frystyk 1477:
1.4 ! frystyk 1478: # Make sure that we snagged all the symbols we need.
! 1479: if egrep ' nm_test_var$' "$nlist" >/dev/null; then
! 1480: if egrep ' nm_test_func$' "$nlist" >/dev/null; then
! 1481: cat <<EOF > conftest.c
1.2 frystyk 1482: #ifdef __cplusplus
1483: extern "C" {
1484: #endif
1485:
1486: EOF
1.4 ! frystyk 1487: # Now generate the symbol file.
! 1488: sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
1.2 frystyk 1489:
1.4 ! frystyk 1490: cat <<EOF >> conftest.c
1.2 frystyk 1491: #if defined (__STDC__) && __STDC__
1.4 ! frystyk 1492: # define lt_ptr_t void *
1.2 frystyk 1493: #else
1.4 ! frystyk 1494: # define lt_ptr_t char *
! 1495: # define const
1.2 frystyk 1496: #endif
1497:
1498: /* The mapping between symbol names and symbols. */
1.4 ! frystyk 1499: const struct {
! 1500: const char *name;
! 1501: lt_ptr_t address;
1.2 frystyk 1502: }
1.4 ! frystyk 1503: lt_preloaded_symbols[] =
1.2 frystyk 1504: {
1505: EOF
1.4 ! frystyk 1506: sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
! 1507: cat <<\EOF >> conftest.c
! 1508: {0, (lt_ptr_t) 0}
1.2 frystyk 1509: };
1510:
1511: #ifdef __cplusplus
1512: }
1513: #endif
1514: EOF
1.4 ! frystyk 1515: # Now try linking the two files.
! 1516: mv conftest.$objext conftestm.$objext
! 1517: save_LIBS="$LIBS"
! 1518: save_CFLAGS="$CFLAGS"
! 1519: LIBS="conftestm.$objext"
! 1520: CFLAGS="$CFLAGS$no_builtin_flag"
! 1521: if { (eval echo $progname:1521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
! 1522: pipe_works=yes
! 1523: else
! 1524: echo "$progname: failed program was:" >&5
! 1525: cat conftest.c >&5
! 1526: fi
! 1527: LIBS="$save_LIBS"
! 1528: else
! 1529: echo "cannot find nm_test_func in $nlist" >&5
! 1530: fi
1.2 frystyk 1531: else
1.4 ! frystyk 1532: echo "cannot find nm_test_var in $nlist" >&5
1.2 frystyk 1533: fi
1534: else
1.4 ! frystyk 1535: echo "cannot run $global_symbol_pipe" >&5
1.2 frystyk 1536: fi
1537: else
1.4 ! frystyk 1538: echo "$progname: failed program was:" >&5
! 1539: cat conftest.c >&5
1.2 frystyk 1540: fi
1.4 ! frystyk 1541: $rm conftest*
1.2 frystyk 1542:
1.4 ! frystyk 1543: # Do not use the global_symbol_pipe unless it works.
! 1544: if test "$pipe_works" = yes; then
! 1545: break
! 1546: else
! 1547: global_symbol_pipe=
! 1548: fi
! 1549: done
1.2 frystyk 1550: echo "$ac_t$pipe_works" 1>&6
1.1 frystyk 1551:
1552: # Check hardcoding attributes.
1553: echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
1554: hardcode_action=
1555: if test -n "$hardcode_libdir_flag_spec" || \
1.2 frystyk 1556: test -n "$runpath_var"; then
1.1 frystyk 1557:
1558: # We can hardcode non-existant directories.
1559: if test "$hardcode_direct" != no && \
1560: test "$hardcode_minus_L" != no && \
1561: test "$hardcode_shlibpath_var" != no; then
1562:
1563: # Linking always hardcodes the temporary library directory.
1564: hardcode_action=relink
1565: else
1566: # We can link without hardcoding, and we can hardcode nonexisting dirs.
1567: hardcode_action=immediate
1568: fi
1.3 frystyk 1569: else
1570: # We cannot hardcode anything, or else we can only hardcode existing
1571: # directories.
1.1 frystyk 1572: hardcode_action=unsupported
1573: fi
1.2 frystyk 1574: echo "$ac_t$hardcode_action" 1>&6
1.1 frystyk 1575:
1576:
1577: reload_flag=
1578: reload_cmds='$LD$reload_flag -o $output$reload_objs'
1579: echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
1.3 frystyk 1580: # PORTME Some linkers may need a different reload flag.
1.1 frystyk 1581: reload_flag='-r'
1.3 frystyk 1582: echo "$ac_t$reload_flag" 1>&6
1.1 frystyk 1583: test -n "$reload_flag" && reload_flag=" $reload_flag"
1584:
1585: # PORTME Fill in your ld.so characteristics
1586: library_names_spec=
1.2 frystyk 1587: libname_spec='lib$name'
1.1 frystyk 1588: soname_spec=
1589: postinstall_cmds=
1.2 frystyk 1590: postuninstall_cmds=
1.1 frystyk 1591: finish_cmds=
1.2 frystyk 1592: finish_eval=
1.1 frystyk 1593: shlibpath_var=
1594: version_type=none
1595: dynamic_linker="$host_os ld.so"
1.4 ! frystyk 1596: sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
! 1597: file_magic_command=
! 1598: deplibs_check_method='unknown'
! 1599: # Need to set the preceding variable on all platforms that support
! 1600: # interlibrary dependencies.
! 1601: # 'none' -- dependencies not supported.
! 1602: # `unknown' -- same as none, but documents that we really don't known.
! 1603: # 'pass_all' -- all dependencies passed with no checks.
! 1604: # 'test_compile' -- check by making test program.
! 1605: # 'file_regex' -- check by looking for filenames that look like the shared
! 1606: # library in the library path.
! 1607: # 'file_magic [regex]' -- check by looking for files in library path which
! 1608: # responds to the $file_magic_command with a given regex. This is actually a
! 1609: # superset of the file_regex command. If you have `file' or equivalent on
! 1610: # your system, you'll want to use this instead.
! 1611: # Notes: regexs are run through expr.
1.1 frystyk 1612: echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
1613: case "$host_os" in
1.4 ! frystyk 1614: aix3*)
1.1 frystyk 1615: version_type=linux
1.3 frystyk 1616: library_names_spec='${libname}${release}.so$versuffix $libname.a'
1.1 frystyk 1617: shlibpath_var=LIBPATH
1618:
1619: # AIX has no versioning support, so we append a major version to the name.
1.3 frystyk 1620: soname_spec='${libname}${release}.so$major'
1.2 frystyk 1621: ;;
1622:
1.4 ! frystyk 1623: aix4*)
! 1624: version_type=linux
! 1625: # AIX has no versioning support, so currently we can not hardcode correct
! 1626: # soname into executable. Probably we can add versioning support to
! 1627: # collect2, so additional links can be useful in future.
! 1628: # We preserve .a as extension for shared libraries though AIX4.2
! 1629: # and later linker supports .so
! 1630: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
! 1631: shlibpath_var=LIBPATH
! 1632: deplibs_check_method=pass_all
! 1633: ;;
! 1634:
1.2 frystyk 1635: amigaos*)
1636: library_names_spec='$libname.ixlibrary $libname.a'
1637: # Create ${libname}_ixlibrary.a entries in /sys/libs.
1638: 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'
1.1 frystyk 1639: ;;
1640:
1.4 ! frystyk 1641: beos*)
! 1642: library_names_spec='${libname}.so'
! 1643: dynamic_linker="$host_os ld.so"
! 1644: shlibpath_var=LIBRARY_PATH
! 1645: ;;
! 1646:
! 1647: bsdi4*)
! 1648: version_type=linux
! 1649: library_names_spec='${libname}.so$major ${libname}.so'
! 1650: soname_spec='${libname}.so'
! 1651: finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
! 1652: shlibpath_var=LD_LIBRARY_PATH
! 1653: check_shared_deplibs_method='file_magic ELF 32-bit LSB shared object'
! 1654: sys_lib_search_path="/shlib /usr/lib /usr/local/lib"
! 1655: ;;
! 1656:
! 1657: cygwin32* | mingw32*)
! 1658: version_type=windows
! 1659: if test "$with_gcc" = yes; then
! 1660: library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
! 1661: else
! 1662: library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
! 1663: fi
! 1664: dynamic_linker='Win32 ld.exe'
! 1665: deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
! 1666: file_magic_command='objdump -f'
! 1667: need_lib_prefix=no
! 1668: # FIXME: first we should search . and the directory the executable is in
! 1669: shlibpath_var=PATH
! 1670: ;;
! 1671:
! 1672: freebsd1*)
! 1673: dynamic_linker=no
! 1674: ;;
! 1675:
! 1676: freebsd*)
! 1677: objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
! 1678: version_type=freebsd-$objformat
! 1679: case "$version_type" in
! 1680: freebsd-elf*)
! 1681: deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
! 1682: file_magic_command=file
! 1683: ;;
! 1684: freebsd-*)
! 1685: deplibs_check_method=unknown
! 1686: ;;
! 1687: esac
! 1688: library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
! 1689: finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="$objformat" ldconfig -m $libdir'
1.1 frystyk 1690: shlibpath_var=LD_LIBRARY_PATH
1.4 ! frystyk 1691: need_version=yes
1.1 frystyk 1692: ;;
1693:
1694: gnu*)
1.3 frystyk 1695: version_type=linux
1696: library_names_spec='${libname}${release}.so$versuffix ${libname}.so'
1.1 frystyk 1697: shlibpath_var=LD_LIBRARY_PATH
1698: ;;
1699:
1.3 frystyk 1700: hpux9* | hpux10* | hpux11*)
1.1 frystyk 1701: # Give a soname corresponding to the major version so that dld.sl refuses to
1702: # link against other versions.
1703: dynamic_linker="$host_os dld.sl"
1704: version_type=sunos
1705: shlibpath_var=SHLIB_PATH
1.3 frystyk 1706: library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
1707: soname_spec='${libname}${release}.sl$major'
1.1 frystyk 1708: # HP-UX runs *really* slowly unless shared libraries are mode 555.
1709: postinstall_cmds='chmod 555 $lib'
1710: ;;
1711:
1.4 ! frystyk 1712: irix5*)
1.1 frystyk 1713: version_type=osf
1.2 frystyk 1714: soname_spec='${libname}${release}.so'
1.3 frystyk 1715: library_names_spec='${libname}${release}.so$versuffix $libname.so'
1.1 frystyk 1716: shlibpath_var=LD_LIBRARY_PATH
1717: ;;
1718:
1.4 ! frystyk 1719: irix6*)
! 1720: version_type=osf
! 1721: soname_spec='${libname}${release}.so'
! 1722: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
! 1723: shlibpath_var=LD_LIBRARYN32_PATH
! 1724: ;;
! 1725:
1.1 frystyk 1726: # No shared lib support for Linux oldld, aout, or coff.
1727: linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
1728: dynamic_linker=no
1729: ;;
1730:
1731: # This must be Linux ELF.
1732: linux-gnu*)
1733: version_type=linux
1.4 ! frystyk 1734: need_lib_prefix=no
! 1735: need_version=no
1.3 frystyk 1736: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1737: soname_spec='${libname}${release}.so$major'
1.4 ! frystyk 1738: finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
1.1 frystyk 1739: shlibpath_var=LD_LIBRARY_PATH
1.4 ! frystyk 1740: deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
! 1741: file_magic_command=file
1.1 frystyk 1742:
1743: if test -f /lib/ld.so.1; then
1744: dynamic_linker='GNU ld.so'
1745: else
1746: # Only the GNU ld.so supports shared libraries on MkLinux.
1747: case "$host_cpu" in
1748: powerpc*) dynamic_linker=no ;;
1749: *) dynamic_linker='Linux ld.so' ;;
1750: esac
1751: fi
1752: ;;
1753:
1.4 ! frystyk 1754: netbsd*)
! 1755: version_type=sunos
! 1756: if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
! 1757: library_names_spec='${libname}${release}.so$versuffix'
! 1758: finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
! 1759: dynamic_linker='NetBSD (a.out) ld.so'
! 1760: else
! 1761: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so'
! 1762: soname_spec='${libname}${release}.so$major'
! 1763: dynamic_linker='NetBSD ld.elf_so'
! 1764: fi
! 1765: shlibpath_var=LD_LIBRARY_PATH
! 1766: ;;
! 1767:
! 1768: openbsd*)
1.1 frystyk 1769: version_type=sunos
1.3 frystyk 1770: library_names_spec='${libname}${release}.so$versuffix'
1771: finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
1.1 frystyk 1772: shlibpath_var=LD_LIBRARY_PATH
1773: ;;
1774:
1.2 frystyk 1775: os2*)
1776: libname_spec='$name'
1.4 ! frystyk 1777: need_lib_prefix=no
1.2 frystyk 1778: library_names_spec='$libname.dll $libname.a'
1779: dynamic_linker='OS/2 ld.exe'
1780: shlibpath_var=LIBPATH
1781: ;;
1782:
1.1 frystyk 1783: osf3* | osf4*)
1784: version_type=osf
1.2 frystyk 1785: soname_spec='${libname}${release}.so'
1.4 ! frystyk 1786: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
1.1 frystyk 1787: shlibpath_var=LD_LIBRARY_PATH
1.4 ! frystyk 1788: deplibs_check_method='pass_all'
1.1 frystyk 1789: ;;
1790:
1791: sco3.2v5*)
1792: version_type=osf
1.3 frystyk 1793: soname_spec='${libname}${release}.so$major'
1794: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1.1 frystyk 1795: shlibpath_var=LD_LIBRARY_PATH
1796: ;;
1797:
1.4 ! frystyk 1798: solaris*)
1.1 frystyk 1799: version_type=linux
1.4 ! frystyk 1800: need_lib_prefix=no
! 1801: need_version=no
1.3 frystyk 1802: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1803: soname_spec='${libname}${release}.so$major'
1.1 frystyk 1804: shlibpath_var=LD_LIBRARY_PATH
1.3 frystyk 1805: # ldd complains unless libraries are executable
1806: postinstall_cmds='chmod +x $lib'
1.4 ! frystyk 1807: deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
! 1808: file_magic_command="file"
1.1 frystyk 1809: ;;
1810:
1811: sunos4*)
1812: version_type=sunos
1.4 ! frystyk 1813: library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
1.3 frystyk 1814: finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
1.2 frystyk 1815: shlibpath_var=LD_LIBRARY_PATH
1.4 ! frystyk 1816: need_version=yes
1.2 frystyk 1817: ;;
1818:
1.4 ! frystyk 1819: sysv4.2uw2* | sysv4.3* | sysv5*)
1.2 frystyk 1820: version_type=linux
1.3 frystyk 1821: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1822: soname_spec='${libname}${release}.so$major'
1.2 frystyk 1823: shlibpath_var=LD_LIBRARY_PATH
1.4 ! frystyk 1824: case "$host_vendor" in
! 1825: ncr)
! 1826: deplibs_check_method='pass_all'
! 1827: ;;
! 1828: esac
1.2 frystyk 1829: ;;
1830:
1831: uts4*)
1832: version_type=linux
1.4 ! frystyk 1833: library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so$major $libname.so'
! 1834: soname_spec='${libname}${release}.so$major'
! 1835: shlibpath_var=LD_LIBRARY_PATH
! 1836: ;;
! 1837:
! 1838: dgux*)
! 1839: version_type=linux
1.3 frystyk 1840: library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1841: soname_spec='${libname}${release}.so$major'
1.1 frystyk 1842: shlibpath_var=LD_LIBRARY_PATH
1843: ;;
1844:
1845: *)
1846: dynamic_linker=no
1847: ;;
1848: esac
1.4 ! frystyk 1849: echo "$ac_t$dynamic_linker" 1>&6
1.1 frystyk 1850: test "$dynamic_linker" = no && can_build_shared=no
1851:
1.2 frystyk 1852: # Report the final consequences.
1.1 frystyk 1853: echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
1854:
1855: echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
1856: test "$can_build_shared" = "no" && enable_shared=no
1857:
1.2 frystyk 1858: # On AIX, shared libraries and static libraries use the same namespace, and
1859: # are all built from PIC.
1.1 frystyk 1860: case "$host_os" in
1.4 ! frystyk 1861: aix3*)
1.1 frystyk 1862: test "$enable_shared" = yes && enable_static=no
1863: if test -n "$RANLIB"; then
1.4 ! frystyk 1864: archive_cmds="$archive_cmds~\$RANLIB \$lib"
1.1 frystyk 1865: postinstall_cmds='$RANLIB $lib'
1866: fi
1867: ;;
1.4 ! frystyk 1868:
! 1869: aix4*)
! 1870: test "$enable_shared" = yes && enable_static=no
! 1871: ;;
1.1 frystyk 1872: esac
1873:
1.2 frystyk 1874: echo "$ac_t$enable_shared" 1>&6
1.1 frystyk 1875:
1876: # Make sure either enable_shared or enable_static is yes.
1877: test "$enable_shared" = yes || enable_static=yes
1878:
1879: echo "checking whether to build static libraries... $enable_static" 1>&6
1880:
1.2 frystyk 1881: echo $ac_n "checking for objdir... $ac_c" 1>&6
1882: rm -f .libs 2>/dev/null
1883: mkdir .libs 2>/dev/null
1884: if test -d .libs; then
1885: objdir=.libs
1886: else
1887: # MS-DOS does not allow filenames that begin with a dot.
1888: objdir=_libs
1889: fi
1890: rmdir .libs 2>/dev/null
1891: echo "$ac_t$objdir" 1>&6
1892:
1893: # Copy echo and quote the copy, instead of the original, because it is
1894: # used later.
1895: ltecho="$echo"
1.4 ! frystyk 1896: if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
! 1897: ltecho="$CONFIG_SHELL \$0 --fallback-echo"
! 1898: fi
! 1899: LTSHELL="$SHELL"
! 1900:
! 1901: # Only quote variables if we're using ltmain.sh.
! 1902: case "$ltmain" in
! 1903: *.sh)
! 1904: # Now quote all the things that may contain metacharacters.
! 1905: for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
! 1906: old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL VERSION \
! 1907: reload_flag reload_cmds wl \
! 1908: pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
! 1909: whole_archive_flag_spec libname_spec library_names_spec soname_spec \
! 1910: RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
! 1911: old_postuninstall_cmds archive_cmds archive_sym_cmds postinstall_cmds postuninstall_cmds \
! 1912: file_magic_command deplibs_check_method allow_undefined_flag no_undefined_flag \
! 1913: finish_cmds finish_eval global_symbol_pipe \
! 1914: hardcode_libdir_flag_spec hardcode_libdir_separator sys_lib_search_path_spec \
! 1915: compiler_c_o compiler_o_lo need_locks; do
! 1916:
! 1917: case "$var" in
! 1918: reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
! 1919: old_postinstall_cmds | old_postuninstall_cmds | \
! 1920: archive_cmds | archive_sym_cmds | \
! 1921: postinstall_cmds | postuninstall_cmds | \
! 1922: finish_cmds | sys_lib_search_path_spec)
! 1923: # Double-quote double-evaled strings.
! 1924: eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
! 1925: ;;
! 1926: *)
! 1927: eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
! 1928: ;;
! 1929: esac
! 1930: done
1.2 frystyk 1931:
1.4 ! frystyk 1932: case "$ltecho" in
! 1933: *'\$0 --fallback-echo"')
! 1934: ltecho=`$echo "X$ltecho" |
! 1935: $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
1.2 frystyk 1936: ;;
1937: esac
1938:
1.4 ! frystyk 1939: trap "$rm \"$ofile\"; exit 1" 1 2 15
! 1940: echo "creating $ofile"
! 1941: $rm "$ofile"
! 1942: cat <<EOF > "$ofile"
1.3 frystyk 1943: #! $SHELL
1.1 frystyk 1944:
1.3 frystyk 1945: # `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
1.4 ! frystyk 1946: # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
1.2 frystyk 1947: # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
1948: #
1.4 ! frystyk 1949: # Copyright (C) 1996-1999 Free Software Foundation, Inc.
1.2 frystyk 1950: # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
1951: #
1952: # This program is free software; you can redistribute it and/or modify
1953: # it under the terms of the GNU General Public License as published by
1954: # the Free Software Foundation; either version 2 of the License, or
1955: # (at your option) any later version.
1.1 frystyk 1956: #
1.2 frystyk 1957: # This program is distributed in the hope that it will be useful, but
1958: # WITHOUT ANY WARRANTY; without even the implied warranty of
1959: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1960: # General Public License for more details.
1961: #
1962: # You should have received a copy of the GNU General Public License
1963: # along with this program; if not, write to the Free Software
1964: # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1965: #
1966: # As a special exception to the GNU General Public License, if you
1967: # distribute this file as part of a program that contains a
1968: # configuration script generated by Autoconf, you may include it under
1969: # the same distribution terms that you use for the rest of that program.
1970:
1.3 frystyk 1971: # Sed that helps us avoid accidentally triggering echo(1) options like -n.
1972: Xsed="sed -e s/^X//"
1973:
1974: # The HP-UX ksh and POSIX shell print the target directory to stdout
1975: # if CDPATH is set.
1976: if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
1977:
1978: ### BEGIN LIBTOOL CONFIG
1.4 ! frystyk 1979: EOF
! 1980: cfgfile="$ofile"
! 1981: ;;
! 1982:
! 1983: *)
! 1984: # Double-quote the variables that need it (for aesthetics).
! 1985: for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
! 1986: old_LN_S old_DLLTOOL old_AS; do
! 1987: eval "$var=\\\"\$var\\\""
! 1988: done
! 1989:
! 1990: # Just create a config file.
! 1991: cfgfile="$ofile.cfg"
! 1992: trap "$rm \"$cfgfile\"; exit 1" 1 2 15
! 1993: echo "creating $cfgfile"
! 1994: $rm "$cfgfile"
! 1995: cat <<EOF > "$cfgfile"
! 1996: # `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
! 1997: # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
! 1998: EOF
! 1999: ;;
! 2000: esac
! 2001:
! 2002: cat <<EOF >> "$cfgfile"
1.3 frystyk 2003: # Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1.1 frystyk 2004: #
1.4 ! frystyk 2005: # CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
! 2006: # LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
! 2007: # DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
1.1 frystyk 2008: # $0$ltconfig_args
2009: #
2010: # Compiler and other test output produced by $progname, useful for
2011: # debugging $progname, is in ./config.log if it exists.
2012:
2013: # The version of $progname that generated this script.
2014: LTCONFIG_VERSION="$VERSION"
2015:
1.2 frystyk 2016: # Shell to use when invoking shell scripts.
1.4 ! frystyk 2017: SHELL=$LTSHELL
1.2 frystyk 2018:
1.3 frystyk 2019: # Whether or not to build shared libraries.
1.1 frystyk 2020: build_libtool_libs=$enable_shared
2021:
1.3 frystyk 2022: # Whether or not to build static libraries.
1.1 frystyk 2023: build_old_libs=$enable_static
2024:
2025: # The host system.
1.4 ! frystyk 2026: host_alias=$host_alias
! 2027: host=$host
1.1 frystyk 2028:
1.3 frystyk 2029: # An echo program that does not interpret backslashes.
1.4 ! frystyk 2030: echo=$ltecho
1.3 frystyk 2031:
1.1 frystyk 2032: # The archiver.
1.4 ! frystyk 2033: AR=$AR
1.2 frystyk 2034:
2035: # The default C compiler.
1.4 ! frystyk 2036: CC=$CC
1.1 frystyk 2037:
2038: # The linker used to build libraries.
1.4 ! frystyk 2039: LD=$LD
1.1 frystyk 2040:
2041: # Whether we need hard or soft links.
1.4 ! frystyk 2042: LN_S=$LN_S
1.2 frystyk 2043:
2044: # A BSD-compatible nm program.
1.4 ! frystyk 2045: NM=$NM
! 2046:
! 2047: # Used on cygwin32: DLL creation program.
! 2048: DLLTOOL="$DLLTOOL"
! 2049:
! 2050: # Used on cygwin32: assembler.
! 2051: AS="$AS"
1.2 frystyk 2052:
2053: # The name of the directory that contains temporary libtool files.
1.4 ! frystyk 2054: objdir=$objdir
1.1 frystyk 2055:
2056: # How to create reloadable object files.
1.4 ! frystyk 2057: reload_flag=$reload_flag
! 2058: reload_cmds=$reload_cmds
1.1 frystyk 2059:
2060: # How to pass a linker flag through the compiler.
1.4 ! frystyk 2061: wl=$wl
! 2062:
! 2063: # Object file suffix (normally "o").
! 2064: objext="$objext"
! 2065:
! 2066: # Old archive suffix (normally "a").
! 2067: libext="$libext"
1.1 frystyk 2068:
2069: # Additional compiler flags for building library objects.
1.4 ! frystyk 2070: pic_flag=$pic_flag
! 2071:
! 2072: # Does compiler simultaneously support -c and -o options
! 2073: compiler_c_o=$compiler_c_o
! 2074:
! 2075: # Can we write directly to a .lo ?
! 2076: compiler_o_lo=$compiler_o_lo
! 2077:
! 2078: # Must we lock files when doing compilation ?
! 2079: need_locks=$need_locks
! 2080:
! 2081: # Do we need the lib prefix for modules?
! 2082: need_lib_prefix=$need_lib_prefix
! 2083:
! 2084: # Do we need a version for libraries?
! 2085: need_version=$need_version
1.1 frystyk 2086:
2087: # Compiler flag to prevent dynamic linking.
1.4 ! frystyk 2088: link_static_flag=$link_static_flag
1.2 frystyk 2089:
2090: # Compiler flag to turn off builtin functions.
1.4 ! frystyk 2091: no_builtin_flag=$no_builtin_flag
1.1 frystyk 2092:
2093: # Compiler flag to allow reflexive dlopens.
1.4 ! frystyk 2094: export_dynamic_flag_spec=$export_dynamic_flag_spec
1.1 frystyk 2095:
1.3 frystyk 2096: # Compiler flag to generate shared objects directly from archives.
1.4 ! frystyk 2097: whole_archive_flag_spec=$whole_archive_flag_spec
1.3 frystyk 2098:
1.1 frystyk 2099: # Library versioning type.
2100: version_type=$version_type
2101:
1.2 frystyk 2102: # Format of library name prefix.
1.4 ! frystyk 2103: libname_spec=$libname_spec
1.2 frystyk 2104:
1.1 frystyk 2105: # List of archive names. First name is the real one, the rest are links.
2106: # The last name is the one that the linker finds with -lNAME.
1.4 ! frystyk 2107: library_names_spec=$library_names_spec
1.1 frystyk 2108:
2109: # The coded name of the library, if different from the real name.
1.4 ! frystyk 2110: soname_spec=$soname_spec
1.1 frystyk 2111:
2112: # Commands used to build and install an old-style archive.
1.4 ! frystyk 2113: RANLIB=$RANLIB
! 2114: old_archive_cmds=$old_archive_cmds
! 2115: old_postinstall_cmds=$old_postinstall_cmds
! 2116: old_postuninstall_cmds=$old_postuninstall_cmds
1.2 frystyk 2117:
2118: # Create an old-style archive from a shared archive.
1.4 ! frystyk 2119: old_archive_from_new_cmds=$old_archive_from_new_cmds
1.1 frystyk 2120:
2121: # Commands used to build and install a shared archive.
1.4 ! frystyk 2122: archive_cmds=$archive_cmds
! 2123: archive_sym_cmds=$archive_sym_cmds
! 2124: postinstall_cmds=$postinstall_cmds
! 2125: postuninstall_cmds=$postuninstall_cmds
! 2126:
! 2127: # Method to check whether dependent libraries are shared objects.
! 2128: deplibs_check_method=$deplibs_check_method
! 2129:
! 2130: # Command to use when deplibs_check_method == file_magic
! 2131: file_magic_command=$file_magic_command
1.1 frystyk 2132:
2133: # Flag that allows shared libraries with undefined symbols to be built.
1.4 ! frystyk 2134: allow_undefined_flag=$allow_undefined_flag
1.2 frystyk 2135:
2136: # Flag that forces no undefined symbols.
1.4 ! frystyk 2137: no_undefined_flag=$no_undefined_flag
1.1 frystyk 2138:
2139: # Commands used to finish a libtool library installation in a directory.
1.4 ! frystyk 2140: finish_cmds=$finish_cmds
1.2 frystyk 2141:
2142: # Same as above, but a single script fragment to be evaled but not shown.
1.4 ! frystyk 2143: finish_eval=$finish_eval
1.1 frystyk 2144:
1.2 frystyk 2145: # Take the output of nm and produce a listing of raw symbols and C names.
1.4 ! frystyk 2146: global_symbol_pipe=$global_symbol_pipe
1.1 frystyk 2147:
2148: # This is the shared library runtime path variable.
2149: runpath_var=$runpath_var
2150:
2151: # This is the shared library path variable.
2152: shlibpath_var=$shlibpath_var
2153:
2154: # How to hardcode a shared library path into an executable.
2155: hardcode_action=$hardcode_action
2156:
2157: # Flag to hardcode \$libdir into a binary during linking.
2158: # This must work even if \$libdir does not exist.
1.4 ! frystyk 2159: hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
1.1 frystyk 2160:
2161: # Whether we need a single -rpath flag with a separated argument.
1.4 ! frystyk 2162: hardcode_libdir_separator=$hardcode_libdir_separator
1.1 frystyk 2163:
2164: # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
2165: # resulting binary.
2166: hardcode_direct=$hardcode_direct
2167:
2168: # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
2169: # resulting binary.
2170: hardcode_minus_L=$hardcode_minus_L
2171:
2172: # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
2173: # the resulting binary.
2174: hardcode_shlibpath_var=$hardcode_shlibpath_var
1.4 ! frystyk 2175:
! 2176: # System search path for libraries
! 2177: sys_lib_search_path_spec=$sys_lib_search_path_spec
! 2178:
! 2179: # Fix the shell variable \$srcfile for the compiler.
! 2180: fix_srcfile_path="$fix_srcfile_path"
1.1 frystyk 2181: EOF
2182:
1.4 ! frystyk 2183: case "$ltmain" in
! 2184: *.sh)
! 2185: echo '### END LIBTOOL CONFIG' >> "$ofile"
! 2186: echo >> "$ofile"
! 2187: case "$host_os" in
! 2188: aix3*)
! 2189: cat <<\EOF >> "$ofile"
1.3 frystyk 2190:
1.2 frystyk 2191: # AIX sometimes has problems with the GCC collect2 program. For some
2192: # reason, if we set the COLLECT_NAMES environment variable, the problems
2193: # vanish in a puff of smoke.
2194: if test "${COLLECT_NAMES+set}" != set; then
2195: COLLECT_NAMES=
2196: export COLLECT_NAMES
2197: fi
2198: EOF
1.4 ! frystyk 2199: ;;
! 2200: esac
1.1 frystyk 2201:
1.4 ! frystyk 2202: # Append the ltmain.sh script.
! 2203: cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
1.3 frystyk 2204:
1.4 ! frystyk 2205: chmod +x "$ofile"
! 2206: ;;
1.1 frystyk 2207:
1.4 ! frystyk 2208: *)
! 2209: # Compile the libtool program.
! 2210: echo "FIXME: would compile $ltmain"
! 2211: ;;
! 2212: esac
1.1 frystyk 2213: exit 0
2214:
2215: # Local Variables:
2216: # mode:shell-script
2217: # sh-indentation:2
2218: # End:
Webmaster