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