aclocal.m4 revision b534f209
1b534f209Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*-
215fb4814Smrg
315fb4814Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4b534f209Smrg# 2005, 2006  Free Software Foundation, Inc.
515fb4814Smrg# This file is free software; the Free Software Foundation
615fb4814Smrg# gives unlimited permission to copy and/or distribute it,
715fb4814Smrg# with or without modifications, as long as this notice is preserved.
815fb4814Smrg
915fb4814Smrg# This program is distributed in the hope that it will be useful,
1015fb4814Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1115fb4814Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1215fb4814Smrg# PARTICULAR PURPOSE.
1315fb4814Smrg
14b534f209Smrgm4_if(m4_PACKAGE_VERSION, [2.61],,
15b534f209Smrg[m4_fatal([this file was generated for autoconf 2.61.
16b534f209SmrgYou have another version of autoconf.  If you want to use that,
17b534f209Smrgyou should regenerate the build system entirely.], [63])])
18de78e416Smrg
1915fb4814Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2015fb4814Smrg
21b534f209Smrg# serial 51 AC_PROG_LIBTOOL
2215fb4814Smrg
2315fb4814Smrg
24b534f209Smrg# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
25b534f209Smrg# -----------------------------------------------------------
26b534f209Smrg# If this macro is not defined by Autoconf, define it here.
27b534f209Smrgm4_ifdef([AC_PROVIDE_IFELSE],
28b534f209Smrg         [],
29b534f209Smrg         [m4_define([AC_PROVIDE_IFELSE],
30b534f209Smrg	         [m4_ifdef([AC_PROVIDE_$1],
31b534f209Smrg		           [$2], [$3])])])
32b410ddbeSmrg
33b410ddbeSmrg
34b534f209Smrg# AC_PROG_LIBTOOL
35b534f209Smrg# ---------------
36b534f209SmrgAC_DEFUN([AC_PROG_LIBTOOL],
37b534f209Smrg[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
38b534f209Smrgdnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
39b534f209Smrgdnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
40b534f209Smrg  AC_PROVIDE_IFELSE([AC_PROG_CXX],
41b534f209Smrg    [AC_LIBTOOL_CXX],
42b534f209Smrg    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
43b534f209Smrg  ])])
44b534f209Smrgdnl And a similar setup for Fortran 77 support
45b534f209Smrg  AC_PROVIDE_IFELSE([AC_PROG_F77],
46b534f209Smrg    [AC_LIBTOOL_F77],
47b534f209Smrg    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
48b534f209Smrg])])
49b534f209Smrg
50b534f209Smrgdnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
51b534f209Smrgdnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
52b534f209Smrgdnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
53b534f209Smrg  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
54b534f209Smrg    [AC_LIBTOOL_GCJ],
55b534f209Smrg    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
56b534f209Smrg      [AC_LIBTOOL_GCJ],
57b534f209Smrg      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
58b534f209Smrg	[AC_LIBTOOL_GCJ],
59b534f209Smrg      [ifdef([AC_PROG_GCJ],
60b534f209Smrg	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
61b534f209Smrg       ifdef([A][M_PROG_GCJ],
62b534f209Smrg	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
63b534f209Smrg       ifdef([LT_AC_PROG_GCJ],
64b534f209Smrg	     [define([LT_AC_PROG_GCJ],
65b534f209Smrg		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
66b534f209Smrg])])# AC_PROG_LIBTOOL
67b534f209Smrg
68b534f209Smrg
69b534f209Smrg# _AC_PROG_LIBTOOL
70b534f209Smrg# ----------------
71b534f209SmrgAC_DEFUN([_AC_PROG_LIBTOOL],
72b534f209Smrg[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
73b534f209SmrgAC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
74b534f209SmrgAC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
75b534f209SmrgAC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
7615fb4814Smrg
7715fb4814Smrg# This can be used to rebuild libtool when needed
78b534f209SmrgLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
7915fb4814Smrg
8015fb4814Smrg# Always use our own libtool.
8115fb4814SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
8215fb4814SmrgAC_SUBST(LIBTOOL)dnl
8315fb4814Smrg
84b534f209Smrg# Prevent multiple expansion
85b534f209Smrgdefine([AC_PROG_LIBTOOL], [])
86b534f209Smrg])# _AC_PROG_LIBTOOL
87b410ddbeSmrg
88b410ddbeSmrg
89b534f209Smrg# AC_LIBTOOL_SETUP
90b534f209Smrg# ----------------
91b534f209SmrgAC_DEFUN([AC_LIBTOOL_SETUP],
92b534f209Smrg[AC_PREREQ(2.50)dnl
93b534f209SmrgAC_REQUIRE([AC_ENABLE_SHARED])dnl
94b534f209SmrgAC_REQUIRE([AC_ENABLE_STATIC])dnl
95b534f209SmrgAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
96b534f209SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
9715fb4814SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
9815fb4814SmrgAC_REQUIRE([AC_PROG_CC])dnl
99b534f209SmrgAC_REQUIRE([AC_PROG_LD])dnl
100b534f209SmrgAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
101b534f209SmrgAC_REQUIRE([AC_PROG_NM])dnl
102b534f209Smrg
10315fb4814SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
104b534f209SmrgAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
105b534f209Smrg# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
106b534f209SmrgAC_REQUIRE([AC_OBJEXT])dnl
107b534f209SmrgAC_REQUIRE([AC_EXEEXT])dnl
10815fb4814Smrgdnl
10915fb4814Smrg
110b534f209SmrgAC_LIBTOOL_SYS_MAX_CMD_LEN
111b534f209SmrgAC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
112b534f209SmrgAC_LIBTOOL_OBJDIR
113b410ddbeSmrg
114b534f209SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
115b534f209Smrg_LT_AC_PROG_ECHO_BACKSLASH
11615fb4814Smrg
11715fb4814Smrgcase $host_os in
11815fb4814Smrgaix3*)
11915fb4814Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
12015fb4814Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
12115fb4814Smrg  # vanish in a puff of smoke.
12215fb4814Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
12315fb4814Smrg    COLLECT_NAMES=
12415fb4814Smrg    export COLLECT_NAMES
12515fb4814Smrg  fi
12615fb4814Smrg  ;;
12715fb4814Smrgesac
12815fb4814Smrg
12915fb4814Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
13015fb4814Smrg# metacharacters that are still active within double-quoted strings.
131b534f209SmrgXsed='sed -e 1s/^X//'
132b534f209Smrg[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
13315fb4814Smrg
13415fb4814Smrg# Same as above, but do not quote variable references.
135b534f209Smrg[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
13615fb4814Smrg
13715fb4814Smrg# Sed substitution to delay expansion of an escaped shell variable in a
13815fb4814Smrg# double_quote_subst'ed string.
13915fb4814Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
14015fb4814Smrg
14115fb4814Smrg# Sed substitution to avoid accidental globbing in evaled expressions
14215fb4814Smrgno_glob_subst='s/\*/\\\*/g'
14315fb4814Smrg
144b534f209Smrg# Constants:
145b534f209Smrgrm="rm -f"
146b534f209Smrg
14715fb4814Smrg# Global variables:
148b534f209Smrgdefault_ofile=libtool
14915fb4814Smrgcan_build_shared=yes
15015fb4814Smrg
15115fb4814Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
15215fb4814Smrg# which needs '.lib').
15315fb4814Smrglibext=a
154b534f209Smrgltmain="$ac_aux_dir/ltmain.sh"
155b534f209Smrgofile="$default_ofile"
156b410ddbeSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
15715fb4814Smrg
158b534f209SmrgAC_CHECK_TOOL(AR, ar, false)
159b534f209SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
160b534f209SmrgAC_CHECK_TOOL(STRIP, strip, :)
161b534f209Smrg
16215fb4814Smrgold_CC="$CC"
16315fb4814Smrgold_CFLAGS="$CFLAGS"
16415fb4814Smrg
16515fb4814Smrg# Set sane defaults for various variables
166b534f209Smrgtest -z "$AR" && AR=ar
167b534f209Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
168b534f209Smrgtest -z "$AS" && AS=as
16915fb4814Smrgtest -z "$CC" && CC=cc
17015fb4814Smrgtest -z "$LTCC" && LTCC=$CC
17115fb4814Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
172b534f209Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
17315fb4814Smrgtest -z "$LD" && LD=ld
174b534f209Smrgtest -z "$LN_S" && LN_S="ln -s"
175b534f209Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
176b534f209Smrgtest -z "$NM" && NM=nm
177b534f209Smrgtest -z "$SED" && SED=sed
178b534f209Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
179b534f209Smrgtest -z "$RANLIB" && RANLIB=:
180b534f209Smrgtest -z "$STRIP" && STRIP=:
18115fb4814Smrgtest -z "$ac_objext" && ac_objext=o
18215fb4814Smrg
183b534f209Smrg# Determine commands to create old-style static archives.
184b534f209Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
185b534f209Smrgold_postinstall_cmds='chmod 644 $oldlib'
186b534f209Smrgold_postuninstall_cmds=
187b534f209Smrg
188b534f209Smrgif test -n "$RANLIB"; then
189b534f209Smrg  case $host_os in
190b534f209Smrg  openbsd*)
191b534f209Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
192b534f209Smrg    ;;
193b534f209Smrg  *)
194b534f209Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
195b534f209Smrg    ;;
196b534f209Smrg  esac
197b534f209Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
198b534f209Smrgfi
199b534f209Smrg
20015fb4814Smrg_LT_CC_BASENAME([$compiler])
20115fb4814Smrg
20215fb4814Smrg# Only perform the check for file, if the check method requires it
20315fb4814Smrgcase $deplibs_check_method in
20415fb4814Smrgfile_magic*)
20515fb4814Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
206b534f209Smrg    AC_PATH_MAGIC
20715fb4814Smrg  fi
20815fb4814Smrg  ;;
20915fb4814Smrgesac
21015fb4814Smrg
211b534f209SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
212b534f209SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
213b534f209Smrgenable_win32_dll=yes, enable_win32_dll=no)
214b410ddbeSmrg
215b534f209SmrgAC_ARG_ENABLE([libtool-lock],
216b534f209Smrg    [AC_HELP_STRING([--disable-libtool-lock],
217b534f209Smrg	[avoid locking (might break parallel builds)])])
218b534f209Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
21915fb4814Smrg
220b534f209SmrgAC_ARG_WITH([pic],
221b534f209Smrg    [AC_HELP_STRING([--with-pic],
222b534f209Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
223b534f209Smrg    [pic_mode="$withval"],
224b534f209Smrg    [pic_mode=default])
225b534f209Smrgtest -z "$pic_mode" && pic_mode=default
22615fb4814Smrg
227b534f209Smrg# Use C for the default configuration in the libtool script
228b534f209Smrgtagname=
229b534f209SmrgAC_LIBTOOL_LANG_C_CONFIG
230b534f209Smrg_LT_AC_TAGCONFIG
231b534f209Smrg])# AC_LIBTOOL_SETUP
232b410ddbeSmrg
233b410ddbeSmrg
234b534f209Smrg# _LT_AC_SYS_COMPILER
23515fb4814Smrg# -------------------
236b534f209SmrgAC_DEFUN([_LT_AC_SYS_COMPILER],
23715fb4814Smrg[AC_REQUIRE([AC_PROG_CC])dnl
23815fb4814Smrg
23915fb4814Smrg# If no C compiler was specified, use CC.
24015fb4814SmrgLTCC=${LTCC-"$CC"}
24115fb4814Smrg
24215fb4814Smrg# If no C compiler flags were specified, use CFLAGS.
24315fb4814SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
24415fb4814Smrg
24515fb4814Smrg# Allow CC to be a program name with arguments.
24615fb4814Smrgcompiler=$CC
247b534f209Smrg])# _LT_AC_SYS_COMPILER
248b534f209Smrg
249b534f209Smrg
250b534f209Smrg# _LT_CC_BASENAME(CC)
251b534f209Smrg# -------------------
252b534f209Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
253b534f209SmrgAC_DEFUN([_LT_CC_BASENAME],
254b534f209Smrg[for cc_temp in $1""; do
255b534f209Smrg  case $cc_temp in
256b534f209Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
257b534f209Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
258b534f209Smrg    \-*) ;;
259b534f209Smrg    *) break;;
260b534f209Smrg  esac
261b534f209Smrgdone
262b534f209Smrgcc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
263b534f209Smrg])
26415fb4814Smrg
26515fb4814Smrg
26615fb4814Smrg# _LT_COMPILER_BOILERPLATE
26715fb4814Smrg# ------------------------
26815fb4814Smrg# Check for compiler boilerplate output or warnings with
26915fb4814Smrg# the simple compiler test code.
270b534f209SmrgAC_DEFUN([_LT_COMPILER_BOILERPLATE],
271b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
272de78e416Smrgac_outfile=conftest.$ac_objext
273de78e416Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
27415fb4814Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
27515fb4814Smrg_lt_compiler_boilerplate=`cat conftest.err`
276b534f209Smrg$rm conftest*
27715fb4814Smrg])# _LT_COMPILER_BOILERPLATE
27815fb4814Smrg
27915fb4814Smrg
28015fb4814Smrg# _LT_LINKER_BOILERPLATE
28115fb4814Smrg# ----------------------
28215fb4814Smrg# Check for linker boilerplate output or warnings with
28315fb4814Smrg# the simple link test code.
284b534f209SmrgAC_DEFUN([_LT_LINKER_BOILERPLATE],
285b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
286de78e416Smrgac_outfile=conftest.$ac_objext
287de78e416Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
28815fb4814Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
28915fb4814Smrg_lt_linker_boilerplate=`cat conftest.err`
290b534f209Smrg$rm conftest*
29115fb4814Smrg])# _LT_LINKER_BOILERPLATE
29215fb4814Smrg
29315fb4814Smrg
294b534f209Smrg# _LT_AC_SYS_LIBPATH_AIX
295b534f209Smrg# ----------------------
29615fb4814Smrg# Links a minimal program and checks the executable
29715fb4814Smrg# for the system default hardcoded library path. In most cases,
29815fb4814Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
29915fb4814Smrg# the location of the communication and MPI libs are included too.
30015fb4814Smrg# If we don't find anything, use the default library path according
30115fb4814Smrg# to the aix ld manual.
302b534f209SmrgAC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
303b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
304de78e416SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
305de78e416Smrglt_aix_libpath_sed='
306de78e416Smrg    /Import File Strings/,/^$/ {
307de78e416Smrg	/^0/ {
308de78e416Smrg	    s/^0  *\(.*\)$/\1/
309de78e416Smrg	    p
310de78e416Smrg	}
311de78e416Smrg    }'
312de78e416Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
31315fb4814Smrg# Check for a 64-bit object if we didn't find anything.
314de78e416Smrgif test -z "$aix_libpath"; then
315de78e416Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
316de78e416Smrgfi],[])
31715fb4814Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
318b534f209Smrg])# _LT_AC_SYS_LIBPATH_AIX
31915fb4814Smrg
32015fb4814Smrg
321b534f209Smrg# _LT_AC_SHELL_INIT(ARG)
322b534f209Smrg# ----------------------
323b534f209SmrgAC_DEFUN([_LT_AC_SHELL_INIT],
32415fb4814Smrg[ifdef([AC_DIVERSION_NOTICE],
32515fb4814Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
32615fb4814Smrg	 [AC_DIVERT_PUSH(NOTICE)])
32715fb4814Smrg$1
32815fb4814SmrgAC_DIVERT_POP
329b534f209Smrg])# _LT_AC_SHELL_INIT
33015fb4814Smrg
33115fb4814Smrg
332b534f209Smrg# _LT_AC_PROG_ECHO_BACKSLASH
333b534f209Smrg# --------------------------
33415fb4814Smrg# Add some code to the start of the generated configure script which
33515fb4814Smrg# will find an echo command which doesn't interpret backslashes.
336b534f209SmrgAC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
337b534f209Smrg[_LT_AC_SHELL_INIT([
33815fb4814Smrg# Check that we are running under the correct shell.
33915fb4814SmrgSHELL=${CONFIG_SHELL-/bin/sh}
34015fb4814Smrg
341b534f209Smrgcase X$ECHO in
34215fb4814SmrgX*--fallback-echo)
34315fb4814Smrg  # Remove one level of quotation (which was required for Make).
344b534f209Smrg  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
34515fb4814Smrg  ;;
34615fb4814Smrgesac
34715fb4814Smrg
348b534f209Smrgecho=${ECHO-echo}
34915fb4814Smrgif test "X[$]1" = X--no-reexec; then
35015fb4814Smrg  # Discard the --no-reexec flag, and continue.
35115fb4814Smrg  shift
35215fb4814Smrgelif test "X[$]1" = X--fallback-echo; then
35315fb4814Smrg  # Avoid inline document here, it may be left over
35415fb4814Smrg  :
355b534f209Smrgelif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
356b534f209Smrg  # Yippee, $echo works!
35715fb4814Smrg  :
35815fb4814Smrgelse
35915fb4814Smrg  # Restart under the correct shell.
36015fb4814Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
36115fb4814Smrgfi
36215fb4814Smrg
36315fb4814Smrgif test "X[$]1" = X--fallback-echo; then
36415fb4814Smrg  # used as fallback echo
36515fb4814Smrg  shift
366b534f209Smrg  cat <<EOF
36715fb4814Smrg[$]*
368b534f209SmrgEOF
36915fb4814Smrg  exit 0
37015fb4814Smrgfi
37115fb4814Smrg
37215fb4814Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
37315fb4814Smrg# if CDPATH is set.
37415fb4814Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
37515fb4814Smrg
376b534f209Smrgif test -z "$ECHO"; then
377b534f209Smrgif test "X${echo_test_string+set}" != Xset; then
378b534f209Smrg# find a string as large as possible, as long as the shell can cope with it
379b534f209Smrg  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
380b534f209Smrg    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
381b534f209Smrg    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
382b534f209Smrg       echo_test_string=`eval $cmd` &&
383b534f209Smrg       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
384b534f209Smrg    then
385b534f209Smrg      break
386b534f209Smrg    fi
387b534f209Smrg  done
388b534f209Smrgfi
38915fb4814Smrg
390b534f209Smrgif test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
391b534f209Smrg   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
392b534f209Smrg   test "X$echo_testing_string" = "X$echo_test_string"; then
393b534f209Smrg  :
394b534f209Smrgelse
395b534f209Smrg  # The Solaris, AIX, and Digital Unix default echo programs unquote
396b534f209Smrg  # backslashes.  This makes it impossible to quote backslashes using
397b534f209Smrg  #   echo "$something" | sed 's/\\/\\\\/g'
398b534f209Smrg  #
399b534f209Smrg  # So, first we look for a working echo in the user's PATH.
40015fb4814Smrg
401b534f209Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
402b534f209Smrg  for dir in $PATH /usr/ucb; do
40315fb4814Smrg    IFS="$lt_save_ifs"
404b534f209Smrg    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
405b534f209Smrg       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
406b534f209Smrg       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
407b534f209Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
408b534f209Smrg      echo="$dir/echo"
409b534f209Smrg      break
410b534f209Smrg    fi
411b534f209Smrg  done
412b534f209Smrg  IFS="$lt_save_ifs"
41315fb4814Smrg
414b534f209Smrg  if test "X$echo" = Xecho; then
415b534f209Smrg    # We didn't find a better echo, so look for alternatives.
416b534f209Smrg    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
417b534f209Smrg       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
418b534f209Smrg       test "X$echo_testing_string" = "X$echo_test_string"; then
419b534f209Smrg      # This shell has a builtin print -r that does the trick.
420b534f209Smrg      echo='print -r'
421b534f209Smrg    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
422b534f209Smrg	 test "X$CONFIG_SHELL" != X/bin/ksh; then
423b534f209Smrg      # If we have ksh, try running configure again with it.
424b534f209Smrg      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
425b534f209Smrg      export ORIGINAL_CONFIG_SHELL
426b534f209Smrg      CONFIG_SHELL=/bin/ksh
427b534f209Smrg      export CONFIG_SHELL
428b534f209Smrg      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
429b534f209Smrg    else
430b534f209Smrg      # Try using printf.
431b534f209Smrg      echo='printf %s\n'
432b534f209Smrg      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
433b534f209Smrg	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
434b534f209Smrg	 test "X$echo_testing_string" = "X$echo_test_string"; then
435b534f209Smrg	# Cool, printf works
436b534f209Smrg	:
437b534f209Smrg      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
438b534f209Smrg	   test "X$echo_testing_string" = 'X\t' &&
439b534f209Smrg	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
440b410ddbeSmrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
441b534f209Smrg	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
442b534f209Smrg	export CONFIG_SHELL
443b534f209Smrg	SHELL="$CONFIG_SHELL"
444b534f209Smrg	export SHELL
445b534f209Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
446b534f209Smrg      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
447b534f209Smrg	   test "X$echo_testing_string" = 'X\t' &&
448b534f209Smrg	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
449b534f209Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
450b534f209Smrg	echo="$CONFIG_SHELL [$]0 --fallback-echo"
451b534f209Smrg      else
452b534f209Smrg	# maybe with a smaller string...
453b534f209Smrg	prev=:
45415fb4814Smrg
455b534f209Smrg	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
456b534f209Smrg	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
457b534f209Smrg	  then
458b534f209Smrg	    break
459b410ddbeSmrg	  fi
460b534f209Smrg	  prev="$cmd"
461b534f209Smrg	done
462b534f209Smrg
463b534f209Smrg	if test "$prev" != 'sed 50q "[$]0"'; then
464b534f209Smrg	  echo_test_string=`eval $prev`
465b534f209Smrg	  export echo_test_string
466b534f209Smrg	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
467b534f209Smrg	else
468b534f209Smrg	  # Oops.  We lost completely, so just stick with echo.
469b534f209Smrg	  echo=echo
470b534f209Smrg	fi
47115fb4814Smrg      fi
47215fb4814Smrg    fi
47315fb4814Smrg  fi
47415fb4814Smrgfi
475b534f209Smrgfi
47615fb4814Smrg
47715fb4814Smrg# Copy echo and quote the copy suitably for passing to libtool from
47815fb4814Smrg# the Makefile, instead of quoting the original, which is used later.
479b534f209SmrgECHO=$echo
480b534f209Smrgif test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
481b534f209Smrg   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
48215fb4814Smrgfi
48315fb4814Smrg
484b534f209SmrgAC_SUBST(ECHO)
485b534f209Smrg])])# _LT_AC_PROG_ECHO_BACKSLASH
48615fb4814Smrg
48715fb4814Smrg
488b534f209Smrg# _LT_AC_LOCK
489b534f209Smrg# -----------
490b534f209SmrgAC_DEFUN([_LT_AC_LOCK],
49115fb4814Smrg[AC_ARG_ENABLE([libtool-lock],
492b534f209Smrg    [AC_HELP_STRING([--disable-libtool-lock],
493b534f209Smrg	[avoid locking (might break parallel builds)])])
49415fb4814Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
49515fb4814Smrg
49615fb4814Smrg# Some flags need to be propagated to the compiler or linker for good
49715fb4814Smrg# libtool support.
49815fb4814Smrgcase $host in
49915fb4814Smrgia64-*-hpux*)
50015fb4814Smrg  # Find out which ABI we are using.
50115fb4814Smrg  echo 'int i;' > conftest.$ac_ext
50215fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
50315fb4814Smrg    case `/usr/bin/file conftest.$ac_objext` in
504b534f209Smrg    *ELF-32*)
505b534f209Smrg      HPUX_IA64_MODE="32"
506b534f209Smrg      ;;
507b534f209Smrg    *ELF-64*)
508b534f209Smrg      HPUX_IA64_MODE="64"
509b534f209Smrg      ;;
51015fb4814Smrg    esac
51115fb4814Smrg  fi
51215fb4814Smrg  rm -rf conftest*
51315fb4814Smrg  ;;
51415fb4814Smrg*-*-irix6*)
51515fb4814Smrg  # Find out which ABI we are using.
51615fb4814Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
51715fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
518b534f209Smrg   if test "$lt_cv_prog_gnu_ld" = yes; then
519b534f209Smrg    case `/usr/bin/file conftest.$ac_objext` in
520b534f209Smrg    *32-bit*)
521b534f209Smrg      LD="${LD-ld} -melf32bsmip"
522b534f209Smrg      ;;
523b534f209Smrg    *N32*)
524b534f209Smrg      LD="${LD-ld} -melf32bmipn32"
525b534f209Smrg      ;;
526b534f209Smrg    *64-bit*)
527b534f209Smrg      LD="${LD-ld} -melf64bmip"
528b534f209Smrg      ;;
529b534f209Smrg    esac
530b534f209Smrg   else
531b534f209Smrg    case `/usr/bin/file conftest.$ac_objext` in
532b534f209Smrg    *32-bit*)
533b534f209Smrg      LD="${LD-ld} -32"
534b534f209Smrg      ;;
535b534f209Smrg    *N32*)
536b534f209Smrg      LD="${LD-ld} -n32"
537b534f209Smrg      ;;
538b534f209Smrg    *64-bit*)
539b534f209Smrg      LD="${LD-ld} -64"
540b534f209Smrg      ;;
541b534f209Smrg    esac
542b534f209Smrg   fi
54315fb4814Smrg  fi
54415fb4814Smrg  rm -rf conftest*
54515fb4814Smrg  ;;
54615fb4814Smrg
547de78e416Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
548b534f209Smrgs390*-*linux*|sparc*-*linux*)
54915fb4814Smrg  # Find out which ABI we are using.
55015fb4814Smrg  echo 'int i;' > conftest.$ac_ext
55115fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
55215fb4814Smrg    case `/usr/bin/file conftest.o` in
553b534f209Smrg    *32-bit*)
554b534f209Smrg      case $host in
555b534f209Smrg        x86_64-*kfreebsd*-gnu)
556b534f209Smrg          LD="${LD-ld} -m elf_i386_fbsd"
557b534f209Smrg          ;;
558b534f209Smrg        x86_64-*linux*)
559b534f209Smrg          LD="${LD-ld} -m elf_i386"
560b534f209Smrg          ;;
561b534f209Smrg        ppc64-*linux*|powerpc64-*linux*)
562b534f209Smrg          LD="${LD-ld} -m elf32ppclinux"
563b534f209Smrg          ;;
564b534f209Smrg        s390x-*linux*)
565b534f209Smrg          LD="${LD-ld} -m elf_s390"
566b534f209Smrg          ;;
567b534f209Smrg        sparc64-*linux*)
568b534f209Smrg          LD="${LD-ld} -m elf32_sparc"
569b534f209Smrg          ;;
570b534f209Smrg      esac
571b534f209Smrg      ;;
572b534f209Smrg    *64-bit*)
573b534f209Smrg      libsuff=64
574b534f209Smrg      case $host in
575b534f209Smrg        x86_64-*kfreebsd*-gnu)
576b534f209Smrg          LD="${LD-ld} -m elf_x86_64_fbsd"
577b534f209Smrg          ;;
578b534f209Smrg        x86_64-*linux*)
579b534f209Smrg          LD="${LD-ld} -m elf_x86_64"
580b534f209Smrg          ;;
581b534f209Smrg        ppc*-*linux*|powerpc*-*linux*)
582b534f209Smrg          LD="${LD-ld} -m elf64ppc"
583b534f209Smrg          ;;
584b534f209Smrg        s390*-*linux*)
585b534f209Smrg          LD="${LD-ld} -m elf64_s390"
586b534f209Smrg          ;;
587b534f209Smrg        sparc*-*linux*)
588b534f209Smrg          LD="${LD-ld} -m elf64_sparc"
589b534f209Smrg          ;;
590b534f209Smrg      esac
591b534f209Smrg      ;;
59215fb4814Smrg    esac
59315fb4814Smrg  fi
59415fb4814Smrg  rm -rf conftest*
59515fb4814Smrg  ;;
59615fb4814Smrg
59715fb4814Smrg*-*-sco3.2v5*)
59815fb4814Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
59915fb4814Smrg  SAVE_CFLAGS="$CFLAGS"
60015fb4814Smrg  CFLAGS="$CFLAGS -belf"
60115fb4814Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
60215fb4814Smrg    [AC_LANG_PUSH(C)
603b534f209Smrg     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
60415fb4814Smrg     AC_LANG_POP])
60515fb4814Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
60615fb4814Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
60715fb4814Smrg    CFLAGS="$SAVE_CFLAGS"
60815fb4814Smrg  fi
60915fb4814Smrg  ;;
61015fb4814Smrgsparc*-*solaris*)
61115fb4814Smrg  # Find out which ABI we are using.
61215fb4814Smrg  echo 'int i;' > conftest.$ac_ext
61315fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
61415fb4814Smrg    case `/usr/bin/file conftest.o` in
61515fb4814Smrg    *64-bit*)
61615fb4814Smrg      case $lt_cv_prog_gnu_ld in
61715fb4814Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
618b534f209Smrg      *)    LD="${LD-ld} -64" ;;
61915fb4814Smrg      esac
62015fb4814Smrg      ;;
62115fb4814Smrg    esac
62215fb4814Smrg  fi
62315fb4814Smrg  rm -rf conftest*
62415fb4814Smrg  ;;
625b534f209Smrg
626b534f209SmrgAC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
627b534f209Smrg[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
628b534f209Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
629b534f209Smrg  AC_CHECK_TOOL(AS, as, false)
630b534f209Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
631b534f209Smrg  ;;
632b534f209Smrg  ])
63315fb4814Smrgesac
63415fb4814Smrg
63515fb4814Smrgneed_locks="$enable_libtool_lock"
63615fb4814Smrg
637b534f209Smrg])# _LT_AC_LOCK
63815fb4814Smrg
63915fb4814Smrg
640b534f209Smrg# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
64115fb4814Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
64215fb4814Smrg# ----------------------------------------------------------------
64315fb4814Smrg# Check whether the given compiler option works
644b534f209SmrgAC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
645b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])
64615fb4814SmrgAC_CACHE_CHECK([$1], [$2],
64715fb4814Smrg  [$2=no
648b534f209Smrg  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
649de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
65015fb4814Smrg   lt_compiler_flag="$3"
65115fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
65215fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
65315fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
65415fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
65515fb4814Smrg   # The option is referenced via a variable to avoid confusing sed.
65615fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
65715fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
65815fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
65915fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
66015fb4814Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
66115fb4814Smrg   (eval "$lt_compile" 2>conftest.err)
66215fb4814Smrg   ac_status=$?
66315fb4814Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
66415fb4814Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
66515fb4814Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
66615fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
66715fb4814Smrg     # So say no if there are warnings other than the usual output.
668b534f209Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
66915fb4814Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
67015fb4814Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
67115fb4814Smrg       $2=yes
67215fb4814Smrg     fi
67315fb4814Smrg   fi
674b534f209Smrg   $rm conftest*
67515fb4814Smrg])
67615fb4814Smrg
67715fb4814Smrgif test x"[$]$2" = xyes; then
678b534f209Smrg    ifelse([$5], , :, [$5])
67915fb4814Smrgelse
680b534f209Smrg    ifelse([$6], , :, [$6])
68115fb4814Smrgfi
682b534f209Smrg])# AC_LIBTOOL_COMPILER_OPTION
68315fb4814Smrg
68415fb4814Smrg
685b534f209Smrg# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
686b534f209Smrg#                          [ACTION-SUCCESS], [ACTION-FAILURE])
687b534f209Smrg# ------------------------------------------------------------
688b534f209Smrg# Check whether the given compiler option works
689b534f209SmrgAC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
690b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
691de78e416SmrgAC_CACHE_CHECK([$1], [$2],
69215fb4814Smrg  [$2=no
69315fb4814Smrg   save_LDFLAGS="$LDFLAGS"
69415fb4814Smrg   LDFLAGS="$LDFLAGS $3"
695de78e416Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
69615fb4814Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
69715fb4814Smrg     # The linker can only warn and ignore the option if not recognized
69815fb4814Smrg     # So say no if there are warnings
69915fb4814Smrg     if test -s conftest.err; then
70015fb4814Smrg       # Append any errors to the config.log.
70115fb4814Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
702b534f209Smrg       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
70315fb4814Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
70415fb4814Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
70515fb4814Smrg         $2=yes
70615fb4814Smrg       fi
70715fb4814Smrg     else
70815fb4814Smrg       $2=yes
70915fb4814Smrg     fi
71015fb4814Smrg   fi
711b534f209Smrg   $rm conftest*
71215fb4814Smrg   LDFLAGS="$save_LDFLAGS"
71315fb4814Smrg])
71415fb4814Smrg
71515fb4814Smrgif test x"[$]$2" = xyes; then
716b534f209Smrg    ifelse([$4], , :, [$4])
71715fb4814Smrgelse
718b534f209Smrg    ifelse([$5], , :, [$5])
71915fb4814Smrgfi
720b534f209Smrg])# AC_LIBTOOL_LINKER_OPTION
72115fb4814Smrg
722b410ddbeSmrg
723b534f209Smrg# AC_LIBTOOL_SYS_MAX_CMD_LEN
724b534f209Smrg# --------------------------
725b534f209SmrgAC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
726b534f209Smrg[# find the maximum length of command line arguments
72715fb4814SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
72815fb4814SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
72915fb4814Smrg  i=0
73015fb4814Smrg  teststring="ABCD"
73115fb4814Smrg
73215fb4814Smrg  case $build_os in
73315fb4814Smrg  msdosdjgpp*)
73415fb4814Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
73515fb4814Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
73615fb4814Smrg    # during glob expansion).  Even if it were fixed, the result of this
73715fb4814Smrg    # check would be larger than it should be.
73815fb4814Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
73915fb4814Smrg    ;;
74015fb4814Smrg
74115fb4814Smrg  gnu*)
74215fb4814Smrg    # Under GNU Hurd, this test is not required because there is
74315fb4814Smrg    # no limit to the length of command line arguments.
74415fb4814Smrg    # Libtool will interpret -1 as no limit whatsoever
74515fb4814Smrg    lt_cv_sys_max_cmd_len=-1;
74615fb4814Smrg    ;;
74715fb4814Smrg
748b534f209Smrg  cygwin* | mingw*)
74915fb4814Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
75015fb4814Smrg    # about 5 minutes as the teststring grows exponentially.
75115fb4814Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
75215fb4814Smrg    # you end up with a "frozen" computer, even though with patience
75315fb4814Smrg    # the test eventually succeeds (with a max line length of 256k).
75415fb4814Smrg    # Instead, let's just punt: use the minimum linelength reported by
75515fb4814Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
75615fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
75715fb4814Smrg    ;;
75815fb4814Smrg
75915fb4814Smrg  amigaos*)
76015fb4814Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
76115fb4814Smrg    # So we just punt and use a minimum line length of 8192.
76215fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
76315fb4814Smrg    ;;
76415fb4814Smrg
76515fb4814Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
76615fb4814Smrg    # This has been around since 386BSD, at least.  Likely further.
76715fb4814Smrg    if test -x /sbin/sysctl; then
76815fb4814Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
76915fb4814Smrg    elif test -x /usr/sbin/sysctl; then
77015fb4814Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
77115fb4814Smrg    else
77215fb4814Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
77315fb4814Smrg    fi
77415fb4814Smrg    # And add a safety zone
77515fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
77615fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
77715fb4814Smrg    ;;
77815fb4814Smrg
77915fb4814Smrg  interix*)
78015fb4814Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
78115fb4814Smrg    lt_cv_sys_max_cmd_len=196608
78215fb4814Smrg    ;;
78315fb4814Smrg
78415fb4814Smrg  osf*)
78515fb4814Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
78615fb4814Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
78715fb4814Smrg    # nice to cause kernel panics so lets avoid the loop below.
78815fb4814Smrg    # First set a reasonable default.
78915fb4814Smrg    lt_cv_sys_max_cmd_len=16384
79015fb4814Smrg    #
79115fb4814Smrg    if test -x /sbin/sysconfig; then
79215fb4814Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
79315fb4814Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
79415fb4814Smrg      esac
79515fb4814Smrg    fi
79615fb4814Smrg    ;;
79715fb4814Smrg  sco3.2v5*)
79815fb4814Smrg    lt_cv_sys_max_cmd_len=102400
79915fb4814Smrg    ;;
80015fb4814Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
80115fb4814Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
80215fb4814Smrg    if test -n "$kargmax"; then
803b534f209Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
80415fb4814Smrg    else
80515fb4814Smrg      lt_cv_sys_max_cmd_len=32768
80615fb4814Smrg    fi
80715fb4814Smrg    ;;
80815fb4814Smrg  *)
809de78e416Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
810de78e416Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
811de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
812de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
813de78e416Smrg    else
814de78e416Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
815b534f209Smrg      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
816b534f209Smrg	       = "XX$teststring") >/dev/null 2>&1 &&
817b534f209Smrg	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
818b534f209Smrg	      lt_cv_sys_max_cmd_len=$new_result &&
819de78e416Smrg	      test $i != 17 # 1/2 MB should be enough
820de78e416Smrg      do
821de78e416Smrg        i=`expr $i + 1`
822de78e416Smrg        teststring=$teststring$teststring
823de78e416Smrg      done
824de78e416Smrg      teststring=
825b534f209Smrg      # Add a significant safety factor because C++ compilers can tack on massive
826b534f209Smrg      # amounts of additional arguments before passing them to the linker.
827b534f209Smrg      # It appears as though 1/2 is a usable value.
828de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
829de78e416Smrg    fi
83015fb4814Smrg    ;;
83115fb4814Smrg  esac
83215fb4814Smrg])
83315fb4814Smrgif test -n $lt_cv_sys_max_cmd_len ; then
83415fb4814Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
83515fb4814Smrgelse
83615fb4814Smrg  AC_MSG_RESULT(none)
83715fb4814Smrgfi
838b534f209Smrg])# AC_LIBTOOL_SYS_MAX_CMD_LEN
83915fb4814Smrg
840b410ddbeSmrg
841b534f209Smrg# _LT_AC_CHECK_DLFCN
842b534f209Smrg# ------------------
843b534f209SmrgAC_DEFUN([_LT_AC_CHECK_DLFCN],
844b534f209Smrg[AC_CHECK_HEADERS(dlfcn.h)dnl
845b534f209Smrg])# _LT_AC_CHECK_DLFCN
84615fb4814Smrg
84715fb4814Smrg
848b534f209Smrg# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
849b534f209Smrg#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
850b534f209Smrg# ---------------------------------------------------------------------
851b534f209SmrgAC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
852b534f209Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
85315fb4814Smrgif test "$cross_compiling" = yes; then :
85415fb4814Smrg  [$4]
85515fb4814Smrgelse
85615fb4814Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
85715fb4814Smrg  lt_status=$lt_dlunknown
858b534f209Smrg  cat > conftest.$ac_ext <<EOF
85915fb4814Smrg[#line __oline__ "configure"
86015fb4814Smrg#include "confdefs.h"
86115fb4814Smrg
86215fb4814Smrg#if HAVE_DLFCN_H
86315fb4814Smrg#include <dlfcn.h>
86415fb4814Smrg#endif
86515fb4814Smrg
86615fb4814Smrg#include <stdio.h>
86715fb4814Smrg
86815fb4814Smrg#ifdef RTLD_GLOBAL
86915fb4814Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
87015fb4814Smrg#else
87115fb4814Smrg#  ifdef DL_GLOBAL
87215fb4814Smrg#    define LT_DLGLOBAL		DL_GLOBAL
87315fb4814Smrg#  else
87415fb4814Smrg#    define LT_DLGLOBAL		0
87515fb4814Smrg#  endif
87615fb4814Smrg#endif
87715fb4814Smrg
87815fb4814Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
87915fb4814Smrg   find out it does not work in some platform. */
88015fb4814Smrg#ifndef LT_DLLAZY_OR_NOW
88115fb4814Smrg#  ifdef RTLD_LAZY
88215fb4814Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
88315fb4814Smrg#  else
88415fb4814Smrg#    ifdef DL_LAZY
88515fb4814Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
88615fb4814Smrg#    else
88715fb4814Smrg#      ifdef RTLD_NOW
88815fb4814Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
88915fb4814Smrg#      else
89015fb4814Smrg#        ifdef DL_NOW
89115fb4814Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
89215fb4814Smrg#        else
89315fb4814Smrg#          define LT_DLLAZY_OR_NOW	0
89415fb4814Smrg#        endif
89515fb4814Smrg#      endif
89615fb4814Smrg#    endif
89715fb4814Smrg#  endif
89815fb4814Smrg#endif
89915fb4814Smrg
900b534f209Smrg#ifdef __cplusplus
901b534f209Smrgextern "C" void exit (int);
902b534f209Smrg#endif
903b534f209Smrg
90415fb4814Smrgvoid fnord() { int i=42;}
90515fb4814Smrgint main ()
90615fb4814Smrg{
90715fb4814Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
90815fb4814Smrg  int status = $lt_dlunknown;
90915fb4814Smrg
91015fb4814Smrg  if (self)
91115fb4814Smrg    {
91215fb4814Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
91315fb4814Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
91415fb4814Smrg      /* dlclose (self); */
91515fb4814Smrg    }
91615fb4814Smrg  else
91715fb4814Smrg    puts (dlerror ());
91815fb4814Smrg
919b534f209Smrg    exit (status);
92015fb4814Smrg}]
921b534f209SmrgEOF
92215fb4814Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
92315fb4814Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
92415fb4814Smrg    lt_status=$?
92515fb4814Smrg    case x$lt_status in
92615fb4814Smrg      x$lt_dlno_uscore) $1 ;;
92715fb4814Smrg      x$lt_dlneed_uscore) $2 ;;
92815fb4814Smrg      x$lt_dlunknown|x*) $3 ;;
92915fb4814Smrg    esac
93015fb4814Smrg  else :
93115fb4814Smrg    # compilation failed
93215fb4814Smrg    $3
93315fb4814Smrg  fi
93415fb4814Smrgfi
93515fb4814Smrgrm -fr conftest*
936b534f209Smrg])# _LT_AC_TRY_DLOPEN_SELF
93715fb4814Smrg
93815fb4814Smrg
939b534f209Smrg# AC_LIBTOOL_DLOPEN_SELF
940b534f209Smrg# ----------------------
941b534f209SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
942b534f209Smrg[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
94315fb4814Smrgif test "x$enable_dlopen" != xyes; then
94415fb4814Smrg  enable_dlopen=unknown
94515fb4814Smrg  enable_dlopen_self=unknown
94615fb4814Smrg  enable_dlopen_self_static=unknown
94715fb4814Smrgelse
94815fb4814Smrg  lt_cv_dlopen=no
94915fb4814Smrg  lt_cv_dlopen_libs=
95015fb4814Smrg
95115fb4814Smrg  case $host_os in
95215fb4814Smrg  beos*)
95315fb4814Smrg    lt_cv_dlopen="load_add_on"
95415fb4814Smrg    lt_cv_dlopen_libs=
95515fb4814Smrg    lt_cv_dlopen_self=yes
95615fb4814Smrg    ;;
95715fb4814Smrg
958b534f209Smrg  mingw* | pw32*)
95915fb4814Smrg    lt_cv_dlopen="LoadLibrary"
96015fb4814Smrg    lt_cv_dlopen_libs=
961b534f209Smrg   ;;
96215fb4814Smrg
96315fb4814Smrg  cygwin*)
96415fb4814Smrg    lt_cv_dlopen="dlopen"
96515fb4814Smrg    lt_cv_dlopen_libs=
966b534f209Smrg   ;;
96715fb4814Smrg
96815fb4814Smrg  darwin*)
96915fb4814Smrg  # if libdl is installed we need to link against it
97015fb4814Smrg    AC_CHECK_LIB([dl], [dlopen],
97115fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
97215fb4814Smrg    lt_cv_dlopen="dyld"
97315fb4814Smrg    lt_cv_dlopen_libs=
97415fb4814Smrg    lt_cv_dlopen_self=yes
97515fb4814Smrg    ])
976b534f209Smrg   ;;
97715fb4814Smrg
97815fb4814Smrg  *)
97915fb4814Smrg    AC_CHECK_FUNC([shl_load],
98015fb4814Smrg	  [lt_cv_dlopen="shl_load"],
98115fb4814Smrg      [AC_CHECK_LIB([dld], [shl_load],
982b534f209Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
98315fb4814Smrg	[AC_CHECK_FUNC([dlopen],
98415fb4814Smrg	      [lt_cv_dlopen="dlopen"],
98515fb4814Smrg	  [AC_CHECK_LIB([dl], [dlopen],
98615fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
98715fb4814Smrg	    [AC_CHECK_LIB([svld], [dlopen],
98815fb4814Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
98915fb4814Smrg	      [AC_CHECK_LIB([dld], [dld_link],
990b534f209Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
99115fb4814Smrg	      ])
99215fb4814Smrg	    ])
99315fb4814Smrg	  ])
99415fb4814Smrg	])
99515fb4814Smrg      ])
99615fb4814Smrg    ;;
99715fb4814Smrg  esac
99815fb4814Smrg
99915fb4814Smrg  if test "x$lt_cv_dlopen" != xno; then
100015fb4814Smrg    enable_dlopen=yes
100115fb4814Smrg  else
100215fb4814Smrg    enable_dlopen=no
100315fb4814Smrg  fi
100415fb4814Smrg
100515fb4814Smrg  case $lt_cv_dlopen in
100615fb4814Smrg  dlopen)
100715fb4814Smrg    save_CPPFLAGS="$CPPFLAGS"
100815fb4814Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
100915fb4814Smrg
101015fb4814Smrg    save_LDFLAGS="$LDFLAGS"
101115fb4814Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
101215fb4814Smrg
101315fb4814Smrg    save_LIBS="$LIBS"
101415fb4814Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
101515fb4814Smrg
101615fb4814Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
101715fb4814Smrg	  lt_cv_dlopen_self, [dnl
1018b534f209Smrg	  _LT_AC_TRY_DLOPEN_SELF(
101915fb4814Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
102015fb4814Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
102115fb4814Smrg    ])
102215fb4814Smrg
102315fb4814Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
102415fb4814Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
102515fb4814Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1026b534f209Smrg    	  lt_cv_dlopen_self_static, [dnl
1027b534f209Smrg	  _LT_AC_TRY_DLOPEN_SELF(
102815fb4814Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
102915fb4814Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
103015fb4814Smrg      ])
103115fb4814Smrg    fi
103215fb4814Smrg
103315fb4814Smrg    CPPFLAGS="$save_CPPFLAGS"
103415fb4814Smrg    LDFLAGS="$save_LDFLAGS"
103515fb4814Smrg    LIBS="$save_LIBS"
103615fb4814Smrg    ;;
103715fb4814Smrg  esac
103815fb4814Smrg
103915fb4814Smrg  case $lt_cv_dlopen_self in
104015fb4814Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
104115fb4814Smrg  *) enable_dlopen_self=unknown ;;
104215fb4814Smrg  esac
104315fb4814Smrg
104415fb4814Smrg  case $lt_cv_dlopen_self_static in
104515fb4814Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
104615fb4814Smrg  *) enable_dlopen_self_static=unknown ;;
104715fb4814Smrg  esac
104815fb4814Smrgfi
1049b534f209Smrg])# AC_LIBTOOL_DLOPEN_SELF
105015fb4814Smrg
1051b410ddbeSmrg
1052b534f209Smrg# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
1053b534f209Smrg# ---------------------------------
1054b534f209Smrg# Check to see if options -c and -o are simultaneously supported by compiler
1055b534f209SmrgAC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
1056b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1057b534f209SmrgAC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
105815fb4814SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1059b534f209Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1060b534f209Smrg  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1061b534f209Smrg   $rm -r conftest 2>/dev/null
106215fb4814Smrg   mkdir conftest
106315fb4814Smrg   cd conftest
106415fb4814Smrg   mkdir out
1065de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
106615fb4814Smrg
106715fb4814Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
106815fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
106915fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
107015fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
107115fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
107215fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
107315fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
107415fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
107515fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
107615fb4814Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
107715fb4814Smrg   (eval "$lt_compile" 2>out/conftest.err)
107815fb4814Smrg   ac_status=$?
107915fb4814Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
108015fb4814Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
108115fb4814Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
108215fb4814Smrg   then
108315fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
108415fb4814Smrg     # So say no if there are warnings
1085b534f209Smrg     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
108615fb4814Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
108715fb4814Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1088b534f209Smrg       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
108915fb4814Smrg     fi
109015fb4814Smrg   fi
109115fb4814Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1092b534f209Smrg   $rm conftest*
109315fb4814Smrg   # SGI C++ compiler will create directory out/ii_files/ for
109415fb4814Smrg   # template instantiation
1095b534f209Smrg   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
1096b534f209Smrg   $rm out/* && rmdir out
109715fb4814Smrg   cd ..
1098b534f209Smrg   rmdir conftest
1099b534f209Smrg   $rm conftest*
110015fb4814Smrg])
1101b534f209Smrg])# AC_LIBTOOL_PROG_CC_C_O
110215fb4814Smrg
110315fb4814Smrg
1104b534f209Smrg# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
1105b534f209Smrg# -----------------------------------------
110615fb4814Smrg# Check to see if we can do hard links to lock some files if needed
1107b534f209SmrgAC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
1108b534f209Smrg[AC_REQUIRE([_LT_AC_LOCK])dnl
110915fb4814Smrg
111015fb4814Smrghard_links="nottested"
1111b534f209Smrgif test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
111215fb4814Smrg  # do not overwrite the value of need_locks provided by the user
111315fb4814Smrg  AC_MSG_CHECKING([if we can lock with hard links])
111415fb4814Smrg  hard_links=yes
1115b534f209Smrg  $rm conftest*
111615fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
111715fb4814Smrg  touch conftest.a
111815fb4814Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
111915fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
112015fb4814Smrg  AC_MSG_RESULT([$hard_links])
112115fb4814Smrg  if test "$hard_links" = no; then
112215fb4814Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
112315fb4814Smrg    need_locks=warn
112415fb4814Smrg  fi
112515fb4814Smrgelse
112615fb4814Smrg  need_locks=no
112715fb4814Smrgfi
1128b534f209Smrg])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
112915fb4814Smrg
113015fb4814Smrg
1131b534f209Smrg# AC_LIBTOOL_OBJDIR
1132b534f209Smrg# -----------------
1133b534f209SmrgAC_DEFUN([AC_LIBTOOL_OBJDIR],
113415fb4814Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
113515fb4814Smrg[rm -f .libs 2>/dev/null
113615fb4814Smrgmkdir .libs 2>/dev/null
113715fb4814Smrgif test -d .libs; then
113815fb4814Smrg  lt_cv_objdir=.libs
113915fb4814Smrgelse
114015fb4814Smrg  # MS-DOS does not allow filenames that begin with a dot.
114115fb4814Smrg  lt_cv_objdir=_libs
114215fb4814Smrgfi
114315fb4814Smrgrmdir .libs 2>/dev/null])
114415fb4814Smrgobjdir=$lt_cv_objdir
1145b534f209Smrg])# AC_LIBTOOL_OBJDIR
114615fb4814Smrg
114715fb4814Smrg
1148b534f209Smrg# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
1149b534f209Smrg# ----------------------------------------------
115015fb4814Smrg# Check hardcoding attributes.
1151b534f209SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
115215fb4814Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1153b534f209Smrg_LT_AC_TAGVAR(hardcode_action, $1)=
1154b534f209Smrgif test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
1155b534f209Smrg   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
1156b534f209Smrg   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
115715fb4814Smrg
1158b534f209Smrg  # We can hardcode non-existant directories.
1159b534f209Smrg  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
116015fb4814Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
116115fb4814Smrg     # have to relink, otherwise we might link with an installed library
116215fb4814Smrg     # when we should be linking with a yet-to-be-installed one
1163b534f209Smrg     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1164b534f209Smrg     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
116515fb4814Smrg    # Linking always hardcodes the temporary library directory.
1166b534f209Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=relink
116715fb4814Smrg  else
116815fb4814Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1169b534f209Smrg    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
117015fb4814Smrg  fi
117115fb4814Smrgelse
117215fb4814Smrg  # We cannot hardcode anything, or else we can only hardcode existing
117315fb4814Smrg  # directories.
1174b534f209Smrg  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
117515fb4814Smrgfi
1176b534f209SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
117715fb4814Smrg
1178b534f209Smrgif test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
117915fb4814Smrg  # Fast installation is not supported
118015fb4814Smrg  enable_fast_install=no
118115fb4814Smrgelif test "$shlibpath_overrides_runpath" = yes ||
118215fb4814Smrg     test "$enable_shared" = no; then
118315fb4814Smrg  # Fast installation is not necessary
118415fb4814Smrg  enable_fast_install=needless
118515fb4814Smrgfi
1186b534f209Smrg])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
118715fb4814Smrg
118815fb4814Smrg
1189b534f209Smrg# AC_LIBTOOL_SYS_LIB_STRIP
1190b534f209Smrg# ------------------------
1191b534f209SmrgAC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
1192b534f209Smrg[striplib=
119315fb4814Smrgold_striplib=
119415fb4814SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
1195b534f209Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
119615fb4814Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
119715fb4814Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
119815fb4814Smrg  AC_MSG_RESULT([yes])
119915fb4814Smrgelse
120015fb4814Smrg# FIXME - insert some real tests, host_os isn't really good enough
120115fb4814Smrg  case $host_os in
1202b534f209Smrg   darwin*)
1203b534f209Smrg       if test -n "$STRIP" ; then
1204b534f209Smrg         striplib="$STRIP -x"
1205b534f209Smrg         old_striplib="$STRIP -S"
1206b534f209Smrg         AC_MSG_RESULT([yes])
1207b534f209Smrg       else
1208b534f209Smrg  AC_MSG_RESULT([no])
1209b534f209Smrgfi
1210b534f209Smrg       ;;
1211b534f209Smrg   *)
1212b534f209Smrg  AC_MSG_RESULT([no])
121315fb4814Smrg    ;;
121415fb4814Smrg  esac
121515fb4814Smrgfi
1216b534f209Smrg])# AC_LIBTOOL_SYS_LIB_STRIP
121715fb4814Smrg
121815fb4814Smrg
1219b534f209Smrg# AC_LIBTOOL_SYS_DYNAMIC_LINKER
122015fb4814Smrg# -----------------------------
122115fb4814Smrg# PORTME Fill in your ld.so characteristics
1222b534f209SmrgAC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
1223b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1224de78e416SmrgAC_MSG_CHECKING([dynamic linker characteristics])
1225b534f209Smrglibrary_names_spec=
1226b534f209Smrglibname_spec='lib$name'
1227b534f209Smrgsoname_spec=
1228b534f209Smrgshrext_cmds=".so"
1229b534f209Smrgpostinstall_cmds=
1230b534f209Smrgpostuninstall_cmds=
1231b534f209Smrgfinish_cmds=
1232b534f209Smrgfinish_eval=
1233b534f209Smrgshlibpath_var=
1234b534f209Smrgshlibpath_overrides_runpath=unknown
1235b534f209Smrgversion_type=none
1236b534f209Smrgdynamic_linker="$host_os ld.so"
1237b534f209Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
1238b534f209Smrgm4_if($1,[],[
123915fb4814Smrgif test "$GCC" = yes; then
1240de78e416Smrg  case $host_os in
1241de78e416Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
1242de78e416Smrg    *) lt_awk_arg="/^libraries:/" ;;
1243de78e416Smrg  esac
1244de78e416Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1245b534f209Smrg  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
124615fb4814Smrg    # if the path contains ";" then we assume it to be the separator
124715fb4814Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
124815fb4814Smrg    # assumed that no part of a normal pathname contains ";" but that should
124915fb4814Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
1250b534f209Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
125115fb4814Smrg  else
1252b534f209Smrg    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
125315fb4814Smrg  fi
1254de78e416Smrg  # Ok, now we have the path, separated by spaces, we can step through it
1255de78e416Smrg  # and add multilib dir if necessary.
1256de78e416Smrg  lt_tmp_lt_search_path_spec=
1257de78e416Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
1258de78e416Smrg  for lt_sys_path in $lt_search_path_spec; do
1259de78e416Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
1260de78e416Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
1261de78e416Smrg    else
1262de78e416Smrg      test -d "$lt_sys_path" && \
1263de78e416Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
1264de78e416Smrg    fi
1265de78e416Smrg  done
1266b534f209Smrg  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
1267de78e416SmrgBEGIN {RS=" "; FS="/|\n";} {
1268de78e416Smrg  lt_foo="";
1269de78e416Smrg  lt_count=0;
1270de78e416Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
1271de78e416Smrg    if ($lt_i != "" && $lt_i != ".") {
1272de78e416Smrg      if ($lt_i == "..") {
1273de78e416Smrg        lt_count++;
1274de78e416Smrg      } else {
1275de78e416Smrg        if (lt_count == 0) {
1276de78e416Smrg          lt_foo="/" $lt_i lt_foo;
1277de78e416Smrg        } else {
1278de78e416Smrg          lt_count--;
1279de78e416Smrg        }
1280de78e416Smrg      }
1281de78e416Smrg    }
1282de78e416Smrg  }
1283de78e416Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
1284de78e416Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
1285de78e416Smrg}'`
1286b534f209Smrg  sys_lib_search_path_spec=`echo $lt_search_path_spec`
128715fb4814Smrgelse
128815fb4814Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
1289de78e416Smrgfi])
129015fb4814Smrgneed_lib_prefix=unknown
129115fb4814Smrghardcode_into_libs=no
129215fb4814Smrg
129315fb4814Smrg# when you set need_version to no, make sure it does not cause -set_version
129415fb4814Smrg# flags to be left without arguments
129515fb4814Smrgneed_version=unknown
129615fb4814Smrg
129715fb4814Smrgcase $host_os in
129815fb4814Smrgaix3*)
129915fb4814Smrg  version_type=linux
130015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
130115fb4814Smrg  shlibpath_var=LIBPATH
130215fb4814Smrg
130315fb4814Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
130415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
130515fb4814Smrg  ;;
130615fb4814Smrg
1307b534f209Smrgaix4* | aix5*)
130815fb4814Smrg  version_type=linux
130915fb4814Smrg  need_lib_prefix=no
131015fb4814Smrg  need_version=no
131115fb4814Smrg  hardcode_into_libs=yes
131215fb4814Smrg  if test "$host_cpu" = ia64; then
131315fb4814Smrg    # AIX 5 supports IA64
131415fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
131515fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
131615fb4814Smrg  else
131715fb4814Smrg    # With GCC up to 2.95.x, collect2 would create an import file
131815fb4814Smrg    # for dependence libraries.  The import file would start with
131915fb4814Smrg    # the line `#! .'.  This would cause the generated library to
132015fb4814Smrg    # depend on `.', always an invalid library.  This was fixed in
132115fb4814Smrg    # development snapshots of GCC prior to 3.0.
132215fb4814Smrg    case $host_os in
132315fb4814Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
132415fb4814Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
132515fb4814Smrg	   echo ' yes '
1326b534f209Smrg	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
132715fb4814Smrg	:
132815fb4814Smrg      else
132915fb4814Smrg	can_build_shared=no
133015fb4814Smrg      fi
133115fb4814Smrg      ;;
133215fb4814Smrg    esac
133315fb4814Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
133415fb4814Smrg    # soname into executable. Probably we can add versioning support to
133515fb4814Smrg    # collect2, so additional links can be useful in future.
133615fb4814Smrg    if test "$aix_use_runtimelinking" = yes; then
133715fb4814Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
133815fb4814Smrg      # instead of lib<name>.a to let people know that these are not
133915fb4814Smrg      # typical AIX shared libraries.
134015fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
134115fb4814Smrg    else
134215fb4814Smrg      # We preserve .a as extension for shared libraries through AIX4.2
134315fb4814Smrg      # and later when we are not doing run time linking.
134415fb4814Smrg      library_names_spec='${libname}${release}.a $libname.a'
134515fb4814Smrg      soname_spec='${libname}${release}${shared_ext}$major'
134615fb4814Smrg    fi
134715fb4814Smrg    shlibpath_var=LIBPATH
134815fb4814Smrg  fi
134915fb4814Smrg  ;;
135015fb4814Smrg
135115fb4814Smrgamigaos*)
1352b534f209Smrg  library_names_spec='$libname.ixlibrary $libname.a'
1353b534f209Smrg  # Create ${libname}_ixlibrary.a entries in /sys/libs.
1354b534f209Smrg  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'
135515fb4814Smrg  ;;
135615fb4814Smrg
135715fb4814Smrgbeos*)
135815fb4814Smrg  library_names_spec='${libname}${shared_ext}'
135915fb4814Smrg  dynamic_linker="$host_os ld.so"
136015fb4814Smrg  shlibpath_var=LIBRARY_PATH
136115fb4814Smrg  ;;
136215fb4814Smrg
136315fb4814Smrgbsdi[[45]]*)
136415fb4814Smrg  version_type=linux
136515fb4814Smrg  need_version=no
136615fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
136715fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
136815fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
136915fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
137015fb4814Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
137115fb4814Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
137215fb4814Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
137315fb4814Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
137415fb4814Smrg  # libtool to hard-code these into programs
137515fb4814Smrg  ;;
137615fb4814Smrg
1377b534f209Smrgcygwin* | mingw* | pw32*)
137815fb4814Smrg  version_type=windows
137915fb4814Smrg  shrext_cmds=".dll"
138015fb4814Smrg  need_version=no
138115fb4814Smrg  need_lib_prefix=no
138215fb4814Smrg
138315fb4814Smrg  case $GCC,$host_os in
1384b534f209Smrg  yes,cygwin* | yes,mingw* | yes,pw32*)
138515fb4814Smrg    library_names_spec='$libname.dll.a'
138615fb4814Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
138715fb4814Smrg    postinstall_cmds='base_file=`basename \${file}`~
1388b534f209Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
138915fb4814Smrg      dldir=$destdir/`dirname \$dlpath`~
139015fb4814Smrg      test -d \$dldir || mkdir -p \$dldir~
139115fb4814Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
1392b534f209Smrg      chmod a+x \$dldir/$dlname'
139315fb4814Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
139415fb4814Smrg      dlpath=$dir/\$dldll~
1395b534f209Smrg       $rm \$dlpath'
139615fb4814Smrg    shlibpath_overrides_runpath=yes
139715fb4814Smrg
139815fb4814Smrg    case $host_os in
139915fb4814Smrg    cygwin*)
140015fb4814Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
140115fb4814Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
140215fb4814Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
140315fb4814Smrg      ;;
1404b534f209Smrg    mingw*)
140515fb4814Smrg      # MinGW DLLs use traditional 'lib' prefix
140615fb4814Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
1407b534f209Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
1408b534f209Smrg      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
140915fb4814Smrg        # It is most probably a Windows format PATH printed by
141015fb4814Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
141115fb4814Smrg        # path with ; separators, and with drive letters. We can handle the
141215fb4814Smrg        # drive letters (cygwin fileutils understands them), so leave them,
141315fb4814Smrg        # especially as we might pass files found there to a mingw objdump,
141415fb4814Smrg        # which wouldn't understand a cygwinified path. Ahh.
1415b534f209Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
141615fb4814Smrg      else
1417b534f209Smrg        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
141815fb4814Smrg      fi
141915fb4814Smrg      ;;
142015fb4814Smrg    pw32*)
142115fb4814Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
142215fb4814Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
142315fb4814Smrg      ;;
142415fb4814Smrg    esac
142515fb4814Smrg    ;;
142615fb4814Smrg
142715fb4814Smrg  *)
142815fb4814Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
142915fb4814Smrg    ;;
143015fb4814Smrg  esac
143115fb4814Smrg  dynamic_linker='Win32 ld.exe'
143215fb4814Smrg  # FIXME: first we should search . and the directory the executable is in
143315fb4814Smrg  shlibpath_var=PATH
143415fb4814Smrg  ;;
143515fb4814Smrg
143615fb4814Smrgdarwin* | rhapsody*)
143715fb4814Smrg  dynamic_linker="$host_os dyld"
143815fb4814Smrg  version_type=darwin
143915fb4814Smrg  need_lib_prefix=no
144015fb4814Smrg  need_version=no
1441b534f209Smrg  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
144215fb4814Smrg  soname_spec='${libname}${release}${major}$shared_ext'
144315fb4814Smrg  shlibpath_overrides_runpath=yes
144415fb4814Smrg  shlibpath_var=DYLD_LIBRARY_PATH
144515fb4814Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
1446b534f209Smrg  m4_if([$1], [],[
1447b534f209Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
144815fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
144915fb4814Smrg  ;;
145015fb4814Smrg
145115fb4814Smrgdgux*)
145215fb4814Smrg  version_type=linux
145315fb4814Smrg  need_lib_prefix=no
145415fb4814Smrg  need_version=no
145515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
145615fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
145715fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
145815fb4814Smrg  ;;
145915fb4814Smrg
146015fb4814Smrgfreebsd1*)
146115fb4814Smrg  dynamic_linker=no
146215fb4814Smrg  ;;
146315fb4814Smrg
146415fb4814Smrgfreebsd* | dragonfly*)
146515fb4814Smrg  # DragonFly does not have aout.  When/if they implement a new
146615fb4814Smrg  # versioning mechanism, adjust this.
146715fb4814Smrg  if test -x /usr/bin/objformat; then
146815fb4814Smrg    objformat=`/usr/bin/objformat`
146915fb4814Smrg  else
147015fb4814Smrg    case $host_os in
147115fb4814Smrg    freebsd[[123]]*) objformat=aout ;;
147215fb4814Smrg    *) objformat=elf ;;
147315fb4814Smrg    esac
147415fb4814Smrg  fi
147515fb4814Smrg  version_type=freebsd-$objformat
147615fb4814Smrg  case $version_type in
147715fb4814Smrg    freebsd-elf*)
147815fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
147915fb4814Smrg      need_version=no
148015fb4814Smrg      need_lib_prefix=no
148115fb4814Smrg      ;;
148215fb4814Smrg    freebsd-*)
148315fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
148415fb4814Smrg      need_version=yes
148515fb4814Smrg      ;;
148615fb4814Smrg  esac
148715fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
148815fb4814Smrg  case $host_os in
148915fb4814Smrg  freebsd2*)
149015fb4814Smrg    shlibpath_overrides_runpath=yes
149115fb4814Smrg    ;;
149215fb4814Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
149315fb4814Smrg    shlibpath_overrides_runpath=yes
149415fb4814Smrg    hardcode_into_libs=yes
149515fb4814Smrg    ;;
149615fb4814Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
149715fb4814Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
149815fb4814Smrg    shlibpath_overrides_runpath=no
149915fb4814Smrg    hardcode_into_libs=yes
150015fb4814Smrg    ;;
1501de78e416Smrg  *) # from 4.6 on, and DragonFly
150215fb4814Smrg    shlibpath_overrides_runpath=yes
150315fb4814Smrg    hardcode_into_libs=yes
150415fb4814Smrg    ;;
150515fb4814Smrg  esac
150615fb4814Smrg  ;;
150715fb4814Smrg
150815fb4814Smrggnu*)
150915fb4814Smrg  version_type=linux
151015fb4814Smrg  need_lib_prefix=no
151115fb4814Smrg  need_version=no
151215fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
151315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
151415fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
151515fb4814Smrg  hardcode_into_libs=yes
151615fb4814Smrg  ;;
151715fb4814Smrg
151815fb4814Smrghpux9* | hpux10* | hpux11*)
151915fb4814Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
152015fb4814Smrg  # link against other versions.
152115fb4814Smrg  version_type=sunos
152215fb4814Smrg  need_lib_prefix=no
152315fb4814Smrg  need_version=no
152415fb4814Smrg  case $host_cpu in
152515fb4814Smrg  ia64*)
152615fb4814Smrg    shrext_cmds='.so'
152715fb4814Smrg    hardcode_into_libs=yes
152815fb4814Smrg    dynamic_linker="$host_os dld.so"
152915fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
153015fb4814Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
153115fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
153215fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
153315fb4814Smrg    if test "X$HPUX_IA64_MODE" = X32; then
153415fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
153515fb4814Smrg    else
153615fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
153715fb4814Smrg    fi
153815fb4814Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
153915fb4814Smrg    ;;
1540b534f209Smrg   hppa*64*)
1541b534f209Smrg     shrext_cmds='.sl'
1542b534f209Smrg     hardcode_into_libs=yes
1543b534f209Smrg     dynamic_linker="$host_os dld.sl"
1544b534f209Smrg     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
1545b534f209Smrg     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
1546b534f209Smrg     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
1547b534f209Smrg     soname_spec='${libname}${release}${shared_ext}$major'
1548b534f209Smrg     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
1549b534f209Smrg     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
1550b534f209Smrg     ;;
1551b534f209Smrg   *)
155215fb4814Smrg    shrext_cmds='.sl'
155315fb4814Smrg    dynamic_linker="$host_os dld.sl"
155415fb4814Smrg    shlibpath_var=SHLIB_PATH
155515fb4814Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
155615fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
155715fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
155815fb4814Smrg    ;;
155915fb4814Smrg  esac
156015fb4814Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
156115fb4814Smrg  postinstall_cmds='chmod 555 $lib'
156215fb4814Smrg  ;;
156315fb4814Smrg
1564de78e416Smrginterix[[3-9]]*)
156515fb4814Smrg  version_type=linux
156615fb4814Smrg  need_lib_prefix=no
156715fb4814Smrg  need_version=no
156815fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
156915fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
157015fb4814Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
157115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
157215fb4814Smrg  shlibpath_overrides_runpath=no
157315fb4814Smrg  hardcode_into_libs=yes
157415fb4814Smrg  ;;
157515fb4814Smrg
157615fb4814Smrgirix5* | irix6* | nonstopux*)
157715fb4814Smrg  case $host_os in
157815fb4814Smrg    nonstopux*) version_type=nonstopux ;;
157915fb4814Smrg    *)
158015fb4814Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
158115fb4814Smrg		version_type=linux
158215fb4814Smrg	else
158315fb4814Smrg		version_type=irix
158415fb4814Smrg	fi ;;
158515fb4814Smrg  esac
158615fb4814Smrg  need_lib_prefix=no
158715fb4814Smrg  need_version=no
158815fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
158915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
159015fb4814Smrg  case $host_os in
159115fb4814Smrg  irix5* | nonstopux*)
159215fb4814Smrg    libsuff= shlibsuff=
159315fb4814Smrg    ;;
159415fb4814Smrg  *)
159515fb4814Smrg    case $LD in # libtool.m4 will add one of these switches to LD
159615fb4814Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
159715fb4814Smrg      libsuff= shlibsuff= libmagic=32-bit;;
159815fb4814Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
159915fb4814Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
160015fb4814Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
160115fb4814Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
160215fb4814Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
160315fb4814Smrg    esac
160415fb4814Smrg    ;;
160515fb4814Smrg  esac
160615fb4814Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
160715fb4814Smrg  shlibpath_overrides_runpath=no
160815fb4814Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
160915fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
161015fb4814Smrg  hardcode_into_libs=yes
161115fb4814Smrg  ;;
161215fb4814Smrg
161315fb4814Smrg# No shared lib support for Linux oldld, aout, or coff.
161415fb4814Smrglinux*oldld* | linux*aout* | linux*coff*)
161515fb4814Smrg  dynamic_linker=no
161615fb4814Smrg  ;;
161715fb4814Smrg
161815fb4814Smrg# This must be Linux ELF.
1619de78e416Smrglinux* | k*bsd*-gnu)
162015fb4814Smrg  version_type=linux
162115fb4814Smrg  need_lib_prefix=no
162215fb4814Smrg  need_version=no
162315fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
162415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
162515fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
162615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
162715fb4814Smrg  shlibpath_overrides_runpath=no
162815fb4814Smrg  # This implies no fast_install, which is unacceptable.
162915fb4814Smrg  # Some rework will be needed to allow for fast_install
163015fb4814Smrg  # before this can be enabled.
163115fb4814Smrg  hardcode_into_libs=yes
1632b534f209Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
1633b534f209Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
163415fb4814Smrg
163515fb4814Smrg  # Append ld.so.conf contents to the search path
163615fb4814Smrg  if test -f /etc/ld.so.conf; then
1637b534f209Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
1638de78e416Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
163915fb4814Smrg  fi
164015fb4814Smrg
164115fb4814Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
164215fb4814Smrg  # powerpc, because MkLinux only supported shared libraries with the
164315fb4814Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
164415fb4814Smrg  # most powerpc-linux boxes support dynamic linking these days and
164515fb4814Smrg  # people can always --disable-shared, the test was removed, and we
164615fb4814Smrg  # assume the GNU/Linux dynamic linker is in use.
164715fb4814Smrg  dynamic_linker='GNU/Linux ld.so'
164815fb4814Smrg  ;;
164915fb4814Smrg
165015fb4814Smrgnetbsd*)
165115fb4814Smrg  version_type=sunos
165215fb4814Smrg  need_lib_prefix=no
165315fb4814Smrg  need_version=no
1654b534f209Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
165515fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
165615fb4814Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
165715fb4814Smrg    dynamic_linker='NetBSD (a.out) ld.so'
165815fb4814Smrg  else
165915fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
166015fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
166115fb4814Smrg    dynamic_linker='NetBSD ld.elf_so'
166215fb4814Smrg  fi
166315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
166415fb4814Smrg  shlibpath_overrides_runpath=yes
166515fb4814Smrg  hardcode_into_libs=yes
166615fb4814Smrg  ;;
166715fb4814Smrg
166815fb4814Smrgnewsos6)
166915fb4814Smrg  version_type=linux
167015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
167115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
167215fb4814Smrg  shlibpath_overrides_runpath=yes
167315fb4814Smrg  ;;
167415fb4814Smrg
1675b534f209Smrgnto-qnx*)
1676b534f209Smrg  version_type=linux
167715fb4814Smrg  need_lib_prefix=no
167815fb4814Smrg  need_version=no
167915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
168015fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
168115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
1682b534f209Smrg  shlibpath_overrides_runpath=yes
168315fb4814Smrg  ;;
168415fb4814Smrg
168515fb4814Smrgopenbsd*)
168615fb4814Smrg  version_type=sunos
168715fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
168815fb4814Smrg  need_lib_prefix=no
168915fb4814Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
169015fb4814Smrg  case $host_os in
1691b534f209Smrg    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
1692b534f209Smrg    *)                         need_version=no  ;;
169315fb4814Smrg  esac
169415fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
169515fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
169615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
1697b534f209Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
169815fb4814Smrg    case $host_os in
169915fb4814Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
170015fb4814Smrg	shlibpath_overrides_runpath=no
170115fb4814Smrg	;;
170215fb4814Smrg      *)
170315fb4814Smrg	shlibpath_overrides_runpath=yes
170415fb4814Smrg	;;
170515fb4814Smrg      esac
170615fb4814Smrg  else
170715fb4814Smrg    shlibpath_overrides_runpath=yes
170815fb4814Smrg  fi
170915fb4814Smrg  ;;
171015fb4814Smrg
171115fb4814Smrgos2*)
171215fb4814Smrg  libname_spec='$name'
171315fb4814Smrg  shrext_cmds=".dll"
171415fb4814Smrg  need_lib_prefix=no
171515fb4814Smrg  library_names_spec='$libname${shared_ext} $libname.a'
171615fb4814Smrg  dynamic_linker='OS/2 ld.exe'
171715fb4814Smrg  shlibpath_var=LIBPATH
171815fb4814Smrg  ;;
171915fb4814Smrg
172015fb4814Smrgosf3* | osf4* | osf5*)
172115fb4814Smrg  version_type=osf
172215fb4814Smrg  need_lib_prefix=no
172315fb4814Smrg  need_version=no
172415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
172515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
172615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
172715fb4814Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
172815fb4814Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
172915fb4814Smrg  ;;
173015fb4814Smrg
1731de78e416Smrgrdos*)
1732de78e416Smrg  dynamic_linker=no
1733de78e416Smrg  ;;
1734de78e416Smrg
173515fb4814Smrgsolaris*)
173615fb4814Smrg  version_type=linux
173715fb4814Smrg  need_lib_prefix=no
173815fb4814Smrg  need_version=no
173915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
174015fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
174115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
174215fb4814Smrg  shlibpath_overrides_runpath=yes
174315fb4814Smrg  hardcode_into_libs=yes
174415fb4814Smrg  # ldd complains unless libraries are executable
174515fb4814Smrg  postinstall_cmds='chmod +x $lib'
174615fb4814Smrg  ;;
174715fb4814Smrg
174815fb4814Smrgsunos4*)
174915fb4814Smrg  version_type=sunos
175015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
175115fb4814Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
175215fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
175315fb4814Smrg  shlibpath_overrides_runpath=yes
175415fb4814Smrg  if test "$with_gnu_ld" = yes; then
175515fb4814Smrg    need_lib_prefix=no
175615fb4814Smrg  fi
175715fb4814Smrg  need_version=yes
175815fb4814Smrg  ;;
175915fb4814Smrg
176015fb4814Smrgsysv4 | sysv4.3*)
176115fb4814Smrg  version_type=linux
176215fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
176315fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
176415fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
176515fb4814Smrg  case $host_vendor in
176615fb4814Smrg    sni)
176715fb4814Smrg      shlibpath_overrides_runpath=no
176815fb4814Smrg      need_lib_prefix=no
1769b534f209Smrg      export_dynamic_flag_spec='${wl}-Blargedynsym'
177015fb4814Smrg      runpath_var=LD_RUN_PATH
177115fb4814Smrg      ;;
177215fb4814Smrg    siemens)
177315fb4814Smrg      need_lib_prefix=no
177415fb4814Smrg      ;;
177515fb4814Smrg    motorola)
177615fb4814Smrg      need_lib_prefix=no
177715fb4814Smrg      need_version=no
177815fb4814Smrg      shlibpath_overrides_runpath=no
177915fb4814Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
178015fb4814Smrg      ;;
178115fb4814Smrg  esac
178215fb4814Smrg  ;;
178315fb4814Smrg
178415fb4814Smrgsysv4*MP*)
178515fb4814Smrg  if test -d /usr/nec ;then
178615fb4814Smrg    version_type=linux
178715fb4814Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
178815fb4814Smrg    soname_spec='$libname${shared_ext}.$major'
178915fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
179015fb4814Smrg  fi
179115fb4814Smrg  ;;
179215fb4814Smrg
179315fb4814Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
179415fb4814Smrg  version_type=freebsd-elf
179515fb4814Smrg  need_lib_prefix=no
179615fb4814Smrg  need_version=no
179715fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
179815fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
179915fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
180015fb4814Smrg  hardcode_into_libs=yes
180115fb4814Smrg  if test "$with_gnu_ld" = yes; then
180215fb4814Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
1803b534f209Smrg    shlibpath_overrides_runpath=no
180415fb4814Smrg  else
180515fb4814Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
1806b534f209Smrg    shlibpath_overrides_runpath=yes
180715fb4814Smrg    case $host_os in
180815fb4814Smrg      sco3.2v5*)
180915fb4814Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
181015fb4814Smrg	;;
181115fb4814Smrg    esac
181215fb4814Smrg  fi
181315fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
181415fb4814Smrg  ;;
181515fb4814Smrg
181615fb4814Smrguts4*)
181715fb4814Smrg  version_type=linux
181815fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
181915fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
182015fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
182115fb4814Smrg  ;;
182215fb4814Smrg
182315fb4814Smrg*)
182415fb4814Smrg  dynamic_linker=no
182515fb4814Smrg  ;;
182615fb4814Smrgesac
182715fb4814SmrgAC_MSG_RESULT([$dynamic_linker])
182815fb4814Smrgtest "$dynamic_linker" = no && can_build_shared=no
182915fb4814Smrg
183015fb4814Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
183115fb4814Smrgif test "$GCC" = yes; then
183215fb4814Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
183315fb4814Smrgfi
1834b534f209Smrg])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
183515fb4814Smrg
1836b534f209Smrg
1837b534f209Smrg# _LT_AC_TAGCONFIG
1838b534f209Smrg# ----------------
1839b534f209SmrgAC_DEFUN([_LT_AC_TAGCONFIG],
1840b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
1841b534f209SmrgAC_ARG_WITH([tags],
1842b534f209Smrg    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
1843b534f209Smrg        [include additional configurations @<:@automatic@:>@])],
1844b534f209Smrg    [tagnames="$withval"])
1845b534f209Smrg
1846b534f209Smrgif test -f "$ltmain" && test -n "$tagnames"; then
1847b534f209Smrg  if test ! -f "${ofile}"; then
1848b534f209Smrg    AC_MSG_WARN([output file `$ofile' does not exist])
1849b534f209Smrg  fi
1850b534f209Smrg
1851b534f209Smrg  if test -z "$LTCC"; then
1852b534f209Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
1853b534f209Smrg    if test -z "$LTCC"; then
1854b534f209Smrg      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
1855b534f209Smrg    else
1856b534f209Smrg      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
1857b534f209Smrg    fi
1858b534f209Smrg  fi
1859b534f209Smrg  if test -z "$LTCFLAGS"; then
1860b534f209Smrg    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
1861b534f209Smrg  fi
1862b534f209Smrg
1863b534f209Smrg  # Extract list of available tagged configurations in $ofile.
1864b534f209Smrg  # Note that this assumes the entire list is on one line.
1865b534f209Smrg  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
1866b534f209Smrg
1867b534f209Smrg  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1868b534f209Smrg  for tagname in $tagnames; do
1869b534f209Smrg    IFS="$lt_save_ifs"
1870b534f209Smrg    # Check whether tagname contains only valid characters
1871b534f209Smrg    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
1872b534f209Smrg    "") ;;
1873b534f209Smrg    *)  AC_MSG_ERROR([invalid tag name: $tagname])
1874b534f209Smrg	;;
1875b534f209Smrg    esac
1876b534f209Smrg
1877b534f209Smrg    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
1878b534f209Smrg    then
1879b534f209Smrg      AC_MSG_ERROR([tag name \"$tagname\" already exists])
1880b534f209Smrg    fi
1881b534f209Smrg
1882b534f209Smrg    # Update the list of available tags.
1883b534f209Smrg    if test -n "$tagname"; then
1884b534f209Smrg      echo appending configuration tag \"$tagname\" to $ofile
1885b534f209Smrg
1886b534f209Smrg      case $tagname in
1887b534f209Smrg      CXX)
1888b534f209Smrg	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1889b534f209Smrg	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1890b534f209Smrg	    (test "X$CXX" != "Xg++"))) ; then
1891b534f209Smrg	  AC_LIBTOOL_LANG_CXX_CONFIG
1892b534f209Smrg	else
1893b534f209Smrg	  tagname=""
1894b534f209Smrg	fi
1895b534f209Smrg	;;
1896b534f209Smrg
1897b534f209Smrg      F77)
1898b534f209Smrg	if test -n "$F77" && test "X$F77" != "Xno"; then
1899b534f209Smrg	  AC_LIBTOOL_LANG_F77_CONFIG
1900b534f209Smrg	else
1901b534f209Smrg	  tagname=""
1902b534f209Smrg	fi
1903b534f209Smrg	;;
1904b534f209Smrg
1905b534f209Smrg      GCJ)
1906b534f209Smrg	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
1907b534f209Smrg	  AC_LIBTOOL_LANG_GCJ_CONFIG
1908b534f209Smrg	else
1909b534f209Smrg	  tagname=""
1910b534f209Smrg	fi
1911b534f209Smrg	;;
1912b534f209Smrg
1913b534f209Smrg      RC)
1914b534f209Smrg	AC_LIBTOOL_LANG_RC_CONFIG
1915b534f209Smrg	;;
1916b534f209Smrg
1917b534f209Smrg      *)
1918b534f209Smrg	AC_MSG_ERROR([Unsupported tag name: $tagname])
1919b534f209Smrg	;;
1920b534f209Smrg      esac
1921b534f209Smrg
1922b534f209Smrg      # Append the new tag name to the list of available tags.
1923b534f209Smrg      if test -n "$tagname" ; then
1924b534f209Smrg      available_tags="$available_tags $tagname"
1925b534f209Smrg    fi
1926b534f209Smrg    fi
1927b534f209Smrg  done
1928b534f209Smrg  IFS="$lt_save_ifs"
1929b534f209Smrg
1930b534f209Smrg  # Now substitute the updated list of available tags.
1931b534f209Smrg  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
1932b534f209Smrg    mv "${ofile}T" "$ofile"
1933b534f209Smrg    chmod +x "$ofile"
1934b534f209Smrg  else
1935b534f209Smrg    rm -f "${ofile}T"
1936b534f209Smrg    AC_MSG_ERROR([unable to update list of available tagged configurations.])
1937b534f209Smrg  fi
1938b410ddbeSmrgfi
1939b534f209Smrg])# _LT_AC_TAGCONFIG
1940b534f209Smrg
1941b534f209Smrg
1942b534f209Smrg# AC_LIBTOOL_DLOPEN
1943b534f209Smrg# -----------------
1944b534f209Smrg# enable checks for dlopen support
1945b534f209SmrgAC_DEFUN([AC_LIBTOOL_DLOPEN],
1946b534f209Smrg [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
1947b534f209Smrg])# AC_LIBTOOL_DLOPEN
1948b534f209Smrg
1949b534f209Smrg
1950b534f209Smrg# AC_LIBTOOL_WIN32_DLL
1951b534f209Smrg# --------------------
1952b534f209Smrg# declare package support for building win32 DLLs
1953b534f209SmrgAC_DEFUN([AC_LIBTOOL_WIN32_DLL],
1954b534f209Smrg[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
1955b534f209Smrg])# AC_LIBTOOL_WIN32_DLL
1956b534f209Smrg
1957b534f209Smrg
1958b534f209Smrg# AC_ENABLE_SHARED([DEFAULT])
1959b534f209Smrg# ---------------------------
1960b534f209Smrg# implement the --enable-shared flag
1961b534f209Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
1962b534f209SmrgAC_DEFUN([AC_ENABLE_SHARED],
1963b534f209Smrg[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1964b534f209SmrgAC_ARG_ENABLE([shared],
1965b534f209Smrg    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
1966b534f209Smrg	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
1967b534f209Smrg    [p=${PACKAGE-default}
1968b534f209Smrg    case $enableval in
1969b534f209Smrg    yes) enable_shared=yes ;;
1970b534f209Smrg    no) enable_shared=no ;;
1971b534f209Smrg    *)
1972b534f209Smrg      enable_shared=no
1973b534f209Smrg      # Look at the argument we got.  We use all the common list separators.
1974b534f209Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
1975b534f209Smrg      for pkg in $enableval; do
1976b534f209Smrg	IFS="$lt_save_ifs"
1977b534f209Smrg	if test "X$pkg" = "X$p"; then
1978b534f209Smrg	  enable_shared=yes
1979b534f209Smrg	fi
1980b534f209Smrg      done
1981b534f209Smrg      IFS="$lt_save_ifs"
1982b534f209Smrg      ;;
1983b534f209Smrg    esac],
1984b534f209Smrg    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
1985b534f209Smrg])# AC_ENABLE_SHARED
1986b534f209Smrg
1987b534f209Smrg
1988b534f209Smrg# AC_DISABLE_SHARED
1989b534f209Smrg# -----------------
1990b534f209Smrg# set the default shared flag to --disable-shared
1991b534f209SmrgAC_DEFUN([AC_DISABLE_SHARED],
1992b534f209Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1993b534f209SmrgAC_ENABLE_SHARED(no)
1994b534f209Smrg])# AC_DISABLE_SHARED
1995b534f209Smrg
1996b534f209Smrg
1997b534f209Smrg# AC_ENABLE_STATIC([DEFAULT])
1998b534f209Smrg# ---------------------------
1999b534f209Smrg# implement the --enable-static flag
2000b534f209Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2001b534f209SmrgAC_DEFUN([AC_ENABLE_STATIC],
2002b534f209Smrg[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2003b534f209SmrgAC_ARG_ENABLE([static],
2004b534f209Smrg    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
2005b534f209Smrg	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
2006b534f209Smrg    [p=${PACKAGE-default}
2007b534f209Smrg    case $enableval in
2008b534f209Smrg    yes) enable_static=yes ;;
2009b534f209Smrg    no) enable_static=no ;;
2010b534f209Smrg    *)
2011b534f209Smrg     enable_static=no
2012b534f209Smrg      # Look at the argument we got.  We use all the common list separators.
2013b534f209Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2014b534f209Smrg      for pkg in $enableval; do
2015b534f209Smrg	IFS="$lt_save_ifs"
2016b534f209Smrg	if test "X$pkg" = "X$p"; then
2017b534f209Smrg	  enable_static=yes
2018b534f209Smrg	fi
2019b534f209Smrg      done
2020b534f209Smrg      IFS="$lt_save_ifs"
2021b534f209Smrg      ;;
2022b534f209Smrg    esac],
2023b534f209Smrg    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
2024b534f209Smrg])# AC_ENABLE_STATIC
2025b534f209Smrg
2026b534f209Smrg
2027b534f209Smrg# AC_DISABLE_STATIC
2028b534f209Smrg# -----------------
2029b534f209Smrg# set the default static flag to --disable-static
2030b534f209SmrgAC_DEFUN([AC_DISABLE_STATIC],
2031b534f209Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2032b534f209SmrgAC_ENABLE_STATIC(no)
2033b534f209Smrg])# AC_DISABLE_STATIC
2034b534f209Smrg
2035b534f209Smrg
2036b534f209Smrg# AC_ENABLE_FAST_INSTALL([DEFAULT])
2037b534f209Smrg# ---------------------------------
2038b534f209Smrg# implement the --enable-fast-install flag
2039b534f209Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
2040b534f209SmrgAC_DEFUN([AC_ENABLE_FAST_INSTALL],
2041b534f209Smrg[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
2042b534f209SmrgAC_ARG_ENABLE([fast-install],
2043b534f209Smrg    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
2044b534f209Smrg    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
2045b534f209Smrg    [p=${PACKAGE-default}
2046b534f209Smrg    case $enableval in
2047b534f209Smrg    yes) enable_fast_install=yes ;;
2048b534f209Smrg    no) enable_fast_install=no ;;
2049b534f209Smrg    *)
2050b534f209Smrg      enable_fast_install=no
2051b534f209Smrg      # Look at the argument we got.  We use all the common list separators.
2052b534f209Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
2053b534f209Smrg      for pkg in $enableval; do
2054b534f209Smrg	IFS="$lt_save_ifs"
2055b534f209Smrg	if test "X$pkg" = "X$p"; then
2056b534f209Smrg	  enable_fast_install=yes
2057b534f209Smrg	fi
2058b534f209Smrg      done
2059b534f209Smrg      IFS="$lt_save_ifs"
2060b534f209Smrg      ;;
2061b534f209Smrg    esac],
2062b534f209Smrg    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
2063b534f209Smrg])# AC_ENABLE_FAST_INSTALL
2064b534f209Smrg
2065b534f209Smrg
2066b534f209Smrg# AC_DISABLE_FAST_INSTALL
2067b534f209Smrg# -----------------------
2068b534f209Smrg# set the default to --disable-fast-install
2069b534f209SmrgAC_DEFUN([AC_DISABLE_FAST_INSTALL],
2070b534f209Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2071b534f209SmrgAC_ENABLE_FAST_INSTALL(no)
2072b534f209Smrg])# AC_DISABLE_FAST_INSTALL
2073b534f209Smrg
207415fb4814Smrg
2075b534f209Smrg# AC_LIBTOOL_PICMODE([MODE])
207615fb4814Smrg# --------------------------
2077b534f209Smrg# implement the --with-pic flag
2078b534f209Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
2079b534f209SmrgAC_DEFUN([AC_LIBTOOL_PICMODE],
2080b534f209Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2081b534f209Smrgpic_mode=ifelse($#,1,$1,default)
2082b534f209Smrg])# AC_LIBTOOL_PICMODE
2083b534f209Smrg
2084b534f209Smrg
2085b534f209Smrg# AC_PROG_EGREP
2086b534f209Smrg# -------------
2087b534f209Smrg# This is predefined starting with Autoconf 2.54, so this conditional
2088b534f209Smrg# definition can be removed once we require Autoconf 2.54 or later.
2089b534f209Smrgm4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
2090b534f209Smrg[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
2091b534f209Smrg   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
2092b534f209Smrg    then ac_cv_prog_egrep='grep -E'
2093b534f209Smrg    else ac_cv_prog_egrep='egrep'
2094b534f209Smrg    fi])
2095b534f209Smrg EGREP=$ac_cv_prog_egrep
2096b534f209Smrg AC_SUBST([EGREP])
2097b534f209Smrg])])
2098b534f209Smrg
2099b534f209Smrg
2100b534f209Smrg# AC_PATH_TOOL_PREFIX
2101b534f209Smrg# -------------------
2102de78e416Smrg# find a file program which can recognize shared library
2103b534f209SmrgAC_DEFUN([AC_PATH_TOOL_PREFIX],
2104b534f209Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
210515fb4814SmrgAC_MSG_CHECKING([for $1])
210615fb4814SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
210715fb4814Smrg[case $MAGIC_CMD in
210815fb4814Smrg[[\\/*] |  ?:[\\/]*])
210915fb4814Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
211015fb4814Smrg  ;;
211115fb4814Smrg*)
211215fb4814Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
211315fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
211415fb4814Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
211515fb4814Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
211615fb4814Smrgdnl not every word.  This closes a longstanding sh security hole.
2117b534f209Smrg  ac_dummy="ifelse([$2], , $PATH, [$2])"
211815fb4814Smrg  for ac_dir in $ac_dummy; do
211915fb4814Smrg    IFS="$lt_save_ifs"
212015fb4814Smrg    test -z "$ac_dir" && ac_dir=.
212115fb4814Smrg    if test -f $ac_dir/$1; then
212215fb4814Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
212315fb4814Smrg      if test -n "$file_magic_test_file"; then
212415fb4814Smrg	case $deplibs_check_method in
212515fb4814Smrg	"file_magic "*)
212615fb4814Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
212715fb4814Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
212815fb4814Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
212915fb4814Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
213015fb4814Smrg	    :
213115fb4814Smrg	  else
2132b534f209Smrg	    cat <<EOF 1>&2
213315fb4814Smrg
213415fb4814Smrg*** Warning: the command libtool uses to detect shared libraries,
213515fb4814Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
213615fb4814Smrg*** The result is that libtool may fail to recognize shared libraries
213715fb4814Smrg*** as such.  This will affect the creation of libtool libraries that
213815fb4814Smrg*** depend on shared libraries, but programs linked with such libtool
213915fb4814Smrg*** libraries will work regardless of this problem.  Nevertheless, you
214015fb4814Smrg*** may want to report the problem to your system manager and/or to
214115fb4814Smrg*** bug-libtool@gnu.org
214215fb4814Smrg
2143b534f209SmrgEOF
214415fb4814Smrg	  fi ;;
214515fb4814Smrg	esac
214615fb4814Smrg      fi
214715fb4814Smrg      break
214815fb4814Smrg    fi
214915fb4814Smrg  done
215015fb4814Smrg  IFS="$lt_save_ifs"
215115fb4814Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
215215fb4814Smrg  ;;
215315fb4814Smrgesac])
215415fb4814SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
215515fb4814Smrgif test -n "$MAGIC_CMD"; then
215615fb4814Smrg  AC_MSG_RESULT($MAGIC_CMD)
215715fb4814Smrgelse
215815fb4814Smrg  AC_MSG_RESULT(no)
215915fb4814Smrgfi
2160b534f209Smrg])# AC_PATH_TOOL_PREFIX
216115fb4814Smrg
216215fb4814Smrg
2163b534f209Smrg# AC_PATH_MAGIC
2164b534f209Smrg# -------------
2165de78e416Smrg# find a file program which can recognize a shared library
2166b534f209SmrgAC_DEFUN([AC_PATH_MAGIC],
2167b534f209Smrg[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
216815fb4814Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
216915fb4814Smrg  if test -n "$ac_tool_prefix"; then
2170b534f209Smrg    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
217115fb4814Smrg  else
217215fb4814Smrg    MAGIC_CMD=:
217315fb4814Smrg  fi
217415fb4814Smrgfi
2175b534f209Smrg])# AC_PATH_MAGIC
217615fb4814Smrg
217715fb4814Smrg
2178b534f209Smrg# AC_PROG_LD
217915fb4814Smrg# ----------
218015fb4814Smrg# find the pathname to the GNU or non-GNU linker
2181b534f209SmrgAC_DEFUN([AC_PROG_LD],
2182b534f209Smrg[AC_ARG_WITH([gnu-ld],
2183b534f209Smrg    [AC_HELP_STRING([--with-gnu-ld],
2184b410ddbeSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2185b410ddbeSmrg    [test "$withval" = no || with_gnu_ld=yes],
2186b534f209Smrg    [with_gnu_ld=no])
2187b534f209SmrgAC_REQUIRE([LT_AC_PROG_SED])dnl
2188b534f209SmrgAC_REQUIRE([AC_PROG_CC])dnl
2189b534f209SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2190b534f209SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
219115fb4814Smrgac_prog=ld
219215fb4814Smrgif test "$GCC" = yes; then
219315fb4814Smrg  # Check if gcc -print-prog-name=ld gives a path.
219415fb4814Smrg  AC_MSG_CHECKING([for ld used by $CC])
219515fb4814Smrg  case $host in
219615fb4814Smrg  *-*-mingw*)
219715fb4814Smrg    # gcc leaves a trailing carriage return which upsets mingw
219815fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
219915fb4814Smrg  *)
220015fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
220115fb4814Smrg  esac
220215fb4814Smrg  case $ac_prog in
220315fb4814Smrg    # Accept absolute paths.
220415fb4814Smrg    [[\\/]]* | ?:[[\\/]]*)
220515fb4814Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
220615fb4814Smrg      # Canonicalize the pathname of ld
2207b534f209Smrg      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
2208b534f209Smrg      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2209b534f209Smrg	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
221015fb4814Smrg      done
221115fb4814Smrg      test -z "$LD" && LD="$ac_prog"
221215fb4814Smrg      ;;
221315fb4814Smrg  "")
221415fb4814Smrg    # If it fails, then pretend we aren't using GCC.
221515fb4814Smrg    ac_prog=ld
221615fb4814Smrg    ;;
221715fb4814Smrg  *)
221815fb4814Smrg    # If it is relative, then search for the first ld in PATH.
221915fb4814Smrg    with_gnu_ld=unknown
222015fb4814Smrg    ;;
222115fb4814Smrg  esac
222215fb4814Smrgelif test "$with_gnu_ld" = yes; then
222315fb4814Smrg  AC_MSG_CHECKING([for GNU ld])
222415fb4814Smrgelse
222515fb4814Smrg  AC_MSG_CHECKING([for non-GNU ld])
222615fb4814Smrgfi
222715fb4814SmrgAC_CACHE_VAL(lt_cv_path_LD,
222815fb4814Smrg[if test -z "$LD"; then
222915fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
223015fb4814Smrg  for ac_dir in $PATH; do
223115fb4814Smrg    IFS="$lt_save_ifs"
223215fb4814Smrg    test -z "$ac_dir" && ac_dir=.
223315fb4814Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
223415fb4814Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
223515fb4814Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
223615fb4814Smrg      # but apparently some variants of GNU ld only accept -v.
223715fb4814Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
223815fb4814Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
223915fb4814Smrg      *GNU* | *'with BFD'*)
224015fb4814Smrg	test "$with_gnu_ld" != no && break
224115fb4814Smrg	;;
224215fb4814Smrg      *)
224315fb4814Smrg	test "$with_gnu_ld" != yes && break
224415fb4814Smrg	;;
224515fb4814Smrg      esac
224615fb4814Smrg    fi
224715fb4814Smrg  done
224815fb4814Smrg  IFS="$lt_save_ifs"
224915fb4814Smrgelse
225015fb4814Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
225115fb4814Smrgfi])
225215fb4814SmrgLD="$lt_cv_path_LD"
225315fb4814Smrgif test -n "$LD"; then
225415fb4814Smrg  AC_MSG_RESULT($LD)
225515fb4814Smrgelse
225615fb4814Smrg  AC_MSG_RESULT(no)
225715fb4814Smrgfi
225815fb4814Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2259b534f209SmrgAC_PROG_LD_GNU
2260b534f209Smrg])# AC_PROG_LD
226115fb4814Smrg
2262b410ddbeSmrg
2263b534f209Smrg# AC_PROG_LD_GNU
2264b534f209Smrg# --------------
2265b534f209SmrgAC_DEFUN([AC_PROG_LD_GNU],
2266b534f209Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
2267b534f209SmrgAC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
226815fb4814Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
226915fb4814Smrgcase `$LD -v 2>&1 </dev/null` in
227015fb4814Smrg*GNU* | *'with BFD'*)
227115fb4814Smrg  lt_cv_prog_gnu_ld=yes
227215fb4814Smrg  ;;
227315fb4814Smrg*)
227415fb4814Smrg  lt_cv_prog_gnu_ld=no
227515fb4814Smrg  ;;
227615fb4814Smrgesac])
227715fb4814Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2278b534f209Smrg])# AC_PROG_LD_GNU
227915fb4814Smrg
228015fb4814Smrg
2281b534f209Smrg# AC_PROG_LD_RELOAD_FLAG
2282b534f209Smrg# ----------------------
228315fb4814Smrg# find reload flag for linker
228415fb4814Smrg#   -- PORTME Some linkers may need a different reload flag.
2285b534f209SmrgAC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
228615fb4814Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
228715fb4814Smrg  lt_cv_ld_reload_flag,
228815fb4814Smrg  [lt_cv_ld_reload_flag='-r'])
228915fb4814Smrgreload_flag=$lt_cv_ld_reload_flag
229015fb4814Smrgcase $reload_flag in
229115fb4814Smrg"" | " "*) ;;
229215fb4814Smrg*) reload_flag=" $reload_flag" ;;
229315fb4814Smrgesac
229415fb4814Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
229515fb4814Smrgcase $host_os in
229615fb4814Smrg  darwin*)
229715fb4814Smrg    if test "$GCC" = yes; then
229815fb4814Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
229915fb4814Smrg    else
230015fb4814Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
230115fb4814Smrg    fi
230215fb4814Smrg    ;;
230315fb4814Smrgesac
2304b534f209Smrg])# AC_PROG_LD_RELOAD_FLAG
230515fb4814Smrg
230615fb4814Smrg
2307b534f209Smrg# AC_DEPLIBS_CHECK_METHOD
2308b534f209Smrg# -----------------------
230915fb4814Smrg# how to check for library dependencies
231015fb4814Smrg#  -- PORTME fill in with the dynamic library characteristics
2311b534f209SmrgAC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
2312b534f209Smrg[AC_CACHE_CHECK([how to recognize dependent libraries],
231315fb4814Smrglt_cv_deplibs_check_method,
231415fb4814Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
231515fb4814Smrglt_cv_file_magic_test_file=
231615fb4814Smrglt_cv_deplibs_check_method='unknown'
231715fb4814Smrg# Need to set the preceding variable on all platforms that support
231815fb4814Smrg# interlibrary dependencies.
231915fb4814Smrg# 'none' -- dependencies not supported.
232015fb4814Smrg# `unknown' -- same as none, but documents that we really don't know.
232115fb4814Smrg# 'pass_all' -- all dependencies passed with no checks.
232215fb4814Smrg# 'test_compile' -- check by making test program.
232315fb4814Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
232415fb4814Smrg# which responds to the $file_magic_cmd with a given extended regex.
232515fb4814Smrg# If you have `file' or equivalent on your system and you're not sure
232615fb4814Smrg# whether `pass_all' will *always* work, you probably want this one.
232715fb4814Smrg
232815fb4814Smrgcase $host_os in
2329b534f209Smrgaix4* | aix5*)
233015fb4814Smrg  lt_cv_deplibs_check_method=pass_all
233115fb4814Smrg  ;;
233215fb4814Smrg
233315fb4814Smrgbeos*)
233415fb4814Smrg  lt_cv_deplibs_check_method=pass_all
233515fb4814Smrg  ;;
233615fb4814Smrg
233715fb4814Smrgbsdi[[45]]*)
233815fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
233915fb4814Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
234015fb4814Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
234115fb4814Smrg  ;;
234215fb4814Smrg
234315fb4814Smrgcygwin*)
234415fb4814Smrg  # func_win32_libid is a shell function defined in ltmain.sh
234515fb4814Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
234615fb4814Smrg  lt_cv_file_magic_cmd='func_win32_libid'
234715fb4814Smrg  ;;
234815fb4814Smrg
234915fb4814Smrgmingw* | pw32*)
235015fb4814Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
2351de78e416Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
2352de78e416Smrg  # unless we find 'file', for example because we are cross-compiling.
2353de78e416Smrg  if ( file / ) >/dev/null 2>&1; then
2354de78e416Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
2355de78e416Smrg    lt_cv_file_magic_cmd='func_win32_libid'
2356de78e416Smrg  else
2357de78e416Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
2358de78e416Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
2359de78e416Smrg  fi
236015fb4814Smrg  ;;
236115fb4814Smrg
236215fb4814Smrgdarwin* | rhapsody*)
236315fb4814Smrg  lt_cv_deplibs_check_method=pass_all
236415fb4814Smrg  ;;
236515fb4814Smrg
2366de78e416Smrgfreebsd* | dragonfly*)
2367b534f209Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
236815fb4814Smrg    case $host_cpu in
236915fb4814Smrg    i*86 )
237015fb4814Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
237115fb4814Smrg      # Let's accept both of them until this is cleared up.
237215fb4814Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
237315fb4814Smrg      lt_cv_file_magic_cmd=/usr/bin/file
237415fb4814Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
237515fb4814Smrg      ;;
237615fb4814Smrg    esac
237715fb4814Smrg  else
237815fb4814Smrg    lt_cv_deplibs_check_method=pass_all
237915fb4814Smrg  fi
238015fb4814Smrg  ;;
238115fb4814Smrg
238215fb4814Smrggnu*)
238315fb4814Smrg  lt_cv_deplibs_check_method=pass_all
238415fb4814Smrg  ;;
238515fb4814Smrg
238615fb4814Smrghpux10.20* | hpux11*)
238715fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
238815fb4814Smrg  case $host_cpu in
238915fb4814Smrg  ia64*)
239015fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
239115fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
239215fb4814Smrg    ;;
239315fb4814Smrg  hppa*64*)
239415fb4814Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
239515fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
239615fb4814Smrg    ;;
239715fb4814Smrg  *)
239815fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
239915fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
240015fb4814Smrg    ;;
240115fb4814Smrg  esac
240215fb4814Smrg  ;;
240315fb4814Smrg
2404de78e416Smrginterix[[3-9]]*)
240515fb4814Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
240615fb4814Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
240715fb4814Smrg  ;;
240815fb4814Smrg
240915fb4814Smrgirix5* | irix6* | nonstopux*)
241015fb4814Smrg  case $LD in
241115fb4814Smrg  *-32|*"-32 ") libmagic=32-bit;;
241215fb4814Smrg  *-n32|*"-n32 ") libmagic=N32;;
241315fb4814Smrg  *-64|*"-64 ") libmagic=64-bit;;
241415fb4814Smrg  *) libmagic=never-match;;
241515fb4814Smrg  esac
241615fb4814Smrg  lt_cv_deplibs_check_method=pass_all
241715fb4814Smrg  ;;
241815fb4814Smrg
241915fb4814Smrg# This must be Linux ELF.
2420de78e416Smrglinux* | k*bsd*-gnu)
242115fb4814Smrg  lt_cv_deplibs_check_method=pass_all
242215fb4814Smrg  ;;
242315fb4814Smrg
242415fb4814Smrgnetbsd*)
2425b534f209Smrg  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
242615fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
242715fb4814Smrg  else
242815fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
242915fb4814Smrg  fi
243015fb4814Smrg  ;;
243115fb4814Smrg
243215fb4814Smrgnewos6*)
243315fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
243415fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
243515fb4814Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
243615fb4814Smrg  ;;
243715fb4814Smrg
2438b534f209Smrgnto-qnx*)
2439b534f209Smrg  lt_cv_deplibs_check_method=unknown
244015fb4814Smrg  ;;
244115fb4814Smrg
244215fb4814Smrgopenbsd*)
2443b534f209Smrg  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
244415fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
244515fb4814Smrg  else
244615fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
244715fb4814Smrg  fi
244815fb4814Smrg  ;;
244915fb4814Smrg
245015fb4814Smrgosf3* | osf4* | osf5*)
245115fb4814Smrg  lt_cv_deplibs_check_method=pass_all
245215fb4814Smrg  ;;
245315fb4814Smrg
2454de78e416Smrgrdos*)
2455de78e416Smrg  lt_cv_deplibs_check_method=pass_all
2456de78e416Smrg  ;;
2457de78e416Smrg
245815fb4814Smrgsolaris*)
245915fb4814Smrg  lt_cv_deplibs_check_method=pass_all
246015fb4814Smrg  ;;
246115fb4814Smrg
246215fb4814Smrgsysv4 | sysv4.3*)
246315fb4814Smrg  case $host_vendor in
246415fb4814Smrg  motorola)
246515fb4814Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
246615fb4814Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
246715fb4814Smrg    ;;
246815fb4814Smrg  ncr)
246915fb4814Smrg    lt_cv_deplibs_check_method=pass_all
247015fb4814Smrg    ;;
247115fb4814Smrg  sequent)
247215fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
247315fb4814Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
247415fb4814Smrg    ;;
247515fb4814Smrg  sni)
247615fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
247715fb4814Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
247815fb4814Smrg    lt_cv_file_magic_test_file=/lib/libc.so
247915fb4814Smrg    ;;
248015fb4814Smrg  siemens)
248115fb4814Smrg    lt_cv_deplibs_check_method=pass_all
248215fb4814Smrg    ;;
248315fb4814Smrg  pc)
248415fb4814Smrg    lt_cv_deplibs_check_method=pass_all
248515fb4814Smrg    ;;
248615fb4814Smrg  esac
248715fb4814Smrg  ;;
248815fb4814Smrg
2489b534f209Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
249015fb4814Smrg  lt_cv_deplibs_check_method=pass_all
249115fb4814Smrg  ;;
249215fb4814Smrgesac
249315fb4814Smrg])
249415fb4814Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
249515fb4814Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
249615fb4814Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
2497b534f209Smrg])# AC_DEPLIBS_CHECK_METHOD
249815fb4814Smrg
249915fb4814Smrg
2500b534f209Smrg# AC_PROG_NM
250115fb4814Smrg# ----------
2502b534f209Smrg# find the pathname to a BSD-compatible name lister
2503b534f209SmrgAC_DEFUN([AC_PROG_NM],
2504b534f209Smrg[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
250515fb4814Smrg[if test -n "$NM"; then
250615fb4814Smrg  # Let the user override the test.
250715fb4814Smrg  lt_cv_path_NM="$NM"
250815fb4814Smrgelse
250915fb4814Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
2510de78e416Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
251115fb4814Smrg    lt_nm_to_check="$lt_nm_to_check nm"
251215fb4814Smrg  fi
251315fb4814Smrg  for lt_tmp_nm in $lt_nm_to_check; do
251415fb4814Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
251515fb4814Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
251615fb4814Smrg      IFS="$lt_save_ifs"
251715fb4814Smrg      test -z "$ac_dir" && ac_dir=.
251815fb4814Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
251915fb4814Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
252015fb4814Smrg	# Check to see if the nm accepts a BSD-compat flag.
252115fb4814Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
252215fb4814Smrg	#   nm: unknown option "B" ignored
252315fb4814Smrg	# Tru64's nm complains that /dev/null is an invalid object file
252415fb4814Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
252515fb4814Smrg	*/dev/null* | *'Invalid file or object type'*)
252615fb4814Smrg	  lt_cv_path_NM="$tmp_nm -B"
252715fb4814Smrg	  break
252815fb4814Smrg	  ;;
252915fb4814Smrg	*)
253015fb4814Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
253115fb4814Smrg	  */dev/null*)
253215fb4814Smrg	    lt_cv_path_NM="$tmp_nm -p"
253315fb4814Smrg	    break
253415fb4814Smrg	    ;;
253515fb4814Smrg	  *)
253615fb4814Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
253715fb4814Smrg	    continue # so that we can try to find one that supports BSD flags
253815fb4814Smrg	    ;;
253915fb4814Smrg	  esac
254015fb4814Smrg	  ;;
254115fb4814Smrg	esac
254215fb4814Smrg      fi
254315fb4814Smrg    done
254415fb4814Smrg    IFS="$lt_save_ifs"
254515fb4814Smrg  done
2546b534f209Smrg  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
254715fb4814Smrgfi])
2548b534f209SmrgNM="$lt_cv_path_NM"
2549b534f209Smrg])# AC_PROG_NM
255015fb4814Smrg
255115fb4814Smrg
2552b534f209Smrg# AC_CHECK_LIBM
2553b534f209Smrg# -------------
255415fb4814Smrg# check for math library
2555b534f209SmrgAC_DEFUN([AC_CHECK_LIBM],
255615fb4814Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
255715fb4814SmrgLIBM=
255815fb4814Smrgcase $host in
255915fb4814Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
256015fb4814Smrg  # These system don't have libm, or don't need it
256115fb4814Smrg  ;;
256215fb4814Smrg*-ncr-sysv4.3*)
256315fb4814Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
256415fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
256515fb4814Smrg  ;;
256615fb4814Smrg*)
256715fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
256815fb4814Smrg  ;;
256915fb4814Smrgesac
2570b534f209Smrg])# AC_CHECK_LIBM
257115fb4814Smrg
257215fb4814Smrg
2573b534f209Smrg# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
2574b534f209Smrg# -----------------------------------
2575b534f209Smrg# sets LIBLTDL to the link flags for the libltdl convenience library and
2576b534f209Smrg# LTDLINCL to the include flags for the libltdl header and adds
2577b534f209Smrg# --enable-ltdl-convenience to the configure arguments.  Note that
2578b534f209Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2579b534f209Smrg# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
2580b534f209Smrg# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
2581b534f209Smrg# (note the single quotes!).  If your package is not flat and you're not
2582b534f209Smrg# using automake, define top_builddir and top_srcdir appropriately in
2583b534f209Smrg# the Makefiles.
2584b534f209SmrgAC_DEFUN([AC_LIBLTDL_CONVENIENCE],
2585b534f209Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2586b534f209Smrg  case $enable_ltdl_convenience in
2587b534f209Smrg  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
2588b534f209Smrg  "") enable_ltdl_convenience=yes
2589b534f209Smrg      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
2590b534f209Smrg  esac
2591b534f209Smrg  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
2592b534f209Smrg  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2593b534f209Smrg  # For backwards non-gettext consistent compatibility...
2594b534f209Smrg  INCLTDL="$LTDLINCL"
2595b534f209Smrg])# AC_LIBLTDL_CONVENIENCE
259615fb4814Smrg
259715fb4814Smrg
2598b534f209Smrg# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
2599b534f209Smrg# -----------------------------------
2600b534f209Smrg# sets LIBLTDL to the link flags for the libltdl installable library and
2601b534f209Smrg# LTDLINCL to the include flags for the libltdl header and adds
2602b534f209Smrg# --enable-ltdl-install to the configure arguments.  Note that
2603b534f209Smrg# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
2604b534f209Smrg# and an installed libltdl is not found, it is assumed to be `libltdl'.
2605b534f209Smrg# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
2606b534f209Smrg# '${top_srcdir}/' (note the single quotes!).  If your package is not
2607b534f209Smrg# flat and you're not using automake, define top_builddir and top_srcdir
2608b534f209Smrg# appropriately in the Makefiles.
2609b534f209Smrg# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
2610b534f209SmrgAC_DEFUN([AC_LIBLTDL_INSTALLABLE],
2611b534f209Smrg[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2612b534f209Smrg  AC_CHECK_LIB(ltdl, lt_dlinit,
2613b534f209Smrg  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
2614b534f209Smrg  [if test x"$enable_ltdl_install" = xno; then
2615b534f209Smrg     AC_MSG_WARN([libltdl not installed, but installation disabled])
2616b534f209Smrg   else
2617b534f209Smrg     enable_ltdl_install=yes
2618b534f209Smrg   fi
2619b534f209Smrg  ])
2620b534f209Smrg  if test x"$enable_ltdl_install" = x"yes"; then
2621b534f209Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install"
2622b534f209Smrg    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
2623b534f209Smrg    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
2624b534f209Smrg  else
2625b534f209Smrg    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
2626b534f209Smrg    LIBLTDL="-lltdl"
2627b534f209Smrg    LTDLINCL=
2628b534f209Smrg  fi
2629b534f209Smrg  # For backwards non-gettext consistent compatibility...
2630b534f209Smrg  INCLTDL="$LTDLINCL"
2631b534f209Smrg])# AC_LIBLTDL_INSTALLABLE
263215fb4814Smrg
263315fb4814Smrg
2634b534f209Smrg# AC_LIBTOOL_CXX
2635b534f209Smrg# --------------
2636b534f209Smrg# enable support for C++ libraries
2637b534f209SmrgAC_DEFUN([AC_LIBTOOL_CXX],
2638b534f209Smrg[AC_REQUIRE([_LT_AC_LANG_CXX])
2639b534f209Smrg])# AC_LIBTOOL_CXX
264015fb4814Smrg
264115fb4814Smrg
2642b534f209Smrg# _LT_AC_LANG_CXX
2643b534f209Smrg# ---------------
2644b534f209SmrgAC_DEFUN([_LT_AC_LANG_CXX],
2645b534f209Smrg[AC_REQUIRE([AC_PROG_CXX])
2646b534f209SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2647b534f209Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
2648b534f209Smrg])# _LT_AC_LANG_CXX
264915fb4814Smrg
2650b534f209Smrg# _LT_AC_PROG_CXXCPP
2651b534f209Smrg# ------------------
2652b534f209SmrgAC_DEFUN([_LT_AC_PROG_CXXCPP],
265315fb4814Smrg[
2654b534f209SmrgAC_REQUIRE([AC_PROG_CXX])
2655b534f209Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
2656b534f209Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
2657b534f209Smrg    (test "X$CXX" != "Xg++"))) ; then
2658b534f209Smrg  AC_PROG_CXXCPP
2659b534f209Smrgfi
2660b534f209Smrg])# _LT_AC_PROG_CXXCPP
266115fb4814Smrg
2662b534f209Smrg# AC_LIBTOOL_F77
2663b534f209Smrg# --------------
2664b534f209Smrg# enable support for Fortran 77 libraries
2665b534f209SmrgAC_DEFUN([AC_LIBTOOL_F77],
2666b534f209Smrg[AC_REQUIRE([_LT_AC_LANG_F77])
2667b534f209Smrg])# AC_LIBTOOL_F77
266815fb4814Smrg
266915fb4814Smrg
2670b534f209Smrg# _LT_AC_LANG_F77
2671b534f209Smrg# ---------------
2672b534f209SmrgAC_DEFUN([_LT_AC_LANG_F77],
2673b534f209Smrg[AC_REQUIRE([AC_PROG_F77])
2674b534f209Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
2675b534f209Smrg])# _LT_AC_LANG_F77
267615fb4814Smrg
267715fb4814Smrg
2678b534f209Smrg# AC_LIBTOOL_GCJ
2679b534f209Smrg# --------------
2680b534f209Smrg# enable support for GCJ libraries
2681b534f209SmrgAC_DEFUN([AC_LIBTOOL_GCJ],
2682b534f209Smrg[AC_REQUIRE([_LT_AC_LANG_GCJ])
2683b534f209Smrg])# AC_LIBTOOL_GCJ
268415fb4814Smrg
268515fb4814Smrg
2686b534f209Smrg# _LT_AC_LANG_GCJ
2687b534f209Smrg# ---------------
2688b534f209SmrgAC_DEFUN([_LT_AC_LANG_GCJ],
2689b534f209Smrg[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
2690b534f209Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
2691b534f209Smrg    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
2692b534f209Smrg      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
2693b534f209Smrg	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
2694b534f209Smrg	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
2695b534f209Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
2696b534f209Smrg])# _LT_AC_LANG_GCJ
2697b534f209Smrg
2698b534f209Smrg
2699b534f209Smrg# AC_LIBTOOL_RC
2700b534f209Smrg# -------------
2701b534f209Smrg# enable support for Windows resource files
2702b534f209SmrgAC_DEFUN([AC_LIBTOOL_RC],
2703b534f209Smrg[AC_REQUIRE([LT_AC_PROG_RC])
2704b534f209Smrg_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
2705b534f209Smrg])# AC_LIBTOOL_RC
2706b534f209Smrg
2707b534f209Smrg
2708b534f209Smrg# AC_LIBTOOL_LANG_C_CONFIG
2709b534f209Smrg# ------------------------
2710b534f209Smrg# Ensure that the configuration vars for the C compiler are
2711b534f209Smrg# suitably defined.  Those variables are subsequently used by
2712b534f209Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2713b534f209SmrgAC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
2714b534f209SmrgAC_DEFUN([_LT_AC_LANG_C_CONFIG],
2715b534f209Smrg[lt_save_CC="$CC"
2716b534f209SmrgAC_LANG_PUSH(C)
2717b534f209Smrg
2718b534f209Smrg# Source file extension for C test sources.
2719b534f209Smrgac_ext=c
2720b534f209Smrg
2721b534f209Smrg# Object file extension for compiled C test sources.
2722b534f209Smrgobjext=o
2723b534f209Smrg_LT_AC_TAGVAR(objext, $1)=$objext
2724b534f209Smrg
2725b534f209Smrg# Code to be used in simple compile tests
2726b534f209Smrglt_simple_compile_test_code="int some_variable = 0;"
2727b534f209Smrg
2728b534f209Smrg# Code to be used in simple link tests
2729b534f209Smrglt_simple_link_test_code='int main(){return(0);}'
2730b534f209Smrg
2731b534f209Smrg_LT_AC_SYS_COMPILER
2732b534f209Smrg
2733b534f209Smrg# save warnings/boilerplate of simple test code
2734b534f209Smrg_LT_COMPILER_BOILERPLATE
2735b534f209Smrg_LT_LINKER_BOILERPLATE
2736b534f209Smrg
2737b534f209SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
2738b534f209SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
2739b534f209SmrgAC_LIBTOOL_PROG_CC_C_O($1)
2740b534f209SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
2741b534f209SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
2742b534f209SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
2743b534f209SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
2744b534f209SmrgAC_LIBTOOL_SYS_LIB_STRIP
2745b534f209SmrgAC_LIBTOOL_DLOPEN_SELF
2746b534f209Smrg
2747b534f209Smrg# Report which library types will actually be built
2748b534f209SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
2749b534f209SmrgAC_MSG_RESULT([$can_build_shared])
2750b534f209Smrg
2751b534f209SmrgAC_MSG_CHECKING([whether to build shared libraries])
2752b534f209Smrgtest "$can_build_shared" = "no" && enable_shared=no
2753b534f209Smrg
2754b534f209Smrg# On AIX, shared libraries and static libraries use the same namespace, and
2755b534f209Smrg# are all built from PIC.
2756b534f209Smrgcase $host_os in
2757b534f209Smrgaix3*)
2758b534f209Smrg  test "$enable_shared" = yes && enable_static=no
2759b534f209Smrg  if test -n "$RANLIB"; then
2760b534f209Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
2761b534f209Smrg    postinstall_cmds='$RANLIB $lib'
2762b534f209Smrg  fi
2763b410ddbeSmrg  ;;
2764b534f209Smrg
2765b534f209Smrgaix4* | aix5*)
2766b534f209Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
2767b534f209Smrg    test "$enable_shared" = yes && enable_static=no
2768b534f209Smrg  fi
2769b534f209Smrg    ;;
2770b410ddbeSmrgesac
2771b534f209SmrgAC_MSG_RESULT([$enable_shared])
277215fb4814Smrg
2773b534f209SmrgAC_MSG_CHECKING([whether to build static libraries])
2774b534f209Smrg# Make sure either enable_shared or enable_static is yes.
2775b534f209Smrgtest "$enable_shared" = yes || enable_static=yes
2776b534f209SmrgAC_MSG_RESULT([$enable_static])
277715fb4814Smrg
2778b534f209SmrgAC_LIBTOOL_CONFIG($1)
277915fb4814Smrg
2780b534f209SmrgAC_LANG_POP
2781b534f209SmrgCC="$lt_save_CC"
2782b534f209Smrg])# AC_LIBTOOL_LANG_C_CONFIG
278315fb4814Smrg
278415fb4814Smrg
2785b534f209Smrg# AC_LIBTOOL_LANG_CXX_CONFIG
2786b534f209Smrg# --------------------------
2787b534f209Smrg# Ensure that the configuration vars for the C compiler are
2788b534f209Smrg# suitably defined.  Those variables are subsequently used by
2789b534f209Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
2790b534f209SmrgAC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
2791b534f209SmrgAC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
2792b534f209Smrg[AC_LANG_PUSH(C++)
2793b534f209SmrgAC_REQUIRE([AC_PROG_CXX])
2794b534f209SmrgAC_REQUIRE([_LT_AC_PROG_CXXCPP])
2795b534f209Smrg
2796b534f209Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
2797b534f209Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
2798b534f209Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
2799b534f209Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
2800b534f209Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
2801b534f209Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
2802b534f209Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
2803b534f209Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
2804b534f209Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2805b534f209Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
2806b534f209Smrg_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
2807b534f209Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
2808b534f209Smrg_LT_AC_TAGVAR(module_cmds, $1)=
2809b534f209Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
2810b534f209Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
2811b534f209Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
2812b534f209Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
2813b534f209Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
2814b534f209Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
281515fb4814Smrg
2816b534f209Smrg# Dependencies to place before and after the object being linked:
2817b534f209Smrg_LT_AC_TAGVAR(predep_objects, $1)=
2818b534f209Smrg_LT_AC_TAGVAR(postdep_objects, $1)=
2819b534f209Smrg_LT_AC_TAGVAR(predeps, $1)=
2820b534f209Smrg_LT_AC_TAGVAR(postdeps, $1)=
2821b534f209Smrg_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
282215fb4814Smrg
2823b534f209Smrg# Source file extension for C++ test sources.
2824b534f209Smrgac_ext=cpp
282515fb4814Smrg
2826b534f209Smrg# Object file extension for compiled C++ test sources.
2827b534f209Smrgobjext=o
2828b534f209Smrg_LT_AC_TAGVAR(objext, $1)=$objext
282915fb4814Smrg
2830b534f209Smrg# Code to be used in simple compile tests
2831b534f209Smrglt_simple_compile_test_code="int some_variable = 0;"
283215fb4814Smrg
2833b534f209Smrg# Code to be used in simple link tests
2834b534f209Smrglt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
283515fb4814Smrg
2836b534f209Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
2837b534f209Smrg_LT_AC_SYS_COMPILER
283815fb4814Smrg
2839b534f209Smrg# save warnings/boilerplate of simple test code
2840b534f209Smrg_LT_COMPILER_BOILERPLATE
2841b534f209Smrg_LT_LINKER_BOILERPLATE
2842b534f209Smrg
2843b534f209Smrg# Allow CC to be a program name with arguments.
2844b534f209Smrglt_save_CC=$CC
2845b534f209Smrglt_save_LD=$LD
2846b534f209Smrglt_save_GCC=$GCC
2847b534f209SmrgGCC=$GXX
2848b534f209Smrglt_save_with_gnu_ld=$with_gnu_ld
2849b534f209Smrglt_save_path_LD=$lt_cv_path_LD
2850b534f209Smrgif test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
2851b534f209Smrg  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
2852b534f209Smrgelse
2853b534f209Smrg  $as_unset lt_cv_prog_gnu_ld
2854b534f209Smrgfi
2855b534f209Smrgif test -n "${lt_cv_path_LDCXX+set}"; then
2856b534f209Smrg  lt_cv_path_LD=$lt_cv_path_LDCXX
2857b534f209Smrgelse
2858b534f209Smrg  $as_unset lt_cv_path_LD
2859b534f209Smrgfi
2860b534f209Smrgtest -z "${LDCXX+set}" || LD=$LDCXX
2861b534f209SmrgCC=${CXX-"c++"}
2862b534f209Smrgcompiler=$CC
2863b534f209Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
2864b534f209Smrg_LT_CC_BASENAME([$compiler])
2865b534f209Smrg
2866b534f209Smrg# We don't want -fno-exception wen compiling C++ code, so set the
2867b534f209Smrg# no_builtin_flag separately
2868b534f209Smrgif test "$GXX" = yes; then
2869b534f209Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
2870b534f209Smrgelse
2871b534f209Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
2872b534f209Smrgfi
2873b534f209Smrg
2874b534f209Smrgif test "$GXX" = yes; then
2875b534f209Smrg  # Set up default GNU C++ configuration
2876b534f209Smrg
2877b534f209Smrg  AC_PROG_LD
2878b534f209Smrg
2879b534f209Smrg  # Check if GNU C++ uses GNU ld as the underlying linker, since the
2880b534f209Smrg  # archiving commands below assume that GNU ld is being used.
2881b534f209Smrg  if test "$with_gnu_ld" = yes; then
2882b534f209Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
2883b534f209Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
2884b534f209Smrg
2885b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
2886b534f209Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
2887b534f209Smrg
2888b534f209Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
2889b534f209Smrg    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
2890b534f209Smrg    #     investigate it a little bit more. (MM)
2891b534f209Smrg    wlarc='${wl}'
2892b534f209Smrg
2893b534f209Smrg    # ancient GNU ld didn't support --whole-archive et. al.
2894b534f209Smrg    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
2895b534f209Smrg	grep 'no-whole-archive' > /dev/null; then
2896b534f209Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
289715fb4814Smrg    else
2898b534f209Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
289915fb4814Smrg    fi
290015fb4814Smrg  else
2901b534f209Smrg    with_gnu_ld=no
2902b534f209Smrg    wlarc=
2903b534f209Smrg
2904b534f209Smrg    # A generic and very simple default shared library creation
2905b534f209Smrg    # command for GNU C++ for the case where it uses the native
2906b534f209Smrg    # linker, instead of GNU ld.  If possible, this setting should
2907b534f209Smrg    # overridden to take advantage of the native linker features on
2908b534f209Smrg    # the platform it is being used on.
2909b534f209Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
291015fb4814Smrg  fi
291115fb4814Smrg
2912b534f209Smrg  # Commands to make compiler produce verbose output that lists
2913b534f209Smrg  # what "hidden" libraries, object files and flags are used when
2914b534f209Smrg  # linking a shared library.
2915b534f209Smrg  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
2916b534f209Smrg
291715fb4814Smrgelse
2918b534f209Smrg  GXX=no
2919b534f209Smrg  with_gnu_ld=no
2920b534f209Smrg  wlarc=
292115fb4814Smrgfi
292215fb4814Smrg
2923b534f209Smrg# PORTME: fill in a description of your system's C++ link characteristics
2924b534f209SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
2925b534f209Smrg_LT_AC_TAGVAR(ld_shlibs, $1)=yes
2926b534f209Smrgcase $host_os in
2927b534f209Smrg  aix3*)
2928b534f209Smrg    # FIXME: insert proper C++ library support
2929b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
2930b534f209Smrg    ;;
2931b534f209Smrg  aix4* | aix5*)
2932b534f209Smrg    if test "$host_cpu" = ia64; then
2933b534f209Smrg      # On IA64, the linker does run time linking by default, so we don't
2934b534f209Smrg      # have to do anything special.
2935b534f209Smrg      aix_use_runtimelinking=no
2936b534f209Smrg      exp_sym_flag='-Bexport'
2937b534f209Smrg      no_entry_flag=""
2938b534f209Smrg    else
2939b534f209Smrg      aix_use_runtimelinking=no
2940b534f209Smrg
2941b534f209Smrg      # Test if we are trying to use run time linking or normal
2942b534f209Smrg      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
2943b534f209Smrg      # need to do runtime linking.
2944b534f209Smrg      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
2945b534f209Smrg	for ld_flag in $LDFLAGS; do
2946b534f209Smrg	  case $ld_flag in
2947b534f209Smrg	  *-brtl*)
2948b534f209Smrg	    aix_use_runtimelinking=yes
2949b534f209Smrg	    break
2950b534f209Smrg	    ;;
2951b534f209Smrg	  esac
2952b534f209Smrg	done
2953b534f209Smrg	;;
2954b534f209Smrg      esac
295515fb4814Smrg
2956b534f209Smrg      exp_sym_flag='-bexport'
2957b534f209Smrg      no_entry_flag='-bnoentry'
2958b534f209Smrg    fi
295915fb4814Smrg
2960b534f209Smrg    # When large executables or shared objects are built, AIX ld can
2961b534f209Smrg    # have problems creating the table of contents.  If linking a library
2962b534f209Smrg    # or program results in "error TOC overflow" add -mminimal-toc to
2963b534f209Smrg    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
2964b534f209Smrg    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
296515fb4814Smrg
2966b534f209Smrg    _LT_AC_TAGVAR(archive_cmds, $1)=''
2967b534f209Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
2968b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
2969b534f209Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
297015fb4814Smrg
2971b534f209Smrg    if test "$GXX" = yes; then
2972b534f209Smrg      case $host_os in aix4.[[012]]|aix4.[[012]].*)
2973b534f209Smrg      # We only want to do this on AIX 4.2 and lower, the check
2974b534f209Smrg      # below for broken collect2 doesn't work under 4.3+
2975b534f209Smrg	collect2name=`${CC} -print-prog-name=collect2`
2976b534f209Smrg	if test -f "$collect2name" && \
2977b534f209Smrg	   strings "$collect2name" | grep resolve_lib_name >/dev/null
2978b534f209Smrg	then
2979b534f209Smrg	  # We have reworked collect2
2980b534f209Smrg	  :
2981b534f209Smrg	else
2982b534f209Smrg	  # We have old collect2
2983b534f209Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
2984b534f209Smrg	  # It fails to find uninstalled libraries when the uninstalled
2985b534f209Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
2986b534f209Smrg	  # to unsupported forces relinking
2987b534f209Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
2988b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2989b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
2990b534f209Smrg	fi
2991b534f209Smrg	;;
2992b534f209Smrg      esac
2993b534f209Smrg      shared_flag='-shared'
2994b534f209Smrg      if test "$aix_use_runtimelinking" = yes; then
2995b534f209Smrg	shared_flag="$shared_flag "'${wl}-G'
2996b534f209Smrg      fi
2997b534f209Smrg    else
2998b534f209Smrg      # not using gcc
299915fb4814Smrg      if test "$host_cpu" = ia64; then
3000b534f209Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
3001b534f209Smrg	# chokes on -Wl,-G. The following line is correct:
3002b534f209Smrg	shared_flag='-G'
3003b534f209Smrg      else
3004b534f209Smrg	if test "$aix_use_runtimelinking" = yes; then
3005b534f209Smrg	  shared_flag='${wl}-G'
3006b534f209Smrg	else
3007b534f209Smrg	  shared_flag='${wl}-bM:SRE'
3008b534f209Smrg	fi
300915fb4814Smrg      fi
3010b534f209Smrg    fi
301115fb4814Smrg
3012b534f209Smrg    # It seems that -bexpall does not export symbols beginning with
3013b534f209Smrg    # underscore (_), so it is better to generate a list of symbols to export.
3014b534f209Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
3015b534f209Smrg    if test "$aix_use_runtimelinking" = yes; then
3016b534f209Smrg      # Warning - without using the other runtime loading flags (-brtl),
3017b534f209Smrg      # -berok will link without error, but may produce a broken library.
3018b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
3019b534f209Smrg      # Determine the default libpath from the value encoded in an empty executable.
3020b534f209Smrg      _LT_AC_SYS_LIBPATH_AIX
3021b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3022b534f209Smrg
3023b534f209Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
3024b534f209Smrg     else
3025b534f209Smrg      if test "$host_cpu" = ia64; then
3026b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
3027b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
3028b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
3029b534f209Smrg      else
3030b534f209Smrg	# Determine the default libpath from the value encoded in an empty executable.
3031b534f209Smrg	_LT_AC_SYS_LIBPATH_AIX
3032b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
3033b534f209Smrg	# Warning - without using the other run time loading flags,
3034b534f209Smrg	# -berok will link without error, but may produce a broken library.
3035b534f209Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
3036b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
3037b534f209Smrg	# Exported symbols can be pulled into shared objects from archives
3038b534f209Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
3039b534f209Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
3040b534f209Smrg	# This is similar to how AIX traditionally builds its shared libraries.
3041b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
3042b410ddbeSmrg      fi
3043b534f209Smrg    fi
3044b534f209Smrg    ;;
3045b534f209Smrg
3046b534f209Smrg  beos*)
3047b534f209Smrg    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
3048b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3049b534f209Smrg      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
3050b534f209Smrg      # support --undefined.  This deserves some investigation.  FIXME
3051b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3052b534f209Smrg    else
3053b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3054b534f209Smrg    fi
3055b534f209Smrg    ;;
3056b534f209Smrg
3057b534f209Smrg  chorus*)
3058b534f209Smrg    case $cc_basename in
305915fb4814Smrg      *)
3060b534f209Smrg	# FIXME: insert proper C++ library support
3061b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
306215fb4814Smrg	;;
306315fb4814Smrg    esac
3064b534f209Smrg    ;;
3065b534f209Smrg
3066b534f209Smrg  cygwin* | mingw* | pw32*)
3067b534f209Smrg    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
3068b534f209Smrg    # as there is no search path for DLLs.
3069b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
3070b534f209Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
3071b534f209Smrg    _LT_AC_TAGVAR(always_export_symbols, $1)=no
3072b534f209Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
3073b534f209Smrg
3074b534f209Smrg    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
3075b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
3076b534f209Smrg      # If the export-symbols file already is a .def file (1st line
3077b534f209Smrg      # is EXPORTS), use it as is; otherwise, prepend...
3078b534f209Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
3079b534f209Smrg	cp $export_symbols $output_objdir/$soname.def;
3080b534f209Smrg      else
3081b534f209Smrg	echo EXPORTS > $output_objdir/$soname.def;
3082b534f209Smrg	cat $export_symbols >> $output_objdir/$soname.def;
3083b534f209Smrg      fi~
3084b534f209Smrg      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
3085b534f209Smrg    else
3086b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3087b534f209Smrg    fi
3088b534f209Smrg  ;;
3089b534f209Smrg      darwin* | rhapsody*)
3090b534f209Smrg        case $host_os in
3091b534f209Smrg        rhapsody* | darwin1.[[012]])
3092b534f209Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
3093b534f209Smrg         ;;
3094b534f209Smrg       *) # Darwin 1.3 on
3095b534f209Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
3096b534f209Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
3097b534f209Smrg         else
3098b534f209Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
3099b534f209Smrg             10.[[012]])
3100b534f209Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
3101b534f209Smrg               ;;
3102b534f209Smrg             10.*)
3103b534f209Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
3104b534f209Smrg               ;;
3105b534f209Smrg           esac
3106b534f209Smrg         fi
3107b534f209Smrg         ;;
3108b534f209Smrg        esac
3109b534f209Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3110b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3111b534f209Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
3112b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
3113b534f209Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
3114b534f209Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3115b534f209Smrg
3116b534f209Smrg    if test "$GXX" = yes ; then
3117b534f209Smrg      lt_int_apple_cc_single_mod=no
3118b534f209Smrg      output_verbose_link_cmd='echo'
3119b534f209Smrg      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
3120b534f209Smrg       lt_int_apple_cc_single_mod=yes
3121b534f209Smrg      fi
3122b534f209Smrg      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
3123b534f209Smrg       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
3124b534f209Smrg      else
3125b534f209Smrg          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
3126b534f209Smrg        fi
3127b534f209Smrg        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3128b534f209Smrg        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3129b534f209Smrg          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
3130b534f209Smrg            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3131b534f209Smrg          else
3132b534f209Smrg            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3133b534f209Smrg          fi
3134b534f209Smrg            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3135b534f209Smrg      else
3136b534f209Smrg      case $cc_basename in
3137b534f209Smrg        xlc*)
3138b534f209Smrg         output_verbose_link_cmd='echo'
3139b534f209Smrg          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
3140b534f209Smrg          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
3141b534f209Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
3142b534f209Smrg          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3143b534f209Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
3144b534f209Smrg          ;;
3145b534f209Smrg       *)
3146b534f209Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
3147b534f209Smrg          ;;
3148b534f209Smrg      esac
3149b534f209Smrg      fi
3150b534f209Smrg        ;;
3151b534f209Smrg
3152b534f209Smrg  dgux*)
3153b534f209Smrg    case $cc_basename in
3154b534f209Smrg      ec++*)
3155b534f209Smrg	# FIXME: insert proper C++ library support
3156b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
315715fb4814Smrg	;;
3158b534f209Smrg      ghcx*)
3159b534f209Smrg	# Green Hills C++ Compiler
3160b534f209Smrg	# FIXME: insert proper C++ library support
3161b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3162de78e416Smrg	;;
3163b534f209Smrg      *)
3164b534f209Smrg	# FIXME: insert proper C++ library support
3165b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
316615fb4814Smrg	;;
3167b534f209Smrg    esac
3168b534f209Smrg    ;;
3169b534f209Smrg  freebsd[[12]]*)
3170b534f209Smrg    # C++ shared libraries reported to be fairly broken before switch to ELF
3171b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3172b534f209Smrg    ;;
3173b534f209Smrg  freebsd-elf*)
3174b534f209Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3175b534f209Smrg    ;;
3176b534f209Smrg  freebsd* | dragonfly*)
3177b534f209Smrg    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
3178b534f209Smrg    # conventions
3179b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
3180b534f209Smrg    ;;
3181b534f209Smrg  gnu*)
3182b534f209Smrg    ;;
3183b534f209Smrg  hpux9*)
3184b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3185b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3186b534f209Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3187b534f209Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3188b534f209Smrg    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3189b534f209Smrg				# but as the default
3190b534f209Smrg				# location of the library.
3191b534f209Smrg
3192b534f209Smrg    case $cc_basename in
3193b534f209Smrg    CC*)
3194b534f209Smrg      # FIXME: insert proper C++ library support
3195b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3196b534f209Smrg      ;;
3197b534f209Smrg    aCC*)
3198b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
3199b534f209Smrg      # Commands to make compiler produce verbose output that lists
3200b534f209Smrg      # what "hidden" libraries, object files and flags are used when
3201b534f209Smrg      # linking a shared library.
3202b534f209Smrg      #
3203b534f209Smrg      # There doesn't appear to be a way to prevent this compiler from
3204b534f209Smrg      # explicitly linking system object files so we need to strip them
3205b534f209Smrg      # from the output so that they don't get included in the library
3206b534f209Smrg      # dependencies.
3207b534f209Smrg      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
3208b534f209Smrg      ;;
3209b534f209Smrg    *)
3210b534f209Smrg      if test "$GXX" = yes; then
3211b534f209Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
3212b534f209Smrg      else
3213b534f209Smrg        # FIXME: insert proper C++ library support
3214b534f209Smrg        _LT_AC_TAGVAR(ld_shlibs, $1)=no
3215b534f209Smrg      fi
3216b534f209Smrg      ;;
3217b534f209Smrg    esac
3218b534f209Smrg    ;;
3219b534f209Smrg  hpux10*|hpux11*)
3220b534f209Smrg    if test $with_gnu_ld = no; then
3221b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
3222b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3223b534f209Smrg
3224b534f209Smrg      case $host_cpu in
3225b534f209Smrg      hppa*64*|ia64*) ;;
3226b534f209Smrg      *)
3227b534f209Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3228b534f209Smrg        ;;
3229b534f209Smrg      esac
3230b534f209Smrg    fi
3231b534f209Smrg    case $host_cpu in
3232b534f209Smrg    hppa*64*|ia64*)
3233b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
3234b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3235b534f209Smrg      ;;
3236b534f209Smrg    *)
3237b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3238b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
3239b534f209Smrg					      # but as the default
3240b534f209Smrg					      # location of the library.
3241b534f209Smrg      ;;
3242b534f209Smrg    esac
3243b534f209Smrg
3244b534f209Smrg    case $cc_basename in
3245b534f209Smrg      CC*)
3246b534f209Smrg	# FIXME: insert proper C++ library support
3247b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3248b534f209Smrg	;;
3249b534f209Smrg      aCC*)
3250b534f209Smrg	case $host_cpu in
3251b534f209Smrg	hppa*64*)
3252b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3253b534f209Smrg	  ;;
3254b534f209Smrg	ia64*)
3255b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3256b534f209Smrg	  ;;
3257b534f209Smrg	*)
3258b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3259b534f209Smrg	  ;;
3260b534f209Smrg	esac
3261b534f209Smrg	# Commands to make compiler produce verbose output that lists
3262b534f209Smrg	# what "hidden" libraries, object files and flags are used when
3263b534f209Smrg	# linking a shared library.
3264b534f209Smrg	#
3265b534f209Smrg	# There doesn't appear to be a way to prevent this compiler from
3266b534f209Smrg	# explicitly linking system object files so we need to strip them
3267b534f209Smrg	# from the output so that they don't get included in the library
3268b534f209Smrg	# dependencies.
3269b534f209Smrg	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
3270b534f209Smrg	;;
3271b534f209Smrg      *)
3272b534f209Smrg	if test "$GXX" = yes; then
3273b534f209Smrg	  if test $with_gnu_ld = no; then
3274b410ddbeSmrg	    case $host_cpu in
3275b534f209Smrg	    hppa*64*)
3276b534f209Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3277b534f209Smrg	      ;;
3278b534f209Smrg	    ia64*)
3279b534f209Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3280b410ddbeSmrg	      ;;
3281b410ddbeSmrg	    *)
3282b534f209Smrg	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3283b410ddbeSmrg	      ;;
3284b410ddbeSmrg	    esac
3285b534f209Smrg	  fi
3286b534f209Smrg	else
3287b534f209Smrg	  # FIXME: insert proper C++ library support
3288b534f209Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3289b534f209Smrg	fi
329015fb4814Smrg	;;
3291b534f209Smrg    esac
3292b534f209Smrg    ;;
3293b534f209Smrg  interix[[3-9]]*)
3294b534f209Smrg    _LT_AC_TAGVAR(hardcode_direct, $1)=no
3295b534f209Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3296b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3297b534f209Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3298b534f209Smrg    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
3299b534f209Smrg    # Instead, shared libraries are loaded at an image base (0x10000000 by
3300b534f209Smrg    # default) and relocated if they conflict, which is a slow very memory
3301b534f209Smrg    # consuming and fragmenting process.  To avoid this, we pick a random,
3302b534f209Smrg    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
3303b534f209Smrg    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
3304b534f209Smrg    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
3305b534f209Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
3306b534f209Smrg    ;;
3307b534f209Smrg  irix5* | irix6*)
3308b534f209Smrg    case $cc_basename in
3309b534f209Smrg      CC*)
3310b534f209Smrg	# SGI C++
3311b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
3312b534f209Smrg
3313b534f209Smrg	# Archives containing C++ object files must be created using
3314b534f209Smrg	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
3315b534f209Smrg	# necessary to make sure instantiated templates are included
3316b534f209Smrg	# in the archive.
3317b534f209Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
331815fb4814Smrg	;;
3319b534f209Smrg      *)
3320b534f209Smrg	if test "$GXX" = yes; then
3321b534f209Smrg	  if test "$with_gnu_ld" = no; then
3322b534f209Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
3323b534f209Smrg	  else
3324b534f209Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
3325b534f209Smrg	  fi
3326b534f209Smrg	fi
3327b534f209Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3328b534f209Smrg	;;
3329b534f209Smrg    esac
3330b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3331b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3332b534f209Smrg    ;;
3333b534f209Smrg  linux* | k*bsd*-gnu)
3334b534f209Smrg    case $cc_basename in
3335b534f209Smrg      KCC*)
3336b534f209Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3337b534f209Smrg
3338b534f209Smrg	# KCC will only create a shared library if the output file
3339b534f209Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3340b534f209Smrg	# to its proper name (with version) after linking.
3341b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
3342b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
3343b534f209Smrg	# Commands to make compiler produce verbose output that lists
3344b534f209Smrg	# what "hidden" libraries, object files and flags are used when
3345b534f209Smrg	# linking a shared library.
3346b534f209Smrg	#
3347b534f209Smrg	# There doesn't appear to be a way to prevent this compiler from
3348b534f209Smrg	# explicitly linking system object files so we need to strip them
3349b534f209Smrg	# from the output so that they don't get included in the library
3350b534f209Smrg	# dependencies.
3351b534f209Smrg	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
3352b534f209Smrg
3353b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
3354b534f209Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3355b534f209Smrg
3356b534f209Smrg	# Archives containing C++ object files must be created using
3357b534f209Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3358b534f209Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3359b534f209Smrg	;;
3360b534f209Smrg      icpc*)
3361b534f209Smrg	# Intel C++
3362b534f209Smrg	with_gnu_ld=yes
3363b534f209Smrg	# version 8.0 and above of icpc choke on multiply defined symbols
3364b534f209Smrg	# if we add $predep_objects and $postdep_objects, however 7.1 and
3365b534f209Smrg	# earlier do not add the objects themselves.
3366b534f209Smrg	case `$CC -V 2>&1` in
3367b534f209Smrg	*"Version 7."*)
3368b534f209Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3369b534f209Smrg  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
3370b534f209Smrg	  ;;
3371b534f209Smrg	*)  # Version 8.0 or newer
3372b534f209Smrg	  tmp_idyn=
3373b534f209Smrg	  case $host_cpu in
3374b534f209Smrg	    ia64*) tmp_idyn=' -i_dynamic';;
3375b534f209Smrg	  esac
3376b534f209Smrg  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
3377b534f209Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
3378b534f209Smrg	  ;;
3379b410ddbeSmrg	esac
3380b534f209Smrg	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3381b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3382b534f209Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3383b534f209Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
338415fb4814Smrg	;;
3385b534f209Smrg      pgCC*)
3386b534f209Smrg        # Portland Group C++ compiler
3387b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
3388b534f209Smrg  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
3389b534f209Smrg
3390b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
3391b534f209Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
3392b534f209Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
3393b534f209Smrg        ;;
3394b534f209Smrg      cxx*)
3395b534f209Smrg	# Compaq C++
3396b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
3397b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
3398b534f209Smrg
3399b534f209Smrg	runpath_var=LD_RUN_PATH
3400b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3401b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3402b534f209Smrg
3403b534f209Smrg	# Commands to make compiler produce verbose output that lists
3404b534f209Smrg	# what "hidden" libraries, object files and flags are used when
3405b534f209Smrg	# linking a shared library.
3406b534f209Smrg	#
3407b534f209Smrg	# There doesn't appear to be a way to prevent this compiler from
3408b534f209Smrg	# explicitly linking system object files so we need to strip them
3409b534f209Smrg	# from the output so that they don't get included in the library
3410b534f209Smrg	# dependencies.
3411b534f209Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
3412b534f209Smrg	;;
3413b534f209Smrg      *)
3414b534f209Smrg	case `$CC -V 2>&1 | sed 5q` in
3415b534f209Smrg	*Sun\ C*)
3416b534f209Smrg	  # Sun C++ 5.9
3417b534f209Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3418b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3419b534f209Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
3420b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3421b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
3422b534f209Smrg
3423b534f209Smrg	  # Not sure whether something based on
3424b534f209Smrg	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
3425b534f209Smrg	  # would be better.
3426b534f209Smrg	  output_verbose_link_cmd='echo'
3427b534f209Smrg
3428b534f209Smrg	  # Archives containing C++ object files must be created using
3429b534f209Smrg	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
3430b534f209Smrg	  # necessary to make sure instantiated templates are included
3431b534f209Smrg	  # in the archive.
3432b534f209Smrg	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3433b534f209Smrg	  ;;
3434b410ddbeSmrg	esac
343515fb4814Smrg	;;
3436b534f209Smrg    esac
3437b534f209Smrg    ;;
3438b534f209Smrg  lynxos*)
3439b534f209Smrg    # FIXME: insert proper C++ library support
3440b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3441b534f209Smrg    ;;
3442b534f209Smrg  m88k*)
3443b534f209Smrg    # FIXME: insert proper C++ library support
3444b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3445b534f209Smrg    ;;
3446b534f209Smrg  mvs*)
3447b534f209Smrg    case $cc_basename in
3448b534f209Smrg      cxx*)
3449b534f209Smrg	# FIXME: insert proper C++ library support
3450b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
345115fb4814Smrg	;;
3452b534f209Smrg      *)
3453b534f209Smrg	# FIXME: insert proper C++ library support
3454b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
345515fb4814Smrg	;;
3456b534f209Smrg    esac
3457b534f209Smrg    ;;
3458b534f209Smrg  netbsd*)
3459b534f209Smrg    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
3460b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
3461b534f209Smrg      wlarc=
3462b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3463b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3464b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3465b534f209Smrg    fi
3466b534f209Smrg    # Workaround some broken pre-1.5 toolchains
3467b534f209Smrg    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
3468b534f209Smrg    ;;
3469b534f209Smrg  openbsd2*)
3470b534f209Smrg    # C++ shared libraries are fairly broken
3471b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3472b534f209Smrg    ;;
3473b534f209Smrg  openbsd*)
3474b534f209Smrg    if test -f /usr/libexec/ld.so; then
3475b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
3476b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3477b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
3478b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3479b534f209Smrg      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3480b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
3481b534f209Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
3482b534f209Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
3483b534f209Smrg      fi
3484b534f209Smrg      output_verbose_link_cmd='echo'
3485b534f209Smrg    else
3486b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
3487b534f209Smrg    fi
3488b534f209Smrg    ;;
3489b534f209Smrg  osf3*)
3490b534f209Smrg    case $cc_basename in
3491b534f209Smrg      KCC*)
3492b534f209Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3493b534f209Smrg
3494b534f209Smrg	# KCC will only create a shared library if the output file
3495b534f209Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3496b534f209Smrg	# to its proper name (with version) after linking.
3497b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
3498b534f209Smrg
3499b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3500b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3501b534f209Smrg
3502b534f209Smrg	# Archives containing C++ object files must be created using
3503b534f209Smrg	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
3504b534f209Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
3505b534f209Smrg
350615fb4814Smrg	;;
3507b534f209Smrg      RCC*)
3508b534f209Smrg	# Rational C++ 2.4.1
3509b534f209Smrg	# FIXME: insert proper C++ library support
3510b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
351115fb4814Smrg	;;
3512b534f209Smrg      cxx*)
3513b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3514b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
3515b534f209Smrg
3516b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3517b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3518b534f209Smrg
3519b534f209Smrg	# Commands to make compiler produce verbose output that lists
3520b534f209Smrg	# what "hidden" libraries, object files and flags are used when
3521b534f209Smrg	# linking a shared library.
3522b534f209Smrg	#
3523b534f209Smrg	# There doesn't appear to be a way to prevent this compiler from
3524b534f209Smrg	# explicitly linking system object files so we need to strip them
3525b534f209Smrg	# from the output so that they don't get included in the library
3526b534f209Smrg	# dependencies.
3527b534f209Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
352815fb4814Smrg	;;
3529b534f209Smrg      *)
3530b534f209Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3531b534f209Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3532b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
3533b534f209Smrg
3534b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3535b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3536b534f209Smrg
3537b534f209Smrg	  # Commands to make compiler produce verbose output that lists
3538b534f209Smrg	  # what "hidden" libraries, object files and flags are used when
3539b534f209Smrg	  # linking a shared library.
3540b534f209Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3541b534f209Smrg
3542b534f209Smrg	else
3543b534f209Smrg	  # FIXME: insert proper C++ library support
3544b534f209Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3545b534f209Smrg	fi
354615fb4814Smrg	;;
3547b534f209Smrg    esac
3548b534f209Smrg    ;;
3549b534f209Smrg  osf4* | osf5*)
3550b534f209Smrg    case $cc_basename in
3551b534f209Smrg      KCC*)
3552b534f209Smrg	# Kuck and Associates, Inc. (KAI) C++ Compiler
3553b534f209Smrg
3554b534f209Smrg	# KCC will only create a shared library if the output file
3555b534f209Smrg	# ends with ".so" (or ".sl" for HP-UX), so rename the library
3556b534f209Smrg	# to its proper name (with version) after linking.
3557b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
3558b534f209Smrg
3559b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
3560b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3561b534f209Smrg
3562b534f209Smrg	# Archives containing C++ object files must be created using
3563b534f209Smrg	# the KAI C++ compiler.
3564b534f209Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
356515fb4814Smrg	;;
3566b534f209Smrg      RCC*)
3567b534f209Smrg	# Rational C++ 2.4.1
3568b534f209Smrg	# FIXME: insert proper C++ library support
3569b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
357015fb4814Smrg	;;
3571b534f209Smrg      cxx*)
3572b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
3573b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
3574b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
3575b534f209Smrg	  echo "-hidden">> $lib.exp~
3576b534f209Smrg	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
3577b534f209Smrg	  $rm $lib.exp'
3578b534f209Smrg
3579b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
3580b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3581b534f209Smrg
3582b534f209Smrg	# Commands to make compiler produce verbose output that lists
3583b534f209Smrg	# what "hidden" libraries, object files and flags are used when
3584b534f209Smrg	# linking a shared library.
3585b534f209Smrg	#
3586b534f209Smrg	# There doesn't appear to be a way to prevent this compiler from
3587b534f209Smrg	# explicitly linking system object files so we need to strip them
3588b534f209Smrg	# from the output so that they don't get included in the library
3589b534f209Smrg	# dependencies.
3590b534f209Smrg	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
3591b410ddbeSmrg	;;
3592b534f209Smrg      *)
3593b534f209Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3594b534f209Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
3595b534f209Smrg	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
3596b534f209Smrg
3597b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
3598b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
3599b534f209Smrg
3600b534f209Smrg	  # Commands to make compiler produce verbose output that lists
3601b534f209Smrg	  # what "hidden" libraries, object files and flags are used when
3602b534f209Smrg	  # linking a shared library.
3603b534f209Smrg	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
3604b534f209Smrg
3605b534f209Smrg	else
3606b534f209Smrg	  # FIXME: insert proper C++ library support
3607b534f209Smrg	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
3608b534f209Smrg	fi
360915fb4814Smrg	;;
3610b534f209Smrg    esac
3611b534f209Smrg    ;;
3612b534f209Smrg  psos*)
3613b534f209Smrg    # FIXME: insert proper C++ library support
3614b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3615b534f209Smrg    ;;
3616b534f209Smrg  sunos4*)
3617b534f209Smrg    case $cc_basename in
3618b534f209Smrg      CC*)
3619b534f209Smrg	# Sun C++ 4.x
3620b534f209Smrg	# FIXME: insert proper C++ library support
3621b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3622b534f209Smrg	;;
3623b534f209Smrg      lcc*)
3624b534f209Smrg	# Lucid
3625b534f209Smrg	# FIXME: insert proper C++ library support
3626b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
362715fb4814Smrg	;;
362815fb4814Smrg      *)
3629b534f209Smrg	# FIXME: insert proper C++ library support
3630b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
3631b410ddbeSmrg	;;
3632b410ddbeSmrg    esac
3633b534f209Smrg    ;;
3634b534f209Smrg  solaris*)
3635b534f209Smrg    case $cc_basename in
3636b534f209Smrg      CC*)
3637b534f209Smrg	# Sun C++ 4.2, 5.x and Centerline C++
3638b534f209Smrg        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
3639b534f209Smrg	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
3640b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
3641b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3642b534f209Smrg	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3643b534f209Smrg
3644b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
3645b534f209Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3646b534f209Smrg	case $host_os in
3647b534f209Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3648b534f209Smrg	  *)
3649b534f209Smrg	    # The compiler driver will combine and reorder linker options,
3650b534f209Smrg	    # but understands `-z linker_flag'.
3651b534f209Smrg	    # Supported since Solaris 2.6 (maybe 2.5.1?)
3652b534f209Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
3653b534f209Smrg	    ;;
3654b534f209Smrg	esac
3655b534f209Smrg	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3656b410ddbeSmrg
3657b534f209Smrg	output_verbose_link_cmd='echo'
3658b410ddbeSmrg
3659b534f209Smrg	# Archives containing C++ object files must be created using
3660b534f209Smrg	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
3661b534f209Smrg	# necessary to make sure instantiated templates are included
3662b534f209Smrg	# in the archive.
3663b534f209Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
3664b534f209Smrg	;;
3665b534f209Smrg      gcx*)
3666b534f209Smrg	# Green Hills C++ Compiler
3667b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3668b410ddbeSmrg
3669b534f209Smrg	# The C++ compiler must be used to create the archive.
3670b534f209Smrg	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
367115fb4814Smrg	;;
367215fb4814Smrg      *)
3673b534f209Smrg	# GNU C++ compiler with Solaris linker
3674b534f209Smrg	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
3675b534f209Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
3676b534f209Smrg	  if $CC --version | grep -v '^2\.7' > /dev/null; then
3677b534f209Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3678b534f209Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3679b534f209Smrg		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3680b410ddbeSmrg
3681b534f209Smrg	    # Commands to make compiler produce verbose output that lists
3682b534f209Smrg	    # what "hidden" libraries, object files and flags are used when
3683b534f209Smrg	    # linking a shared library.
3684b534f209Smrg	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3685b534f209Smrg	  else
3686b534f209Smrg	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
3687b534f209Smrg	    # platform.
3688b534f209Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
3689b534f209Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
3690b534f209Smrg		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
3691b410ddbeSmrg
3692b534f209Smrg	    # Commands to make compiler produce verbose output that lists
3693b534f209Smrg	    # what "hidden" libraries, object files and flags are used when
3694b534f209Smrg	    # linking a shared library.
3695b534f209Smrg	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
3696b534f209Smrg	  fi
3697b410ddbeSmrg
3698b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
3699b534f209Smrg	  case $host_os in
3700b534f209Smrg	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
3701b534f209Smrg	  *)
3702b534f209Smrg	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
3703b534f209Smrg	    ;;
3704b534f209Smrg	  esac
3705b534f209Smrg	fi
3706b534f209Smrg	;;
370715fb4814Smrg    esac
3708b534f209Smrg    ;;
3709b534f209Smrg  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
3710b534f209Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3711b534f209Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3712b534f209Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3713b534f209Smrg    runpath_var='LD_RUN_PATH'
3714b534f209Smrg
3715b534f209Smrg    case $cc_basename in
3716b534f209Smrg      CC*)
3717b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3718b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
371915fb4814Smrg	;;
372015fb4814Smrg      *)
3721b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
3722b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
372315fb4814Smrg	;;
3724b534f209Smrg    esac
3725b534f209Smrg    ;;
3726b534f209Smrg  sysv5* | sco3.2v5* | sco5v6*)
3727b534f209Smrg    # Note: We can NOT use -z defs as we might desire, because we do not
3728b534f209Smrg    # link with -lc, and that would cause any symbols used from libc to
3729b534f209Smrg    # always be unresolved, which means just about no library would
3730b534f209Smrg    # ever link correctly.  If we're not using GNU ld we use -z text
3731b534f209Smrg    # though, which does catch some bad symbols but isn't as heavy-handed
3732b534f209Smrg    # as -z defs.
3733b534f209Smrg    # For security reasons, it is highly recommended that you always
3734b534f209Smrg    # use absolute paths for naming shared libraries, and exclude the
3735b534f209Smrg    # DT_RUNPATH tag from executables and libraries.  But doing so
3736b534f209Smrg    # requires that you compile everything twice, which is a pain.
3737b534f209Smrg    # So that behaviour is only enabled if SCOABSPATH is set to a
3738b534f209Smrg    # non-empty value in the environment.  Most likely only useful for
3739b534f209Smrg    # creating official distributions of packages.
3740b534f209Smrg    # This is a hack until libtool officially supports absolute path
3741b534f209Smrg    # names for shared libraries.
3742b534f209Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
3743b534f209Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
3744b534f209Smrg    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
3745b534f209Smrg    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
3746b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
3747b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
3748b534f209Smrg    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
3749b534f209Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
3750b534f209Smrg    runpath_var='LD_RUN_PATH'
3751b534f209Smrg
3752b534f209Smrg    case $cc_basename in
3753b534f209Smrg      CC*)
3754b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3755b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3756b410ddbeSmrg	;;
3757b534f209Smrg      *)
3758b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3759b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
3760b534f209Smrg	;;
3761b534f209Smrg    esac
3762b534f209Smrg    ;;
3763b534f209Smrg  tandem*)
3764b534f209Smrg    case $cc_basename in
3765b534f209Smrg      NCC*)
3766b534f209Smrg	# NonStop-UX NCC 3.20
3767b534f209Smrg	# FIXME: insert proper C++ library support
3768b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
376915fb4814Smrg	;;
377015fb4814Smrg      *)
3771b534f209Smrg	# FIXME: insert proper C++ library support
3772b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
377315fb4814Smrg	;;
3774b534f209Smrg    esac
3775b534f209Smrg    ;;
3776b534f209Smrg  vxworks*)
3777b534f209Smrg    # FIXME: insert proper C++ library support
3778b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3779b534f209Smrg    ;;
3780b534f209Smrg  *)
3781b534f209Smrg    # FIXME: insert proper C++ library support
3782b534f209Smrg    _LT_AC_TAGVAR(ld_shlibs, $1)=no
3783b534f209Smrg    ;;
3784b534f209Smrgesac
3785b534f209SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
3786b534f209Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
378715fb4814Smrg
3788b534f209Smrg_LT_AC_TAGVAR(GCC, $1)="$GXX"
3789b534f209Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
379015fb4814Smrg
3791b534f209SmrgAC_LIBTOOL_POSTDEP_PREDEP($1)
3792b534f209SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
3793b534f209SmrgAC_LIBTOOL_PROG_CC_C_O($1)
3794b534f209SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
3795b534f209SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
3796b534f209SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
3797b534f209SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
379815fb4814Smrg
3799b534f209SmrgAC_LIBTOOL_CONFIG($1)
380015fb4814Smrg
3801b534f209SmrgAC_LANG_POP
3802b534f209SmrgCC=$lt_save_CC
3803b534f209SmrgLDCXX=$LD
3804b534f209SmrgLD=$lt_save_LD
3805b534f209SmrgGCC=$lt_save_GCC
3806b534f209Smrgwith_gnu_ldcxx=$with_gnu_ld
3807b534f209Smrgwith_gnu_ld=$lt_save_with_gnu_ld
3808b534f209Smrglt_cv_path_LDCXX=$lt_cv_path_LD
3809b534f209Smrglt_cv_path_LD=$lt_save_path_LD
3810b534f209Smrglt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
3811b534f209Smrglt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
3812b534f209Smrg])# AC_LIBTOOL_LANG_CXX_CONFIG
3813b534f209Smrg
3814b534f209Smrg# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
3815b534f209Smrg# ------------------------------------
3816b534f209Smrg# Figure out "hidden" library dependencies from verbose
3817b534f209Smrg# compiler output when linking a shared library.
3818b534f209Smrg# Parse the compiler output and extract the necessary
3819b534f209Smrg# objects, libraries and library flags.
3820b534f209SmrgAC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
3821b534f209Smrgdnl we can't use the lt_simple_compile_test_code here,
3822b534f209Smrgdnl because it contains code intended for an executable,
3823b534f209Smrgdnl not a library.  It's possible we should let each
3824b534f209Smrgdnl tag define a new lt_????_link_test_code variable,
3825b534f209Smrgdnl but it's only used here...
3826b534f209Smrgifelse([$1],[],[cat > conftest.$ac_ext <<EOF
3827b534f209Smrgint a;
3828b534f209Smrgvoid foo (void) { a = 0; }
3829b534f209SmrgEOF
3830b534f209Smrg],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
3831b534f209Smrgclass Foo
3832b534f209Smrg{
3833b534f209Smrgpublic:
3834b534f209Smrg  Foo (void) { a = 0; }
3835b534f209Smrgprivate:
3836b534f209Smrg  int a;
3837b534f209Smrg};
3838b534f209SmrgEOF
3839b534f209Smrg],[$1],[F77],[cat > conftest.$ac_ext <<EOF
3840b534f209Smrg      subroutine foo
3841b534f209Smrg      implicit none
3842b534f209Smrg      integer*4 a
3843b534f209Smrg      a=0
3844b534f209Smrg      return
3845b534f209Smrg      end
3846b534f209SmrgEOF
3847b534f209Smrg],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
3848b534f209Smrgpublic class foo {
3849b534f209Smrg  private int a;
3850b534f209Smrg  public void bar (void) {
3851b534f209Smrg    a = 0;
3852b534f209Smrg  }
3853b534f209Smrg};
3854b534f209SmrgEOF
3855b534f209Smrg])
3856b534f209Smrgdnl Parse the compiler output and extract the necessary
3857b534f209Smrgdnl objects, libraries and library flags.
3858b534f209Smrgif AC_TRY_EVAL(ac_compile); then
3859b534f209Smrg  # Parse the compiler output and extract the necessary
3860b534f209Smrg  # objects, libraries and library flags.
386115fb4814Smrg
3862b534f209Smrg  # Sentinel used to keep track of whether or not we are before
3863b534f209Smrg  # the conftest object file.
3864b534f209Smrg  pre_test_object_deps_done=no
386515fb4814Smrg
3866b534f209Smrg  # The `*' in the case matches for architectures that use `case' in
3867b534f209Smrg  # $output_verbose_cmd can trigger glob expansion during the loop
3868b534f209Smrg  # eval without this substitution.
3869b534f209Smrg  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
387015fb4814Smrg
3871b534f209Smrg  for p in `eval $output_verbose_link_cmd`; do
3872b534f209Smrg    case $p in
387315fb4814Smrg
3874b534f209Smrg    -L* | -R* | -l*)
3875b534f209Smrg       # Some compilers place space between "-{L,R}" and the path.
3876b534f209Smrg       # Remove the space.
3877b534f209Smrg       if test $p = "-L" \
3878b534f209Smrg	  || test $p = "-R"; then
3879b534f209Smrg	 prev=$p
3880b534f209Smrg	 continue
3881b534f209Smrg       else
3882b534f209Smrg	 prev=
3883b534f209Smrg       fi
388415fb4814Smrg
3885b534f209Smrg       if test "$pre_test_object_deps_done" = no; then
3886b534f209Smrg	 case $p in
3887b534f209Smrg	 -L* | -R*)
3888b534f209Smrg	   # Internal compiler library paths should come after those
3889b534f209Smrg	   # provided the user.  The postdeps already come after the
3890b534f209Smrg	   # user supplied libs so there is no need to process them.
3891b534f209Smrg	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
3892b534f209Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
3893b534f209Smrg	   else
3894b534f209Smrg	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
3895b534f209Smrg	   fi
3896b534f209Smrg	   ;;
3897b534f209Smrg	 # The "-l" case would never come before the object being
3898b534f209Smrg	 # linked, so don't bother handling this case.
3899b534f209Smrg	 esac
3900b534f209Smrg       else
3901b534f209Smrg	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
3902b534f209Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
3903b534f209Smrg	 else
3904b534f209Smrg	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
3905b534f209Smrg	 fi
3906b534f209Smrg       fi
3907b534f209Smrg       ;;
390815fb4814Smrg
3909b534f209Smrg    *.$objext)
3910b534f209Smrg       # This assumes that the test object file only shows up
3911b534f209Smrg       # once in the compiler output.
3912b534f209Smrg       if test "$p" = "conftest.$objext"; then
3913b534f209Smrg	 pre_test_object_deps_done=yes
3914b534f209Smrg	 continue
3915b534f209Smrg       fi
391615fb4814Smrg
3917b534f209Smrg       if test "$pre_test_object_deps_done" = no; then
3918b534f209Smrg	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
3919b534f209Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
3920b534f209Smrg	 else
3921b534f209Smrg	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
3922b534f209Smrg	 fi
3923b534f209Smrg       else
3924b534f209Smrg	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
3925b534f209Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
3926b534f209Smrg	 else
3927b534f209Smrg	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
3928b534f209Smrg	 fi
3929b534f209Smrg       fi
3930b534f209Smrg       ;;
3931b534f209Smrg
3932b534f209Smrg    *) ;; # Ignore the rest.
393315fb4814Smrg
393415fb4814Smrg    esac
3935b534f209Smrg  done
393615fb4814Smrg
3937b534f209Smrg  # Clean up.
3938b534f209Smrg  rm -f a.out a.exe
3939b534f209Smrgelse
3940b534f209Smrg  echo "libtool.m4: error: problem compiling $1 test program"
394115fb4814Smrgfi
394215fb4814Smrg
3943b534f209Smrg$rm -f confest.$objext
394483cab373Smrg
3945b534f209Smrg# PORTME: override above test on systems where it is broken
3946b534f209Smrgifelse([$1],[CXX],
3947b534f209Smrg[case $host_os in
3948b534f209Smrginterix[[3-9]]*)
3949b534f209Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
3950b534f209Smrg  # hack all around it, let's just trust "g++" to DTRT.
3951b534f209Smrg  _LT_AC_TAGVAR(predep_objects,$1)=
3952b534f209Smrg  _LT_AC_TAGVAR(postdep_objects,$1)=
3953b534f209Smrg  _LT_AC_TAGVAR(postdeps,$1)=
3954b534f209Smrg  ;;
395515fb4814Smrg
3956b534f209Smrglinux*)
3957b534f209Smrg  case `$CC -V 2>&1 | sed 5q` in
3958b534f209Smrg  *Sun\ C*)
3959b534f209Smrg    # Sun C++ 5.9
3960b534f209Smrg    #
3961b534f209Smrg    # The more standards-conforming stlport4 library is
3962b534f209Smrg    # incompatible with the Cstd library. Avoid specifying
3963b534f209Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
3964b534f209Smrg    # -library=stlport4 depends on it.
3965b534f209Smrg    case " $CXX $CXXFLAGS " in
3966b534f209Smrg    *" -library=stlport4 "*)
3967b534f209Smrg      solaris_use_stlport4=yes
3968b534f209Smrg      ;;
3969b534f209Smrg    esac
3970b534f209Smrg    if test "$solaris_use_stlport4" != yes; then
3971b534f209Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
3972de78e416Smrg    fi
3973de78e416Smrg    ;;
3974b410ddbeSmrg  esac
3975b534f209Smrg  ;;
3976de78e416Smrg
3977b534f209Smrgsolaris*)
3978b534f209Smrg  case $cc_basename in
3979b534f209Smrg  CC*)
3980b534f209Smrg    # The more standards-conforming stlport4 library is
3981b534f209Smrg    # incompatible with the Cstd library. Avoid specifying
3982b534f209Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
3983b534f209Smrg    # -library=stlport4 depends on it.
3984b534f209Smrg    case " $CXX $CXXFLAGS " in
3985b534f209Smrg    *" -library=stlport4 "*)
3986b534f209Smrg      solaris_use_stlport4=yes
3987b534f209Smrg      ;;
3988b534f209Smrg    esac
3989b534f209Smrg
3990b534f209Smrg    # Adding this requires a known-good setup of shared libraries for
3991b534f209Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
3992b534f209Smrg    # archive will be linked into the output, leading to subtle bugs.
3993b534f209Smrg    if test "$solaris_use_stlport4" != yes; then
3994b534f209Smrg      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
3995de78e416Smrg    fi
399615fb4814Smrg    ;;
399715fb4814Smrg  esac
3998b534f209Smrg  ;;
3999b534f209Smrgesac
4000b534f209Smrg])
400115fb4814Smrg
4002b534f209Smrgcase " $_LT_AC_TAGVAR(postdeps, $1) " in
4003b534f209Smrg*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
4004b534f209Smrgesac
4005b534f209Smrg])# AC_LIBTOOL_POSTDEP_PREDEP
400615fb4814Smrg
4007b534f209Smrg# AC_LIBTOOL_LANG_F77_CONFIG
4008b534f209Smrg# --------------------------
4009b534f209Smrg# Ensure that the configuration vars for the C compiler are
4010b534f209Smrg# suitably defined.  Those variables are subsequently used by
4011b534f209Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4012b534f209SmrgAC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
4013b534f209SmrgAC_DEFUN([_LT_AC_LANG_F77_CONFIG],
4014b534f209Smrg[AC_REQUIRE([AC_PROG_F77])
4015b534f209SmrgAC_LANG_PUSH(Fortran 77)
401615fb4814Smrg
4017b534f209Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
4018b534f209Smrg_LT_AC_TAGVAR(allow_undefined_flag, $1)=
4019b534f209Smrg_LT_AC_TAGVAR(always_export_symbols, $1)=no
4020b534f209Smrg_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
4021b534f209Smrg_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
4022b534f209Smrg_LT_AC_TAGVAR(hardcode_direct, $1)=no
4023b534f209Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
4024b534f209Smrg_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4025b534f209Smrg_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
4026b534f209Smrg_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
4027b534f209Smrg_LT_AC_TAGVAR(hardcode_automatic, $1)=no
4028b534f209Smrg_LT_AC_TAGVAR(module_cmds, $1)=
4029b534f209Smrg_LT_AC_TAGVAR(module_expsym_cmds, $1)=
4030b534f209Smrg_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
4031b534f209Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
4032b534f209Smrg_LT_AC_TAGVAR(no_undefined_flag, $1)=
4033b534f209Smrg_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
4034b534f209Smrg_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
403515fb4814Smrg
4036b534f209Smrg# Source file extension for f77 test sources.
4037b534f209Smrgac_ext=f
403815fb4814Smrg
4039b534f209Smrg# Object file extension for compiled f77 test sources.
4040b534f209Smrgobjext=o
4041b534f209Smrg_LT_AC_TAGVAR(objext, $1)=$objext
404215fb4814Smrg
4043b534f209Smrg# Code to be used in simple compile tests
4044b534f209Smrglt_simple_compile_test_code="\
4045b534f209Smrg      subroutine t
4046b534f209Smrg      return
4047b534f209Smrg      end
4048b534f209Smrg"
404915fb4814Smrg
4050b534f209Smrg# Code to be used in simple link tests
4051b534f209Smrglt_simple_link_test_code="\
4052b534f209Smrg      program t
4053b534f209Smrg      end
4054b534f209Smrg"
405515fb4814Smrg
4056b534f209Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4057b534f209Smrg_LT_AC_SYS_COMPILER
405815fb4814Smrg
4059b534f209Smrg# save warnings/boilerplate of simple test code
4060b534f209Smrg_LT_COMPILER_BOILERPLATE
4061b534f209Smrg_LT_LINKER_BOILERPLATE
406215fb4814Smrg
4063b534f209Smrg# Allow CC to be a program name with arguments.
4064b534f209Smrglt_save_CC="$CC"
4065b534f209SmrgCC=${F77-"f77"}
4066b534f209Smrgcompiler=$CC
4067b534f209Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4068b534f209Smrg_LT_CC_BASENAME([$compiler])
406915fb4814Smrg
4070b534f209SmrgAC_MSG_CHECKING([if libtool supports shared libraries])
4071b534f209SmrgAC_MSG_RESULT([$can_build_shared])
407215fb4814Smrg
4073b534f209SmrgAC_MSG_CHECKING([whether to build shared libraries])
4074b534f209Smrgtest "$can_build_shared" = "no" && enable_shared=no
407515fb4814Smrg
4076b534f209Smrg# On AIX, shared libraries and static libraries use the same namespace, and
4077b534f209Smrg# are all built from PIC.
4078b534f209Smrgcase $host_os in
4079b534f209Smrgaix3*)
4080b534f209Smrg  test "$enable_shared" = yes && enable_static=no
4081b534f209Smrg  if test -n "$RANLIB"; then
4082b534f209Smrg    archive_cmds="$archive_cmds~\$RANLIB \$lib"
4083b534f209Smrg    postinstall_cmds='$RANLIB $lib'
4084b534f209Smrg  fi
4085b534f209Smrg  ;;
4086b534f209Smrgaix4* | aix5*)
4087b534f209Smrg  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
4088b534f209Smrg    test "$enable_shared" = yes && enable_static=no
4089b534f209Smrg  fi
4090b534f209Smrg  ;;
4091b534f209Smrgesac
4092b534f209SmrgAC_MSG_RESULT([$enable_shared])
409315fb4814Smrg
4094b534f209SmrgAC_MSG_CHECKING([whether to build static libraries])
4095b534f209Smrg# Make sure either enable_shared or enable_static is yes.
4096b534f209Smrgtest "$enable_shared" = yes || enable_static=yes
4097b534f209SmrgAC_MSG_RESULT([$enable_static])
409815fb4814Smrg
4099b534f209Smrg_LT_AC_TAGVAR(GCC, $1)="$G77"
4100b534f209Smrg_LT_AC_TAGVAR(LD, $1)="$LD"
410115fb4814Smrg
4102b534f209SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4103b534f209SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4104b534f209SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4105b534f209SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4106b534f209SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4107b534f209SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
410815fb4814Smrg
4109b534f209SmrgAC_LIBTOOL_CONFIG($1)
411015fb4814Smrg
4111b534f209SmrgAC_LANG_POP
4112b534f209SmrgCC="$lt_save_CC"
4113b534f209Smrg])# AC_LIBTOOL_LANG_F77_CONFIG
411415fb4814Smrg
411515fb4814Smrg
4116b534f209Smrg# AC_LIBTOOL_LANG_GCJ_CONFIG
4117b534f209Smrg# --------------------------
4118b534f209Smrg# Ensure that the configuration vars for the C compiler are
4119b534f209Smrg# suitably defined.  Those variables are subsequently used by
4120b534f209Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4121b534f209SmrgAC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
4122b534f209SmrgAC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
4123b534f209Smrg[AC_LANG_SAVE
412415fb4814Smrg
4125b534f209Smrg# Source file extension for Java test sources.
4126b534f209Smrgac_ext=java
412715fb4814Smrg
4128b534f209Smrg# Object file extension for compiled Java test sources.
4129b534f209Smrgobjext=o
4130b534f209Smrg_LT_AC_TAGVAR(objext, $1)=$objext
413115fb4814Smrg
4132b534f209Smrg# Code to be used in simple compile tests
4133b534f209Smrglt_simple_compile_test_code="class foo {}"
413415fb4814Smrg
4135b534f209Smrg# Code to be used in simple link tests
4136b534f209Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
413715fb4814Smrg
4138b534f209Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4139b534f209Smrg_LT_AC_SYS_COMPILER
414015fb4814Smrg
4141b534f209Smrg# save warnings/boilerplate of simple test code
4142b534f209Smrg_LT_COMPILER_BOILERPLATE
4143b534f209Smrg_LT_LINKER_BOILERPLATE
414415fb4814Smrg
4145b534f209Smrg# Allow CC to be a program name with arguments.
4146b534f209Smrglt_save_CC="$CC"
4147b534f209SmrgCC=${GCJ-"gcj"}
4148b534f209Smrgcompiler=$CC
4149b534f209Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4150b534f209Smrg_LT_CC_BASENAME([$compiler])
415115fb4814Smrg
4152b534f209Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
4153b534f209Smrg_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
415415fb4814Smrg
4155b534f209Smrg_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
415615fb4814Smrg
4157b534f209SmrgAC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
4158b534f209SmrgAC_LIBTOOL_PROG_COMPILER_PIC($1)
4159b534f209SmrgAC_LIBTOOL_PROG_CC_C_O($1)
4160b534f209SmrgAC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
4161b534f209SmrgAC_LIBTOOL_PROG_LD_SHLIBS($1)
4162b534f209SmrgAC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
4163b534f209SmrgAC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
416415fb4814Smrg
4165b534f209SmrgAC_LIBTOOL_CONFIG($1)
416615fb4814Smrg
4167b534f209SmrgAC_LANG_RESTORE
4168b534f209SmrgCC="$lt_save_CC"
4169b534f209Smrg])# AC_LIBTOOL_LANG_GCJ_CONFIG
417015fb4814Smrg
417115fb4814Smrg
4172b534f209Smrg# AC_LIBTOOL_LANG_RC_CONFIG
4173b534f209Smrg# -------------------------
4174b534f209Smrg# Ensure that the configuration vars for the Windows resource compiler are
4175b534f209Smrg# suitably defined.  Those variables are subsequently used by
4176b534f209Smrg# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
4177b534f209SmrgAC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
4178b534f209SmrgAC_DEFUN([_LT_AC_LANG_RC_CONFIG],
4179b534f209Smrg[AC_LANG_SAVE
418015fb4814Smrg
4181b534f209Smrg# Source file extension for RC test sources.
4182b534f209Smrgac_ext=rc
418315fb4814Smrg
4184b534f209Smrg# Object file extension for compiled RC test sources.
4185b534f209Smrgobjext=o
4186b534f209Smrg_LT_AC_TAGVAR(objext, $1)=$objext
418715fb4814Smrg
4188b534f209Smrg# Code to be used in simple compile tests
4189b534f209Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
419015fb4814Smrg
4191b534f209Smrg# Code to be used in simple link tests
4192b534f209Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
419315fb4814Smrg
4194b534f209Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
4195b534f209Smrg_LT_AC_SYS_COMPILER
4196b410ddbeSmrg
4197b534f209Smrg# save warnings/boilerplate of simple test code
4198b534f209Smrg_LT_COMPILER_BOILERPLATE
4199b534f209Smrg_LT_LINKER_BOILERPLATE
420015fb4814Smrg
4201b534f209Smrg# Allow CC to be a program name with arguments.
4202b534f209Smrglt_save_CC="$CC"
4203b534f209SmrgCC=${RC-"windres"}
4204b534f209Smrgcompiler=$CC
4205b534f209Smrg_LT_AC_TAGVAR(compiler, $1)=$CC
4206b534f209Smrg_LT_CC_BASENAME([$compiler])
4207b534f209Smrg_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
420815fb4814Smrg
4209b534f209SmrgAC_LIBTOOL_CONFIG($1)
421015fb4814Smrg
4211b534f209SmrgAC_LANG_RESTORE
4212b534f209SmrgCC="$lt_save_CC"
4213b534f209Smrg])# AC_LIBTOOL_LANG_RC_CONFIG
421415fb4814Smrg
4215b410ddbeSmrg
4216b534f209Smrg# AC_LIBTOOL_CONFIG([TAGNAME])
4217b534f209Smrg# ----------------------------
4218b534f209Smrg# If TAGNAME is not passed, then create an initial libtool script
4219b534f209Smrg# with a default configuration from the untagged config vars.  Otherwise
4220b534f209Smrg# add code to config.status for appending the configuration named by
4221b534f209Smrg# TAGNAME from the matching tagged config vars.
4222b534f209SmrgAC_DEFUN([AC_LIBTOOL_CONFIG],
4223b534f209Smrg[# The else clause should only fire when bootstrapping the
4224b534f209Smrg# libtool distribution, otherwise you forgot to ship ltmain.sh
4225b534f209Smrg# with your package, and you will get complaints that there are
4226b534f209Smrg# no rules to generate ltmain.sh.
4227b534f209Smrgif test -f "$ltmain"; then
4228b534f209Smrg  # See if we are running on zsh, and set the options which allow our commands through
4229b534f209Smrg  # without removal of \ escapes.
4230b534f209Smrg  if test -n "${ZSH_VERSION+set}" ; then
4231b534f209Smrg    setopt NO_GLOB_SUBST
4232b534f209Smrg  fi
4233b534f209Smrg  # Now quote all the things that may contain metacharacters while being
4234b534f209Smrg  # careful not to overquote the AC_SUBSTed values.  We take copies of the
4235b534f209Smrg  # variables and quote the copies for generation of the libtool script.
4236b534f209Smrg  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
4237b534f209Smrg    SED SHELL STRIP \
4238b534f209Smrg    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
4239b534f209Smrg    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
4240b534f209Smrg    deplibs_check_method reload_flag reload_cmds need_locks \
4241b534f209Smrg    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
4242b534f209Smrg    lt_cv_sys_global_symbol_to_c_name_address \
4243b534f209Smrg    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
4244b534f209Smrg    old_postinstall_cmds old_postuninstall_cmds \
4245b534f209Smrg    _LT_AC_TAGVAR(compiler, $1) \
4246b534f209Smrg    _LT_AC_TAGVAR(CC, $1) \
4247b534f209Smrg    _LT_AC_TAGVAR(LD, $1) \
4248b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
4249b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
4250b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
4251b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
4252b534f209Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
4253b534f209Smrg    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
4254b534f209Smrg    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
4255b534f209Smrg    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
4256b534f209Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) \
4257b534f209Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
4258b534f209Smrg    _LT_AC_TAGVAR(predep_objects, $1) \
4259b534f209Smrg    _LT_AC_TAGVAR(postdep_objects, $1) \
4260b534f209Smrg    _LT_AC_TAGVAR(predeps, $1) \
4261b534f209Smrg    _LT_AC_TAGVAR(postdeps, $1) \
4262b534f209Smrg    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
4263b534f209Smrg    _LT_AC_TAGVAR(archive_cmds, $1) \
4264b534f209Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
4265b534f209Smrg    _LT_AC_TAGVAR(postinstall_cmds, $1) \
4266b534f209Smrg    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
4267b534f209Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
4268b534f209Smrg    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
4269b534f209Smrg    _LT_AC_TAGVAR(no_undefined_flag, $1) \
4270b534f209Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
4271b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
4272b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
4273b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
4274b534f209Smrg    _LT_AC_TAGVAR(hardcode_automatic, $1) \
4275b534f209Smrg    _LT_AC_TAGVAR(module_cmds, $1) \
4276b534f209Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
4277b534f209Smrg    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
4278b534f209Smrg    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
4279b534f209Smrg    _LT_AC_TAGVAR(exclude_expsyms, $1) \
4280b534f209Smrg    _LT_AC_TAGVAR(include_expsyms, $1); do
4281b534f209Smrg
4282b534f209Smrg    case $var in
4283b534f209Smrg    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
4284b534f209Smrg    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
4285b534f209Smrg    _LT_AC_TAGVAR(archive_cmds, $1) | \
4286b534f209Smrg    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
4287b534f209Smrg    _LT_AC_TAGVAR(module_cmds, $1) | \
4288b534f209Smrg    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
4289b534f209Smrg    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
4290b534f209Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
4291b534f209Smrg    extract_expsyms_cmds | reload_cmds | finish_cmds | \
4292b534f209Smrg    postinstall_cmds | postuninstall_cmds | \
4293b534f209Smrg    old_postinstall_cmds | old_postuninstall_cmds | \
4294b534f209Smrg    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
4295b534f209Smrg      # Double-quote double-evaled strings.
4296b534f209Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
429715fb4814Smrg      ;;
4298b534f209Smrg    *)
4299b534f209Smrg      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
4300b410ddbeSmrg      ;;
4301b534f209Smrg    esac
4302b534f209Smrg  done
430315fb4814Smrg
4304b534f209Smrg  case $lt_echo in
4305b534f209Smrg  *'\[$]0 --fallback-echo"')
4306b534f209Smrg    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
4307b534f209Smrg    ;;
4308b534f209Smrg  esac
430915fb4814Smrg
4310b534f209Smrgifelse([$1], [],
4311b534f209Smrg  [cfgfile="${ofile}T"
4312b534f209Smrg  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
4313b534f209Smrg  $rm -f "$cfgfile"
4314b534f209Smrg  AC_MSG_NOTICE([creating $ofile])],
4315b534f209Smrg  [cfgfile="$ofile"])
431615fb4814Smrg
4317b534f209Smrg  cat <<__EOF__ >> "$cfgfile"
4318b534f209Smrgifelse([$1], [],
4319b534f209Smrg[#! $SHELL
432015fb4814Smrg
4321b534f209Smrg# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
4322b534f209Smrg# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
4323b534f209Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
4324b534f209Smrg#
4325b534f209Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
4326b534f209Smrg# Free Software Foundation, Inc.
4327b534f209Smrg#
4328b534f209Smrg# This file is part of GNU Libtool:
4329b534f209Smrg# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4330b534f209Smrg#
4331b534f209Smrg# This program is free software; you can redistribute it and/or modify
4332b534f209Smrg# it under the terms of the GNU General Public License as published by
4333b534f209Smrg# the Free Software Foundation; either version 2 of the License, or
4334b534f209Smrg# (at your option) any later version.
4335b534f209Smrg#
4336b534f209Smrg# This program is distributed in the hope that it will be useful, but
4337b534f209Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
4338b534f209Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4339b534f209Smrg# General Public License for more details.
4340b534f209Smrg#
4341b534f209Smrg# You should have received a copy of the GNU General Public License
4342b534f209Smrg# along with this program; if not, write to the Free Software
4343b534f209Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4344b534f209Smrg#
4345b534f209Smrg# As a special exception to the GNU General Public License, if you
4346b534f209Smrg# distribute this file as part of a program that contains a
4347b534f209Smrg# configuration script generated by Autoconf, you may include it under
4348b534f209Smrg# the same distribution terms that you use for the rest of that program.
434915fb4814Smrg
4350b534f209Smrg# A sed program that does not truncate output.
4351b534f209SmrgSED=$lt_SED
435215fb4814Smrg
4353b534f209Smrg# Sed that helps us avoid accidentally triggering echo(1) options like -n.
4354b534f209SmrgXsed="$SED -e 1s/^X//"
435515fb4814Smrg
4356b534f209Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
4357b534f209Smrg# if CDPATH is set.
4358b534f209Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
435915fb4814Smrg
4360b534f209Smrg# The names of the tagged configurations supported by this script.
4361b534f209Smrgavailable_tags=
436215fb4814Smrg
4363b534f209Smrg# ### BEGIN LIBTOOL CONFIG],
4364b534f209Smrg[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
436515fb4814Smrg
4366b534f209Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
436715fb4814Smrg
4368b534f209Smrg# Shell to use when invoking shell scripts.
4369b534f209SmrgSHELL=$lt_SHELL
437015fb4814Smrg
4371b534f209Smrg# Whether or not to build shared libraries.
4372b534f209Smrgbuild_libtool_libs=$enable_shared
437315fb4814Smrg
4374b534f209Smrg# Whether or not to build static libraries.
4375b534f209Smrgbuild_old_libs=$enable_static
437615fb4814Smrg
4377b534f209Smrg# Whether or not to add -lc for building shared libraries.
4378b534f209Smrgbuild_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
437915fb4814Smrg
4380b534f209Smrg# Whether or not to disallow shared libs when runtime libs are static
4381b534f209Smrgallow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
438215fb4814Smrg
4383b534f209Smrg# Whether or not to optimize for fast installation.
4384b534f209Smrgfast_install=$enable_fast_install
438515fb4814Smrg
4386b534f209Smrg# The host system.
4387b534f209Smrghost_alias=$host_alias
4388b534f209Smrghost=$host
4389b534f209Smrghost_os=$host_os
439015fb4814Smrg
4391b534f209Smrg# The build system.
4392b534f209Smrgbuild_alias=$build_alias
4393b534f209Smrgbuild=$build
4394b534f209Smrgbuild_os=$build_os
439515fb4814Smrg
4396b534f209Smrg# An echo program that does not interpret backslashes.
4397b534f209Smrgecho=$lt_echo
439815fb4814Smrg
4399b534f209Smrg# The archiver.
4400b534f209SmrgAR=$lt_AR
4401b534f209SmrgAR_FLAGS=$lt_AR_FLAGS
440215fb4814Smrg
4403b534f209Smrg# A C compiler.
4404b534f209SmrgLTCC=$lt_LTCC
440515fb4814Smrg
4406b534f209Smrg# LTCC compiler flags.
4407b534f209SmrgLTCFLAGS=$lt_LTCFLAGS
440815fb4814Smrg
4409b534f209Smrg# A language-specific compiler.
4410b534f209SmrgCC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
441115fb4814Smrg
4412b534f209Smrg# Is the compiler the GNU C compiler?
4413b534f209Smrgwith_gcc=$_LT_AC_TAGVAR(GCC, $1)
441415fb4814Smrg
4415b534f209Smrg# An ERE matcher.
4416b534f209SmrgEGREP=$lt_EGREP
441715fb4814Smrg
4418b534f209Smrg# The linker used to build libraries.
4419b534f209SmrgLD=$lt_[]_LT_AC_TAGVAR(LD, $1)
442015fb4814Smrg
4421b534f209Smrg# Whether we need hard or soft links.
4422b534f209SmrgLN_S=$lt_LN_S
442315fb4814Smrg
4424b534f209Smrg# A BSD-compatible nm program.
4425b534f209SmrgNM=$lt_NM
442615fb4814Smrg
4427b534f209Smrg# A symbol stripping program
4428b534f209SmrgSTRIP=$lt_STRIP
442915fb4814Smrg
4430b534f209Smrg# Used to examine libraries when file_magic_cmd begins "file"
4431b534f209SmrgMAGIC_CMD=$MAGIC_CMD
443215fb4814Smrg
4433b534f209Smrg# Used on cygwin: DLL creation program.
4434b534f209SmrgDLLTOOL="$DLLTOOL"
443515fb4814Smrg
4436b534f209Smrg# Used on cygwin: object dumper.
4437b534f209SmrgOBJDUMP="$OBJDUMP"
443815fb4814Smrg
4439b534f209Smrg# Used on cygwin: assembler.
4440b534f209SmrgAS="$AS"
444115fb4814Smrg
4442b534f209Smrg# The name of the directory that contains temporary libtool files.
4443b534f209Smrgobjdir=$objdir
444415fb4814Smrg
4445b534f209Smrg# How to create reloadable object files.
4446b534f209Smrgreload_flag=$lt_reload_flag
4447b534f209Smrgreload_cmds=$lt_reload_cmds
444815fb4814Smrg
4449b534f209Smrg# How to pass a linker flag through the compiler.
4450b534f209Smrgwl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
445115fb4814Smrg
4452b534f209Smrg# Object file suffix (normally "o").
4453b534f209Smrgobjext="$ac_objext"
445415fb4814Smrg
4455b534f209Smrg# Old archive suffix (normally "a").
4456b534f209Smrglibext="$libext"
445715fb4814Smrg
4458b534f209Smrg# Shared library suffix (normally ".so").
4459b534f209Smrgshrext_cmds='$shrext_cmds'
446015fb4814Smrg
4461b534f209Smrg# Executable file suffix (normally "").
4462b534f209Smrgexeext="$exeext"
446315fb4814Smrg
4464b534f209Smrg# Additional compiler flags for building library objects.
4465b534f209Smrgpic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
4466b534f209Smrgpic_mode=$pic_mode
446715fb4814Smrg
4468b534f209Smrg# What is the maximum length of a command?
4469b534f209Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
447015fb4814Smrg
4471b534f209Smrg# Does compiler simultaneously support -c and -o options?
4472b534f209Smrgcompiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
447315fb4814Smrg
4474b534f209Smrg# Must we lock files when doing compilation?
4475b534f209Smrgneed_locks=$lt_need_locks
447615fb4814Smrg
4477b534f209Smrg# Do we need the lib prefix for modules?
4478b534f209Smrgneed_lib_prefix=$need_lib_prefix
447915fb4814Smrg
4480b534f209Smrg# Do we need a version for libraries?
4481b534f209Smrgneed_version=$need_version
448215fb4814Smrg
4483b534f209Smrg# Whether dlopen is supported.
4484b534f209Smrgdlopen_support=$enable_dlopen
448515fb4814Smrg
4486b534f209Smrg# Whether dlopen of programs is supported.
4487b534f209Smrgdlopen_self=$enable_dlopen_self
448815fb4814Smrg
4489b534f209Smrg# Whether dlopen of statically linked programs is supported.
4490b534f209Smrgdlopen_self_static=$enable_dlopen_self_static
449115fb4814Smrg
4492b534f209Smrg# Compiler flag to prevent dynamic linking.
4493b534f209Smrglink_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
449415fb4814Smrg
4495b534f209Smrg# Compiler flag to turn off builtin functions.
4496b534f209Smrgno_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
449715fb4814Smrg
4498b534f209Smrg# Compiler flag to allow reflexive dlopens.
4499b534f209Smrgexport_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
450015fb4814Smrg
4501b534f209Smrg# Compiler flag to generate shared objects directly from archives.
4502b534f209Smrgwhole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
450315fb4814Smrg
4504b534f209Smrg# Compiler flag to generate thread-safe objects.
4505b534f209Smrgthread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
450615fb4814Smrg
4507b534f209Smrg# Library versioning type.
4508b534f209Smrgversion_type=$version_type
450915fb4814Smrg
4510b534f209Smrg# Format of library name prefix.
4511b534f209Smrglibname_spec=$lt_libname_spec
451215fb4814Smrg
4513b534f209Smrg# List of archive names.  First name is the real one, the rest are links.
4514b534f209Smrg# The last name is the one that the linker finds with -lNAME.
4515b534f209Smrglibrary_names_spec=$lt_library_names_spec
451615fb4814Smrg
4517b534f209Smrg# The coded name of the library, if different from the real name.
4518b534f209Smrgsoname_spec=$lt_soname_spec
451983cab373Smrg
4520b534f209Smrg# Commands used to build and install an old-style archive.
4521b534f209SmrgRANLIB=$lt_RANLIB
4522b534f209Smrgold_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
4523b534f209Smrgold_postinstall_cmds=$lt_old_postinstall_cmds
4524b534f209Smrgold_postuninstall_cmds=$lt_old_postuninstall_cmds
452515fb4814Smrg
4526b534f209Smrg# Create an old-style archive from a shared archive.
4527b534f209Smrgold_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
452815fb4814Smrg
4529b534f209Smrg# Create a temporary old-style archive to link instead of a shared archive.
4530b534f209Smrgold_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
453115fb4814Smrg
4532b534f209Smrg# Commands used to build and install a shared archive.
4533b534f209Smrgarchive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
4534b534f209Smrgarchive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
4535b534f209Smrgpostinstall_cmds=$lt_postinstall_cmds
4536b534f209Smrgpostuninstall_cmds=$lt_postuninstall_cmds
453715fb4814Smrg
4538b534f209Smrg# Commands used to build a loadable module (assumed same as above if empty)
4539b534f209Smrgmodule_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
4540b534f209Smrgmodule_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
4541b410ddbeSmrg
4542b534f209Smrg# Commands to strip libraries.
4543b534f209Smrgold_striplib=$lt_old_striplib
4544b534f209Smrgstriplib=$lt_striplib
454515fb4814Smrg
4546b534f209Smrg# Dependencies to place before the objects being linked to create a
4547b534f209Smrg# shared library.
4548b534f209Smrgpredep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
454915fb4814Smrg
4550b534f209Smrg# Dependencies to place after the objects being linked to create a
4551b534f209Smrg# shared library.
4552b534f209Smrgpostdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
455315fb4814Smrg
4554b534f209Smrg# Dependencies to place before the objects being linked to create a
4555b534f209Smrg# shared library.
4556b534f209Smrgpredeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
455715fb4814Smrg
4558b534f209Smrg# Dependencies to place after the objects being linked to create a
4559b534f209Smrg# shared library.
4560b534f209Smrgpostdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
456115fb4814Smrg
4562b534f209Smrg# The library search path used internally by the compiler when linking
4563b534f209Smrg# a shared library.
4564b534f209Smrgcompiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
456515fb4814Smrg
4566b534f209Smrg# Method to check whether dependent libraries are shared objects.
4567b534f209Smrgdeplibs_check_method=$lt_deplibs_check_method
456815fb4814Smrg
4569b534f209Smrg# Command to use when deplibs_check_method == file_magic.
4570b534f209Smrgfile_magic_cmd=$lt_file_magic_cmd
457115fb4814Smrg
4572b534f209Smrg# Flag that allows shared libraries with undefined symbols to be built.
4573b534f209Smrgallow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
457415fb4814Smrg
4575b534f209Smrg# Flag that forces no undefined symbols.
4576b534f209Smrgno_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
457715fb4814Smrg
4578b534f209Smrg# Commands used to finish a libtool library installation in a directory.
4579b534f209Smrgfinish_cmds=$lt_finish_cmds
458015fb4814Smrg
4581b534f209Smrg# Same as above, but a single script fragment to be evaled but not shown.
4582b534f209Smrgfinish_eval=$lt_finish_eval
458315fb4814Smrg
4584b534f209Smrg# Take the output of nm and produce a listing of raw symbols and C names.
4585b534f209Smrgglobal_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
458615fb4814Smrg
4587b534f209Smrg# Transform the output of nm in a proper C declaration
4588b534f209Smrgglobal_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
458915fb4814Smrg
4590b534f209Smrg# Transform the output of nm in a C name address pair
4591b534f209Smrgglobal_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
459215fb4814Smrg
4593b534f209Smrg# This is the shared library runtime path variable.
4594b534f209Smrgrunpath_var=$runpath_var
459515fb4814Smrg
4596b534f209Smrg# This is the shared library path variable.
4597b534f209Smrgshlibpath_var=$shlibpath_var
459815fb4814Smrg
4599b534f209Smrg# Is shlibpath searched before the hard-coded library search path?
4600b534f209Smrgshlibpath_overrides_runpath=$shlibpath_overrides_runpath
460115fb4814Smrg
4602b534f209Smrg# How to hardcode a shared library path into an executable.
4603b534f209Smrghardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
460415fb4814Smrg
4605b534f209Smrg# Whether we should hardcode library paths into libraries.
4606b534f209Smrghardcode_into_libs=$hardcode_into_libs
460715fb4814Smrg
4608b534f209Smrg# Flag to hardcode \$libdir into a binary during linking.
4609b534f209Smrg# This must work even if \$libdir does not exist.
4610b534f209Smrghardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
461115fb4814Smrg
4612b534f209Smrg# If ld is used when linking, flag to hardcode \$libdir into
4613b534f209Smrg# a binary during linking. This must work even if \$libdir does
4614b534f209Smrg# not exist.
4615b534f209Smrghardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
461615fb4814Smrg
4617b534f209Smrg# Whether we need a single -rpath flag with a separated argument.
4618b534f209Smrghardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
461915fb4814Smrg
4620b534f209Smrg# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
4621b534f209Smrg# resulting binary.
4622b534f209Smrghardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
462315fb4814Smrg
4624b534f209Smrg# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
4625b534f209Smrg# resulting binary.
4626b534f209Smrghardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
462715fb4814Smrg
4628b534f209Smrg# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
4629b534f209Smrg# the resulting binary.
4630b534f209Smrghardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
463115fb4814Smrg
4632b534f209Smrg# Set to yes if building a shared library automatically hardcodes DIR into the library
4633b534f209Smrg# and all subsequent libraries and executables linked against it.
4634b534f209Smrghardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
463515fb4814Smrg
4636b534f209Smrg# Variables whose values should be saved in libtool wrapper scripts and
4637b534f209Smrg# restored at relink time.
4638b534f209Smrgvariables_saved_for_relink="$variables_saved_for_relink"
463915fb4814Smrg
4640b534f209Smrg# Whether libtool must link a program against all its dependency libraries.
4641b534f209Smrglink_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
464215fb4814Smrg
4643b534f209Smrg# Compile-time system search path for libraries
4644b534f209Smrgsys_lib_search_path_spec=$lt_sys_lib_search_path_spec
464515fb4814Smrg
4646b534f209Smrg# Run-time system search path for libraries
4647b534f209Smrgsys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
464815fb4814Smrg
4649b534f209Smrg# Fix the shell variable \$srcfile for the compiler.
4650b534f209Smrgfix_srcfile_path=$lt_fix_srcfile_path
465115fb4814Smrg
4652b534f209Smrg# Set to yes if exported symbols are required.
4653b534f209Smrgalways_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
465415fb4814Smrg
4655b534f209Smrg# The commands to list exported symbols.
4656b534f209Smrgexport_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
465715fb4814Smrg
4658b534f209Smrg# The commands to extract the exported symbol list from a shared archive.
4659b534f209Smrgextract_expsyms_cmds=$lt_extract_expsyms_cmds
466015fb4814Smrg
4661b534f209Smrg# Symbols that should not be listed in the preloaded symbols.
4662b534f209Smrgexclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
466315fb4814Smrg
4664b534f209Smrg# Symbols that must always be exported.
4665b534f209Smrginclude_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
466615fb4814Smrg
4667b534f209Smrgifelse([$1],[],
4668b534f209Smrg[# ### END LIBTOOL CONFIG],
4669b534f209Smrg[# ### END LIBTOOL TAG CONFIG: $tagname])
467015fb4814Smrg
4671b534f209Smrg__EOF__
467215fb4814Smrg
4673b534f209Smrgifelse([$1],[], [
4674b534f209Smrg  case $host_os in
4675b534f209Smrg  aix3*)
4676b534f209Smrg    cat <<\EOF >> "$cfgfile"
467715fb4814Smrg
4678b534f209Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
4679b534f209Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
4680b534f209Smrg# vanish in a puff of smoke.
4681b534f209Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
4682b534f209Smrg  COLLECT_NAMES=
4683b534f209Smrg  export COLLECT_NAMES
4684b534f209Smrgfi
4685b534f209SmrgEOF
4686b534f209Smrg    ;;
4687b534f209Smrg  esac
468815fb4814Smrg
4689b534f209Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
4690b534f209Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
4691b534f209Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
4692b534f209Smrg  # is reportedly fixed, but why not run on old versions too?
4693b534f209Smrg  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
469415fb4814Smrg
4695b534f209Smrg  mv -f "$cfgfile" "$ofile" || \
4696b534f209Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
4697b534f209Smrg  chmod +x "$ofile"
4698b534f209Smrg])
4699b410ddbeSmrgelse
4700b534f209Smrg  # If there is no Makefile yet, we rely on a make rule to execute
4701b534f209Smrg  # `config.status --recheck' to rerun these tests and create the
4702b534f209Smrg  # libtool script then.
4703b534f209Smrg  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
4704b534f209Smrg  if test -f "$ltmain_in"; then
4705b534f209Smrg    test -f Makefile && make "$ltmain"
4706b534f209Smrg  fi
4707b410ddbeSmrgfi
4708b534f209Smrg])# AC_LIBTOOL_CONFIG
470915fb4814Smrg
4710b410ddbeSmrg
4711b534f209Smrg# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
4712b534f209Smrg# -------------------------------------------
4713b534f209SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
4714b534f209Smrg[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
4715b410ddbeSmrg
4716b534f209Smrg_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
471715fb4814Smrg
4718b534f209Smrgif test "$GCC" = yes; then
4719b534f209Smrg  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
472015fb4814Smrg
4721b534f209Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
4722b534f209Smrg    lt_cv_prog_compiler_rtti_exceptions,
4723b534f209Smrg    [-fno-rtti -fno-exceptions], [],
4724b534f209Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
4725b410ddbeSmrgfi
4726b534f209Smrg])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
472715fb4814Smrg
472815fb4814Smrg
4729b534f209Smrg# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
4730b534f209Smrg# ---------------------------------
4731b534f209SmrgAC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
4732b534f209Smrg[AC_REQUIRE([AC_CANONICAL_HOST])
4733b534f209SmrgAC_REQUIRE([LT_AC_PROG_SED])
4734b534f209SmrgAC_REQUIRE([AC_PROG_NM])
4735b534f209SmrgAC_REQUIRE([AC_OBJEXT])
4736b534f209Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
4737b534f209SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
4738b534f209SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
4739b534f209Smrg[
4740b534f209Smrg# These are sane defaults that work on at least a few old systems.
4741b534f209Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
474215fb4814Smrg
4743b534f209Smrg# Character class describing NM global symbol codes.
4744b534f209Smrgsymcode='[[BCDEGRST]]'
474515fb4814Smrg
4746b534f209Smrg# Regexp to match symbols that can be accessed directly from C.
4747b534f209Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
474815fb4814Smrg
4749b534f209Smrg# Transform an extracted symbol line into a proper C declaration
4750b534f209Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
475115fb4814Smrg
4752b534f209Smrg# Transform an extracted symbol line into symbol name and symbol address
4753b534f209Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
475415fb4814Smrg
4755b534f209Smrg# Define system-specific variables.
4756b534f209Smrgcase $host_os in
4757b534f209Smrgaix*)
4758b534f209Smrg  symcode='[[BCDT]]'
4759b534f209Smrg  ;;
4760b534f209Smrgcygwin* | mingw* | pw32*)
4761b534f209Smrg  symcode='[[ABCDGISTW]]'
4762b534f209Smrg  ;;
4763b534f209Smrghpux*) # Its linker distinguishes data from code symbols
4764b534f209Smrg  if test "$host_cpu" = ia64; then
4765b534f209Smrg    symcode='[[ABCDEGRST]]'
4766b534f209Smrg  fi
4767b534f209Smrg  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4768b534f209Smrg  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
4769b534f209Smrg  ;;
4770b534f209Smrglinux* | k*bsd*-gnu)
4771b534f209Smrg  if test "$host_cpu" = ia64; then
4772b534f209Smrg    symcode='[[ABCDGIRSTW]]'
4773b534f209Smrg    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
4774b534f209Smrg    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
4775b534f209Smrg  fi
4776b534f209Smrg  ;;
4777b534f209Smrgirix* | nonstopux*)
4778b534f209Smrg  symcode='[[BCDEGRST]]'
4779b534f209Smrg  ;;
4780b534f209Smrgosf*)
4781b534f209Smrg  symcode='[[BCDEGQRST]]'
4782b534f209Smrg  ;;
4783b534f209Smrgsolaris*)
4784b534f209Smrg  symcode='[[BDRT]]'
4785b534f209Smrg  ;;
4786b534f209Smrgsco3.2v5*)
4787b534f209Smrg  symcode='[[DT]]'
4788b534f209Smrg  ;;
4789b534f209Smrgsysv4.2uw2*)
4790b534f209Smrg  symcode='[[DT]]'
4791b534f209Smrg  ;;
4792b534f209Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
4793b534f209Smrg  symcode='[[ABDT]]'
4794b534f209Smrg  ;;
4795b534f209Smrgsysv4)
4796b534f209Smrg  symcode='[[DFNSTU]]'
4797b534f209Smrg  ;;
4798b534f209Smrgesac
479915fb4814Smrg
4800b534f209Smrg# Handle CRLF in mingw tool chain
4801b534f209Smrgopt_cr=
4802b534f209Smrgcase $build_os in
4803b534f209Smrgmingw*)
4804b534f209Smrg  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4805b534f209Smrg  ;;
4806b534f209Smrgesac
480715fb4814Smrg
4808b534f209Smrg# If we're using GNU nm, then use its standard symbol codes.
4809b534f209Smrgcase `$NM -V 2>&1` in
4810b534f209Smrg*GNU* | *'with BFD'*)
4811b534f209Smrg  symcode='[[ABCDGIRSTW]]' ;;
4812b534f209Smrgesac
481315fb4814Smrg
4814b534f209Smrg# Try without a prefix undercore, then with it.
4815b534f209Smrgfor ac_symprfx in "" "_"; do
4816b410ddbeSmrg
4817b534f209Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4818b534f209Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
481915fb4814Smrg
4820b534f209Smrg  # Write the raw and C identifiers.
4821b534f209Smrg  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4822b410ddbeSmrg
4823b534f209Smrg  # Check to see that the pipe works correctly.
4824b534f209Smrg  pipe_works=no
4825b410ddbeSmrg
4826b534f209Smrg  rm -f conftest*
4827b534f209Smrg  cat > conftest.$ac_ext <<EOF
4828b534f209Smrg#ifdef __cplusplus
4829b534f209Smrgextern "C" {
4830b534f209Smrg#endif
4831b534f209Smrgchar nm_test_var;
4832b534f209Smrgvoid nm_test_func(){}
4833b534f209Smrg#ifdef __cplusplus
4834b534f209Smrg}
4835b534f209Smrg#endif
4836b534f209Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
4837b534f209SmrgEOF
483815fb4814Smrg
4839b534f209Smrg  if AC_TRY_EVAL(ac_compile); then
4840b534f209Smrg    # Now try to grab the symbols.
4841b534f209Smrg    nlist=conftest.nm
4842b534f209Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
4843b534f209Smrg      # Try sorting and uniquifying the output.
4844b534f209Smrg      if sort "$nlist" | uniq > "$nlist"T; then
4845b534f209Smrg	mv -f "$nlist"T "$nlist"
4846b534f209Smrg      else
4847b534f209Smrg	rm -f "$nlist"T
4848b534f209Smrg      fi
484915fb4814Smrg
4850b534f209Smrg      # Make sure that we snagged all the symbols we need.
4851b534f209Smrg      if grep ' nm_test_var$' "$nlist" >/dev/null; then
4852b534f209Smrg	if grep ' nm_test_func$' "$nlist" >/dev/null; then
4853b534f209Smrg	  cat <<EOF > conftest.$ac_ext
4854b534f209Smrg#ifdef __cplusplus
4855b534f209Smrgextern "C" {
4856b534f209Smrg#endif
485715fb4814Smrg
4858b534f209SmrgEOF
4859b534f209Smrg	  # Now generate the symbol file.
4860b534f209Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
4861b410ddbeSmrg
4862b534f209Smrg	  cat <<EOF >> conftest.$ac_ext
4863b534f209Smrg#if defined (__STDC__) && __STDC__
4864b534f209Smrg# define lt_ptr_t void *
4865b534f209Smrg#else
4866b534f209Smrg# define lt_ptr_t char *
4867b534f209Smrg# define const
4868b534f209Smrg#endif
4869b410ddbeSmrg
4870b534f209Smrg/* The mapping between symbol names and symbols. */
4871b534f209Smrgconst struct {
4872b534f209Smrg  const char *name;
4873b534f209Smrg  lt_ptr_t address;
4874b534f209Smrg}
4875b534f209Smrglt_preloaded_symbols[[]] =
4876b534f209Smrg{
4877b534f209SmrgEOF
4878b534f209Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
4879b534f209Smrg	  cat <<\EOF >> conftest.$ac_ext
4880b534f209Smrg  {0, (lt_ptr_t) 0}
4881b534f209Smrg};
4882b410ddbeSmrg
4883b534f209Smrg#ifdef __cplusplus
4884b534f209Smrg}
4885b534f209Smrg#endif
4886b534f209SmrgEOF
4887b534f209Smrg	  # Now try linking the two files.
4888b534f209Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4889b534f209Smrg	  lt_save_LIBS="$LIBS"
4890b534f209Smrg	  lt_save_CFLAGS="$CFLAGS"
4891b534f209Smrg	  LIBS="conftstm.$ac_objext"
4892b534f209Smrg	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4893b534f209Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
4894b534f209Smrg	    pipe_works=yes
4895b534f209Smrg	  fi
4896b534f209Smrg	  LIBS="$lt_save_LIBS"
4897b534f209Smrg	  CFLAGS="$lt_save_CFLAGS"
4898b534f209Smrg	else
4899b534f209Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4900b534f209Smrg	fi
4901b534f209Smrg      else
4902b534f209Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4903b534f209Smrg      fi
4904b534f209Smrg    else
4905b534f209Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4906b534f209Smrg    fi
4907b534f209Smrg  else
4908b534f209Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4909b534f209Smrg    cat conftest.$ac_ext >&5
4910b534f209Smrg  fi
4911b534f209Smrg  rm -f conftest* conftst*
4912b410ddbeSmrg
4913b534f209Smrg  # Do not use the global_symbol_pipe unless it works.
4914b534f209Smrg  if test "$pipe_works" = yes; then
4915b534f209Smrg    break
4916b534f209Smrg  else
4917b534f209Smrg    lt_cv_sys_global_symbol_pipe=
4918b534f209Smrg  fi
4919b534f209Smrgdone
4920b534f209Smrg])
4921b534f209Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4922b534f209Smrg  lt_cv_sys_global_symbol_to_cdecl=
4923b534f209Smrgfi
4924b534f209Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4925b534f209Smrg  AC_MSG_RESULT(failed)
4926b534f209Smrgelse
4927b534f209Smrg  AC_MSG_RESULT(ok)
4928b534f209Smrgfi
4929b534f209Smrg]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
493015fb4814Smrg
4931b410ddbeSmrg
4932b534f209Smrg# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
4933b534f209Smrg# ---------------------------------------
4934b534f209SmrgAC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
4935b534f209Smrg[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
4936b534f209Smrg_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4937b534f209Smrg_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
4938b410ddbeSmrg
4939b534f209SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
4940b534f209Smrg ifelse([$1],[CXX],[
4941b534f209Smrg  # C++ specific cases for pic, static, wl, etc.
4942b534f209Smrg  if test "$GXX" = yes; then
4943b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4944b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
4945b410ddbeSmrg
494615fb4814Smrg    case $host_os in
4947b534f209Smrg    aix*)
4948b534f209Smrg      # All AIX code is PIC.
4949b534f209Smrg      if test "$host_cpu" = ia64; then
4950b534f209Smrg	# AIX 5 now supports IA64 processor
4951b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4952b534f209Smrg      fi
4953b534f209Smrg      ;;
4954b534f209Smrg    amigaos*)
4955b534f209Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
4956b534f209Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
4957b534f209Smrg      # like `-m68040'.
4958b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4959b534f209Smrg      ;;
4960b534f209Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4961b534f209Smrg      # PIC is the default for these OSes.
4962b534f209Smrg      ;;
4963b534f209Smrg    mingw* | cygwin* | os2* | pw32*)
4964b534f209Smrg      # This hack is so that the source file can tell whether it is being
4965b534f209Smrg      # built for inclusion in a dll (and should export symbols for example).
4966b534f209Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4967b534f209Smrg      # (--disable-auto-import) libraries
4968b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
4969b534f209Smrg      ;;
4970b534f209Smrg    darwin* | rhapsody*)
4971b534f209Smrg      # PIC is the default on this platform
4972b534f209Smrg      # Common symbols not allowed in MH_DYLIB files
4973b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4974b534f209Smrg      ;;
4975b534f209Smrg    *djgpp*)
4976b534f209Smrg      # DJGPP does not support shared libraries at all
4977b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
4978b534f209Smrg      ;;
4979b534f209Smrg    interix[[3-9]]*)
4980b534f209Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4981b534f209Smrg      # Instead, we relocate shared libraries at runtime.
4982b534f209Smrg      ;;
4983b534f209Smrg    sysv4*MP*)
4984b534f209Smrg      if test -d /usr/nec; then
4985b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4986b534f209Smrg      fi
4987b534f209Smrg      ;;
4988b534f209Smrg    hpux*)
4989b534f209Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4990b534f209Smrg      # not for PA HP-UX.
4991b534f209Smrg      case $host_cpu in
4992b534f209Smrg      hppa*64*|ia64*)
4993b534f209Smrg	;;
4994b534f209Smrg      *)
4995b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4996b534f209Smrg	;;
4997b534f209Smrg      esac
4998b534f209Smrg      ;;
4999b534f209Smrg    *)
5000b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5001b534f209Smrg      ;;
5002b534f209Smrg    esac
5003b534f209Smrg  else
5004b534f209Smrg    case $host_os in
5005b534f209Smrg      aix4* | aix5*)
5006b534f209Smrg	# All AIX code is PIC.
5007b534f209Smrg	if test "$host_cpu" = ia64; then
5008b534f209Smrg	  # AIX 5 now supports IA64 processor
5009b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5010b534f209Smrg	else
5011b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5012b534f209Smrg	fi
5013b534f209Smrg	;;
5014b534f209Smrg      chorus*)
5015b534f209Smrg	case $cc_basename in
5016b534f209Smrg	cxch68*)
5017b534f209Smrg	  # Green Hills C++ Compiler
5018b534f209Smrg	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
5019b534f209Smrg	  ;;
5020b534f209Smrg	esac
5021b534f209Smrg	;;
5022b534f209Smrg       darwin*)
5023b534f209Smrg         # PIC is the default on this platform
5024b534f209Smrg         # Common symbols not allowed in MH_DYLIB files
5025b534f209Smrg         case $cc_basename in
5026b534f209Smrg           xlc*)
5027b534f209Smrg           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5028b534f209Smrg           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5029b534f209Smrg           ;;
5030b534f209Smrg         esac
5031b534f209Smrg       ;;
5032b534f209Smrg      dgux*)
5033b534f209Smrg	case $cc_basename in
5034b534f209Smrg	  ec++*)
5035b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5036b534f209Smrg	    ;;
5037b534f209Smrg	  ghcx*)
5038b534f209Smrg	    # Green Hills C++ Compiler
5039b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5040b534f209Smrg	    ;;
5041b534f209Smrg	  *)
5042b534f209Smrg	    ;;
5043b534f209Smrg	esac
5044b534f209Smrg	;;
5045b534f209Smrg      freebsd* | dragonfly*)
5046b534f209Smrg	# FreeBSD uses GNU C++
5047b534f209Smrg	;;
5048b534f209Smrg      hpux9* | hpux10* | hpux11*)
5049b534f209Smrg	case $cc_basename in
5050b534f209Smrg	  CC*)
5051b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5052b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5053b534f209Smrg	    if test "$host_cpu" != ia64; then
5054b534f209Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5055b534f209Smrg	    fi
5056b534f209Smrg	    ;;
5057b534f209Smrg	  aCC*)
5058b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5059b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5060b534f209Smrg	    case $host_cpu in
5061b534f209Smrg	    hppa*64*|ia64*)
5062b534f209Smrg	      # +Z the default
5063b534f209Smrg	      ;;
5064b534f209Smrg	    *)
5065b534f209Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5066b534f209Smrg	      ;;
5067b534f209Smrg	    esac
5068b534f209Smrg	    ;;
5069b534f209Smrg	  *)
5070b534f209Smrg	    ;;
5071b534f209Smrg	esac
5072b534f209Smrg	;;
5073b534f209Smrg      interix*)
5074b534f209Smrg	# This is c89, which is MS Visual C++ (no shared libs)
5075b534f209Smrg	# Anyone wants to do a port?
5076b534f209Smrg	;;
5077b534f209Smrg      irix5* | irix6* | nonstopux*)
5078b534f209Smrg	case $cc_basename in
5079b534f209Smrg	  CC*)
5080b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5081b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5082b534f209Smrg	    # CC pic flag -KPIC is the default.
5083b534f209Smrg	    ;;
5084b534f209Smrg	  *)
5085b534f209Smrg	    ;;
5086b534f209Smrg	esac
5087b534f209Smrg	;;
5088b534f209Smrg      linux* | k*bsd*-gnu)
5089b534f209Smrg	case $cc_basename in
5090b534f209Smrg	  KCC*)
5091b534f209Smrg	    # KAI C++ Compiler
5092b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5093b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5094b534f209Smrg	    ;;
5095b534f209Smrg	  icpc* | ecpc*)
5096b534f209Smrg	    # Intel C++
5097b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5098b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5099b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5100b534f209Smrg	    ;;
5101b534f209Smrg	  pgCC*)
5102b534f209Smrg	    # Portland Group C++ compiler.
5103b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5104b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5105b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5106b534f209Smrg	    ;;
5107b534f209Smrg	  cxx*)
5108b534f209Smrg	    # Compaq C++
5109b534f209Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5110b534f209Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5111b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5112b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5113b534f209Smrg	    ;;
5114b534f209Smrg	  *)
5115b534f209Smrg	    case `$CC -V 2>&1 | sed 5q` in
5116b534f209Smrg	    *Sun\ C*)
5117b534f209Smrg	      # Sun C++ 5.9
5118b534f209Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5119b534f209Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5120b534f209Smrg	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5121b534f209Smrg	      ;;
5122b534f209Smrg	    esac
5123b534f209Smrg	    ;;
5124b534f209Smrg	esac
5125b534f209Smrg	;;
5126b534f209Smrg      lynxos*)
5127b534f209Smrg	;;
5128b534f209Smrg      m88k*)
5129b534f209Smrg	;;
5130b534f209Smrg      mvs*)
5131b534f209Smrg	case $cc_basename in
5132b534f209Smrg	  cxx*)
5133b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
5134b534f209Smrg	    ;;
5135b534f209Smrg	  *)
5136b534f209Smrg	    ;;
5137b534f209Smrg	esac
5138b534f209Smrg	;;
5139b534f209Smrg      netbsd*)
5140b534f209Smrg	;;
5141b534f209Smrg      osf3* | osf4* | osf5*)
5142b534f209Smrg	case $cc_basename in
5143b534f209Smrg	  KCC*)
5144b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
5145b534f209Smrg	    ;;
5146b534f209Smrg	  RCC*)
5147b534f209Smrg	    # Rational C++ 2.4.1
5148b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5149b534f209Smrg	    ;;
5150b534f209Smrg	  cxx*)
5151b534f209Smrg	    # Digital/Compaq C++
5152b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5153b534f209Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
5154b534f209Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
5155b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5156b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5157b534f209Smrg	    ;;
5158b534f209Smrg	  *)
5159b534f209Smrg	    ;;
5160b534f209Smrg	esac
5161b534f209Smrg	;;
5162b534f209Smrg      psos*)
5163b534f209Smrg	;;
5164b534f209Smrg      solaris*)
5165b534f209Smrg	case $cc_basename in
5166b534f209Smrg	  CC*)
5167b534f209Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
5168b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5169b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5170b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5171b534f209Smrg	    ;;
5172b534f209Smrg	  gcx*)
5173b534f209Smrg	    # Green Hills C++ Compiler
5174b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5175b534f209Smrg	    ;;
5176b534f209Smrg	  *)
5177b534f209Smrg	    ;;
5178b534f209Smrg	esac
5179b534f209Smrg	;;
5180b534f209Smrg      sunos4*)
5181b534f209Smrg	case $cc_basename in
5182b534f209Smrg	  CC*)
5183b534f209Smrg	    # Sun C++ 4.x
5184b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5185b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5186b534f209Smrg	    ;;
5187b534f209Smrg	  lcc*)
5188b534f209Smrg	    # Lucid
5189b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5190b534f209Smrg	    ;;
5191b534f209Smrg	  *)
5192b534f209Smrg	    ;;
5193b534f209Smrg	esac
5194b534f209Smrg	;;
5195b534f209Smrg      tandem*)
5196b534f209Smrg	case $cc_basename in
5197b534f209Smrg	  NCC*)
5198b534f209Smrg	    # NonStop-UX NCC 3.20
5199b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5200b534f209Smrg	    ;;
5201b534f209Smrg	  *)
5202b534f209Smrg	    ;;
5203b534f209Smrg	esac
5204b534f209Smrg	;;
5205b534f209Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5206b534f209Smrg	case $cc_basename in
5207b534f209Smrg	  CC*)
5208b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5209b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5210b534f209Smrg	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5211b534f209Smrg	    ;;
5212b534f209Smrg	esac
5213b534f209Smrg	;;
5214b534f209Smrg      vxworks*)
5215b534f209Smrg	;;
5216b534f209Smrg      *)
5217b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5218b534f209Smrg	;;
5219b534f209Smrg    esac
5220b534f209Smrg  fi
5221b534f209Smrg],
5222b534f209Smrg[
5223b534f209Smrg  if test "$GCC" = yes; then
5224b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5225b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5226b534f209Smrg
5227b534f209Smrg    case $host_os in
5228b534f209Smrg      aix*)
5229b534f209Smrg      # All AIX code is PIC.
5230b534f209Smrg      if test "$host_cpu" = ia64; then
5231b534f209Smrg	# AIX 5 now supports IA64 processor
5232b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5233b534f209Smrg      fi
5234b534f209Smrg      ;;
5235b534f209Smrg
5236b534f209Smrg    amigaos*)
5237b534f209Smrg      # FIXME: we need at least 68020 code to build shared libraries, but
5238b534f209Smrg      # adding the `-m68020' flag to GCC prevents building anything better,
5239b534f209Smrg      # like `-m68040'.
5240b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
5241b534f209Smrg      ;;
5242b534f209Smrg
5243b534f209Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
5244b534f209Smrg      # PIC is the default for these OSes.
5245b534f209Smrg      ;;
5246b534f209Smrg
5247b534f209Smrg    mingw* | cygwin* | pw32* | os2*)
5248b534f209Smrg      # This hack is so that the source file can tell whether it is being
5249b534f209Smrg      # built for inclusion in a dll (and should export symbols for example).
5250b534f209Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
5251b534f209Smrg      # (--disable-auto-import) libraries
5252b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5253b534f209Smrg      ;;
5254b534f209Smrg
5255b534f209Smrg    darwin* | rhapsody*)
5256b534f209Smrg      # PIC is the default on this platform
5257b534f209Smrg      # Common symbols not allowed in MH_DYLIB files
5258b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
5259b534f209Smrg      ;;
5260b534f209Smrg
5261b534f209Smrg    interix[[3-9]]*)
5262b534f209Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
5263b534f209Smrg      # Instead, we relocate shared libraries at runtime.
5264b534f209Smrg      ;;
5265b534f209Smrg
5266b534f209Smrg    msdosdjgpp*)
5267b534f209Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
5268b534f209Smrg      # on systems that don't support them.
5269b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5270b534f209Smrg      enable_shared=no
5271b534f209Smrg      ;;
5272b534f209Smrg
5273b534f209Smrg    sysv4*MP*)
5274b534f209Smrg      if test -d /usr/nec; then
5275b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
5276b534f209Smrg      fi
5277b534f209Smrg      ;;
5278b534f209Smrg
5279b534f209Smrg    hpux*)
5280b534f209Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5281b534f209Smrg      # not for PA HP-UX.
5282b534f209Smrg      case $host_cpu in
5283b534f209Smrg      hppa*64*|ia64*)
5284b534f209Smrg	# +Z the default
5285b534f209Smrg	;;
5286b534f209Smrg      *)
5287b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5288b534f209Smrg	;;
5289b534f209Smrg      esac
5290b534f209Smrg      ;;
5291b534f209Smrg
5292b534f209Smrg    *)
5293b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
5294b534f209Smrg      ;;
5295b534f209Smrg    esac
5296b534f209Smrg  else
5297b534f209Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
5298b534f209Smrg    case $host_os in
5299b534f209Smrg    aix*)
5300b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5301b534f209Smrg      if test "$host_cpu" = ia64; then
5302b534f209Smrg	# AIX 5 now supports IA64 processor
5303b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5304b534f209Smrg      else
5305b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
5306b534f209Smrg      fi
5307b534f209Smrg      ;;
5308b534f209Smrg      darwin*)
5309b534f209Smrg        # PIC is the default on this platform
5310b534f209Smrg        # Common symbols not allowed in MH_DYLIB files
5311b534f209Smrg       case $cc_basename in
5312b534f209Smrg         xlc*)
5313b534f209Smrg         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
5314b534f209Smrg         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5315b534f209Smrg         ;;
5316b534f209Smrg       esac
5317b534f209Smrg       ;;
5318b534f209Smrg
5319b534f209Smrg    mingw* | cygwin* | pw32* | os2*)
5320b534f209Smrg      # This hack is so that the source file can tell whether it is being
5321b534f209Smrg      # built for inclusion in a dll (and should export symbols for example).
5322b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
5323b534f209Smrg      ;;
5324b534f209Smrg
5325b534f209Smrg    hpux9* | hpux10* | hpux11*)
5326b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5327b534f209Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
5328b534f209Smrg      # not for PA HP-UX.
5329b534f209Smrg      case $host_cpu in
5330b534f209Smrg      hppa*64*|ia64*)
5331b534f209Smrg	# +Z the default
5332b534f209Smrg	;;
5333b534f209Smrg      *)
5334b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
5335b534f209Smrg	;;
5336b534f209Smrg      esac
5337b534f209Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
5338b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
5339b534f209Smrg      ;;
5340b534f209Smrg
5341b534f209Smrg    irix5* | irix6* | nonstopux*)
5342b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5343b534f209Smrg      # PIC (with -KPIC) is the default.
5344b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5345b534f209Smrg      ;;
5346b534f209Smrg
5347b534f209Smrg    newsos6)
5348b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5349b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5350b534f209Smrg      ;;
5351b534f209Smrg
5352b534f209Smrg    linux* | k*bsd*-gnu)
5353b534f209Smrg      case $cc_basename in
5354b534f209Smrg      icc* | ecc*)
5355b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5356b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5357b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
5358b534f209Smrg        ;;
5359b534f209Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
5360b534f209Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
5361b534f209Smrg	# which looks to be a dead project)
5362b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5363b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
5364b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5365b534f209Smrg        ;;
5366b534f209Smrg      ccc*)
5367b534f209Smrg        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5368b534f209Smrg        # All Alpha code is PIC.
5369b534f209Smrg        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5370b534f209Smrg        ;;
5371b534f209Smrg      *)
5372b534f209Smrg        case `$CC -V 2>&1 | sed 5q` in
5373b534f209Smrg	*Sun\ C*)
5374b534f209Smrg	  # Sun C 5.9
5375b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5376b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5377b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5378b534f209Smrg	  ;;
5379b534f209Smrg	*Sun\ F*)
5380b534f209Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
5381b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5382b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5383b534f209Smrg	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
5384b534f209Smrg	  ;;
5385b534f209Smrg	esac
5386b534f209Smrg	;;
5387b534f209Smrg      esac
5388b534f209Smrg      ;;
5389b534f209Smrg
5390b534f209Smrg    osf3* | osf4* | osf5*)
5391b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5392b534f209Smrg      # All OSF/1 code is PIC.
5393b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5394b534f209Smrg      ;;
5395b534f209Smrg
5396b534f209Smrg    rdos*)
5397b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
5398b534f209Smrg      ;;
5399b534f209Smrg
5400b534f209Smrg    solaris*)
5401b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5402b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5403b534f209Smrg      case $cc_basename in
5404b534f209Smrg      f77* | f90* | f95*)
5405b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
5406b534f209Smrg      *)
5407b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
5408b534f209Smrg      esac
5409b534f209Smrg      ;;
5410b534f209Smrg
5411b534f209Smrg    sunos4*)
5412b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
5413b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
5414b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5415b534f209Smrg      ;;
5416b534f209Smrg
5417b534f209Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
5418b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5419b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5420b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5421b534f209Smrg      ;;
5422b534f209Smrg
5423b534f209Smrg    sysv4*MP*)
5424b534f209Smrg      if test -d /usr/nec ;then
5425b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
5426b534f209Smrg	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5427b534f209Smrg      fi
5428b534f209Smrg      ;;
5429b534f209Smrg
5430b534f209Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
5431b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5432b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
5433b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5434b534f209Smrg      ;;
5435b534f209Smrg
5436b534f209Smrg    unicos*)
5437b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
5438b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5439b534f209Smrg      ;;
5440b534f209Smrg
5441b534f209Smrg    uts4*)
5442b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
5443b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
5444b534f209Smrg      ;;
5445b534f209Smrg
5446b534f209Smrg    *)
5447b534f209Smrg      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
5448b534f209Smrg      ;;
5449b534f209Smrg    esac
5450b534f209Smrg  fi
5451b534f209Smrg])
5452b534f209SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
5453b534f209Smrg
5454b534f209Smrg#
5455b534f209Smrg# Check to make sure the PIC flag actually works.
5456b534f209Smrg#
5457b534f209Smrgif test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
5458b534f209Smrg  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
5459b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
5460b534f209Smrg    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
5461b534f209Smrg    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
5462b534f209Smrg     "" | " "*) ;;
5463b534f209Smrg     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
5464b534f209Smrg     esac],
5465b534f209Smrg    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5466b534f209Smrg     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
5467b534f209Smrgfi
5468b534f209Smrgcase $host_os in
5469b534f209Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
5470b534f209Smrg  *djgpp*)
5471b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
5472b534f209Smrg    ;;
5473b534f209Smrg  *)
5474b534f209Smrg    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
5475b534f209Smrg    ;;
5476b534f209Smrgesac
5477b534f209Smrg
5478b534f209Smrg#
5479b534f209Smrg# Check to make sure the static flag actually works.
5480b534f209Smrg#
5481b534f209Smrgwl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
5482b534f209SmrgAC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
5483b534f209Smrg  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
5484b534f209Smrg  $lt_tmp_static_flag,
5485b534f209Smrg  [],
5486b534f209Smrg  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
5487b534f209Smrg])
5488b534f209Smrg
5489b534f209Smrg
5490b534f209Smrg# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
5491b534f209Smrg# ------------------------------------
5492b534f209Smrg# See if the linker supports building shared libraries.
5493b534f209SmrgAC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
5494b534f209Smrg[AC_REQUIRE([LT_AC_PROG_SED])dnl
5495b534f209SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5496b534f209Smrgifelse([$1],[CXX],[
5497b534f209Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5498b534f209Smrg  case $host_os in
5499b534f209Smrg  aix4* | aix5*)
5500b534f209Smrg    # If we're using GNU nm, then we don't want the "-C" option.
5501b534f209Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
5502b534f209Smrg    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5503b534f209Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
5504b534f209Smrg    else
5505b534f209Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
5506b534f209Smrg    fi
5507b534f209Smrg    ;;
5508b534f209Smrg  pw32*)
5509b534f209Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
5510b534f209Smrg  ;;
5511b534f209Smrg  cygwin* | mingw*)
5512b534f209Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5513b534f209Smrg  ;;
5514b534f209Smrg  *)
5515b534f209Smrg    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5516b534f209Smrg  ;;
5517b534f209Smrg  esac
5518b534f209Smrg],[
5519b534f209Smrg  runpath_var=
5520b534f209Smrg  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
5521b534f209Smrg  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5522b534f209Smrg  _LT_AC_TAGVAR(archive_cmds, $1)=
5523b534f209Smrg  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
5524b534f209Smrg  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
5525b534f209Smrg  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
5526b534f209Smrg  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5527b534f209Smrg  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5528b534f209Smrg  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
5529b534f209Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5530b534f209Smrg  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5531b534f209Smrg  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5532b534f209Smrg  _LT_AC_TAGVAR(hardcode_direct, $1)=no
5533b534f209Smrg  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
5534b534f209Smrg  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5535b534f209Smrg  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
5536b534f209Smrg  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
5537b534f209Smrg  _LT_AC_TAGVAR(module_cmds, $1)=
5538b534f209Smrg  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
5539b534f209Smrg  _LT_AC_TAGVAR(always_export_symbols, $1)=no
5540b534f209Smrg  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
5541b534f209Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
5542b534f209Smrg  # included in the symbol list
5543b534f209Smrg  _LT_AC_TAGVAR(include_expsyms, $1)=
5544b534f209Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5545b534f209Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
5546b534f209Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
5547b534f209Smrg  # as well as any symbol that contains `d'.
5548b534f209Smrg  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
5549b534f209Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5550b534f209Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5551b534f209Smrg  # the symbol is explicitly referenced.  Since portable code cannot
5552b534f209Smrg  # rely on this symbol name, it's probably fine to never include it in
5553b534f209Smrg  # preloaded symbol tables.
5554b534f209Smrg  extract_expsyms_cmds=
5555b534f209Smrg  # Just being paranoid about ensuring that cc_basename is set.
5556b534f209Smrg  _LT_CC_BASENAME([$compiler])
5557b534f209Smrg  case $host_os in
5558b534f209Smrg  cygwin* | mingw* | pw32*)
5559b534f209Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5560b534f209Smrg    # When not using gcc, we currently assume that we are using
5561b534f209Smrg    # Microsoft Visual C++.
5562b534f209Smrg    if test "$GCC" != yes; then
5563b534f209Smrg      with_gnu_ld=no
5564b534f209Smrg    fi
5565b534f209Smrg    ;;
5566b534f209Smrg  interix*)
5567b534f209Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5568b534f209Smrg    with_gnu_ld=yes
5569b534f209Smrg    ;;
5570b534f209Smrg  openbsd*)
5571b534f209Smrg    with_gnu_ld=no
5572b534f209Smrg    ;;
5573b534f209Smrg  esac
5574b534f209Smrg
5575b534f209Smrg  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
5576b534f209Smrg  if test "$with_gnu_ld" = yes; then
5577b534f209Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5578b534f209Smrg    wlarc='${wl}'
5579b534f209Smrg
5580b534f209Smrg    # Set some defaults for GNU ld with shared library support. These
5581b534f209Smrg    # are reset later if shared libraries are not supported. Putting them
5582b534f209Smrg    # here allows them to be overridden if necessary.
5583b534f209Smrg    runpath_var=LD_RUN_PATH
5584b534f209Smrg    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5585b534f209Smrg    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5586b534f209Smrg    # ancient GNU ld didn't support --whole-archive et. al.
5587b534f209Smrg    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
5588b534f209Smrg	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5589b534f209Smrg      else
5590b534f209Smrg  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5591b534f209Smrg    fi
5592b534f209Smrg    supports_anon_versioning=no
5593b534f209Smrg    case `$LD -v 2>/dev/null` in
5594b534f209Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5595b534f209Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5596b534f209Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5597b534f209Smrg      *\ 2.11.*) ;; # other 2.11 versions
5598b534f209Smrg      *) supports_anon_versioning=yes ;;
5599b534f209Smrg    esac
5600b534f209Smrg
5601b534f209Smrg    # See if GNU ld supports shared libraries.
5602b534f209Smrg    case $host_os in
5603b534f209Smrg    aix3* | aix4* | aix5*)
5604b534f209Smrg      # On AIX/PPC, the GNU linker is very broken
5605b534f209Smrg      if test "$host_cpu" != ia64; then
5606b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5607b534f209Smrg	cat <<EOF 1>&2
5608b534f209Smrg
5609b534f209Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
5610b534f209Smrg*** to be unable to reliably create shared libraries on AIX.
5611b534f209Smrg*** Therefore, libtool is disabling shared libraries support.  If you
5612b534f209Smrg*** really care for shared libraries, you may want to modify your PATH
5613b534f209Smrg*** so that a non-GNU linker is found, and then restart.
5614b534f209Smrg
5615b534f209SmrgEOF
5616b534f209Smrg      fi
5617b534f209Smrg      ;;
5618b534f209Smrg
5619b534f209Smrg    amigaos*)
5620b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5621b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5622b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5623b534f209Smrg
5624b534f209Smrg      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
5625b534f209Smrg      # that the semantics of dynamic libraries on AmigaOS, at least up
5626b534f209Smrg      # to version 4, is to share data among multiple programs linked
5627b534f209Smrg      # with the same dynamic library.  Since this doesn't match the
5628b534f209Smrg      # behavior of shared libraries on other platforms, we can't use
5629b534f209Smrg      # them.
5630b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5631b534f209Smrg      ;;
5632b534f209Smrg
5633b534f209Smrg    beos*)
5634b534f209Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5635b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5636b534f209Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5637b534f209Smrg	# support --undefined.  This deserves some investigation.  FIXME
5638b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5639b534f209Smrg      else
5640b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5641b534f209Smrg      fi
5642b534f209Smrg      ;;
5643b534f209Smrg
5644b534f209Smrg    cygwin* | mingw* | pw32*)
5645b534f209Smrg      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5646b534f209Smrg      # as there is no search path for DLLs.
5647b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5648b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5649b534f209Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=no
5650b534f209Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5651b534f209Smrg      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5652b534f209Smrg
5653b534f209Smrg      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
5654b534f209Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5655b534f209Smrg	# If the export-symbols file already is a .def file (1st line
5656b534f209Smrg	# is EXPORTS), use it as is; otherwise, prepend...
5657b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5658b534f209Smrg	  cp $export_symbols $output_objdir/$soname.def;
5659b534f209Smrg	else
5660b534f209Smrg	  echo EXPORTS > $output_objdir/$soname.def;
5661b534f209Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
5662b534f209Smrg	fi~
5663b534f209Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5664b534f209Smrg      else
5665b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5666b534f209Smrg      fi
5667b534f209Smrg      ;;
5668b534f209Smrg
5669b534f209Smrg    interix[[3-9]]*)
5670b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5671b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5672b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5673b534f209Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5674b534f209Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5675b534f209Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5676b534f209Smrg      # default) and relocated if they conflict, which is a slow very memory
5677b534f209Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5678b534f209Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5679b534f209Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5680b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5681b534f209Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5682b534f209Smrg      ;;
5683b534f209Smrg
5684b534f209Smrg    gnu* | linux* | k*bsd*-gnu)
5685b534f209Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5686b534f209Smrg	tmp_addflag=
5687b534f209Smrg	case $cc_basename,$host_cpu in
5688b534f209Smrg	pgcc*)				# Portland Group C compiler
5689b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
5690b534f209Smrg	  tmp_addflag=' $pic_flag'
5691b534f209Smrg	  ;;
5692b534f209Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
5693b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
5694b534f209Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5695b534f209Smrg	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
5696b534f209Smrg	  tmp_addflag=' -i_dynamic' ;;
5697b534f209Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5698b534f209Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5699b534f209Smrg	ifc* | ifort*)			# Intel Fortran compiler
5700b534f209Smrg	  tmp_addflag=' -nofor_main' ;;
5701b534f209Smrg	esac
5702b534f209Smrg	case `$CC -V 2>&1 | sed 5q` in
5703b534f209Smrg	*Sun\ C*)			# Sun C 5.9
5704b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
5705b534f209Smrg	  tmp_sharedflag='-G' ;;
5706b534f209Smrg	*Sun\ F*)			# Sun Fortran 8.3
5707b534f209Smrg	  tmp_sharedflag='-G' ;;
5708b534f209Smrg	*)
5709b534f209Smrg	  tmp_sharedflag='-shared' ;;
5710b534f209Smrg	esac
5711b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5712b534f209Smrg
5713b534f209Smrg	if test $supports_anon_versioning = yes; then
5714b534f209Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
5715b534f209Smrg  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5716b534f209Smrg  $echo "local: *; };" >> $output_objdir/$libname.ver~
5717b534f209Smrg	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5718b534f209Smrg	fi
5719b534f209Smrg      else
5720b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5721b534f209Smrg      fi
5722b534f209Smrg      ;;
5723b534f209Smrg
5724b534f209Smrg    netbsd*)
5725b534f209Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
5726b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5727b534f209Smrg	wlarc=
5728b534f209Smrg      else
5729b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5730b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5731b534f209Smrg      fi
5732b534f209Smrg      ;;
5733b534f209Smrg
5734b534f209Smrg    solaris*)
5735b534f209Smrg      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
5736b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5737b534f209Smrg	cat <<EOF 1>&2
5738b534f209Smrg
5739b534f209Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5740b534f209Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
5741b534f209Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5742b534f209Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5743b534f209Smrg*** your PATH or compiler configuration so that the native linker is
5744b534f209Smrg*** used, and then restart.
5745b534f209Smrg
5746b534f209SmrgEOF
5747b534f209Smrg      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5748b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5749b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5750b534f209Smrg      else
5751b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5752b534f209Smrg      fi
5753b534f209Smrg      ;;
5754b534f209Smrg
5755b534f209Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5756b534f209Smrg      case `$LD -v 2>&1` in
5757b534f209Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5758b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5759b534f209Smrg	cat <<_LT_EOF 1>&2
5760b534f209Smrg
5761b534f209Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
5762b534f209Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5763b534f209Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5764b534f209Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5765b534f209Smrg*** your PATH or compiler configuration so that the native linker is
5766b534f209Smrg*** used, and then restart.
5767b534f209Smrg
5768b534f209Smrg_LT_EOF
5769b534f209Smrg	;;
5770b534f209Smrg	*)
5771b534f209Smrg	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5772b534f209Smrg	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
5773b534f209Smrg	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
5774b534f209Smrg	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
5775b534f209Smrg	  else
5776b534f209Smrg	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
5777b534f209Smrg	  fi
5778b534f209Smrg	;;
5779b534f209Smrg      esac
5780b534f209Smrg      ;;
5781b534f209Smrg
5782b534f209Smrg    sunos4*)
5783b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5784b534f209Smrg      wlarc=
5785b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5786b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
5787b534f209Smrg      ;;
5788b534f209Smrg
5789b534f209Smrg    *)
5790b534f209Smrg      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
5791b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5792b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5793b534f209Smrg      else
5794b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
5795b534f209Smrg      fi
5796b534f209Smrg      ;;
579715fb4814Smrg    esac
579815fb4814Smrg
5799b534f209Smrg    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
5800b534f209Smrg      runpath_var=
5801b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
5802b534f209Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
5803b534f209Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
5804b534f209Smrg    fi
5805b534f209Smrg  else
5806b534f209Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
5807b534f209Smrg    case $host_os in
5808b534f209Smrg    aix3*)
5809b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5810b534f209Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5811b534f209Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5812b534f209Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
5813b534f209Smrg      # are no directories specified by -L.
5814b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5815b534f209Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
5816b534f209Smrg	# Neither direct hardcoding nor static linking is supported with a
5817b534f209Smrg	# broken collect2.
5818b534f209Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5819b534f209Smrg      fi
5820b534f209Smrg      ;;
5821b534f209Smrg
5822b534f209Smrg    aix4* | aix5*)
5823b534f209Smrg      if test "$host_cpu" = ia64; then
5824b534f209Smrg	# On IA64, the linker does run time linking by default, so we don't
5825b534f209Smrg	# have to do anything special.
5826b534f209Smrg	aix_use_runtimelinking=no
5827b534f209Smrg	exp_sym_flag='-Bexport'
5828b534f209Smrg	no_entry_flag=""
5829b534f209Smrg      else
5830b534f209Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5831b534f209Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
5832b534f209Smrg	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
5833b534f209Smrg	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
5834b534f209Smrg	else
5835b534f209Smrg	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
5836b534f209Smrg	fi
5837b534f209Smrg	aix_use_runtimelinking=no
5838b534f209Smrg
5839b534f209Smrg	# Test if we are trying to use run time linking or normal
5840b534f209Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5841b534f209Smrg	# need to do runtime linking.
5842b534f209Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
5843b534f209Smrg	  for ld_flag in $LDFLAGS; do
5844b534f209Smrg  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5845b534f209Smrg  	    aix_use_runtimelinking=yes
5846b534f209Smrg  	    break
5847b534f209Smrg  	  fi
5848b534f209Smrg	  done
5849b534f209Smrg	  ;;
5850b534f209Smrg	esac
5851b534f209Smrg
5852b534f209Smrg	exp_sym_flag='-bexport'
5853b534f209Smrg	no_entry_flag='-bnoentry'
5854b534f209Smrg      fi
5855b534f209Smrg
5856b534f209Smrg      # When large executables or shared objects are built, AIX ld can
5857b534f209Smrg      # have problems creating the table of contents.  If linking a library
5858b534f209Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
5859b534f209Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5860b534f209Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5861b534f209Smrg
5862b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)=''
5863b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
5864b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
5865b534f209Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
5866b534f209Smrg
5867b534f209Smrg      if test "$GCC" = yes; then
5868b534f209Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5869b534f209Smrg	# We only want to do this on AIX 4.2 and lower, the check
5870b534f209Smrg	# below for broken collect2 doesn't work under 4.3+
5871b534f209Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5872b534f209Smrg	  if test -f "$collect2name" && \
5873b534f209Smrg  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
5874b534f209Smrg	  then
5875b534f209Smrg  	  # We have reworked collect2
5876b534f209Smrg  	  :
5877b534f209Smrg	  else
5878b534f209Smrg  	  # We have old collect2
5879b534f209Smrg  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
5880b534f209Smrg  	  # It fails to find uninstalled libraries when the uninstalled
5881b534f209Smrg  	  # path is not listed in the libpath.  Setting hardcode_minus_L
5882b534f209Smrg  	  # to unsupported forces relinking
5883b534f209Smrg  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5884b534f209Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5885b534f209Smrg  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
5886b534f209Smrg	  fi
5887b534f209Smrg	  ;;
5888b534f209Smrg	esac
5889b534f209Smrg	shared_flag='-shared'
5890b534f209Smrg	if test "$aix_use_runtimelinking" = yes; then
5891b534f209Smrg	  shared_flag="$shared_flag "'${wl}-G'
5892b534f209Smrg	fi
5893b534f209Smrg      else
5894b534f209Smrg	# not using gcc
5895b534f209Smrg	if test "$host_cpu" = ia64; then
5896b534f209Smrg  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5897b534f209Smrg  	# chokes on -Wl,-G. The following line is correct:
5898b534f209Smrg	  shared_flag='-G'
5899b534f209Smrg	else
5900b534f209Smrg	  if test "$aix_use_runtimelinking" = yes; then
5901b534f209Smrg	    shared_flag='${wl}-G'
5902b534f209Smrg	  else
5903b534f209Smrg	    shared_flag='${wl}-bM:SRE'
5904b534f209Smrg	  fi
5905b534f209Smrg	fi
5906b534f209Smrg      fi
5907b534f209Smrg
5908b534f209Smrg      # It seems that -bexpall does not export symbols beginning with
5909b534f209Smrg      # underscore (_), so it is better to generate a list of symbols to export.
5910b534f209Smrg      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
5911b534f209Smrg      if test "$aix_use_runtimelinking" = yes; then
5912b534f209Smrg	# Warning - without using the other runtime loading flags (-brtl),
5913b534f209Smrg	# -berok will link without error, but may produce a broken library.
5914b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
5915b534f209Smrg       # Determine the default libpath from the value encoded in an empty executable.
5916b534f209Smrg       _LT_AC_SYS_LIBPATH_AIX
5917b534f209Smrg       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5918b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5919b534f209Smrg       else
5920b534f209Smrg	if test "$host_cpu" = ia64; then
5921b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5922b534f209Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5923b534f209Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
5924b534f209Smrg	else
5925b534f209Smrg	 # Determine the default libpath from the value encoded in an empty executable.
5926b534f209Smrg	 _LT_AC_SYS_LIBPATH_AIX
5927b534f209Smrg	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5928b534f209Smrg	  # Warning - without using the other run time loading flags,
5929b534f209Smrg	  # -berok will link without error, but may produce a broken library.
5930b534f209Smrg	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5931b534f209Smrg	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5932b534f209Smrg	  # Exported symbols can be pulled into shared objects from archives
5933b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5934b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
5935b534f209Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
5936b534f209Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5937b534f209Smrg	fi
5938b534f209Smrg      fi
5939b534f209Smrg      ;;
5940b534f209Smrg
5941b534f209Smrg    amigaos*)
5942b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5943b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5944b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
5945b534f209Smrg      # see comment about different semantics on the GNU ld section
5946b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
5947b534f209Smrg      ;;
5948b534f209Smrg
5949b534f209Smrg    bsdi[[45]]*)
5950b534f209Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5951b534f209Smrg      ;;
5952b534f209Smrg
5953b534f209Smrg    cygwin* | mingw* | pw32*)
5954b534f209Smrg      # When not using gcc, we currently assume that we are using
5955b534f209Smrg      # Microsoft Visual C++.
5956b534f209Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5957b534f209Smrg      # no search path for DLLs.
5958b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5959b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
5960b534f209Smrg      # Tell ltmain to make .lib files, not .a files.
5961b534f209Smrg      libext=lib
5962b534f209Smrg      # Tell ltmain to make .dll files, not .so files.
5963b534f209Smrg      shrext_cmds=".dll"
5964b534f209Smrg      # FIXME: Setting linknames here is a bad hack.
5965b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
5966b534f209Smrg      # The linker will automatically build a .lib file if we build a DLL.
5967b534f209Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
5968b534f209Smrg      # FIXME: Should let the user specify the lib program.
5969b534f209Smrg      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5970b534f209Smrg      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
5971b534f209Smrg      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5972b534f209Smrg      ;;
5973b534f209Smrg
5974b534f209Smrg    darwin* | rhapsody*)
5975b534f209Smrg      case $host_os in
5976b534f209Smrg        rhapsody* | darwin1.[[012]])
5977b534f209Smrg         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
5978b534f209Smrg         ;;
5979b534f209Smrg       *) # Darwin 1.3 on
5980b534f209Smrg         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
5981b534f209Smrg           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5982b534f209Smrg         else
5983b534f209Smrg           case ${MACOSX_DEPLOYMENT_TARGET} in
5984b534f209Smrg             10.[[012]])
5985b534f209Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
5986b534f209Smrg               ;;
5987b534f209Smrg             10.*)
5988b534f209Smrg               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
5989b534f209Smrg               ;;
5990b534f209Smrg           esac
5991b534f209Smrg         fi
5992b534f209Smrg         ;;
5993b534f209Smrg      esac
5994b534f209Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
5995b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=no
5996b534f209Smrg      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
5997b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5998b534f209Smrg      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
5999b534f209Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6000b534f209Smrg    if test "$GCC" = yes ; then
6001b534f209Smrg    	output_verbose_link_cmd='echo'
6002b534f209Smrg        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
6003b534f209Smrg      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6004b534f209Smrg      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6005b534f209Smrg      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6006b534f209Smrg      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6007b534f209Smrg    else
6008b534f209Smrg      case $cc_basename in
6009b534f209Smrg        xlc*)
6010b534f209Smrg         output_verbose_link_cmd='echo'
6011b534f209Smrg         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
6012b534f209Smrg         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
6013b534f209Smrg          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
6014b534f209Smrg         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6015b534f209Smrg          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
6016b534f209Smrg          ;;
6017b534f209Smrg       *)
6018b534f209Smrg         _LT_AC_TAGVAR(ld_shlibs, $1)=no
6019b534f209Smrg          ;;
6020b534f209Smrg      esac
6021b534f209Smrg    fi
6022b534f209Smrg      ;;
602315fb4814Smrg
6024b534f209Smrg    dgux*)
6025b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6026b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6027b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6028b534f209Smrg      ;;
602915fb4814Smrg
6030b534f209Smrg    freebsd1*)
6031b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6032b534f209Smrg      ;;
603315fb4814Smrg
6034b534f209Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
6035b534f209Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
6036b534f209Smrg    # does not break anything, and helps significantly (at the cost of a little
6037b534f209Smrg    # extra space).
6038b534f209Smrg    freebsd2.2*)
6039b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
6040b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6041b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6042b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6043b534f209Smrg      ;;
604415fb4814Smrg
6045b534f209Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
6046b534f209Smrg    freebsd2*)
6047b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6048b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6049b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6050b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6051b534f209Smrg      ;;
605215fb4814Smrg
6053b534f209Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
6054b534f209Smrg    freebsd* | dragonfly*)
6055b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
6056b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6057b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6058b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6059b534f209Smrg      ;;
606015fb4814Smrg
6061b534f209Smrg    hpux9*)
6062b534f209Smrg      if test "$GCC" = yes; then
6063b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6064b534f209Smrg      else
6065b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6066b534f209Smrg      fi
6067b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6068b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6069b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
607015fb4814Smrg
6071b534f209Smrg      # hardcode_minus_L: Not really in the search PATH,
6072b534f209Smrg      # but as the default location of the library.
6073b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6074b534f209Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6075b534f209Smrg      ;;
607615fb4814Smrg
6077b534f209Smrg    hpux10*)
6078b534f209Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6079b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6080b534f209Smrg      else
6081b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
6082b534f209Smrg      fi
6083b534f209Smrg      if test "$with_gnu_ld" = no; then
6084b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6085b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
608615fb4814Smrg
6087b534f209Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6088b534f209Smrg	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
608915fb4814Smrg
6090b534f209Smrg	# hardcode_minus_L: Not really in the search PATH,
6091b534f209Smrg	# but as the default location of the library.
6092b534f209Smrg	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6093b534f209Smrg      fi
6094b534f209Smrg      ;;
609515fb4814Smrg
6096b534f209Smrg    hpux11*)
6097b534f209Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
6098b534f209Smrg	case $host_cpu in
6099b534f209Smrg	hppa*64*)
6100b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6101b534f209Smrg	  ;;
6102b534f209Smrg	ia64*)
6103b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6104b534f209Smrg	  ;;
6105b534f209Smrg	*)
6106b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6107b534f209Smrg	  ;;
6108b534f209Smrg	esac
6109b534f209Smrg      else
6110b534f209Smrg	case $host_cpu in
6111b534f209Smrg	hppa*64*)
6112b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6113b534f209Smrg	  ;;
6114b534f209Smrg	ia64*)
6115b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
6116b534f209Smrg	  ;;
6117b534f209Smrg	*)
6118b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
6119b534f209Smrg	  ;;
6120b534f209Smrg	esac
6121b534f209Smrg      fi
6122b534f209Smrg      if test "$with_gnu_ld" = no; then
6123b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6124b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
612515fb4814Smrg
6126b534f209Smrg	case $host_cpu in
6127b534f209Smrg	hppa*64*|ia64*)
6128b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
6129b534f209Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6130b534f209Smrg	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6131b534f209Smrg	  ;;
6132b534f209Smrg	*)
6133b534f209Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6134b534f209Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
613515fb4814Smrg
6136b534f209Smrg	  # hardcode_minus_L: Not really in the search PATH,
6137b534f209Smrg	  # but as the default location of the library.
6138b534f209Smrg	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6139b534f209Smrg	  ;;
6140b534f209Smrg	esac
6141b534f209Smrg      fi
6142b534f209Smrg      ;;
614315fb4814Smrg
6144b534f209Smrg    irix5* | irix6* | nonstopux*)
6145b534f209Smrg      if test "$GCC" = yes; then
6146b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6147b534f209Smrg      else
6148b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6149b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
6150b534f209Smrg      fi
6151b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6152b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6153b534f209Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6154b534f209Smrg      ;;
6155b410ddbeSmrg
6156b534f209Smrg    netbsd*)
6157b534f209Smrg      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
6158b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
6159b534f209Smrg      else
6160b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
6161b534f209Smrg      fi
6162b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6163b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6164b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6165b534f209Smrg      ;;
6166b410ddbeSmrg
6167b534f209Smrg    newsos6)
6168b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6169b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6170b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6171b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6172b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6173b534f209Smrg      ;;
6174b410ddbeSmrg
6175b534f209Smrg    openbsd*)
6176b534f209Smrg      if test -f /usr/libexec/ld.so; then
6177b534f209Smrg	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
6178b534f209Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6179b534f209Smrg	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6180b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6181b534f209Smrg	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
6182b534f209Smrg	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6183b534f209Smrg	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6184b534f209Smrg	else
6185b534f209Smrg	  case $host_os in
6186b534f209Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
6187b534f209Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
6188b534f209Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6189b534f209Smrg	     ;;
6190b534f209Smrg	   *)
6191b534f209Smrg	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
6192b534f209Smrg	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6193b534f209Smrg	     ;;
6194b534f209Smrg	  esac
6195b534f209Smrg        fi
6196b534f209Smrg      else
6197b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=no
6198b534f209Smrg      fi
6199b534f209Smrg      ;;
6200b410ddbeSmrg
6201b534f209Smrg    os2*)
6202b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6203b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6204b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
6205b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
6206b534f209Smrg      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
6207b534f209Smrg      ;;
6208b410ddbeSmrg
6209b534f209Smrg    osf3*)
6210b534f209Smrg      if test "$GCC" = yes; then
6211b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6212b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6213b534f209Smrg      else
6214b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6215b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6216b534f209Smrg      fi
6217b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6218b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6219b534f209Smrg      ;;
6220b410ddbeSmrg
6221b534f209Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
6222b534f209Smrg      if test "$GCC" = yes; then
6223b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6224b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6225b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6226b534f209Smrg      else
6227b534f209Smrg	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6228b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
6229b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
6230b534f209Smrg	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
623115fb4814Smrg
6232b534f209Smrg	# Both c and cxx compiler support -rpath directly
6233b534f209Smrg	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6234b534f209Smrg      fi
6235b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
6236b534f209Smrg      ;;
623715fb4814Smrg
6238b534f209Smrg    solaris*)
6239b534f209Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
6240b534f209Smrg      if test "$GCC" = yes; then
6241b534f209Smrg	wlarc='${wl}'
6242b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
6243b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6244b534f209Smrg	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
6245b534f209Smrg      else
6246b534f209Smrg	wlarc=''
6247b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
6248b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
6249b534f209Smrg  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
6250b534f209Smrg      fi
6251b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6252b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6253b534f209Smrg      case $host_os in
6254b534f209Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6255b534f209Smrg      *)
6256b534f209Smrg	# The compiler driver will combine and reorder linker options,
6257b534f209Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
6258b534f209Smrg	# but is careful enough not to reorder.
6259b534f209Smrg 	# Supported since Solaris 2.6 (maybe 2.5.1?)
6260b534f209Smrg	if test "$GCC" = yes; then
6261b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6262b534f209Smrg	else
6263b534f209Smrg	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6264b534f209Smrg	fi
6265b534f209Smrg	;;
6266b534f209Smrg      esac
6267b534f209Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6268b534f209Smrg      ;;
6269de78e416Smrg
6270b534f209Smrg    sunos4*)
6271b534f209Smrg      if test "x$host_vendor" = xsequent; then
6272b534f209Smrg	# Use $CC to link under sequent, because it throws in some extra .o
6273b534f209Smrg	# files that make .init and .fini sections work.
6274b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
6275b534f209Smrg      else
6276b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
6277b534f209Smrg      fi
6278b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6279b534f209Smrg      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
6280b534f209Smrg      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
6281b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6282b534f209Smrg      ;;
628315fb4814Smrg
6284b534f209Smrg    sysv4)
6285b534f209Smrg      case $host_vendor in
6286b534f209Smrg	sni)
6287b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6288b534f209Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
6289b534f209Smrg	;;
6290b534f209Smrg	siemens)
6291b534f209Smrg	  ## LD is ld it makes a PLAMLIB
6292b534f209Smrg	  ## CC just makes a GrossModule.
6293b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
6294b534f209Smrg	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
6295b534f209Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
6296b534f209Smrg        ;;
6297b534f209Smrg	motorola)
6298b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6299b534f209Smrg	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6300b534f209Smrg	;;
6301b534f209Smrg      esac
6302b534f209Smrg      runpath_var='LD_RUN_PATH'
6303b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6304b534f209Smrg      ;;
630515fb4814Smrg
6306b534f209Smrg    sysv4.3*)
6307b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6308b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6309b534f209Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6310b534f209Smrg      ;;
631115fb4814Smrg
6312b534f209Smrg    sysv4*MP*)
6313b534f209Smrg      if test -d /usr/nec; then
6314b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6315b534f209Smrg	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6316b534f209Smrg	runpath_var=LD_RUN_PATH
6317b534f209Smrg	hardcode_runpath_var=yes
6318b534f209Smrg	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
6319b534f209Smrg      fi
6320b534f209Smrg      ;;
6321b534f209Smrg
6322b534f209Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6323b534f209Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6324b534f209Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6325b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6326b534f209Smrg      runpath_var='LD_RUN_PATH'
6327b534f209Smrg
6328b534f209Smrg      if test "$GCC" = yes; then
6329b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6330b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6331b534f209Smrg      else
6332b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6333b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6334b534f209Smrg      fi
6335b534f209Smrg      ;;
6336b534f209Smrg
6337b534f209Smrg    sysv5* | sco3.2v5* | sco5v6*)
6338b534f209Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
6339b534f209Smrg      # link with -lc, and that would cause any symbols used from libc to
6340b534f209Smrg      # always be unresolved, which means just about no library would
6341b534f209Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
6342b534f209Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
6343b534f209Smrg      # as -z defs.
6344b534f209Smrg      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6345b534f209Smrg      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6346b534f209Smrg      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6347b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6348b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
6349b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
6350b534f209Smrg      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
6351b534f209Smrg      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6352b534f209Smrg      runpath_var='LD_RUN_PATH'
6353b534f209Smrg
6354b534f209Smrg      if test "$GCC" = yes; then
6355b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6356b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6357b534f209Smrg      else
6358b534f209Smrg	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6359b534f209Smrg	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
6360b534f209Smrg      fi
6361b534f209Smrg      ;;
6362b534f209Smrg
6363b534f209Smrg    uts4*)
6364b534f209Smrg      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6365b534f209Smrg      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6366b534f209Smrg      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
6367b534f209Smrg      ;;
6368b534f209Smrg
6369b534f209Smrg    *)
6370b534f209Smrg      _LT_AC_TAGVAR(ld_shlibs, $1)=no
6371b534f209Smrg      ;;
6372b534f209Smrg    esac
6373b534f209Smrg  fi
6374b534f209Smrg])
6375b534f209SmrgAC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
6376b534f209Smrgtest "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6377b534f209Smrg
6378b534f209Smrg#
6379b534f209Smrg# Do we need to explicitly link libc?
6380b534f209Smrg#
6381b534f209Smrgcase "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
6382b534f209Smrgx|xyes)
6383b534f209Smrg  # Assume -lc should be added
6384b534f209Smrg  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6385b534f209Smrg
6386b534f209Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
6387b534f209Smrg    case $_LT_AC_TAGVAR(archive_cmds, $1) in
6388b534f209Smrg    *'~'*)
6389b534f209Smrg      # FIXME: we may have to deal with multi-command sequences.
6390b534f209Smrg      ;;
6391b534f209Smrg    '$CC '*)
6392b534f209Smrg      # Test whether the compiler implicitly links with -lc since on some
6393b534f209Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6394b534f209Smrg      # to ld, don't add -lc before -lgcc.
6395b534f209Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
6396b534f209Smrg      $rm conftest*
6397b534f209Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
639815fb4814Smrg
6399b534f209Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6400b534f209Smrg        soname=conftest
6401b534f209Smrg        lib=conftest
6402b534f209Smrg        libobjs=conftest.$ac_objext
6403b534f209Smrg        deplibs=
6404b534f209Smrg        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
6405b534f209Smrg	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
6406b534f209Smrg        compiler_flags=-v
6407b534f209Smrg        linker_flags=-v
6408b534f209Smrg        verstring=
6409b534f209Smrg        output_objdir=.
6410b534f209Smrg        libname=conftest
6411b534f209Smrg        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
6412b534f209Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
6413b534f209Smrg        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
6414b534f209Smrg        then
6415b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
6416b534f209Smrg        else
6417b534f209Smrg	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
6418b534f209Smrg        fi
6419b534f209Smrg        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6420b534f209Smrg      else
6421b534f209Smrg        cat conftest.err 1>&5
6422b534f209Smrg      fi
6423b534f209Smrg      $rm conftest*
6424b534f209Smrg      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
6425b534f209Smrg      ;;
6426b534f209Smrg    esac
6427b534f209Smrg  fi
6428b534f209Smrg  ;;
6429b534f209Smrgesac
6430b534f209Smrg])# AC_LIBTOOL_PROG_LD_SHLIBS
643115fb4814Smrg
643215fb4814Smrg
6433b534f209Smrg# _LT_AC_FILE_LTDLL_C
6434b534f209Smrg# -------------------
6435b534f209Smrg# Be careful that the start marker always follows a newline.
6436b534f209SmrgAC_DEFUN([_LT_AC_FILE_LTDLL_C], [
6437b534f209Smrg# /* ltdll.c starts here */
6438b534f209Smrg# #define WIN32_LEAN_AND_MEAN
6439b534f209Smrg# #include <windows.h>
6440b534f209Smrg# #undef WIN32_LEAN_AND_MEAN
6441b534f209Smrg# #include <stdio.h>
6442b534f209Smrg#
6443b534f209Smrg# #ifndef __CYGWIN__
6444b534f209Smrg# #  ifdef __CYGWIN32__
6445b534f209Smrg# #    define __CYGWIN__ __CYGWIN32__
6446b534f209Smrg# #  endif
6447b534f209Smrg# #endif
6448b534f209Smrg#
6449b534f209Smrg# #ifdef __cplusplus
6450b534f209Smrg# extern "C" {
6451b534f209Smrg# #endif
6452b534f209Smrg# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
6453b534f209Smrg# #ifdef __cplusplus
6454b534f209Smrg# }
6455b534f209Smrg# #endif
6456b534f209Smrg#
6457b534f209Smrg# #ifdef __CYGWIN__
6458b534f209Smrg# #include <cygwin/cygwin_dll.h>
6459b534f209Smrg# DECLARE_CYGWIN_DLL( DllMain );
6460b534f209Smrg# #endif
6461b534f209Smrg# HINSTANCE __hDllInstance_base;
6462b534f209Smrg#
6463b534f209Smrg# BOOL APIENTRY
6464b534f209Smrg# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
6465b534f209Smrg# {
6466b534f209Smrg#   __hDllInstance_base = hInst;
6467b534f209Smrg#   return TRUE;
6468b534f209Smrg# }
6469b534f209Smrg# /* ltdll.c ends here */
6470b534f209Smrg])# _LT_AC_FILE_LTDLL_C
6471b534f209Smrg
6472b534f209Smrg
6473b534f209Smrg# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
6474b534f209Smrg# ---------------------------------
6475b534f209SmrgAC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
647615fb4814Smrg
6477b410ddbeSmrg
6478b534f209Smrg# old names
6479b534f209SmrgAC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
6480b534f209SmrgAC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
6481b534f209SmrgAC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
6482b534f209SmrgAC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
6483b534f209SmrgAC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
6484b534f209SmrgAC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
6485b534f209SmrgAC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
648615fb4814Smrg
6487b534f209Smrg# This is just to silence aclocal about the macro not being used
6488b534f209Smrgifelse([AC_DISABLE_FAST_INSTALL])
648915fb4814Smrg
6490b534f209SmrgAC_DEFUN([LT_AC_PROG_GCJ],
6491b534f209Smrg[AC_CHECK_TOOL(GCJ, gcj, no)
6492b534f209Smrg  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6493b534f209Smrg  AC_SUBST(GCJFLAGS)
6494b534f209Smrg])
6495b410ddbeSmrg
6496b534f209SmrgAC_DEFUN([LT_AC_PROG_RC],
6497b534f209Smrg[AC_CHECK_TOOL(RC, windres, no)
649815fb4814Smrg])
649915fb4814Smrg
650015fb4814Smrg
6501b534f209Smrg# Cheap backport of AS_EXECUTABLE_P and required macros
6502b534f209Smrg# from Autoconf 2.59; we should not use $as_executable_p directly.
6503b410ddbeSmrg
6504b534f209Smrg# _AS_TEST_PREPARE
6505b534f209Smrg# ----------------
6506b534f209Smrgm4_ifndef([_AS_TEST_PREPARE],
6507b534f209Smrg[m4_defun([_AS_TEST_PREPARE],
6508b534f209Smrg[if test -x / >/dev/null 2>&1; then
6509b534f209Smrg  as_executable_p='test -x'
6510b534f209Smrgelse
6511b534f209Smrg  as_executable_p='test -f'
6512b534f209Smrgfi
6513b534f209Smrg])])# _AS_TEST_PREPARE
6514b410ddbeSmrg
6515b534f209Smrg# AS_EXECUTABLE_P
6516b534f209Smrg# ---------------
6517b534f209Smrg# Check whether a file is executable.
6518b534f209Smrgm4_ifndef([AS_EXECUTABLE_P],
6519b534f209Smrg[m4_defun([AS_EXECUTABLE_P],
6520b534f209Smrg[AS_REQUIRE([_AS_TEST_PREPARE])dnl
6521b534f209Smrg$as_executable_p $1[]dnl
6522b534f209Smrg])])# AS_EXECUTABLE_P
6523b410ddbeSmrg
6524b410ddbeSmrg# NOTE: This macro has been submitted for inclusion into   #
6525b410ddbeSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
6526b410ddbeSmrg#  a released version of Autoconf we should remove this    #
6527b410ddbeSmrg#  macro and use it instead.                               #
6528b534f209Smrg# LT_AC_PROG_SED
6529b534f209Smrg# --------------
6530b534f209Smrg# Check for a fully-functional sed program, that truncates
6531b534f209Smrg# as few characters as possible.  Prefer GNU sed if found.
6532b534f209SmrgAC_DEFUN([LT_AC_PROG_SED],
6533b410ddbeSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
6534b410ddbeSmrgAC_CACHE_VAL(lt_cv_path_SED,
6535b410ddbeSmrg[# Loop through the user's path and test for sed and gsed.
6536b410ddbeSmrg# Then use that list of sed's as ones to test for truncation.
6537b410ddbeSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6538b410ddbeSmrgfor as_dir in $PATH
6539b410ddbeSmrgdo
6540b410ddbeSmrg  IFS=$as_save_IFS
6541b410ddbeSmrg  test -z "$as_dir" && as_dir=.
6542b410ddbeSmrg  for lt_ac_prog in sed gsed; do
6543b410ddbeSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
6544b534f209Smrg      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
6545b410ddbeSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
6546b410ddbeSmrg      fi
6547b410ddbeSmrg    done
6548b410ddbeSmrg  done
6549b410ddbeSmrgdone
6550b410ddbeSmrgIFS=$as_save_IFS
6551b410ddbeSmrglt_ac_max=0
6552b410ddbeSmrglt_ac_count=0
6553b410ddbeSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
6554b410ddbeSmrg# along with /bin/sed that truncates output.
6555b410ddbeSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
6556b410ddbeSmrg  test ! -f $lt_ac_sed && continue
6557b410ddbeSmrg  cat /dev/null > conftest.in
6558b410ddbeSmrg  lt_ac_count=0
6559b410ddbeSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
6560b410ddbeSmrg  # Check for GNU sed and select it if it is found.
6561b410ddbeSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
6562b410ddbeSmrg    lt_cv_path_SED=$lt_ac_sed
6563b410ddbeSmrg    break
6564b410ddbeSmrg  fi
6565b410ddbeSmrg  while true; do
6566b410ddbeSmrg    cat conftest.in conftest.in >conftest.tmp
6567b410ddbeSmrg    mv conftest.tmp conftest.in
6568b410ddbeSmrg    cp conftest.in conftest.nl
6569b410ddbeSmrg    echo >>conftest.nl
6570b410ddbeSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
6571b410ddbeSmrg    cmp -s conftest.out conftest.nl || break
6572b410ddbeSmrg    # 10000 chars as input seems more than enough
6573b410ddbeSmrg    test $lt_ac_count -gt 10 && break
6574b410ddbeSmrg    lt_ac_count=`expr $lt_ac_count + 1`
6575b410ddbeSmrg    if test $lt_ac_count -gt $lt_ac_max; then
6576b410ddbeSmrg      lt_ac_max=$lt_ac_count
6577b410ddbeSmrg      lt_cv_path_SED=$lt_ac_sed
657815fb4814Smrg    fi
6579b410ddbeSmrg  done
6580b410ddbeSmrgdone
6581b410ddbeSmrg])
6582b410ddbeSmrgSED=$lt_cv_path_SED
6583b410ddbeSmrgAC_SUBST([SED])
6584b410ddbeSmrgAC_MSG_RESULT([$SED])
6585b410ddbeSmrg])
658615fb4814Smrg
6587b534f209Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
6588b534f209Smrg# 
6589b534f209Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
6590b410ddbeSmrg#
6591b534f209Smrg# This program is free software; you can redistribute it and/or modify
6592b534f209Smrg# it under the terms of the GNU General Public License as published by
6593b534f209Smrg# the Free Software Foundation; either version 2 of the License, or
6594b534f209Smrg# (at your option) any later version.
6595b410ddbeSmrg#
6596b534f209Smrg# This program is distributed in the hope that it will be useful, but
6597b534f209Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
6598b534f209Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
6599b534f209Smrg# General Public License for more details.
6600b534f209Smrg#
6601b534f209Smrg# You should have received a copy of the GNU General Public License
6602b534f209Smrg# along with this program; if not, write to the Free Software
6603b534f209Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6604b534f209Smrg#
6605b534f209Smrg# As a special exception to the GNU General Public License, if you
6606b534f209Smrg# distribute this file as part of a program that contains a
6607b534f209Smrg# configuration script generated by Autoconf, you may include it under
6608b534f209Smrg# the same distribution terms that you use for the rest of that program.
660915fb4814Smrg
6610b534f209Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
6611b534f209Smrg# ----------------------------------
6612b534f209SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
6613b534f209Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
6614b534f209Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
6615b534f209SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
6616b534f209Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
6617b534f209Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
6618b534f209Smrgfi
6619b534f209Smrgif test -n "$PKG_CONFIG"; then
6620b534f209Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
6621b534f209Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
6622b534f209Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6623b534f209Smrg		AC_MSG_RESULT([yes])
6624b534f209Smrg	else
6625b534f209Smrg		AC_MSG_RESULT([no])
6626b534f209Smrg		PKG_CONFIG=""
6627b410ddbeSmrg	fi
6628b534f209Smrg		
6629b534f209Smrgfi[]dnl
6630b534f209Smrg])# PKG_PROG_PKG_CONFIG
663115fb4814Smrg
6632b534f209Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6633b534f209Smrg#
6634b534f209Smrg# Check to see whether a particular set of modules exists.  Similar
6635b534f209Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6636b534f209Smrg#
6637b534f209Smrg#
6638b534f209Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6639b534f209Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
6640b534f209Smrg# PKG_CHECK_EXISTS manually
6641b534f209Smrg# --------------------------------------------------------------
6642b534f209SmrgAC_DEFUN([PKG_CHECK_EXISTS],
6643b534f209Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6644b534f209Smrgif test -n "$PKG_CONFIG" && \
6645b534f209Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
6646b534f209Smrg  m4_ifval([$2], [$2], [:])
6647b534f209Smrgm4_ifvaln([$3], [else
6648b534f209Smrg  $3])dnl
6649b534f209Smrgfi])
665015fb4814Smrg
665115fb4814Smrg
6652b534f209Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
6653b534f209Smrg# ---------------------------------------------
6654b534f209Smrgm4_define([_PKG_CONFIG],
6655b534f209Smrg[if test -n "$PKG_CONFIG"; then
6656b534f209Smrg    if test -n "$$1"; then
6657b534f209Smrg        pkg_cv_[]$1="$$1"
6658b534f209Smrg    else
6659b534f209Smrg        PKG_CHECK_EXISTS([$3],
6660b534f209Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
6661b534f209Smrg			 [pkg_failed=yes])
6662b534f209Smrg    fi
6663b534f209Smrgelse
6664b534f209Smrg	pkg_failed=untried
6665b534f209Smrgfi[]dnl
6666b534f209Smrg])# _PKG_CONFIG
666715fb4814Smrg
6668b534f209Smrg# _PKG_SHORT_ERRORS_SUPPORTED
6669b534f209Smrg# -----------------------------
6670b534f209SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
6671b534f209Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
6672b534f209Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6673b534f209Smrg        _pkg_short_errors_supported=yes
6674b534f209Smrgelse
6675b534f209Smrg        _pkg_short_errors_supported=no
6676b534f209Smrgfi[]dnl
6677b534f209Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
667815fb4814Smrg
667915fb4814Smrg
6680b534f209Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
6681b534f209Smrg# [ACTION-IF-NOT-FOUND])
6682b534f209Smrg#
6683b534f209Smrg#
6684b534f209Smrg# Note that if there is a possibility the first call to
6685b534f209Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
6686b534f209Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
6687b534f209Smrg#
6688b534f209Smrg#
6689b534f209Smrg# --------------------------------------------------------------
6690b534f209SmrgAC_DEFUN([PKG_CHECK_MODULES],
6691b534f209Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6692b534f209SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
6693b534f209SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
669415fb4814Smrg
6695b534f209Smrgpkg_failed=no
6696b534f209SmrgAC_MSG_CHECKING([for $1])
669715fb4814Smrg
6698b534f209Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
6699b534f209Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
670015fb4814Smrg
6701b534f209Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
6702b534f209Smrgand $1[]_LIBS to avoid the need to call pkg-config.
6703b534f209SmrgSee the pkg-config man page for more details.])
6704b410ddbeSmrg
6705b534f209Smrgif test $pkg_failed = yes; then
6706b534f209Smrg        _PKG_SHORT_ERRORS_SUPPORTED
6707b534f209Smrg        if test $_pkg_short_errors_supported = yes; then
6708b534f209Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
6709b534f209Smrg        else 
6710b534f209Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6711b534f209Smrg        fi
6712b534f209Smrg	# Put the nasty error message in config.log where it belongs
6713b534f209Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
6714b410ddbeSmrg
6715b534f209Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
6716b534f209Smrg[Package requirements ($2) were not met:
6717b410ddbeSmrg
6718b534f209Smrg$$1_PKG_ERRORS
671915fb4814Smrg
6720b534f209SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
6721b534f209Smrginstalled software in a non-standard prefix.
672215fb4814Smrg
6723b534f209Smrg_PKG_TEXT
6724b534f209Smrg])],
6725b534f209Smrg		[AC_MSG_RESULT([no])
6726b534f209Smrg                $4])
6727b534f209Smrgelif test $pkg_failed = untried; then
6728b534f209Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
6729b534f209Smrg[The pkg-config script could not be found or is too old.  Make sure it
6730b534f209Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
6731b534f209Smrgpath to pkg-config.
673215fb4814Smrg
6733b534f209Smrg_PKG_TEXT
6734b410ddbeSmrg
6735b534f209SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
6736b534f209Smrg		[$4])
6737b534f209Smrgelse
6738b534f209Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
6739b534f209Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
6740b534f209Smrg        AC_MSG_RESULT([yes])
6741b534f209Smrg	ifelse([$3], , :, [$3])
6742b534f209Smrgfi[]dnl
6743b534f209Smrg])# PKG_CHECK_MODULES
6744b410ddbeSmrg
6745b534f209Smrgdnl
6746b534f209Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
6747b534f209Smrgdnl 
6748b534f209Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
6749b534f209Smrgdnl copy of this software and associated documentation files (the
6750b534f209Smrgdnl "Software"), to deal in the Software without restriction, including
6751b534f209Smrgdnl without limitation the rights to use, copy, modify, merge, publish,
6752b534f209Smrgdnl distribute, and/or sell copies of the Software, and to permit persons
6753b534f209Smrgdnl to whom the Software is furnished to do so, provided that the above
6754b534f209Smrgdnl copyright notice(s) and this permission notice appear in all copies of
6755b534f209Smrgdnl the Software and that both the above copyright notice(s) and this
6756b534f209Smrgdnl permission notice appear in supporting documentation.
6757b534f209Smrgdnl
6758b534f209Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
6759b534f209Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
6760b534f209Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
6761b534f209Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
6762b534f209Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
6763b534f209Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
6764b534f209Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
6765b534f209Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
6766b534f209Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6767b534f209Smrgdnl
6768b534f209Smrgdnl Except as contained in this notice, the name of a copyright holder
6769b534f209Smrgdnl shall not be used in advertising or otherwise to promote the sale, use
6770b534f209Smrgdnl or other dealings in this Software without prior written authorization
6771b534f209Smrgdnl of the copyright holder.
6772b410ddbeSmrg
6773b534f209Smrg# XORG_MACROS_VERSION(required-version)
6774b534f209Smrg# -------------------------------------
6775b534f209Smrg# Minimum version: 1.1.0
6776b534f209Smrg#
6777b534f209Smrg# If you're using a macro added in Version 1.1 or newer, include this in
6778b534f209Smrg# your configure.ac with the minimum required version, such as:
6779b534f209Smrg# XORG_MACROS_VERSION(1.1)
6780b534f209Smrg#
6781b534f209Smrg# To force at least a version with this macro defined, also add:
6782b534f209Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
6783b534f209Smrg#
6784b534f209Smrg#
6785b534f209Smrg# See the "minimum version" comment for each macro you use to see what 
6786b534f209Smrg# version you require.
6787b534f209SmrgAC_DEFUN([XORG_MACROS_VERSION],[
6788b534f209Smrg	[XORG_MACROS_needed_version=$1
6789b534f209Smrg	XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
6790b534f209Smrg	XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
6791b534f209Smrg	AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
6792b534f209Smrg	[XORG_MACROS_version=1.1.5
6793b534f209Smrg	XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
6794b534f209Smrg	XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
6795b534f209Smrg	if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
6796b534f209Smrg		AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
6797b410ddbeSmrg	fi
6798b534f209Smrg	if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
6799b534f209Smrg		AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
6800b534f209Smrg	fi
6801b534f209Smrg	AC_MSG_RESULT([yes, $XORG_MACROS_version])
6802b534f209Smrg]) # XORG_MACROS_VERSION
6803b410ddbeSmrg
6804b534f209Smrg# XORG_PROG_RAWCPP()
6805b534f209Smrg# ------------------
6806b534f209Smrg# Minimum version: 1.0.0
6807b534f209Smrg#
6808b534f209Smrg# Find cpp program and necessary flags for use in pre-processing text files
6809b534f209Smrg# such as man pages and config files
6810b534f209SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
6811b534f209SmrgAC_REQUIRE([AC_PROG_CPP])
6812b534f209SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
6813b534f209Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
681415fb4814Smrg
6815b534f209Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
6816b534f209Smrg# which is not the best choice for supporting other OS'es, but covers most
6817b534f209Smrg# of the ones we need for now.
6818b534f209SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
6819b534f209SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
6820b534f209Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6821b534f209Smrg	AC_MSG_RESULT([no])
6822b534f209Smrgelse
6823b534f209Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
6824b534f209Smrg		RAWCPPFLAGS=-undef
6825b534f209Smrg		AC_MSG_RESULT([yes])
6826b534f209Smrg	else
6827b534f209Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
6828b534f209Smrg	fi
6829b534f209Smrgfi
6830b534f209Smrgrm -f conftest.$ac_ext
683115fb4814Smrg
6832b534f209SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
6833b534f209SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
6834b534f209Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6835b534f209Smrg	AC_MSG_RESULT([no])
6836b534f209Smrgelse
6837b534f209Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
6838b534f209Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
6839b534f209Smrg		AC_MSG_RESULT([yes])
6840b534f209Smrg	else
6841b534f209Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
6842b534f209Smrg	fi
6843b534f209Smrgfi
6844b534f209Smrgrm -f conftest.$ac_ext
6845b534f209SmrgAC_SUBST(RAWCPPFLAGS)
6846b534f209Smrg]) # XORG_PROG_RAWCPP
684715fb4814Smrg
6848b534f209Smrg# XORG_MANPAGE_SECTIONS()
6849b534f209Smrg# -----------------------
6850b534f209Smrg# Minimum version: 1.0.0
6851b534f209Smrg#
6852b534f209Smrg# Determine which sections man pages go in for the different man page types
6853b534f209Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
6854b534f209Smrg# Not sure if there's any better way than just hardcoding by OS name.
6855b534f209Smrg# Override default settings by setting environment variables
685615fb4814Smrg
6857b534f209SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
6858b534f209SmrgAC_REQUIRE([AC_CANONICAL_HOST])
685915fb4814Smrg
6860b534f209Smrgif test x$APP_MAN_SUFFIX = x    ; then
6861b534f209Smrg    APP_MAN_SUFFIX=1
6862b534f209Smrgfi
6863b534f209Smrgif test x$APP_MAN_DIR = x    ; then
6864b534f209Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
6865b534f209Smrgfi
6866b410ddbeSmrg
6867b534f209Smrgif test x$LIB_MAN_SUFFIX = x    ; then
6868b534f209Smrg    LIB_MAN_SUFFIX=3
6869b534f209Smrgfi
6870b534f209Smrgif test x$LIB_MAN_DIR = x    ; then
6871b534f209Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
6872b534f209Smrgfi
6873b410ddbeSmrg
6874b534f209Smrgif test x$FILE_MAN_SUFFIX = x    ; then
6875b534f209Smrg    case $host_os in
6876b534f209Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
6877b534f209Smrg	*)		FILE_MAN_SUFFIX=5  ;;
6878b534f209Smrg    esac
6879b534f209Smrgfi
6880b534f209Smrgif test x$FILE_MAN_DIR = x    ; then
6881b534f209Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
6882b534f209Smrgfi
6883b410ddbeSmrg
6884b534f209Smrgif test x$MISC_MAN_SUFFIX = x    ; then
6885b534f209Smrg    case $host_os in
6886b534f209Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
6887b534f209Smrg	*)		MISC_MAN_SUFFIX=7  ;;
6888b534f209Smrg    esac
6889b534f209Smrgfi
6890b534f209Smrgif test x$MISC_MAN_DIR = x    ; then
6891b534f209Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
6892b534f209Smrgfi
689315fb4814Smrg
6894b534f209Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
6895b534f209Smrg    case $host_os in
6896b534f209Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
6897b534f209Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
6898b534f209Smrg    esac
6899b534f209Smrgfi
6900b534f209Smrgif test x$DRIVER_MAN_DIR = x    ; then
6901b534f209Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
6902b534f209Smrgfi
6903de78e416Smrg
6904b534f209Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
6905b534f209Smrg    case $host_os in
6906b534f209Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
6907b534f209Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
6908b534f209Smrg    esac
6909b534f209Smrgfi
6910b534f209Smrgif test x$ADMIN_MAN_DIR = x    ; then
6911b534f209Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
6912b534f209Smrgfi
6913de78e416Smrg
6914de78e416Smrg
6915b534f209SmrgAC_SUBST([APP_MAN_SUFFIX])
6916b534f209SmrgAC_SUBST([LIB_MAN_SUFFIX])
6917b534f209SmrgAC_SUBST([FILE_MAN_SUFFIX])
6918b534f209SmrgAC_SUBST([MISC_MAN_SUFFIX])
6919b534f209SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
6920b534f209SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
6921b534f209SmrgAC_SUBST([APP_MAN_DIR])
6922b534f209SmrgAC_SUBST([LIB_MAN_DIR])
6923b534f209SmrgAC_SUBST([FILE_MAN_DIR])
6924b534f209SmrgAC_SUBST([MISC_MAN_DIR])
6925b534f209SmrgAC_SUBST([DRIVER_MAN_DIR])
6926b534f209SmrgAC_SUBST([ADMIN_MAN_DIR])
6927b534f209Smrg]) # XORG_MANPAGE_SECTIONS
6928de78e416Smrg
6929b534f209Smrg# XORG_CHECK_LINUXDOC
6930b534f209Smrg# -------------------
6931b534f209Smrg# Minimum version: 1.0.0
6932b410ddbeSmrg#
6933b534f209Smrg# Defines the variable MAKE_TEXT if the necessary tools and
6934b534f209Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
6935b534f209Smrg# Whether or not the necessary tools and files are found can be checked
6936b534f209Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
6937b534f209SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
6938b534f209SmrgXORG_SGML_PATH=$prefix/share/sgml
6939b534f209SmrgHAVE_DEFS_ENT=
6940b410ddbeSmrg
6941b534f209SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
6942b410ddbeSmrg
6943b534f209SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
6944b534f209SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
6945b410ddbeSmrg
6946b534f209SmrgAC_MSG_CHECKING([Whether to build documentation])
6947b410ddbeSmrg
6948b534f209Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
6949b534f209Smrg   BUILDDOC=yes
6950b534f209Smrgelse
6951b534f209Smrg   BUILDDOC=no
6952b534f209Smrgfi
6953b410ddbeSmrg
6954b534f209SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
6955b410ddbeSmrg
6956b534f209SmrgAC_MSG_RESULT([$BUILDDOC])
6957b410ddbeSmrg
6958b534f209SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
6959b410ddbeSmrg
6960b534f209Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
6961b534f209Smrg   BUILDPDFDOC=yes
6962b534f209Smrgelse
6963b534f209Smrg   BUILDPDFDOC=no
6964b534f209Smrgfi
6965b410ddbeSmrg
6966b534f209SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
6967b410ddbeSmrg
6968b534f209SmrgAC_MSG_RESULT([$BUILDPDFDOC])
6969b410ddbeSmrg
6970b534f209SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
6971b534f209SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
6972b534f209SmrgMAKE_PDF="$PS2PDF"
6973b534f209SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
6974b410ddbeSmrg
6975b534f209SmrgAC_SUBST(MAKE_TEXT)
6976b534f209SmrgAC_SUBST(MAKE_PS)
6977b534f209SmrgAC_SUBST(MAKE_PDF)
6978b534f209SmrgAC_SUBST(MAKE_HTML)
6979b534f209Smrg]) # XORG_CHECK_LINUXDOC
6980b410ddbeSmrg
6981b534f209Smrg# XORG_CHECK_DOCBOOK
6982b534f209Smrg# -------------------
6983b534f209Smrg# Minimum version: 1.0.0
6984b410ddbeSmrg#
6985b534f209Smrg# Checks for the ability to build output formats from SGML DocBook source.
6986b534f209Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
6987b534f209Smrg# indicates whether the necessary tools and files are found and, if set,
6988b534f209Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
6989b534f209SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
6990b534f209SmrgXORG_SGML_PATH=$prefix/share/sgml
6991b534f209SmrgHAVE_DEFS_ENT=
6992b534f209SmrgBUILDTXTDOC=no
6993b534f209SmrgBUILDPDFDOC=no
6994b534f209SmrgBUILDPSDOC=no
6995b534f209SmrgBUILDHTMLDOC=no
699615fb4814Smrg
6997b534f209SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
6998b410ddbeSmrg
6999b534f209SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
7000b534f209SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
7001b534f209SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
7002b534f209SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
700315fb4814Smrg
7004b534f209SmrgAC_MSG_CHECKING([Whether to build text documentation])
7005b534f209Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
7006b534f209Smrg   test x$BUILD_TXTDOC != xno; then
7007b534f209Smrg	BUILDTXTDOC=yes
700815fb4814Smrgfi
7009b534f209SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
7010b534f209SmrgAC_MSG_RESULT([$BUILDTXTDOC])
701115fb4814Smrg
7012b534f209SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
7013b534f209Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
7014b534f209Smrg   test x$BUILD_PDFDOC != xno; then
7015b534f209Smrg	BUILDPDFDOC=yes
7016b534f209Smrgfi
7017b534f209SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
7018b534f209SmrgAC_MSG_RESULT([$BUILDPDFDOC])
701915fb4814Smrg
7020b534f209SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
7021b534f209Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
7022b534f209Smrg   test x$BUILD_PSDOC != xno; then
7023b534f209Smrg	BUILDPSDOC=yes
7024b534f209Smrgfi
7025b534f209SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
7026b534f209SmrgAC_MSG_RESULT([$BUILDPSDOC])
702715fb4814Smrg
7028b534f209SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
7029b534f209Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
7030b534f209Smrg   test x$BUILD_HTMLDOC != xno; then
7031b534f209Smrg	BUILDHTMLDOC=yes
7032b534f209Smrgfi
7033b534f209SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
7034b534f209SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
703515fb4814Smrg
7036b534f209SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
7037b534f209SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
7038b534f209SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
7039b534f209SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
704015fb4814Smrg
7041b534f209SmrgAC_SUBST(MAKE_TEXT)
7042b534f209SmrgAC_SUBST(MAKE_PS)
7043b534f209SmrgAC_SUBST(MAKE_PDF)
7044b534f209SmrgAC_SUBST(MAKE_HTML)
7045b534f209Smrg]) # XORG_CHECK_DOCBOOK
704615fb4814Smrg
7047b534f209Smrg# XORG_CHECK_MALLOC_ZERO
7048b534f209Smrg# ----------------------
7049b534f209Smrg# Minimum version: 1.0.0
705015fb4814Smrg#
7051b534f209Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
7052b534f209Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
7053b534f209Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
7054b534f209SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
7055b534f209SmrgAC_ARG_ENABLE(malloc0returnsnull,
7056b534f209Smrg	AC_HELP_STRING([--enable-malloc0returnsnull],
7057b534f209Smrg		       [malloc(0) returns NULL (default: auto)]),
7058b534f209Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
7059b534f209Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
706015fb4814Smrg
7061b534f209SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
7062b534f209Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
7063b534f209Smrg	AC_RUN_IFELSE([
7064b534f209Smrgchar *malloc();
7065b534f209Smrgchar *realloc();
7066b534f209Smrgchar *calloc();
7067b534f209Smrgmain() {
7068b534f209Smrg    char *m0, *r0, *c0, *p;
7069b534f209Smrg    m0 = malloc(0);
7070b534f209Smrg    p = malloc(10);
7071b534f209Smrg    r0 = realloc(p,0);
7072b534f209Smrg    c0 = calloc(0);
7073b534f209Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
7074b534f209Smrg}],
7075b534f209Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
7076b534f209Smrg		[MALLOC_ZERO_RETURNS_NULL=no])
7077b534f209Smrgfi
7078b534f209SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
707915fb4814Smrg
7080b534f209Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
7081b534f209Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
7082b534f209Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
7083b534f209Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
708415fb4814Smrgelse
7085b534f209Smrg	MALLOC_ZERO_CFLAGS=""
7086b534f209Smrg	XMALLOC_ZERO_CFLAGS=""
7087b534f209Smrg	XTMALLOC_ZERO_CFLAGS=""
7088b534f209Smrgfi
708915fb4814Smrg
7090b534f209SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
7091b534f209SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
7092b534f209SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
7093b534f209Smrg]) # XORG_CHECK_MALLOC_ZERO
709415fb4814Smrg
7095b534f209Smrg# XORG_WITH_LINT()
7096b534f209Smrg# ----------------
709783cab373Smrg# Minimum version: 1.1.0
709815fb4814Smrg#
7099b534f209Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
7100b534f209Smrg# is specified.   (Use --with-lint=sparse for sparse.)
7101b534f209Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
7102b534f209Smrg# Sets $LINT_FLAGS to flags to pass to source checker
7103b534f209Smrg# Sets LINT automake conditional if enabled (default: disabled)
710415fb4814Smrg#
7105b534f209SmrgAC_DEFUN([XORG_WITH_LINT],[
710615fb4814Smrg
7107b534f209Smrg# Allow checking code with lint, sparse, etc.
7108b534f209SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
7109b534f209Smrg		[Use a lint-style source code checker (default: disabled)])],
7110b534f209Smrg		[use_lint=$withval], [use_lint=no])
7111b534f209Smrgif test "x$use_lint" = "xyes" ; then
7112b534f209Smrg	LINT="lint"
711383cab373Smrgelse
7114b534f209Smrg	LINT="$use_lint"
7115b534f209Smrgfi
7116b534f209Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
7117b534f209Smrg    case $LINT in
7118b534f209Smrg	lint|*/lint)
7119b534f209Smrg	    case $host_os in
7120b534f209Smrg		solaris*)
7121b534f209Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
7122b534f209Smrg			;;
7123b534f209Smrg	    esac
7124b534f209Smrg	    ;;
7125b534f209Smrg    esac
712683cab373Smrgfi
712715fb4814Smrg
7128b534f209SmrgAC_SUBST(LINT)
7129b534f209SmrgAC_SUBST(LINT_FLAGS)
7130b534f209SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
7131b534f209Smrg
7132b534f209Smrg]) # XORG_WITH_LINT
7133b534f209Smrg
7134b534f209Smrg# XORG_LINT_LIBRARY(LIBNAME)
7135b534f209Smrg# --------------------------
7136b534f209Smrg# Minimum version: 1.1.0
7137b534f209Smrg#
7138b534f209Smrg# Sets up flags for building lint libraries for checking programs that call
7139b534f209Smrg# functions in the library.
7140b534f209Smrg# Disabled by default, enable with --enable-lint-library
7141b534f209Smrg# Sets: 
7142b534f209Smrg#	@LINTLIB@		- name of lint library file to make
7143b534f209Smrg#	MAKE_LINT_LIB		- automake conditional
7144b534f209Smrg#
7145b534f209Smrg
7146b534f209SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
7147b534f209SmrgAC_REQUIRE([XORG_WITH_LINT])
7148b534f209Smrg# Build lint "library" for more indepth checks of programs calling this library
7149b534f209SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
7150b534f209Smrg	[Create lint library (default: disabled)])],
7151b534f209Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
7152b534f209Smrgif test "x$make_lint_lib" != "xno" ; then
7153b534f209Smrg	if test "x$LINT" = "xno" ; then
7154b534f209Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
7155b534f209Smrg	fi
7156b534f209Smrg	if test "x$make_lint_lib" = "xyes" ; then
7157b534f209Smrg		LINTLIB=llib-l$1.ln
715883cab373Smrg	else
7159b534f209Smrg		LINTLIB=$make_lint_lib
716083cab373Smrg	fi
716115fb4814Smrgfi
7162b534f209SmrgAC_SUBST(LINTLIB)
7163b534f209SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
716415fb4814Smrg
7165b534f209Smrg]) # XORG_LINT_LIBRARY
7166b534f209Smrg
7167b534f209Smrg# Copyright (C) 2002, 2003, 2005, 2006  Free Software Foundation, Inc.
716815fb4814Smrg#
7169b534f209Smrg# This file is free software; the Free Software Foundation
7170b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7171b534f209Smrg# with or without modifications, as long as this notice is preserved.
717215fb4814Smrg
7173b534f209Smrg# AM_AUTOMAKE_VERSION(VERSION)
7174b534f209Smrg# ----------------------------
7175b534f209Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
7176b534f209Smrg# generated from the m4 files accompanying Automake X.Y.
7177b534f209Smrg# (This private macro should not be called outside this file.)
7178b534f209SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
7179b534f209Smrg[am__api_version='1.10'
7180b534f209Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
7181b534f209Smrgdnl require some minimum version.  Point them to the right macro.
7182b534f209Smrgm4_if([$1], [1.10], [],
7183b534f209Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
7184b534f209Smrg])
718515fb4814Smrg
7186b534f209Smrg# _AM_AUTOCONF_VERSION(VERSION)
7187b534f209Smrg# -----------------------------
7188b534f209Smrg# aclocal traces this macro to find the Autoconf version.
7189b534f209Smrg# This is a private macro too.  Using m4_define simplifies
7190b534f209Smrg# the logic in aclocal, which can simply ignore this definition.
7191b534f209Smrgm4_define([_AM_AUTOCONF_VERSION], [])
719215fb4814Smrg
7193b534f209Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
7194b534f209Smrg# -------------------------------
7195b534f209Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
7196b534f209Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
7197b534f209SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
7198b534f209Smrg[AM_AUTOMAKE_VERSION([1.10])dnl
7199b534f209Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
720015fb4814Smrg
7201b534f209Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
720215fb4814Smrg
7203b534f209Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7204b534f209Smrg#
7205b534f209Smrg# This file is free software; the Free Software Foundation
7206b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7207b534f209Smrg# with or without modifications, as long as this notice is preserved.
7208b534f209Smrg
7209b534f209Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
7210b534f209Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
7211b534f209Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
7212b534f209Smrg#
7213b534f209Smrg# Of course, Automake must honor this variable whenever it calls a
7214b534f209Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
7215b534f209Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
7216b534f209Smrg# depending on how configure is run.  This is pretty annoying, since
7217b534f209Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
7218b534f209Smrg# source directory, any form will work fine, but in subdirectories a
7219b534f209Smrg# relative path needs to be adjusted first.
7220b534f209Smrg#
7221b534f209Smrg# $ac_aux_dir/missing
7222b534f209Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
7223b534f209Smrg# $top_srcdir/$ac_aux_dir/missing
7224b534f209Smrg#    fails if $ac_aux_dir is absolute,
7225b534f209Smrg#    fails when called from a subdirectory in a VPATH build with
7226b534f209Smrg#          a relative $ac_aux_dir
7227b534f209Smrg#
7228b534f209Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
7229b534f209Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
7230b534f209Smrg# harmless because $srcdir is `.', but things will broke when you
7231b534f209Smrg# start a VPATH build or use an absolute $srcdir.
7232b534f209Smrg#
7233b534f209Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
7234b534f209Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
7235b534f209Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
7236b534f209Smrg# and then we would define $MISSING as
7237b534f209Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
7238b534f209Smrg# This will work as long as MISSING is not called from configure, because
7239b534f209Smrg# unfortunately $(top_srcdir) has no meaning in configure.
7240b534f209Smrg# However there are other variables, like CC, which are often used in
7241b534f209Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
7242b534f209Smrg#
7243b534f209Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
7244b534f209Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
7245b534f209Smrg# configured tree to be moved without reconfiguration.
7246b534f209Smrg
7247b534f209SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
7248b534f209Smrg[dnl Rely on autoconf to set up CDPATH properly.
7249b534f209SmrgAC_PREREQ([2.50])dnl
7250b534f209Smrg# expand $ac_aux_dir to an absolute path
7251b534f209Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
7252b534f209Smrg])
7253b534f209Smrg
7254b534f209Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
7255b534f209Smrg
7256b534f209Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
7257b534f209Smrg# Free Software Foundation, Inc.
7258b534f209Smrg#
7259b534f209Smrg# This file is free software; the Free Software Foundation
7260b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7261b534f209Smrg# with or without modifications, as long as this notice is preserved.
726215fb4814Smrg
7263b534f209Smrg# serial 8
726415fb4814Smrg
7265b534f209Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
7266b534f209Smrg# -------------------------------------
7267b534f209Smrg# Define a conditional.
7268b534f209SmrgAC_DEFUN([AM_CONDITIONAL],
7269b534f209Smrg[AC_PREREQ(2.52)dnl
7270b534f209Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
7271b534f209Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
7272b534f209SmrgAC_SUBST([$1_TRUE])dnl
7273b534f209SmrgAC_SUBST([$1_FALSE])dnl
7274b534f209Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
7275b534f209Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
7276b534f209Smrgif $2; then
7277b534f209Smrg  $1_TRUE=
7278b534f209Smrg  $1_FALSE='#'
7279b534f209Smrgelse
7280b534f209Smrg  $1_TRUE='#'
7281b534f209Smrg  $1_FALSE=
728215fb4814Smrgfi
7283b534f209SmrgAC_CONFIG_COMMANDS_PRE(
7284b534f209Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
7285b534f209Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
7286b534f209SmrgUsually this means the macro was only invoked conditionally.]])
7287b534f209Smrgfi])])
728815fb4814Smrg
7289b534f209Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7290b534f209Smrg# Free Software Foundation, Inc.
7291b534f209Smrg#
7292b534f209Smrg# This file is free software; the Free Software Foundation
7293b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7294b534f209Smrg# with or without modifications, as long as this notice is preserved.
729515fb4814Smrg
7296b534f209Smrg# serial 9
7297b410ddbeSmrg
7298b534f209Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
7299b534f209Smrg# written in clear, in which case automake, when reading aclocal.m4,
7300b534f209Smrg# will think it sees a *use*, and therefore will trigger all it's
7301b534f209Smrg# C support machinery.  Also note that it means that autoscan, seeing
7302b534f209Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
7303b410ddbeSmrg
730415fb4814Smrg
7305b534f209Smrg# _AM_DEPENDENCIES(NAME)
7306b534f209Smrg# ----------------------
7307b534f209Smrg# See how the compiler implements dependency checking.
7308b534f209Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
7309b534f209Smrg# We try a few techniques and use that to set a single cache variable.
7310b410ddbeSmrg#
7311b534f209Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
7312b534f209Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
7313b534f209Smrg# dependency, and given that the user is not expected to run this macro,
7314b534f209Smrg# just rely on AC_PROG_CC.
7315b534f209SmrgAC_DEFUN([_AM_DEPENDENCIES],
7316b534f209Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
7317b534f209SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
7318b534f209SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
7319b534f209SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
7320b410ddbeSmrg
7321b534f209Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
7322b534f209Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
7323b534f209Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
7324b534f209Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
7325b534f209Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
7326b534f209Smrg                   [depcc="$$1"   am_compiler_list=])
7327b410ddbeSmrg
7328b534f209SmrgAC_CACHE_CHECK([dependency style of $depcc],
7329b534f209Smrg               [am_cv_$1_dependencies_compiler_type],
7330b534f209Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
7331b534f209Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
7332b534f209Smrg  # making bogus files that we don't know about and never remove.  For
7333b534f209Smrg  # instance it was reported that on HP-UX the gcc test will end up
7334b534f209Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
7335b534f209Smrg  # in D'.
7336b534f209Smrg  mkdir conftest.dir
7337b534f209Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
7338b534f209Smrg  # using a relative directory.
7339b534f209Smrg  cp "$am_depcomp" conftest.dir
7340b534f209Smrg  cd conftest.dir
7341b534f209Smrg  # We will build objects and dependencies in a subdirectory because
7342b534f209Smrg  # it helps to detect inapplicable dependency modes.  For instance
7343b534f209Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
7344b534f209Smrg  # side effect of compilation, but ICC will put the dependencies in
7345b534f209Smrg  # the current directory while Tru64 will put them in the object
7346b534f209Smrg  # directory.
7347b534f209Smrg  mkdir sub
734815fb4814Smrg
7349b534f209Smrg  am_cv_$1_dependencies_compiler_type=none
7350b534f209Smrg  if test "$am_compiler_list" = ""; then
7351b534f209Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
7352b534f209Smrg  fi
7353b534f209Smrg  for depmode in $am_compiler_list; do
7354b534f209Smrg    # Setup a source with many dependencies, because some compilers
7355b534f209Smrg    # like to wrap large dependency lists on column 80 (with \), and
7356b534f209Smrg    # we should not choose a depcomp mode which is confused by this.
7357b534f209Smrg    #
7358b534f209Smrg    # We need to recreate these files for each test, as the compiler may
7359b534f209Smrg    # overwrite some of them when testing with obscure command lines.
7360b534f209Smrg    # This happens at least with the AIX C compiler.
7361b534f209Smrg    : > sub/conftest.c
7362b534f209Smrg    for i in 1 2 3 4 5 6; do
7363b534f209Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
7364b534f209Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
7365b534f209Smrg      # Solaris 8's {/usr,}/bin/sh.
7366b534f209Smrg      touch sub/conftst$i.h
7367b534f209Smrg    done
7368b534f209Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
736915fb4814Smrg
7370b534f209Smrg    case $depmode in
7371b534f209Smrg    nosideeffect)
7372b534f209Smrg      # after this tag, mechanisms are not by side-effect, so they'll
7373b534f209Smrg      # only be used when explicitly requested
7374b534f209Smrg      if test "x$enable_dependency_tracking" = xyes; then
7375b534f209Smrg	continue
7376b534f209Smrg      else
7377b534f209Smrg	break
7378b534f209Smrg      fi
7379b534f209Smrg      ;;
7380b534f209Smrg    none) break ;;
7381b534f209Smrg    esac
7382b534f209Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
7383b534f209Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
7384b534f209Smrg    # handle `-M -o', and we need to detect this.
7385b534f209Smrg    if depmode=$depmode \
7386b534f209Smrg       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
7387b534f209Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
7388b534f209Smrg       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
7389b534f209Smrg         >/dev/null 2>conftest.err &&
7390b534f209Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
7391b534f209Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
7392b534f209Smrg       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
7393b534f209Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
7394b534f209Smrg      # icc doesn't choke on unknown options, it will just issue warnings
7395b534f209Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
7396b534f209Smrg      # that says an option was ignored or not supported.
7397b534f209Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
7398b534f209Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
7399b534f209Smrg      # The diagnosis changed in icc 8.0:
7400b534f209Smrg      #   icc: Command line remark: option '-MP' not supported
7401b534f209Smrg      if (grep 'ignoring option' conftest.err ||
7402b534f209Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
7403b534f209Smrg        am_cv_$1_dependencies_compiler_type=$depmode
7404b534f209Smrg        break
7405b534f209Smrg      fi
7406b534f209Smrg    fi
7407b534f209Smrg  done
740815fb4814Smrg
7409b534f209Smrg  cd ..
7410b534f209Smrg  rm -rf conftest.dir
741183cab373Smrgelse
7412b534f209Smrg  am_cv_$1_dependencies_compiler_type=none
741383cab373Smrgfi
7414b534f209Smrg])
7415b534f209SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
7416b534f209SmrgAM_CONDITIONAL([am__fastdep$1], [
7417b534f209Smrg  test "x$enable_dependency_tracking" != xno \
7418b534f209Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
7419b534f209Smrg])
742015fb4814Smrg
742115fb4814Smrg
7422b534f209Smrg# AM_SET_DEPDIR
7423b534f209Smrg# -------------
7424b534f209Smrg# Choose a directory name for dependency files.
7425b534f209Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
7426b534f209SmrgAC_DEFUN([AM_SET_DEPDIR],
7427b534f209Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
7428b534f209SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
7429b534f209Smrg])
743015fb4814Smrg
743115fb4814Smrg
7432b534f209Smrg# AM_DEP_TRACK
7433b534f209Smrg# ------------
7434b534f209SmrgAC_DEFUN([AM_DEP_TRACK],
7435b534f209Smrg[AC_ARG_ENABLE(dependency-tracking,
7436b534f209Smrg[  --disable-dependency-tracking  speeds up one-time build
7437b534f209Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
7438b534f209Smrgif test "x$enable_dependency_tracking" != xno; then
7439b534f209Smrg  am_depcomp="$ac_aux_dir/depcomp"
7440b534f209Smrg  AMDEPBACKSLASH='\'
7441b410ddbeSmrgfi
7442b534f209SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
7443b534f209SmrgAC_SUBST([AMDEPBACKSLASH])dnl
7444b534f209Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
7445b534f209Smrg])
7446b410ddbeSmrg
7447b534f209Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
7448b410ddbeSmrg
7449b534f209Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
7450b534f209Smrg# Free Software Foundation, Inc.
7451b534f209Smrg#
7452b534f209Smrg# This file is free software; the Free Software Foundation
7453b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7454b534f209Smrg# with or without modifications, as long as this notice is preserved.
7455b410ddbeSmrg
7456b534f209Smrg#serial 3
7457b410ddbeSmrg
7458b534f209Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
7459b534f209Smrg# ------------------------------
7460b534f209SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
7461b534f209Smrg[for mf in $CONFIG_FILES; do
7462b534f209Smrg  # Strip MF so we end up with the name of the file.
7463b534f209Smrg  mf=`echo "$mf" | sed -e 's/:.*$//'`
7464b534f209Smrg  # Check whether this is an Automake generated Makefile or not.
7465b534f209Smrg  # We used to match only the files named `Makefile.in', but
7466b534f209Smrg  # some people rename them; so instead we look at the file content.
7467b534f209Smrg  # Grep'ing the first line is not enough: some people post-process
7468b534f209Smrg  # each Makefile.in and add a new line on top of each file to say so.
7469b534f209Smrg  # Grep'ing the whole file is not good either: AIX grep has a line
7470b534f209Smrg  # limit of 2048, but all sed's we know have understand at least 4000.
7471b534f209Smrg  if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
7472b534f209Smrg    dirpart=`AS_DIRNAME("$mf")`
7473b534f209Smrg  else
7474b534f209Smrg    continue
7475b534f209Smrg  fi
7476b534f209Smrg  # Extract the definition of DEPDIR, am__include, and am__quote
7477b534f209Smrg  # from the Makefile without running `make'.
7478b534f209Smrg  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
7479b534f209Smrg  test -z "$DEPDIR" && continue
7480b534f209Smrg  am__include=`sed -n 's/^am__include = //p' < "$mf"`
7481b534f209Smrg  test -z "am__include" && continue
7482b534f209Smrg  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
7483b534f209Smrg  # When using ansi2knr, U may be empty or an underscore; expand it
7484b534f209Smrg  U=`sed -n 's/^U = //p' < "$mf"`
7485b534f209Smrg  # Find all dependency output files, they are included files with
7486b534f209Smrg  # $(DEPDIR) in their names.  We invoke sed twice because it is the
7487b534f209Smrg  # simplest approach to changing $(DEPDIR) to its actual value in the
7488b534f209Smrg  # expansion.
7489b534f209Smrg  for file in `sed -n "
7490b534f209Smrg    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
7491b534f209Smrg       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
7492b534f209Smrg    # Make sure the directory exists.
7493b534f209Smrg    test -f "$dirpart/$file" && continue
7494b534f209Smrg    fdir=`AS_DIRNAME(["$file"])`
7495b534f209Smrg    AS_MKDIR_P([$dirpart/$fdir])
7496b534f209Smrg    # echo "creating $dirpart/$file"
7497b534f209Smrg    echo '# dummy' > "$dirpart/$file"
7498b534f209Smrg  done
7499b534f209Smrgdone
7500b534f209Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
7501b410ddbeSmrg
7502b534f209Smrg
7503b534f209Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
7504b534f209Smrg# -----------------------------
7505b534f209Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
7506b410ddbeSmrg#
7507b534f209Smrg# This code is only required when automatic dependency tracking
7508b534f209Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
7509b534f209Smrg# need in order to bootstrap the dependency handling code.
7510b534f209SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
7511b534f209Smrg[AC_CONFIG_COMMANDS([depfiles],
7512b534f209Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
7513b534f209Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
7514b534f209Smrg])
7515b410ddbeSmrg
7516b534f209Smrg# Do all the work for Automake.                             -*- Autoconf -*-
7517b410ddbeSmrg
7518b534f209Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
7519b534f209Smrg# 2005, 2006 Free Software Foundation, Inc.
7520b534f209Smrg#
7521b534f209Smrg# This file is free software; the Free Software Foundation
7522b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7523b534f209Smrg# with or without modifications, as long as this notice is preserved.
7524b410ddbeSmrg
7525b534f209Smrg# serial 12
7526b410ddbeSmrg
7527b534f209Smrg# This macro actually does too much.  Some checks are only needed if
7528b534f209Smrg# your package does certain things.  But this isn't really a big deal.
7529b410ddbeSmrg
7530b534f209Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
7531b534f209Smrg# AM_INIT_AUTOMAKE([OPTIONS])
7532b534f209Smrg# -----------------------------------------------
7533b534f209Smrg# The call with PACKAGE and VERSION arguments is the old style
7534b534f209Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
7535b534f209Smrg# and VERSION should now be passed to AC_INIT and removed from
7536b534f209Smrg# the call to AM_INIT_AUTOMAKE.
7537b534f209Smrg# We support both call styles for the transition.  After
7538b534f209Smrg# the next Automake release, Autoconf can make the AC_INIT
7539b534f209Smrg# arguments mandatory, and then we can depend on a new Autoconf
7540b534f209Smrg# release and drop the old call support.
7541b534f209SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
7542b534f209Smrg[AC_PREREQ([2.60])dnl
7543b534f209Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
7544b534f209Smrgdnl the ones we care about.
7545b534f209Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
7546b534f209SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
7547b534f209SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
7548b534f209Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
7549b534f209Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
7550b534f209Smrg  # is not polluted with repeated "-I."
7551b534f209Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
7552b534f209Smrg  # test to see if srcdir already configured
7553b534f209Smrg  if test -f $srcdir/config.status; then
7554b534f209Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
7555b534f209Smrg  fi
7556b410ddbeSmrgfi
7557b410ddbeSmrg
7558b534f209Smrg# test whether we have cygpath
7559b534f209Smrgif test -z "$CYGPATH_W"; then
7560b534f209Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
7561b534f209Smrg    CYGPATH_W='cygpath -w'
7562b534f209Smrg  else
7563b534f209Smrg    CYGPATH_W=echo
7564b534f209Smrg  fi
7565b410ddbeSmrgfi
7566b534f209SmrgAC_SUBST([CYGPATH_W])
7567b410ddbeSmrg
7568b534f209Smrg# Define the identity of the package.
7569b534f209Smrgdnl Distinguish between old-style and new-style calls.
7570b534f209Smrgm4_ifval([$2],
7571b534f209Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
7572b534f209Smrg AC_SUBST([PACKAGE], [$1])dnl
7573b534f209Smrg AC_SUBST([VERSION], [$2])],
7574b534f209Smrg[_AM_SET_OPTIONS([$1])dnl
7575b534f209Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
7576b534f209Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
7577b534f209Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
7578b534f209Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
7579b534f209Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
7580b410ddbeSmrg
7581b534f209Smrg_AM_IF_OPTION([no-define],,
7582b534f209Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
7583b534f209Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
7584b410ddbeSmrg
7585b534f209Smrg# Some tools Automake needs.
7586b534f209SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
7587b534f209SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
7588b534f209SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
7589b534f209SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
7590b534f209SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
7591b534f209SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
7592b534f209SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
7593b534f209SmrgAM_PROG_INSTALL_SH
7594b534f209SmrgAM_PROG_INSTALL_STRIP
7595b534f209SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
7596b534f209Smrg# We need awk for the "check" target.  The system "awk" is bad on
7597b534f209Smrg# some platforms.
7598b534f209SmrgAC_REQUIRE([AC_PROG_AWK])dnl
7599b534f209SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
7600b534f209SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
7601b534f209Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
7602b534f209Smrg              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
7603b534f209Smrg	      		     [_AM_PROG_TAR([v7])])])
7604b534f209Smrg_AM_IF_OPTION([no-dependencies],,
7605b534f209Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
7606b534f209Smrg                  [_AM_DEPENDENCIES(CC)],
7607b534f209Smrg                  [define([AC_PROG_CC],
7608b534f209Smrg                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
7609b534f209SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
7610b534f209Smrg                  [_AM_DEPENDENCIES(CXX)],
7611b534f209Smrg                  [define([AC_PROG_CXX],
7612b534f209Smrg                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
7613b534f209SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
7614b534f209Smrg                  [_AM_DEPENDENCIES(OBJC)],
7615b534f209Smrg                  [define([AC_PROG_OBJC],
7616b534f209Smrg                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
7617b534f209Smrg])
7618b534f209Smrg])
7619b410ddbeSmrg
7620b410ddbeSmrg
7621b534f209Smrg# When config.status generates a header, we must update the stamp-h file.
7622b534f209Smrg# This file resides in the same directory as the config header
7623b534f209Smrg# that is generated.  The stamp files are numbered to have different names.
7624b410ddbeSmrg
7625b534f209Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
7626b534f209Smrg# loop where config.status creates the headers, so we can generate
7627b534f209Smrg# our stamp files there.
7628b534f209SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
7629b534f209Smrg[# Compute $1's index in $config_headers.
7630b534f209Smrg_am_stamp_count=1
7631b534f209Smrgfor _am_header in $config_headers :; do
7632b534f209Smrg  case $_am_header in
7633b534f209Smrg    $1 | $1:* )
7634b534f209Smrg      break ;;
7635b534f209Smrg    * )
7636b534f209Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
7637b534f209Smrg  esac
7638b534f209Smrgdone
7639b534f209Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
7640b410ddbeSmrg
7641b534f209Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7642b410ddbeSmrg#
7643b534f209Smrg# This file is free software; the Free Software Foundation
7644b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7645b534f209Smrg# with or without modifications, as long as this notice is preserved.
7646b410ddbeSmrg
7647b534f209Smrg# AM_PROG_INSTALL_SH
7648b534f209Smrg# ------------------
7649b534f209Smrg# Define $install_sh.
7650b534f209SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
7651b534f209Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7652b534f209Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
7653b534f209SmrgAC_SUBST(install_sh)])
7654b410ddbeSmrg
7655b534f209Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
7656b410ddbeSmrg#
7657b534f209Smrg# This file is free software; the Free Software Foundation
7658b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7659b534f209Smrg# with or without modifications, as long as this notice is preserved.
7660b410ddbeSmrg
7661b534f209Smrg# serial 2
7662b534f209Smrg
7663b534f209Smrg# Check whether the underlying file-system supports filenames
7664b534f209Smrg# with a leading dot.  For instance MS-DOS doesn't.
7665b534f209SmrgAC_DEFUN([AM_SET_LEADING_DOT],
7666b534f209Smrg[rm -rf .tst 2>/dev/null
7667b534f209Smrgmkdir .tst 2>/dev/null
7668b534f209Smrgif test -d .tst; then
7669b534f209Smrg  am__leading_dot=.
7670b410ddbeSmrgelse
7671b534f209Smrg  am__leading_dot=_
7672b410ddbeSmrgfi
7673b534f209Smrgrmdir .tst 2>/dev/null
7674b534f209SmrgAC_SUBST([am__leading_dot])])
7675b410ddbeSmrg
7676b534f209Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
7677b534f209Smrg# From Jim Meyering
7678b534f209Smrg
7679b534f209Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
7680b534f209Smrg# Free Software Foundation, Inc.
7681b410ddbeSmrg#
7682b534f209Smrg# This file is free software; the Free Software Foundation
7683b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7684b534f209Smrg# with or without modifications, as long as this notice is preserved.
7685b534f209Smrg
7686b534f209Smrg# serial 4
7687b534f209Smrg
7688b534f209SmrgAC_DEFUN([AM_MAINTAINER_MODE],
7689b534f209Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
7690b534f209Smrg  dnl maintainer-mode is disabled by default
7691b534f209Smrg  AC_ARG_ENABLE(maintainer-mode,
7692b534f209Smrg[  --enable-maintainer-mode  enable make rules and dependencies not useful
7693b534f209Smrg			  (and sometimes confusing) to the casual installer],
7694b534f209Smrg      USE_MAINTAINER_MODE=$enableval,
7695b534f209Smrg      USE_MAINTAINER_MODE=no)
7696b534f209Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
7697b534f209Smrg  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
7698b534f209Smrg  MAINT=$MAINTAINER_MODE_TRUE
7699b534f209Smrg  AC_SUBST(MAINT)dnl
7700b534f209Smrg]
7701b534f209Smrg)
7702b534f209Smrg
7703b534f209SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
7704b534f209Smrg
7705b534f209Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
7706b534f209Smrg
7707b534f209Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7708b410ddbeSmrg#
7709b534f209Smrg# This file is free software; the Free Software Foundation
7710b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7711b534f209Smrg# with or without modifications, as long as this notice is preserved.
7712b410ddbeSmrg
7713b534f209Smrg# serial 3
771415fb4814Smrg
7715b534f209Smrg# AM_MAKE_INCLUDE()
7716b534f209Smrg# -----------------
7717b534f209Smrg# Check to see how make treats includes.
7718b534f209SmrgAC_DEFUN([AM_MAKE_INCLUDE],
7719b534f209Smrg[am_make=${MAKE-make}
7720b534f209Smrgcat > confinc << 'END'
7721b534f209Smrgam__doit:
7722b534f209Smrg	@echo done
7723b534f209Smrg.PHONY: am__doit
7724b534f209SmrgEND
7725b534f209Smrg# If we don't find an include directive, just comment out the code.
7726b534f209SmrgAC_MSG_CHECKING([for style of include used by $am_make])
7727b534f209Smrgam__include="#"
7728b534f209Smrgam__quote=
7729b534f209Smrg_am_result=none
7730b534f209Smrg# First try GNU make style include.
7731b534f209Smrgecho "include confinc" > confmf
7732b534f209Smrg# We grep out `Entering directory' and `Leaving directory'
7733b534f209Smrg# messages which can occur if `w' ends up in MAKEFLAGS.
7734b534f209Smrg# In particular we don't look at `^make:' because GNU make might
7735b534f209Smrg# be invoked under some other name (usually "gmake"), in which
7736b534f209Smrg# case it prints its new name instead of `make'.
7737b534f209Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
7738b534f209Smrg   am__include=include
7739b534f209Smrg   am__quote=
7740b534f209Smrg   _am_result=GNU
7741b410ddbeSmrgfi
7742b534f209Smrg# Now try BSD make style include.
7743b534f209Smrgif test "$am__include" = "#"; then
7744b534f209Smrg   echo '.include "confinc"' > confmf
7745b534f209Smrg   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
7746b534f209Smrg      am__include=.include
7747b534f209Smrg      am__quote="\""
7748b534f209Smrg      _am_result=BSD
7749b410ddbeSmrg   fi
7750b410ddbeSmrgfi
7751b534f209SmrgAC_SUBST([am__include])
7752b534f209SmrgAC_SUBST([am__quote])
7753b534f209SmrgAC_MSG_RESULT([$_am_result])
7754b534f209Smrgrm -f confinc confmf
7755b534f209Smrg])
775615fb4814Smrg
7757b534f209Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
775883cab373Smrg
7759b534f209Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
7760b534f209Smrg# Free Software Foundation, Inc.
7761b410ddbeSmrg#
7762b534f209Smrg# This file is free software; the Free Software Foundation
7763b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7764b534f209Smrg# with or without modifications, as long as this notice is preserved.
7765b410ddbeSmrg
7766b534f209Smrg# serial 5
7767b534f209Smrg
7768b534f209Smrg# AM_MISSING_PROG(NAME, PROGRAM)
7769b534f209Smrg# ------------------------------
7770b534f209SmrgAC_DEFUN([AM_MISSING_PROG],
7771b534f209Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
7772b534f209Smrg$1=${$1-"${am_missing_run}$2"}
7773b534f209SmrgAC_SUBST($1)])
7774b534f209Smrg
7775b534f209Smrg
7776b534f209Smrg# AM_MISSING_HAS_RUN
7777b534f209Smrg# ------------------
7778b534f209Smrg# Define MISSING if not defined so far and test if it supports --run.
7779b534f209Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
7780b534f209SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
7781b534f209Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
7782b534f209SmrgAC_REQUIRE_AUX_FILE([missing])dnl
7783b534f209Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
7784b534f209Smrg# Use eval to expand $SHELL
7785b534f209Smrgif eval "$MISSING --run true"; then
7786b534f209Smrg  am_missing_run="$MISSING --run "
7787b410ddbeSmrgelse
7788b534f209Smrg  am_missing_run=
7789b534f209Smrg  AC_MSG_WARN([`missing' script is too old or missing])
779083cab373Smrgfi
7791b534f209Smrg])
779215fb4814Smrg
7793b534f209Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
7794b410ddbeSmrg#
7795b534f209Smrg# This file is free software; the Free Software Foundation
7796b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7797b534f209Smrg# with or without modifications, as long as this notice is preserved.
7798b534f209Smrg
7799b534f209Smrg# AM_PROG_MKDIR_P
7800b534f209Smrg# ---------------
7801b534f209Smrg# Check for `mkdir -p'.
7802b534f209SmrgAC_DEFUN([AM_PROG_MKDIR_P],
7803b534f209Smrg[AC_PREREQ([2.60])dnl
7804b534f209SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
7805b534f209Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
7806b534f209Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
7807b534f209Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
7808b534f209Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
7809b534f209Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
7810b534f209Smrgdnl adjustment using top_builddir (which is defined more often than
7811b534f209Smrgdnl MKDIR_P).
7812b534f209SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
7813b534f209Smrgcase $mkdir_p in
7814b534f209Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
7815b534f209Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
7816b534f209Smrgesac
7817b534f209Smrg])
7818b534f209Smrg
7819b534f209Smrg# Helper functions for option handling.                     -*- Autoconf -*-
7820b534f209Smrg
7821b534f209Smrg# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
7822b410ddbeSmrg#
7823b534f209Smrg# This file is free software; the Free Software Foundation
7824b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7825b534f209Smrg# with or without modifications, as long as this notice is preserved.
7826b534f209Smrg
7827b534f209Smrg# serial 3
7828b534f209Smrg
7829b534f209Smrg# _AM_MANGLE_OPTION(NAME)
7830b534f209Smrg# -----------------------
7831b534f209SmrgAC_DEFUN([_AM_MANGLE_OPTION],
7832b534f209Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
7833b534f209Smrg
7834b534f209Smrg# _AM_SET_OPTION(NAME)
7835b534f209Smrg# ------------------------------
7836b534f209Smrg# Set option NAME.  Presently that only means defining a flag for this option.
7837b534f209SmrgAC_DEFUN([_AM_SET_OPTION],
7838b534f209Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
7839b534f209Smrg
7840b534f209Smrg# _AM_SET_OPTIONS(OPTIONS)
7841b534f209Smrg# ----------------------------------
7842b534f209Smrg# OPTIONS is a space-separated list of Automake options.
7843b534f209SmrgAC_DEFUN([_AM_SET_OPTIONS],
7844b534f209Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
7845b534f209Smrg
7846b534f209Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
7847b534f209Smrg# -------------------------------------------
7848b534f209Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7849b534f209SmrgAC_DEFUN([_AM_IF_OPTION],
7850b534f209Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
7851b534f209Smrg
7852b534f209Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
7853b534f209Smrg
7854b534f209Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
7855b534f209Smrg# Free Software Foundation, Inc.
7856b410ddbeSmrg#
7857b534f209Smrg# This file is free software; the Free Software Foundation
7858b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7859b534f209Smrg# with or without modifications, as long as this notice is preserved.
7860b410ddbeSmrg
7861b534f209Smrg# serial 4
7862b534f209Smrg
7863b534f209Smrg# AM_SANITY_CHECK
7864b534f209Smrg# ---------------
7865b534f209SmrgAC_DEFUN([AM_SANITY_CHECK],
7866b534f209Smrg[AC_MSG_CHECKING([whether build environment is sane])
7867b534f209Smrg# Just in case
7868b534f209Smrgsleep 1
7869b534f209Smrgecho timestamp > conftest.file
7870b534f209Smrg# Do `set' in a subshell so we don't clobber the current shell's
7871b534f209Smrg# arguments.  Must try -L first in case configure is actually a
7872b534f209Smrg# symlink; some systems play weird games with the mod time of symlinks
7873b534f209Smrg# (eg FreeBSD returns the mod time of the symlink's containing
7874b534f209Smrg# directory).
7875b534f209Smrgif (
7876b534f209Smrg   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
7877b534f209Smrg   if test "$[*]" = "X"; then
7878b534f209Smrg      # -L didn't work.
7879b534f209Smrg      set X `ls -t $srcdir/configure conftest.file`
7880b410ddbeSmrg   fi
7881b534f209Smrg   rm -f conftest.file
7882b534f209Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
7883b534f209Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
7884b534f209Smrg
7885b534f209Smrg      # If neither matched, then we have a broken ls.  This can happen
7886b534f209Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
7887b534f209Smrg      # broken ls alias from the environment.  This has actually
7888b534f209Smrg      # happened.  Such a system could not be considered "sane".
7889b534f209Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
7890b534f209Smrgalias in your environment])
7891b410ddbeSmrg   fi
789215fb4814Smrg
7893b534f209Smrg   test "$[2]" = conftest.file
7894b534f209Smrg   )
7895b534f209Smrgthen
7896b534f209Smrg   # Ok.
7897b534f209Smrg   :
7898b534f209Smrgelse
7899b534f209Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
7900b534f209SmrgCheck your system clock])
790115fb4814Smrgfi
7902b534f209SmrgAC_MSG_RESULT(yes)])
7903b410ddbeSmrg
7904b534f209Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
7905b410ddbeSmrg#
7906b534f209Smrg# This file is free software; the Free Software Foundation
7907b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7908b534f209Smrg# with or without modifications, as long as this notice is preserved.
7909b410ddbeSmrg
7910b534f209Smrg# AM_PROG_INSTALL_STRIP
7911b534f209Smrg# ---------------------
7912b534f209Smrg# One issue with vendor `install' (even GNU) is that you can't
7913b534f209Smrg# specify the program used to strip binaries.  This is especially
7914b534f209Smrg# annoying in cross-compiling environments, where the build's strip
7915b534f209Smrg# is unlikely to handle the host's binaries.
7916b534f209Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
7917b534f209Smrg# always use install-sh in `make install-strip', and initialize
7918b534f209Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
7919b534f209SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
7920b534f209Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
7921b534f209Smrg# Installed binaries are usually stripped using `strip' when the user
7922b534f209Smrg# run `make install-strip'.  However `strip' might not be the right
7923b534f209Smrg# tool to use in cross-compilation environments, therefore Automake
7924b534f209Smrg# will honor the `STRIP' environment variable to overrule this program.
7925b534f209Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
7926b534f209Smrgif test "$cross_compiling" != no; then
7927b534f209Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
792883cab373Smrgfi
7929b534f209SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
7930b534f209SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
7931de78e416Smrg
7932b534f209Smrg# Copyright (C) 2006  Free Software Foundation, Inc.
7933de78e416Smrg#
7934b534f209Smrg# This file is free software; the Free Software Foundation
7935b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7936b534f209Smrg# with or without modifications, as long as this notice is preserved.
7937de78e416Smrg
7938b534f209Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
7939b534f209Smrg# ---------------------------
7940b534f209Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
7941b534f209Smrg# This macro is traced by Automake.
7942b534f209SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
7943de78e416Smrg
7944b534f209Smrg# Check how to create a tarball.                            -*- Autoconf -*-
7945de78e416Smrg
7946b534f209Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
794783cab373Smrg#
7948b534f209Smrg# This file is free software; the Free Software Foundation
7949b534f209Smrg# gives unlimited permission to copy and/or distribute it,
7950b534f209Smrg# with or without modifications, as long as this notice is preserved.
7951b410ddbeSmrg
7952b534f209Smrg# serial 2
7953b410ddbeSmrg
7954b534f209Smrg# _AM_PROG_TAR(FORMAT)
7955b534f209Smrg# --------------------
7956b534f209Smrg# Check how to create a tarball in format FORMAT.
7957b534f209Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
7958b534f209Smrg#
7959b534f209Smrg# Substitute a variable $(am__tar) that is a command
7960b534f209Smrg# writing to stdout a FORMAT-tarball containing the directory
7961b534f209Smrg# $tardir.
7962b534f209Smrg#     tardir=directory && $(am__tar) > result.tar
7963b534f209Smrg#
7964b534f209Smrg# Substitute a variable $(am__untar) that extract such
7965b534f209Smrg# a tarball read from stdin.
7966b534f209Smrg#     $(am__untar) < result.tar
7967b534f209SmrgAC_DEFUN([_AM_PROG_TAR],
7968b534f209Smrg[# Always define AMTAR for backward compatibility.
7969b534f209SmrgAM_MISSING_PROG([AMTAR], [tar])
7970b534f209Smrgm4_if([$1], [v7],
7971b534f209Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
7972b534f209Smrg     [m4_case([$1], [ustar],, [pax],,
7973b534f209Smrg              [m4_fatal([Unknown tar format])])
7974b534f209SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
7975b534f209Smrg# Loop over all known methods to create a tar archive until one works.
7976b534f209Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
7977b534f209Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
7978b534f209Smrg# Do not fold the above two line into one, because Tru64 sh and
7979b534f209Smrg# Solaris sh will not grok spaces in the rhs of `-'.
7980b534f209Smrgfor _am_tool in $_am_tools
7981b534f209Smrgdo
7982b534f209Smrg  case $_am_tool in
7983b534f209Smrg  gnutar)
7984b534f209Smrg    for _am_tar in tar gnutar gtar;
7985b534f209Smrg    do
7986b534f209Smrg      AM_RUN_LOG([$_am_tar --version]) && break
7987b534f209Smrg    done
7988b534f209Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
7989b534f209Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
7990b534f209Smrg    am__untar="$_am_tar -xf -"
7991b534f209Smrg    ;;
7992b534f209Smrg  plaintar)
7993b534f209Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
7994b534f209Smrg    # ustar tarball either.
7995b534f209Smrg    (tar --version) >/dev/null 2>&1 && continue
7996b534f209Smrg    am__tar='tar chf - "$$tardir"'
7997b534f209Smrg    am__tar_='tar chf - "$tardir"'
7998b534f209Smrg    am__untar='tar xf -'
7999b534f209Smrg    ;;
8000b534f209Smrg  pax)
8001b534f209Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
8002b534f209Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
8003b534f209Smrg    am__untar='pax -r'
8004b534f209Smrg    ;;
8005b534f209Smrg  cpio)
8006b534f209Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
8007b534f209Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
8008b534f209Smrg    am__untar='cpio -i -H $1 -d'
8009b534f209Smrg    ;;
8010b534f209Smrg  none)
8011b534f209Smrg    am__tar=false
8012b534f209Smrg    am__tar_=false
8013b534f209Smrg    am__untar=false
8014b534f209Smrg    ;;
8015b534f209Smrg  esac
8016b410ddbeSmrg
8017b534f209Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
8018b534f209Smrg  # and am__untar set.
8019b534f209Smrg  test -n "${am_cv_prog_tar_$1}" && break
8020de78e416Smrg
8021b534f209Smrg  # tar/untar a dummy directory, and stop if the command works
8022b534f209Smrg  rm -rf conftest.dir
8023b534f209Smrg  mkdir conftest.dir
8024b534f209Smrg  echo GrepMe > conftest.dir/file
8025b534f209Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
8026b534f209Smrg  rm -rf conftest.dir
8027b534f209Smrg  if test -s conftest.tar; then
8028b534f209Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
8029b534f209Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
8030b534f209Smrg  fi
8031b534f209Smrgdone
8032b534f209Smrgrm -rf conftest.dir
8033de78e416Smrg
8034b534f209SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
8035b534f209SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
8036b534f209SmrgAC_SUBST([am__tar])
8037b534f209SmrgAC_SUBST([am__untar])
8038b534f209Smrg]) # _AM_PROG_TAR
8039de78e416Smrg
8040b534f209Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8041b534f209Smrgdnl
8042b534f209Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
8043b534f209Smrgdnl 
8044b534f209Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
8045b534f209Smrgdnl copy of this software and associated documentation files (the "Software"),
8046b534f209Smrgdnl to deal in the Software without restriction, including without limitation
8047b534f209Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8048b534f209Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
8049b534f209Smrgdnl Software is furnished to do so, subject to the following conditions:
8050b534f209Smrgdnl
8051b534f209Smrgdnl The above copyright notice and this permission notice (including the next
8052b534f209Smrgdnl paragraph) shall be included in all copies or substantial portions of the
8053b534f209Smrgdnl Software.
8054b534f209Smrgdnl
8055b534f209Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8056b534f209Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8057b534f209Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
8058b534f209Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8059b534f209Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8060b534f209Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8061b534f209Smrgdnl DEALINGS IN THE SOFTWARE.
8062b534f209Smrg
8063b534f209Smrg# XORG_MACROS_VERSION(required-version)
8064b534f209Smrg# -------------------------------------
806583cab373Smrg# Minimum version: 1.1.0
806683cab373Smrg#
8067b534f209Smrg# If you're using a macro added in Version 1.1 or newer, include this in
8068b534f209Smrg# your configure.ac with the minimum required version, such as:
8069b534f209Smrg# XORG_MACROS_VERSION(1.1)
8070b410ddbeSmrg#
8071b534f209Smrg# To ensure that this macro is defined, also add:
8072b534f209Smrg# m4_ifndef([XORG_MACROS_VERSION],
8073b534f209Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
807483cab373Smrg#
807583cab373Smrg#
8076b534f209Smrg# See the "minimum version" comment for each macro you use to see what 
8077b534f209Smrg# version you require.
8078b534f209Smrgm4_defun([XORG_MACROS_VERSION],[
8079b534f209Smrgm4_define([vers_have], [1.15.0])
8080b534f209Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8081b534f209Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8082b534f209Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
8083b534f209Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8084b534f209Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
8085b534f209Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8086b534f209Smrgm4_undefine([vers_have])
8087b534f209Smrgm4_undefine([maj_have])
8088b534f209Smrgm4_undefine([maj_needed])
8089b534f209Smrg]) # XORG_MACROS_VERSION
8090b410ddbeSmrg
8091b534f209Smrg# XORG_PROG_RAWCPP()
8092b534f209Smrg# ------------------
8093b534f209Smrg# Minimum version: 1.0.0
8094b410ddbeSmrg#
8095b534f209Smrg# Find cpp program and necessary flags for use in pre-processing text files
8096b534f209Smrg# such as man pages and config files
8097b534f209SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
8098b534f209SmrgAC_REQUIRE([AC_PROG_CPP])
8099b534f209SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
8100b534f209Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8101b410ddbeSmrg
8102b534f209Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
8103b534f209Smrg# which is not the best choice for supporting other OS'es, but covers most
8104b534f209Smrg# of the ones we need for now.
8105b534f209SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
8106b534f209SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
8107b534f209Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8108b534f209Smrg	AC_MSG_RESULT([no])
8109b534f209Smrgelse
8110b534f209Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8111b534f209Smrg		RAWCPPFLAGS=-undef
8112b534f209Smrg		AC_MSG_RESULT([yes])
8113b534f209Smrg	# under Cygwin unix is still defined even with -undef
8114b534f209Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8115b534f209Smrg		RAWCPPFLAGS="-undef -ansi"
8116b534f209Smrg		AC_MSG_RESULT([yes, with -ansi])
8117b534f209Smrg	else
8118b534f209Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
8119b410ddbeSmrg	fi
8120b410ddbeSmrgfi
8121b534f209Smrgrm -f conftest.$ac_ext
812283cab373Smrg
8123b534f209SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
8124b534f209SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
8125b534f209Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8126b534f209Smrg	AC_MSG_RESULT([no])
8127b534f209Smrgelse
8128b534f209Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8129b534f209Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8130b534f209Smrg		AC_MSG_RESULT([yes])
8131b534f209Smrg	else
8132b534f209Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
813383cab373Smrg	fi
8134b534f209Smrgfi
8135b534f209Smrgrm -f conftest.$ac_ext
8136b534f209SmrgAC_SUBST(RAWCPPFLAGS)
8137b534f209Smrg]) # XORG_PROG_RAWCPP
8138de78e416Smrg
8139b534f209Smrg# XORG_MANPAGE_SECTIONS()
8140b534f209Smrg# -----------------------
8141b534f209Smrg# Minimum version: 1.0.0
814283cab373Smrg#
8143b534f209Smrg# Determine which sections man pages go in for the different man page types
8144b534f209Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8145b534f209Smrg# Not sure if there's any better way than just hardcoding by OS name.
8146b534f209Smrg# Override default settings by setting environment variables
8147b534f209Smrg# Added MAN_SUBSTS in version 1.8
8148b534f209Smrg# Added AC_PROG_SED in version 1.8
8149de78e416Smrg
8150b534f209SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
8151b534f209SmrgAC_REQUIRE([AC_CANONICAL_HOST])
8152b534f209SmrgAC_REQUIRE([AC_PROG_SED])
8153b410ddbeSmrg
8154b534f209Smrgif test x$APP_MAN_SUFFIX = x    ; then
8155b534f209Smrg    APP_MAN_SUFFIX=1
8156b534f209Smrgfi
8157b534f209Smrgif test x$APP_MAN_DIR = x    ; then
8158b534f209Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8159b534f209Smrgfi
8160b410ddbeSmrg
8161b534f209Smrgif test x$LIB_MAN_SUFFIX = x    ; then
8162b534f209Smrg    LIB_MAN_SUFFIX=3
8163b534f209Smrgfi
8164b534f209Smrgif test x$LIB_MAN_DIR = x    ; then
8165b534f209Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8166b534f209Smrgfi
8167b410ddbeSmrg
8168b534f209Smrgif test x$FILE_MAN_SUFFIX = x    ; then
8169b534f209Smrg    case $host_os in
8170b534f209Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
8171b534f209Smrg	*)		FILE_MAN_SUFFIX=5  ;;
8172b534f209Smrg    esac
8173b534f209Smrgfi
8174b534f209Smrgif test x$FILE_MAN_DIR = x    ; then
8175b534f209Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8176b534f209Smrgfi
8177de78e416Smrg
8178b534f209Smrgif test x$MISC_MAN_SUFFIX = x    ; then
8179b534f209Smrg    case $host_os in
8180b534f209Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
8181b534f209Smrg	*)		MISC_MAN_SUFFIX=7  ;;
8182b534f209Smrg    esac
8183b534f209Smrgfi
8184b534f209Smrgif test x$MISC_MAN_DIR = x    ; then
8185b534f209Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8186b534f209Smrgfi
8187de78e416Smrg
8188b534f209Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
8189b534f209Smrg    case $host_os in
8190b534f209Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
8191b534f209Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
8192b534f209Smrg    esac
8193b534f209Smrgfi
8194b534f209Smrgif test x$DRIVER_MAN_DIR = x    ; then
8195b534f209Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
8196b534f209Smrgfi
8197de78e416Smrg
8198b534f209Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
8199b534f209Smrg    case $host_os in
8200b534f209Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
8201b534f209Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
8202b534f209Smrg    esac
8203b534f209Smrgfi
8204b534f209Smrgif test x$ADMIN_MAN_DIR = x    ; then
8205b534f209Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8206b534f209Smrgfi
8207de78e416Smrg
8208de78e416Smrg
8209b534f209SmrgAC_SUBST([APP_MAN_SUFFIX])
8210b534f209SmrgAC_SUBST([LIB_MAN_SUFFIX])
8211b534f209SmrgAC_SUBST([FILE_MAN_SUFFIX])
8212b534f209SmrgAC_SUBST([MISC_MAN_SUFFIX])
8213b534f209SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
8214b534f209SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
8215b534f209SmrgAC_SUBST([APP_MAN_DIR])
8216b534f209SmrgAC_SUBST([LIB_MAN_DIR])
8217b534f209SmrgAC_SUBST([FILE_MAN_DIR])
8218b534f209SmrgAC_SUBST([MISC_MAN_DIR])
8219b534f209SmrgAC_SUBST([DRIVER_MAN_DIR])
8220b534f209SmrgAC_SUBST([ADMIN_MAN_DIR])
8221de78e416Smrg
8222b534f209SmrgXORG_MAN_PAGE="X Version 11"
8223b534f209SmrgAC_SUBST([XORG_MAN_PAGE])
8224b534f209SmrgMAN_SUBSTS="\
8225b534f209Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8226b534f209Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8227b534f209Smrg	-e 's|__xservername__|Xorg|g' \
8228b534f209Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
8229b534f209Smrg	-e 's|__projectroot__|\$(prefix)|g' \
8230b534f209Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
8231b534f209Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
8232b534f209Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
8233b534f209Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
8234b534f209Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
8235b534f209Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
8236b534f209Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
8237b534f209SmrgAC_SUBST([MAN_SUBSTS])
8238b534f209Smrg
8239b534f209Smrg]) # XORG_MANPAGE_SECTIONS
8240b534f209Smrg
8241b534f209Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
8242b534f209Smrg# ------------------------
8243b534f209Smrg# Minimum version: 1.7.0
824483cab373Smrg#
8245b534f209Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
8246b534f209Smrg# provided by xorg-sgml-doctools, if installed.
8247b534f209SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
8248b534f209SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
8249b534f209SmrgXORG_SGML_PATH=
8250b534f209SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
8251b534f209Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
8252b534f209Smrg    [m4_ifval([$1],[:],
8253b534f209Smrg        [if test x"$cross_compiling" != x"yes" ; then
8254b534f209Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
8255b534f209Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
8256b534f209Smrg         fi])
8257b534f209Smrg    ])
8258b534f209Smrg
8259b534f209Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
8260b534f209Smrg# the path and the name of the doc stylesheet
8261b534f209Smrgif test "x$XORG_SGML_PATH" != "x" ; then
8262b534f209Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
8263b534f209Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
8264b534f209Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
8265b534f209Smrgelse
8266b534f209Smrg   AC_MSG_RESULT([no])
8267b534f209Smrgfi
8268b534f209Smrg
8269b534f209SmrgAC_SUBST(XORG_SGML_PATH)
8270b534f209SmrgAC_SUBST(STYLESHEET_SRCDIR)
8271b534f209SmrgAC_SUBST(XSL_STYLESHEET)
8272b534f209SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
8273b534f209Smrg]) # XORG_CHECK_SGML_DOCTOOLS
8274b534f209Smrg
8275b534f209Smrg# XORG_CHECK_LINUXDOC
8276b534f209Smrg# -------------------
8277b534f209Smrg# Minimum version: 1.0.0
827883cab373Smrg#
8279b534f209Smrg# Defines the variable MAKE_TEXT if the necessary tools and
8280b534f209Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
8281b534f209Smrg# Whether or not the necessary tools and files are found can be checked
8282b534f209Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
8283b534f209SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
8284b534f209SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
8285b534f209SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
8286de78e416Smrg
8287b534f209SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
8288de78e416Smrg
8289b534f209SmrgAC_MSG_CHECKING([whether to build documentation])
8290de78e416Smrg
8291b534f209Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
8292b534f209Smrg   BUILDDOC=yes
8293b534f209Smrgelse
8294b534f209Smrg   BUILDDOC=no
8295b534f209Smrgfi
8296de78e416Smrg
8297b534f209SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
8298de78e416Smrg
8299b534f209SmrgAC_MSG_RESULT([$BUILDDOC])
8300b534f209Smrg
8301b534f209SmrgAC_MSG_CHECKING([whether to build pdf documentation])
8302b534f209Smrg
8303b534f209Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
8304b534f209Smrg   BUILDPDFDOC=yes
8305de78e416Smrgelse
8306b534f209Smrg   BUILDPDFDOC=no
8307de78e416Smrgfi
830815fb4814Smrg
8309b534f209SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
831015fb4814Smrg
8311b534f209SmrgAC_MSG_RESULT([$BUILDPDFDOC])
831283cab373Smrg
8313b534f209SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
8314b534f209SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8315b534f209SmrgMAKE_PDF="$PS2PDF"
8316b534f209SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
831715fb4814Smrg
8318b534f209SmrgAC_SUBST(MAKE_TEXT)
8319b534f209SmrgAC_SUBST(MAKE_PS)
8320b534f209SmrgAC_SUBST(MAKE_PDF)
8321b534f209SmrgAC_SUBST(MAKE_HTML)
8322b534f209Smrg]) # XORG_CHECK_LINUXDOC
832383cab373Smrg
8324b534f209Smrg# XORG_CHECK_DOCBOOK
8325b534f209Smrg# -------------------
8326b534f209Smrg# Minimum version: 1.0.0
832715fb4814Smrg#
8328b534f209Smrg# Checks for the ability to build output formats from SGML DocBook source.
8329b534f209Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8330b534f209Smrg# indicates whether the necessary tools and files are found and, if set,
8331b534f209Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8332b534f209SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
8333b534f209SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
833415fb4814Smrg
8335b534f209SmrgBUILDTXTDOC=no
8336b534f209SmrgBUILDPDFDOC=no
8337b534f209SmrgBUILDPSDOC=no
8338b534f209SmrgBUILDHTMLDOC=no
833915fb4814Smrg
8340b534f209SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
8341b534f209SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8342b534f209SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
8343b534f209SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
8344de78e416Smrg
8345b534f209SmrgAC_MSG_CHECKING([whether to build text documentation])
8346b534f209Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
8347b534f209Smrg   test x$BUILD_TXTDOC != xno; then
8348b534f209Smrg	BUILDTXTDOC=yes
8349b534f209Smrgfi
8350b534f209SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8351b534f209SmrgAC_MSG_RESULT([$BUILDTXTDOC])
835215fb4814Smrg
8353b534f209SmrgAC_MSG_CHECKING([whether to build PDF documentation])
8354b534f209Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
8355b534f209Smrg   test x$BUILD_PDFDOC != xno; then
8356b534f209Smrg	BUILDPDFDOC=yes
8357b534f209Smrgfi
8358b534f209SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8359b534f209SmrgAC_MSG_RESULT([$BUILDPDFDOC])
836015fb4814Smrg
8361b534f209SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
8362b534f209Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
8363b534f209Smrg   test x$BUILD_PSDOC != xno; then
8364b534f209Smrg	BUILDPSDOC=yes
8365b534f209Smrgfi
8366b534f209SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8367b534f209SmrgAC_MSG_RESULT([$BUILDPSDOC])
8368b534f209Smrg
8369b534f209SmrgAC_MSG_CHECKING([whether to build HTML documentation])
8370b534f209Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
8371b534f209Smrg   test x$BUILD_HTMLDOC != xno; then
8372b534f209Smrg	BUILDHTMLDOC=yes
8373b534f209Smrgfi
8374b534f209SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8375b534f209SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
8376b534f209Smrg
8377b534f209SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8378b534f209SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8379b534f209SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8380b534f209SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
8381b534f209Smrg
8382b534f209SmrgAC_SUBST(MAKE_TEXT)
8383b534f209SmrgAC_SUBST(MAKE_PS)
8384b534f209SmrgAC_SUBST(MAKE_PDF)
8385b534f209SmrgAC_SUBST(MAKE_HTML)
8386b534f209Smrg]) # XORG_CHECK_DOCBOOK
8387b534f209Smrg
8388b534f209Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
8389b534f209Smrg# ----------------
8390b534f209Smrg# Minimum version: 1.5.0
8391b534f209Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8392b534f209Smrg#
8393b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8394b534f209Smrg# not at the appropriate level. This macro enables a module to test for the
8395b534f209Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8396b534f209Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
8397b534f209Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
8398b534f209Smrg# --with-xmlto assumes 'auto'.
8399b534f209Smrg#
8400b534f209Smrg# Interface to module:
8401b534f209Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
8402b534f209Smrg# XMLTO:	returns the path of the xmlto program found
8403b534f209Smrg#		returns the path set by the user in the environment
8404b534f209Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
8405b534f209Smrg#		'no' user instructs the module not to use xmlto
8406b534f209Smrg#
8407b534f209Smrg# Added in version 1.10.0
8408b534f209Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
8409b534f209Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
8410b534f209Smrg#
8411b534f209Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
8412b534f209Smrg#
8413b534f209SmrgAC_DEFUN([XORG_WITH_XMLTO],[
8414b534f209SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
8415b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
8416b534f209SmrgAC_ARG_WITH(xmlto,
8417b534f209Smrg	AS_HELP_STRING([--with-xmlto],
8418b534f209Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
8419b534f209Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
8420b534f209Smrgm4_undefine([_defopt])
842183cab373Smrg
8422b534f209Smrgif test "x$use_xmlto" = x"auto"; then
8423b534f209Smrg   AC_PATH_PROG([XMLTO], [xmlto])
8424b534f209Smrg   if test "x$XMLTO" = "x"; then
8425b534f209Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
8426b534f209Smrg	have_xmlto=no
8427b534f209Smrg   else
8428b534f209Smrg        have_xmlto=yes
8429b534f209Smrg   fi
8430b534f209Smrgelif test "x$use_xmlto" = x"yes" ; then
8431b534f209Smrg   AC_PATH_PROG([XMLTO], [xmlto])
8432b534f209Smrg   if test "x$XMLTO" = "x"; then
8433b534f209Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
8434b534f209Smrg   fi
8435b534f209Smrg   have_xmlto=yes
8436b534f209Smrgelif test "x$use_xmlto" = x"no" ; then
8437b534f209Smrg   if test "x$XMLTO" != "x"; then
8438b534f209Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
8439b534f209Smrg   fi
8440b534f209Smrg   have_xmlto=no
844183cab373Smrgelse
8442b534f209Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
844383cab373Smrgfi
844483cab373Smrg
8445b534f209Smrg# Test for a minimum version of xmlto, if provided.
8446b534f209Smrgm4_ifval([$1],
8447b534f209Smrg[if test "$have_xmlto" = yes; then
8448b534f209Smrg    # scrape the xmlto version
8449b534f209Smrg    AC_MSG_CHECKING([the xmlto version])
8450b534f209Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
8451b534f209Smrg    AC_MSG_RESULT([$xmlto_version])
8452b534f209Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
8453b534f209Smrg        [if test "x$use_xmlto" = xauto; then
8454b534f209Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
8455b534f209Smrg            have_xmlto=no
8456b534f209Smrg        else
8457b534f209Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
8458b534f209Smrg        fi])
8459b534f209Smrgfi])
846083cab373Smrg
8461b534f209Smrg# Test for the ability of xmlto to generate a text target
8462b534f209Smrghave_xmlto_text=no
8463b534f209Smrgcat > conftest.xml << "EOF"
8464b534f209SmrgEOF
8465b534f209SmrgAS_IF([test "$have_xmlto" = yes],
8466b534f209Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
8467b534f209Smrg             [have_xmlto_text=yes],
8468b534f209Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
8469b534f209Smrgrm -f conftest.xml
8470b534f209SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
8471b534f209SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
8472b534f209Smrg]) # XORG_WITH_XMLTO
8473b534f209Smrg
8474b534f209Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
8475b534f209Smrg# --------------------------------------------
8476b534f209Smrg# Minimum version: 1.12.0
8477b534f209Smrg# Minimum version for optional DEFAULT argument: 1.12.0
8478b534f209Smrg#
8479b534f209Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
8480b534f209Smrg# XML-based language used for the transformation of XML documents.
8481b534f209Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
8482b534f209Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
8483b534f209Smrg# The XSLT processor is often used as a standalone tool for transformations.
8484b534f209Smrg# It should not be assumed that this tool is used only to work with documnetation.
8485b534f209Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
8486b534f209Smrg#
8487b534f209Smrg# Interface to module:
8488b534f209Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
8489b534f209Smrg# XSLTPROC:	 returns the path of the xsltproc program found
8490b534f209Smrg#		 returns the path set by the user in the environment
8491b534f209Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
8492b534f209Smrg#		  'no' user instructs the module not to use xsltproc
8493b534f209Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
8494b534f209Smrg#
8495b534f209Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
8496b534f209Smrg#
8497b534f209SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
8498b534f209SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
8499b534f209Smrg# Preserves the interface, should it be implemented later
8500b534f209Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
8501b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
8502b534f209SmrgAC_ARG_WITH(xsltproc,
8503b534f209Smrg	AS_HELP_STRING([--with-xsltproc],
8504b534f209Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
8505b534f209Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
8506b534f209Smrgm4_undefine([_defopt])
8507b534f209Smrg
8508b534f209Smrgif test "x$use_xsltproc" = x"auto"; then
8509b534f209Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
8510b534f209Smrg   if test "x$XSLTPROC" = "x"; then
8511b534f209Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
8512b534f209Smrg	have_xsltproc=no
8513b534f209Smrg   else
8514b534f209Smrg        have_xsltproc=yes
8515b534f209Smrg   fi
8516b534f209Smrgelif test "x$use_xsltproc" = x"yes" ; then
8517b534f209Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
8518b534f209Smrg   if test "x$XSLTPROC" = "x"; then
8519b534f209Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
8520b534f209Smrg   fi
8521b534f209Smrg   have_xsltproc=yes
8522b534f209Smrgelif test "x$use_xsltproc" = x"no" ; then
8523b534f209Smrg   if test "x$XSLTPROC" != "x"; then
8524b534f209Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
8525b534f209Smrg   fi
8526b534f209Smrg   have_xsltproc=no
8527b534f209Smrgelse
8528b534f209Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
8529b534f209Smrgfi
853083cab373Smrg
8531b534f209SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
8532b534f209Smrg]) # XORG_WITH_XSLTPROC
853383cab373Smrg
8534b534f209Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
8535b534f209Smrg# ----------------------------------------
8536b534f209Smrg# Minimum version: 1.15.0
8537b534f209Smrg#
8538b534f209Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
8539b534f209Smrg# scanning arbitrary text files, extracting information from those text files,
8540b534f209Smrg# and printing reports based on that information.
8541b534f209Smrg#
8542b534f209Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
8543b534f209Smrg#
8544b534f209Smrg# Interface to module:
8545b534f209Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
8546b534f209Smrg# PERL:	     returns the path of the perl program found
8547b534f209Smrg#	     returns the path set by the user in the environment
8548b534f209Smrg# --with-perl: 'yes' user instructs the module to use perl
8549b534f209Smrg#	       'no' user instructs the module not to use perl
8550b534f209Smrg# have_perl: returns yes if perl found in PATH or no
8551b534f209Smrg#
8552b534f209Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
8553b534f209Smrg#
8554b534f209SmrgAC_DEFUN([XORG_WITH_PERL],[
8555b534f209SmrgAC_ARG_VAR([PERL], [Path to perl command])
8556b534f209Smrg# Preserves the interface, should it be implemented later
8557b534f209Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
8558b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
8559b534f209SmrgAC_ARG_WITH(perl,
8560b534f209Smrg	AS_HELP_STRING([--with-perl],
8561b534f209Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
8562b534f209Smrg	   [use_perl=$withval], [use_perl=]_defopt)
8563b534f209Smrgm4_undefine([_defopt])
8564b534f209Smrg
8565b534f209Smrgif test "x$use_perl" = x"auto"; then
8566b534f209Smrg   AC_PATH_PROG([PERL], [perl])
8567b534f209Smrg   if test "x$PERL" = "x"; then
8568b534f209Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
8569b534f209Smrg	have_perl=no
8570b534f209Smrg   else
8571b534f209Smrg        have_perl=yes
8572b534f209Smrg   fi
8573b534f209Smrgelif test "x$use_perl" = x"yes" ; then
8574b534f209Smrg   AC_PATH_PROG([PERL], [perl])
8575b534f209Smrg   if test "x$PERL" = "x"; then
8576b534f209Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
8577b534f209Smrg   fi
8578b534f209Smrg   have_perl=yes
8579b534f209Smrgelif test "x$use_perl" = x"no" ; then
8580b534f209Smrg   if test "x$PERL" != "x"; then
8581b534f209Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
8582b534f209Smrg   fi
8583b534f209Smrg   have_perl=no
8584b534f209Smrgelse
8585b534f209Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
858683cab373Smrgfi
858783cab373Smrg
8588b534f209SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
8589b534f209Smrg]) # XORG_WITH_PERL
859083cab373Smrg
8591b534f209Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
8592b534f209Smrg# ----------------
8593b534f209Smrg# Minimum version: 1.5.0
8594b534f209Smrg# Minimum version for optional DEFAULT argument: 1.11.0
859583cab373Smrg#
8596b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8597b534f209Smrg# not at the appropriate level. This macro enables a module to test for the
8598b534f209Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8599b534f209Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
8600b534f209Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
8601b534f209Smrg# --with-asciidoc assumes 'auto'.
8602b534f209Smrg#
8603b534f209Smrg# Interface to module:
8604b534f209Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
8605b534f209Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
8606b534f209Smrg#		 returns the path set by the user in the environment
8607b534f209Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
8608b534f209Smrg#		  'no' user instructs the module not to use asciidoc
8609b534f209Smrg#
8610b534f209Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
8611b534f209Smrg#
8612b534f209SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
8613b534f209SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
8614b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
8615b534f209SmrgAC_ARG_WITH(asciidoc,
8616b534f209Smrg	AS_HELP_STRING([--with-asciidoc],
8617b534f209Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
8618b534f209Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
8619b534f209Smrgm4_undefine([_defopt])
862083cab373Smrg
8621b534f209Smrgif test "x$use_asciidoc" = x"auto"; then
8622b534f209Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8623b534f209Smrg   if test "x$ASCIIDOC" = "x"; then
8624b534f209Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
8625b534f209Smrg	have_asciidoc=no
8626b534f209Smrg   else
8627b534f209Smrg        have_asciidoc=yes
8628b534f209Smrg   fi
8629b534f209Smrgelif test "x$use_asciidoc" = x"yes" ; then
8630b534f209Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8631b534f209Smrg   if test "x$ASCIIDOC" = "x"; then
8632b534f209Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
8633b534f209Smrg   fi
8634b534f209Smrg   have_asciidoc=yes
8635b534f209Smrgelif test "x$use_asciidoc" = x"no" ; then
8636b534f209Smrg   if test "x$ASCIIDOC" != "x"; then
8637b534f209Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
8638b534f209Smrg   fi
8639b534f209Smrg   have_asciidoc=no
8640b534f209Smrgelse
8641b534f209Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
8642b534f209Smrgfi
8643b534f209Smrgm4_ifval([$1],
8644b534f209Smrg[if test "$have_asciidoc" = yes; then
8645b534f209Smrg    # scrape the asciidoc version
8646b534f209Smrg    AC_MSG_CHECKING([the asciidoc version])
8647b534f209Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
8648b534f209Smrg    AC_MSG_RESULT([$asciidoc_version])
8649b534f209Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
8650b534f209Smrg        [if test "x$use_asciidoc" = xauto; then
8651b534f209Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
8652b534f209Smrg            have_asciidoc=no
8653b534f209Smrg        else
8654b534f209Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
8655b534f209Smrg        fi])
8656b534f209Smrgfi])
8657b534f209SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
8658b534f209Smrg]) # XORG_WITH_ASCIIDOC
865983cab373Smrg
8660b534f209Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
8661b534f209Smrg# --------------------------------
8662b534f209Smrg# Minimum version: 1.5.0
8663b534f209Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8664b534f209Smrg#
8665b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8666b534f209Smrg# not at the appropriate level. This macro enables a module to test for the
8667b534f209Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8668b534f209Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
8669b534f209Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
8670b534f209Smrg# --with-doxygen assumes 'auto'.
8671b534f209Smrg#
8672b534f209Smrg# Interface to module:
8673b534f209Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
8674b534f209Smrg# DOXYGEN:	 returns the path of the doxygen program found
8675b534f209Smrg#		 returns the path set by the user in the environment
8676b534f209Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
8677b534f209Smrg#		  'no' user instructs the module not to use doxygen
8678b534f209Smrg#
8679b534f209Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
8680b534f209Smrg#
8681b534f209SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
8682b534f209SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
8683b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
8684b534f209SmrgAC_ARG_WITH(doxygen,
8685b534f209Smrg	AS_HELP_STRING([--with-doxygen],
8686b534f209Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
8687b534f209Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
8688b534f209Smrgm4_undefine([_defopt])
8689de78e416Smrg
8690b534f209Smrgif test "x$use_doxygen" = x"auto"; then
8691b534f209Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8692b534f209Smrg   if test "x$DOXYGEN" = "x"; then
8693b534f209Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
8694b534f209Smrg	have_doxygen=no
8695b534f209Smrg   else
8696b534f209Smrg        have_doxygen=yes
8697b534f209Smrg   fi
8698b534f209Smrgelif test "x$use_doxygen" = x"yes" ; then
8699b534f209Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8700b534f209Smrg   if test "x$DOXYGEN" = "x"; then
8701b534f209Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
8702b534f209Smrg   fi
8703b534f209Smrg   have_doxygen=yes
8704b534f209Smrgelif test "x$use_doxygen" = x"no" ; then
8705b534f209Smrg   if test "x$DOXYGEN" != "x"; then
8706b534f209Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
8707b534f209Smrg   fi
8708b534f209Smrg   have_doxygen=no
8709b534f209Smrgelse
8710b534f209Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
8711b534f209Smrgfi
8712b534f209Smrgm4_ifval([$1],
8713b534f209Smrg[if test "$have_doxygen" = yes; then
8714b534f209Smrg    # scrape the doxygen version
8715b534f209Smrg    AC_MSG_CHECKING([the doxygen version])
8716b534f209Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
8717b534f209Smrg    AC_MSG_RESULT([$doxygen_version])
8718b534f209Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
8719b534f209Smrg        [if test "x$use_doxygen" = xauto; then
8720b534f209Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
8721b534f209Smrg            have_doxygen=no
8722b534f209Smrg        else
8723b534f209Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
8724b534f209Smrg        fi])
8725b534f209Smrgfi])
8726b534f209SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
8727b534f209Smrg]) # XORG_WITH_DOXYGEN
8728de78e416Smrg
8729b534f209Smrg# XORG_WITH_GROFF([DEFAULT])
8730b534f209Smrg# ----------------
8731b534f209Smrg# Minimum version: 1.6.0
8732b534f209Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8733b534f209Smrg#
8734b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8735b534f209Smrg# not at the appropriate level. This macro enables a module to test for the
8736b534f209Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8737b534f209Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
8738b534f209Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
8739b534f209Smrg# --with-groff assumes 'auto'.
8740b534f209Smrg#
8741b534f209Smrg# Interface to module:
8742b534f209Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
8743b534f209Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
8744b534f209Smrg# HAVE_GROFF_MS: the -ms macros package
8745b534f209Smrg# GROFF:	 returns the path of the groff program found
8746b534f209Smrg#		 returns the path set by the user in the environment
8747b534f209Smrg# --with-groff:	 'yes' user instructs the module to use groff
8748b534f209Smrg#		 'no' user instructs the module not to use groff
874983cab373Smrg#
8750b534f209Smrg# Added in version 1.9.0:
8751b534f209Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
8752b534f209Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
8753b534f209Smrg#		   psselect from the psutils package.
8754b534f209Smrg#		   the ghostcript package. Refer to the grohtml man pages
875583cab373Smrg#
8756b534f209Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
8757b534f209Smrg#
8758b534f209Smrg# OS and distros often splits groff in a basic and full package, the former
8759b534f209Smrg# having the groff program and the later having devices, fonts and macros
8760b534f209Smrg# Checking for the groff executable is not enough.
8761b534f209Smrg#
8762b534f209Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
8763b534f209Smrg# unset HAVE_GROFF or GROFF env variables.
8764b534f209Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
8765b534f209Smrg#
8766b534f209SmrgAC_DEFUN([XORG_WITH_GROFF],[
8767b534f209SmrgAC_ARG_VAR([GROFF], [Path to groff command])
8768b534f209Smrgm4_define([_defopt], m4_default([$1], [auto]))
8769b534f209SmrgAC_ARG_WITH(groff,
8770b534f209Smrg	AS_HELP_STRING([--with-groff],
8771b534f209Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
8772b534f209Smrg	   [use_groff=$withval], [use_groff=]_defopt)
8773b534f209Smrgm4_undefine([_defopt])
877483cab373Smrg
8775b534f209Smrgif test "x$use_groff" = x"auto"; then
8776b534f209Smrg   AC_PATH_PROG([GROFF], [groff])
8777b534f209Smrg   if test "x$GROFF" = "x"; then
8778b534f209Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
8779b534f209Smrg	have_groff=no
8780b534f209Smrg   else
8781b534f209Smrg        have_groff=yes
8782b534f209Smrg   fi
8783b534f209Smrgelif test "x$use_groff" = x"yes" ; then
8784b534f209Smrg   AC_PATH_PROG([GROFF], [groff])
8785b534f209Smrg   if test "x$GROFF" = "x"; then
8786b534f209Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
8787b534f209Smrg   fi
8788b534f209Smrg   have_groff=yes
8789b534f209Smrgelif test "x$use_groff" = x"no" ; then
8790b534f209Smrg   if test "x$GROFF" != "x"; then
8791b534f209Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
8792b534f209Smrg   fi
8793b534f209Smrg   have_groff=no
8794b534f209Smrgelse
8795b534f209Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
879683cab373Smrgfi
8797de78e416Smrg
8798b534f209Smrg# We have groff, test for the presence of the macro packages
8799b534f209Smrgif test "x$have_groff" = x"yes"; then
8800b534f209Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
8801b534f209Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
8802b534f209Smrg        groff_ms_works=yes
8803b534f209Smrg    else
8804b534f209Smrg        groff_ms_works=no
8805b534f209Smrg    fi
8806b534f209Smrg    AC_MSG_RESULT([$groff_ms_works])
8807b534f209Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
8808b534f209Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
8809b534f209Smrg        groff_mm_works=yes
8810b534f209Smrg    else
8811b534f209Smrg        groff_mm_works=no
8812b534f209Smrg    fi
8813b534f209Smrg    AC_MSG_RESULT([$groff_mm_works])
881483cab373Smrgfi
881583cab373Smrg
8816b534f209Smrg# We have groff, test for HTML dependencies, one command per package
8817b534f209Smrgif test "x$have_groff" = x"yes"; then
8818b534f209Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
8819b534f209Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
8820b534f209Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
8821b534f209Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
8822b534f209Smrg      have_groff_html=yes
8823b534f209Smrg   else
8824b534f209Smrg      have_groff_html=no
8825b534f209Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
8826b534f209Smrg   fi
8827b534f209Smrgfi
882883cab373Smrg
8829b534f209Smrg# Set Automake conditionals for Makefiles
8830b534f209SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
8831b534f209SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
8832b534f209SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
8833b534f209SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
8834b534f209Smrg]) # XORG_WITH_GROFF
8835de78e416Smrg
8836b534f209Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
8837b534f209Smrg# ---------------------------------------
8838b534f209Smrg# Minimum version: 1.6.0
8839b534f209Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8840b534f209Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
8841de78e416Smrg#
8842b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8843b534f209Smrg# not at the appropriate level. This macro enables a module to test for the
8844b534f209Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8845b534f209Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
8846b534f209Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
8847b534f209Smrg# --with-fop assumes 'auto'.
8848b534f209Smrg#
8849b534f209Smrg# Interface to module:
8850b534f209Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
8851b534f209Smrg# FOP:	 	returns the path of the fop program found
8852b534f209Smrg#		returns the path set by the user in the environment
8853b534f209Smrg# --with-fop: 	'yes' user instructs the module to use fop
8854b534f209Smrg#		'no' user instructs the module not to use fop
8855b534f209Smrg#
8856b534f209Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
8857b534f209Smrg#
8858b534f209SmrgAC_DEFUN([XORG_WITH_FOP],[
8859b534f209SmrgAC_ARG_VAR([FOP], [Path to fop command])
8860b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
8861b534f209SmrgAC_ARG_WITH(fop,
8862b534f209Smrg	AS_HELP_STRING([--with-fop],
8863b534f209Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
8864b534f209Smrg	   [use_fop=$withval], [use_fop=]_defopt)
8865b534f209Smrgm4_undefine([_defopt])
8866de78e416Smrg
8867b534f209Smrgif test "x$use_fop" = x"auto"; then
8868b534f209Smrg   AC_PATH_PROG([FOP], [fop])
8869b534f209Smrg   if test "x$FOP" = "x"; then
8870b534f209Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
8871b534f209Smrg	have_fop=no
8872b534f209Smrg   else
8873b534f209Smrg        have_fop=yes
8874b534f209Smrg   fi
8875b534f209Smrgelif test "x$use_fop" = x"yes" ; then
8876b534f209Smrg   AC_PATH_PROG([FOP], [fop])
8877b534f209Smrg   if test "x$FOP" = "x"; then
8878b534f209Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
8879b534f209Smrg   fi
8880b534f209Smrg   have_fop=yes
8881b534f209Smrgelif test "x$use_fop" = x"no" ; then
8882b534f209Smrg   if test "x$FOP" != "x"; then
8883b534f209Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
8884b534f209Smrg   fi
8885b534f209Smrg   have_fop=no
8886b534f209Smrgelse
8887b534f209Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
8888de78e416Smrgfi
888915fb4814Smrg
8890b534f209Smrg# Test for a minimum version of fop, if provided.
8891b534f209Smrgm4_ifval([$1],
8892b534f209Smrg[if test "$have_fop" = yes; then
8893b534f209Smrg    # scrape the fop version
8894b534f209Smrg    AC_MSG_CHECKING([for fop minimum version])
8895b534f209Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
8896b534f209Smrg    AC_MSG_RESULT([$fop_version])
8897b534f209Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
8898b534f209Smrg        [if test "x$use_fop" = xauto; then
8899b534f209Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
8900b534f209Smrg            have_fop=no
8901b534f209Smrg        else
8902b534f209Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
8903b534f209Smrg        fi])
8904b534f209Smrgfi])
8905b534f209SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
8906b534f209Smrg]) # XORG_WITH_FOP
8907b534f209Smrg
8908b534f209Smrg# XORG_WITH_PS2PDF([DEFAULT])
8909b534f209Smrg# ----------------
8910b534f209Smrg# Minimum version: 1.6.0
8911b534f209Smrg# Minimum version for optional DEFAULT argument: 1.11.0
8912b534f209Smrg#
8913b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8914b534f209Smrg# not at the appropriate level. This macro enables a module to test for the
8915b534f209Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8916b534f209Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
8917b534f209Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
8918b534f209Smrg# --with-ps2pdf assumes 'auto'.
8919b534f209Smrg#
8920b534f209Smrg# Interface to module:
8921b534f209Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
8922b534f209Smrg# PS2PDF:	returns the path of the ps2pdf program found
8923b534f209Smrg#		returns the path set by the user in the environment
8924b534f209Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
8925b534f209Smrg#		 'no' user instructs the module not to use ps2pdf
892615fb4814Smrg#
8927b534f209Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
8928b534f209Smrg#
8929b534f209SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
8930b534f209SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
8931b534f209Smrgm4_define([_defopt], m4_default([$1], [auto]))
8932b534f209SmrgAC_ARG_WITH(ps2pdf,
8933b534f209Smrg	AS_HELP_STRING([--with-ps2pdf],
8934b534f209Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
8935b534f209Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
8936b534f209Smrgm4_undefine([_defopt])
893715fb4814Smrg
8938b534f209Smrgif test "x$use_ps2pdf" = x"auto"; then
8939b534f209Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
8940b534f209Smrg   if test "x$PS2PDF" = "x"; then
8941b534f209Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
8942b534f209Smrg	have_ps2pdf=no
8943b534f209Smrg   else
8944b534f209Smrg        have_ps2pdf=yes
8945b534f209Smrg   fi
8946b534f209Smrgelif test "x$use_ps2pdf" = x"yes" ; then
8947b534f209Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
8948b534f209Smrg   if test "x$PS2PDF" = "x"; then
8949b534f209Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
8950b534f209Smrg   fi
8951b534f209Smrg   have_ps2pdf=yes
8952b534f209Smrgelif test "x$use_ps2pdf" = x"no" ; then
8953b534f209Smrg   if test "x$PS2PDF" != "x"; then
8954b534f209Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
8955b534f209Smrg   fi
8956b534f209Smrg   have_ps2pdf=no
895783cab373Smrgelse
8958b534f209Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
8959de78e416Smrgfi
8960b534f209SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
8961b534f209Smrg]) # XORG_WITH_PS2PDF
896215fb4814Smrg
8963b534f209Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
8964b534f209Smrg# ----------------
8965b534f209Smrg# Minimum version: 1.6.0
896683cab373Smrg#
8967b534f209Smrg# Documentation tools are not always available on all platforms and sometimes
8968b534f209Smrg# not at the appropriate level. This macro enables a builder to skip all
8969b534f209Smrg# documentation targets except traditional man pages.
8970b534f209Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
8971b534f209Smrg# maximum flexibilty in controlling documentation building.
8972b534f209Smrg# Refer to:
8973b534f209Smrg# XORG_WITH_XMLTO         --with-xmlto
8974b534f209Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
8975b534f209Smrg# XORG_WITH_DOXYGEN       --with-doxygen
8976b534f209Smrg# XORG_WITH_FOP           --with-fop
8977b534f209Smrg# XORG_WITH_GROFF         --with-groff
8978b534f209Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
897915fb4814Smrg#
8980b534f209Smrg# Interface to module:
8981b534f209Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
8982b534f209Smrg# --enable-docs: 'yes' user instructs the module to generate docs
8983b534f209Smrg#		 'no' user instructs the module not to generate docs
8984b534f209Smrg# parm1:	specify the default value, yes or no.
898583cab373Smrg#
8986b534f209SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
8987b534f209Smrgm4_define([docs_default], m4_default([$1], [yes]))
8988b534f209SmrgAC_ARG_ENABLE(docs,
8989b534f209Smrg	AS_HELP_STRING([--enable-docs],
8990b534f209Smrg	   [Enable building the documentation (default: ]docs_default[)]),
8991b534f209Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
8992b534f209Smrgm4_undefine([docs_default])
8993b534f209SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
8994b534f209SmrgAC_MSG_CHECKING([whether to build documentation])
8995b534f209SmrgAC_MSG_RESULT([$build_docs])
8996b534f209Smrg]) # XORG_ENABLE_DOCS
899715fb4814Smrg
8998b534f209Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
8999b534f209Smrg# ----------------
9000b534f209Smrg# Minimum version: 1.6.0
9001b534f209Smrg#
9002b534f209Smrg# This macro enables a builder to skip all developer documentation.
9003b534f209Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9004b534f209Smrg# maximum flexibilty in controlling documentation building.
9005b534f209Smrg# Refer to:
9006b534f209Smrg# XORG_WITH_XMLTO         --with-xmlto
9007b534f209Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9008b534f209Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9009b534f209Smrg# XORG_WITH_FOP           --with-fop
9010b534f209Smrg# XORG_WITH_GROFF         --with-groff
9011b534f209Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9012b534f209Smrg#
9013b534f209Smrg# Interface to module:
9014b534f209Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
9015b534f209Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
9016b534f209Smrg#			'no' user instructs the module not to generate developer docs
9017b534f209Smrg# parm1:		specify the default value, yes or no.
9018b534f209Smrg#
9019b534f209SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
9020b534f209Smrgm4_define([devel_default], m4_default([$1], [yes]))
9021b534f209SmrgAC_ARG_ENABLE(devel-docs,
9022b534f209Smrg	AS_HELP_STRING([--enable-devel-docs],
9023b534f209Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
9024b534f209Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
9025b534f209Smrgm4_undefine([devel_default])
9026b534f209SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
9027b534f209SmrgAC_MSG_CHECKING([whether to build developer documentation])
9028b534f209SmrgAC_MSG_RESULT([$build_devel_docs])
9029b534f209Smrg]) # XORG_ENABLE_DEVEL_DOCS
9030de78e416Smrg
9031b534f209Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
9032b534f209Smrg# ----------------
9033b534f209Smrg# Minimum version: 1.6.0
9034b534f209Smrg#
9035b534f209Smrg# This macro enables a builder to skip all functional specification targets.
9036b534f209Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9037b534f209Smrg# maximum flexibilty in controlling documentation building.
9038b534f209Smrg# Refer to:
9039b534f209Smrg# XORG_WITH_XMLTO         --with-xmlto
9040b534f209Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9041b534f209Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9042b534f209Smrg# XORG_WITH_FOP           --with-fop
9043b534f209Smrg# XORG_WITH_GROFF         --with-groff
9044b534f209Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9045b534f209Smrg#
9046b534f209Smrg# Interface to module:
9047b534f209Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
9048b534f209Smrg# --enable-specs:	'yes' user instructs the module to generate specs
9049b534f209Smrg#			'no' user instructs the module not to generate specs
9050b534f209Smrg# parm1:		specify the default value, yes or no.
9051b534f209Smrg#
9052b534f209SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
9053b534f209Smrgm4_define([spec_default], m4_default([$1], [yes]))
9054b534f209SmrgAC_ARG_ENABLE(specs,
9055b534f209Smrg	AS_HELP_STRING([--enable-specs],
9056b534f209Smrg	   [Enable building the specs (default: ]spec_default[)]),
9057b534f209Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
9058b534f209Smrgm4_undefine([spec_default])
9059b534f209SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
9060b534f209SmrgAC_MSG_CHECKING([whether to build functional specifications])
9061b534f209SmrgAC_MSG_RESULT([$build_specs])
9062b534f209Smrg]) # XORG_ENABLE_SPECS
9063de78e416Smrg
9064b534f209Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
9065b534f209Smrg# ----------------------------------------------
9066b534f209Smrg# Minimum version: 1.13.0
9067b534f209Smrg#
9068b534f209Smrg# This macro enables a builder to enable/disable unit testing
9069b534f209Smrg# It makes no assumption about the test cases implementation
9070b534f209Smrg# Test cases may or may not use Automake "Support for test suites"
9071b534f209Smrg# They may or may not use the software utility library GLib
9072b534f209Smrg#
9073b534f209Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
9074b534f209Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
9075b534f209Smrg# The variable enable_unit_tests is used by other macros in this file.
9076b534f209Smrg#
9077b534f209Smrg# Interface to module:
9078b534f209Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
9079b534f209Smrg# enable_unit_tests:    used in configure.ac for additional configuration
9080b534f209Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
9081b534f209Smrg#			'no' user instructs the module not to build tests
9082b534f209Smrg# parm1:		specify the default value, yes or no.
9083b534f209Smrg#
9084b534f209SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
9085b534f209SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
9086b534f209SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
9087b534f209Smrgm4_define([_defopt], m4_default([$1], [auto]))
9088b534f209SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
9089b534f209Smrg	[Enable building unit test cases (default: ]_defopt[)]),
9090b534f209Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
9091b534f209Smrgm4_undefine([_defopt])
9092b534f209SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
9093b534f209SmrgAC_MSG_CHECKING([whether to build unit test cases])
9094b534f209SmrgAC_MSG_RESULT([$enable_unit_tests])
9095b534f209Smrg]) # XORG_ENABLE_UNIT_TESTS
9096b534f209Smrg
9097b534f209Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
9098b534f209Smrg# ----------------------------------------
9099b534f209Smrg# Minimum version: 1.13.0
9100b534f209Smrg#
9101b534f209Smrg# GLib is a library which provides advanced data structures and functions.
9102b534f209Smrg# This macro enables a module to test for the presence of Glib.
9103b534f209Smrg#
9104b534f209Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
9105b534f209Smrg# Otherwise the value of $enable_unit_tests is blank.
9106b534f209Smrg#
9107b534f209Smrg# Interface to module:
9108b534f209Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
9109b534f209Smrg# with_glib: used in configure.ac to know if GLib has been found
9110b534f209Smrg# --with-glib:	'yes' user instructs the module to use glib
9111b534f209Smrg#		'no' user instructs the module not to use glib
9112b534f209Smrg#
9113b534f209SmrgAC_DEFUN([XORG_WITH_GLIB],[
9114b534f209SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9115b534f209Smrgm4_define([_defopt], m4_default([$2], [auto]))
9116b534f209SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
9117b534f209Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
9118b534f209Smrg	[with_glib=$withval], [with_glib=]_defopt)
9119b534f209Smrgm4_undefine([_defopt])
9120b534f209Smrg
9121b534f209Smrghave_glib=no
9122b534f209Smrg# Do not probe GLib if user explicitly disabled unit testing
9123b534f209Smrgif test "x$enable_unit_tests" != x"no"; then
9124b534f209Smrg  # Do not probe GLib if user explicitly disabled it
9125b534f209Smrg  if test "x$with_glib" != x"no"; then
9126b534f209Smrg    m4_ifval(
9127b534f209Smrg      [$1],
9128b534f209Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
9129b534f209Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
9130b534f209Smrg    )
9131b534f209Smrg  fi
913283cab373Smrgfi
9133b534f209Smrg
9134b534f209Smrg# Not having GLib when unit testing has been explicitly requested is an error
9135b534f209Smrgif test "x$enable_unit_tests" = x"yes"; then
9136b534f209Smrg  if test "x$have_glib" = x"no"; then
9137b534f209Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9138b534f209Smrg  fi
913915fb4814Smrgfi
914015fb4814Smrg
9141b534f209Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
9142b534f209Smrgif test "x$enable_unit_tests" = x"no"; then
9143b534f209Smrg  if test "x$with_glib" = x"yes"; then
9144b534f209Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
9145b534f209Smrg  fi
9146b534f209Smrgfi
914715fb4814Smrg
9148b534f209Smrg# Not having GLib when it has been explicitly requested is an error
9149b534f209Smrgif test "x$with_glib" = x"yes"; then
9150b534f209Smrg  if test "x$have_glib" = x"no"; then
9151b534f209Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
9152b534f209Smrg  fi
9153b534f209Smrgfi
915415fb4814Smrg
9155b534f209SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
9156b534f209Smrg]) # XORG_WITH_GLIB
915715fb4814Smrg
9158b534f209Smrg# XORG_LD_WRAP
9159b534f209Smrg# ------------
9160b534f209Smrg# Minimum version: 1.13.0
9161de78e416Smrg#
9162b534f209Smrg# Check if linker supports -wrap, passed via compiler flags
9163b534f209Smrg#
9164b534f209Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
9165b534f209Smrg# Otherwise the value of $enable_unit_tests is blank.
9166b534f209Smrg#
9167b534f209SmrgAC_DEFUN([XORG_LD_WRAP],[
9168b534f209SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no])
9169b534f209Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
9170b534f209Smrgif test "x$enable_unit_tests" = x"yes"; then
9171b534f209Smrg  if test "x$have_ld_wrap" = x"no"; then
9172b534f209Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
9173b534f209Smrg  fi
9174b534f209Smrgfi
9175b534f209SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
9176b534f209Smrg#
9177b534f209Smrg]) # XORG_LD_WRAP
917815fb4814Smrg
9179b534f209Smrg# XORG_CHECK_LINKER_FLAGS
918083cab373Smrg# -----------------------
9181b534f209Smrg# SYNOPSIS
9182b534f209Smrg#
9183b534f209Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE])
9184b534f209Smrg#
9185b534f209Smrg# DESCRIPTION
9186b534f209Smrg#
9187b534f209Smrg#   Check whether the given linker FLAGS work with the current language's
9188b534f209Smrg#   linker, or whether they give an error.
9189b534f209Smrg#
9190b534f209Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
9191b534f209Smrg#   success/failure.
9192b534f209Smrg#
9193b534f209Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
9194b534f209Smrg#
9195b534f209Smrg# LICENSE
9196b534f209Smrg#
9197b534f209Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
9198b534f209Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
9199b534f209Smrg#   Copyright (c) 2009 Matteo Frigo
9200b534f209Smrg#
9201b534f209Smrg#   This program is free software: you can redistribute it and/or modify it
9202b534f209Smrg#   under the terms of the GNU General Public License as published by the
9203b534f209Smrg#   Free Software Foundation, either version 3 of the License, or (at your
9204b534f209Smrg#   option) any later version.
9205b534f209Smrg#
9206b534f209Smrg#   This program is distributed in the hope that it will be useful, but
9207b534f209Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
9208b534f209Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
9209b534f209Smrg#   Public License for more details.
9210b534f209Smrg#
9211b534f209Smrg#   You should have received a copy of the GNU General Public License along
9212b534f209Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
9213b534f209Smrg#
9214b534f209Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
9215b534f209Smrg#   gives unlimited permission to copy, distribute and modify the configure
9216b534f209Smrg#   scripts that are the output of Autoconf when processing the Macro. You
9217b534f209Smrg#   need not follow the terms of the GNU General Public License when using
9218b534f209Smrg#   or distributing such scripts, even though portions of the text of the
9219b534f209Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
9220b534f209Smrg#   all other use of the material that constitutes the Autoconf Macro.
9221b534f209Smrg#
9222b534f209Smrg#   This special exception to the GPL applies to versions of the Autoconf
9223b534f209Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
9224b534f209Smrg#   modified version of the Autoconf Macro, you may extend this special
9225b534f209Smrg#   exception to the GPL to apply to your modified version as well.#
9226b534f209SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
9227b534f209Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
9228b534f209Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
9229b534f209SmrgAS_LITERAL_IF([$1],
9230b534f209Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
9231b534f209Smrg      ax_save_FLAGS=$LDFLAGS
9232b534f209Smrg      LDFLAGS="$1"
9233b534f209Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM()],
9234b534f209Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
9235b534f209Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
9236b534f209Smrg      LDFLAGS=$ax_save_FLAGS])],
9237b534f209Smrg  [ax_save_FLAGS=$LDFLAGS
9238b534f209Smrg   LDFLAGS="$1"
9239b534f209Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
9240b534f209Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
9241b534f209Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
9242b534f209Smrg   LDFLAGS=$ax_save_FLAGS])
9243b534f209Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
9244b534f209SmrgAC_MSG_RESULT($xorg_check_linker_flags)
9245b534f209Smrgif test "x$xorg_check_linker_flags" = xyes; then
9246b534f209Smrg	m4_default([$2], :)
9247b534f209Smrgelse
9248b534f209Smrg	m4_default([$3], :)
9249b534f209Smrgfi
9250b534f209Smrg]) # XORG_CHECK_LINKER_FLAGS
925115fb4814Smrg
9252b534f209Smrg# XORG_CHECK_MALLOC_ZERO
9253b534f209Smrg# ----------------------
9254b534f209Smrg# Minimum version: 1.0.0
9255b534f209Smrg#
9256b534f209Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
9257b534f209Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
9258b534f209Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
9259b534f209SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
9260b534f209SmrgAC_ARG_ENABLE(malloc0returnsnull,
9261b534f209Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
9262b534f209Smrg		       [malloc(0) returns NULL (default: auto)]),
9263b534f209Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
9264b534f209Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
926515fb4814Smrg
9266b534f209SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
9267b534f209Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
9268b534f209Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
9269b534f209Smrg#include <stdlib.h>
9270b534f209Smrg],[
9271b534f209Smrg    char *m0, *r0, *c0, *p;
9272b534f209Smrg    m0 = malloc(0);
9273b534f209Smrg    p = malloc(10);
9274b534f209Smrg    r0 = realloc(p,0);
9275b534f209Smrg    c0 = calloc(0,10);
9276b534f209Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
9277b534f209Smrg])],
9278b534f209Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
9279b534f209Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
9280b534f209Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
9281b534f209Smrgfi
9282b534f209SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
928315fb4814Smrg
9284b534f209Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
9285b534f209Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
9286b534f209Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
9287b534f209Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
9288b534f209Smrgelse
9289b534f209Smrg	MALLOC_ZERO_CFLAGS=""
9290b534f209Smrg	XMALLOC_ZERO_CFLAGS=""
9291b534f209Smrg	XTMALLOC_ZERO_CFLAGS=""
9292b534f209Smrgfi
929315fb4814Smrg
9294b534f209SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
9295b534f209SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
9296b534f209SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
9297b534f209Smrg]) # XORG_CHECK_MALLOC_ZERO
929815fb4814Smrg
9299b534f209Smrg# XORG_WITH_LINT()
9300b534f209Smrg# ----------------
9301b534f209Smrg# Minimum version: 1.1.0
9302de78e416Smrg#
9303b534f209Smrg# This macro enables the use of a tool that flags some suspicious and
9304b534f209Smrg# non-portable constructs (likely to be bugs) in C language source code.
9305b534f209Smrg# It will attempt to locate the tool and use appropriate options.
9306b534f209Smrg# There are various lint type tools on different platforms.
9307b534f209Smrg#
9308b534f209Smrg# Interface to module:
9309b534f209Smrg# LINT:		returns the path to the tool found on the platform
9310b534f209Smrg#		or the value set to LINT on the configure cmd line
9311b534f209Smrg#		also an Automake conditional
9312b534f209Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
9313b534f209Smrg#
9314b534f209Smrg# --with-lint:	'yes' user instructs the module to use lint
9315b534f209Smrg#		'no' user instructs the module not to use lint (default)
9316b534f209Smrg#
9317b534f209Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
9318b534f209Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
9319b534f209Smrg#
9320b534f209SmrgAC_DEFUN([XORG_WITH_LINT],[
9321de78e416Smrg
9322b534f209SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
9323b534f209SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
9324b534f209SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
9325b534f209Smrg		[Use a lint-style source code checker (default: disabled)])],
9326b534f209Smrg		[use_lint=$withval], [use_lint=no])
932715fb4814Smrg
9328b534f209Smrg# Obtain platform specific info like program name and options
9329b534f209Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
9330b534f209Smrgcase $host_os in
9331b534f209Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
9332b534f209Smrg	lint_name=splint
9333b534f209Smrg	lint_options="-badflag"
9334b534f209Smrg	;;
9335b534f209Smrg  *freebsd* | *netbsd*)
9336b534f209Smrg	lint_name=lint
9337b534f209Smrg	lint_options="-u -b"
9338b534f209Smrg	;;
9339b534f209Smrg  *solaris*)
9340b534f209Smrg	lint_name=lint
9341b534f209Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
9342b534f209Smrg	;;
934383cab373Smrgesac
934415fb4814Smrg
9345b534f209Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
9346b534f209Smrgif test "x$use_lint" = x"yes" ; then
9347b534f209Smrg   AC_PATH_PROG([LINT], [$lint_name])
9348b534f209Smrg   if test "x$LINT" = "x"; then
9349b534f209Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
935083cab373Smrg   fi
9351b534f209Smrgelif test "x$use_lint" = x"no" ; then
9352b534f209Smrg   if test "x$LINT" != "x"; then
9353b534f209Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
935483cab373Smrg   fi
935515fb4814Smrgelse
9356b534f209Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
9357de78e416Smrgfi
935883cab373Smrg
9359b534f209Smrg# User supplied flags override default flags
9360b534f209Smrgif test "x$LINT_FLAGS" != "x"; then
9361b534f209Smrg   lint_options=$LINT_FLAGS
9362b534f209Smrgfi
9363b410ddbeSmrg
9364b534f209SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
9365b534f209SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
9366b410ddbeSmrg
9367b534f209Smrg]) # XORG_WITH_LINT
9368b410ddbeSmrg
9369b534f209Smrg# XORG_LINT_LIBRARY(LIBNAME)
9370b534f209Smrg# --------------------------
9371b534f209Smrg# Minimum version: 1.1.0
937283cab373Smrg#
9373b534f209Smrg# Sets up flags for building lint libraries for checking programs that call
9374b534f209Smrg# functions in the library.
9375b534f209Smrg#
9376b534f209Smrg# Interface to module:
9377b534f209Smrg# LINTLIB		- Automake variable with the name of lint library file to make
9378b534f209Smrg# MAKE_LINT_LIB		- Automake conditional
9379b534f209Smrg#
9380b534f209Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
9381b534f209Smrg#			  - 'no' user instructs the module not to create a lint library (default)
938283cab373Smrg
9383b534f209SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
9384b534f209SmrgAC_REQUIRE([XORG_WITH_LINT])
9385b534f209SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
9386b534f209Smrg	[Create lint library (default: disabled)])],
9387b534f209Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
9388b534f209Smrg
9389b534f209Smrgif test "x$make_lint_lib" = x"yes" ; then
9390b534f209Smrg   LINTLIB=llib-l$1.ln
9391b534f209Smrg   if test "x$LINT" = "x"; then
9392b534f209Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
9393b534f209Smrg   fi
9394b534f209Smrgelif test "x$make_lint_lib" != x"no" ; then
9395b534f209Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
939615fb4814Smrgfi
939715fb4814Smrg
9398b534f209SmrgAC_SUBST(LINTLIB)
9399b534f209SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9400b534f209Smrg
9401b534f209Smrg]) # XORG_LINT_LIBRARY
9402b534f209Smrg
9403b534f209Smrg# XORG_COMPILER_BRAND
9404b534f209Smrg# -------------------
9405b534f209Smrg# Minimum version: 1.14.0
9406b534f209Smrg#
9407b534f209Smrg# Checks for various brands of compilers and sets flags as appropriate:
9408b534f209Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
9409b534f209Smrg#   clang compiler - sets CLANGCC to "yes"
9410b534f209Smrg#   Intel compiler - sets INTELCC to "yes"
9411b534f209Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
9412b534f209Smrg#
9413b534f209SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
9414b534f209SmrgAC_REQUIRE([AC_PROG_CC_C99])
9415b534f209SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
9416b534f209SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9417b534f209SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9418b534f209Smrg]) # XORG_COMPILER_BRAND
9419b534f209Smrg
9420b534f209Smrg# XORG_CWARNFLAGS
9421b534f209Smrg# ---------------
9422b534f209Smrg# Minimum version: 1.2.0
9423b534f209Smrg#
9424b534f209Smrg# Defines CWARNFLAGS to enable C compiler warnings.
9425b534f209Smrg#
9426b534f209SmrgAC_DEFUN([XORG_CWARNFLAGS], [
9427b534f209SmrgAC_REQUIRE([AC_PROG_CC_C99])
9428b534f209SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
9429b534f209Smrgif  test "x$GCC" = xyes ; then
9430b534f209Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
9431b534f209Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
9432b534f209Smrg-Wbad-function-cast -Wformat=2"
9433b534f209Smrg    case `$CC -dumpversion` in
9434b534f209Smrg    3.4.* | 4.*)
9435b534f209Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
9436b534f209Smrg	;;
9437b534f209Smrg    esac
9438b534f209Smrgelse
9439b534f209Smrg    if test "x$SUNCC" = "xyes"; then
9440b534f209Smrg	CWARNFLAGS="-v"
9441b534f209Smrg    fi
9442b534f209Smrgfi
9443b534f209SmrgAC_SUBST(CWARNFLAGS)
9444b534f209Smrg]) # XORG_CWARNFLAGS
9445b534f209Smrg
9446b534f209Smrg# XORG_STRICT_OPTION
9447b534f209Smrg# -----------------------
9448b534f209Smrg# Minimum version: 1.3.0
944983cab373Smrg#
9450b534f209Smrg# Add configure option to enable strict compilation flags, such as treating
9451b534f209Smrg# warnings as fatal errors.
9452b534f209Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
9453b534f209Smrg# $CWARNFLAGS.
9454b534f209Smrg#
9455b534f209Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
9456b534f209Smrg# when strict compilation is unconditionally desired.
9457b534f209SmrgAC_DEFUN([XORG_STRICT_OPTION], [
9458b534f209Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89
9459b534f209SmrgAC_REQUIRE([AC_PROG_CC_C99])
9460b534f209SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
9461b534f209SmrgAC_REQUIRE([XORG_CWARNFLAGS])
946215fb4814Smrg
9463b534f209SmrgAC_ARG_ENABLE(strict-compilation,
9464b534f209Smrg			  AS_HELP_STRING([--enable-strict-compilation],
9465b534f209Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
9466b534f209Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9467b534f209Smrgif test "x$GCC" = xyes ; then
9468b534f209Smrg    STRICT_CFLAGS="-pedantic -Werror"
9469b534f209Smrg    # Add -Werror=attributes if supported (gcc 4.2 & later)
9470b534f209Smrg    AC_MSG_CHECKING([if $CC supports -Werror=attributes])
9471b534f209Smrg    save_CFLAGS="$CFLAGS"
9472b534f209Smrg    CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
9473b534f209Smrg    AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
9474b534f209Smrg		      [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
9475b534f209Smrg		       AC_MSG_RESULT([yes])],
9476b534f209Smrg		      [AC_MSG_RESULT([no])])
9477b534f209Smrg    CFLAGS="$save_CFLAGS"
9478b534f209Smrgelif test "x$SUNCC" = "xyes"; then
9479b534f209Smrg    STRICT_CFLAGS="-errwarn"
9480b534f209Smrgelif test "x$INTELCC" = "xyes"; then
9481b534f209Smrg    STRICT_CFLAGS="-Werror"
9482b534f209Smrgfi
9483b534f209Smrgif test "x$STRICT_COMPILE" = "xyes"; then
9484b534f209Smrg    CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9485b534f209Smrgfi
9486b534f209SmrgAC_SUBST([STRICT_CFLAGS])
9487b534f209SmrgAC_SUBST([CWARNFLAGS])
9488b534f209Smrg]) # XORG_STRICT_OPTION
948915fb4814Smrg
9490b534f209Smrg# XORG_DEFAULT_OPTIONS
9491b534f209Smrg# --------------------
9492b534f209Smrg# Minimum version: 1.3.0
9493de78e416Smrg#
9494b534f209Smrg# Defines default options for X.Org modules.
9495b534f209Smrg#
9496b534f209SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
9497b534f209SmrgAC_REQUIRE([AC_PROG_INSTALL])
9498b534f209SmrgXORG_CWARNFLAGS
9499b534f209SmrgXORG_STRICT_OPTION
9500b534f209SmrgXORG_RELEASE_VERSION
9501b534f209SmrgXORG_CHANGELOG
9502b534f209SmrgXORG_INSTALL
9503b534f209SmrgXORG_MANPAGE_SECTIONS
9504b534f209Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
9505b534f209Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
9506b534f209Smrg]) # XORG_DEFAULT_OPTIONS
950715fb4814Smrg
9508b534f209Smrg# XORG_INSTALL()
9509b534f209Smrg# ----------------
9510b534f209Smrg# Minimum version: 1.4.0
9511b534f209Smrg#
9512b534f209Smrg# Defines the variable INSTALL_CMD as the command to copy
9513b534f209Smrg# INSTALL from $prefix/share/util-macros.
9514b534f209Smrg#
9515b534f209SmrgAC_DEFUN([XORG_INSTALL], [
9516b534f209SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
9517b534f209Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
9518b534f209SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
9519b534f209Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
9520b534f209Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
9521b534f209Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
9522b534f209SmrgAC_SUBST([INSTALL_CMD])
9523b534f209Smrg]) # XORG_INSTALL
9524b534f209Smrgdnl Copyright 2005 Red Hat, Inc
9525b534f209Smrgdnl
9526b534f209Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9527b534f209Smrgdnl documentation for any purpose is hereby granted without fee, provided that
9528b534f209Smrgdnl the above copyright notice appear in all copies and that both that
9529b534f209Smrgdnl copyright notice and this permission notice appear in supporting
9530b534f209Smrgdnl documentation.
9531b534f209Smrgdnl
9532b534f209Smrgdnl The above copyright notice and this permission notice shall be included
9533b534f209Smrgdnl in all copies or substantial portions of the Software.
9534b534f209Smrgdnl
9535b534f209Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9536b534f209Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9537b534f209Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9538b534f209Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9539b534f209Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9540b534f209Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9541b534f209Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
9542b534f209Smrgdnl
9543b534f209Smrgdnl Except as contained in this notice, the name of the copyright holders shall
9544b534f209Smrgdnl not be used in advertising or otherwise to promote the sale, use or
9545b534f209Smrgdnl other dealings in this Software without prior written authorization
9546b534f209Smrgdnl from the copyright holders.
9547b534f209Smrgdnl
9548de78e416Smrg
9549b534f209Smrg# XORG_RELEASE_VERSION
955083cab373Smrg# --------------------
9551b534f209Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
9552b534f209Smrg 
9553b534f209SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
9554b534f209Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
9555b534f209Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
9556b534f209Smrg		[Major version of this package])
9557b534f209Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
9558b534f209Smrg	if test "x$PVM" = "x"; then
9559b534f209Smrg		PVM="0"
9560b534f209Smrg	fi
9561b534f209Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
9562b534f209Smrg		[$PVM],
9563b534f209Smrg		[Minor version of this package])
9564b534f209Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
9565b534f209Smrg	if test "x$PVP" = "x"; then
9566b534f209Smrg		PVP="0"
9567b534f209Smrg	fi
9568b534f209Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
9569b534f209Smrg		[$PVP],
9570b534f209Smrg		[Patch version of this package])
9571b534f209Smrg])
9572b534f209Smrg
9573b534f209Smrg# XORG_CHANGELOG()
9574b534f209Smrg# ----------------
9575b534f209Smrg# Minimum version: 1.2.0
957615fb4814Smrg#
9577b534f209Smrg# Defines the variable CHANGELOG_CMD as the command to generate
9578b534f209Smrg# ChangeLog from git.
9579de78e416Smrg#
9580b534f209Smrg#
9581b534f209SmrgAC_DEFUN([XORG_CHANGELOG], [
9582b534f209SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
9583b534f209Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
9584b534f209Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
9585b534f209Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
9586b534f209SmrgAC_SUBST([CHANGELOG_CMD])
9587b534f209Smrg]) # XORG_CHANGELOG
958883cab373Smrg
9589b534f209Smrgdnl Copyright 2005 Red Hat, Inc
9590b534f209Smrgdnl 
9591b534f209Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9592b534f209Smrgdnl documentation for any purpose is hereby granted without fee, provided that
9593b534f209Smrgdnl the above copyright notice appear in all copies and that both that
9594b534f209Smrgdnl copyright notice and this permission notice appear in supporting
9595b534f209Smrgdnl documentation.
9596b534f209Smrgdnl 
9597b534f209Smrgdnl The above copyright notice and this permission notice shall be included
9598b534f209Smrgdnl in all copies or substantial portions of the Software.
9599b534f209Smrgdnl 
9600b534f209Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9601b534f209Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9602b534f209Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9603b534f209Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9604b534f209Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9605b534f209Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9606b534f209Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
9607b534f209Smrgdnl 
9608b534f209Smrgdnl Except as contained in this notice, the name of the copyright holders shall
9609b534f209Smrgdnl not be used in advertising or otherwise to promote the sale, use or
9610b534f209Smrgdnl other dealings in this Software without prior written authorization
9611b534f209Smrgdnl from the copyright holders.
9612b534f209Smrgdnl 
961383cab373Smrg
9614b534f209Smrg# XORG_DRIVER_CHECK_EXT()
9615b534f209Smrg# --------------------------
9616b534f209Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
9617b534f209Smrg# is defined, then add $1 to $REQUIRED_MODULES.
961883cab373Smrg
9619b534f209SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
9620b534f209Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9621b534f209Smrg	SAVE_CFLAGS="$CFLAGS"
9622b534f209Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
9623b534f209Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9624b534f209Smrg#include "xorg-server.h"
9625b534f209Smrg#if !defined $1
9626b534f209Smrg#error $1 not defined
9627b534f209Smrg#endif
9628b534f209Smrg		]])],
9629b534f209Smrg		[_EXT_CHECK=yes],
9630b534f209Smrg		[_EXT_CHECK=no])
9631b534f209Smrg	CFLAGS="$SAVE_CFLAGS"
9632b534f209Smrg	AC_MSG_CHECKING([if $1 is defined])
9633b534f209Smrg	AC_MSG_RESULT([$_EXT_CHECK])
9634b534f209Smrg	if test "$_EXT_CHECK" != no; then
9635b534f209Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
9636b534f209Smrg	fi
9637b534f209Smrg])
963815fb4814Smrg
9639