xref: /OK3568_Linux_fs/external/xserver/m4/libtool.m4 (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
4*4882a593Smuzhiyun#   Written by Gordon Matzigkeit, 1996
5*4882a593Smuzhiyun#
6*4882a593Smuzhiyun# This file is free software; the Free Software Foundation gives
7*4882a593Smuzhiyun# unlimited permission to copy and/or distribute it, with or without
8*4882a593Smuzhiyun# modifications, as long as this notice is preserved.
9*4882a593Smuzhiyun
10*4882a593Smuzhiyunm4_define([_LT_COPYING], [dnl
11*4882a593Smuzhiyun# Copyright (C) 2014 Free Software Foundation, Inc.
12*4882a593Smuzhiyun# This is free software; see the source for copying conditions.  There is NO
13*4882a593Smuzhiyun# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun# GNU Libtool is free software; you can redistribute it and/or modify
16*4882a593Smuzhiyun# it under the terms of the GNU General Public License as published by
17*4882a593Smuzhiyun# the Free Software Foundation; either version 2 of of the License, or
18*4882a593Smuzhiyun# (at your option) any later version.
19*4882a593Smuzhiyun#
20*4882a593Smuzhiyun# As a special exception to the GNU General Public License, if you
21*4882a593Smuzhiyun# distribute this file as part of a program or library that is built
22*4882a593Smuzhiyun# using GNU Libtool, you may include this file under the  same
23*4882a593Smuzhiyun# distribution terms that you use for the rest of that program.
24*4882a593Smuzhiyun#
25*4882a593Smuzhiyun# GNU Libtool is distributed in the hope that it will be useful, but
26*4882a593Smuzhiyun# WITHOUT ANY WARRANTY; without even the implied warranty of
27*4882a593Smuzhiyun# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28*4882a593Smuzhiyun# GNU General Public License for more details.
29*4882a593Smuzhiyun#
30*4882a593Smuzhiyun# You should have received a copy of the GNU General Public License
31*4882a593Smuzhiyun# along with this program.  If not, see <http://www.gnu.org/licenses/>.
32*4882a593Smuzhiyun])
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun# serial 58 LT_INIT
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun# LT_PREREQ(VERSION)
38*4882a593Smuzhiyun# ------------------
39*4882a593Smuzhiyun# Complain and exit if this libtool version is less that VERSION.
40*4882a593Smuzhiyunm4_defun([LT_PREREQ],
41*4882a593Smuzhiyun[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
42*4882a593Smuzhiyun       [m4_default([$3],
43*4882a593Smuzhiyun		   [m4_fatal([Libtool version $1 or higher is required],
44*4882a593Smuzhiyun		             63)])],
45*4882a593Smuzhiyun       [$2])])
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun# _LT_CHECK_BUILDDIR
49*4882a593Smuzhiyun# ------------------
50*4882a593Smuzhiyun# Complain if the absolute build directory name contains unusual characters
51*4882a593Smuzhiyunm4_defun([_LT_CHECK_BUILDDIR],
52*4882a593Smuzhiyun[case `pwd` in
53*4882a593Smuzhiyun  *\ * | *\	*)
54*4882a593Smuzhiyun    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
55*4882a593Smuzhiyunesac
56*4882a593Smuzhiyun])
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun# LT_INIT([OPTIONS])
60*4882a593Smuzhiyun# ------------------
61*4882a593SmuzhiyunAC_DEFUN([LT_INIT],
62*4882a593Smuzhiyun[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
63*4882a593SmuzhiyunAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
64*4882a593SmuzhiyunAC_BEFORE([$0], [LT_LANG])dnl
65*4882a593SmuzhiyunAC_BEFORE([$0], [LT_OUTPUT])dnl
66*4882a593SmuzhiyunAC_BEFORE([$0], [LTDL_INIT])dnl
67*4882a593Smuzhiyunm4_require([_LT_CHECK_BUILDDIR])dnl
68*4882a593Smuzhiyun
69*4882a593Smuzhiyundnl Autoconf doesn't catch unexpanded LT_ macros by default:
70*4882a593Smuzhiyunm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
71*4882a593Smuzhiyunm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
72*4882a593Smuzhiyundnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
73*4882a593Smuzhiyundnl unless we require an AC_DEFUNed macro:
74*4882a593SmuzhiyunAC_REQUIRE([LTOPTIONS_VERSION])dnl
75*4882a593SmuzhiyunAC_REQUIRE([LTSUGAR_VERSION])dnl
76*4882a593SmuzhiyunAC_REQUIRE([LTVERSION_VERSION])dnl
77*4882a593SmuzhiyunAC_REQUIRE([LTOBSOLETE_VERSION])dnl
78*4882a593Smuzhiyunm4_require([_LT_PROG_LTMAIN])dnl
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
81*4882a593Smuzhiyun
82*4882a593Smuzhiyundnl Parse OPTIONS
83*4882a593Smuzhiyun_LT_SET_OPTIONS([$0], [$1])
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun# This can be used to rebuild libtool when needed
86*4882a593SmuzhiyunLIBTOOL_DEPS=$ltmain
87*4882a593Smuzhiyun
88*4882a593Smuzhiyun# Always use our own libtool.
89*4882a593SmuzhiyunLIBTOOL='$(SHELL) $(top_builddir)/libtool'
90*4882a593SmuzhiyunAC_SUBST(LIBTOOL)dnl
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun_LT_SETUP
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun# Only expand once:
95*4882a593Smuzhiyunm4_define([LT_INIT])
96*4882a593Smuzhiyun])# LT_INIT
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun# Old names:
99*4882a593SmuzhiyunAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
100*4882a593SmuzhiyunAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
101*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
102*4882a593Smuzhiyundnl AC_DEFUN([AC_PROG_LIBTOOL], [])
103*4882a593Smuzhiyundnl AC_DEFUN([AM_PROG_LIBTOOL], [])
104*4882a593Smuzhiyun
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun# _LT_PREPARE_CC_BASENAME
107*4882a593Smuzhiyun# -----------------------
108*4882a593Smuzhiyunm4_defun([_LT_PREPARE_CC_BASENAME], [
109*4882a593Smuzhiyun# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
110*4882a593Smuzhiyunfunc_cc_basename ()
111*4882a593Smuzhiyun{
112*4882a593Smuzhiyun    for cc_temp in @S|@*""; do
113*4882a593Smuzhiyun      case $cc_temp in
114*4882a593Smuzhiyun        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
115*4882a593Smuzhiyun        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
116*4882a593Smuzhiyun        \-*) ;;
117*4882a593Smuzhiyun        *) break;;
118*4882a593Smuzhiyun      esac
119*4882a593Smuzhiyun    done
120*4882a593Smuzhiyun    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
121*4882a593Smuzhiyun}
122*4882a593Smuzhiyun])# _LT_PREPARE_CC_BASENAME
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun# _LT_CC_BASENAME(CC)
126*4882a593Smuzhiyun# -------------------
127*4882a593Smuzhiyun# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
128*4882a593Smuzhiyun# but that macro is also expanded into generated libtool script, which
129*4882a593Smuzhiyun# arranges for $SED and $ECHO to be set by different means.
130*4882a593Smuzhiyunm4_defun([_LT_CC_BASENAME],
131*4882a593Smuzhiyun[m4_require([_LT_PREPARE_CC_BASENAME])dnl
132*4882a593SmuzhiyunAC_REQUIRE([_LT_DECL_SED])dnl
133*4882a593SmuzhiyunAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
134*4882a593Smuzhiyunfunc_cc_basename $1
135*4882a593Smuzhiyuncc_basename=$func_cc_basename_result
136*4882a593Smuzhiyun])
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun# _LT_FILEUTILS_DEFAULTS
140*4882a593Smuzhiyun# ----------------------
141*4882a593Smuzhiyun# It is okay to use these file commands and assume they have been set
142*4882a593Smuzhiyun# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
143*4882a593Smuzhiyunm4_defun([_LT_FILEUTILS_DEFAULTS],
144*4882a593Smuzhiyun[: ${CP="cp -f"}
145*4882a593Smuzhiyun: ${MV="mv -f"}
146*4882a593Smuzhiyun: ${RM="rm -f"}
147*4882a593Smuzhiyun])# _LT_FILEUTILS_DEFAULTS
148*4882a593Smuzhiyun
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun# _LT_SETUP
151*4882a593Smuzhiyun# ---------
152*4882a593Smuzhiyunm4_defun([_LT_SETUP],
153*4882a593Smuzhiyun[AC_REQUIRE([AC_CANONICAL_HOST])dnl
154*4882a593SmuzhiyunAC_REQUIRE([AC_CANONICAL_BUILD])dnl
155*4882a593SmuzhiyunAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
156*4882a593SmuzhiyunAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
159*4882a593Smuzhiyundnl
160*4882a593Smuzhiyun_LT_DECL([], [host_alias], [0], [The host system])dnl
161*4882a593Smuzhiyun_LT_DECL([], [host], [0])dnl
162*4882a593Smuzhiyun_LT_DECL([], [host_os], [0])dnl
163*4882a593Smuzhiyundnl
164*4882a593Smuzhiyun_LT_DECL([], [build_alias], [0], [The build system])dnl
165*4882a593Smuzhiyun_LT_DECL([], [build], [0])dnl
166*4882a593Smuzhiyun_LT_DECL([], [build_os], [0])dnl
167*4882a593Smuzhiyundnl
168*4882a593SmuzhiyunAC_REQUIRE([AC_PROG_CC])dnl
169*4882a593SmuzhiyunAC_REQUIRE([LT_PATH_LD])dnl
170*4882a593SmuzhiyunAC_REQUIRE([LT_PATH_NM])dnl
171*4882a593Smuzhiyundnl
172*4882a593SmuzhiyunAC_REQUIRE([AC_PROG_LN_S])dnl
173*4882a593Smuzhiyuntest -z "$LN_S" && LN_S="ln -s"
174*4882a593Smuzhiyun_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
175*4882a593Smuzhiyundnl
176*4882a593SmuzhiyunAC_REQUIRE([LT_CMD_MAX_LEN])dnl
177*4882a593Smuzhiyun_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
178*4882a593Smuzhiyun_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
179*4882a593Smuzhiyundnl
180*4882a593Smuzhiyunm4_require([_LT_FILEUTILS_DEFAULTS])dnl
181*4882a593Smuzhiyunm4_require([_LT_CHECK_SHELL_FEATURES])dnl
182*4882a593Smuzhiyunm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
183*4882a593Smuzhiyunm4_require([_LT_CMD_RELOAD])dnl
184*4882a593Smuzhiyunm4_require([_LT_CHECK_MAGIC_METHOD])dnl
185*4882a593Smuzhiyunm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
186*4882a593Smuzhiyunm4_require([_LT_CMD_OLD_ARCHIVE])dnl
187*4882a593Smuzhiyunm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
188*4882a593Smuzhiyunm4_require([_LT_WITH_SYSROOT])dnl
189*4882a593Smuzhiyunm4_require([_LT_CMD_TRUNCATE])dnl
190*4882a593Smuzhiyun
191*4882a593Smuzhiyun_LT_CONFIG_LIBTOOL_INIT([
192*4882a593Smuzhiyun# See if we are running on zsh, and set the options that allow our
193*4882a593Smuzhiyun# commands through without removal of \ escapes INIT.
194*4882a593Smuzhiyunif test -n "\${ZSH_VERSION+set}"; then
195*4882a593Smuzhiyun   setopt NO_GLOB_SUBST
196*4882a593Smuzhiyunfi
197*4882a593Smuzhiyun])
198*4882a593Smuzhiyunif test -n "${ZSH_VERSION+set}"; then
199*4882a593Smuzhiyun   setopt NO_GLOB_SUBST
200*4882a593Smuzhiyunfi
201*4882a593Smuzhiyun
202*4882a593Smuzhiyun_LT_CHECK_OBJDIR
203*4882a593Smuzhiyun
204*4882a593Smuzhiyunm4_require([_LT_TAG_COMPILER])dnl
205*4882a593Smuzhiyun
206*4882a593Smuzhiyuncase $host_os in
207*4882a593Smuzhiyunaix3*)
208*4882a593Smuzhiyun  # AIX sometimes has problems with the GCC collect2 program.  For some
209*4882a593Smuzhiyun  # reason, if we set the COLLECT_NAMES environment variable, the problems
210*4882a593Smuzhiyun  # vanish in a puff of smoke.
211*4882a593Smuzhiyun  if test set != "${COLLECT_NAMES+set}"; then
212*4882a593Smuzhiyun    COLLECT_NAMES=
213*4882a593Smuzhiyun    export COLLECT_NAMES
214*4882a593Smuzhiyun  fi
215*4882a593Smuzhiyun  ;;
216*4882a593Smuzhiyunesac
217*4882a593Smuzhiyun
218*4882a593Smuzhiyun# Global variables:
219*4882a593Smuzhiyunofile=libtool
220*4882a593Smuzhiyuncan_build_shared=yes
221*4882a593Smuzhiyun
222*4882a593Smuzhiyun# All known linkers require a '.a' archive for static linking (except MSVC,
223*4882a593Smuzhiyun# which needs '.lib').
224*4882a593Smuzhiyunlibext=a
225*4882a593Smuzhiyun
226*4882a593Smuzhiyunwith_gnu_ld=$lt_cv_prog_gnu_ld
227*4882a593Smuzhiyun
228*4882a593Smuzhiyunold_CC=$CC
229*4882a593Smuzhiyunold_CFLAGS=$CFLAGS
230*4882a593Smuzhiyun
231*4882a593Smuzhiyun# Set sane defaults for various variables
232*4882a593Smuzhiyuntest -z "$CC" && CC=cc
233*4882a593Smuzhiyuntest -z "$LTCC" && LTCC=$CC
234*4882a593Smuzhiyuntest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
235*4882a593Smuzhiyuntest -z "$LD" && LD=ld
236*4882a593Smuzhiyuntest -z "$ac_objext" && ac_objext=o
237*4882a593Smuzhiyun
238*4882a593Smuzhiyun_LT_CC_BASENAME([$compiler])
239*4882a593Smuzhiyun
240*4882a593Smuzhiyun# Only perform the check for file, if the check method requires it
241*4882a593Smuzhiyuntest -z "$MAGIC_CMD" && MAGIC_CMD=file
242*4882a593Smuzhiyuncase $deplibs_check_method in
243*4882a593Smuzhiyunfile_magic*)
244*4882a593Smuzhiyun  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
245*4882a593Smuzhiyun    _LT_PATH_MAGIC
246*4882a593Smuzhiyun  fi
247*4882a593Smuzhiyun  ;;
248*4882a593Smuzhiyunesac
249*4882a593Smuzhiyun
250*4882a593Smuzhiyun# Use C for the default configuration in the libtool script
251*4882a593SmuzhiyunLT_SUPPORTED_TAG([CC])
252*4882a593Smuzhiyun_LT_LANG_C_CONFIG
253*4882a593Smuzhiyun_LT_LANG_DEFAULT_CONFIG
254*4882a593Smuzhiyun_LT_CONFIG_COMMANDS
255*4882a593Smuzhiyun])# _LT_SETUP
256*4882a593Smuzhiyun
257*4882a593Smuzhiyun
258*4882a593Smuzhiyun# _LT_PREPARE_SED_QUOTE_VARS
259*4882a593Smuzhiyun# --------------------------
260*4882a593Smuzhiyun# Define a few sed substitution that help us do robust quoting.
261*4882a593Smuzhiyunm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
262*4882a593Smuzhiyun[# Backslashify metacharacters that are still active within
263*4882a593Smuzhiyun# double-quoted strings.
264*4882a593Smuzhiyunsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
265*4882a593Smuzhiyun
266*4882a593Smuzhiyun# Same as above, but do not quote variable references.
267*4882a593Smuzhiyundouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
268*4882a593Smuzhiyun
269*4882a593Smuzhiyun# Sed substitution to delay expansion of an escaped shell variable in a
270*4882a593Smuzhiyun# double_quote_subst'ed string.
271*4882a593Smuzhiyundelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
272*4882a593Smuzhiyun
273*4882a593Smuzhiyun# Sed substitution to delay expansion of an escaped single quote.
274*4882a593Smuzhiyundelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun# Sed substitution to avoid accidental globbing in evaled expressions
277*4882a593Smuzhiyunno_glob_subst='s/\*/\\\*/g'
278*4882a593Smuzhiyun])
279*4882a593Smuzhiyun
280*4882a593Smuzhiyun# _LT_PROG_LTMAIN
281*4882a593Smuzhiyun# ---------------
282*4882a593Smuzhiyun# Note that this code is called both from 'configure', and 'config.status'
283*4882a593Smuzhiyun# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
284*4882a593Smuzhiyun# 'config.status' has no value for ac_aux_dir unless we are using Automake,
285*4882a593Smuzhiyun# so we pass a copy along to make sure it has a sensible value anyway.
286*4882a593Smuzhiyunm4_defun([_LT_PROG_LTMAIN],
287*4882a593Smuzhiyun[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
288*4882a593Smuzhiyun_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
289*4882a593Smuzhiyunltmain=$ac_aux_dir/ltmain.sh
290*4882a593Smuzhiyun])# _LT_PROG_LTMAIN
291*4882a593Smuzhiyun
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun## ------------------------------------- ##
294*4882a593Smuzhiyun## Accumulate code for creating libtool. ##
295*4882a593Smuzhiyun## ------------------------------------- ##
296*4882a593Smuzhiyun
297*4882a593Smuzhiyun# So that we can recreate a full libtool script including additional
298*4882a593Smuzhiyun# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
299*4882a593Smuzhiyun# in macros and then make a single call at the end using the 'libtool'
300*4882a593Smuzhiyun# label.
301*4882a593Smuzhiyun
302*4882a593Smuzhiyun
303*4882a593Smuzhiyun# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
304*4882a593Smuzhiyun# ----------------------------------------
305*4882a593Smuzhiyun# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
306*4882a593Smuzhiyunm4_define([_LT_CONFIG_LIBTOOL_INIT],
307*4882a593Smuzhiyun[m4_ifval([$1],
308*4882a593Smuzhiyun          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
309*4882a593Smuzhiyun                     [$1
310*4882a593Smuzhiyun])])])
311*4882a593Smuzhiyun
312*4882a593Smuzhiyun# Initialize.
313*4882a593Smuzhiyunm4_define([_LT_OUTPUT_LIBTOOL_INIT])
314*4882a593Smuzhiyun
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun# _LT_CONFIG_LIBTOOL([COMMANDS])
317*4882a593Smuzhiyun# ------------------------------
318*4882a593Smuzhiyun# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
319*4882a593Smuzhiyunm4_define([_LT_CONFIG_LIBTOOL],
320*4882a593Smuzhiyun[m4_ifval([$1],
321*4882a593Smuzhiyun          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
322*4882a593Smuzhiyun                     [$1
323*4882a593Smuzhiyun])])])
324*4882a593Smuzhiyun
325*4882a593Smuzhiyun# Initialize.
326*4882a593Smuzhiyunm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
327*4882a593Smuzhiyun
328*4882a593Smuzhiyun
329*4882a593Smuzhiyun# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
330*4882a593Smuzhiyun# -----------------------------------------------------
331*4882a593Smuzhiyunm4_defun([_LT_CONFIG_SAVE_COMMANDS],
332*4882a593Smuzhiyun[_LT_CONFIG_LIBTOOL([$1])
333*4882a593Smuzhiyun_LT_CONFIG_LIBTOOL_INIT([$2])
334*4882a593Smuzhiyun])
335*4882a593Smuzhiyun
336*4882a593Smuzhiyun
337*4882a593Smuzhiyun# _LT_FORMAT_COMMENT([COMMENT])
338*4882a593Smuzhiyun# -----------------------------
339*4882a593Smuzhiyun# Add leading comment marks to the start of each line, and a trailing
340*4882a593Smuzhiyun# full-stop to the whole comment if one is not present already.
341*4882a593Smuzhiyunm4_define([_LT_FORMAT_COMMENT],
342*4882a593Smuzhiyun[m4_ifval([$1], [
343*4882a593Smuzhiyunm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
344*4882a593Smuzhiyun              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
345*4882a593Smuzhiyun)])
346*4882a593Smuzhiyun
347*4882a593Smuzhiyun
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun## ------------------------ ##
350*4882a593Smuzhiyun## FIXME: Eliminate VARNAME ##
351*4882a593Smuzhiyun## ------------------------ ##
352*4882a593Smuzhiyun
353*4882a593Smuzhiyun
354*4882a593Smuzhiyun# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
355*4882a593Smuzhiyun# -------------------------------------------------------------------
356*4882a593Smuzhiyun# CONFIGNAME is the name given to the value in the libtool script.
357*4882a593Smuzhiyun# VARNAME is the (base) name used in the configure script.
358*4882a593Smuzhiyun# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
359*4882a593Smuzhiyun# VARNAME.  Any other value will be used directly.
360*4882a593Smuzhiyunm4_define([_LT_DECL],
361*4882a593Smuzhiyun[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
362*4882a593Smuzhiyun    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
363*4882a593Smuzhiyun	[m4_ifval([$1], [$1], [$2])])
364*4882a593Smuzhiyun    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
365*4882a593Smuzhiyun    m4_ifval([$4],
366*4882a593Smuzhiyun	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
367*4882a593Smuzhiyun    lt_dict_add_subkey([lt_decl_dict], [$2],
368*4882a593Smuzhiyun	[tagged?], [m4_ifval([$5], [yes], [no])])])
369*4882a593Smuzhiyun])
370*4882a593Smuzhiyun
371*4882a593Smuzhiyun
372*4882a593Smuzhiyun# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
373*4882a593Smuzhiyun# --------------------------------------------------------
374*4882a593Smuzhiyunm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
375*4882a593Smuzhiyun
376*4882a593Smuzhiyun
377*4882a593Smuzhiyun# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
378*4882a593Smuzhiyun# ------------------------------------------------
379*4882a593Smuzhiyunm4_define([lt_decl_tag_varnames],
380*4882a593Smuzhiyun[_lt_decl_filter([tagged?], [yes], $@)])
381*4882a593Smuzhiyun
382*4882a593Smuzhiyun
383*4882a593Smuzhiyun# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
384*4882a593Smuzhiyun# ---------------------------------------------------------
385*4882a593Smuzhiyunm4_define([_lt_decl_filter],
386*4882a593Smuzhiyun[m4_case([$#],
387*4882a593Smuzhiyun  [0], [m4_fatal([$0: too few arguments: $#])],
388*4882a593Smuzhiyun  [1], [m4_fatal([$0: too few arguments: $#: $1])],
389*4882a593Smuzhiyun  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
390*4882a593Smuzhiyun  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
391*4882a593Smuzhiyun  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
392*4882a593Smuzhiyun])
393*4882a593Smuzhiyun
394*4882a593Smuzhiyun
395*4882a593Smuzhiyun# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
396*4882a593Smuzhiyun# --------------------------------------------------
397*4882a593Smuzhiyunm4_define([lt_decl_quote_varnames],
398*4882a593Smuzhiyun[_lt_decl_filter([value], [1], $@)])
399*4882a593Smuzhiyun
400*4882a593Smuzhiyun
401*4882a593Smuzhiyun# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
402*4882a593Smuzhiyun# ---------------------------------------------------
403*4882a593Smuzhiyunm4_define([lt_decl_dquote_varnames],
404*4882a593Smuzhiyun[_lt_decl_filter([value], [2], $@)])
405*4882a593Smuzhiyun
406*4882a593Smuzhiyun
407*4882a593Smuzhiyun# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
408*4882a593Smuzhiyun# ---------------------------------------------------
409*4882a593Smuzhiyunm4_define([lt_decl_varnames_tagged],
410*4882a593Smuzhiyun[m4_assert([$# <= 2])dnl
411*4882a593Smuzhiyun_$0(m4_quote(m4_default([$1], [[, ]])),
412*4882a593Smuzhiyun    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
413*4882a593Smuzhiyun    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
414*4882a593Smuzhiyunm4_define([_lt_decl_varnames_tagged],
415*4882a593Smuzhiyun[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
416*4882a593Smuzhiyun
417*4882a593Smuzhiyun
418*4882a593Smuzhiyun# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
419*4882a593Smuzhiyun# ------------------------------------------------
420*4882a593Smuzhiyunm4_define([lt_decl_all_varnames],
421*4882a593Smuzhiyun[_$0(m4_quote(m4_default([$1], [[, ]])),
422*4882a593Smuzhiyun     m4_if([$2], [],
423*4882a593Smuzhiyun	   m4_quote(lt_decl_varnames),
424*4882a593Smuzhiyun	m4_quote(m4_shift($@))))[]dnl
425*4882a593Smuzhiyun])
426*4882a593Smuzhiyunm4_define([_lt_decl_all_varnames],
427*4882a593Smuzhiyun[lt_join($@, lt_decl_varnames_tagged([$1],
428*4882a593Smuzhiyun			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
429*4882a593Smuzhiyun])
430*4882a593Smuzhiyun
431*4882a593Smuzhiyun
432*4882a593Smuzhiyun# _LT_CONFIG_STATUS_DECLARE([VARNAME])
433*4882a593Smuzhiyun# ------------------------------------
434*4882a593Smuzhiyun# Quote a variable value, and forward it to 'config.status' so that its
435*4882a593Smuzhiyun# declaration there will have the same value as in 'configure'.  VARNAME
436*4882a593Smuzhiyun# must have a single quote delimited value for this to work.
437*4882a593Smuzhiyunm4_define([_LT_CONFIG_STATUS_DECLARE],
438*4882a593Smuzhiyun[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
439*4882a593Smuzhiyun
440*4882a593Smuzhiyun
441*4882a593Smuzhiyun# _LT_CONFIG_STATUS_DECLARATIONS
442*4882a593Smuzhiyun# ------------------------------
443*4882a593Smuzhiyun# We delimit libtool config variables with single quotes, so when
444*4882a593Smuzhiyun# we write them to config.status, we have to be sure to quote all
445*4882a593Smuzhiyun# embedded single quotes properly.  In configure, this macro expands
446*4882a593Smuzhiyun# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
447*4882a593Smuzhiyun#
448*4882a593Smuzhiyun#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
449*4882a593Smuzhiyunm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
450*4882a593Smuzhiyun[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
451*4882a593Smuzhiyun    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
452*4882a593Smuzhiyun
453*4882a593Smuzhiyun
454*4882a593Smuzhiyun# _LT_LIBTOOL_TAGS
455*4882a593Smuzhiyun# ----------------
456*4882a593Smuzhiyun# Output comment and list of tags supported by the script
457*4882a593Smuzhiyunm4_defun([_LT_LIBTOOL_TAGS],
458*4882a593Smuzhiyun[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
459*4882a593Smuzhiyunavailable_tags='_LT_TAGS'dnl
460*4882a593Smuzhiyun])
461*4882a593Smuzhiyun
462*4882a593Smuzhiyun
463*4882a593Smuzhiyun# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
464*4882a593Smuzhiyun# -----------------------------------
465*4882a593Smuzhiyun# Extract the dictionary values for VARNAME (optionally with TAG) and
466*4882a593Smuzhiyun# expand to a commented shell variable setting:
467*4882a593Smuzhiyun#
468*4882a593Smuzhiyun#    # Some comment about what VAR is for.
469*4882a593Smuzhiyun#    visible_name=$lt_internal_name
470*4882a593Smuzhiyunm4_define([_LT_LIBTOOL_DECLARE],
471*4882a593Smuzhiyun[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
472*4882a593Smuzhiyun					   [description])))[]dnl
473*4882a593Smuzhiyunm4_pushdef([_libtool_name],
474*4882a593Smuzhiyun    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
475*4882a593Smuzhiyunm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
476*4882a593Smuzhiyun    [0], [_libtool_name=[$]$1],
477*4882a593Smuzhiyun    [1], [_libtool_name=$lt_[]$1],
478*4882a593Smuzhiyun    [2], [_libtool_name=$lt_[]$1],
479*4882a593Smuzhiyun    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
480*4882a593Smuzhiyunm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
481*4882a593Smuzhiyun])
482*4882a593Smuzhiyun
483*4882a593Smuzhiyun
484*4882a593Smuzhiyun# _LT_LIBTOOL_CONFIG_VARS
485*4882a593Smuzhiyun# -----------------------
486*4882a593Smuzhiyun# Produce commented declarations of non-tagged libtool config variables
487*4882a593Smuzhiyun# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
488*4882a593Smuzhiyun# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
489*4882a593Smuzhiyun# section) are produced by _LT_LIBTOOL_TAG_VARS.
490*4882a593Smuzhiyunm4_defun([_LT_LIBTOOL_CONFIG_VARS],
491*4882a593Smuzhiyun[m4_foreach([_lt_var],
492*4882a593Smuzhiyun    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
493*4882a593Smuzhiyun    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
494*4882a593Smuzhiyun
495*4882a593Smuzhiyun
496*4882a593Smuzhiyun# _LT_LIBTOOL_TAG_VARS(TAG)
497*4882a593Smuzhiyun# -------------------------
498*4882a593Smuzhiyunm4_define([_LT_LIBTOOL_TAG_VARS],
499*4882a593Smuzhiyun[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
500*4882a593Smuzhiyun    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
501*4882a593Smuzhiyun
502*4882a593Smuzhiyun
503*4882a593Smuzhiyun# _LT_TAGVAR(VARNAME, [TAGNAME])
504*4882a593Smuzhiyun# ------------------------------
505*4882a593Smuzhiyunm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
506*4882a593Smuzhiyun
507*4882a593Smuzhiyun
508*4882a593Smuzhiyun# _LT_CONFIG_COMMANDS
509*4882a593Smuzhiyun# -------------------
510*4882a593Smuzhiyun# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
511*4882a593Smuzhiyun# variables for single and double quote escaping we saved from calls
512*4882a593Smuzhiyun# to _LT_DECL, we can put quote escaped variables declarations
513*4882a593Smuzhiyun# into 'config.status', and then the shell code to quote escape them in
514*4882a593Smuzhiyun# for loops in 'config.status'.  Finally, any additional code accumulated
515*4882a593Smuzhiyun# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
516*4882a593Smuzhiyunm4_defun([_LT_CONFIG_COMMANDS],
517*4882a593Smuzhiyun[AC_PROVIDE_IFELSE([LT_OUTPUT],
518*4882a593Smuzhiyun	dnl If the libtool generation code has been placed in $CONFIG_LT,
519*4882a593Smuzhiyun	dnl instead of duplicating it all over again into config.status,
520*4882a593Smuzhiyun	dnl then we will have config.status run $CONFIG_LT later, so it
521*4882a593Smuzhiyun	dnl needs to know what name is stored there:
522*4882a593Smuzhiyun        [AC_CONFIG_COMMANDS([libtool],
523*4882a593Smuzhiyun            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
524*4882a593Smuzhiyun    dnl If the libtool generation code is destined for config.status,
525*4882a593Smuzhiyun    dnl expand the accumulated commands and init code now:
526*4882a593Smuzhiyun    [AC_CONFIG_COMMANDS([libtool],
527*4882a593Smuzhiyun        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
528*4882a593Smuzhiyun])#_LT_CONFIG_COMMANDS
529*4882a593Smuzhiyun
530*4882a593Smuzhiyun
531*4882a593Smuzhiyun# Initialize.
532*4882a593Smuzhiyunm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
533*4882a593Smuzhiyun[
534*4882a593Smuzhiyun
535*4882a593Smuzhiyun# The HP-UX ksh and POSIX shell print the target directory to stdout
536*4882a593Smuzhiyun# if CDPATH is set.
537*4882a593Smuzhiyun(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
538*4882a593Smuzhiyun
539*4882a593Smuzhiyunsed_quote_subst='$sed_quote_subst'
540*4882a593Smuzhiyundouble_quote_subst='$double_quote_subst'
541*4882a593Smuzhiyundelay_variable_subst='$delay_variable_subst'
542*4882a593Smuzhiyun_LT_CONFIG_STATUS_DECLARATIONS
543*4882a593SmuzhiyunLTCC='$LTCC'
544*4882a593SmuzhiyunLTCFLAGS='$LTCFLAGS'
545*4882a593Smuzhiyuncompiler='$compiler_DEFAULT'
546*4882a593Smuzhiyun
547*4882a593Smuzhiyun# A function that is used when there is no print builtin or printf.
548*4882a593Smuzhiyunfunc_fallback_echo ()
549*4882a593Smuzhiyun{
550*4882a593Smuzhiyun  eval 'cat <<_LTECHO_EOF
551*4882a593Smuzhiyun\$[]1
552*4882a593Smuzhiyun_LTECHO_EOF'
553*4882a593Smuzhiyun}
554*4882a593Smuzhiyun
555*4882a593Smuzhiyun# Quote evaled strings.
556*4882a593Smuzhiyunfor var in lt_decl_all_varnames([[ \
557*4882a593Smuzhiyun]], lt_decl_quote_varnames); do
558*4882a593Smuzhiyun    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
559*4882a593Smuzhiyun    *[[\\\\\\\`\\"\\\$]]*)
560*4882a593Smuzhiyun      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
561*4882a593Smuzhiyun      ;;
562*4882a593Smuzhiyun    *)
563*4882a593Smuzhiyun      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
564*4882a593Smuzhiyun      ;;
565*4882a593Smuzhiyun    esac
566*4882a593Smuzhiyundone
567*4882a593Smuzhiyun
568*4882a593Smuzhiyun# Double-quote double-evaled strings.
569*4882a593Smuzhiyunfor var in lt_decl_all_varnames([[ \
570*4882a593Smuzhiyun]], lt_decl_dquote_varnames); do
571*4882a593Smuzhiyun    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
572*4882a593Smuzhiyun    *[[\\\\\\\`\\"\\\$]]*)
573*4882a593Smuzhiyun      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
574*4882a593Smuzhiyun      ;;
575*4882a593Smuzhiyun    *)
576*4882a593Smuzhiyun      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
577*4882a593Smuzhiyun      ;;
578*4882a593Smuzhiyun    esac
579*4882a593Smuzhiyundone
580*4882a593Smuzhiyun
581*4882a593Smuzhiyun_LT_OUTPUT_LIBTOOL_INIT
582*4882a593Smuzhiyun])
583*4882a593Smuzhiyun
584*4882a593Smuzhiyun# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
585*4882a593Smuzhiyun# ------------------------------------
586*4882a593Smuzhiyun# Generate a child script FILE with all initialization necessary to
587*4882a593Smuzhiyun# reuse the environment learned by the parent script, and make the
588*4882a593Smuzhiyun# file executable.  If COMMENT is supplied, it is inserted after the
589*4882a593Smuzhiyun# '#!' sequence but before initialization text begins.  After this
590*4882a593Smuzhiyun# macro, additional text can be appended to FILE to form the body of
591*4882a593Smuzhiyun# the child script.  The macro ends with non-zero status if the
592*4882a593Smuzhiyun# file could not be fully written (such as if the disk is full).
593*4882a593Smuzhiyunm4_ifdef([AS_INIT_GENERATED],
594*4882a593Smuzhiyun[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
595*4882a593Smuzhiyun[m4_defun([_LT_GENERATED_FILE_INIT],
596*4882a593Smuzhiyun[m4_require([AS_PREPARE])]dnl
597*4882a593Smuzhiyun[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
598*4882a593Smuzhiyun[lt_write_fail=0
599*4882a593Smuzhiyuncat >$1 <<_ASEOF || lt_write_fail=1
600*4882a593Smuzhiyun#! $SHELL
601*4882a593Smuzhiyun# Generated by $as_me.
602*4882a593Smuzhiyun$2
603*4882a593SmuzhiyunSHELL=\${CONFIG_SHELL-$SHELL}
604*4882a593Smuzhiyunexport SHELL
605*4882a593Smuzhiyun_ASEOF
606*4882a593Smuzhiyuncat >>$1 <<\_ASEOF || lt_write_fail=1
607*4882a593SmuzhiyunAS_SHELL_SANITIZE
608*4882a593Smuzhiyun_AS_PREPARE
609*4882a593Smuzhiyunexec AS_MESSAGE_FD>&1
610*4882a593Smuzhiyun_ASEOF
611*4882a593Smuzhiyuntest 0 = "$lt_write_fail" && chmod +x $1[]dnl
612*4882a593Smuzhiyunm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
613*4882a593Smuzhiyun
614*4882a593Smuzhiyun# LT_OUTPUT
615*4882a593Smuzhiyun# ---------
616*4882a593Smuzhiyun# This macro allows early generation of the libtool script (before
617*4882a593Smuzhiyun# AC_OUTPUT is called), incase it is used in configure for compilation
618*4882a593Smuzhiyun# tests.
619*4882a593SmuzhiyunAC_DEFUN([LT_OUTPUT],
620*4882a593Smuzhiyun[: ${CONFIG_LT=./config.lt}
621*4882a593SmuzhiyunAC_MSG_NOTICE([creating $CONFIG_LT])
622*4882a593Smuzhiyun_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
623*4882a593Smuzhiyun[# Run this file to recreate a libtool stub with the current configuration.])
624*4882a593Smuzhiyun
625*4882a593Smuzhiyuncat >>"$CONFIG_LT" <<\_LTEOF
626*4882a593Smuzhiyunlt_cl_silent=false
627*4882a593Smuzhiyunexec AS_MESSAGE_LOG_FD>>config.log
628*4882a593Smuzhiyun{
629*4882a593Smuzhiyun  echo
630*4882a593Smuzhiyun  AS_BOX([Running $as_me.])
631*4882a593Smuzhiyun} >&AS_MESSAGE_LOG_FD
632*4882a593Smuzhiyun
633*4882a593Smuzhiyunlt_cl_help="\
634*4882a593Smuzhiyun'$as_me' creates a local libtool stub from the current configuration,
635*4882a593Smuzhiyunfor use in further configure time tests before the real libtool is
636*4882a593Smuzhiyungenerated.
637*4882a593Smuzhiyun
638*4882a593SmuzhiyunUsage: $[0] [[OPTIONS]]
639*4882a593Smuzhiyun
640*4882a593Smuzhiyun  -h, --help      print this help, then exit
641*4882a593Smuzhiyun  -V, --version   print version number, then exit
642*4882a593Smuzhiyun  -q, --quiet     do not print progress messages
643*4882a593Smuzhiyun  -d, --debug     don't remove temporary files
644*4882a593Smuzhiyun
645*4882a593SmuzhiyunReport bugs to <bug-libtool@gnu.org>."
646*4882a593Smuzhiyun
647*4882a593Smuzhiyunlt_cl_version="\
648*4882a593Smuzhiyunm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
649*4882a593Smuzhiyunm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
650*4882a593Smuzhiyunconfigured by $[0], generated by m4_PACKAGE_STRING.
651*4882a593Smuzhiyun
652*4882a593SmuzhiyunCopyright (C) 2011 Free Software Foundation, Inc.
653*4882a593SmuzhiyunThis config.lt script is free software; the Free Software Foundation
654*4882a593Smuzhiyungives unlimited permision to copy, distribute and modify it."
655*4882a593Smuzhiyun
656*4882a593Smuzhiyunwhile test 0 != $[#]
657*4882a593Smuzhiyundo
658*4882a593Smuzhiyun  case $[1] in
659*4882a593Smuzhiyun    --version | --v* | -V )
660*4882a593Smuzhiyun      echo "$lt_cl_version"; exit 0 ;;
661*4882a593Smuzhiyun    --help | --h* | -h )
662*4882a593Smuzhiyun      echo "$lt_cl_help"; exit 0 ;;
663*4882a593Smuzhiyun    --debug | --d* | -d )
664*4882a593Smuzhiyun      debug=: ;;
665*4882a593Smuzhiyun    --quiet | --q* | --silent | --s* | -q )
666*4882a593Smuzhiyun      lt_cl_silent=: ;;
667*4882a593Smuzhiyun
668*4882a593Smuzhiyun    -*) AC_MSG_ERROR([unrecognized option: $[1]
669*4882a593SmuzhiyunTry '$[0] --help' for more information.]) ;;
670*4882a593Smuzhiyun
671*4882a593Smuzhiyun    *) AC_MSG_ERROR([unrecognized argument: $[1]
672*4882a593SmuzhiyunTry '$[0] --help' for more information.]) ;;
673*4882a593Smuzhiyun  esac
674*4882a593Smuzhiyun  shift
675*4882a593Smuzhiyundone
676*4882a593Smuzhiyun
677*4882a593Smuzhiyunif $lt_cl_silent; then
678*4882a593Smuzhiyun  exec AS_MESSAGE_FD>/dev/null
679*4882a593Smuzhiyunfi
680*4882a593Smuzhiyun_LTEOF
681*4882a593Smuzhiyun
682*4882a593Smuzhiyuncat >>"$CONFIG_LT" <<_LTEOF
683*4882a593Smuzhiyun_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
684*4882a593Smuzhiyun_LTEOF
685*4882a593Smuzhiyun
686*4882a593Smuzhiyuncat >>"$CONFIG_LT" <<\_LTEOF
687*4882a593SmuzhiyunAC_MSG_NOTICE([creating $ofile])
688*4882a593Smuzhiyun_LT_OUTPUT_LIBTOOL_COMMANDS
689*4882a593SmuzhiyunAS_EXIT(0)
690*4882a593Smuzhiyun_LTEOF
691*4882a593Smuzhiyunchmod +x "$CONFIG_LT"
692*4882a593Smuzhiyun
693*4882a593Smuzhiyun# configure is writing to config.log, but config.lt does its own redirection,
694*4882a593Smuzhiyun# appending to config.log, which fails on DOS, as config.log is still kept
695*4882a593Smuzhiyun# open by configure.  Here we exec the FD to /dev/null, effectively closing
696*4882a593Smuzhiyun# config.log, so it can be properly (re)opened and appended to by config.lt.
697*4882a593Smuzhiyunlt_cl_success=:
698*4882a593Smuzhiyuntest yes = "$silent" &&
699*4882a593Smuzhiyun  lt_config_lt_args="$lt_config_lt_args --quiet"
700*4882a593Smuzhiyunexec AS_MESSAGE_LOG_FD>/dev/null
701*4882a593Smuzhiyun$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
702*4882a593Smuzhiyunexec AS_MESSAGE_LOG_FD>>config.log
703*4882a593Smuzhiyun$lt_cl_success || AS_EXIT(1)
704*4882a593Smuzhiyun])# LT_OUTPUT
705*4882a593Smuzhiyun
706*4882a593Smuzhiyun
707*4882a593Smuzhiyun# _LT_CONFIG(TAG)
708*4882a593Smuzhiyun# ---------------
709*4882a593Smuzhiyun# If TAG is the built-in tag, create an initial libtool script with a
710*4882a593Smuzhiyun# default configuration from the untagged config vars.  Otherwise add code
711*4882a593Smuzhiyun# to config.status for appending the configuration named by TAG from the
712*4882a593Smuzhiyun# matching tagged config vars.
713*4882a593Smuzhiyunm4_defun([_LT_CONFIG],
714*4882a593Smuzhiyun[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
715*4882a593Smuzhiyun_LT_CONFIG_SAVE_COMMANDS([
716*4882a593Smuzhiyun  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
717*4882a593Smuzhiyun  m4_if(_LT_TAG, [C], [
718*4882a593Smuzhiyun    # See if we are running on zsh, and set the options that allow our
719*4882a593Smuzhiyun    # commands through without removal of \ escapes.
720*4882a593Smuzhiyun    if test -n "${ZSH_VERSION+set}"; then
721*4882a593Smuzhiyun      setopt NO_GLOB_SUBST
722*4882a593Smuzhiyun    fi
723*4882a593Smuzhiyun
724*4882a593Smuzhiyun    cfgfile=${ofile}T
725*4882a593Smuzhiyun    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
726*4882a593Smuzhiyun    $RM "$cfgfile"
727*4882a593Smuzhiyun
728*4882a593Smuzhiyun    cat <<_LT_EOF >> "$cfgfile"
729*4882a593Smuzhiyun#! $SHELL
730*4882a593Smuzhiyun# Generated automatically by $as_me ($PACKAGE) $VERSION
731*4882a593Smuzhiyun# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
732*4882a593Smuzhiyun# NOTE: Changes made to this file will be lost: look at ltmain.sh.
733*4882a593Smuzhiyun
734*4882a593Smuzhiyun# Provide generalized library-building support services.
735*4882a593Smuzhiyun# Written by Gordon Matzigkeit, 1996
736*4882a593Smuzhiyun
737*4882a593Smuzhiyun_LT_COPYING
738*4882a593Smuzhiyun_LT_LIBTOOL_TAGS
739*4882a593Smuzhiyun
740*4882a593Smuzhiyun# Configured defaults for sys_lib_dlsearch_path munging.
741*4882a593Smuzhiyun: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
742*4882a593Smuzhiyun
743*4882a593Smuzhiyun# ### BEGIN LIBTOOL CONFIG
744*4882a593Smuzhiyun_LT_LIBTOOL_CONFIG_VARS
745*4882a593Smuzhiyun_LT_LIBTOOL_TAG_VARS
746*4882a593Smuzhiyun# ### END LIBTOOL CONFIG
747*4882a593Smuzhiyun
748*4882a593Smuzhiyun_LT_EOF
749*4882a593Smuzhiyun
750*4882a593Smuzhiyun    cat <<'_LT_EOF' >> "$cfgfile"
751*4882a593Smuzhiyun
752*4882a593Smuzhiyun# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
753*4882a593Smuzhiyun
754*4882a593Smuzhiyun_LT_PREPARE_MUNGE_PATH_LIST
755*4882a593Smuzhiyun_LT_PREPARE_CC_BASENAME
756*4882a593Smuzhiyun
757*4882a593Smuzhiyun# ### END FUNCTIONS SHARED WITH CONFIGURE
758*4882a593Smuzhiyun
759*4882a593Smuzhiyun_LT_EOF
760*4882a593Smuzhiyun
761*4882a593Smuzhiyun  case $host_os in
762*4882a593Smuzhiyun  aix3*)
763*4882a593Smuzhiyun    cat <<\_LT_EOF >> "$cfgfile"
764*4882a593Smuzhiyun# AIX sometimes has problems with the GCC collect2 program.  For some
765*4882a593Smuzhiyun# reason, if we set the COLLECT_NAMES environment variable, the problems
766*4882a593Smuzhiyun# vanish in a puff of smoke.
767*4882a593Smuzhiyunif test set != "${COLLECT_NAMES+set}"; then
768*4882a593Smuzhiyun  COLLECT_NAMES=
769*4882a593Smuzhiyun  export COLLECT_NAMES
770*4882a593Smuzhiyunfi
771*4882a593Smuzhiyun_LT_EOF
772*4882a593Smuzhiyun    ;;
773*4882a593Smuzhiyun  esac
774*4882a593Smuzhiyun
775*4882a593Smuzhiyun  _LT_PROG_LTMAIN
776*4882a593Smuzhiyun
777*4882a593Smuzhiyun  # We use sed instead of cat because bash on DJGPP gets confused if
778*4882a593Smuzhiyun  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
779*4882a593Smuzhiyun  # text mode, it properly converts lines to CR/LF.  This bash problem
780*4882a593Smuzhiyun  # is reportedly fixed, but why not run on old versions too?
781*4882a593Smuzhiyun  sed '$q' "$ltmain" >> "$cfgfile" \
782*4882a593Smuzhiyun     || (rm -f "$cfgfile"; exit 1)
783*4882a593Smuzhiyun
784*4882a593Smuzhiyun   mv -f "$cfgfile" "$ofile" ||
785*4882a593Smuzhiyun    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
786*4882a593Smuzhiyun  chmod +x "$ofile"
787*4882a593Smuzhiyun],
788*4882a593Smuzhiyun[cat <<_LT_EOF >> "$ofile"
789*4882a593Smuzhiyun
790*4882a593Smuzhiyundnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
791*4882a593Smuzhiyundnl in a comment (ie after a #).
792*4882a593Smuzhiyun# ### BEGIN LIBTOOL TAG CONFIG: $1
793*4882a593Smuzhiyun_LT_LIBTOOL_TAG_VARS(_LT_TAG)
794*4882a593Smuzhiyun# ### END LIBTOOL TAG CONFIG: $1
795*4882a593Smuzhiyun_LT_EOF
796*4882a593Smuzhiyun])dnl /m4_if
797*4882a593Smuzhiyun],
798*4882a593Smuzhiyun[m4_if([$1], [], [
799*4882a593Smuzhiyun    PACKAGE='$PACKAGE'
800*4882a593Smuzhiyun    VERSION='$VERSION'
801*4882a593Smuzhiyun    RM='$RM'
802*4882a593Smuzhiyun    ofile='$ofile'], [])
803*4882a593Smuzhiyun])dnl /_LT_CONFIG_SAVE_COMMANDS
804*4882a593Smuzhiyun])# _LT_CONFIG
805*4882a593Smuzhiyun
806*4882a593Smuzhiyun
807*4882a593Smuzhiyun# LT_SUPPORTED_TAG(TAG)
808*4882a593Smuzhiyun# ---------------------
809*4882a593Smuzhiyun# Trace this macro to discover what tags are supported by the libtool
810*4882a593Smuzhiyun# --tag option, using:
811*4882a593Smuzhiyun#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
812*4882a593SmuzhiyunAC_DEFUN([LT_SUPPORTED_TAG], [])
813*4882a593Smuzhiyun
814*4882a593Smuzhiyun
815*4882a593Smuzhiyun# C support is built-in for now
816*4882a593Smuzhiyunm4_define([_LT_LANG_C_enabled], [])
817*4882a593Smuzhiyunm4_define([_LT_TAGS], [])
818*4882a593Smuzhiyun
819*4882a593Smuzhiyun
820*4882a593Smuzhiyun# LT_LANG(LANG)
821*4882a593Smuzhiyun# -------------
822*4882a593Smuzhiyun# Enable libtool support for the given language if not already enabled.
823*4882a593SmuzhiyunAC_DEFUN([LT_LANG],
824*4882a593Smuzhiyun[AC_BEFORE([$0], [LT_OUTPUT])dnl
825*4882a593Smuzhiyunm4_case([$1],
826*4882a593Smuzhiyun  [C],			[_LT_LANG(C)],
827*4882a593Smuzhiyun  [C++],		[_LT_LANG(CXX)],
828*4882a593Smuzhiyun  [Go],			[_LT_LANG(GO)],
829*4882a593Smuzhiyun  [Java],		[_LT_LANG(GCJ)],
830*4882a593Smuzhiyun  [Fortran 77],		[_LT_LANG(F77)],
831*4882a593Smuzhiyun  [Fortran],		[_LT_LANG(FC)],
832*4882a593Smuzhiyun  [Windows Resource],	[_LT_LANG(RC)],
833*4882a593Smuzhiyun  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
834*4882a593Smuzhiyun    [_LT_LANG($1)],
835*4882a593Smuzhiyun    [m4_fatal([$0: unsupported language: "$1"])])])dnl
836*4882a593Smuzhiyun])# LT_LANG
837*4882a593Smuzhiyun
838*4882a593Smuzhiyun
839*4882a593Smuzhiyun# _LT_LANG(LANGNAME)
840*4882a593Smuzhiyun# ------------------
841*4882a593Smuzhiyunm4_defun([_LT_LANG],
842*4882a593Smuzhiyun[m4_ifdef([_LT_LANG_]$1[_enabled], [],
843*4882a593Smuzhiyun  [LT_SUPPORTED_TAG([$1])dnl
844*4882a593Smuzhiyun  m4_append([_LT_TAGS], [$1 ])dnl
845*4882a593Smuzhiyun  m4_define([_LT_LANG_]$1[_enabled], [])dnl
846*4882a593Smuzhiyun  _LT_LANG_$1_CONFIG($1)])dnl
847*4882a593Smuzhiyun])# _LT_LANG
848*4882a593Smuzhiyun
849*4882a593Smuzhiyun
850*4882a593Smuzhiyunm4_ifndef([AC_PROG_GO], [
851*4882a593Smuzhiyun############################################################
852*4882a593Smuzhiyun# NOTE: This macro has been submitted for inclusion into   #
853*4882a593Smuzhiyun#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
854*4882a593Smuzhiyun#  a released version of Autoconf we should remove this    #
855*4882a593Smuzhiyun#  macro and use it instead.                               #
856*4882a593Smuzhiyun############################################################
857*4882a593Smuzhiyunm4_defun([AC_PROG_GO],
858*4882a593Smuzhiyun[AC_LANG_PUSH(Go)dnl
859*4882a593SmuzhiyunAC_ARG_VAR([GOC],     [Go compiler command])dnl
860*4882a593SmuzhiyunAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
861*4882a593Smuzhiyun_AC_ARG_VAR_LDFLAGS()dnl
862*4882a593SmuzhiyunAC_CHECK_TOOL(GOC, gccgo)
863*4882a593Smuzhiyunif test -z "$GOC"; then
864*4882a593Smuzhiyun  if test -n "$ac_tool_prefix"; then
865*4882a593Smuzhiyun    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
866*4882a593Smuzhiyun  fi
867*4882a593Smuzhiyunfi
868*4882a593Smuzhiyunif test -z "$GOC"; then
869*4882a593Smuzhiyun  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
870*4882a593Smuzhiyunfi
871*4882a593Smuzhiyun])#m4_defun
872*4882a593Smuzhiyun])#m4_ifndef
873*4882a593Smuzhiyun
874*4882a593Smuzhiyun
875*4882a593Smuzhiyun# _LT_LANG_DEFAULT_CONFIG
876*4882a593Smuzhiyun# -----------------------
877*4882a593Smuzhiyunm4_defun([_LT_LANG_DEFAULT_CONFIG],
878*4882a593Smuzhiyun[AC_PROVIDE_IFELSE([AC_PROG_CXX],
879*4882a593Smuzhiyun  [LT_LANG(CXX)],
880*4882a593Smuzhiyun  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
881*4882a593Smuzhiyun
882*4882a593SmuzhiyunAC_PROVIDE_IFELSE([AC_PROG_F77],
883*4882a593Smuzhiyun  [LT_LANG(F77)],
884*4882a593Smuzhiyun  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
885*4882a593Smuzhiyun
886*4882a593SmuzhiyunAC_PROVIDE_IFELSE([AC_PROG_FC],
887*4882a593Smuzhiyun  [LT_LANG(FC)],
888*4882a593Smuzhiyun  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
889*4882a593Smuzhiyun
890*4882a593Smuzhiyundnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
891*4882a593Smuzhiyundnl pulling things in needlessly.
892*4882a593SmuzhiyunAC_PROVIDE_IFELSE([AC_PROG_GCJ],
893*4882a593Smuzhiyun  [LT_LANG(GCJ)],
894*4882a593Smuzhiyun  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
895*4882a593Smuzhiyun    [LT_LANG(GCJ)],
896*4882a593Smuzhiyun    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
897*4882a593Smuzhiyun      [LT_LANG(GCJ)],
898*4882a593Smuzhiyun      [m4_ifdef([AC_PROG_GCJ],
899*4882a593Smuzhiyun	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
900*4882a593Smuzhiyun       m4_ifdef([A][M_PROG_GCJ],
901*4882a593Smuzhiyun	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
902*4882a593Smuzhiyun       m4_ifdef([LT_PROG_GCJ],
903*4882a593Smuzhiyun	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
904*4882a593Smuzhiyun
905*4882a593SmuzhiyunAC_PROVIDE_IFELSE([AC_PROG_GO],
906*4882a593Smuzhiyun  [LT_LANG(GO)],
907*4882a593Smuzhiyun  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
908*4882a593Smuzhiyun
909*4882a593SmuzhiyunAC_PROVIDE_IFELSE([LT_PROG_RC],
910*4882a593Smuzhiyun  [LT_LANG(RC)],
911*4882a593Smuzhiyun  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
912*4882a593Smuzhiyun])# _LT_LANG_DEFAULT_CONFIG
913*4882a593Smuzhiyun
914*4882a593Smuzhiyun# Obsolete macros:
915*4882a593SmuzhiyunAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
916*4882a593SmuzhiyunAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
917*4882a593SmuzhiyunAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
918*4882a593SmuzhiyunAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
919*4882a593SmuzhiyunAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
920*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
921*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_CXX], [])
922*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_F77], [])
923*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_FC], [])
924*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
925*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_RC], [])
926*4882a593Smuzhiyun
927*4882a593Smuzhiyun
928*4882a593Smuzhiyun# _LT_TAG_COMPILER
929*4882a593Smuzhiyun# ----------------
930*4882a593Smuzhiyunm4_defun([_LT_TAG_COMPILER],
931*4882a593Smuzhiyun[AC_REQUIRE([AC_PROG_CC])dnl
932*4882a593Smuzhiyun
933*4882a593Smuzhiyun_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
934*4882a593Smuzhiyun_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
935*4882a593Smuzhiyun_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
936*4882a593Smuzhiyun_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
937*4882a593Smuzhiyun
938*4882a593Smuzhiyun# If no C compiler was specified, use CC.
939*4882a593SmuzhiyunLTCC=${LTCC-"$CC"}
940*4882a593Smuzhiyun
941*4882a593Smuzhiyun# If no C compiler flags were specified, use CFLAGS.
942*4882a593SmuzhiyunLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
943*4882a593Smuzhiyun
944*4882a593Smuzhiyun# Allow CC to be a program name with arguments.
945*4882a593Smuzhiyuncompiler=$CC
946*4882a593Smuzhiyun])# _LT_TAG_COMPILER
947*4882a593Smuzhiyun
948*4882a593Smuzhiyun
949*4882a593Smuzhiyun# _LT_COMPILER_BOILERPLATE
950*4882a593Smuzhiyun# ------------------------
951*4882a593Smuzhiyun# Check for compiler boilerplate output or warnings with
952*4882a593Smuzhiyun# the simple compiler test code.
953*4882a593Smuzhiyunm4_defun([_LT_COMPILER_BOILERPLATE],
954*4882a593Smuzhiyun[m4_require([_LT_DECL_SED])dnl
955*4882a593Smuzhiyunac_outfile=conftest.$ac_objext
956*4882a593Smuzhiyunecho "$lt_simple_compile_test_code" >conftest.$ac_ext
957*4882a593Smuzhiyuneval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
958*4882a593Smuzhiyun_lt_compiler_boilerplate=`cat conftest.err`
959*4882a593Smuzhiyun$RM conftest*
960*4882a593Smuzhiyun])# _LT_COMPILER_BOILERPLATE
961*4882a593Smuzhiyun
962*4882a593Smuzhiyun
963*4882a593Smuzhiyun# _LT_LINKER_BOILERPLATE
964*4882a593Smuzhiyun# ----------------------
965*4882a593Smuzhiyun# Check for linker boilerplate output or warnings with
966*4882a593Smuzhiyun# the simple link test code.
967*4882a593Smuzhiyunm4_defun([_LT_LINKER_BOILERPLATE],
968*4882a593Smuzhiyun[m4_require([_LT_DECL_SED])dnl
969*4882a593Smuzhiyunac_outfile=conftest.$ac_objext
970*4882a593Smuzhiyunecho "$lt_simple_link_test_code" >conftest.$ac_ext
971*4882a593Smuzhiyuneval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
972*4882a593Smuzhiyun_lt_linker_boilerplate=`cat conftest.err`
973*4882a593Smuzhiyun$RM -r conftest*
974*4882a593Smuzhiyun])# _LT_LINKER_BOILERPLATE
975*4882a593Smuzhiyun
976*4882a593Smuzhiyun# _LT_REQUIRED_DARWIN_CHECKS
977*4882a593Smuzhiyun# -------------------------
978*4882a593Smuzhiyunm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
979*4882a593Smuzhiyun  case $host_os in
980*4882a593Smuzhiyun    rhapsody* | darwin*)
981*4882a593Smuzhiyun    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
982*4882a593Smuzhiyun    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
983*4882a593Smuzhiyun    AC_CHECK_TOOL([LIPO], [lipo], [:])
984*4882a593Smuzhiyun    AC_CHECK_TOOL([OTOOL], [otool], [:])
985*4882a593Smuzhiyun    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
986*4882a593Smuzhiyun    _LT_DECL([], [DSYMUTIL], [1],
987*4882a593Smuzhiyun      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
988*4882a593Smuzhiyun    _LT_DECL([], [NMEDIT], [1],
989*4882a593Smuzhiyun      [Tool to change global to local symbols on Mac OS X])
990*4882a593Smuzhiyun    _LT_DECL([], [LIPO], [1],
991*4882a593Smuzhiyun      [Tool to manipulate fat objects and archives on Mac OS X])
992*4882a593Smuzhiyun    _LT_DECL([], [OTOOL], [1],
993*4882a593Smuzhiyun      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
994*4882a593Smuzhiyun    _LT_DECL([], [OTOOL64], [1],
995*4882a593Smuzhiyun      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
996*4882a593Smuzhiyun
997*4882a593Smuzhiyun    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
998*4882a593Smuzhiyun      [lt_cv_apple_cc_single_mod=no
999*4882a593Smuzhiyun      if test -z "$LT_MULTI_MODULE"; then
1000*4882a593Smuzhiyun	# By default we will add the -single_module flag. You can override
1001*4882a593Smuzhiyun	# by either setting the environment variable LT_MULTI_MODULE
1002*4882a593Smuzhiyun	# non-empty at configure time, or by adding -multi_module to the
1003*4882a593Smuzhiyun	# link flags.
1004*4882a593Smuzhiyun	rm -rf libconftest.dylib*
1005*4882a593Smuzhiyun	echo "int foo(void){return 1;}" > conftest.c
1006*4882a593Smuzhiyun	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1007*4882a593Smuzhiyun-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1008*4882a593Smuzhiyun	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1009*4882a593Smuzhiyun	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1010*4882a593Smuzhiyun        _lt_result=$?
1011*4882a593Smuzhiyun	# If there is a non-empty error log, and "single_module"
1012*4882a593Smuzhiyun	# appears in it, assume the flag caused a linker warning
1013*4882a593Smuzhiyun        if test -s conftest.err && $GREP single_module conftest.err; then
1014*4882a593Smuzhiyun	  cat conftest.err >&AS_MESSAGE_LOG_FD
1015*4882a593Smuzhiyun	# Otherwise, if the output was created with a 0 exit code from
1016*4882a593Smuzhiyun	# the compiler, it worked.
1017*4882a593Smuzhiyun	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1018*4882a593Smuzhiyun	  lt_cv_apple_cc_single_mod=yes
1019*4882a593Smuzhiyun	else
1020*4882a593Smuzhiyun	  cat conftest.err >&AS_MESSAGE_LOG_FD
1021*4882a593Smuzhiyun	fi
1022*4882a593Smuzhiyun	rm -rf libconftest.dylib*
1023*4882a593Smuzhiyun	rm -f conftest.*
1024*4882a593Smuzhiyun      fi])
1025*4882a593Smuzhiyun
1026*4882a593Smuzhiyun    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1027*4882a593Smuzhiyun      [lt_cv_ld_exported_symbols_list],
1028*4882a593Smuzhiyun      [lt_cv_ld_exported_symbols_list=no
1029*4882a593Smuzhiyun      save_LDFLAGS=$LDFLAGS
1030*4882a593Smuzhiyun      echo "_main" > conftest.sym
1031*4882a593Smuzhiyun      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1032*4882a593Smuzhiyun      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1033*4882a593Smuzhiyun	[lt_cv_ld_exported_symbols_list=yes],
1034*4882a593Smuzhiyun	[lt_cv_ld_exported_symbols_list=no])
1035*4882a593Smuzhiyun	LDFLAGS=$save_LDFLAGS
1036*4882a593Smuzhiyun    ])
1037*4882a593Smuzhiyun
1038*4882a593Smuzhiyun    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1039*4882a593Smuzhiyun      [lt_cv_ld_force_load=no
1040*4882a593Smuzhiyun      cat > conftest.c << _LT_EOF
1041*4882a593Smuzhiyunint forced_loaded() { return 2;}
1042*4882a593Smuzhiyun_LT_EOF
1043*4882a593Smuzhiyun      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1044*4882a593Smuzhiyun      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1045*4882a593Smuzhiyun      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1046*4882a593Smuzhiyun      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1047*4882a593Smuzhiyun      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1048*4882a593Smuzhiyun      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1049*4882a593Smuzhiyun      cat > conftest.c << _LT_EOF
1050*4882a593Smuzhiyunint main() { return 0;}
1051*4882a593Smuzhiyun_LT_EOF
1052*4882a593Smuzhiyun      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1053*4882a593Smuzhiyun      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1054*4882a593Smuzhiyun      _lt_result=$?
1055*4882a593Smuzhiyun      if test -s conftest.err && $GREP force_load conftest.err; then
1056*4882a593Smuzhiyun	cat conftest.err >&AS_MESSAGE_LOG_FD
1057*4882a593Smuzhiyun      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1058*4882a593Smuzhiyun	lt_cv_ld_force_load=yes
1059*4882a593Smuzhiyun      else
1060*4882a593Smuzhiyun	cat conftest.err >&AS_MESSAGE_LOG_FD
1061*4882a593Smuzhiyun      fi
1062*4882a593Smuzhiyun        rm -f conftest.err libconftest.a conftest conftest.c
1063*4882a593Smuzhiyun        rm -rf conftest.dSYM
1064*4882a593Smuzhiyun    ])
1065*4882a593Smuzhiyun    case $host_os in
1066*4882a593Smuzhiyun    rhapsody* | darwin1.[[012]])
1067*4882a593Smuzhiyun      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1068*4882a593Smuzhiyun    darwin1.*)
1069*4882a593Smuzhiyun      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1070*4882a593Smuzhiyun    darwin*) # darwin 5.x on
1071*4882a593Smuzhiyun      # if running on 10.5 or later, the deployment target defaults
1072*4882a593Smuzhiyun      # to the OS version, if on x86, and 10.4, the deployment
1073*4882a593Smuzhiyun      # target defaults to 10.4. Don't you love it?
1074*4882a593Smuzhiyun      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1075*4882a593Smuzhiyun	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1076*4882a593Smuzhiyun	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1077*4882a593Smuzhiyun	10.[[012]][[,.]]*)
1078*4882a593Smuzhiyun	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1079*4882a593Smuzhiyun	10.*)
1080*4882a593Smuzhiyun	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1081*4882a593Smuzhiyun      esac
1082*4882a593Smuzhiyun    ;;
1083*4882a593Smuzhiyun  esac
1084*4882a593Smuzhiyun    if test yes = "$lt_cv_apple_cc_single_mod"; then
1085*4882a593Smuzhiyun      _lt_dar_single_mod='$single_module'
1086*4882a593Smuzhiyun    fi
1087*4882a593Smuzhiyun    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1088*4882a593Smuzhiyun      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1089*4882a593Smuzhiyun    else
1090*4882a593Smuzhiyun      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1091*4882a593Smuzhiyun    fi
1092*4882a593Smuzhiyun    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1093*4882a593Smuzhiyun      _lt_dsymutil='~$DSYMUTIL $lib || :'
1094*4882a593Smuzhiyun    else
1095*4882a593Smuzhiyun      _lt_dsymutil=
1096*4882a593Smuzhiyun    fi
1097*4882a593Smuzhiyun    ;;
1098*4882a593Smuzhiyun  esac
1099*4882a593Smuzhiyun])
1100*4882a593Smuzhiyun
1101*4882a593Smuzhiyun
1102*4882a593Smuzhiyun# _LT_DARWIN_LINKER_FEATURES([TAG])
1103*4882a593Smuzhiyun# ---------------------------------
1104*4882a593Smuzhiyun# Checks for linker and compiler features on darwin
1105*4882a593Smuzhiyunm4_defun([_LT_DARWIN_LINKER_FEATURES],
1106*4882a593Smuzhiyun[
1107*4882a593Smuzhiyun  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1108*4882a593Smuzhiyun  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1109*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_direct, $1)=no
1110*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_automatic, $1)=yes
1111*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1112*4882a593Smuzhiyun  if test yes = "$lt_cv_ld_force_load"; then
1113*4882a593Smuzhiyun    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
1114*4882a593Smuzhiyun    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1115*4882a593Smuzhiyun                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1116*4882a593Smuzhiyun  else
1117*4882a593Smuzhiyun    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1118*4882a593Smuzhiyun  fi
1119*4882a593Smuzhiyun  _LT_TAGVAR(link_all_deplibs, $1)=yes
1120*4882a593Smuzhiyun  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1121*4882a593Smuzhiyun  case $cc_basename in
1122*4882a593Smuzhiyun     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1123*4882a593Smuzhiyun     *) _lt_dar_can_shared=$GCC ;;
1124*4882a593Smuzhiyun  esac
1125*4882a593Smuzhiyun  if test yes = "$_lt_dar_can_shared"; then
1126*4882a593Smuzhiyun    output_verbose_link_cmd=func_echo_all
1127*4882a593Smuzhiyun    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
1128*4882a593Smuzhiyun    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1129*4882a593Smuzhiyun    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
1130*4882a593Smuzhiyun    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
1131*4882a593Smuzhiyun    m4_if([$1], [CXX],
1132*4882a593Smuzhiyun[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1133*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
1134*4882a593Smuzhiyun      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
1135*4882a593Smuzhiyun    fi
1136*4882a593Smuzhiyun],[])
1137*4882a593Smuzhiyun  else
1138*4882a593Smuzhiyun  _LT_TAGVAR(ld_shlibs, $1)=no
1139*4882a593Smuzhiyun  fi
1140*4882a593Smuzhiyun])
1141*4882a593Smuzhiyun
1142*4882a593Smuzhiyun# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1143*4882a593Smuzhiyun# ----------------------------------
1144*4882a593Smuzhiyun# Links a minimal program and checks the executable
1145*4882a593Smuzhiyun# for the system default hardcoded library path. In most cases,
1146*4882a593Smuzhiyun# this is /usr/lib:/lib, but when the MPI compilers are used
1147*4882a593Smuzhiyun# the location of the communication and MPI libs are included too.
1148*4882a593Smuzhiyun# If we don't find anything, use the default library path according
1149*4882a593Smuzhiyun# to the aix ld manual.
1150*4882a593Smuzhiyun# Store the results from the different compilers for each TAGNAME.
1151*4882a593Smuzhiyun# Allow to override them for all tags through lt_cv_aix_libpath.
1152*4882a593Smuzhiyunm4_defun([_LT_SYS_MODULE_PATH_AIX],
1153*4882a593Smuzhiyun[m4_require([_LT_DECL_SED])dnl
1154*4882a593Smuzhiyunif test set = "${lt_cv_aix_libpath+set}"; then
1155*4882a593Smuzhiyun  aix_libpath=$lt_cv_aix_libpath
1156*4882a593Smuzhiyunelse
1157*4882a593Smuzhiyun  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1158*4882a593Smuzhiyun  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1159*4882a593Smuzhiyun  lt_aix_libpath_sed='[
1160*4882a593Smuzhiyun      /Import File Strings/,/^$/ {
1161*4882a593Smuzhiyun	  /^0/ {
1162*4882a593Smuzhiyun	      s/^0  *\([^ ]*\) *$/\1/
1163*4882a593Smuzhiyun	      p
1164*4882a593Smuzhiyun	  }
1165*4882a593Smuzhiyun      }]'
1166*4882a593Smuzhiyun  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1167*4882a593Smuzhiyun  # Check for a 64-bit object if we didn't find anything.
1168*4882a593Smuzhiyun  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1169*4882a593Smuzhiyun    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1170*4882a593Smuzhiyun  fi],[])
1171*4882a593Smuzhiyun  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1172*4882a593Smuzhiyun    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1173*4882a593Smuzhiyun  fi
1174*4882a593Smuzhiyun  ])
1175*4882a593Smuzhiyun  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1176*4882a593Smuzhiyunfi
1177*4882a593Smuzhiyun])# _LT_SYS_MODULE_PATH_AIX
1178*4882a593Smuzhiyun
1179*4882a593Smuzhiyun
1180*4882a593Smuzhiyun# _LT_SHELL_INIT(ARG)
1181*4882a593Smuzhiyun# -------------------
1182*4882a593Smuzhiyunm4_define([_LT_SHELL_INIT],
1183*4882a593Smuzhiyun[m4_divert_text([M4SH-INIT], [$1
1184*4882a593Smuzhiyun])])# _LT_SHELL_INIT
1185*4882a593Smuzhiyun
1186*4882a593Smuzhiyun
1187*4882a593Smuzhiyun
1188*4882a593Smuzhiyun# _LT_PROG_ECHO_BACKSLASH
1189*4882a593Smuzhiyun# -----------------------
1190*4882a593Smuzhiyun# Find how we can fake an echo command that does not interpret backslash.
1191*4882a593Smuzhiyun# In particular, with Autoconf 2.60 or later we add some code to the start
1192*4882a593Smuzhiyun# of the generated configure script that will find a shell with a builtin
1193*4882a593Smuzhiyun# printf (that we can use as an echo command).
1194*4882a593Smuzhiyunm4_defun([_LT_PROG_ECHO_BACKSLASH],
1195*4882a593Smuzhiyun[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1196*4882a593SmuzhiyunECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1197*4882a593SmuzhiyunECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1198*4882a593Smuzhiyun
1199*4882a593SmuzhiyunAC_MSG_CHECKING([how to print strings])
1200*4882a593Smuzhiyun# Test print first, because it will be a builtin if present.
1201*4882a593Smuzhiyunif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1202*4882a593Smuzhiyun   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1203*4882a593Smuzhiyun  ECHO='print -r --'
1204*4882a593Smuzhiyunelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1205*4882a593Smuzhiyun  ECHO='printf %s\n'
1206*4882a593Smuzhiyunelse
1207*4882a593Smuzhiyun  # Use this function as a fallback that always works.
1208*4882a593Smuzhiyun  func_fallback_echo ()
1209*4882a593Smuzhiyun  {
1210*4882a593Smuzhiyun    eval 'cat <<_LTECHO_EOF
1211*4882a593Smuzhiyun$[]1
1212*4882a593Smuzhiyun_LTECHO_EOF'
1213*4882a593Smuzhiyun  }
1214*4882a593Smuzhiyun  ECHO='func_fallback_echo'
1215*4882a593Smuzhiyunfi
1216*4882a593Smuzhiyun
1217*4882a593Smuzhiyun# func_echo_all arg...
1218*4882a593Smuzhiyun# Invoke $ECHO with all args, space-separated.
1219*4882a593Smuzhiyunfunc_echo_all ()
1220*4882a593Smuzhiyun{
1221*4882a593Smuzhiyun    $ECHO "$*"
1222*4882a593Smuzhiyun}
1223*4882a593Smuzhiyun
1224*4882a593Smuzhiyuncase $ECHO in
1225*4882a593Smuzhiyun  printf*) AC_MSG_RESULT([printf]) ;;
1226*4882a593Smuzhiyun  print*) AC_MSG_RESULT([print -r]) ;;
1227*4882a593Smuzhiyun  *) AC_MSG_RESULT([cat]) ;;
1228*4882a593Smuzhiyunesac
1229*4882a593Smuzhiyun
1230*4882a593Smuzhiyunm4_ifdef([_AS_DETECT_SUGGESTED],
1231*4882a593Smuzhiyun[_AS_DETECT_SUGGESTED([
1232*4882a593Smuzhiyun  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1233*4882a593Smuzhiyun    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1234*4882a593Smuzhiyun    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1235*4882a593Smuzhiyun    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1236*4882a593Smuzhiyun    PATH=/empty FPATH=/empty; export PATH FPATH
1237*4882a593Smuzhiyun    test "X`printf %s $ECHO`" = "X$ECHO" \
1238*4882a593Smuzhiyun      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1239*4882a593Smuzhiyun
1240*4882a593Smuzhiyun_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1241*4882a593Smuzhiyun_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1242*4882a593Smuzhiyun])# _LT_PROG_ECHO_BACKSLASH
1243*4882a593Smuzhiyun
1244*4882a593Smuzhiyun
1245*4882a593Smuzhiyun# _LT_WITH_SYSROOT
1246*4882a593Smuzhiyun# ----------------
1247*4882a593SmuzhiyunAC_DEFUN([_LT_WITH_SYSROOT],
1248*4882a593Smuzhiyun[AC_MSG_CHECKING([for sysroot])
1249*4882a593SmuzhiyunAC_ARG_WITH([sysroot],
1250*4882a593Smuzhiyun[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1251*4882a593Smuzhiyun  [Search for dependent libraries within DIR (or the compiler's sysroot
1252*4882a593Smuzhiyun   if not specified).])],
1253*4882a593Smuzhiyun[], [with_sysroot=no])
1254*4882a593Smuzhiyun
1255*4882a593Smuzhiyundnl lt_sysroot will always be passed unquoted.  We quote it here
1256*4882a593Smuzhiyundnl in case the user passed a directory name.
1257*4882a593Smuzhiyunlt_sysroot=
1258*4882a593Smuzhiyuncase $with_sysroot in #(
1259*4882a593Smuzhiyun yes)
1260*4882a593Smuzhiyun   if test yes = "$GCC"; then
1261*4882a593Smuzhiyun     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1262*4882a593Smuzhiyun   fi
1263*4882a593Smuzhiyun   ;; #(
1264*4882a593Smuzhiyun /*)
1265*4882a593Smuzhiyun   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1266*4882a593Smuzhiyun   ;; #(
1267*4882a593Smuzhiyun no|'')
1268*4882a593Smuzhiyun   ;; #(
1269*4882a593Smuzhiyun *)
1270*4882a593Smuzhiyun   AC_MSG_RESULT([$with_sysroot])
1271*4882a593Smuzhiyun   AC_MSG_ERROR([The sysroot must be an absolute path.])
1272*4882a593Smuzhiyun   ;;
1273*4882a593Smuzhiyunesac
1274*4882a593Smuzhiyun
1275*4882a593Smuzhiyun AC_MSG_RESULT([${lt_sysroot:-no}])
1276*4882a593Smuzhiyun_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1277*4882a593Smuzhiyun[dependent libraries, and where our libraries should be installed.])])
1278*4882a593Smuzhiyun
1279*4882a593Smuzhiyun# _LT_ENABLE_LOCK
1280*4882a593Smuzhiyun# ---------------
1281*4882a593Smuzhiyunm4_defun([_LT_ENABLE_LOCK],
1282*4882a593Smuzhiyun[AC_ARG_ENABLE([libtool-lock],
1283*4882a593Smuzhiyun  [AS_HELP_STRING([--disable-libtool-lock],
1284*4882a593Smuzhiyun    [avoid locking (might break parallel builds)])])
1285*4882a593Smuzhiyuntest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1286*4882a593Smuzhiyun
1287*4882a593Smuzhiyun# Some flags need to be propagated to the compiler or linker for good
1288*4882a593Smuzhiyun# libtool support.
1289*4882a593Smuzhiyuncase $host in
1290*4882a593Smuzhiyunia64-*-hpux*)
1291*4882a593Smuzhiyun  # Find out what ABI is being produced by ac_compile, and set mode
1292*4882a593Smuzhiyun  # options accordingly.
1293*4882a593Smuzhiyun  echo 'int i;' > conftest.$ac_ext
1294*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_compile); then
1295*4882a593Smuzhiyun    case `/usr/bin/file conftest.$ac_objext` in
1296*4882a593Smuzhiyun      *ELF-32*)
1297*4882a593Smuzhiyun	HPUX_IA64_MODE=32
1298*4882a593Smuzhiyun	;;
1299*4882a593Smuzhiyun      *ELF-64*)
1300*4882a593Smuzhiyun	HPUX_IA64_MODE=64
1301*4882a593Smuzhiyun	;;
1302*4882a593Smuzhiyun    esac
1303*4882a593Smuzhiyun  fi
1304*4882a593Smuzhiyun  rm -rf conftest*
1305*4882a593Smuzhiyun  ;;
1306*4882a593Smuzhiyun*-*-irix6*)
1307*4882a593Smuzhiyun  # Find out what ABI is being produced by ac_compile, and set linker
1308*4882a593Smuzhiyun  # options accordingly.
1309*4882a593Smuzhiyun  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1310*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_compile); then
1311*4882a593Smuzhiyun    if test yes = "$lt_cv_prog_gnu_ld"; then
1312*4882a593Smuzhiyun      case `/usr/bin/file conftest.$ac_objext` in
1313*4882a593Smuzhiyun	*32-bit*)
1314*4882a593Smuzhiyun	  LD="${LD-ld} -melf32bsmip"
1315*4882a593Smuzhiyun	  ;;
1316*4882a593Smuzhiyun	*N32*)
1317*4882a593Smuzhiyun	  LD="${LD-ld} -melf32bmipn32"
1318*4882a593Smuzhiyun	  ;;
1319*4882a593Smuzhiyun	*64-bit*)
1320*4882a593Smuzhiyun	  LD="${LD-ld} -melf64bmip"
1321*4882a593Smuzhiyun	;;
1322*4882a593Smuzhiyun      esac
1323*4882a593Smuzhiyun    else
1324*4882a593Smuzhiyun      case `/usr/bin/file conftest.$ac_objext` in
1325*4882a593Smuzhiyun	*32-bit*)
1326*4882a593Smuzhiyun	  LD="${LD-ld} -32"
1327*4882a593Smuzhiyun	  ;;
1328*4882a593Smuzhiyun	*N32*)
1329*4882a593Smuzhiyun	  LD="${LD-ld} -n32"
1330*4882a593Smuzhiyun	  ;;
1331*4882a593Smuzhiyun	*64-bit*)
1332*4882a593Smuzhiyun	  LD="${LD-ld} -64"
1333*4882a593Smuzhiyun	  ;;
1334*4882a593Smuzhiyun      esac
1335*4882a593Smuzhiyun    fi
1336*4882a593Smuzhiyun  fi
1337*4882a593Smuzhiyun  rm -rf conftest*
1338*4882a593Smuzhiyun  ;;
1339*4882a593Smuzhiyun
1340*4882a593Smuzhiyunmips64*-*linux*)
1341*4882a593Smuzhiyun  # Find out what ABI is being produced by ac_compile, and set linker
1342*4882a593Smuzhiyun  # options accordingly.
1343*4882a593Smuzhiyun  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1344*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_compile); then
1345*4882a593Smuzhiyun    emul=elf
1346*4882a593Smuzhiyun    case `/usr/bin/file conftest.$ac_objext` in
1347*4882a593Smuzhiyun      *32-bit*)
1348*4882a593Smuzhiyun	emul="${emul}32"
1349*4882a593Smuzhiyun	;;
1350*4882a593Smuzhiyun      *64-bit*)
1351*4882a593Smuzhiyun	emul="${emul}64"
1352*4882a593Smuzhiyun	;;
1353*4882a593Smuzhiyun    esac
1354*4882a593Smuzhiyun    case `/usr/bin/file conftest.$ac_objext` in
1355*4882a593Smuzhiyun      *MSB*)
1356*4882a593Smuzhiyun	emul="${emul}btsmip"
1357*4882a593Smuzhiyun	;;
1358*4882a593Smuzhiyun      *LSB*)
1359*4882a593Smuzhiyun	emul="${emul}ltsmip"
1360*4882a593Smuzhiyun	;;
1361*4882a593Smuzhiyun    esac
1362*4882a593Smuzhiyun    case `/usr/bin/file conftest.$ac_objext` in
1363*4882a593Smuzhiyun      *N32*)
1364*4882a593Smuzhiyun	emul="${emul}n32"
1365*4882a593Smuzhiyun	;;
1366*4882a593Smuzhiyun    esac
1367*4882a593Smuzhiyun    LD="${LD-ld} -m $emul"
1368*4882a593Smuzhiyun  fi
1369*4882a593Smuzhiyun  rm -rf conftest*
1370*4882a593Smuzhiyun  ;;
1371*4882a593Smuzhiyun
1372*4882a593Smuzhiyunx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1373*4882a593Smuzhiyuns390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1374*4882a593Smuzhiyun  # Find out what ABI is being produced by ac_compile, and set linker
1375*4882a593Smuzhiyun  # options accordingly.  Note that the listed cases only cover the
1376*4882a593Smuzhiyun  # situations where additional linker options are needed (such as when
1377*4882a593Smuzhiyun  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1378*4882a593Smuzhiyun  # vice versa); the common cases where no linker options are needed do
1379*4882a593Smuzhiyun  # not appear in the list.
1380*4882a593Smuzhiyun  echo 'int i;' > conftest.$ac_ext
1381*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_compile); then
1382*4882a593Smuzhiyun    case `/usr/bin/file conftest.o` in
1383*4882a593Smuzhiyun      *32-bit*)
1384*4882a593Smuzhiyun	case $host in
1385*4882a593Smuzhiyun	  x86_64-*kfreebsd*-gnu)
1386*4882a593Smuzhiyun	    LD="${LD-ld} -m elf_i386_fbsd"
1387*4882a593Smuzhiyun	    ;;
1388*4882a593Smuzhiyun	  x86_64-*linux*)
1389*4882a593Smuzhiyun	    case `/usr/bin/file conftest.o` in
1390*4882a593Smuzhiyun	      *x86-64*)
1391*4882a593Smuzhiyun		LD="${LD-ld} -m elf32_x86_64"
1392*4882a593Smuzhiyun		;;
1393*4882a593Smuzhiyun	      *)
1394*4882a593Smuzhiyun		LD="${LD-ld} -m elf_i386"
1395*4882a593Smuzhiyun		;;
1396*4882a593Smuzhiyun	    esac
1397*4882a593Smuzhiyun	    ;;
1398*4882a593Smuzhiyun	  powerpc64le-*linux*)
1399*4882a593Smuzhiyun	    LD="${LD-ld} -m elf32lppclinux"
1400*4882a593Smuzhiyun	    ;;
1401*4882a593Smuzhiyun	  powerpc64-*linux*)
1402*4882a593Smuzhiyun	    LD="${LD-ld} -m elf32ppclinux"
1403*4882a593Smuzhiyun	    ;;
1404*4882a593Smuzhiyun	  s390x-*linux*)
1405*4882a593Smuzhiyun	    LD="${LD-ld} -m elf_s390"
1406*4882a593Smuzhiyun	    ;;
1407*4882a593Smuzhiyun	  sparc64-*linux*)
1408*4882a593Smuzhiyun	    LD="${LD-ld} -m elf32_sparc"
1409*4882a593Smuzhiyun	    ;;
1410*4882a593Smuzhiyun	esac
1411*4882a593Smuzhiyun	;;
1412*4882a593Smuzhiyun      *64-bit*)
1413*4882a593Smuzhiyun	case $host in
1414*4882a593Smuzhiyun	  x86_64-*kfreebsd*-gnu)
1415*4882a593Smuzhiyun	    LD="${LD-ld} -m elf_x86_64_fbsd"
1416*4882a593Smuzhiyun	    ;;
1417*4882a593Smuzhiyun	  x86_64-*linux*)
1418*4882a593Smuzhiyun	    LD="${LD-ld} -m elf_x86_64"
1419*4882a593Smuzhiyun	    ;;
1420*4882a593Smuzhiyun	  powerpcle-*linux*|powerpc64le-*linux*)
1421*4882a593Smuzhiyun	    LD="${LD-ld} -m elf64lppc"
1422*4882a593Smuzhiyun	    ;;
1423*4882a593Smuzhiyun	  powerpc-*linux*|powerpc64-*linux*)
1424*4882a593Smuzhiyun	    LD="${LD-ld} -m elf64ppc"
1425*4882a593Smuzhiyun	    ;;
1426*4882a593Smuzhiyun	  s390*-*linux*|s390*-*tpf*)
1427*4882a593Smuzhiyun	    LD="${LD-ld} -m elf64_s390"
1428*4882a593Smuzhiyun	    ;;
1429*4882a593Smuzhiyun	  sparc*-*linux*)
1430*4882a593Smuzhiyun	    LD="${LD-ld} -m elf64_sparc"
1431*4882a593Smuzhiyun	    ;;
1432*4882a593Smuzhiyun	esac
1433*4882a593Smuzhiyun	;;
1434*4882a593Smuzhiyun    esac
1435*4882a593Smuzhiyun  fi
1436*4882a593Smuzhiyun  rm -rf conftest*
1437*4882a593Smuzhiyun  ;;
1438*4882a593Smuzhiyun
1439*4882a593Smuzhiyun*-*-sco3.2v5*)
1440*4882a593Smuzhiyun  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1441*4882a593Smuzhiyun  SAVE_CFLAGS=$CFLAGS
1442*4882a593Smuzhiyun  CFLAGS="$CFLAGS -belf"
1443*4882a593Smuzhiyun  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1444*4882a593Smuzhiyun    [AC_LANG_PUSH(C)
1445*4882a593Smuzhiyun     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1446*4882a593Smuzhiyun     AC_LANG_POP])
1447*4882a593Smuzhiyun  if test yes != "$lt_cv_cc_needs_belf"; then
1448*4882a593Smuzhiyun    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1449*4882a593Smuzhiyun    CFLAGS=$SAVE_CFLAGS
1450*4882a593Smuzhiyun  fi
1451*4882a593Smuzhiyun  ;;
1452*4882a593Smuzhiyun*-*solaris*)
1453*4882a593Smuzhiyun  # Find out what ABI is being produced by ac_compile, and set linker
1454*4882a593Smuzhiyun  # options accordingly.
1455*4882a593Smuzhiyun  echo 'int i;' > conftest.$ac_ext
1456*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_compile); then
1457*4882a593Smuzhiyun    case `/usr/bin/file conftest.o` in
1458*4882a593Smuzhiyun    *64-bit*)
1459*4882a593Smuzhiyun      case $lt_cv_prog_gnu_ld in
1460*4882a593Smuzhiyun      yes*)
1461*4882a593Smuzhiyun        case $host in
1462*4882a593Smuzhiyun        i?86-*-solaris*|x86_64-*-solaris*)
1463*4882a593Smuzhiyun          LD="${LD-ld} -m elf_x86_64"
1464*4882a593Smuzhiyun          ;;
1465*4882a593Smuzhiyun        sparc*-*-solaris*)
1466*4882a593Smuzhiyun          LD="${LD-ld} -m elf64_sparc"
1467*4882a593Smuzhiyun          ;;
1468*4882a593Smuzhiyun        esac
1469*4882a593Smuzhiyun        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1470*4882a593Smuzhiyun        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1471*4882a593Smuzhiyun          LD=${LD-ld}_sol2
1472*4882a593Smuzhiyun        fi
1473*4882a593Smuzhiyun        ;;
1474*4882a593Smuzhiyun      *)
1475*4882a593Smuzhiyun	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1476*4882a593Smuzhiyun	  LD="${LD-ld} -64"
1477*4882a593Smuzhiyun	fi
1478*4882a593Smuzhiyun	;;
1479*4882a593Smuzhiyun      esac
1480*4882a593Smuzhiyun      ;;
1481*4882a593Smuzhiyun    esac
1482*4882a593Smuzhiyun  fi
1483*4882a593Smuzhiyun  rm -rf conftest*
1484*4882a593Smuzhiyun  ;;
1485*4882a593Smuzhiyunesac
1486*4882a593Smuzhiyun
1487*4882a593Smuzhiyunneed_locks=$enable_libtool_lock
1488*4882a593Smuzhiyun])# _LT_ENABLE_LOCK
1489*4882a593Smuzhiyun
1490*4882a593Smuzhiyun
1491*4882a593Smuzhiyun# _LT_PROG_AR
1492*4882a593Smuzhiyun# -----------
1493*4882a593Smuzhiyunm4_defun([_LT_PROG_AR],
1494*4882a593Smuzhiyun[AC_CHECK_TOOLS(AR, [ar], false)
1495*4882a593Smuzhiyun: ${AR=ar}
1496*4882a593Smuzhiyun: ${AR_FLAGS=cru}
1497*4882a593Smuzhiyun_LT_DECL([], [AR], [1], [The archiver])
1498*4882a593Smuzhiyun_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1499*4882a593Smuzhiyun
1500*4882a593SmuzhiyunAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1501*4882a593Smuzhiyun  [lt_cv_ar_at_file=no
1502*4882a593Smuzhiyun   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1503*4882a593Smuzhiyun     [echo conftest.$ac_objext > conftest.lst
1504*4882a593Smuzhiyun      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1505*4882a593Smuzhiyun      AC_TRY_EVAL([lt_ar_try])
1506*4882a593Smuzhiyun      if test 0 -eq "$ac_status"; then
1507*4882a593Smuzhiyun	# Ensure the archiver fails upon bogus file names.
1508*4882a593Smuzhiyun	rm -f conftest.$ac_objext libconftest.a
1509*4882a593Smuzhiyun	AC_TRY_EVAL([lt_ar_try])
1510*4882a593Smuzhiyun	if test 0 -ne "$ac_status"; then
1511*4882a593Smuzhiyun          lt_cv_ar_at_file=@
1512*4882a593Smuzhiyun        fi
1513*4882a593Smuzhiyun      fi
1514*4882a593Smuzhiyun      rm -f conftest.* libconftest.a
1515*4882a593Smuzhiyun     ])
1516*4882a593Smuzhiyun  ])
1517*4882a593Smuzhiyun
1518*4882a593Smuzhiyunif test no = "$lt_cv_ar_at_file"; then
1519*4882a593Smuzhiyun  archiver_list_spec=
1520*4882a593Smuzhiyunelse
1521*4882a593Smuzhiyun  archiver_list_spec=$lt_cv_ar_at_file
1522*4882a593Smuzhiyunfi
1523*4882a593Smuzhiyun_LT_DECL([], [archiver_list_spec], [1],
1524*4882a593Smuzhiyun  [How to feed a file listing to the archiver])
1525*4882a593Smuzhiyun])# _LT_PROG_AR
1526*4882a593Smuzhiyun
1527*4882a593Smuzhiyun
1528*4882a593Smuzhiyun# _LT_CMD_OLD_ARCHIVE
1529*4882a593Smuzhiyun# -------------------
1530*4882a593Smuzhiyunm4_defun([_LT_CMD_OLD_ARCHIVE],
1531*4882a593Smuzhiyun[_LT_PROG_AR
1532*4882a593Smuzhiyun
1533*4882a593SmuzhiyunAC_CHECK_TOOL(STRIP, strip, :)
1534*4882a593Smuzhiyuntest -z "$STRIP" && STRIP=:
1535*4882a593Smuzhiyun_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1536*4882a593Smuzhiyun
1537*4882a593SmuzhiyunAC_CHECK_TOOL(RANLIB, ranlib, :)
1538*4882a593Smuzhiyuntest -z "$RANLIB" && RANLIB=:
1539*4882a593Smuzhiyun_LT_DECL([], [RANLIB], [1],
1540*4882a593Smuzhiyun    [Commands used to install an old-style archive])
1541*4882a593Smuzhiyun
1542*4882a593Smuzhiyun# Determine commands to create old-style static archives.
1543*4882a593Smuzhiyunold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1544*4882a593Smuzhiyunold_postinstall_cmds='chmod 644 $oldlib'
1545*4882a593Smuzhiyunold_postuninstall_cmds=
1546*4882a593Smuzhiyun
1547*4882a593Smuzhiyunif test -n "$RANLIB"; then
1548*4882a593Smuzhiyun  case $host_os in
1549*4882a593Smuzhiyun  bitrig* | openbsd*)
1550*4882a593Smuzhiyun    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1551*4882a593Smuzhiyun    ;;
1552*4882a593Smuzhiyun  *)
1553*4882a593Smuzhiyun    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1554*4882a593Smuzhiyun    ;;
1555*4882a593Smuzhiyun  esac
1556*4882a593Smuzhiyun  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1557*4882a593Smuzhiyunfi
1558*4882a593Smuzhiyun
1559*4882a593Smuzhiyuncase $host_os in
1560*4882a593Smuzhiyun  darwin*)
1561*4882a593Smuzhiyun    lock_old_archive_extraction=yes ;;
1562*4882a593Smuzhiyun  *)
1563*4882a593Smuzhiyun    lock_old_archive_extraction=no ;;
1564*4882a593Smuzhiyunesac
1565*4882a593Smuzhiyun_LT_DECL([], [old_postinstall_cmds], [2])
1566*4882a593Smuzhiyun_LT_DECL([], [old_postuninstall_cmds], [2])
1567*4882a593Smuzhiyun_LT_TAGDECL([], [old_archive_cmds], [2],
1568*4882a593Smuzhiyun    [Commands used to build an old-style archive])
1569*4882a593Smuzhiyun_LT_DECL([], [lock_old_archive_extraction], [0],
1570*4882a593Smuzhiyun    [Whether to use a lock for old archive extraction])
1571*4882a593Smuzhiyun])# _LT_CMD_OLD_ARCHIVE
1572*4882a593Smuzhiyun
1573*4882a593Smuzhiyun
1574*4882a593Smuzhiyun# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1575*4882a593Smuzhiyun#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1576*4882a593Smuzhiyun# ----------------------------------------------------------------
1577*4882a593Smuzhiyun# Check whether the given compiler option works
1578*4882a593SmuzhiyunAC_DEFUN([_LT_COMPILER_OPTION],
1579*4882a593Smuzhiyun[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1580*4882a593Smuzhiyunm4_require([_LT_DECL_SED])dnl
1581*4882a593SmuzhiyunAC_CACHE_CHECK([$1], [$2],
1582*4882a593Smuzhiyun  [$2=no
1583*4882a593Smuzhiyun   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1584*4882a593Smuzhiyun   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1585*4882a593Smuzhiyun   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1586*4882a593Smuzhiyun   # Insert the option either (1) after the last *FLAGS variable, or
1587*4882a593Smuzhiyun   # (2) before a word containing "conftest.", or (3) at the end.
1588*4882a593Smuzhiyun   # Note that $ac_compile itself does not contain backslashes and begins
1589*4882a593Smuzhiyun   # with a dollar sign (not a hyphen), so the echo should work correctly.
1590*4882a593Smuzhiyun   # The option is referenced via a variable to avoid confusing sed.
1591*4882a593Smuzhiyun   lt_compile=`echo "$ac_compile" | $SED \
1592*4882a593Smuzhiyun   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1593*4882a593Smuzhiyun   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1594*4882a593Smuzhiyun   -e 's:$: $lt_compiler_flag:'`
1595*4882a593Smuzhiyun   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1596*4882a593Smuzhiyun   (eval "$lt_compile" 2>conftest.err)
1597*4882a593Smuzhiyun   ac_status=$?
1598*4882a593Smuzhiyun   cat conftest.err >&AS_MESSAGE_LOG_FD
1599*4882a593Smuzhiyun   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1600*4882a593Smuzhiyun   if (exit $ac_status) && test -s "$ac_outfile"; then
1601*4882a593Smuzhiyun     # The compiler can only warn and ignore the option if not recognized
1602*4882a593Smuzhiyun     # So say no if there are warnings other than the usual output.
1603*4882a593Smuzhiyun     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1604*4882a593Smuzhiyun     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1605*4882a593Smuzhiyun     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1606*4882a593Smuzhiyun       $2=yes
1607*4882a593Smuzhiyun     fi
1608*4882a593Smuzhiyun   fi
1609*4882a593Smuzhiyun   $RM conftest*
1610*4882a593Smuzhiyun])
1611*4882a593Smuzhiyun
1612*4882a593Smuzhiyunif test yes = "[$]$2"; then
1613*4882a593Smuzhiyun    m4_if([$5], , :, [$5])
1614*4882a593Smuzhiyunelse
1615*4882a593Smuzhiyun    m4_if([$6], , :, [$6])
1616*4882a593Smuzhiyunfi
1617*4882a593Smuzhiyun])# _LT_COMPILER_OPTION
1618*4882a593Smuzhiyun
1619*4882a593Smuzhiyun# Old name:
1620*4882a593SmuzhiyunAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1621*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
1622*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1623*4882a593Smuzhiyun
1624*4882a593Smuzhiyun
1625*4882a593Smuzhiyun# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1626*4882a593Smuzhiyun#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1627*4882a593Smuzhiyun# ----------------------------------------------------
1628*4882a593Smuzhiyun# Check whether the given linker option works
1629*4882a593SmuzhiyunAC_DEFUN([_LT_LINKER_OPTION],
1630*4882a593Smuzhiyun[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1631*4882a593Smuzhiyunm4_require([_LT_DECL_SED])dnl
1632*4882a593SmuzhiyunAC_CACHE_CHECK([$1], [$2],
1633*4882a593Smuzhiyun  [$2=no
1634*4882a593Smuzhiyun   save_LDFLAGS=$LDFLAGS
1635*4882a593Smuzhiyun   LDFLAGS="$LDFLAGS $3"
1636*4882a593Smuzhiyun   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1637*4882a593Smuzhiyun   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1638*4882a593Smuzhiyun     # The linker can only warn and ignore the option if not recognized
1639*4882a593Smuzhiyun     # So say no if there are warnings
1640*4882a593Smuzhiyun     if test -s conftest.err; then
1641*4882a593Smuzhiyun       # Append any errors to the config.log.
1642*4882a593Smuzhiyun       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1643*4882a593Smuzhiyun       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1644*4882a593Smuzhiyun       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1645*4882a593Smuzhiyun       if diff conftest.exp conftest.er2 >/dev/null; then
1646*4882a593Smuzhiyun         $2=yes
1647*4882a593Smuzhiyun       fi
1648*4882a593Smuzhiyun     else
1649*4882a593Smuzhiyun       $2=yes
1650*4882a593Smuzhiyun     fi
1651*4882a593Smuzhiyun   fi
1652*4882a593Smuzhiyun   $RM -r conftest*
1653*4882a593Smuzhiyun   LDFLAGS=$save_LDFLAGS
1654*4882a593Smuzhiyun])
1655*4882a593Smuzhiyun
1656*4882a593Smuzhiyunif test yes = "[$]$2"; then
1657*4882a593Smuzhiyun    m4_if([$4], , :, [$4])
1658*4882a593Smuzhiyunelse
1659*4882a593Smuzhiyun    m4_if([$5], , :, [$5])
1660*4882a593Smuzhiyunfi
1661*4882a593Smuzhiyun])# _LT_LINKER_OPTION
1662*4882a593Smuzhiyun
1663*4882a593Smuzhiyun# Old name:
1664*4882a593SmuzhiyunAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1665*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
1666*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1667*4882a593Smuzhiyun
1668*4882a593Smuzhiyun
1669*4882a593Smuzhiyun# LT_CMD_MAX_LEN
1670*4882a593Smuzhiyun#---------------
1671*4882a593SmuzhiyunAC_DEFUN([LT_CMD_MAX_LEN],
1672*4882a593Smuzhiyun[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1673*4882a593Smuzhiyun# find the maximum length of command line arguments
1674*4882a593SmuzhiyunAC_MSG_CHECKING([the maximum length of command line arguments])
1675*4882a593SmuzhiyunAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1676*4882a593Smuzhiyun  i=0
1677*4882a593Smuzhiyun  teststring=ABCD
1678*4882a593Smuzhiyun
1679*4882a593Smuzhiyun  case $build_os in
1680*4882a593Smuzhiyun  msdosdjgpp*)
1681*4882a593Smuzhiyun    # On DJGPP, this test can blow up pretty badly due to problems in libc
1682*4882a593Smuzhiyun    # (any single argument exceeding 2000 bytes causes a buffer overrun
1683*4882a593Smuzhiyun    # during glob expansion).  Even if it were fixed, the result of this
1684*4882a593Smuzhiyun    # check would be larger than it should be.
1685*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1686*4882a593Smuzhiyun    ;;
1687*4882a593Smuzhiyun
1688*4882a593Smuzhiyun  gnu*)
1689*4882a593Smuzhiyun    # Under GNU Hurd, this test is not required because there is
1690*4882a593Smuzhiyun    # no limit to the length of command line arguments.
1691*4882a593Smuzhiyun    # Libtool will interpret -1 as no limit whatsoever
1692*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=-1;
1693*4882a593Smuzhiyun    ;;
1694*4882a593Smuzhiyun
1695*4882a593Smuzhiyun  cygwin* | mingw* | cegcc*)
1696*4882a593Smuzhiyun    # On Win9x/ME, this test blows up -- it succeeds, but takes
1697*4882a593Smuzhiyun    # about 5 minutes as the teststring grows exponentially.
1698*4882a593Smuzhiyun    # Worse, since 9x/ME are not pre-emptively multitasking,
1699*4882a593Smuzhiyun    # you end up with a "frozen" computer, even though with patience
1700*4882a593Smuzhiyun    # the test eventually succeeds (with a max line length of 256k).
1701*4882a593Smuzhiyun    # Instead, let's just punt: use the minimum linelength reported by
1702*4882a593Smuzhiyun    # all of the supported platforms: 8192 (on NT/2K/XP).
1703*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=8192;
1704*4882a593Smuzhiyun    ;;
1705*4882a593Smuzhiyun
1706*4882a593Smuzhiyun  mint*)
1707*4882a593Smuzhiyun    # On MiNT this can take a long time and run out of memory.
1708*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=8192;
1709*4882a593Smuzhiyun    ;;
1710*4882a593Smuzhiyun
1711*4882a593Smuzhiyun  mint*)
1712*4882a593Smuzhiyun    # On MiNT this can take a long time and run out of memory.
1713*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=8192;
1714*4882a593Smuzhiyun    ;;
1715*4882a593Smuzhiyun
1716*4882a593Smuzhiyun  amigaos*)
1717*4882a593Smuzhiyun    # On AmigaOS with pdksh, this test takes hours, literally.
1718*4882a593Smuzhiyun    # So we just punt and use a minimum line length of 8192.
1719*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=8192;
1720*4882a593Smuzhiyun    ;;
1721*4882a593Smuzhiyun
1722*4882a593Smuzhiyun  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1723*4882a593Smuzhiyun    # This has been around since 386BSD, at least.  Likely further.
1724*4882a593Smuzhiyun    if test -x /sbin/sysctl; then
1725*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1726*4882a593Smuzhiyun    elif test -x /usr/sbin/sysctl; then
1727*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1728*4882a593Smuzhiyun    else
1729*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1730*4882a593Smuzhiyun    fi
1731*4882a593Smuzhiyun    # And add a safety zone
1732*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1733*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1734*4882a593Smuzhiyun    ;;
1735*4882a593Smuzhiyun
1736*4882a593Smuzhiyun  interix*)
1737*4882a593Smuzhiyun    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1738*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=196608
1739*4882a593Smuzhiyun    ;;
1740*4882a593Smuzhiyun
1741*4882a593Smuzhiyun  os2*)
1742*4882a593Smuzhiyun    # The test takes a long time on OS/2.
1743*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=8192
1744*4882a593Smuzhiyun    ;;
1745*4882a593Smuzhiyun
1746*4882a593Smuzhiyun  osf*)
1747*4882a593Smuzhiyun    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1748*4882a593Smuzhiyun    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1749*4882a593Smuzhiyun    # nice to cause kernel panics so lets avoid the loop below.
1750*4882a593Smuzhiyun    # First set a reasonable default.
1751*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=16384
1752*4882a593Smuzhiyun    #
1753*4882a593Smuzhiyun    if test -x /sbin/sysconfig; then
1754*4882a593Smuzhiyun      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1755*4882a593Smuzhiyun        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1756*4882a593Smuzhiyun      esac
1757*4882a593Smuzhiyun    fi
1758*4882a593Smuzhiyun    ;;
1759*4882a593Smuzhiyun  sco3.2v5*)
1760*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=102400
1761*4882a593Smuzhiyun    ;;
1762*4882a593Smuzhiyun  sysv5* | sco5v6* | sysv4.2uw2*)
1763*4882a593Smuzhiyun    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1764*4882a593Smuzhiyun    if test -n "$kargmax"; then
1765*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1766*4882a593Smuzhiyun    else
1767*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=32768
1768*4882a593Smuzhiyun    fi
1769*4882a593Smuzhiyun    ;;
1770*4882a593Smuzhiyun  *)
1771*4882a593Smuzhiyun    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1772*4882a593Smuzhiyun    if test -n "$lt_cv_sys_max_cmd_len" && \
1773*4882a593Smuzhiyun       test undefined != "$lt_cv_sys_max_cmd_len"; then
1774*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1775*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1776*4882a593Smuzhiyun    else
1777*4882a593Smuzhiyun      # Make teststring a little bigger before we do anything with it.
1778*4882a593Smuzhiyun      # a 1K string should be a reasonable start.
1779*4882a593Smuzhiyun      for i in 1 2 3 4 5 6 7 8; do
1780*4882a593Smuzhiyun        teststring=$teststring$teststring
1781*4882a593Smuzhiyun      done
1782*4882a593Smuzhiyun      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1783*4882a593Smuzhiyun      # If test is not a shell built-in, we'll probably end up computing a
1784*4882a593Smuzhiyun      # maximum length that is only half of the actual maximum length, but
1785*4882a593Smuzhiyun      # we can't tell.
1786*4882a593Smuzhiyun      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1787*4882a593Smuzhiyun	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1788*4882a593Smuzhiyun	      test 17 != "$i" # 1/2 MB should be enough
1789*4882a593Smuzhiyun      do
1790*4882a593Smuzhiyun        i=`expr $i + 1`
1791*4882a593Smuzhiyun        teststring=$teststring$teststring
1792*4882a593Smuzhiyun      done
1793*4882a593Smuzhiyun      # Only check the string length outside the loop.
1794*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1795*4882a593Smuzhiyun      teststring=
1796*4882a593Smuzhiyun      # Add a significant safety factor because C++ compilers can tack on
1797*4882a593Smuzhiyun      # massive amounts of additional arguments before passing them to the
1798*4882a593Smuzhiyun      # linker.  It appears as though 1/2 is a usable value.
1799*4882a593Smuzhiyun      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1800*4882a593Smuzhiyun    fi
1801*4882a593Smuzhiyun    ;;
1802*4882a593Smuzhiyun  esac
1803*4882a593Smuzhiyun])
1804*4882a593Smuzhiyunif test -n "$lt_cv_sys_max_cmd_len"; then
1805*4882a593Smuzhiyun  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1806*4882a593Smuzhiyunelse
1807*4882a593Smuzhiyun  AC_MSG_RESULT(none)
1808*4882a593Smuzhiyunfi
1809*4882a593Smuzhiyunmax_cmd_len=$lt_cv_sys_max_cmd_len
1810*4882a593Smuzhiyun_LT_DECL([], [max_cmd_len], [0],
1811*4882a593Smuzhiyun    [What is the maximum length of a command?])
1812*4882a593Smuzhiyun])# LT_CMD_MAX_LEN
1813*4882a593Smuzhiyun
1814*4882a593Smuzhiyun# Old name:
1815*4882a593SmuzhiyunAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1816*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
1817*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1818*4882a593Smuzhiyun
1819*4882a593Smuzhiyun
1820*4882a593Smuzhiyun# _LT_HEADER_DLFCN
1821*4882a593Smuzhiyun# ----------------
1822*4882a593Smuzhiyunm4_defun([_LT_HEADER_DLFCN],
1823*4882a593Smuzhiyun[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1824*4882a593Smuzhiyun])# _LT_HEADER_DLFCN
1825*4882a593Smuzhiyun
1826*4882a593Smuzhiyun
1827*4882a593Smuzhiyun# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1828*4882a593Smuzhiyun#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1829*4882a593Smuzhiyun# ----------------------------------------------------------------
1830*4882a593Smuzhiyunm4_defun([_LT_TRY_DLOPEN_SELF],
1831*4882a593Smuzhiyun[m4_require([_LT_HEADER_DLFCN])dnl
1832*4882a593Smuzhiyunif test yes = "$cross_compiling"; then :
1833*4882a593Smuzhiyun  [$4]
1834*4882a593Smuzhiyunelse
1835*4882a593Smuzhiyun  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1836*4882a593Smuzhiyun  lt_status=$lt_dlunknown
1837*4882a593Smuzhiyun  cat > conftest.$ac_ext <<_LT_EOF
1838*4882a593Smuzhiyun[#line $LINENO "configure"
1839*4882a593Smuzhiyun#include "confdefs.h"
1840*4882a593Smuzhiyun
1841*4882a593Smuzhiyun#if HAVE_DLFCN_H
1842*4882a593Smuzhiyun#include <dlfcn.h>
1843*4882a593Smuzhiyun#endif
1844*4882a593Smuzhiyun
1845*4882a593Smuzhiyun#include <stdio.h>
1846*4882a593Smuzhiyun
1847*4882a593Smuzhiyun#ifdef RTLD_GLOBAL
1848*4882a593Smuzhiyun#  define LT_DLGLOBAL		RTLD_GLOBAL
1849*4882a593Smuzhiyun#else
1850*4882a593Smuzhiyun#  ifdef DL_GLOBAL
1851*4882a593Smuzhiyun#    define LT_DLGLOBAL		DL_GLOBAL
1852*4882a593Smuzhiyun#  else
1853*4882a593Smuzhiyun#    define LT_DLGLOBAL		0
1854*4882a593Smuzhiyun#  endif
1855*4882a593Smuzhiyun#endif
1856*4882a593Smuzhiyun
1857*4882a593Smuzhiyun/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1858*4882a593Smuzhiyun   find out it does not work in some platform. */
1859*4882a593Smuzhiyun#ifndef LT_DLLAZY_OR_NOW
1860*4882a593Smuzhiyun#  ifdef RTLD_LAZY
1861*4882a593Smuzhiyun#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1862*4882a593Smuzhiyun#  else
1863*4882a593Smuzhiyun#    ifdef DL_LAZY
1864*4882a593Smuzhiyun#      define LT_DLLAZY_OR_NOW		DL_LAZY
1865*4882a593Smuzhiyun#    else
1866*4882a593Smuzhiyun#      ifdef RTLD_NOW
1867*4882a593Smuzhiyun#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1868*4882a593Smuzhiyun#      else
1869*4882a593Smuzhiyun#        ifdef DL_NOW
1870*4882a593Smuzhiyun#          define LT_DLLAZY_OR_NOW	DL_NOW
1871*4882a593Smuzhiyun#        else
1872*4882a593Smuzhiyun#          define LT_DLLAZY_OR_NOW	0
1873*4882a593Smuzhiyun#        endif
1874*4882a593Smuzhiyun#      endif
1875*4882a593Smuzhiyun#    endif
1876*4882a593Smuzhiyun#  endif
1877*4882a593Smuzhiyun#endif
1878*4882a593Smuzhiyun
1879*4882a593Smuzhiyun/* When -fvisibility=hidden is used, assume the code has been annotated
1880*4882a593Smuzhiyun   correspondingly for the symbols needed.  */
1881*4882a593Smuzhiyun#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1882*4882a593Smuzhiyunint fnord () __attribute__((visibility("default")));
1883*4882a593Smuzhiyun#endif
1884*4882a593Smuzhiyun
1885*4882a593Smuzhiyunint fnord () { return 42; }
1886*4882a593Smuzhiyunint main ()
1887*4882a593Smuzhiyun{
1888*4882a593Smuzhiyun  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1889*4882a593Smuzhiyun  int status = $lt_dlunknown;
1890*4882a593Smuzhiyun
1891*4882a593Smuzhiyun  if (self)
1892*4882a593Smuzhiyun    {
1893*4882a593Smuzhiyun      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1894*4882a593Smuzhiyun      else
1895*4882a593Smuzhiyun        {
1896*4882a593Smuzhiyun	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1897*4882a593Smuzhiyun          else puts (dlerror ());
1898*4882a593Smuzhiyun	}
1899*4882a593Smuzhiyun      /* dlclose (self); */
1900*4882a593Smuzhiyun    }
1901*4882a593Smuzhiyun  else
1902*4882a593Smuzhiyun    puts (dlerror ());
1903*4882a593Smuzhiyun
1904*4882a593Smuzhiyun  return status;
1905*4882a593Smuzhiyun}]
1906*4882a593Smuzhiyun_LT_EOF
1907*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1908*4882a593Smuzhiyun    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1909*4882a593Smuzhiyun    lt_status=$?
1910*4882a593Smuzhiyun    case x$lt_status in
1911*4882a593Smuzhiyun      x$lt_dlno_uscore) $1 ;;
1912*4882a593Smuzhiyun      x$lt_dlneed_uscore) $2 ;;
1913*4882a593Smuzhiyun      x$lt_dlunknown|x*) $3 ;;
1914*4882a593Smuzhiyun    esac
1915*4882a593Smuzhiyun  else :
1916*4882a593Smuzhiyun    # compilation failed
1917*4882a593Smuzhiyun    $3
1918*4882a593Smuzhiyun  fi
1919*4882a593Smuzhiyunfi
1920*4882a593Smuzhiyunrm -fr conftest*
1921*4882a593Smuzhiyun])# _LT_TRY_DLOPEN_SELF
1922*4882a593Smuzhiyun
1923*4882a593Smuzhiyun
1924*4882a593Smuzhiyun# LT_SYS_DLOPEN_SELF
1925*4882a593Smuzhiyun# ------------------
1926*4882a593SmuzhiyunAC_DEFUN([LT_SYS_DLOPEN_SELF],
1927*4882a593Smuzhiyun[m4_require([_LT_HEADER_DLFCN])dnl
1928*4882a593Smuzhiyunif test yes != "$enable_dlopen"; then
1929*4882a593Smuzhiyun  enable_dlopen=unknown
1930*4882a593Smuzhiyun  enable_dlopen_self=unknown
1931*4882a593Smuzhiyun  enable_dlopen_self_static=unknown
1932*4882a593Smuzhiyunelse
1933*4882a593Smuzhiyun  lt_cv_dlopen=no
1934*4882a593Smuzhiyun  lt_cv_dlopen_libs=
1935*4882a593Smuzhiyun
1936*4882a593Smuzhiyun  case $host_os in
1937*4882a593Smuzhiyun  beos*)
1938*4882a593Smuzhiyun    lt_cv_dlopen=load_add_on
1939*4882a593Smuzhiyun    lt_cv_dlopen_libs=
1940*4882a593Smuzhiyun    lt_cv_dlopen_self=yes
1941*4882a593Smuzhiyun    ;;
1942*4882a593Smuzhiyun
1943*4882a593Smuzhiyun  mingw* | pw32* | cegcc*)
1944*4882a593Smuzhiyun    lt_cv_dlopen=LoadLibrary
1945*4882a593Smuzhiyun    lt_cv_dlopen_libs=
1946*4882a593Smuzhiyun    ;;
1947*4882a593Smuzhiyun
1948*4882a593Smuzhiyun  cygwin*)
1949*4882a593Smuzhiyun    lt_cv_dlopen=dlopen
1950*4882a593Smuzhiyun    lt_cv_dlopen_libs=
1951*4882a593Smuzhiyun    ;;
1952*4882a593Smuzhiyun
1953*4882a593Smuzhiyun  darwin*)
1954*4882a593Smuzhiyun    # if libdl is installed we need to link against it
1955*4882a593Smuzhiyun    AC_CHECK_LIB([dl], [dlopen],
1956*4882a593Smuzhiyun		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1957*4882a593Smuzhiyun    lt_cv_dlopen=dyld
1958*4882a593Smuzhiyun    lt_cv_dlopen_libs=
1959*4882a593Smuzhiyun    lt_cv_dlopen_self=yes
1960*4882a593Smuzhiyun    ])
1961*4882a593Smuzhiyun    ;;
1962*4882a593Smuzhiyun
1963*4882a593Smuzhiyun  tpf*)
1964*4882a593Smuzhiyun    # Don't try to run any link tests for TPF.  We know it's impossible
1965*4882a593Smuzhiyun    # because TPF is a cross-compiler, and we know how we open DSOs.
1966*4882a593Smuzhiyun    lt_cv_dlopen=dlopen
1967*4882a593Smuzhiyun    lt_cv_dlopen_libs=
1968*4882a593Smuzhiyun    lt_cv_dlopen_self=no
1969*4882a593Smuzhiyun    ;;
1970*4882a593Smuzhiyun
1971*4882a593Smuzhiyun  *)
1972*4882a593Smuzhiyun    AC_CHECK_FUNC([shl_load],
1973*4882a593Smuzhiyun	  [lt_cv_dlopen=shl_load],
1974*4882a593Smuzhiyun      [AC_CHECK_LIB([dld], [shl_load],
1975*4882a593Smuzhiyun	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1976*4882a593Smuzhiyun	[AC_CHECK_FUNC([dlopen],
1977*4882a593Smuzhiyun	      [lt_cv_dlopen=dlopen],
1978*4882a593Smuzhiyun	  [AC_CHECK_LIB([dl], [dlopen],
1979*4882a593Smuzhiyun		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1980*4882a593Smuzhiyun	    [AC_CHECK_LIB([svld], [dlopen],
1981*4882a593Smuzhiyun		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1982*4882a593Smuzhiyun	      [AC_CHECK_LIB([dld], [dld_link],
1983*4882a593Smuzhiyun		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1984*4882a593Smuzhiyun	      ])
1985*4882a593Smuzhiyun	    ])
1986*4882a593Smuzhiyun	  ])
1987*4882a593Smuzhiyun	])
1988*4882a593Smuzhiyun      ])
1989*4882a593Smuzhiyun    ;;
1990*4882a593Smuzhiyun  esac
1991*4882a593Smuzhiyun
1992*4882a593Smuzhiyun  if test no = "$lt_cv_dlopen"; then
1993*4882a593Smuzhiyun    enable_dlopen=no
1994*4882a593Smuzhiyun  else
1995*4882a593Smuzhiyun    enable_dlopen=yes
1996*4882a593Smuzhiyun  fi
1997*4882a593Smuzhiyun
1998*4882a593Smuzhiyun  case $lt_cv_dlopen in
1999*4882a593Smuzhiyun  dlopen)
2000*4882a593Smuzhiyun    save_CPPFLAGS=$CPPFLAGS
2001*4882a593Smuzhiyun    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2002*4882a593Smuzhiyun
2003*4882a593Smuzhiyun    save_LDFLAGS=$LDFLAGS
2004*4882a593Smuzhiyun    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2005*4882a593Smuzhiyun
2006*4882a593Smuzhiyun    save_LIBS=$LIBS
2007*4882a593Smuzhiyun    LIBS="$lt_cv_dlopen_libs $LIBS"
2008*4882a593Smuzhiyun
2009*4882a593Smuzhiyun    AC_CACHE_CHECK([whether a program can dlopen itself],
2010*4882a593Smuzhiyun	  lt_cv_dlopen_self, [dnl
2011*4882a593Smuzhiyun	  _LT_TRY_DLOPEN_SELF(
2012*4882a593Smuzhiyun	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2013*4882a593Smuzhiyun	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2014*4882a593Smuzhiyun    ])
2015*4882a593Smuzhiyun
2016*4882a593Smuzhiyun    if test yes = "$lt_cv_dlopen_self"; then
2017*4882a593Smuzhiyun      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2018*4882a593Smuzhiyun      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2019*4882a593Smuzhiyun	  lt_cv_dlopen_self_static, [dnl
2020*4882a593Smuzhiyun	  _LT_TRY_DLOPEN_SELF(
2021*4882a593Smuzhiyun	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2022*4882a593Smuzhiyun	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2023*4882a593Smuzhiyun      ])
2024*4882a593Smuzhiyun    fi
2025*4882a593Smuzhiyun
2026*4882a593Smuzhiyun    CPPFLAGS=$save_CPPFLAGS
2027*4882a593Smuzhiyun    LDFLAGS=$save_LDFLAGS
2028*4882a593Smuzhiyun    LIBS=$save_LIBS
2029*4882a593Smuzhiyun    ;;
2030*4882a593Smuzhiyun  esac
2031*4882a593Smuzhiyun
2032*4882a593Smuzhiyun  case $lt_cv_dlopen_self in
2033*4882a593Smuzhiyun  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2034*4882a593Smuzhiyun  *) enable_dlopen_self=unknown ;;
2035*4882a593Smuzhiyun  esac
2036*4882a593Smuzhiyun
2037*4882a593Smuzhiyun  case $lt_cv_dlopen_self_static in
2038*4882a593Smuzhiyun  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2039*4882a593Smuzhiyun  *) enable_dlopen_self_static=unknown ;;
2040*4882a593Smuzhiyun  esac
2041*4882a593Smuzhiyunfi
2042*4882a593Smuzhiyun_LT_DECL([dlopen_support], [enable_dlopen], [0],
2043*4882a593Smuzhiyun	 [Whether dlopen is supported])
2044*4882a593Smuzhiyun_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2045*4882a593Smuzhiyun	 [Whether dlopen of programs is supported])
2046*4882a593Smuzhiyun_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2047*4882a593Smuzhiyun	 [Whether dlopen of statically linked programs is supported])
2048*4882a593Smuzhiyun])# LT_SYS_DLOPEN_SELF
2049*4882a593Smuzhiyun
2050*4882a593Smuzhiyun# Old name:
2051*4882a593SmuzhiyunAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2052*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
2053*4882a593Smuzhiyundnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2054*4882a593Smuzhiyun
2055*4882a593Smuzhiyun
2056*4882a593Smuzhiyun# _LT_COMPILER_C_O([TAGNAME])
2057*4882a593Smuzhiyun# ---------------------------
2058*4882a593Smuzhiyun# Check to see if options -c and -o are simultaneously supported by compiler.
2059*4882a593Smuzhiyun# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2060*4882a593Smuzhiyunm4_defun([_LT_COMPILER_C_O],
2061*4882a593Smuzhiyun[m4_require([_LT_DECL_SED])dnl
2062*4882a593Smuzhiyunm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2063*4882a593Smuzhiyunm4_require([_LT_TAG_COMPILER])dnl
2064*4882a593SmuzhiyunAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2065*4882a593Smuzhiyun  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2066*4882a593Smuzhiyun  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2067*4882a593Smuzhiyun   $RM -r conftest 2>/dev/null
2068*4882a593Smuzhiyun   mkdir conftest
2069*4882a593Smuzhiyun   cd conftest
2070*4882a593Smuzhiyun   mkdir out
2071*4882a593Smuzhiyun   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2072*4882a593Smuzhiyun
2073*4882a593Smuzhiyun   lt_compiler_flag="-o out/conftest2.$ac_objext"
2074*4882a593Smuzhiyun   # Insert the option either (1) after the last *FLAGS variable, or
2075*4882a593Smuzhiyun   # (2) before a word containing "conftest.", or (3) at the end.
2076*4882a593Smuzhiyun   # Note that $ac_compile itself does not contain backslashes and begins
2077*4882a593Smuzhiyun   # with a dollar sign (not a hyphen), so the echo should work correctly.
2078*4882a593Smuzhiyun   lt_compile=`echo "$ac_compile" | $SED \
2079*4882a593Smuzhiyun   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2080*4882a593Smuzhiyun   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2081*4882a593Smuzhiyun   -e 's:$: $lt_compiler_flag:'`
2082*4882a593Smuzhiyun   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2083*4882a593Smuzhiyun   (eval "$lt_compile" 2>out/conftest.err)
2084*4882a593Smuzhiyun   ac_status=$?
2085*4882a593Smuzhiyun   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2086*4882a593Smuzhiyun   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2087*4882a593Smuzhiyun   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2088*4882a593Smuzhiyun   then
2089*4882a593Smuzhiyun     # The compiler can only warn and ignore the option if not recognized
2090*4882a593Smuzhiyun     # So say no if there are warnings
2091*4882a593Smuzhiyun     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2092*4882a593Smuzhiyun     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2093*4882a593Smuzhiyun     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2094*4882a593Smuzhiyun       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2095*4882a593Smuzhiyun     fi
2096*4882a593Smuzhiyun   fi
2097*4882a593Smuzhiyun   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2098*4882a593Smuzhiyun   $RM conftest*
2099*4882a593Smuzhiyun   # SGI C++ compiler will create directory out/ii_files/ for
2100*4882a593Smuzhiyun   # template instantiation
2101*4882a593Smuzhiyun   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2102*4882a593Smuzhiyun   $RM out/* && rmdir out
2103*4882a593Smuzhiyun   cd ..
2104*4882a593Smuzhiyun   $RM -r conftest
2105*4882a593Smuzhiyun   $RM conftest*
2106*4882a593Smuzhiyun])
2107*4882a593Smuzhiyun_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2108*4882a593Smuzhiyun	[Does compiler simultaneously support -c and -o options?])
2109*4882a593Smuzhiyun])# _LT_COMPILER_C_O
2110*4882a593Smuzhiyun
2111*4882a593Smuzhiyun
2112*4882a593Smuzhiyun# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2113*4882a593Smuzhiyun# ----------------------------------
2114*4882a593Smuzhiyun# Check to see if we can do hard links to lock some files if needed
2115*4882a593Smuzhiyunm4_defun([_LT_COMPILER_FILE_LOCKS],
2116*4882a593Smuzhiyun[m4_require([_LT_ENABLE_LOCK])dnl
2117*4882a593Smuzhiyunm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2118*4882a593Smuzhiyun_LT_COMPILER_C_O([$1])
2119*4882a593Smuzhiyun
2120*4882a593Smuzhiyunhard_links=nottested
2121*4882a593Smuzhiyunif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2122*4882a593Smuzhiyun  # do not overwrite the value of need_locks provided by the user
2123*4882a593Smuzhiyun  AC_MSG_CHECKING([if we can lock with hard links])
2124*4882a593Smuzhiyun  hard_links=yes
2125*4882a593Smuzhiyun  $RM conftest*
2126*4882a593Smuzhiyun  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2127*4882a593Smuzhiyun  touch conftest.a
2128*4882a593Smuzhiyun  ln conftest.a conftest.b 2>&5 || hard_links=no
2129*4882a593Smuzhiyun  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2130*4882a593Smuzhiyun  AC_MSG_RESULT([$hard_links])
2131*4882a593Smuzhiyun  if test no = "$hard_links"; then
2132*4882a593Smuzhiyun    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2133*4882a593Smuzhiyun    need_locks=warn
2134*4882a593Smuzhiyun  fi
2135*4882a593Smuzhiyunelse
2136*4882a593Smuzhiyun  need_locks=no
2137*4882a593Smuzhiyunfi
2138*4882a593Smuzhiyun_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2139*4882a593Smuzhiyun])# _LT_COMPILER_FILE_LOCKS
2140*4882a593Smuzhiyun
2141*4882a593Smuzhiyun
2142*4882a593Smuzhiyun# _LT_CHECK_OBJDIR
2143*4882a593Smuzhiyun# ----------------
2144*4882a593Smuzhiyunm4_defun([_LT_CHECK_OBJDIR],
2145*4882a593Smuzhiyun[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2146*4882a593Smuzhiyun[rm -f .libs 2>/dev/null
2147*4882a593Smuzhiyunmkdir .libs 2>/dev/null
2148*4882a593Smuzhiyunif test -d .libs; then
2149*4882a593Smuzhiyun  lt_cv_objdir=.libs
2150*4882a593Smuzhiyunelse
2151*4882a593Smuzhiyun  # MS-DOS does not allow filenames that begin with a dot.
2152*4882a593Smuzhiyun  lt_cv_objdir=_libs
2153*4882a593Smuzhiyunfi
2154*4882a593Smuzhiyunrmdir .libs 2>/dev/null])
2155*4882a593Smuzhiyunobjdir=$lt_cv_objdir
2156*4882a593Smuzhiyun_LT_DECL([], [objdir], [0],
2157*4882a593Smuzhiyun         [The name of the directory that contains temporary libtool files])dnl
2158*4882a593Smuzhiyunm4_pattern_allow([LT_OBJDIR])dnl
2159*4882a593SmuzhiyunAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2160*4882a593Smuzhiyun  [Define to the sub-directory where libtool stores uninstalled libraries.])
2161*4882a593Smuzhiyun])# _LT_CHECK_OBJDIR
2162*4882a593Smuzhiyun
2163*4882a593Smuzhiyun
2164*4882a593Smuzhiyun# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2165*4882a593Smuzhiyun# --------------------------------------
2166*4882a593Smuzhiyun# Check hardcoding attributes.
2167*4882a593Smuzhiyunm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2168*4882a593Smuzhiyun[AC_MSG_CHECKING([how to hardcode library paths into programs])
2169*4882a593Smuzhiyun_LT_TAGVAR(hardcode_action, $1)=
2170*4882a593Smuzhiyunif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2171*4882a593Smuzhiyun   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2172*4882a593Smuzhiyun   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2173*4882a593Smuzhiyun
2174*4882a593Smuzhiyun  # We can hardcode non-existent directories.
2175*4882a593Smuzhiyun  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2176*4882a593Smuzhiyun     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2177*4882a593Smuzhiyun     # have to relink, otherwise we might link with an installed library
2178*4882a593Smuzhiyun     # when we should be linking with a yet-to-be-installed one
2179*4882a593Smuzhiyun     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2180*4882a593Smuzhiyun     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2181*4882a593Smuzhiyun    # Linking always hardcodes the temporary library directory.
2182*4882a593Smuzhiyun    _LT_TAGVAR(hardcode_action, $1)=relink
2183*4882a593Smuzhiyun  else
2184*4882a593Smuzhiyun    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2185*4882a593Smuzhiyun    _LT_TAGVAR(hardcode_action, $1)=immediate
2186*4882a593Smuzhiyun  fi
2187*4882a593Smuzhiyunelse
2188*4882a593Smuzhiyun  # We cannot hardcode anything, or else we can only hardcode existing
2189*4882a593Smuzhiyun  # directories.
2190*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_action, $1)=unsupported
2191*4882a593Smuzhiyunfi
2192*4882a593SmuzhiyunAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2193*4882a593Smuzhiyun
2194*4882a593Smuzhiyunif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2195*4882a593Smuzhiyun   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2196*4882a593Smuzhiyun  # Fast installation is not supported
2197*4882a593Smuzhiyun  enable_fast_install=no
2198*4882a593Smuzhiyunelif test yes = "$shlibpath_overrides_runpath" ||
2199*4882a593Smuzhiyun     test no = "$enable_shared"; then
2200*4882a593Smuzhiyun  # Fast installation is not necessary
2201*4882a593Smuzhiyun  enable_fast_install=needless
2202*4882a593Smuzhiyunfi
2203*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_action], [0],
2204*4882a593Smuzhiyun    [How to hardcode a shared library path into an executable])
2205*4882a593Smuzhiyun])# _LT_LINKER_HARDCODE_LIBPATH
2206*4882a593Smuzhiyun
2207*4882a593Smuzhiyun
2208*4882a593Smuzhiyun# _LT_CMD_STRIPLIB
2209*4882a593Smuzhiyun# ----------------
2210*4882a593Smuzhiyunm4_defun([_LT_CMD_STRIPLIB],
2211*4882a593Smuzhiyun[m4_require([_LT_DECL_EGREP])
2212*4882a593Smuzhiyunstriplib=
2213*4882a593Smuzhiyunold_striplib=
2214*4882a593SmuzhiyunAC_MSG_CHECKING([whether stripping libraries is possible])
2215*4882a593Smuzhiyunif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2216*4882a593Smuzhiyun  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2217*4882a593Smuzhiyun  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2218*4882a593Smuzhiyun  AC_MSG_RESULT([yes])
2219*4882a593Smuzhiyunelse
2220*4882a593Smuzhiyun# FIXME - insert some real tests, host_os isn't really good enough
2221*4882a593Smuzhiyun  case $host_os in
2222*4882a593Smuzhiyun  darwin*)
2223*4882a593Smuzhiyun    if test -n "$STRIP"; then
2224*4882a593Smuzhiyun      striplib="$STRIP -x"
2225*4882a593Smuzhiyun      old_striplib="$STRIP -S"
2226*4882a593Smuzhiyun      AC_MSG_RESULT([yes])
2227*4882a593Smuzhiyun    else
2228*4882a593Smuzhiyun      AC_MSG_RESULT([no])
2229*4882a593Smuzhiyun    fi
2230*4882a593Smuzhiyun    ;;
2231*4882a593Smuzhiyun  *)
2232*4882a593Smuzhiyun    AC_MSG_RESULT([no])
2233*4882a593Smuzhiyun    ;;
2234*4882a593Smuzhiyun  esac
2235*4882a593Smuzhiyunfi
2236*4882a593Smuzhiyun_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2237*4882a593Smuzhiyun_LT_DECL([], [striplib], [1])
2238*4882a593Smuzhiyun])# _LT_CMD_STRIPLIB
2239*4882a593Smuzhiyun
2240*4882a593Smuzhiyun
2241*4882a593Smuzhiyun# _LT_PREPARE_MUNGE_PATH_LIST
2242*4882a593Smuzhiyun# ---------------------------
2243*4882a593Smuzhiyun# Make sure func_munge_path_list() is defined correctly.
2244*4882a593Smuzhiyunm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2245*4882a593Smuzhiyun[[# func_munge_path_list VARIABLE PATH
2246*4882a593Smuzhiyun# -----------------------------------
2247*4882a593Smuzhiyun# VARIABLE is name of variable containing _space_ separated list of
2248*4882a593Smuzhiyun# directories to be munged by the contents of PATH, which is string
2249*4882a593Smuzhiyun# having a format:
2250*4882a593Smuzhiyun# "DIR[:DIR]:"
2251*4882a593Smuzhiyun#       string "DIR[ DIR]" will be prepended to VARIABLE
2252*4882a593Smuzhiyun# ":DIR[:DIR]"
2253*4882a593Smuzhiyun#       string "DIR[ DIR]" will be appended to VARIABLE
2254*4882a593Smuzhiyun# "DIRP[:DIRP]::[DIRA:]DIRA"
2255*4882a593Smuzhiyun#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2256*4882a593Smuzhiyun#       "DIRA[ DIRA]" will be appended to VARIABLE
2257*4882a593Smuzhiyun# "DIR[:DIR]"
2258*4882a593Smuzhiyun#       VARIABLE will be replaced by "DIR[ DIR]"
2259*4882a593Smuzhiyunfunc_munge_path_list ()
2260*4882a593Smuzhiyun{
2261*4882a593Smuzhiyun    case x@S|@2 in
2262*4882a593Smuzhiyun    x)
2263*4882a593Smuzhiyun        ;;
2264*4882a593Smuzhiyun    *:)
2265*4882a593Smuzhiyun        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2266*4882a593Smuzhiyun        ;;
2267*4882a593Smuzhiyun    x:*)
2268*4882a593Smuzhiyun        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2269*4882a593Smuzhiyun        ;;
2270*4882a593Smuzhiyun    *::*)
2271*4882a593Smuzhiyun        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2272*4882a593Smuzhiyun        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2273*4882a593Smuzhiyun        ;;
2274*4882a593Smuzhiyun    *)
2275*4882a593Smuzhiyun        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2276*4882a593Smuzhiyun        ;;
2277*4882a593Smuzhiyun    esac
2278*4882a593Smuzhiyun}
2279*4882a593Smuzhiyun]])# _LT_PREPARE_PATH_LIST
2280*4882a593Smuzhiyun
2281*4882a593Smuzhiyun
2282*4882a593Smuzhiyun# _LT_SYS_DYNAMIC_LINKER([TAG])
2283*4882a593Smuzhiyun# -----------------------------
2284*4882a593Smuzhiyun# PORTME Fill in your ld.so characteristics
2285*4882a593Smuzhiyunm4_defun([_LT_SYS_DYNAMIC_LINKER],
2286*4882a593Smuzhiyun[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2287*4882a593Smuzhiyunm4_require([_LT_DECL_EGREP])dnl
2288*4882a593Smuzhiyunm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2289*4882a593Smuzhiyunm4_require([_LT_DECL_OBJDUMP])dnl
2290*4882a593Smuzhiyunm4_require([_LT_DECL_SED])dnl
2291*4882a593Smuzhiyunm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2292*4882a593Smuzhiyunm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2293*4882a593SmuzhiyunAC_MSG_CHECKING([dynamic linker characteristics])
2294*4882a593Smuzhiyunm4_if([$1],
2295*4882a593Smuzhiyun	[], [
2296*4882a593Smuzhiyunif test yes = "$GCC"; then
2297*4882a593Smuzhiyun  case $host_os in
2298*4882a593Smuzhiyun    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2299*4882a593Smuzhiyun    *) lt_awk_arg='/^libraries:/' ;;
2300*4882a593Smuzhiyun  esac
2301*4882a593Smuzhiyun  case $host_os in
2302*4882a593Smuzhiyun    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2303*4882a593Smuzhiyun    *) lt_sed_strip_eq='s|=/|/|g' ;;
2304*4882a593Smuzhiyun  esac
2305*4882a593Smuzhiyun  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2306*4882a593Smuzhiyun  case $lt_search_path_spec in
2307*4882a593Smuzhiyun  *\;*)
2308*4882a593Smuzhiyun    # if the path contains ";" then we assume it to be the separator
2309*4882a593Smuzhiyun    # otherwise default to the standard path separator (i.e. ":") - it is
2310*4882a593Smuzhiyun    # assumed that no part of a normal pathname contains ";" but that should
2311*4882a593Smuzhiyun    # okay in the real world where ";" in dirpaths is itself problematic.
2312*4882a593Smuzhiyun    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2313*4882a593Smuzhiyun    ;;
2314*4882a593Smuzhiyun  *)
2315*4882a593Smuzhiyun    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2316*4882a593Smuzhiyun    ;;
2317*4882a593Smuzhiyun  esac
2318*4882a593Smuzhiyun  # Ok, now we have the path, separated by spaces, we can step through it
2319*4882a593Smuzhiyun  # and add multilib dir if necessary...
2320*4882a593Smuzhiyun  lt_tmp_lt_search_path_spec=
2321*4882a593Smuzhiyun  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2322*4882a593Smuzhiyun  # ...but if some path component already ends with the multilib dir we assume
2323*4882a593Smuzhiyun  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2324*4882a593Smuzhiyun  case "$lt_multi_os_dir; $lt_search_path_spec " in
2325*4882a593Smuzhiyun  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2326*4882a593Smuzhiyun    lt_multi_os_dir=
2327*4882a593Smuzhiyun    ;;
2328*4882a593Smuzhiyun  esac
2329*4882a593Smuzhiyun  for lt_sys_path in $lt_search_path_spec; do
2330*4882a593Smuzhiyun    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2331*4882a593Smuzhiyun      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2332*4882a593Smuzhiyun    elif test -n "$lt_multi_os_dir"; then
2333*4882a593Smuzhiyun      test -d "$lt_sys_path" && \
2334*4882a593Smuzhiyun	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2335*4882a593Smuzhiyun    fi
2336*4882a593Smuzhiyun  done
2337*4882a593Smuzhiyun  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2338*4882a593SmuzhiyunBEGIN {RS = " "; FS = "/|\n";} {
2339*4882a593Smuzhiyun  lt_foo = "";
2340*4882a593Smuzhiyun  lt_count = 0;
2341*4882a593Smuzhiyun  for (lt_i = NF; lt_i > 0; lt_i--) {
2342*4882a593Smuzhiyun    if ($lt_i != "" && $lt_i != ".") {
2343*4882a593Smuzhiyun      if ($lt_i == "..") {
2344*4882a593Smuzhiyun        lt_count++;
2345*4882a593Smuzhiyun      } else {
2346*4882a593Smuzhiyun        if (lt_count == 0) {
2347*4882a593Smuzhiyun          lt_foo = "/" $lt_i lt_foo;
2348*4882a593Smuzhiyun        } else {
2349*4882a593Smuzhiyun          lt_count--;
2350*4882a593Smuzhiyun        }
2351*4882a593Smuzhiyun      }
2352*4882a593Smuzhiyun    }
2353*4882a593Smuzhiyun  }
2354*4882a593Smuzhiyun  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2355*4882a593Smuzhiyun  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2356*4882a593Smuzhiyun}'`
2357*4882a593Smuzhiyun  # AWK program above erroneously prepends '/' to C:/dos/paths
2358*4882a593Smuzhiyun  # for these hosts.
2359*4882a593Smuzhiyun  case $host_os in
2360*4882a593Smuzhiyun    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2361*4882a593Smuzhiyun      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2362*4882a593Smuzhiyun  esac
2363*4882a593Smuzhiyun  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2364*4882a593Smuzhiyunelse
2365*4882a593Smuzhiyun  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2366*4882a593Smuzhiyunfi])
2367*4882a593Smuzhiyunlibrary_names_spec=
2368*4882a593Smuzhiyunlibname_spec='lib$name'
2369*4882a593Smuzhiyunsoname_spec=
2370*4882a593Smuzhiyunshrext_cmds=.so
2371*4882a593Smuzhiyunpostinstall_cmds=
2372*4882a593Smuzhiyunpostuninstall_cmds=
2373*4882a593Smuzhiyunfinish_cmds=
2374*4882a593Smuzhiyunfinish_eval=
2375*4882a593Smuzhiyunshlibpath_var=
2376*4882a593Smuzhiyunshlibpath_overrides_runpath=unknown
2377*4882a593Smuzhiyunversion_type=none
2378*4882a593Smuzhiyundynamic_linker="$host_os ld.so"
2379*4882a593Smuzhiyunsys_lib_dlsearch_path_spec="/lib /usr/lib"
2380*4882a593Smuzhiyunneed_lib_prefix=unknown
2381*4882a593Smuzhiyunhardcode_into_libs=no
2382*4882a593Smuzhiyun
2383*4882a593Smuzhiyun# when you set need_version to no, make sure it does not cause -set_version
2384*4882a593Smuzhiyun# flags to be left without arguments
2385*4882a593Smuzhiyunneed_version=unknown
2386*4882a593Smuzhiyun
2387*4882a593SmuzhiyunAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2388*4882a593Smuzhiyun[User-defined run-time library search path.])
2389*4882a593Smuzhiyun
2390*4882a593Smuzhiyuncase $host_os in
2391*4882a593Smuzhiyunaix3*)
2392*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2393*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2394*4882a593Smuzhiyun  shlibpath_var=LIBPATH
2395*4882a593Smuzhiyun
2396*4882a593Smuzhiyun  # AIX 3 has no versioning support, so we append a major version to the name.
2397*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2398*4882a593Smuzhiyun  ;;
2399*4882a593Smuzhiyun
2400*4882a593Smuzhiyunaix[[4-9]]*)
2401*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2402*4882a593Smuzhiyun  need_lib_prefix=no
2403*4882a593Smuzhiyun  need_version=no
2404*4882a593Smuzhiyun  hardcode_into_libs=yes
2405*4882a593Smuzhiyun  if test ia64 = "$host_cpu"; then
2406*4882a593Smuzhiyun    # AIX 5 supports IA64
2407*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2408*4882a593Smuzhiyun    shlibpath_var=LD_LIBRARY_PATH
2409*4882a593Smuzhiyun  else
2410*4882a593Smuzhiyun    # With GCC up to 2.95.x, collect2 would create an import file
2411*4882a593Smuzhiyun    # for dependence libraries.  The import file would start with
2412*4882a593Smuzhiyun    # the line '#! .'.  This would cause the generated library to
2413*4882a593Smuzhiyun    # depend on '.', always an invalid library.  This was fixed in
2414*4882a593Smuzhiyun    # development snapshots of GCC prior to 3.0.
2415*4882a593Smuzhiyun    case $host_os in
2416*4882a593Smuzhiyun      aix4 | aix4.[[01]] | aix4.[[01]].*)
2417*4882a593Smuzhiyun      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2418*4882a593Smuzhiyun	   echo ' yes '
2419*4882a593Smuzhiyun	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2420*4882a593Smuzhiyun	:
2421*4882a593Smuzhiyun      else
2422*4882a593Smuzhiyun	can_build_shared=no
2423*4882a593Smuzhiyun      fi
2424*4882a593Smuzhiyun      ;;
2425*4882a593Smuzhiyun    esac
2426*4882a593Smuzhiyun    # Using Import Files as archive members, it is possible to support
2427*4882a593Smuzhiyun    # filename-based versioning of shared library archives on AIX. While
2428*4882a593Smuzhiyun    # this would work for both with and without runtime linking, it will
2429*4882a593Smuzhiyun    # prevent static linking of such archives. So we do filename-based
2430*4882a593Smuzhiyun    # shared library versioning with .so extension only, which is used
2431*4882a593Smuzhiyun    # when both runtime linking and shared linking is enabled.
2432*4882a593Smuzhiyun    # Unfortunately, runtime linking may impact performance, so we do
2433*4882a593Smuzhiyun    # not want this to be the default eventually. Also, we use the
2434*4882a593Smuzhiyun    # versioned .so libs for executables only if there is the -brtl
2435*4882a593Smuzhiyun    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2436*4882a593Smuzhiyun    # To allow for filename-based versioning support, we need to create
2437*4882a593Smuzhiyun    # libNAME.so.V as an archive file, containing:
2438*4882a593Smuzhiyun    # *) an Import File, referring to the versioned filename of the
2439*4882a593Smuzhiyun    #    archive as well as the shared archive member, telling the
2440*4882a593Smuzhiyun    #    bitwidth (32 or 64) of that shared object, and providing the
2441*4882a593Smuzhiyun    #    list of exported symbols of that shared object, eventually
2442*4882a593Smuzhiyun    #    decorated with the 'weak' keyword
2443*4882a593Smuzhiyun    # *) the shared object with the F_LOADONLY flag set, to really avoid
2444*4882a593Smuzhiyun    #    it being seen by the linker.
2445*4882a593Smuzhiyun    # At run time we better use the real file rather than another symlink,
2446*4882a593Smuzhiyun    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2447*4882a593Smuzhiyun
2448*4882a593Smuzhiyun    case $with_aix_soname,$aix_use_runtimelinking in
2449*4882a593Smuzhiyun    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2450*4882a593Smuzhiyun    # soname into executable. Probably we can add versioning support to
2451*4882a593Smuzhiyun    # collect2, so additional links can be useful in future.
2452*4882a593Smuzhiyun    aix,yes) # traditional libtool
2453*4882a593Smuzhiyun      dynamic_linker='AIX unversionable lib.so'
2454*4882a593Smuzhiyun      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2455*4882a593Smuzhiyun      # instead of lib<name>.a to let people know that these are not
2456*4882a593Smuzhiyun      # typical AIX shared libraries.
2457*4882a593Smuzhiyun      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2458*4882a593Smuzhiyun      ;;
2459*4882a593Smuzhiyun    aix,no) # traditional AIX only
2460*4882a593Smuzhiyun      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2461*4882a593Smuzhiyun      # We preserve .a as extension for shared libraries through AIX4.2
2462*4882a593Smuzhiyun      # and later when we are not doing run time linking.
2463*4882a593Smuzhiyun      library_names_spec='$libname$release.a $libname.a'
2464*4882a593Smuzhiyun      soname_spec='$libname$release$shared_ext$major'
2465*4882a593Smuzhiyun      ;;
2466*4882a593Smuzhiyun    svr4,*) # full svr4 only
2467*4882a593Smuzhiyun      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2468*4882a593Smuzhiyun      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2469*4882a593Smuzhiyun      # We do not specify a path in Import Files, so LIBPATH fires.
2470*4882a593Smuzhiyun      shlibpath_overrides_runpath=yes
2471*4882a593Smuzhiyun      ;;
2472*4882a593Smuzhiyun    *,yes) # both, prefer svr4
2473*4882a593Smuzhiyun      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2474*4882a593Smuzhiyun      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2475*4882a593Smuzhiyun      # unpreferred sharedlib libNAME.a needs extra handling
2476*4882a593Smuzhiyun      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2477*4882a593Smuzhiyun      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2478*4882a593Smuzhiyun      # We do not specify a path in Import Files, so LIBPATH fires.
2479*4882a593Smuzhiyun      shlibpath_overrides_runpath=yes
2480*4882a593Smuzhiyun      ;;
2481*4882a593Smuzhiyun    *,no) # both, prefer aix
2482*4882a593Smuzhiyun      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2483*4882a593Smuzhiyun      library_names_spec='$libname$release.a $libname.a'
2484*4882a593Smuzhiyun      soname_spec='$libname$release$shared_ext$major'
2485*4882a593Smuzhiyun      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2486*4882a593Smuzhiyun      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2487*4882a593Smuzhiyun      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2488*4882a593Smuzhiyun      ;;
2489*4882a593Smuzhiyun    esac
2490*4882a593Smuzhiyun    shlibpath_var=LIBPATH
2491*4882a593Smuzhiyun  fi
2492*4882a593Smuzhiyun  ;;
2493*4882a593Smuzhiyun
2494*4882a593Smuzhiyunamigaos*)
2495*4882a593Smuzhiyun  case $host_cpu in
2496*4882a593Smuzhiyun  powerpc)
2497*4882a593Smuzhiyun    # Since July 2007 AmigaOS4 officially supports .so libraries.
2498*4882a593Smuzhiyun    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2499*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2500*4882a593Smuzhiyun    ;;
2501*4882a593Smuzhiyun  m68k)
2502*4882a593Smuzhiyun    library_names_spec='$libname.ixlibrary $libname.a'
2503*4882a593Smuzhiyun    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2504*4882a593Smuzhiyun    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
2505*4882a593Smuzhiyun    ;;
2506*4882a593Smuzhiyun  esac
2507*4882a593Smuzhiyun  ;;
2508*4882a593Smuzhiyun
2509*4882a593Smuzhiyunbeos*)
2510*4882a593Smuzhiyun  library_names_spec='$libname$shared_ext'
2511*4882a593Smuzhiyun  dynamic_linker="$host_os ld.so"
2512*4882a593Smuzhiyun  shlibpath_var=LIBRARY_PATH
2513*4882a593Smuzhiyun  ;;
2514*4882a593Smuzhiyun
2515*4882a593Smuzhiyunbsdi[[45]]*)
2516*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2517*4882a593Smuzhiyun  need_version=no
2518*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2519*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2520*4882a593Smuzhiyun  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2521*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2522*4882a593Smuzhiyun  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2523*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2524*4882a593Smuzhiyun  # the default ld.so.conf also contains /usr/contrib/lib and
2525*4882a593Smuzhiyun  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2526*4882a593Smuzhiyun  # libtool to hard-code these into programs
2527*4882a593Smuzhiyun  ;;
2528*4882a593Smuzhiyun
2529*4882a593Smuzhiyuncygwin* | mingw* | pw32* | cegcc*)
2530*4882a593Smuzhiyun  version_type=windows
2531*4882a593Smuzhiyun  shrext_cmds=.dll
2532*4882a593Smuzhiyun  need_version=no
2533*4882a593Smuzhiyun  need_lib_prefix=no
2534*4882a593Smuzhiyun
2535*4882a593Smuzhiyun  case $GCC,$cc_basename in
2536*4882a593Smuzhiyun  yes,*)
2537*4882a593Smuzhiyun    # gcc
2538*4882a593Smuzhiyun    library_names_spec='$libname.dll.a'
2539*4882a593Smuzhiyun    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2540*4882a593Smuzhiyun    postinstall_cmds='base_file=`basename \$file`~
2541*4882a593Smuzhiyun      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2542*4882a593Smuzhiyun      dldir=$destdir/`dirname \$dlpath`~
2543*4882a593Smuzhiyun      test -d \$dldir || mkdir -p \$dldir~
2544*4882a593Smuzhiyun      $install_prog $dir/$dlname \$dldir/$dlname~
2545*4882a593Smuzhiyun      chmod a+x \$dldir/$dlname~
2546*4882a593Smuzhiyun      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2547*4882a593Smuzhiyun        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2548*4882a593Smuzhiyun      fi'
2549*4882a593Smuzhiyun    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2550*4882a593Smuzhiyun      dlpath=$dir/\$dldll~
2551*4882a593Smuzhiyun       $RM \$dlpath'
2552*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes
2553*4882a593Smuzhiyun
2554*4882a593Smuzhiyun    case $host_os in
2555*4882a593Smuzhiyun    cygwin*)
2556*4882a593Smuzhiyun      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2557*4882a593Smuzhiyun      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2558*4882a593Smuzhiyunm4_if([$1], [],[
2559*4882a593Smuzhiyun      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2560*4882a593Smuzhiyun      ;;
2561*4882a593Smuzhiyun    mingw* | cegcc*)
2562*4882a593Smuzhiyun      # MinGW DLLs use traditional 'lib' prefix
2563*4882a593Smuzhiyun      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2564*4882a593Smuzhiyun      ;;
2565*4882a593Smuzhiyun    pw32*)
2566*4882a593Smuzhiyun      # pw32 DLLs use 'pw' prefix rather than 'lib'
2567*4882a593Smuzhiyun      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2568*4882a593Smuzhiyun      ;;
2569*4882a593Smuzhiyun    esac
2570*4882a593Smuzhiyun    dynamic_linker='Win32 ld.exe'
2571*4882a593Smuzhiyun    ;;
2572*4882a593Smuzhiyun
2573*4882a593Smuzhiyun  *,cl*)
2574*4882a593Smuzhiyun    # Native MSVC
2575*4882a593Smuzhiyun    libname_spec='$name'
2576*4882a593Smuzhiyun    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2577*4882a593Smuzhiyun    library_names_spec='$libname.dll.lib'
2578*4882a593Smuzhiyun
2579*4882a593Smuzhiyun    case $build_os in
2580*4882a593Smuzhiyun    mingw*)
2581*4882a593Smuzhiyun      sys_lib_search_path_spec=
2582*4882a593Smuzhiyun      lt_save_ifs=$IFS
2583*4882a593Smuzhiyun      IFS=';'
2584*4882a593Smuzhiyun      for lt_path in $LIB
2585*4882a593Smuzhiyun      do
2586*4882a593Smuzhiyun        IFS=$lt_save_ifs
2587*4882a593Smuzhiyun        # Let DOS variable expansion print the short 8.3 style file name.
2588*4882a593Smuzhiyun        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2589*4882a593Smuzhiyun        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2590*4882a593Smuzhiyun      done
2591*4882a593Smuzhiyun      IFS=$lt_save_ifs
2592*4882a593Smuzhiyun      # Convert to MSYS style.
2593*4882a593Smuzhiyun      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2594*4882a593Smuzhiyun      ;;
2595*4882a593Smuzhiyun    cygwin*)
2596*4882a593Smuzhiyun      # Convert to unix form, then to dos form, then back to unix form
2597*4882a593Smuzhiyun      # but this time dos style (no spaces!) so that the unix form looks
2598*4882a593Smuzhiyun      # like /cygdrive/c/PROGRA~1:/cygdr...
2599*4882a593Smuzhiyun      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2600*4882a593Smuzhiyun      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2601*4882a593Smuzhiyun      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2602*4882a593Smuzhiyun      ;;
2603*4882a593Smuzhiyun    *)
2604*4882a593Smuzhiyun      sys_lib_search_path_spec=$LIB
2605*4882a593Smuzhiyun      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2606*4882a593Smuzhiyun        # It is most probably a Windows format PATH.
2607*4882a593Smuzhiyun        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2608*4882a593Smuzhiyun      else
2609*4882a593Smuzhiyun        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2610*4882a593Smuzhiyun      fi
2611*4882a593Smuzhiyun      # FIXME: find the short name or the path components, as spaces are
2612*4882a593Smuzhiyun      # common. (e.g. "Program Files" -> "PROGRA~1")
2613*4882a593Smuzhiyun      ;;
2614*4882a593Smuzhiyun    esac
2615*4882a593Smuzhiyun
2616*4882a593Smuzhiyun    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2617*4882a593Smuzhiyun    postinstall_cmds='base_file=`basename \$file`~
2618*4882a593Smuzhiyun      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2619*4882a593Smuzhiyun      dldir=$destdir/`dirname \$dlpath`~
2620*4882a593Smuzhiyun      test -d \$dldir || mkdir -p \$dldir~
2621*4882a593Smuzhiyun      $install_prog $dir/$dlname \$dldir/$dlname'
2622*4882a593Smuzhiyun    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2623*4882a593Smuzhiyun      dlpath=$dir/\$dldll~
2624*4882a593Smuzhiyun       $RM \$dlpath'
2625*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes
2626*4882a593Smuzhiyun    dynamic_linker='Win32 link.exe'
2627*4882a593Smuzhiyun    ;;
2628*4882a593Smuzhiyun
2629*4882a593Smuzhiyun  *)
2630*4882a593Smuzhiyun    # Assume MSVC wrapper
2631*4882a593Smuzhiyun    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2632*4882a593Smuzhiyun    dynamic_linker='Win32 ld.exe'
2633*4882a593Smuzhiyun    ;;
2634*4882a593Smuzhiyun  esac
2635*4882a593Smuzhiyun  # FIXME: first we should search . and the directory the executable is in
2636*4882a593Smuzhiyun  shlibpath_var=PATH
2637*4882a593Smuzhiyun  ;;
2638*4882a593Smuzhiyun
2639*4882a593Smuzhiyundarwin* | rhapsody*)
2640*4882a593Smuzhiyun  dynamic_linker="$host_os dyld"
2641*4882a593Smuzhiyun  version_type=darwin
2642*4882a593Smuzhiyun  need_lib_prefix=no
2643*4882a593Smuzhiyun  need_version=no
2644*4882a593Smuzhiyun  library_names_spec='$libname$release$versuffix$shared_ext $libname$release$major$shared_ext $libname$shared_ext'
2645*4882a593Smuzhiyun  soname_spec='$libname$release$major$shared_ext'
2646*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
2647*4882a593Smuzhiyun  shlibpath_var=DYLD_LIBRARY_PATH
2648*4882a593Smuzhiyun  shrext_cmds='`test .$module = .yes && echo .bundle || echo .dylib`'
2649*4882a593Smuzhiyunm4_if([$1], [],[
2650*4882a593Smuzhiyun  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2651*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2652*4882a593Smuzhiyun  ;;
2653*4882a593Smuzhiyun
2654*4882a593Smuzhiyundgux*)
2655*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2656*4882a593Smuzhiyun  need_lib_prefix=no
2657*4882a593Smuzhiyun  need_version=no
2658*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2659*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2660*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2661*4882a593Smuzhiyun  ;;
2662*4882a593Smuzhiyun
2663*4882a593Smuzhiyunfreebsd* | dragonfly*)
2664*4882a593Smuzhiyun  # DragonFly does not have aout.  When/if they implement a new
2665*4882a593Smuzhiyun  # versioning mechanism, adjust this.
2666*4882a593Smuzhiyun  if test -x /usr/bin/objformat; then
2667*4882a593Smuzhiyun    objformat=`/usr/bin/objformat`
2668*4882a593Smuzhiyun  else
2669*4882a593Smuzhiyun    case $host_os in
2670*4882a593Smuzhiyun    freebsd[[23]].*) objformat=aout ;;
2671*4882a593Smuzhiyun    *) objformat=elf ;;
2672*4882a593Smuzhiyun    esac
2673*4882a593Smuzhiyun  fi
2674*4882a593Smuzhiyun  # Handle Gentoo/FreeBSD as it was Linux
2675*4882a593Smuzhiyun  case $host_vendor in
2676*4882a593Smuzhiyun    gentoo)
2677*4882a593Smuzhiyun      version_type=linux ;;
2678*4882a593Smuzhiyun    *)
2679*4882a593Smuzhiyun      version_type=freebsd-$objformat ;;
2680*4882a593Smuzhiyun  esac
2681*4882a593Smuzhiyun
2682*4882a593Smuzhiyun  case $version_type in
2683*4882a593Smuzhiyun    freebsd-elf*)
2684*4882a593Smuzhiyun      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2685*4882a593Smuzhiyun      soname_spec='$libname$release$shared_ext$major'
2686*4882a593Smuzhiyun      need_version=no
2687*4882a593Smuzhiyun      need_lib_prefix=no
2688*4882a593Smuzhiyun      ;;
2689*4882a593Smuzhiyun    freebsd-*)
2690*4882a593Smuzhiyun      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2691*4882a593Smuzhiyun      need_version=yes
2692*4882a593Smuzhiyun      ;;
2693*4882a593Smuzhiyun    linux)
2694*4882a593Smuzhiyun      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2695*4882a593Smuzhiyun      soname_spec='${libname}${release}${shared_ext}$major'
2696*4882a593Smuzhiyun      need_lib_prefix=no
2697*4882a593Smuzhiyun      need_version=no
2698*4882a593Smuzhiyun      ;;
2699*4882a593Smuzhiyun  esac
2700*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2701*4882a593Smuzhiyun  case $host_os in
2702*4882a593Smuzhiyun  freebsd2.*)
2703*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes
2704*4882a593Smuzhiyun    ;;
2705*4882a593Smuzhiyun  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2706*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes
2707*4882a593Smuzhiyun    hardcode_into_libs=yes
2708*4882a593Smuzhiyun    ;;
2709*4882a593Smuzhiyun  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2710*4882a593Smuzhiyun  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2711*4882a593Smuzhiyun    shlibpath_overrides_runpath=no
2712*4882a593Smuzhiyun    hardcode_into_libs=yes
2713*4882a593Smuzhiyun    ;;
2714*4882a593Smuzhiyun  *) # from 4.6 on, and DragonFly
2715*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes
2716*4882a593Smuzhiyun    hardcode_into_libs=yes
2717*4882a593Smuzhiyun    ;;
2718*4882a593Smuzhiyun  esac
2719*4882a593Smuzhiyun  ;;
2720*4882a593Smuzhiyun
2721*4882a593Smuzhiyunhaiku*)
2722*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2723*4882a593Smuzhiyun  need_lib_prefix=no
2724*4882a593Smuzhiyun  need_version=no
2725*4882a593Smuzhiyun  dynamic_linker="$host_os runtime_loader"
2726*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2727*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2728*4882a593Smuzhiyun  shlibpath_var=LIBRARY_PATH
2729*4882a593Smuzhiyun  shlibpath_overrides_runpath=no
2730*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2731*4882a593Smuzhiyun  hardcode_into_libs=yes
2732*4882a593Smuzhiyun  ;;
2733*4882a593Smuzhiyun
2734*4882a593Smuzhiyunhpux9* | hpux10* | hpux11*)
2735*4882a593Smuzhiyun  # Give a soname corresponding to the major version so that dld.sl refuses to
2736*4882a593Smuzhiyun  # link against other versions.
2737*4882a593Smuzhiyun  version_type=sunos
2738*4882a593Smuzhiyun  need_lib_prefix=no
2739*4882a593Smuzhiyun  need_version=no
2740*4882a593Smuzhiyun  case $host_cpu in
2741*4882a593Smuzhiyun  ia64*)
2742*4882a593Smuzhiyun    shrext_cmds='.so'
2743*4882a593Smuzhiyun    hardcode_into_libs=yes
2744*4882a593Smuzhiyun    dynamic_linker="$host_os dld.so"
2745*4882a593Smuzhiyun    shlibpath_var=LD_LIBRARY_PATH
2746*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2747*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2748*4882a593Smuzhiyun    soname_spec='$libname$release$shared_ext$major'
2749*4882a593Smuzhiyun    if test 32 = "$HPUX_IA64_MODE"; then
2750*4882a593Smuzhiyun      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2751*4882a593Smuzhiyun      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2752*4882a593Smuzhiyun    else
2753*4882a593Smuzhiyun      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2754*4882a593Smuzhiyun      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2755*4882a593Smuzhiyun    fi
2756*4882a593Smuzhiyun    ;;
2757*4882a593Smuzhiyun  hppa*64*)
2758*4882a593Smuzhiyun    shrext_cmds='.sl'
2759*4882a593Smuzhiyun    hardcode_into_libs=yes
2760*4882a593Smuzhiyun    dynamic_linker="$host_os dld.sl"
2761*4882a593Smuzhiyun    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2762*4882a593Smuzhiyun    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2763*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2764*4882a593Smuzhiyun    soname_spec='$libname$release$shared_ext$major'
2765*4882a593Smuzhiyun    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2766*4882a593Smuzhiyun    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2767*4882a593Smuzhiyun    ;;
2768*4882a593Smuzhiyun  *)
2769*4882a593Smuzhiyun    shrext_cmds='.sl'
2770*4882a593Smuzhiyun    dynamic_linker="$host_os dld.sl"
2771*4882a593Smuzhiyun    shlibpath_var=SHLIB_PATH
2772*4882a593Smuzhiyun    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2773*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2774*4882a593Smuzhiyun    soname_spec='$libname$release$shared_ext$major'
2775*4882a593Smuzhiyun    ;;
2776*4882a593Smuzhiyun  esac
2777*4882a593Smuzhiyun  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2778*4882a593Smuzhiyun  postinstall_cmds='chmod 555 $lib'
2779*4882a593Smuzhiyun  # or fails outright, so override atomically:
2780*4882a593Smuzhiyun  install_override_mode=555
2781*4882a593Smuzhiyun  ;;
2782*4882a593Smuzhiyun
2783*4882a593Smuzhiyuninterix[[3-9]]*)
2784*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2785*4882a593Smuzhiyun  need_lib_prefix=no
2786*4882a593Smuzhiyun  need_version=no
2787*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2788*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2789*4882a593Smuzhiyun  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2790*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2791*4882a593Smuzhiyun  shlibpath_overrides_runpath=no
2792*4882a593Smuzhiyun  hardcode_into_libs=yes
2793*4882a593Smuzhiyun  ;;
2794*4882a593Smuzhiyun
2795*4882a593Smuzhiyunirix5* | irix6* | nonstopux*)
2796*4882a593Smuzhiyun  case $host_os in
2797*4882a593Smuzhiyun    nonstopux*) version_type=nonstopux ;;
2798*4882a593Smuzhiyun    *)
2799*4882a593Smuzhiyun	if test yes = "$lt_cv_prog_gnu_ld"; then
2800*4882a593Smuzhiyun		version_type=linux # correct to gnu/linux during the next big refactor
2801*4882a593Smuzhiyun	else
2802*4882a593Smuzhiyun		version_type=irix
2803*4882a593Smuzhiyun	fi ;;
2804*4882a593Smuzhiyun  esac
2805*4882a593Smuzhiyun  need_lib_prefix=no
2806*4882a593Smuzhiyun  need_version=no
2807*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2808*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2809*4882a593Smuzhiyun  case $host_os in
2810*4882a593Smuzhiyun  irix5* | nonstopux*)
2811*4882a593Smuzhiyun    libsuff= shlibsuff=
2812*4882a593Smuzhiyun    ;;
2813*4882a593Smuzhiyun  *)
2814*4882a593Smuzhiyun    case $LD in # libtool.m4 will add one of these switches to LD
2815*4882a593Smuzhiyun    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2816*4882a593Smuzhiyun      libsuff= shlibsuff= libmagic=32-bit;;
2817*4882a593Smuzhiyun    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2818*4882a593Smuzhiyun      libsuff=32 shlibsuff=N32 libmagic=N32;;
2819*4882a593Smuzhiyun    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2820*4882a593Smuzhiyun      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2821*4882a593Smuzhiyun    *) libsuff= shlibsuff= libmagic=never-match;;
2822*4882a593Smuzhiyun    esac
2823*4882a593Smuzhiyun    ;;
2824*4882a593Smuzhiyun  esac
2825*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2826*4882a593Smuzhiyun  shlibpath_overrides_runpath=no
2827*4882a593Smuzhiyun  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2828*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2829*4882a593Smuzhiyun  hardcode_into_libs=yes
2830*4882a593Smuzhiyun  ;;
2831*4882a593Smuzhiyun
2832*4882a593Smuzhiyun# No shared lib support for Linux oldld, aout, or coff.
2833*4882a593Smuzhiyunlinux*oldld* | linux*aout* | linux*coff*)
2834*4882a593Smuzhiyun  dynamic_linker=no
2835*4882a593Smuzhiyun  ;;
2836*4882a593Smuzhiyun
2837*4882a593Smuzhiyunlinux*android*)
2838*4882a593Smuzhiyun  version_type=none # Android doesn't support versioned libraries.
2839*4882a593Smuzhiyun  need_lib_prefix=no
2840*4882a593Smuzhiyun  need_version=no
2841*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext'
2842*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext'
2843*4882a593Smuzhiyun  finish_cmds=
2844*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2845*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
2846*4882a593Smuzhiyun
2847*4882a593Smuzhiyun  # This implies no fast_install, which is unacceptable.
2848*4882a593Smuzhiyun  # Some rework will be needed to allow for fast_install
2849*4882a593Smuzhiyun  # before this can be enabled.
2850*4882a593Smuzhiyun  hardcode_into_libs=yes
2851*4882a593Smuzhiyun
2852*4882a593Smuzhiyun  dynamic_linker='Android linker'
2853*4882a593Smuzhiyun  # Don't embed -rpath directories since the linker doesn't support them.
2854*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2855*4882a593Smuzhiyun  ;;
2856*4882a593Smuzhiyun
2857*4882a593Smuzhiyun# This must be glibc/ELF.
2858*4882a593Smuzhiyunlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2859*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2860*4882a593Smuzhiyun  need_lib_prefix=no
2861*4882a593Smuzhiyun  need_version=no
2862*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2863*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2864*4882a593Smuzhiyun  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2865*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2866*4882a593Smuzhiyun  shlibpath_overrides_runpath=no
2867*4882a593Smuzhiyun
2868*4882a593Smuzhiyun  # Some binutils ld are patched to set DT_RUNPATH
2869*4882a593Smuzhiyun  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2870*4882a593Smuzhiyun    [lt_cv_shlibpath_overrides_runpath=no
2871*4882a593Smuzhiyun    save_LDFLAGS=$LDFLAGS
2872*4882a593Smuzhiyun    save_libdir=$libdir
2873*4882a593Smuzhiyun    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2874*4882a593Smuzhiyun	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2875*4882a593Smuzhiyun    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2876*4882a593Smuzhiyun      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2877*4882a593Smuzhiyun	 [lt_cv_shlibpath_overrides_runpath=yes])])
2878*4882a593Smuzhiyun    LDFLAGS=$save_LDFLAGS
2879*4882a593Smuzhiyun    libdir=$save_libdir
2880*4882a593Smuzhiyun    ])
2881*4882a593Smuzhiyun  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2882*4882a593Smuzhiyun
2883*4882a593Smuzhiyun  # This implies no fast_install, which is unacceptable.
2884*4882a593Smuzhiyun  # Some rework will be needed to allow for fast_install
2885*4882a593Smuzhiyun  # before this can be enabled.
2886*4882a593Smuzhiyun  hardcode_into_libs=yes
2887*4882a593Smuzhiyun
2888*4882a593Smuzhiyun  # Ideally, we could use ldconfig to report *all* directores which are
2889*4882a593Smuzhiyun  # searched for libraries, however this is still not possible.  Aside from not
2890*4882a593Smuzhiyun  # being certain /sbin/ldconfig is available, command
2891*4882a593Smuzhiyun  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2892*4882a593Smuzhiyun  # even though it is searched at run-time.  Try to do the best guess by
2893*4882a593Smuzhiyun  # appending ld.so.conf contents (and includes) to the search path.
2894*4882a593Smuzhiyun  if test -f /etc/ld.so.conf; then
2895*4882a593Smuzhiyun    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2896*4882a593Smuzhiyun    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2897*4882a593Smuzhiyun  fi
2898*4882a593Smuzhiyun
2899*4882a593Smuzhiyun  # We used to test for /lib/ld.so.1 and disable shared libraries on
2900*4882a593Smuzhiyun  # powerpc, because MkLinux only supported shared libraries with the
2901*4882a593Smuzhiyun  # GNU dynamic linker.  Since this was broken with cross compilers,
2902*4882a593Smuzhiyun  # most powerpc-linux boxes support dynamic linking these days and
2903*4882a593Smuzhiyun  # people can always --disable-shared, the test was removed, and we
2904*4882a593Smuzhiyun  # assume the GNU/Linux dynamic linker is in use.
2905*4882a593Smuzhiyun  dynamic_linker='GNU/Linux ld.so'
2906*4882a593Smuzhiyun  ;;
2907*4882a593Smuzhiyun
2908*4882a593Smuzhiyunnetbsd*)
2909*4882a593Smuzhiyun  version_type=sunos
2910*4882a593Smuzhiyun  need_lib_prefix=no
2911*4882a593Smuzhiyun  need_version=no
2912*4882a593Smuzhiyun  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2913*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2914*4882a593Smuzhiyun    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2915*4882a593Smuzhiyun    dynamic_linker='NetBSD (a.out) ld.so'
2916*4882a593Smuzhiyun  else
2917*4882a593Smuzhiyun    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2918*4882a593Smuzhiyun    soname_spec='$libname$release$shared_ext$major'
2919*4882a593Smuzhiyun    dynamic_linker='NetBSD ld.elf_so'
2920*4882a593Smuzhiyun  fi
2921*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2922*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
2923*4882a593Smuzhiyun  hardcode_into_libs=yes
2924*4882a593Smuzhiyun  ;;
2925*4882a593Smuzhiyun
2926*4882a593Smuzhiyunnewsos6)
2927*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
2928*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2929*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2930*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
2931*4882a593Smuzhiyun  ;;
2932*4882a593Smuzhiyun
2933*4882a593Smuzhiyun*nto* | *qnx*)
2934*4882a593Smuzhiyun  version_type=qnx
2935*4882a593Smuzhiyun  need_lib_prefix=no
2936*4882a593Smuzhiyun  need_version=no
2937*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2938*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2939*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2940*4882a593Smuzhiyun  shlibpath_overrides_runpath=no
2941*4882a593Smuzhiyun  hardcode_into_libs=yes
2942*4882a593Smuzhiyun  dynamic_linker='ldqnx.so'
2943*4882a593Smuzhiyun  ;;
2944*4882a593Smuzhiyun
2945*4882a593Smuzhiyunopenbsd* | bitrig*)
2946*4882a593Smuzhiyun  version_type=sunos
2947*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec=/usr/lib
2948*4882a593Smuzhiyun  need_lib_prefix=no
2949*4882a593Smuzhiyun  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2950*4882a593Smuzhiyun    need_version=no
2951*4882a593Smuzhiyun  else
2952*4882a593Smuzhiyun    need_version=yes
2953*4882a593Smuzhiyun  fi
2954*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2955*4882a593Smuzhiyun  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2956*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2957*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
2958*4882a593Smuzhiyun  ;;
2959*4882a593Smuzhiyun
2960*4882a593Smuzhiyunos2*)
2961*4882a593Smuzhiyun  libname_spec='$name'
2962*4882a593Smuzhiyun  version_type=windows
2963*4882a593Smuzhiyun  shrext_cmds=.dll
2964*4882a593Smuzhiyun  need_version=no
2965*4882a593Smuzhiyun  need_lib_prefix=no
2966*4882a593Smuzhiyun  # OS/2 can only load a DLL with a base name of 8 characters or less.
2967*4882a593Smuzhiyun  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2968*4882a593Smuzhiyun    v=$($ECHO $release$versuffix | tr -d .-);
2969*4882a593Smuzhiyun    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2970*4882a593Smuzhiyun    $ECHO $n$v`$shared_ext'
2971*4882a593Smuzhiyun  library_names_spec='${libname}_dll.$libext'
2972*4882a593Smuzhiyun  dynamic_linker='OS/2 ld.exe'
2973*4882a593Smuzhiyun  shlibpath_var=BEGINLIBPATH
2974*4882a593Smuzhiyun  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2975*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2976*4882a593Smuzhiyun  postinstall_cmds='base_file=`basename \$file`~
2977*4882a593Smuzhiyun    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2978*4882a593Smuzhiyun    dldir=$destdir/`dirname \$dlpath`~
2979*4882a593Smuzhiyun    test -d \$dldir || mkdir -p \$dldir~
2980*4882a593Smuzhiyun    $install_prog $dir/$dlname \$dldir/$dlname~
2981*4882a593Smuzhiyun    chmod a+x \$dldir/$dlname~
2982*4882a593Smuzhiyun    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2983*4882a593Smuzhiyun      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2984*4882a593Smuzhiyun    fi'
2985*4882a593Smuzhiyun  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2986*4882a593Smuzhiyun    dlpath=$dir/\$dldll~
2987*4882a593Smuzhiyun    $RM \$dlpath'
2988*4882a593Smuzhiyun  ;;
2989*4882a593Smuzhiyun
2990*4882a593Smuzhiyunosf3* | osf4* | osf5*)
2991*4882a593Smuzhiyun  version_type=osf
2992*4882a593Smuzhiyun  need_lib_prefix=no
2993*4882a593Smuzhiyun  need_version=no
2994*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
2995*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2996*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
2997*4882a593Smuzhiyun  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2998*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2999*4882a593Smuzhiyun  ;;
3000*4882a593Smuzhiyun
3001*4882a593Smuzhiyunrdos*)
3002*4882a593Smuzhiyun  dynamic_linker=no
3003*4882a593Smuzhiyun  ;;
3004*4882a593Smuzhiyun
3005*4882a593Smuzhiyunsolaris*)
3006*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
3007*4882a593Smuzhiyun  need_lib_prefix=no
3008*4882a593Smuzhiyun  need_version=no
3009*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3010*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
3011*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
3012*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
3013*4882a593Smuzhiyun  hardcode_into_libs=yes
3014*4882a593Smuzhiyun  # ldd complains unless libraries are executable
3015*4882a593Smuzhiyun  postinstall_cmds='chmod +x $lib'
3016*4882a593Smuzhiyun  ;;
3017*4882a593Smuzhiyun
3018*4882a593Smuzhiyunsunos4*)
3019*4882a593Smuzhiyun  version_type=sunos
3020*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3021*4882a593Smuzhiyun  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3022*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
3023*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
3024*4882a593Smuzhiyun  if test yes = "$with_gnu_ld"; then
3025*4882a593Smuzhiyun    need_lib_prefix=no
3026*4882a593Smuzhiyun  fi
3027*4882a593Smuzhiyun  need_version=yes
3028*4882a593Smuzhiyun  ;;
3029*4882a593Smuzhiyun
3030*4882a593Smuzhiyunsysv4 | sysv4.3*)
3031*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
3032*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3033*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
3034*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
3035*4882a593Smuzhiyun  case $host_vendor in
3036*4882a593Smuzhiyun    sni)
3037*4882a593Smuzhiyun      shlibpath_overrides_runpath=no
3038*4882a593Smuzhiyun      need_lib_prefix=no
3039*4882a593Smuzhiyun      runpath_var=LD_RUN_PATH
3040*4882a593Smuzhiyun      ;;
3041*4882a593Smuzhiyun    siemens)
3042*4882a593Smuzhiyun      need_lib_prefix=no
3043*4882a593Smuzhiyun      ;;
3044*4882a593Smuzhiyun    motorola)
3045*4882a593Smuzhiyun      need_lib_prefix=no
3046*4882a593Smuzhiyun      need_version=no
3047*4882a593Smuzhiyun      shlibpath_overrides_runpath=no
3048*4882a593Smuzhiyun      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3049*4882a593Smuzhiyun      ;;
3050*4882a593Smuzhiyun  esac
3051*4882a593Smuzhiyun  ;;
3052*4882a593Smuzhiyun
3053*4882a593Smuzhiyunsysv4*MP*)
3054*4882a593Smuzhiyun  if test -d /usr/nec; then
3055*4882a593Smuzhiyun    version_type=linux # correct to gnu/linux during the next big refactor
3056*4882a593Smuzhiyun    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3057*4882a593Smuzhiyun    soname_spec='$libname$shared_ext.$major'
3058*4882a593Smuzhiyun    shlibpath_var=LD_LIBRARY_PATH
3059*4882a593Smuzhiyun  fi
3060*4882a593Smuzhiyun  ;;
3061*4882a593Smuzhiyun
3062*4882a593Smuzhiyunsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3063*4882a593Smuzhiyun  version_type=sco
3064*4882a593Smuzhiyun  need_lib_prefix=no
3065*4882a593Smuzhiyun  need_version=no
3066*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3067*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
3068*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
3069*4882a593Smuzhiyun  shlibpath_overrides_runpath=yes
3070*4882a593Smuzhiyun  hardcode_into_libs=yes
3071*4882a593Smuzhiyun  if test yes = "$with_gnu_ld"; then
3072*4882a593Smuzhiyun    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3073*4882a593Smuzhiyun  else
3074*4882a593Smuzhiyun    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3075*4882a593Smuzhiyun    case $host_os in
3076*4882a593Smuzhiyun      sco3.2v5*)
3077*4882a593Smuzhiyun        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3078*4882a593Smuzhiyun	;;
3079*4882a593Smuzhiyun    esac
3080*4882a593Smuzhiyun  fi
3081*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec='/usr/lib'
3082*4882a593Smuzhiyun  ;;
3083*4882a593Smuzhiyun
3084*4882a593Smuzhiyuntpf*)
3085*4882a593Smuzhiyun  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3086*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
3087*4882a593Smuzhiyun  need_lib_prefix=no
3088*4882a593Smuzhiyun  need_version=no
3089*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3090*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
3091*4882a593Smuzhiyun  shlibpath_overrides_runpath=no
3092*4882a593Smuzhiyun  hardcode_into_libs=yes
3093*4882a593Smuzhiyun  ;;
3094*4882a593Smuzhiyun
3095*4882a593Smuzhiyunuts4*)
3096*4882a593Smuzhiyun  version_type=linux # correct to gnu/linux during the next big refactor
3097*4882a593Smuzhiyun  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3098*4882a593Smuzhiyun  soname_spec='$libname$release$shared_ext$major'
3099*4882a593Smuzhiyun  shlibpath_var=LD_LIBRARY_PATH
3100*4882a593Smuzhiyun  ;;
3101*4882a593Smuzhiyun
3102*4882a593Smuzhiyun*)
3103*4882a593Smuzhiyun  dynamic_linker=no
3104*4882a593Smuzhiyun  ;;
3105*4882a593Smuzhiyunesac
3106*4882a593SmuzhiyunAC_MSG_RESULT([$dynamic_linker])
3107*4882a593Smuzhiyuntest no = "$dynamic_linker" && can_build_shared=no
3108*4882a593Smuzhiyun
3109*4882a593Smuzhiyunvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3110*4882a593Smuzhiyunif test yes = "$GCC"; then
3111*4882a593Smuzhiyun  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3112*4882a593Smuzhiyunfi
3113*4882a593Smuzhiyun
3114*4882a593Smuzhiyunif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3115*4882a593Smuzhiyun  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3116*4882a593Smuzhiyunfi
3117*4882a593Smuzhiyun
3118*4882a593Smuzhiyunif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3119*4882a593Smuzhiyun  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3120*4882a593Smuzhiyunfi
3121*4882a593Smuzhiyun
3122*4882a593Smuzhiyun# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3123*4882a593Smuzhiyunconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3124*4882a593Smuzhiyun
3125*4882a593Smuzhiyun# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3126*4882a593Smuzhiyunfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3127*4882a593Smuzhiyun
3128*4882a593Smuzhiyun# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3129*4882a593Smuzhiyunconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3130*4882a593Smuzhiyun
3131*4882a593Smuzhiyun_LT_DECL([], [variables_saved_for_relink], [1],
3132*4882a593Smuzhiyun    [Variables whose values should be saved in libtool wrapper scripts and
3133*4882a593Smuzhiyun    restored at link time])
3134*4882a593Smuzhiyun_LT_DECL([], [need_lib_prefix], [0],
3135*4882a593Smuzhiyun    [Do we need the "lib" prefix for modules?])
3136*4882a593Smuzhiyun_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3137*4882a593Smuzhiyun_LT_DECL([], [version_type], [0], [Library versioning type])
3138*4882a593Smuzhiyun_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3139*4882a593Smuzhiyun_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3140*4882a593Smuzhiyun_LT_DECL([], [shlibpath_overrides_runpath], [0],
3141*4882a593Smuzhiyun    [Is shlibpath searched before the hard-coded library search path?])
3142*4882a593Smuzhiyun_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3143*4882a593Smuzhiyun_LT_DECL([], [library_names_spec], [1],
3144*4882a593Smuzhiyun    [[List of archive names.  First name is the real one, the rest are links.
3145*4882a593Smuzhiyun    The last name is the one that the linker finds with -lNAME]])
3146*4882a593Smuzhiyun_LT_DECL([], [soname_spec], [1],
3147*4882a593Smuzhiyun    [[The coded name of the library, if different from the real name]])
3148*4882a593Smuzhiyun_LT_DECL([], [install_override_mode], [1],
3149*4882a593Smuzhiyun    [Permission mode override for installation of shared libraries])
3150*4882a593Smuzhiyun_LT_DECL([], [postinstall_cmds], [2],
3151*4882a593Smuzhiyun    [Command to use after installation of a shared archive])
3152*4882a593Smuzhiyun_LT_DECL([], [postuninstall_cmds], [2],
3153*4882a593Smuzhiyun    [Command to use after uninstallation of a shared archive])
3154*4882a593Smuzhiyun_LT_DECL([], [finish_cmds], [2],
3155*4882a593Smuzhiyun    [Commands used to finish a libtool library installation in a directory])
3156*4882a593Smuzhiyun_LT_DECL([], [finish_eval], [1],
3157*4882a593Smuzhiyun    [[As "finish_cmds", except a single script fragment to be evaled but
3158*4882a593Smuzhiyun    not shown]])
3159*4882a593Smuzhiyun_LT_DECL([], [hardcode_into_libs], [0],
3160*4882a593Smuzhiyun    [Whether we should hardcode library paths into libraries])
3161*4882a593Smuzhiyun_LT_DECL([], [sys_lib_search_path_spec], [2],
3162*4882a593Smuzhiyun    [Compile-time system search path for libraries])
3163*4882a593Smuzhiyun_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3164*4882a593Smuzhiyun    [Detected run-time system search path for libraries])
3165*4882a593Smuzhiyun_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3166*4882a593Smuzhiyun    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3167*4882a593Smuzhiyun])# _LT_SYS_DYNAMIC_LINKER
3168*4882a593Smuzhiyun
3169*4882a593Smuzhiyun
3170*4882a593Smuzhiyun# _LT_PATH_TOOL_PREFIX(TOOL)
3171*4882a593Smuzhiyun# --------------------------
3172*4882a593Smuzhiyun# find a file program that can recognize shared library
3173*4882a593SmuzhiyunAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3174*4882a593Smuzhiyun[m4_require([_LT_DECL_EGREP])dnl
3175*4882a593SmuzhiyunAC_MSG_CHECKING([for $1])
3176*4882a593SmuzhiyunAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3177*4882a593Smuzhiyun[case $MAGIC_CMD in
3178*4882a593Smuzhiyun[[\\/*] |  ?:[\\/]*])
3179*4882a593Smuzhiyun  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3180*4882a593Smuzhiyun  ;;
3181*4882a593Smuzhiyun*)
3182*4882a593Smuzhiyun  lt_save_MAGIC_CMD=$MAGIC_CMD
3183*4882a593Smuzhiyun  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3184*4882a593Smuzhiyundnl $ac_dummy forces splitting on constant user-supplied paths.
3185*4882a593Smuzhiyundnl POSIX.2 word splitting is done only on the output of word expansions,
3186*4882a593Smuzhiyundnl not every word.  This closes a longstanding sh security hole.
3187*4882a593Smuzhiyun  ac_dummy="m4_if([$2], , $PATH, [$2])"
3188*4882a593Smuzhiyun  for ac_dir in $ac_dummy; do
3189*4882a593Smuzhiyun    IFS=$lt_save_ifs
3190*4882a593Smuzhiyun    test -z "$ac_dir" && ac_dir=.
3191*4882a593Smuzhiyun    if test -f "$ac_dir/$1"; then
3192*4882a593Smuzhiyun      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3193*4882a593Smuzhiyun      if test -n "$file_magic_test_file"; then
3194*4882a593Smuzhiyun	case $deplibs_check_method in
3195*4882a593Smuzhiyun	"file_magic "*)
3196*4882a593Smuzhiyun	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3197*4882a593Smuzhiyun	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3198*4882a593Smuzhiyun	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3199*4882a593Smuzhiyun	    $EGREP "$file_magic_regex" > /dev/null; then
3200*4882a593Smuzhiyun	    :
3201*4882a593Smuzhiyun	  else
3202*4882a593Smuzhiyun	    cat <<_LT_EOF 1>&2
3203*4882a593Smuzhiyun
3204*4882a593Smuzhiyun*** Warning: the command libtool uses to detect shared libraries,
3205*4882a593Smuzhiyun*** $file_magic_cmd, produces output that libtool cannot recognize.
3206*4882a593Smuzhiyun*** The result is that libtool may fail to recognize shared libraries
3207*4882a593Smuzhiyun*** as such.  This will affect the creation of libtool libraries that
3208*4882a593Smuzhiyun*** depend on shared libraries, but programs linked with such libtool
3209*4882a593Smuzhiyun*** libraries will work regardless of this problem.  Nevertheless, you
3210*4882a593Smuzhiyun*** may want to report the problem to your system manager and/or to
3211*4882a593Smuzhiyun*** bug-libtool@gnu.org
3212*4882a593Smuzhiyun
3213*4882a593Smuzhiyun_LT_EOF
3214*4882a593Smuzhiyun	  fi ;;
3215*4882a593Smuzhiyun	esac
3216*4882a593Smuzhiyun      fi
3217*4882a593Smuzhiyun      break
3218*4882a593Smuzhiyun    fi
3219*4882a593Smuzhiyun  done
3220*4882a593Smuzhiyun  IFS=$lt_save_ifs
3221*4882a593Smuzhiyun  MAGIC_CMD=$lt_save_MAGIC_CMD
3222*4882a593Smuzhiyun  ;;
3223*4882a593Smuzhiyunesac])
3224*4882a593SmuzhiyunMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3225*4882a593Smuzhiyunif test -n "$MAGIC_CMD"; then
3226*4882a593Smuzhiyun  AC_MSG_RESULT($MAGIC_CMD)
3227*4882a593Smuzhiyunelse
3228*4882a593Smuzhiyun  AC_MSG_RESULT(no)
3229*4882a593Smuzhiyunfi
3230*4882a593Smuzhiyun_LT_DECL([], [MAGIC_CMD], [0],
3231*4882a593Smuzhiyun	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3232*4882a593Smuzhiyun])# _LT_PATH_TOOL_PREFIX
3233*4882a593Smuzhiyun
3234*4882a593Smuzhiyun# Old name:
3235*4882a593SmuzhiyunAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3236*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
3237*4882a593Smuzhiyundnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3238*4882a593Smuzhiyun
3239*4882a593Smuzhiyun
3240*4882a593Smuzhiyun# _LT_PATH_MAGIC
3241*4882a593Smuzhiyun# --------------
3242*4882a593Smuzhiyun# find a file program that can recognize a shared library
3243*4882a593Smuzhiyunm4_defun([_LT_PATH_MAGIC],
3244*4882a593Smuzhiyun[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3245*4882a593Smuzhiyunif test -z "$lt_cv_path_MAGIC_CMD"; then
3246*4882a593Smuzhiyun  if test -n "$ac_tool_prefix"; then
3247*4882a593Smuzhiyun    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3248*4882a593Smuzhiyun  else
3249*4882a593Smuzhiyun    MAGIC_CMD=:
3250*4882a593Smuzhiyun  fi
3251*4882a593Smuzhiyunfi
3252*4882a593Smuzhiyun])# _LT_PATH_MAGIC
3253*4882a593Smuzhiyun
3254*4882a593Smuzhiyun
3255*4882a593Smuzhiyun# LT_PATH_LD
3256*4882a593Smuzhiyun# ----------
3257*4882a593Smuzhiyun# find the pathname to the GNU or non-GNU linker
3258*4882a593SmuzhiyunAC_DEFUN([LT_PATH_LD],
3259*4882a593Smuzhiyun[AC_REQUIRE([AC_PROG_CC])dnl
3260*4882a593SmuzhiyunAC_REQUIRE([AC_CANONICAL_HOST])dnl
3261*4882a593SmuzhiyunAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3262*4882a593Smuzhiyunm4_require([_LT_DECL_SED])dnl
3263*4882a593Smuzhiyunm4_require([_LT_DECL_EGREP])dnl
3264*4882a593Smuzhiyunm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3265*4882a593Smuzhiyun
3266*4882a593SmuzhiyunAC_ARG_WITH([gnu-ld],
3267*4882a593Smuzhiyun    [AS_HELP_STRING([--with-gnu-ld],
3268*4882a593Smuzhiyun	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3269*4882a593Smuzhiyun    [test no = "$withval" || with_gnu_ld=yes],
3270*4882a593Smuzhiyun    [with_gnu_ld=no])dnl
3271*4882a593Smuzhiyun
3272*4882a593Smuzhiyunac_prog=ld
3273*4882a593Smuzhiyunif test yes = "$GCC"; then
3274*4882a593Smuzhiyun  # Check if gcc -print-prog-name=ld gives a path.
3275*4882a593Smuzhiyun  AC_MSG_CHECKING([for ld used by $CC])
3276*4882a593Smuzhiyun  case $host in
3277*4882a593Smuzhiyun  *-*-mingw*)
3278*4882a593Smuzhiyun    # gcc leaves a trailing carriage return, which upsets mingw
3279*4882a593Smuzhiyun    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3280*4882a593Smuzhiyun  *)
3281*4882a593Smuzhiyun    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3282*4882a593Smuzhiyun  esac
3283*4882a593Smuzhiyun  case $ac_prog in
3284*4882a593Smuzhiyun    # Accept absolute paths.
3285*4882a593Smuzhiyun    [[\\/]]* | ?:[[\\/]]*)
3286*4882a593Smuzhiyun      re_direlt='/[[^/]][[^/]]*/\.\./'
3287*4882a593Smuzhiyun      # Canonicalize the pathname of ld
3288*4882a593Smuzhiyun      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3289*4882a593Smuzhiyun      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3290*4882a593Smuzhiyun	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3291*4882a593Smuzhiyun      done
3292*4882a593Smuzhiyun      test -z "$LD" && LD=$ac_prog
3293*4882a593Smuzhiyun      ;;
3294*4882a593Smuzhiyun  "")
3295*4882a593Smuzhiyun    # If it fails, then pretend we aren't using GCC.
3296*4882a593Smuzhiyun    ac_prog=ld
3297*4882a593Smuzhiyun    ;;
3298*4882a593Smuzhiyun  *)
3299*4882a593Smuzhiyun    # If it is relative, then search for the first ld in PATH.
3300*4882a593Smuzhiyun    with_gnu_ld=unknown
3301*4882a593Smuzhiyun    ;;
3302*4882a593Smuzhiyun  esac
3303*4882a593Smuzhiyunelif test yes = "$with_gnu_ld"; then
3304*4882a593Smuzhiyun  AC_MSG_CHECKING([for GNU ld])
3305*4882a593Smuzhiyunelse
3306*4882a593Smuzhiyun  AC_MSG_CHECKING([for non-GNU ld])
3307*4882a593Smuzhiyunfi
3308*4882a593SmuzhiyunAC_CACHE_VAL(lt_cv_path_LD,
3309*4882a593Smuzhiyun[if test -z "$LD"; then
3310*4882a593Smuzhiyun  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3311*4882a593Smuzhiyun  for ac_dir in $PATH; do
3312*4882a593Smuzhiyun    IFS=$lt_save_ifs
3313*4882a593Smuzhiyun    test -z "$ac_dir" && ac_dir=.
3314*4882a593Smuzhiyun    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3315*4882a593Smuzhiyun      lt_cv_path_LD=$ac_dir/$ac_prog
3316*4882a593Smuzhiyun      # Check to see if the program is GNU ld.  I'd rather use --version,
3317*4882a593Smuzhiyun      # but apparently some variants of GNU ld only accept -v.
3318*4882a593Smuzhiyun      # Break only if it was the GNU/non-GNU ld that we prefer.
3319*4882a593Smuzhiyun      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3320*4882a593Smuzhiyun      *GNU* | *'with BFD'*)
3321*4882a593Smuzhiyun	test no != "$with_gnu_ld" && break
3322*4882a593Smuzhiyun	;;
3323*4882a593Smuzhiyun      *)
3324*4882a593Smuzhiyun	test yes != "$with_gnu_ld" && break
3325*4882a593Smuzhiyun	;;
3326*4882a593Smuzhiyun      esac
3327*4882a593Smuzhiyun    fi
3328*4882a593Smuzhiyun  done
3329*4882a593Smuzhiyun  IFS=$lt_save_ifs
3330*4882a593Smuzhiyunelse
3331*4882a593Smuzhiyun  lt_cv_path_LD=$LD # Let the user override the test with a path.
3332*4882a593Smuzhiyunfi])
3333*4882a593SmuzhiyunLD=$lt_cv_path_LD
3334*4882a593Smuzhiyunif test -n "$LD"; then
3335*4882a593Smuzhiyun  AC_MSG_RESULT($LD)
3336*4882a593Smuzhiyunelse
3337*4882a593Smuzhiyun  AC_MSG_RESULT(no)
3338*4882a593Smuzhiyunfi
3339*4882a593Smuzhiyuntest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3340*4882a593Smuzhiyun_LT_PATH_LD_GNU
3341*4882a593SmuzhiyunAC_SUBST([LD])
3342*4882a593Smuzhiyun
3343*4882a593Smuzhiyun_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3344*4882a593Smuzhiyun])# LT_PATH_LD
3345*4882a593Smuzhiyun
3346*4882a593Smuzhiyun# Old names:
3347*4882a593SmuzhiyunAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3348*4882a593SmuzhiyunAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3349*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
3350*4882a593Smuzhiyundnl AC_DEFUN([AM_PROG_LD], [])
3351*4882a593Smuzhiyundnl AC_DEFUN([AC_PROG_LD], [])
3352*4882a593Smuzhiyun
3353*4882a593Smuzhiyun
3354*4882a593Smuzhiyun# _LT_PATH_LD_GNU
3355*4882a593Smuzhiyun#- --------------
3356*4882a593Smuzhiyunm4_defun([_LT_PATH_LD_GNU],
3357*4882a593Smuzhiyun[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3358*4882a593Smuzhiyun[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3359*4882a593Smuzhiyuncase `$LD -v 2>&1 </dev/null` in
3360*4882a593Smuzhiyun*GNU* | *'with BFD'*)
3361*4882a593Smuzhiyun  lt_cv_prog_gnu_ld=yes
3362*4882a593Smuzhiyun  ;;
3363*4882a593Smuzhiyun*)
3364*4882a593Smuzhiyun  lt_cv_prog_gnu_ld=no
3365*4882a593Smuzhiyun  ;;
3366*4882a593Smuzhiyunesac])
3367*4882a593Smuzhiyunwith_gnu_ld=$lt_cv_prog_gnu_ld
3368*4882a593Smuzhiyun])# _LT_PATH_LD_GNU
3369*4882a593Smuzhiyun
3370*4882a593Smuzhiyun
3371*4882a593Smuzhiyun# _LT_CMD_RELOAD
3372*4882a593Smuzhiyun# --------------
3373*4882a593Smuzhiyun# find reload flag for linker
3374*4882a593Smuzhiyun#   -- PORTME Some linkers may need a different reload flag.
3375*4882a593Smuzhiyunm4_defun([_LT_CMD_RELOAD],
3376*4882a593Smuzhiyun[AC_CACHE_CHECK([for $LD option to reload object files],
3377*4882a593Smuzhiyun  lt_cv_ld_reload_flag,
3378*4882a593Smuzhiyun  [lt_cv_ld_reload_flag='-r'])
3379*4882a593Smuzhiyunreload_flag=$lt_cv_ld_reload_flag
3380*4882a593Smuzhiyuncase $reload_flag in
3381*4882a593Smuzhiyun"" | " "*) ;;
3382*4882a593Smuzhiyun*) reload_flag=" $reload_flag" ;;
3383*4882a593Smuzhiyunesac
3384*4882a593Smuzhiyunreload_cmds='$LD$reload_flag -o $output$reload_objs'
3385*4882a593Smuzhiyuncase $host_os in
3386*4882a593Smuzhiyun  cygwin* | mingw* | pw32* | cegcc*)
3387*4882a593Smuzhiyun    if test yes != "$GCC"; then
3388*4882a593Smuzhiyun      reload_cmds=false
3389*4882a593Smuzhiyun    fi
3390*4882a593Smuzhiyun    ;;
3391*4882a593Smuzhiyun  darwin*)
3392*4882a593Smuzhiyun    if test yes = "$GCC"; then
3393*4882a593Smuzhiyun      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3394*4882a593Smuzhiyun    else
3395*4882a593Smuzhiyun      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3396*4882a593Smuzhiyun    fi
3397*4882a593Smuzhiyun    ;;
3398*4882a593Smuzhiyunesac
3399*4882a593Smuzhiyun_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3400*4882a593Smuzhiyun_LT_TAGDECL([], [reload_cmds], [2])dnl
3401*4882a593Smuzhiyun])# _LT_CMD_RELOAD
3402*4882a593Smuzhiyun
3403*4882a593Smuzhiyun
3404*4882a593Smuzhiyun# _LT_PATH_DD
3405*4882a593Smuzhiyun# -----------
3406*4882a593Smuzhiyun# find a working dd
3407*4882a593Smuzhiyunm4_defun([_LT_PATH_DD],
3408*4882a593Smuzhiyun[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3409*4882a593Smuzhiyun[printf 0123456789abcdef0123456789abcdef >conftest.i
3410*4882a593Smuzhiyuncat conftest.i conftest.i >conftest2.i
3411*4882a593Smuzhiyun: ${lt_DD:=$DD}
3412*4882a593SmuzhiyunAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3413*4882a593Smuzhiyun[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3414*4882a593Smuzhiyun  cmp -s conftest.i conftest.out \
3415*4882a593Smuzhiyun  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3416*4882a593Smuzhiyunfi])
3417*4882a593Smuzhiyunrm -f conftest.i conftest2.i conftest.out])
3418*4882a593Smuzhiyun])# _LT_PATH_DD
3419*4882a593Smuzhiyun
3420*4882a593Smuzhiyun
3421*4882a593Smuzhiyun# _LT_CMD_TRUNCATE
3422*4882a593Smuzhiyun# ----------------
3423*4882a593Smuzhiyun# find command to truncate a binary pipe
3424*4882a593Smuzhiyunm4_defun([_LT_CMD_TRUNCATE],
3425*4882a593Smuzhiyun[m4_require([_LT_PATH_DD])
3426*4882a593SmuzhiyunAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3427*4882a593Smuzhiyun[printf 0123456789abcdef0123456789abcdef >conftest.i
3428*4882a593Smuzhiyuncat conftest.i conftest.i >conftest2.i
3429*4882a593Smuzhiyunlt_cv_truncate_bin=
3430*4882a593Smuzhiyunif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3431*4882a593Smuzhiyun  cmp -s conftest.i conftest.out \
3432*4882a593Smuzhiyun  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3433*4882a593Smuzhiyunfi
3434*4882a593Smuzhiyunrm -f conftest.i conftest2.i conftest.out
3435*4882a593Smuzhiyuntest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3436*4882a593Smuzhiyun_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3437*4882a593Smuzhiyun  [Command to truncate a binary pipe])
3438*4882a593Smuzhiyun])# _LT_CMD_TRUNCATE
3439*4882a593Smuzhiyun
3440*4882a593Smuzhiyun
3441*4882a593Smuzhiyun# _LT_CHECK_MAGIC_METHOD
3442*4882a593Smuzhiyun# ----------------------
3443*4882a593Smuzhiyun# how to check for library dependencies
3444*4882a593Smuzhiyun#  -- PORTME fill in with the dynamic library characteristics
3445*4882a593Smuzhiyunm4_defun([_LT_CHECK_MAGIC_METHOD],
3446*4882a593Smuzhiyun[m4_require([_LT_DECL_EGREP])
3447*4882a593Smuzhiyunm4_require([_LT_DECL_OBJDUMP])
3448*4882a593SmuzhiyunAC_CACHE_CHECK([how to recognize dependent libraries],
3449*4882a593Smuzhiyunlt_cv_deplibs_check_method,
3450*4882a593Smuzhiyun[lt_cv_file_magic_cmd='$MAGIC_CMD'
3451*4882a593Smuzhiyunlt_cv_file_magic_test_file=
3452*4882a593Smuzhiyunlt_cv_deplibs_check_method='unknown'
3453*4882a593Smuzhiyun# Need to set the preceding variable on all platforms that support
3454*4882a593Smuzhiyun# interlibrary dependencies.
3455*4882a593Smuzhiyun# 'none' -- dependencies not supported.
3456*4882a593Smuzhiyun# 'unknown' -- same as none, but documents that we really don't know.
3457*4882a593Smuzhiyun# 'pass_all' -- all dependencies passed with no checks.
3458*4882a593Smuzhiyun# 'test_compile' -- check by making test program.
3459*4882a593Smuzhiyun# 'file_magic [[regex]]' -- check by looking for files in library path
3460*4882a593Smuzhiyun# that responds to the $file_magic_cmd with a given extended regex.
3461*4882a593Smuzhiyun# If you have 'file' or equivalent on your system and you're not sure
3462*4882a593Smuzhiyun# whether 'pass_all' will *always* work, you probably want this one.
3463*4882a593Smuzhiyun
3464*4882a593Smuzhiyuncase $host_os in
3465*4882a593Smuzhiyunaix[[4-9]]*)
3466*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3467*4882a593Smuzhiyun  ;;
3468*4882a593Smuzhiyun
3469*4882a593Smuzhiyunbeos*)
3470*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3471*4882a593Smuzhiyun  ;;
3472*4882a593Smuzhiyun
3473*4882a593Smuzhiyunbsdi[[45]]*)
3474*4882a593Smuzhiyun  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3475*4882a593Smuzhiyun  lt_cv_file_magic_cmd='/usr/bin/file -L'
3476*4882a593Smuzhiyun  lt_cv_file_magic_test_file=/shlib/libc.so
3477*4882a593Smuzhiyun  ;;
3478*4882a593Smuzhiyun
3479*4882a593Smuzhiyuncygwin*)
3480*4882a593Smuzhiyun  # func_win32_libid is a shell function defined in ltmain.sh
3481*4882a593Smuzhiyun  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3482*4882a593Smuzhiyun  lt_cv_file_magic_cmd='func_win32_libid'
3483*4882a593Smuzhiyun  ;;
3484*4882a593Smuzhiyun
3485*4882a593Smuzhiyunmingw* | pw32*)
3486*4882a593Smuzhiyun  # Base MSYS/MinGW do not provide the 'file' command needed by
3487*4882a593Smuzhiyun  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3488*4882a593Smuzhiyun  # unless we find 'file', for example because we are cross-compiling.
3489*4882a593Smuzhiyun  if ( file / ) >/dev/null 2>&1; then
3490*4882a593Smuzhiyun    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3491*4882a593Smuzhiyun    lt_cv_file_magic_cmd='func_win32_libid'
3492*4882a593Smuzhiyun  else
3493*4882a593Smuzhiyun    # Keep this pattern in sync with the one in func_win32_libid.
3494*4882a593Smuzhiyun    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3495*4882a593Smuzhiyun    lt_cv_file_magic_cmd='$OBJDUMP -f'
3496*4882a593Smuzhiyun  fi
3497*4882a593Smuzhiyun  ;;
3498*4882a593Smuzhiyun
3499*4882a593Smuzhiyuncegcc*)
3500*4882a593Smuzhiyun  # use the weaker test based on 'objdump'. See mingw*.
3501*4882a593Smuzhiyun  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3502*4882a593Smuzhiyun  lt_cv_file_magic_cmd='$OBJDUMP -f'
3503*4882a593Smuzhiyun  ;;
3504*4882a593Smuzhiyun
3505*4882a593Smuzhiyundarwin* | rhapsody*)
3506*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3507*4882a593Smuzhiyun  ;;
3508*4882a593Smuzhiyun
3509*4882a593Smuzhiyunfreebsd* | dragonfly*)
3510*4882a593Smuzhiyun  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3511*4882a593Smuzhiyun    case $host_cpu in
3512*4882a593Smuzhiyun    i*86 )
3513*4882a593Smuzhiyun      # Not sure whether the presence of OpenBSD here was a mistake.
3514*4882a593Smuzhiyun      # Let's accept both of them until this is cleared up.
3515*4882a593Smuzhiyun      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3516*4882a593Smuzhiyun      lt_cv_file_magic_cmd=/usr/bin/file
3517*4882a593Smuzhiyun      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3518*4882a593Smuzhiyun      ;;
3519*4882a593Smuzhiyun    esac
3520*4882a593Smuzhiyun  else
3521*4882a593Smuzhiyun    lt_cv_deplibs_check_method=pass_all
3522*4882a593Smuzhiyun  fi
3523*4882a593Smuzhiyun  ;;
3524*4882a593Smuzhiyun
3525*4882a593Smuzhiyunhaiku*)
3526*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3527*4882a593Smuzhiyun  ;;
3528*4882a593Smuzhiyun
3529*4882a593Smuzhiyunhpux10.20* | hpux11*)
3530*4882a593Smuzhiyun  lt_cv_file_magic_cmd=/usr/bin/file
3531*4882a593Smuzhiyun  case $host_cpu in
3532*4882a593Smuzhiyun  ia64*)
3533*4882a593Smuzhiyun    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3534*4882a593Smuzhiyun    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3535*4882a593Smuzhiyun    ;;
3536*4882a593Smuzhiyun  hppa*64*)
3537*4882a593Smuzhiyun    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3538*4882a593Smuzhiyun    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3539*4882a593Smuzhiyun    ;;
3540*4882a593Smuzhiyun  *)
3541*4882a593Smuzhiyun    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3542*4882a593Smuzhiyun    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3543*4882a593Smuzhiyun    ;;
3544*4882a593Smuzhiyun  esac
3545*4882a593Smuzhiyun  ;;
3546*4882a593Smuzhiyun
3547*4882a593Smuzhiyuninterix[[3-9]]*)
3548*4882a593Smuzhiyun  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3549*4882a593Smuzhiyun  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3550*4882a593Smuzhiyun  ;;
3551*4882a593Smuzhiyun
3552*4882a593Smuzhiyunirix5* | irix6* | nonstopux*)
3553*4882a593Smuzhiyun  case $LD in
3554*4882a593Smuzhiyun  *-32|*"-32 ") libmagic=32-bit;;
3555*4882a593Smuzhiyun  *-n32|*"-n32 ") libmagic=N32;;
3556*4882a593Smuzhiyun  *-64|*"-64 ") libmagic=64-bit;;
3557*4882a593Smuzhiyun  *) libmagic=never-match;;
3558*4882a593Smuzhiyun  esac
3559*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3560*4882a593Smuzhiyun  ;;
3561*4882a593Smuzhiyun
3562*4882a593Smuzhiyun# This must be glibc/ELF.
3563*4882a593Smuzhiyunlinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3564*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3565*4882a593Smuzhiyun  ;;
3566*4882a593Smuzhiyun
3567*4882a593Smuzhiyunnetbsd*)
3568*4882a593Smuzhiyun  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3569*4882a593Smuzhiyun    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3570*4882a593Smuzhiyun  else
3571*4882a593Smuzhiyun    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3572*4882a593Smuzhiyun  fi
3573*4882a593Smuzhiyun  ;;
3574*4882a593Smuzhiyun
3575*4882a593Smuzhiyunnewos6*)
3576*4882a593Smuzhiyun  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3577*4882a593Smuzhiyun  lt_cv_file_magic_cmd=/usr/bin/file
3578*4882a593Smuzhiyun  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3579*4882a593Smuzhiyun  ;;
3580*4882a593Smuzhiyun
3581*4882a593Smuzhiyun*nto* | *qnx*)
3582*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3583*4882a593Smuzhiyun  ;;
3584*4882a593Smuzhiyun
3585*4882a593Smuzhiyunopenbsd* | bitrig*)
3586*4882a593Smuzhiyun  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3587*4882a593Smuzhiyun    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3588*4882a593Smuzhiyun  else
3589*4882a593Smuzhiyun    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3590*4882a593Smuzhiyun  fi
3591*4882a593Smuzhiyun  ;;
3592*4882a593Smuzhiyun
3593*4882a593Smuzhiyunosf3* | osf4* | osf5*)
3594*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3595*4882a593Smuzhiyun  ;;
3596*4882a593Smuzhiyun
3597*4882a593Smuzhiyunrdos*)
3598*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3599*4882a593Smuzhiyun  ;;
3600*4882a593Smuzhiyun
3601*4882a593Smuzhiyunsolaris*)
3602*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3603*4882a593Smuzhiyun  ;;
3604*4882a593Smuzhiyun
3605*4882a593Smuzhiyunsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3606*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3607*4882a593Smuzhiyun  ;;
3608*4882a593Smuzhiyun
3609*4882a593Smuzhiyunsysv4 | sysv4.3*)
3610*4882a593Smuzhiyun  case $host_vendor in
3611*4882a593Smuzhiyun  motorola)
3612*4882a593Smuzhiyun    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
3613*4882a593Smuzhiyun    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3614*4882a593Smuzhiyun    ;;
3615*4882a593Smuzhiyun  ncr)
3616*4882a593Smuzhiyun    lt_cv_deplibs_check_method=pass_all
3617*4882a593Smuzhiyun    ;;
3618*4882a593Smuzhiyun  sequent)
3619*4882a593Smuzhiyun    lt_cv_file_magic_cmd='/bin/file'
3620*4882a593Smuzhiyun    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3621*4882a593Smuzhiyun    ;;
3622*4882a593Smuzhiyun  sni)
3623*4882a593Smuzhiyun    lt_cv_file_magic_cmd='/bin/file'
3624*4882a593Smuzhiyun    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3625*4882a593Smuzhiyun    lt_cv_file_magic_test_file=/lib/libc.so
3626*4882a593Smuzhiyun    ;;
3627*4882a593Smuzhiyun  siemens)
3628*4882a593Smuzhiyun    lt_cv_deplibs_check_method=pass_all
3629*4882a593Smuzhiyun    ;;
3630*4882a593Smuzhiyun  pc)
3631*4882a593Smuzhiyun    lt_cv_deplibs_check_method=pass_all
3632*4882a593Smuzhiyun    ;;
3633*4882a593Smuzhiyun  esac
3634*4882a593Smuzhiyun  ;;
3635*4882a593Smuzhiyun
3636*4882a593Smuzhiyuntpf*)
3637*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3638*4882a593Smuzhiyun  ;;
3639*4882a593Smuzhiyunos2*)
3640*4882a593Smuzhiyun  lt_cv_deplibs_check_method=pass_all
3641*4882a593Smuzhiyun  ;;
3642*4882a593Smuzhiyunesac
3643*4882a593Smuzhiyun])
3644*4882a593Smuzhiyun
3645*4882a593Smuzhiyunfile_magic_glob=
3646*4882a593Smuzhiyunwant_nocaseglob=no
3647*4882a593Smuzhiyunif test "$build" = "$host"; then
3648*4882a593Smuzhiyun  case $host_os in
3649*4882a593Smuzhiyun  mingw* | pw32*)
3650*4882a593Smuzhiyun    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3651*4882a593Smuzhiyun      want_nocaseglob=yes
3652*4882a593Smuzhiyun    else
3653*4882a593Smuzhiyun      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3654*4882a593Smuzhiyun    fi
3655*4882a593Smuzhiyun    ;;
3656*4882a593Smuzhiyun  esac
3657*4882a593Smuzhiyunfi
3658*4882a593Smuzhiyun
3659*4882a593Smuzhiyunfile_magic_cmd=$lt_cv_file_magic_cmd
3660*4882a593Smuzhiyundeplibs_check_method=$lt_cv_deplibs_check_method
3661*4882a593Smuzhiyuntest -z "$deplibs_check_method" && deplibs_check_method=unknown
3662*4882a593Smuzhiyun
3663*4882a593Smuzhiyun_LT_DECL([], [deplibs_check_method], [1],
3664*4882a593Smuzhiyun    [Method to check whether dependent libraries are shared objects])
3665*4882a593Smuzhiyun_LT_DECL([], [file_magic_cmd], [1],
3666*4882a593Smuzhiyun    [Command to use when deplibs_check_method = "file_magic"])
3667*4882a593Smuzhiyun_LT_DECL([], [file_magic_glob], [1],
3668*4882a593Smuzhiyun    [How to find potential files when deplibs_check_method = "file_magic"])
3669*4882a593Smuzhiyun_LT_DECL([], [want_nocaseglob], [1],
3670*4882a593Smuzhiyun    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3671*4882a593Smuzhiyun])# _LT_CHECK_MAGIC_METHOD
3672*4882a593Smuzhiyun
3673*4882a593Smuzhiyun
3674*4882a593Smuzhiyun# LT_PATH_NM
3675*4882a593Smuzhiyun# ----------
3676*4882a593Smuzhiyun# find the pathname to a BSD- or MS-compatible name lister
3677*4882a593SmuzhiyunAC_DEFUN([LT_PATH_NM],
3678*4882a593Smuzhiyun[AC_REQUIRE([AC_PROG_CC])dnl
3679*4882a593SmuzhiyunAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3680*4882a593Smuzhiyun[if test -n "$NM"; then
3681*4882a593Smuzhiyun  # Let the user override the test.
3682*4882a593Smuzhiyun  lt_cv_path_NM=$NM
3683*4882a593Smuzhiyunelse
3684*4882a593Smuzhiyun  lt_nm_to_check=${ac_tool_prefix}nm
3685*4882a593Smuzhiyun  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3686*4882a593Smuzhiyun    lt_nm_to_check="$lt_nm_to_check nm"
3687*4882a593Smuzhiyun  fi
3688*4882a593Smuzhiyun  for lt_tmp_nm in $lt_nm_to_check; do
3689*4882a593Smuzhiyun    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3690*4882a593Smuzhiyun    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3691*4882a593Smuzhiyun      IFS=$lt_save_ifs
3692*4882a593Smuzhiyun      test -z "$ac_dir" && ac_dir=.
3693*4882a593Smuzhiyun      tmp_nm=$ac_dir/$lt_tmp_nm
3694*4882a593Smuzhiyun      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3695*4882a593Smuzhiyun	# Check to see if the nm accepts a BSD-compat flag.
3696*4882a593Smuzhiyun	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3697*4882a593Smuzhiyun	#   nm: unknown option "B" ignored
3698*4882a593Smuzhiyun	# Tru64's nm complains that /dev/null is an invalid object file
3699*4882a593Smuzhiyun	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3700*4882a593Smuzhiyun	case $build_os in
3701*4882a593Smuzhiyun	mingw*) lt_bad_file=conftest.nm/nofile ;;
3702*4882a593Smuzhiyun	*) lt_bad_file=/dev/null ;;
3703*4882a593Smuzhiyun	esac
3704*4882a593Smuzhiyun	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3705*4882a593Smuzhiyun	*$lt_bad_file* | *'Invalid file or object type'*)
3706*4882a593Smuzhiyun	  lt_cv_path_NM="$tmp_nm -B"
3707*4882a593Smuzhiyun	  break 2
3708*4882a593Smuzhiyun	  ;;
3709*4882a593Smuzhiyun	*)
3710*4882a593Smuzhiyun	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3711*4882a593Smuzhiyun	  */dev/null*)
3712*4882a593Smuzhiyun	    lt_cv_path_NM="$tmp_nm -p"
3713*4882a593Smuzhiyun	    break 2
3714*4882a593Smuzhiyun	    ;;
3715*4882a593Smuzhiyun	  *)
3716*4882a593Smuzhiyun	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3717*4882a593Smuzhiyun	    continue # so that we can try to find one that supports BSD flags
3718*4882a593Smuzhiyun	    ;;
3719*4882a593Smuzhiyun	  esac
3720*4882a593Smuzhiyun	  ;;
3721*4882a593Smuzhiyun	esac
3722*4882a593Smuzhiyun      fi
3723*4882a593Smuzhiyun    done
3724*4882a593Smuzhiyun    IFS=$lt_save_ifs
3725*4882a593Smuzhiyun  done
3726*4882a593Smuzhiyun  : ${lt_cv_path_NM=no}
3727*4882a593Smuzhiyunfi])
3728*4882a593Smuzhiyunif test no != "$lt_cv_path_NM"; then
3729*4882a593Smuzhiyun  NM=$lt_cv_path_NM
3730*4882a593Smuzhiyunelse
3731*4882a593Smuzhiyun  # Didn't find any BSD compatible name lister, look for dumpbin.
3732*4882a593Smuzhiyun  if test -n "$DUMPBIN"; then :
3733*4882a593Smuzhiyun    # Let the user override the test.
3734*4882a593Smuzhiyun  else
3735*4882a593Smuzhiyun    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3736*4882a593Smuzhiyun    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3737*4882a593Smuzhiyun    *COFF*)
3738*4882a593Smuzhiyun      DUMPBIN="$DUMPBIN -symbols -headers"
3739*4882a593Smuzhiyun      ;;
3740*4882a593Smuzhiyun    *)
3741*4882a593Smuzhiyun      DUMPBIN=:
3742*4882a593Smuzhiyun      ;;
3743*4882a593Smuzhiyun    esac
3744*4882a593Smuzhiyun  fi
3745*4882a593Smuzhiyun  AC_SUBST([DUMPBIN])
3746*4882a593Smuzhiyun  if test : != "$DUMPBIN"; then
3747*4882a593Smuzhiyun    NM=$DUMPBIN
3748*4882a593Smuzhiyun  fi
3749*4882a593Smuzhiyunfi
3750*4882a593Smuzhiyuntest -z "$NM" && NM=nm
3751*4882a593SmuzhiyunAC_SUBST([NM])
3752*4882a593Smuzhiyun_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3753*4882a593Smuzhiyun
3754*4882a593SmuzhiyunAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3755*4882a593Smuzhiyun  [lt_cv_nm_interface="BSD nm"
3756*4882a593Smuzhiyun  echo "int some_variable = 0;" > conftest.$ac_ext
3757*4882a593Smuzhiyun  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3758*4882a593Smuzhiyun  (eval "$ac_compile" 2>conftest.err)
3759*4882a593Smuzhiyun  cat conftest.err >&AS_MESSAGE_LOG_FD
3760*4882a593Smuzhiyun  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3761*4882a593Smuzhiyun  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3762*4882a593Smuzhiyun  cat conftest.err >&AS_MESSAGE_LOG_FD
3763*4882a593Smuzhiyun  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3764*4882a593Smuzhiyun  cat conftest.out >&AS_MESSAGE_LOG_FD
3765*4882a593Smuzhiyun  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3766*4882a593Smuzhiyun    lt_cv_nm_interface="MS dumpbin"
3767*4882a593Smuzhiyun  fi
3768*4882a593Smuzhiyun  rm -f conftest*])
3769*4882a593Smuzhiyun])# LT_PATH_NM
3770*4882a593Smuzhiyun
3771*4882a593Smuzhiyun# Old names:
3772*4882a593SmuzhiyunAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3773*4882a593SmuzhiyunAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3774*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
3775*4882a593Smuzhiyundnl AC_DEFUN([AM_PROG_NM], [])
3776*4882a593Smuzhiyundnl AC_DEFUN([AC_PROG_NM], [])
3777*4882a593Smuzhiyun
3778*4882a593Smuzhiyun# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3779*4882a593Smuzhiyun# --------------------------------
3780*4882a593Smuzhiyun# how to determine the name of the shared library
3781*4882a593Smuzhiyun# associated with a specific link library.
3782*4882a593Smuzhiyun#  -- PORTME fill in with the dynamic library characteristics
3783*4882a593Smuzhiyunm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3784*4882a593Smuzhiyun[m4_require([_LT_DECL_EGREP])
3785*4882a593Smuzhiyunm4_require([_LT_DECL_OBJDUMP])
3786*4882a593Smuzhiyunm4_require([_LT_DECL_DLLTOOL])
3787*4882a593SmuzhiyunAC_CACHE_CHECK([how to associate runtime and link libraries],
3788*4882a593Smuzhiyunlt_cv_sharedlib_from_linklib_cmd,
3789*4882a593Smuzhiyun[lt_cv_sharedlib_from_linklib_cmd='unknown'
3790*4882a593Smuzhiyun
3791*4882a593Smuzhiyuncase $host_os in
3792*4882a593Smuzhiyuncygwin* | mingw* | pw32* | cegcc*)
3793*4882a593Smuzhiyun  # two different shell functions defined in ltmain.sh;
3794*4882a593Smuzhiyun  # decide which one to use based on capabilities of $DLLTOOL
3795*4882a593Smuzhiyun  case `$DLLTOOL --help 2>&1` in
3796*4882a593Smuzhiyun  *--identify-strict*)
3797*4882a593Smuzhiyun    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3798*4882a593Smuzhiyun    ;;
3799*4882a593Smuzhiyun  *)
3800*4882a593Smuzhiyun    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3801*4882a593Smuzhiyun    ;;
3802*4882a593Smuzhiyun  esac
3803*4882a593Smuzhiyun  ;;
3804*4882a593Smuzhiyun*)
3805*4882a593Smuzhiyun  # fallback: assume linklib IS sharedlib
3806*4882a593Smuzhiyun  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3807*4882a593Smuzhiyun  ;;
3808*4882a593Smuzhiyunesac
3809*4882a593Smuzhiyun])
3810*4882a593Smuzhiyunsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3811*4882a593Smuzhiyuntest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3812*4882a593Smuzhiyun
3813*4882a593Smuzhiyun_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3814*4882a593Smuzhiyun    [Command to associate shared and link libraries])
3815*4882a593Smuzhiyun])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3816*4882a593Smuzhiyun
3817*4882a593Smuzhiyun
3818*4882a593Smuzhiyun# _LT_PATH_MANIFEST_TOOL
3819*4882a593Smuzhiyun# ----------------------
3820*4882a593Smuzhiyun# locate the manifest tool
3821*4882a593Smuzhiyunm4_defun([_LT_PATH_MANIFEST_TOOL],
3822*4882a593Smuzhiyun[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3823*4882a593Smuzhiyuntest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3824*4882a593SmuzhiyunAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3825*4882a593Smuzhiyun  [lt_cv_path_mainfest_tool=no
3826*4882a593Smuzhiyun  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3827*4882a593Smuzhiyun  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3828*4882a593Smuzhiyun  cat conftest.err >&AS_MESSAGE_LOG_FD
3829*4882a593Smuzhiyun  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3830*4882a593Smuzhiyun    lt_cv_path_mainfest_tool=yes
3831*4882a593Smuzhiyun  fi
3832*4882a593Smuzhiyun  rm -f conftest*])
3833*4882a593Smuzhiyunif test yes != "$lt_cv_path_mainfest_tool"; then
3834*4882a593Smuzhiyun  MANIFEST_TOOL=:
3835*4882a593Smuzhiyunfi
3836*4882a593Smuzhiyun_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3837*4882a593Smuzhiyun])# _LT_PATH_MANIFEST_TOOL
3838*4882a593Smuzhiyun
3839*4882a593Smuzhiyun
3840*4882a593Smuzhiyun# _LT_DLL_DEF_P([FILE])
3841*4882a593Smuzhiyun# ---------------------
3842*4882a593Smuzhiyun# True iff FILE is a Windows DLL '.def' file.
3843*4882a593Smuzhiyun# Keep in sync with func_dll_def_p in the libtool script
3844*4882a593SmuzhiyunAC_DEFUN([_LT_DLL_DEF_P],
3845*4882a593Smuzhiyun[dnl
3846*4882a593Smuzhiyun  test DEF = "`$SED -n dnl
3847*4882a593Smuzhiyun    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3848*4882a593Smuzhiyun    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3849*4882a593Smuzhiyun    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3850*4882a593Smuzhiyun    -e q dnl                          Only consider the first "real" line
3851*4882a593Smuzhiyun    $1`" dnl
3852*4882a593Smuzhiyun])# _LT_DLL_DEF_P
3853*4882a593Smuzhiyun
3854*4882a593Smuzhiyun
3855*4882a593Smuzhiyun# LT_LIB_M
3856*4882a593Smuzhiyun# --------
3857*4882a593Smuzhiyun# check for math library
3858*4882a593SmuzhiyunAC_DEFUN([LT_LIB_M],
3859*4882a593Smuzhiyun[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3860*4882a593SmuzhiyunLIBM=
3861*4882a593Smuzhiyuncase $host in
3862*4882a593Smuzhiyun*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3863*4882a593Smuzhiyun  # These system don't have libm, or don't need it
3864*4882a593Smuzhiyun  ;;
3865*4882a593Smuzhiyun*-ncr-sysv4.3*)
3866*4882a593Smuzhiyun  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3867*4882a593Smuzhiyun  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3868*4882a593Smuzhiyun  ;;
3869*4882a593Smuzhiyun*)
3870*4882a593Smuzhiyun  AC_CHECK_LIB(m, cos, LIBM=-lm)
3871*4882a593Smuzhiyun  ;;
3872*4882a593Smuzhiyunesac
3873*4882a593SmuzhiyunAC_SUBST([LIBM])
3874*4882a593Smuzhiyun])# LT_LIB_M
3875*4882a593Smuzhiyun
3876*4882a593Smuzhiyun# Old name:
3877*4882a593SmuzhiyunAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3878*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
3879*4882a593Smuzhiyundnl AC_DEFUN([AC_CHECK_LIBM], [])
3880*4882a593Smuzhiyun
3881*4882a593Smuzhiyun
3882*4882a593Smuzhiyun# _LT_COMPILER_NO_RTTI([TAGNAME])
3883*4882a593Smuzhiyun# -------------------------------
3884*4882a593Smuzhiyunm4_defun([_LT_COMPILER_NO_RTTI],
3885*4882a593Smuzhiyun[m4_require([_LT_TAG_COMPILER])dnl
3886*4882a593Smuzhiyun
3887*4882a593Smuzhiyun_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3888*4882a593Smuzhiyun
3889*4882a593Smuzhiyunif test yes = "$GCC"; then
3890*4882a593Smuzhiyun  case $cc_basename in
3891*4882a593Smuzhiyun  nvcc*)
3892*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3893*4882a593Smuzhiyun  *)
3894*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3895*4882a593Smuzhiyun  esac
3896*4882a593Smuzhiyun
3897*4882a593Smuzhiyun  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3898*4882a593Smuzhiyun    lt_cv_prog_compiler_rtti_exceptions,
3899*4882a593Smuzhiyun    [-fno-rtti -fno-exceptions], [],
3900*4882a593Smuzhiyun    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3901*4882a593Smuzhiyunfi
3902*4882a593Smuzhiyun_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3903*4882a593Smuzhiyun	[Compiler flag to turn off builtin functions])
3904*4882a593Smuzhiyun])# _LT_COMPILER_NO_RTTI
3905*4882a593Smuzhiyun
3906*4882a593Smuzhiyun
3907*4882a593Smuzhiyun# _LT_CMD_GLOBAL_SYMBOLS
3908*4882a593Smuzhiyun# ----------------------
3909*4882a593Smuzhiyunm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3910*4882a593Smuzhiyun[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3911*4882a593SmuzhiyunAC_REQUIRE([AC_PROG_CC])dnl
3912*4882a593SmuzhiyunAC_REQUIRE([AC_PROG_AWK])dnl
3913*4882a593SmuzhiyunAC_REQUIRE([LT_PATH_NM])dnl
3914*4882a593SmuzhiyunAC_REQUIRE([LT_PATH_LD])dnl
3915*4882a593Smuzhiyunm4_require([_LT_DECL_SED])dnl
3916*4882a593Smuzhiyunm4_require([_LT_DECL_EGREP])dnl
3917*4882a593Smuzhiyunm4_require([_LT_TAG_COMPILER])dnl
3918*4882a593Smuzhiyun
3919*4882a593Smuzhiyun# Check for command to grab the raw symbol name followed by C symbol from nm.
3920*4882a593SmuzhiyunAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3921*4882a593SmuzhiyunAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3922*4882a593Smuzhiyun[
3923*4882a593Smuzhiyun# These are sane defaults that work on at least a few old systems.
3924*4882a593Smuzhiyun# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3925*4882a593Smuzhiyun
3926*4882a593Smuzhiyun# Character class describing NM global symbol codes.
3927*4882a593Smuzhiyunsymcode='[[BCDEGRST]]'
3928*4882a593Smuzhiyun
3929*4882a593Smuzhiyun# Regexp to match symbols that can be accessed directly from C.
3930*4882a593Smuzhiyunsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3931*4882a593Smuzhiyun
3932*4882a593Smuzhiyun# Define system-specific variables.
3933*4882a593Smuzhiyuncase $host_os in
3934*4882a593Smuzhiyunaix*)
3935*4882a593Smuzhiyun  symcode='[[BCDT]]'
3936*4882a593Smuzhiyun  ;;
3937*4882a593Smuzhiyuncygwin* | mingw* | pw32* | cegcc*)
3938*4882a593Smuzhiyun  symcode='[[ABCDGISTW]]'
3939*4882a593Smuzhiyun  ;;
3940*4882a593Smuzhiyunhpux*)
3941*4882a593Smuzhiyun  if test ia64 = "$host_cpu"; then
3942*4882a593Smuzhiyun    symcode='[[ABCDEGRST]]'
3943*4882a593Smuzhiyun  fi
3944*4882a593Smuzhiyun  ;;
3945*4882a593Smuzhiyunirix* | nonstopux*)
3946*4882a593Smuzhiyun  symcode='[[BCDEGRST]]'
3947*4882a593Smuzhiyun  ;;
3948*4882a593Smuzhiyunosf*)
3949*4882a593Smuzhiyun  symcode='[[BCDEGQRST]]'
3950*4882a593Smuzhiyun  ;;
3951*4882a593Smuzhiyunsolaris*)
3952*4882a593Smuzhiyun  symcode='[[BDRT]]'
3953*4882a593Smuzhiyun  ;;
3954*4882a593Smuzhiyunsco3.2v5*)
3955*4882a593Smuzhiyun  symcode='[[DT]]'
3956*4882a593Smuzhiyun  ;;
3957*4882a593Smuzhiyunsysv4.2uw2*)
3958*4882a593Smuzhiyun  symcode='[[DT]]'
3959*4882a593Smuzhiyun  ;;
3960*4882a593Smuzhiyunsysv5* | sco5v6* | unixware* | OpenUNIX*)
3961*4882a593Smuzhiyun  symcode='[[ABDT]]'
3962*4882a593Smuzhiyun  ;;
3963*4882a593Smuzhiyunsysv4)
3964*4882a593Smuzhiyun  symcode='[[DFNSTU]]'
3965*4882a593Smuzhiyun  ;;
3966*4882a593Smuzhiyunesac
3967*4882a593Smuzhiyun
3968*4882a593Smuzhiyun# If we're using GNU nm, then use its standard symbol codes.
3969*4882a593Smuzhiyuncase `$NM -V 2>&1` in
3970*4882a593Smuzhiyun*GNU* | *'with BFD'*)
3971*4882a593Smuzhiyun  symcode='[[ABCDGIRSTW]]' ;;
3972*4882a593Smuzhiyunesac
3973*4882a593Smuzhiyun
3974*4882a593Smuzhiyunif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3975*4882a593Smuzhiyun  # Gets list of data symbols to import.
3976*4882a593Smuzhiyun  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3977*4882a593Smuzhiyun  # Adjust the below global symbol transforms to fixup imported variables.
3978*4882a593Smuzhiyun  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3979*4882a593Smuzhiyun  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3980*4882a593Smuzhiyun  lt_c_name_lib_hook="\
3981*4882a593Smuzhiyun  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3982*4882a593Smuzhiyun  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3983*4882a593Smuzhiyunelse
3984*4882a593Smuzhiyun  # Disable hooks by default.
3985*4882a593Smuzhiyun  lt_cv_sys_global_symbol_to_import=
3986*4882a593Smuzhiyun  lt_cdecl_hook=
3987*4882a593Smuzhiyun  lt_c_name_hook=
3988*4882a593Smuzhiyun  lt_c_name_lib_hook=
3989*4882a593Smuzhiyunfi
3990*4882a593Smuzhiyun
3991*4882a593Smuzhiyun# Transform an extracted symbol line into a proper C declaration.
3992*4882a593Smuzhiyun# Some systems (esp. on ia64) link data and code symbols differently,
3993*4882a593Smuzhiyun# so use this general approach.
3994*4882a593Smuzhiyunlt_cv_sys_global_symbol_to_cdecl="sed -n"\
3995*4882a593Smuzhiyun$lt_cdecl_hook\
3996*4882a593Smuzhiyun" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3997*4882a593Smuzhiyun" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3998*4882a593Smuzhiyun
3999*4882a593Smuzhiyun# Transform an extracted symbol line into symbol name and symbol address
4000*4882a593Smuzhiyunlt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4001*4882a593Smuzhiyun$lt_c_name_hook\
4002*4882a593Smuzhiyun" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4003*4882a593Smuzhiyun" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4004*4882a593Smuzhiyun
4005*4882a593Smuzhiyun# Transform an extracted symbol line into symbol name with lib prefix and
4006*4882a593Smuzhiyun# symbol address.
4007*4882a593Smuzhiyunlt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4008*4882a593Smuzhiyun$lt_c_name_lib_hook\
4009*4882a593Smuzhiyun" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4010*4882a593Smuzhiyun" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4011*4882a593Smuzhiyun" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4012*4882a593Smuzhiyun
4013*4882a593Smuzhiyun# Handle CRLF in mingw tool chain
4014*4882a593Smuzhiyunopt_cr=
4015*4882a593Smuzhiyuncase $build_os in
4016*4882a593Smuzhiyunmingw*)
4017*4882a593Smuzhiyun  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4018*4882a593Smuzhiyun  ;;
4019*4882a593Smuzhiyunesac
4020*4882a593Smuzhiyun
4021*4882a593Smuzhiyun# Try without a prefix underscore, then with it.
4022*4882a593Smuzhiyunfor ac_symprfx in "" "_"; do
4023*4882a593Smuzhiyun
4024*4882a593Smuzhiyun  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4025*4882a593Smuzhiyun  symxfrm="\\1 $ac_symprfx\\2 \\2"
4026*4882a593Smuzhiyun
4027*4882a593Smuzhiyun  # Write the raw and C identifiers.
4028*4882a593Smuzhiyun  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4029*4882a593Smuzhiyun    # Fake it for dumpbin and say T for any non-static function,
4030*4882a593Smuzhiyun    # D for any global variable and I for any imported variable.
4031*4882a593Smuzhiyun    # Also find C++ and __fastcall symbols from MSVC++,
4032*4882a593Smuzhiyun    # which start with @ or ?.
4033*4882a593Smuzhiyun    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4034*4882a593Smuzhiyun"     {last_section=section; section=\$ 3};"\
4035*4882a593Smuzhiyun"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4036*4882a593Smuzhiyun"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4037*4882a593Smuzhiyun"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4038*4882a593Smuzhiyun"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4039*4882a593Smuzhiyun"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4040*4882a593Smuzhiyun"     \$ 0!~/External *\|/{next};"\
4041*4882a593Smuzhiyun"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4042*4882a593Smuzhiyun"     {if(hide[section]) next};"\
4043*4882a593Smuzhiyun"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4044*4882a593Smuzhiyun"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4045*4882a593Smuzhiyun"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4046*4882a593Smuzhiyun"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4047*4882a593Smuzhiyun"     ' prfx=^$ac_symprfx]"
4048*4882a593Smuzhiyun  else
4049*4882a593Smuzhiyun    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4050*4882a593Smuzhiyun  fi
4051*4882a593Smuzhiyun  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4052*4882a593Smuzhiyun
4053*4882a593Smuzhiyun  # Check to see that the pipe works correctly.
4054*4882a593Smuzhiyun  pipe_works=no
4055*4882a593Smuzhiyun
4056*4882a593Smuzhiyun  rm -f conftest*
4057*4882a593Smuzhiyun  cat > conftest.$ac_ext <<_LT_EOF
4058*4882a593Smuzhiyun#ifdef __cplusplus
4059*4882a593Smuzhiyunextern "C" {
4060*4882a593Smuzhiyun#endif
4061*4882a593Smuzhiyunchar nm_test_var;
4062*4882a593Smuzhiyunvoid nm_test_func(void);
4063*4882a593Smuzhiyunvoid nm_test_func(void){}
4064*4882a593Smuzhiyun#ifdef __cplusplus
4065*4882a593Smuzhiyun}
4066*4882a593Smuzhiyun#endif
4067*4882a593Smuzhiyunint main(){nm_test_var='a';nm_test_func();return(0);}
4068*4882a593Smuzhiyun_LT_EOF
4069*4882a593Smuzhiyun
4070*4882a593Smuzhiyun  if AC_TRY_EVAL(ac_compile); then
4071*4882a593Smuzhiyun    # Now try to grab the symbols.
4072*4882a593Smuzhiyun    nlist=conftest.nm
4073*4882a593Smuzhiyun    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4074*4882a593Smuzhiyun      # Try sorting and uniquifying the output.
4075*4882a593Smuzhiyun      if sort "$nlist" | uniq > "$nlist"T; then
4076*4882a593Smuzhiyun	mv -f "$nlist"T "$nlist"
4077*4882a593Smuzhiyun      else
4078*4882a593Smuzhiyun	rm -f "$nlist"T
4079*4882a593Smuzhiyun      fi
4080*4882a593Smuzhiyun
4081*4882a593Smuzhiyun      # Make sure that we snagged all the symbols we need.
4082*4882a593Smuzhiyun      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4083*4882a593Smuzhiyun	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4084*4882a593Smuzhiyun	  cat <<_LT_EOF > conftest.$ac_ext
4085*4882a593Smuzhiyun/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4086*4882a593Smuzhiyun#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4087*4882a593Smuzhiyun/* DATA imports from DLLs on WIN32 can't be const, because runtime
4088*4882a593Smuzhiyun   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4089*4882a593Smuzhiyun# define LT@&t@_DLSYM_CONST
4090*4882a593Smuzhiyun#elif defined __osf__
4091*4882a593Smuzhiyun/* This system does not cope well with relocations in const data.  */
4092*4882a593Smuzhiyun# define LT@&t@_DLSYM_CONST
4093*4882a593Smuzhiyun#else
4094*4882a593Smuzhiyun# define LT@&t@_DLSYM_CONST const
4095*4882a593Smuzhiyun#endif
4096*4882a593Smuzhiyun
4097*4882a593Smuzhiyun#ifdef __cplusplus
4098*4882a593Smuzhiyunextern "C" {
4099*4882a593Smuzhiyun#endif
4100*4882a593Smuzhiyun
4101*4882a593Smuzhiyun_LT_EOF
4102*4882a593Smuzhiyun	  # Now generate the symbol file.
4103*4882a593Smuzhiyun	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4104*4882a593Smuzhiyun
4105*4882a593Smuzhiyun	  cat <<_LT_EOF >> conftest.$ac_ext
4106*4882a593Smuzhiyun
4107*4882a593Smuzhiyun/* The mapping between symbol names and symbols.  */
4108*4882a593SmuzhiyunLT@&t@_DLSYM_CONST struct {
4109*4882a593Smuzhiyun  const char *name;
4110*4882a593Smuzhiyun  void       *address;
4111*4882a593Smuzhiyun}
4112*4882a593Smuzhiyunlt__PROGRAM__LTX_preloaded_symbols[[]] =
4113*4882a593Smuzhiyun{
4114*4882a593Smuzhiyun  { "@PROGRAM@", (void *) 0 },
4115*4882a593Smuzhiyun_LT_EOF
4116*4882a593Smuzhiyun	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4117*4882a593Smuzhiyun	  cat <<\_LT_EOF >> conftest.$ac_ext
4118*4882a593Smuzhiyun  {0, (void *) 0}
4119*4882a593Smuzhiyun};
4120*4882a593Smuzhiyun
4121*4882a593Smuzhiyun/* This works around a problem in FreeBSD linker */
4122*4882a593Smuzhiyun#ifdef FREEBSD_WORKAROUND
4123*4882a593Smuzhiyunstatic const void *lt_preloaded_setup() {
4124*4882a593Smuzhiyun  return lt__PROGRAM__LTX_preloaded_symbols;
4125*4882a593Smuzhiyun}
4126*4882a593Smuzhiyun#endif
4127*4882a593Smuzhiyun
4128*4882a593Smuzhiyun#ifdef __cplusplus
4129*4882a593Smuzhiyun}
4130*4882a593Smuzhiyun#endif
4131*4882a593Smuzhiyun_LT_EOF
4132*4882a593Smuzhiyun	  # Now try linking the two files.
4133*4882a593Smuzhiyun	  mv conftest.$ac_objext conftstm.$ac_objext
4134*4882a593Smuzhiyun	  lt_globsym_save_LIBS=$LIBS
4135*4882a593Smuzhiyun	  lt_globsym_save_CFLAGS=$CFLAGS
4136*4882a593Smuzhiyun	  LIBS=conftstm.$ac_objext
4137*4882a593Smuzhiyun	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4138*4882a593Smuzhiyun	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4139*4882a593Smuzhiyun	    pipe_works=yes
4140*4882a593Smuzhiyun	  fi
4141*4882a593Smuzhiyun	  LIBS=$lt_globsym_save_LIBS
4142*4882a593Smuzhiyun	  CFLAGS=$lt_globsym_save_CFLAGS
4143*4882a593Smuzhiyun	else
4144*4882a593Smuzhiyun	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4145*4882a593Smuzhiyun	fi
4146*4882a593Smuzhiyun      else
4147*4882a593Smuzhiyun	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4148*4882a593Smuzhiyun      fi
4149*4882a593Smuzhiyun    else
4150*4882a593Smuzhiyun      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4151*4882a593Smuzhiyun    fi
4152*4882a593Smuzhiyun  else
4153*4882a593Smuzhiyun    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4154*4882a593Smuzhiyun    cat conftest.$ac_ext >&5
4155*4882a593Smuzhiyun  fi
4156*4882a593Smuzhiyun  rm -rf conftest* conftst*
4157*4882a593Smuzhiyun
4158*4882a593Smuzhiyun  # Do not use the global_symbol_pipe unless it works.
4159*4882a593Smuzhiyun  if test yes = "$pipe_works"; then
4160*4882a593Smuzhiyun    break
4161*4882a593Smuzhiyun  else
4162*4882a593Smuzhiyun    lt_cv_sys_global_symbol_pipe=
4163*4882a593Smuzhiyun  fi
4164*4882a593Smuzhiyundone
4165*4882a593Smuzhiyun])
4166*4882a593Smuzhiyunif test -z "$lt_cv_sys_global_symbol_pipe"; then
4167*4882a593Smuzhiyun  lt_cv_sys_global_symbol_to_cdecl=
4168*4882a593Smuzhiyunfi
4169*4882a593Smuzhiyunif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4170*4882a593Smuzhiyun  AC_MSG_RESULT(failed)
4171*4882a593Smuzhiyunelse
4172*4882a593Smuzhiyun  AC_MSG_RESULT(ok)
4173*4882a593Smuzhiyunfi
4174*4882a593Smuzhiyun
4175*4882a593Smuzhiyun# Response file support.
4176*4882a593Smuzhiyunif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4177*4882a593Smuzhiyun  nm_file_list_spec='@'
4178*4882a593Smuzhiyunelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4179*4882a593Smuzhiyun  nm_file_list_spec='@'
4180*4882a593Smuzhiyunfi
4181*4882a593Smuzhiyun
4182*4882a593Smuzhiyun_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4183*4882a593Smuzhiyun    [Take the output of nm and produce a listing of raw symbols and C names])
4184*4882a593Smuzhiyun_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4185*4882a593Smuzhiyun    [Transform the output of nm in a proper C declaration])
4186*4882a593Smuzhiyun_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4187*4882a593Smuzhiyun    [Transform the output of nm into a list of symbols to manually relocate])
4188*4882a593Smuzhiyun_LT_DECL([global_symbol_to_c_name_address],
4189*4882a593Smuzhiyun    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4190*4882a593Smuzhiyun    [Transform the output of nm in a C name address pair])
4191*4882a593Smuzhiyun_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4192*4882a593Smuzhiyun    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4193*4882a593Smuzhiyun    [Transform the output of nm in a C name address pair when lib prefix is needed])
4194*4882a593Smuzhiyun_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4195*4882a593Smuzhiyun    [The name lister interface])
4196*4882a593Smuzhiyun_LT_DECL([], [nm_file_list_spec], [1],
4197*4882a593Smuzhiyun    [Specify filename containing input files for $NM])
4198*4882a593Smuzhiyun]) # _LT_CMD_GLOBAL_SYMBOLS
4199*4882a593Smuzhiyun
4200*4882a593Smuzhiyun
4201*4882a593Smuzhiyun# _LT_COMPILER_PIC([TAGNAME])
4202*4882a593Smuzhiyun# ---------------------------
4203*4882a593Smuzhiyunm4_defun([_LT_COMPILER_PIC],
4204*4882a593Smuzhiyun[m4_require([_LT_TAG_COMPILER])dnl
4205*4882a593Smuzhiyun_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4206*4882a593Smuzhiyun_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4207*4882a593Smuzhiyun_LT_TAGVAR(lt_prog_compiler_static, $1)=
4208*4882a593Smuzhiyun
4209*4882a593Smuzhiyunm4_if([$1], [CXX], [
4210*4882a593Smuzhiyun  # C++ specific cases for pic, static, wl, etc.
4211*4882a593Smuzhiyun  if test yes = "$GXX"; then
4212*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4213*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4214*4882a593Smuzhiyun
4215*4882a593Smuzhiyun    case $host_os in
4216*4882a593Smuzhiyun    aix*)
4217*4882a593Smuzhiyun      # All AIX code is PIC.
4218*4882a593Smuzhiyun      if test ia64 = "$host_cpu"; then
4219*4882a593Smuzhiyun	# AIX 5 now supports IA64 processor
4220*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4221*4882a593Smuzhiyun      fi
4222*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4223*4882a593Smuzhiyun      ;;
4224*4882a593Smuzhiyun
4225*4882a593Smuzhiyun    amigaos*)
4226*4882a593Smuzhiyun      case $host_cpu in
4227*4882a593Smuzhiyun      powerpc)
4228*4882a593Smuzhiyun            # see comment about AmigaOS4 .so support
4229*4882a593Smuzhiyun            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4230*4882a593Smuzhiyun        ;;
4231*4882a593Smuzhiyun      m68k)
4232*4882a593Smuzhiyun            # FIXME: we need at least 68020 code to build shared libraries, but
4233*4882a593Smuzhiyun            # adding the '-m68020' flag to GCC prevents building anything better,
4234*4882a593Smuzhiyun            # like '-m68040'.
4235*4882a593Smuzhiyun            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4236*4882a593Smuzhiyun        ;;
4237*4882a593Smuzhiyun      esac
4238*4882a593Smuzhiyun      ;;
4239*4882a593Smuzhiyun
4240*4882a593Smuzhiyun    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4241*4882a593Smuzhiyun      # PIC is the default for these OSes.
4242*4882a593Smuzhiyun      ;;
4243*4882a593Smuzhiyun    mingw* | cygwin* | os2* | pw32* | cegcc*)
4244*4882a593Smuzhiyun      # This hack is so that the source file can tell whether it is being
4245*4882a593Smuzhiyun      # built for inclusion in a dll (and should export symbols for example).
4246*4882a593Smuzhiyun      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4247*4882a593Smuzhiyun      # (--disable-auto-import) libraries
4248*4882a593Smuzhiyun      m4_if([$1], [GCJ], [],
4249*4882a593Smuzhiyun	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4250*4882a593Smuzhiyun      case $host_os in
4251*4882a593Smuzhiyun      os2*)
4252*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4253*4882a593Smuzhiyun	;;
4254*4882a593Smuzhiyun      esac
4255*4882a593Smuzhiyun      ;;
4256*4882a593Smuzhiyun    darwin* | rhapsody*)
4257*4882a593Smuzhiyun      # PIC is the default on this platform
4258*4882a593Smuzhiyun      # Common symbols not allowed in MH_DYLIB files
4259*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4260*4882a593Smuzhiyun      ;;
4261*4882a593Smuzhiyun    *djgpp*)
4262*4882a593Smuzhiyun      # DJGPP does not support shared libraries at all
4263*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4264*4882a593Smuzhiyun      ;;
4265*4882a593Smuzhiyun    haiku*)
4266*4882a593Smuzhiyun      # PIC is the default for Haiku.
4267*4882a593Smuzhiyun      # The "-static" flag exists, but is broken.
4268*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4269*4882a593Smuzhiyun      ;;
4270*4882a593Smuzhiyun    interix[[3-9]]*)
4271*4882a593Smuzhiyun      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4272*4882a593Smuzhiyun      # Instead, we relocate shared libraries at runtime.
4273*4882a593Smuzhiyun      ;;
4274*4882a593Smuzhiyun    sysv4*MP*)
4275*4882a593Smuzhiyun      if test -d /usr/nec; then
4276*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4277*4882a593Smuzhiyun      fi
4278*4882a593Smuzhiyun      ;;
4279*4882a593Smuzhiyun    hpux*)
4280*4882a593Smuzhiyun      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4281*4882a593Smuzhiyun      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4282*4882a593Smuzhiyun      # sets the default TLS model and affects inlining.
4283*4882a593Smuzhiyun      case $host_cpu in
4284*4882a593Smuzhiyun      hppa*64*)
4285*4882a593Smuzhiyun	;;
4286*4882a593Smuzhiyun      *)
4287*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4288*4882a593Smuzhiyun	;;
4289*4882a593Smuzhiyun      esac
4290*4882a593Smuzhiyun      ;;
4291*4882a593Smuzhiyun    *qnx* | *nto*)
4292*4882a593Smuzhiyun      # QNX uses GNU C++, but need to define -shared option too, otherwise
4293*4882a593Smuzhiyun      # it will coredump.
4294*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4295*4882a593Smuzhiyun      ;;
4296*4882a593Smuzhiyun    *)
4297*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4298*4882a593Smuzhiyun      ;;
4299*4882a593Smuzhiyun    esac
4300*4882a593Smuzhiyun  else
4301*4882a593Smuzhiyun    case $host_os in
4302*4882a593Smuzhiyun      aix[[4-9]]*)
4303*4882a593Smuzhiyun	# All AIX code is PIC.
4304*4882a593Smuzhiyun	if test ia64 = "$host_cpu"; then
4305*4882a593Smuzhiyun	  # AIX 5 now supports IA64 processor
4306*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4307*4882a593Smuzhiyun	else
4308*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4309*4882a593Smuzhiyun	fi
4310*4882a593Smuzhiyun	;;
4311*4882a593Smuzhiyun      chorus*)
4312*4882a593Smuzhiyun	case $cc_basename in
4313*4882a593Smuzhiyun	cxch68*)
4314*4882a593Smuzhiyun	  # Green Hills C++ Compiler
4315*4882a593Smuzhiyun	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
4316*4882a593Smuzhiyun	  ;;
4317*4882a593Smuzhiyun	esac
4318*4882a593Smuzhiyun	;;
4319*4882a593Smuzhiyun      mingw* | cygwin* | os2* | pw32* | cegcc*)
4320*4882a593Smuzhiyun	# This hack is so that the source file can tell whether it is being
4321*4882a593Smuzhiyun	# built for inclusion in a dll (and should export symbols for example).
4322*4882a593Smuzhiyun	m4_if([$1], [GCJ], [],
4323*4882a593Smuzhiyun	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4324*4882a593Smuzhiyun	;;
4325*4882a593Smuzhiyun      dgux*)
4326*4882a593Smuzhiyun	case $cc_basename in
4327*4882a593Smuzhiyun	  ec++*)
4328*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4329*4882a593Smuzhiyun	    ;;
4330*4882a593Smuzhiyun	  ghcx*)
4331*4882a593Smuzhiyun	    # Green Hills C++ Compiler
4332*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4333*4882a593Smuzhiyun	    ;;
4334*4882a593Smuzhiyun	  *)
4335*4882a593Smuzhiyun	    ;;
4336*4882a593Smuzhiyun	esac
4337*4882a593Smuzhiyun	;;
4338*4882a593Smuzhiyun      freebsd* | dragonfly*)
4339*4882a593Smuzhiyun	# FreeBSD uses GNU C++
4340*4882a593Smuzhiyun	;;
4341*4882a593Smuzhiyun      hpux9* | hpux10* | hpux11*)
4342*4882a593Smuzhiyun	case $cc_basename in
4343*4882a593Smuzhiyun	  CC*)
4344*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4345*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4346*4882a593Smuzhiyun	    if test ia64 != "$host_cpu"; then
4347*4882a593Smuzhiyun	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4348*4882a593Smuzhiyun	    fi
4349*4882a593Smuzhiyun	    ;;
4350*4882a593Smuzhiyun	  aCC*)
4351*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4352*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4353*4882a593Smuzhiyun	    case $host_cpu in
4354*4882a593Smuzhiyun	    hppa*64*|ia64*)
4355*4882a593Smuzhiyun	      # +Z the default
4356*4882a593Smuzhiyun	      ;;
4357*4882a593Smuzhiyun	    *)
4358*4882a593Smuzhiyun	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4359*4882a593Smuzhiyun	      ;;
4360*4882a593Smuzhiyun	    esac
4361*4882a593Smuzhiyun	    ;;
4362*4882a593Smuzhiyun	  *)
4363*4882a593Smuzhiyun	    ;;
4364*4882a593Smuzhiyun	esac
4365*4882a593Smuzhiyun	;;
4366*4882a593Smuzhiyun      interix*)
4367*4882a593Smuzhiyun	# This is c89, which is MS Visual C++ (no shared libs)
4368*4882a593Smuzhiyun	# Anyone wants to do a port?
4369*4882a593Smuzhiyun	;;
4370*4882a593Smuzhiyun      irix5* | irix6* | nonstopux*)
4371*4882a593Smuzhiyun	case $cc_basename in
4372*4882a593Smuzhiyun	  CC*)
4373*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4374*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4375*4882a593Smuzhiyun	    # CC pic flag -KPIC is the default.
4376*4882a593Smuzhiyun	    ;;
4377*4882a593Smuzhiyun	  *)
4378*4882a593Smuzhiyun	    ;;
4379*4882a593Smuzhiyun	esac
4380*4882a593Smuzhiyun	;;
4381*4882a593Smuzhiyun      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4382*4882a593Smuzhiyun	case $cc_basename in
4383*4882a593Smuzhiyun	  KCC*)
4384*4882a593Smuzhiyun	    # KAI C++ Compiler
4385*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4386*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4387*4882a593Smuzhiyun	    ;;
4388*4882a593Smuzhiyun	  ecpc* )
4389*4882a593Smuzhiyun	    # old Intel C++ for x86_64, which still supported -KPIC.
4390*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4391*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4392*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4393*4882a593Smuzhiyun	    ;;
4394*4882a593Smuzhiyun	  icpc* )
4395*4882a593Smuzhiyun	    # Intel C++, used to be incompatible with GCC.
4396*4882a593Smuzhiyun	    # ICC 10 doesn't accept -KPIC any more.
4397*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4398*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4399*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4400*4882a593Smuzhiyun	    ;;
4401*4882a593Smuzhiyun	  pgCC* | pgcpp*)
4402*4882a593Smuzhiyun	    # Portland Group C++ compiler
4403*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4404*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4405*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4406*4882a593Smuzhiyun	    ;;
4407*4882a593Smuzhiyun	  cxx*)
4408*4882a593Smuzhiyun	    # Compaq C++
4409*4882a593Smuzhiyun	    # Make sure the PIC flag is empty.  It appears that all Alpha
4410*4882a593Smuzhiyun	    # Linux and Compaq Tru64 Unix objects are PIC.
4411*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4412*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4413*4882a593Smuzhiyun	    ;;
4414*4882a593Smuzhiyun	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4415*4882a593Smuzhiyun	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4416*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4417*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4418*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4419*4882a593Smuzhiyun	    ;;
4420*4882a593Smuzhiyun	  *)
4421*4882a593Smuzhiyun	    case `$CC -V 2>&1 | sed 5q` in
4422*4882a593Smuzhiyun	    *Sun\ C*)
4423*4882a593Smuzhiyun	      # Sun C++ 5.9
4424*4882a593Smuzhiyun	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4425*4882a593Smuzhiyun	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4426*4882a593Smuzhiyun	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4427*4882a593Smuzhiyun	      ;;
4428*4882a593Smuzhiyun	    esac
4429*4882a593Smuzhiyun	    ;;
4430*4882a593Smuzhiyun	esac
4431*4882a593Smuzhiyun	;;
4432*4882a593Smuzhiyun      lynxos*)
4433*4882a593Smuzhiyun	;;
4434*4882a593Smuzhiyun      m88k*)
4435*4882a593Smuzhiyun	;;
4436*4882a593Smuzhiyun      mvs*)
4437*4882a593Smuzhiyun	case $cc_basename in
4438*4882a593Smuzhiyun	  cxx*)
4439*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4440*4882a593Smuzhiyun	    ;;
4441*4882a593Smuzhiyun	  *)
4442*4882a593Smuzhiyun	    ;;
4443*4882a593Smuzhiyun	esac
4444*4882a593Smuzhiyun	;;
4445*4882a593Smuzhiyun      netbsd*)
4446*4882a593Smuzhiyun	;;
4447*4882a593Smuzhiyun      *qnx* | *nto*)
4448*4882a593Smuzhiyun        # QNX uses GNU C++, but need to define -shared option too, otherwise
4449*4882a593Smuzhiyun        # it will coredump.
4450*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4451*4882a593Smuzhiyun        ;;
4452*4882a593Smuzhiyun      osf3* | osf4* | osf5*)
4453*4882a593Smuzhiyun	case $cc_basename in
4454*4882a593Smuzhiyun	  KCC*)
4455*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4456*4882a593Smuzhiyun	    ;;
4457*4882a593Smuzhiyun	  RCC*)
4458*4882a593Smuzhiyun	    # Rational C++ 2.4.1
4459*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4460*4882a593Smuzhiyun	    ;;
4461*4882a593Smuzhiyun	  cxx*)
4462*4882a593Smuzhiyun	    # Digital/Compaq C++
4463*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4464*4882a593Smuzhiyun	    # Make sure the PIC flag is empty.  It appears that all Alpha
4465*4882a593Smuzhiyun	    # Linux and Compaq Tru64 Unix objects are PIC.
4466*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4467*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4468*4882a593Smuzhiyun	    ;;
4469*4882a593Smuzhiyun	  *)
4470*4882a593Smuzhiyun	    ;;
4471*4882a593Smuzhiyun	esac
4472*4882a593Smuzhiyun	;;
4473*4882a593Smuzhiyun      psos*)
4474*4882a593Smuzhiyun	;;
4475*4882a593Smuzhiyun      solaris*)
4476*4882a593Smuzhiyun	case $cc_basename in
4477*4882a593Smuzhiyun	  CC* | sunCC*)
4478*4882a593Smuzhiyun	    # Sun C++ 4.2, 5.x and Centerline C++
4479*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4480*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4481*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4482*4882a593Smuzhiyun	    ;;
4483*4882a593Smuzhiyun	  gcx*)
4484*4882a593Smuzhiyun	    # Green Hills C++ Compiler
4485*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4486*4882a593Smuzhiyun	    ;;
4487*4882a593Smuzhiyun	  *)
4488*4882a593Smuzhiyun	    ;;
4489*4882a593Smuzhiyun	esac
4490*4882a593Smuzhiyun	;;
4491*4882a593Smuzhiyun      sunos4*)
4492*4882a593Smuzhiyun	case $cc_basename in
4493*4882a593Smuzhiyun	  CC*)
4494*4882a593Smuzhiyun	    # Sun C++ 4.x
4495*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4496*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4497*4882a593Smuzhiyun	    ;;
4498*4882a593Smuzhiyun	  lcc*)
4499*4882a593Smuzhiyun	    # Lucid
4500*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4501*4882a593Smuzhiyun	    ;;
4502*4882a593Smuzhiyun	  *)
4503*4882a593Smuzhiyun	    ;;
4504*4882a593Smuzhiyun	esac
4505*4882a593Smuzhiyun	;;
4506*4882a593Smuzhiyun      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4507*4882a593Smuzhiyun	case $cc_basename in
4508*4882a593Smuzhiyun	  CC*)
4509*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4510*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4511*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4512*4882a593Smuzhiyun	    ;;
4513*4882a593Smuzhiyun	esac
4514*4882a593Smuzhiyun	;;
4515*4882a593Smuzhiyun      tandem*)
4516*4882a593Smuzhiyun	case $cc_basename in
4517*4882a593Smuzhiyun	  NCC*)
4518*4882a593Smuzhiyun	    # NonStop-UX NCC 3.20
4519*4882a593Smuzhiyun	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4520*4882a593Smuzhiyun	    ;;
4521*4882a593Smuzhiyun	  *)
4522*4882a593Smuzhiyun	    ;;
4523*4882a593Smuzhiyun	esac
4524*4882a593Smuzhiyun	;;
4525*4882a593Smuzhiyun      vxworks*)
4526*4882a593Smuzhiyun	;;
4527*4882a593Smuzhiyun      *)
4528*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4529*4882a593Smuzhiyun	;;
4530*4882a593Smuzhiyun    esac
4531*4882a593Smuzhiyun  fi
4532*4882a593Smuzhiyun],
4533*4882a593Smuzhiyun[
4534*4882a593Smuzhiyun  if test yes = "$GCC"; then
4535*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4536*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4537*4882a593Smuzhiyun
4538*4882a593Smuzhiyun    case $host_os in
4539*4882a593Smuzhiyun      aix*)
4540*4882a593Smuzhiyun      # All AIX code is PIC.
4541*4882a593Smuzhiyun      if test ia64 = "$host_cpu"; then
4542*4882a593Smuzhiyun	# AIX 5 now supports IA64 processor
4543*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4544*4882a593Smuzhiyun      fi
4545*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4546*4882a593Smuzhiyun      ;;
4547*4882a593Smuzhiyun
4548*4882a593Smuzhiyun    amigaos*)
4549*4882a593Smuzhiyun      case $host_cpu in
4550*4882a593Smuzhiyun      powerpc)
4551*4882a593Smuzhiyun            # see comment about AmigaOS4 .so support
4552*4882a593Smuzhiyun            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4553*4882a593Smuzhiyun        ;;
4554*4882a593Smuzhiyun      m68k)
4555*4882a593Smuzhiyun            # FIXME: we need at least 68020 code to build shared libraries, but
4556*4882a593Smuzhiyun            # adding the '-m68020' flag to GCC prevents building anything better,
4557*4882a593Smuzhiyun            # like '-m68040'.
4558*4882a593Smuzhiyun            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4559*4882a593Smuzhiyun        ;;
4560*4882a593Smuzhiyun      esac
4561*4882a593Smuzhiyun      ;;
4562*4882a593Smuzhiyun
4563*4882a593Smuzhiyun    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4564*4882a593Smuzhiyun      # PIC is the default for these OSes.
4565*4882a593Smuzhiyun      ;;
4566*4882a593Smuzhiyun
4567*4882a593Smuzhiyun    mingw* | cygwin* | pw32* | os2* | cegcc*)
4568*4882a593Smuzhiyun      # This hack is so that the source file can tell whether it is being
4569*4882a593Smuzhiyun      # built for inclusion in a dll (and should export symbols for example).
4570*4882a593Smuzhiyun      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4571*4882a593Smuzhiyun      # (--disable-auto-import) libraries
4572*4882a593Smuzhiyun      m4_if([$1], [GCJ], [],
4573*4882a593Smuzhiyun	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4574*4882a593Smuzhiyun      case $host_os in
4575*4882a593Smuzhiyun      os2*)
4576*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4577*4882a593Smuzhiyun	;;
4578*4882a593Smuzhiyun      esac
4579*4882a593Smuzhiyun      ;;
4580*4882a593Smuzhiyun
4581*4882a593Smuzhiyun    darwin* | rhapsody*)
4582*4882a593Smuzhiyun      # PIC is the default on this platform
4583*4882a593Smuzhiyun      # Common symbols not allowed in MH_DYLIB files
4584*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4585*4882a593Smuzhiyun      ;;
4586*4882a593Smuzhiyun
4587*4882a593Smuzhiyun    haiku*)
4588*4882a593Smuzhiyun      # PIC is the default for Haiku.
4589*4882a593Smuzhiyun      # The "-static" flag exists, but is broken.
4590*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4591*4882a593Smuzhiyun      ;;
4592*4882a593Smuzhiyun
4593*4882a593Smuzhiyun    hpux*)
4594*4882a593Smuzhiyun      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4595*4882a593Smuzhiyun      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4596*4882a593Smuzhiyun      # sets the default TLS model and affects inlining.
4597*4882a593Smuzhiyun      case $host_cpu in
4598*4882a593Smuzhiyun      hppa*64*)
4599*4882a593Smuzhiyun	# +Z the default
4600*4882a593Smuzhiyun	;;
4601*4882a593Smuzhiyun      *)
4602*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4603*4882a593Smuzhiyun	;;
4604*4882a593Smuzhiyun      esac
4605*4882a593Smuzhiyun      ;;
4606*4882a593Smuzhiyun
4607*4882a593Smuzhiyun    interix[[3-9]]*)
4608*4882a593Smuzhiyun      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4609*4882a593Smuzhiyun      # Instead, we relocate shared libraries at runtime.
4610*4882a593Smuzhiyun      ;;
4611*4882a593Smuzhiyun
4612*4882a593Smuzhiyun    msdosdjgpp*)
4613*4882a593Smuzhiyun      # Just because we use GCC doesn't mean we suddenly get shared libraries
4614*4882a593Smuzhiyun      # on systems that don't support them.
4615*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4616*4882a593Smuzhiyun      enable_shared=no
4617*4882a593Smuzhiyun      ;;
4618*4882a593Smuzhiyun
4619*4882a593Smuzhiyun    *nto* | *qnx*)
4620*4882a593Smuzhiyun      # QNX uses GNU C++, but need to define -shared option too, otherwise
4621*4882a593Smuzhiyun      # it will coredump.
4622*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4623*4882a593Smuzhiyun      ;;
4624*4882a593Smuzhiyun
4625*4882a593Smuzhiyun    sysv4*MP*)
4626*4882a593Smuzhiyun      if test -d /usr/nec; then
4627*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4628*4882a593Smuzhiyun      fi
4629*4882a593Smuzhiyun      ;;
4630*4882a593Smuzhiyun
4631*4882a593Smuzhiyun    *)
4632*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4633*4882a593Smuzhiyun      ;;
4634*4882a593Smuzhiyun    esac
4635*4882a593Smuzhiyun
4636*4882a593Smuzhiyun    case $cc_basename in
4637*4882a593Smuzhiyun    nvcc*) # Cuda Compiler Driver 2.2
4638*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4639*4882a593Smuzhiyun      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4640*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4641*4882a593Smuzhiyun      fi
4642*4882a593Smuzhiyun      ;;
4643*4882a593Smuzhiyun    esac
4644*4882a593Smuzhiyun  else
4645*4882a593Smuzhiyun    # PORTME Check for flag to pass linker flags through the system compiler.
4646*4882a593Smuzhiyun    case $host_os in
4647*4882a593Smuzhiyun    aix*)
4648*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4649*4882a593Smuzhiyun      if test ia64 = "$host_cpu"; then
4650*4882a593Smuzhiyun	# AIX 5 now supports IA64 processor
4651*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4652*4882a593Smuzhiyun      else
4653*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4654*4882a593Smuzhiyun      fi
4655*4882a593Smuzhiyun      ;;
4656*4882a593Smuzhiyun
4657*4882a593Smuzhiyun    darwin* | rhapsody*)
4658*4882a593Smuzhiyun      # PIC is the default on this platform
4659*4882a593Smuzhiyun      # Common symbols not allowed in MH_DYLIB files
4660*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4661*4882a593Smuzhiyun      case $cc_basename in
4662*4882a593Smuzhiyun      nagfor*)
4663*4882a593Smuzhiyun        # NAG Fortran compiler
4664*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4665*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4666*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4667*4882a593Smuzhiyun        ;;
4668*4882a593Smuzhiyun      esac
4669*4882a593Smuzhiyun      ;;
4670*4882a593Smuzhiyun
4671*4882a593Smuzhiyun    mingw* | cygwin* | pw32* | os2* | cegcc*)
4672*4882a593Smuzhiyun      # This hack is so that the source file can tell whether it is being
4673*4882a593Smuzhiyun      # built for inclusion in a dll (and should export symbols for example).
4674*4882a593Smuzhiyun      m4_if([$1], [GCJ], [],
4675*4882a593Smuzhiyun	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4676*4882a593Smuzhiyun      case $host_os in
4677*4882a593Smuzhiyun      os2*)
4678*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4679*4882a593Smuzhiyun	;;
4680*4882a593Smuzhiyun      esac
4681*4882a593Smuzhiyun      ;;
4682*4882a593Smuzhiyun
4683*4882a593Smuzhiyun    hpux9* | hpux10* | hpux11*)
4684*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4685*4882a593Smuzhiyun      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4686*4882a593Smuzhiyun      # not for PA HP-UX.
4687*4882a593Smuzhiyun      case $host_cpu in
4688*4882a593Smuzhiyun      hppa*64*|ia64*)
4689*4882a593Smuzhiyun	# +Z the default
4690*4882a593Smuzhiyun	;;
4691*4882a593Smuzhiyun      *)
4692*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4693*4882a593Smuzhiyun	;;
4694*4882a593Smuzhiyun      esac
4695*4882a593Smuzhiyun      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4696*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4697*4882a593Smuzhiyun      ;;
4698*4882a593Smuzhiyun
4699*4882a593Smuzhiyun    irix5* | irix6* | nonstopux*)
4700*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4701*4882a593Smuzhiyun      # PIC (with -KPIC) is the default.
4702*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4703*4882a593Smuzhiyun      ;;
4704*4882a593Smuzhiyun
4705*4882a593Smuzhiyun    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4706*4882a593Smuzhiyun      case $cc_basename in
4707*4882a593Smuzhiyun      # old Intel for x86_64, which still supported -KPIC.
4708*4882a593Smuzhiyun      ecc*)
4709*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4710*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4711*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4712*4882a593Smuzhiyun        ;;
4713*4882a593Smuzhiyun      # icc used to be incompatible with GCC.
4714*4882a593Smuzhiyun      # ICC 10 doesn't accept -KPIC any more.
4715*4882a593Smuzhiyun      icc* | ifort*)
4716*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4717*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4718*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4719*4882a593Smuzhiyun        ;;
4720*4882a593Smuzhiyun      # Lahey Fortran 8.1.
4721*4882a593Smuzhiyun      lf95*)
4722*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4723*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4724*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4725*4882a593Smuzhiyun	;;
4726*4882a593Smuzhiyun      nagfor*)
4727*4882a593Smuzhiyun	# NAG Fortran compiler
4728*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4729*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4730*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4731*4882a593Smuzhiyun	;;
4732*4882a593Smuzhiyun      tcc*)
4733*4882a593Smuzhiyun	# Fabrice Bellard et al's Tiny C Compiler
4734*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4735*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4736*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4737*4882a593Smuzhiyun	;;
4738*4882a593Smuzhiyun      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4739*4882a593Smuzhiyun        # Portland Group compilers (*not* the Pentium gcc compiler,
4740*4882a593Smuzhiyun	# which looks to be a dead project)
4741*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4742*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4743*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4744*4882a593Smuzhiyun        ;;
4745*4882a593Smuzhiyun      ccc*)
4746*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4747*4882a593Smuzhiyun        # All Alpha code is PIC.
4748*4882a593Smuzhiyun        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4749*4882a593Smuzhiyun        ;;
4750*4882a593Smuzhiyun      xl* | bgxl* | bgf* | mpixl*)
4751*4882a593Smuzhiyun	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4752*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4753*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4754*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4755*4882a593Smuzhiyun	;;
4756*4882a593Smuzhiyun      *)
4757*4882a593Smuzhiyun	case `$CC -V 2>&1 | sed 5q` in
4758*4882a593Smuzhiyun	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4759*4882a593Smuzhiyun	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4760*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4761*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4762*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4763*4882a593Smuzhiyun	  ;;
4764*4882a593Smuzhiyun	*Sun\ F* | *Sun*Fortran*)
4765*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4766*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4767*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4768*4882a593Smuzhiyun	  ;;
4769*4882a593Smuzhiyun	*Sun\ C*)
4770*4882a593Smuzhiyun	  # Sun C 5.9
4771*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4772*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4773*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4774*4882a593Smuzhiyun	  ;;
4775*4882a593Smuzhiyun        *Intel*\ [[CF]]*Compiler*)
4776*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4777*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4778*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4779*4882a593Smuzhiyun	  ;;
4780*4882a593Smuzhiyun	*Portland\ Group*)
4781*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4782*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4783*4882a593Smuzhiyun	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4784*4882a593Smuzhiyun	  ;;
4785*4882a593Smuzhiyun	esac
4786*4882a593Smuzhiyun	;;
4787*4882a593Smuzhiyun      esac
4788*4882a593Smuzhiyun      ;;
4789*4882a593Smuzhiyun
4790*4882a593Smuzhiyun    newsos6)
4791*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4792*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4793*4882a593Smuzhiyun      ;;
4794*4882a593Smuzhiyun
4795*4882a593Smuzhiyun    *nto* | *qnx*)
4796*4882a593Smuzhiyun      # QNX uses GNU C++, but need to define -shared option too, otherwise
4797*4882a593Smuzhiyun      # it will coredump.
4798*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4799*4882a593Smuzhiyun      ;;
4800*4882a593Smuzhiyun
4801*4882a593Smuzhiyun    osf3* | osf4* | osf5*)
4802*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4803*4882a593Smuzhiyun      # All OSF/1 code is PIC.
4804*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4805*4882a593Smuzhiyun      ;;
4806*4882a593Smuzhiyun
4807*4882a593Smuzhiyun    rdos*)
4808*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4809*4882a593Smuzhiyun      ;;
4810*4882a593Smuzhiyun
4811*4882a593Smuzhiyun    solaris*)
4812*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4813*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4814*4882a593Smuzhiyun      case $cc_basename in
4815*4882a593Smuzhiyun      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4816*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4817*4882a593Smuzhiyun      *)
4818*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4819*4882a593Smuzhiyun      esac
4820*4882a593Smuzhiyun      ;;
4821*4882a593Smuzhiyun
4822*4882a593Smuzhiyun    sunos4*)
4823*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4824*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4825*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4826*4882a593Smuzhiyun      ;;
4827*4882a593Smuzhiyun
4828*4882a593Smuzhiyun    sysv4 | sysv4.2uw2* | sysv4.3*)
4829*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4830*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4831*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4832*4882a593Smuzhiyun      ;;
4833*4882a593Smuzhiyun
4834*4882a593Smuzhiyun    sysv4*MP*)
4835*4882a593Smuzhiyun      if test -d /usr/nec; then
4836*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4837*4882a593Smuzhiyun	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4838*4882a593Smuzhiyun      fi
4839*4882a593Smuzhiyun      ;;
4840*4882a593Smuzhiyun
4841*4882a593Smuzhiyun    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4842*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4843*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4844*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4845*4882a593Smuzhiyun      ;;
4846*4882a593Smuzhiyun
4847*4882a593Smuzhiyun    unicos*)
4848*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4849*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4850*4882a593Smuzhiyun      ;;
4851*4882a593Smuzhiyun
4852*4882a593Smuzhiyun    uts4*)
4853*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4854*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4855*4882a593Smuzhiyun      ;;
4856*4882a593Smuzhiyun
4857*4882a593Smuzhiyun    *)
4858*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4859*4882a593Smuzhiyun      ;;
4860*4882a593Smuzhiyun    esac
4861*4882a593Smuzhiyun  fi
4862*4882a593Smuzhiyun])
4863*4882a593Smuzhiyuncase $host_os in
4864*4882a593Smuzhiyun  # For platforms that do not support PIC, -DPIC is meaningless:
4865*4882a593Smuzhiyun  *djgpp*)
4866*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4867*4882a593Smuzhiyun    ;;
4868*4882a593Smuzhiyun  *)
4869*4882a593Smuzhiyun    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4870*4882a593Smuzhiyun    ;;
4871*4882a593Smuzhiyunesac
4872*4882a593Smuzhiyun
4873*4882a593SmuzhiyunAC_CACHE_CHECK([for $compiler option to produce PIC],
4874*4882a593Smuzhiyun  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4875*4882a593Smuzhiyun  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4876*4882a593Smuzhiyun_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4877*4882a593Smuzhiyun
4878*4882a593Smuzhiyun#
4879*4882a593Smuzhiyun# Check to make sure the PIC flag actually works.
4880*4882a593Smuzhiyun#
4881*4882a593Smuzhiyunif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4882*4882a593Smuzhiyun  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4883*4882a593Smuzhiyun    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4884*4882a593Smuzhiyun    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4885*4882a593Smuzhiyun    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4886*4882a593Smuzhiyun     "" | " "*) ;;
4887*4882a593Smuzhiyun     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4888*4882a593Smuzhiyun     esac],
4889*4882a593Smuzhiyun    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4890*4882a593Smuzhiyun     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4891*4882a593Smuzhiyunfi
4892*4882a593Smuzhiyun_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4893*4882a593Smuzhiyun	[Additional compiler flags for building library objects])
4894*4882a593Smuzhiyun
4895*4882a593Smuzhiyun_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4896*4882a593Smuzhiyun	[How to pass a linker flag through the compiler])
4897*4882a593Smuzhiyun#
4898*4882a593Smuzhiyun# Check to make sure the static flag actually works.
4899*4882a593Smuzhiyun#
4900*4882a593Smuzhiyunwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4901*4882a593Smuzhiyun_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4902*4882a593Smuzhiyun  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4903*4882a593Smuzhiyun  $lt_tmp_static_flag,
4904*4882a593Smuzhiyun  [],
4905*4882a593Smuzhiyun  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4906*4882a593Smuzhiyun_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4907*4882a593Smuzhiyun	[Compiler flag to prevent dynamic linking])
4908*4882a593Smuzhiyun])# _LT_COMPILER_PIC
4909*4882a593Smuzhiyun
4910*4882a593Smuzhiyun
4911*4882a593Smuzhiyun# _LT_LINKER_SHLIBS([TAGNAME])
4912*4882a593Smuzhiyun# ----------------------------
4913*4882a593Smuzhiyun# See if the linker supports building shared libraries.
4914*4882a593Smuzhiyunm4_defun([_LT_LINKER_SHLIBS],
4915*4882a593Smuzhiyun[AC_REQUIRE([LT_PATH_LD])dnl
4916*4882a593SmuzhiyunAC_REQUIRE([LT_PATH_NM])dnl
4917*4882a593Smuzhiyunm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4918*4882a593Smuzhiyunm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4919*4882a593Smuzhiyunm4_require([_LT_DECL_EGREP])dnl
4920*4882a593Smuzhiyunm4_require([_LT_DECL_SED])dnl
4921*4882a593Smuzhiyunm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4922*4882a593Smuzhiyunm4_require([_LT_TAG_COMPILER])dnl
4923*4882a593SmuzhiyunAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4924*4882a593Smuzhiyunm4_if([$1], [CXX], [
4925*4882a593Smuzhiyun  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4926*4882a593Smuzhiyun  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4927*4882a593Smuzhiyun  case $host_os in
4928*4882a593Smuzhiyun  aix[[4-9]]*)
4929*4882a593Smuzhiyun    # If we're using GNU nm, then we don't want the "-C" option.
4930*4882a593Smuzhiyun    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4931*4882a593Smuzhiyun    # Without the "-l" option, or with the "-B" option, AIX nm treats
4932*4882a593Smuzhiyun    # weak defined symbols like other global defined symbols, whereas
4933*4882a593Smuzhiyun    # GNU nm marks them as "W".
4934*4882a593Smuzhiyun    # While the 'weak' keyword is ignored in the Export File, we need
4935*4882a593Smuzhiyun    # it in the Import File for the 'aix-soname' feature, so we have
4936*4882a593Smuzhiyun    # to replace the "-B" option with "-P" for AIX nm.
4937*4882a593Smuzhiyun    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4938*4882a593Smuzhiyun      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4939*4882a593Smuzhiyun    else
4940*4882a593Smuzhiyun      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4941*4882a593Smuzhiyun    fi
4942*4882a593Smuzhiyun    ;;
4943*4882a593Smuzhiyun  pw32*)
4944*4882a593Smuzhiyun    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4945*4882a593Smuzhiyun    ;;
4946*4882a593Smuzhiyun  cygwin* | mingw* | cegcc*)
4947*4882a593Smuzhiyun    case $cc_basename in
4948*4882a593Smuzhiyun    cl*)
4949*4882a593Smuzhiyun      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4950*4882a593Smuzhiyun      ;;
4951*4882a593Smuzhiyun    *)
4952*4882a593Smuzhiyun      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
4953*4882a593Smuzhiyun      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4954*4882a593Smuzhiyun      ;;
4955*4882a593Smuzhiyun    esac
4956*4882a593Smuzhiyun    ;;
4957*4882a593Smuzhiyun  *)
4958*4882a593Smuzhiyun    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4959*4882a593Smuzhiyun    ;;
4960*4882a593Smuzhiyun  esac
4961*4882a593Smuzhiyun], [
4962*4882a593Smuzhiyun  runpath_var=
4963*4882a593Smuzhiyun  _LT_TAGVAR(allow_undefined_flag, $1)=
4964*4882a593Smuzhiyun  _LT_TAGVAR(always_export_symbols, $1)=no
4965*4882a593Smuzhiyun  _LT_TAGVAR(archive_cmds, $1)=
4966*4882a593Smuzhiyun  _LT_TAGVAR(archive_expsym_cmds, $1)=
4967*4882a593Smuzhiyun  _LT_TAGVAR(compiler_needs_object, $1)=no
4968*4882a593Smuzhiyun  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4969*4882a593Smuzhiyun  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4970*4882a593Smuzhiyun  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4971*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_automatic, $1)=no
4972*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_direct, $1)=no
4973*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4974*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4975*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4976*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_minus_L, $1)=no
4977*4882a593Smuzhiyun  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4978*4882a593Smuzhiyun  _LT_TAGVAR(inherit_rpath, $1)=no
4979*4882a593Smuzhiyun  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4980*4882a593Smuzhiyun  _LT_TAGVAR(module_cmds, $1)=
4981*4882a593Smuzhiyun  _LT_TAGVAR(module_expsym_cmds, $1)=
4982*4882a593Smuzhiyun  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4983*4882a593Smuzhiyun  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4984*4882a593Smuzhiyun  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4985*4882a593Smuzhiyun  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4986*4882a593Smuzhiyun  # include_expsyms should be a list of space-separated symbols to be *always*
4987*4882a593Smuzhiyun  # included in the symbol list
4988*4882a593Smuzhiyun  _LT_TAGVAR(include_expsyms, $1)=
4989*4882a593Smuzhiyun  # exclude_expsyms can be an extended regexp of symbols to exclude
4990*4882a593Smuzhiyun  # it will be wrapped by ' (' and ')$', so one must not match beginning or
4991*4882a593Smuzhiyun  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4992*4882a593Smuzhiyun  # as well as any symbol that contains 'd'.
4993*4882a593Smuzhiyun  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4994*4882a593Smuzhiyun  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4995*4882a593Smuzhiyun  # platforms (ab)use it in PIC code, but their linkers get confused if
4996*4882a593Smuzhiyun  # the symbol is explicitly referenced.  Since portable code cannot
4997*4882a593Smuzhiyun  # rely on this symbol name, it's probably fine to never include it in
4998*4882a593Smuzhiyun  # preloaded symbol tables.
4999*4882a593Smuzhiyun  # Exclude shared library initialization/finalization symbols.
5000*4882a593Smuzhiyundnl Note also adjust exclude_expsyms for C++ above.
5001*4882a593Smuzhiyun  extract_expsyms_cmds=
5002*4882a593Smuzhiyun
5003*4882a593Smuzhiyun  case $host_os in
5004*4882a593Smuzhiyun  cygwin* | mingw* | pw32* | cegcc*)
5005*4882a593Smuzhiyun    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5006*4882a593Smuzhiyun    # When not using gcc, we currently assume that we are using
5007*4882a593Smuzhiyun    # Microsoft Visual C++.
5008*4882a593Smuzhiyun    if test yes != "$GCC"; then
5009*4882a593Smuzhiyun      with_gnu_ld=no
5010*4882a593Smuzhiyun    fi
5011*4882a593Smuzhiyun    ;;
5012*4882a593Smuzhiyun  interix*)
5013*4882a593Smuzhiyun    # we just hope/assume this is gcc and not c89 (= MSVC++)
5014*4882a593Smuzhiyun    with_gnu_ld=yes
5015*4882a593Smuzhiyun    ;;
5016*4882a593Smuzhiyun  openbsd* | bitrig*)
5017*4882a593Smuzhiyun    with_gnu_ld=no
5018*4882a593Smuzhiyun    ;;
5019*4882a593Smuzhiyun  esac
5020*4882a593Smuzhiyun
5021*4882a593Smuzhiyun  _LT_TAGVAR(ld_shlibs, $1)=yes
5022*4882a593Smuzhiyun
5023*4882a593Smuzhiyun  # On some targets, GNU ld is compatible enough with the native linker
5024*4882a593Smuzhiyun  # that we're better off using the native interface for both.
5025*4882a593Smuzhiyun  lt_use_gnu_ld_interface=no
5026*4882a593Smuzhiyun  if test yes = "$with_gnu_ld"; then
5027*4882a593Smuzhiyun    case $host_os in
5028*4882a593Smuzhiyun      aix*)
5029*4882a593Smuzhiyun	# The AIX port of GNU ld has always aspired to compatibility
5030*4882a593Smuzhiyun	# with the native linker.  However, as the warning in the GNU ld
5031*4882a593Smuzhiyun	# block says, versions before 2.19.5* couldn't really create working
5032*4882a593Smuzhiyun	# shared libraries, regardless of the interface used.
5033*4882a593Smuzhiyun	case `$LD -v 2>&1` in
5034*4882a593Smuzhiyun	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5035*4882a593Smuzhiyun	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5036*4882a593Smuzhiyun	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5037*4882a593Smuzhiyun	  *)
5038*4882a593Smuzhiyun	    lt_use_gnu_ld_interface=yes
5039*4882a593Smuzhiyun	    ;;
5040*4882a593Smuzhiyun	esac
5041*4882a593Smuzhiyun	;;
5042*4882a593Smuzhiyun      *)
5043*4882a593Smuzhiyun	lt_use_gnu_ld_interface=yes
5044*4882a593Smuzhiyun	;;
5045*4882a593Smuzhiyun    esac
5046*4882a593Smuzhiyun  fi
5047*4882a593Smuzhiyun
5048*4882a593Smuzhiyun  if test yes = "$lt_use_gnu_ld_interface"; then
5049*4882a593Smuzhiyun    # If archive_cmds runs LD, not CC, wlarc should be empty
5050*4882a593Smuzhiyun    wlarc='$wl'
5051*4882a593Smuzhiyun
5052*4882a593Smuzhiyun    # Set some defaults for GNU ld with shared library support. These
5053*4882a593Smuzhiyun    # are reset later if shared libraries are not supported. Putting them
5054*4882a593Smuzhiyun    # here allows them to be overridden if necessary.
5055*4882a593Smuzhiyun    runpath_var=LD_RUN_PATH
5056*4882a593Smuzhiyun    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5057*4882a593Smuzhiyun    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5058*4882a593Smuzhiyun    # ancient GNU ld didn't support --whole-archive et. al.
5059*4882a593Smuzhiyun    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5060*4882a593Smuzhiyun      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5061*4882a593Smuzhiyun    else
5062*4882a593Smuzhiyun      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5063*4882a593Smuzhiyun    fi
5064*4882a593Smuzhiyun    supports_anon_versioning=no
5065*4882a593Smuzhiyun    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5066*4882a593Smuzhiyun      *GNU\ gold*) supports_anon_versioning=yes ;;
5067*4882a593Smuzhiyun      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5068*4882a593Smuzhiyun      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5069*4882a593Smuzhiyun      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5070*4882a593Smuzhiyun      *\ 2.11.*) ;; # other 2.11 versions
5071*4882a593Smuzhiyun      *) supports_anon_versioning=yes ;;
5072*4882a593Smuzhiyun    esac
5073*4882a593Smuzhiyun
5074*4882a593Smuzhiyun    # See if GNU ld supports shared libraries.
5075*4882a593Smuzhiyun    case $host_os in
5076*4882a593Smuzhiyun    aix[[3-9]]*)
5077*4882a593Smuzhiyun      # On AIX/PPC, the GNU linker is very broken
5078*4882a593Smuzhiyun      if test ia64 != "$host_cpu"; then
5079*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5080*4882a593Smuzhiyun	cat <<_LT_EOF 1>&2
5081*4882a593Smuzhiyun
5082*4882a593Smuzhiyun*** Warning: the GNU linker, at least up to release 2.19, is reported
5083*4882a593Smuzhiyun*** to be unable to reliably create shared libraries on AIX.
5084*4882a593Smuzhiyun*** Therefore, libtool is disabling shared libraries support.  If you
5085*4882a593Smuzhiyun*** really care for shared libraries, you may want to install binutils
5086*4882a593Smuzhiyun*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5087*4882a593Smuzhiyun*** You will then need to restart the configuration process.
5088*4882a593Smuzhiyun
5089*4882a593Smuzhiyun_LT_EOF
5090*4882a593Smuzhiyun      fi
5091*4882a593Smuzhiyun      ;;
5092*4882a593Smuzhiyun
5093*4882a593Smuzhiyun    amigaos*)
5094*4882a593Smuzhiyun      case $host_cpu in
5095*4882a593Smuzhiyun      powerpc)
5096*4882a593Smuzhiyun            # see comment about AmigaOS4 .so support
5097*4882a593Smuzhiyun            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5098*4882a593Smuzhiyun            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5099*4882a593Smuzhiyun        ;;
5100*4882a593Smuzhiyun      m68k)
5101*4882a593Smuzhiyun            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5102*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5103*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5104*4882a593Smuzhiyun        ;;
5105*4882a593Smuzhiyun      esac
5106*4882a593Smuzhiyun      ;;
5107*4882a593Smuzhiyun
5108*4882a593Smuzhiyun    beos*)
5109*4882a593Smuzhiyun      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5110*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5111*4882a593Smuzhiyun	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5112*4882a593Smuzhiyun	# support --undefined.  This deserves some investigation.  FIXME
5113*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5114*4882a593Smuzhiyun      else
5115*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5116*4882a593Smuzhiyun      fi
5117*4882a593Smuzhiyun      ;;
5118*4882a593Smuzhiyun
5119*4882a593Smuzhiyun    cygwin* | mingw* | pw32* | cegcc*)
5120*4882a593Smuzhiyun      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5121*4882a593Smuzhiyun      # as there is no search path for DLLs.
5122*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5123*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5124*4882a593Smuzhiyun      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5125*4882a593Smuzhiyun      _LT_TAGVAR(always_export_symbols, $1)=no
5126*4882a593Smuzhiyun      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5127*4882a593Smuzhiyun      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
5128*4882a593Smuzhiyun      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5129*4882a593Smuzhiyun
5130*4882a593Smuzhiyun      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5131*4882a593Smuzhiyun        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5132*4882a593Smuzhiyun	# If the export-symbols file already is a .def file, use it as
5133*4882a593Smuzhiyun	# is; otherwise, prepend EXPORTS...
5134*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5135*4882a593Smuzhiyun          cp $export_symbols $output_objdir/$soname.def;
5136*4882a593Smuzhiyun        else
5137*4882a593Smuzhiyun          echo EXPORTS > $output_objdir/$soname.def;
5138*4882a593Smuzhiyun          cat $export_symbols >> $output_objdir/$soname.def;
5139*4882a593Smuzhiyun        fi~
5140*4882a593Smuzhiyun        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5141*4882a593Smuzhiyun      else
5142*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5143*4882a593Smuzhiyun      fi
5144*4882a593Smuzhiyun      ;;
5145*4882a593Smuzhiyun
5146*4882a593Smuzhiyun    haiku*)
5147*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5148*4882a593Smuzhiyun      _LT_TAGVAR(link_all_deplibs, $1)=yes
5149*4882a593Smuzhiyun      ;;
5150*4882a593Smuzhiyun
5151*4882a593Smuzhiyun    os2*)
5152*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5153*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5154*4882a593Smuzhiyun      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5155*4882a593Smuzhiyun      shrext_cmds=.dll
5156*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5157*4882a593Smuzhiyun	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5158*4882a593Smuzhiyun	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5159*4882a593Smuzhiyun	$ECHO EXPORTS >> $output_objdir/$libname.def~
5160*4882a593Smuzhiyun	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5161*4882a593Smuzhiyun	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5162*4882a593Smuzhiyun	emximp -o $lib $output_objdir/$libname.def'
5163*4882a593Smuzhiyun      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5164*4882a593Smuzhiyun	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5165*4882a593Smuzhiyun	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5166*4882a593Smuzhiyun	$ECHO EXPORTS >> $output_objdir/$libname.def~
5167*4882a593Smuzhiyun	prefix_cmds="$SED"~
5168*4882a593Smuzhiyun	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5169*4882a593Smuzhiyun	  prefix_cmds="$prefix_cmds -e 1d";
5170*4882a593Smuzhiyun	fi~
5171*4882a593Smuzhiyun	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5172*4882a593Smuzhiyun	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5173*4882a593Smuzhiyun	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5174*4882a593Smuzhiyun	emximp -o $lib $output_objdir/$libname.def'
5175*4882a593Smuzhiyun      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5176*4882a593Smuzhiyun      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5177*4882a593Smuzhiyun      ;;
5178*4882a593Smuzhiyun
5179*4882a593Smuzhiyun    interix[[3-9]]*)
5180*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=no
5181*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5182*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5183*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5184*4882a593Smuzhiyun      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5185*4882a593Smuzhiyun      # Instead, shared libraries are loaded at an image base (0x10000000 by
5186*4882a593Smuzhiyun      # default) and relocated if they conflict, which is a slow very memory
5187*4882a593Smuzhiyun      # consuming and fragmenting process.  To avoid this, we pick a random,
5188*4882a593Smuzhiyun      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5189*4882a593Smuzhiyun      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5190*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5191*4882a593Smuzhiyun      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
5192*4882a593Smuzhiyun      ;;
5193*4882a593Smuzhiyun
5194*4882a593Smuzhiyun    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5195*4882a593Smuzhiyun      tmp_diet=no
5196*4882a593Smuzhiyun      if test linux-dietlibc = "$host_os"; then
5197*4882a593Smuzhiyun	case $cc_basename in
5198*4882a593Smuzhiyun	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5199*4882a593Smuzhiyun	esac
5200*4882a593Smuzhiyun      fi
5201*4882a593Smuzhiyun      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5202*4882a593Smuzhiyun	 && test no = "$tmp_diet"
5203*4882a593Smuzhiyun      then
5204*4882a593Smuzhiyun	tmp_addflag=' $pic_flag'
5205*4882a593Smuzhiyun	tmp_sharedflag='-shared'
5206*4882a593Smuzhiyun	case $cc_basename,$host_cpu in
5207*4882a593Smuzhiyun        pgcc*)				# Portland Group C compiler
5208*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5209*4882a593Smuzhiyun	  tmp_addflag=' $pic_flag'
5210*4882a593Smuzhiyun	  ;;
5211*4882a593Smuzhiyun	pgf77* | pgf90* | pgf95* | pgfortran*)
5212*4882a593Smuzhiyun					# Portland Group f77 and f90 compilers
5213*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5214*4882a593Smuzhiyun	  tmp_addflag=' $pic_flag -Mnomain' ;;
5215*4882a593Smuzhiyun	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5216*4882a593Smuzhiyun	  tmp_addflag=' -i_dynamic' ;;
5217*4882a593Smuzhiyun	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5218*4882a593Smuzhiyun	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5219*4882a593Smuzhiyun	ifc* | ifort*)			# Intel Fortran compiler
5220*4882a593Smuzhiyun	  tmp_addflag=' -nofor_main' ;;
5221*4882a593Smuzhiyun	lf95*)				# Lahey Fortran 8.1
5222*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5223*4882a593Smuzhiyun	  tmp_sharedflag='--shared' ;;
5224*4882a593Smuzhiyun        nagfor*)                        # NAGFOR 5.3
5225*4882a593Smuzhiyun          tmp_sharedflag='-Wl,-shared' ;;
5226*4882a593Smuzhiyun	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5227*4882a593Smuzhiyun	  tmp_sharedflag='-qmkshrobj'
5228*4882a593Smuzhiyun	  tmp_addflag= ;;
5229*4882a593Smuzhiyun	nvcc*)	# Cuda Compiler Driver 2.2
5230*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5231*4882a593Smuzhiyun	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5232*4882a593Smuzhiyun	  ;;
5233*4882a593Smuzhiyun	esac
5234*4882a593Smuzhiyun	case `$CC -V 2>&1 | sed 5q` in
5235*4882a593Smuzhiyun	*Sun\ C*)			# Sun C 5.9
5236*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
5237*4882a593Smuzhiyun	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5238*4882a593Smuzhiyun	  tmp_sharedflag='-G' ;;
5239*4882a593Smuzhiyun	*Sun\ F*)			# Sun Fortran 8.3
5240*4882a593Smuzhiyun	  tmp_sharedflag='-G' ;;
5241*4882a593Smuzhiyun	esac
5242*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5243*4882a593Smuzhiyun
5244*4882a593Smuzhiyun        if test yes = "$supports_anon_versioning"; then
5245*4882a593Smuzhiyun          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5246*4882a593Smuzhiyun            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5247*4882a593Smuzhiyun            echo "local: *; };" >> $output_objdir/$libname.ver~
5248*4882a593Smuzhiyun            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5249*4882a593Smuzhiyun        fi
5250*4882a593Smuzhiyun
5251*4882a593Smuzhiyun	case $cc_basename in
5252*4882a593Smuzhiyun	tcc*)
5253*4882a593Smuzhiyun	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5254*4882a593Smuzhiyun	  ;;
5255*4882a593Smuzhiyun	xlf* | bgf* | bgxlf* | mpixlf*)
5256*4882a593Smuzhiyun	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5257*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5258*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5259*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5260*4882a593Smuzhiyun	  if test yes = "$supports_anon_versioning"; then
5261*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5262*4882a593Smuzhiyun              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5263*4882a593Smuzhiyun              echo "local: *; };" >> $output_objdir/$libname.ver~
5264*4882a593Smuzhiyun              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5265*4882a593Smuzhiyun	  fi
5266*4882a593Smuzhiyun	  ;;
5267*4882a593Smuzhiyun	esac
5268*4882a593Smuzhiyun      else
5269*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
5270*4882a593Smuzhiyun      fi
5271*4882a593Smuzhiyun      ;;
5272*4882a593Smuzhiyun
5273*4882a593Smuzhiyun    netbsd*)
5274*4882a593Smuzhiyun      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5275*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5276*4882a593Smuzhiyun	wlarc=
5277*4882a593Smuzhiyun      else
5278*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5279*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5280*4882a593Smuzhiyun      fi
5281*4882a593Smuzhiyun      ;;
5282*4882a593Smuzhiyun
5283*4882a593Smuzhiyun    solaris*)
5284*4882a593Smuzhiyun      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5285*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5286*4882a593Smuzhiyun	cat <<_LT_EOF 1>&2
5287*4882a593Smuzhiyun
5288*4882a593Smuzhiyun*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5289*4882a593Smuzhiyun*** create shared libraries on Solaris systems.  Therefore, libtool
5290*4882a593Smuzhiyun*** is disabling shared libraries support.  We urge you to upgrade GNU
5291*4882a593Smuzhiyun*** binutils to release 2.9.1 or newer.  Another option is to modify
5292*4882a593Smuzhiyun*** your PATH or compiler configuration so that the native linker is
5293*4882a593Smuzhiyun*** used, and then restart.
5294*4882a593Smuzhiyun
5295*4882a593Smuzhiyun_LT_EOF
5296*4882a593Smuzhiyun      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5297*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5298*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5299*4882a593Smuzhiyun      else
5300*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5301*4882a593Smuzhiyun      fi
5302*4882a593Smuzhiyun      ;;
5303*4882a593Smuzhiyun
5304*4882a593Smuzhiyun    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5305*4882a593Smuzhiyun      case `$LD -v 2>&1` in
5306*4882a593Smuzhiyun        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5307*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5308*4882a593Smuzhiyun	cat <<_LT_EOF 1>&2
5309*4882a593Smuzhiyun
5310*4882a593Smuzhiyun*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5311*4882a593Smuzhiyun*** reliably create shared libraries on SCO systems.  Therefore, libtool
5312*4882a593Smuzhiyun*** is disabling shared libraries support.  We urge you to upgrade GNU
5313*4882a593Smuzhiyun*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5314*4882a593Smuzhiyun*** your PATH or compiler configuration so that the native linker is
5315*4882a593Smuzhiyun*** used, and then restart.
5316*4882a593Smuzhiyun
5317*4882a593Smuzhiyun_LT_EOF
5318*4882a593Smuzhiyun	;;
5319*4882a593Smuzhiyun	*)
5320*4882a593Smuzhiyun	  # For security reasons, it is highly recommended that you always
5321*4882a593Smuzhiyun	  # use absolute paths for naming shared libraries, and exclude the
5322*4882a593Smuzhiyun	  # DT_RUNPATH tag from executables and libraries.  But doing so
5323*4882a593Smuzhiyun	  # requires that you compile everything twice, which is a pain.
5324*4882a593Smuzhiyun	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5325*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5326*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5327*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5328*4882a593Smuzhiyun	  else
5329*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
5330*4882a593Smuzhiyun	  fi
5331*4882a593Smuzhiyun	;;
5332*4882a593Smuzhiyun      esac
5333*4882a593Smuzhiyun      ;;
5334*4882a593Smuzhiyun
5335*4882a593Smuzhiyun    sunos4*)
5336*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5337*4882a593Smuzhiyun      wlarc=
5338*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5339*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5340*4882a593Smuzhiyun      ;;
5341*4882a593Smuzhiyun
5342*4882a593Smuzhiyun    *)
5343*4882a593Smuzhiyun      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5344*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5345*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
5346*4882a593Smuzhiyun      else
5347*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5348*4882a593Smuzhiyun      fi
5349*4882a593Smuzhiyun      ;;
5350*4882a593Smuzhiyun    esac
5351*4882a593Smuzhiyun
5352*4882a593Smuzhiyun    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5353*4882a593Smuzhiyun      runpath_var=
5354*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5355*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5356*4882a593Smuzhiyun      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5357*4882a593Smuzhiyun    fi
5358*4882a593Smuzhiyun  else
5359*4882a593Smuzhiyun    # PORTME fill in a description of your system's linker (not GNU ld)
5360*4882a593Smuzhiyun    case $host_os in
5361*4882a593Smuzhiyun    aix3*)
5362*4882a593Smuzhiyun      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5363*4882a593Smuzhiyun      _LT_TAGVAR(always_export_symbols, $1)=yes
5364*4882a593Smuzhiyun      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
5365*4882a593Smuzhiyun      # Note: this linker hardcodes the directories in LIBPATH if there
5366*4882a593Smuzhiyun      # are no directories specified by -L.
5367*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5368*4882a593Smuzhiyun      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5369*4882a593Smuzhiyun	# Neither direct hardcoding nor static linking is supported with a
5370*4882a593Smuzhiyun	# broken collect2.
5371*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5372*4882a593Smuzhiyun      fi
5373*4882a593Smuzhiyun      ;;
5374*4882a593Smuzhiyun
5375*4882a593Smuzhiyun    aix[[4-9]]*)
5376*4882a593Smuzhiyun      if test ia64 = "$host_cpu"; then
5377*4882a593Smuzhiyun	# On IA64, the linker does run time linking by default, so we don't
5378*4882a593Smuzhiyun	# have to do anything special.
5379*4882a593Smuzhiyun	aix_use_runtimelinking=no
5380*4882a593Smuzhiyun	exp_sym_flag='-Bexport'
5381*4882a593Smuzhiyun	no_entry_flag=
5382*4882a593Smuzhiyun      else
5383*4882a593Smuzhiyun	# If we're using GNU nm, then we don't want the "-C" option.
5384*4882a593Smuzhiyun	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5385*4882a593Smuzhiyun	# Without the "-l" option, or with the "-B" option, AIX nm treats
5386*4882a593Smuzhiyun	# weak defined symbols like other global defined symbols, whereas
5387*4882a593Smuzhiyun	# GNU nm marks them as "W".
5388*4882a593Smuzhiyun	# While the 'weak' keyword is ignored in the Export File, we need
5389*4882a593Smuzhiyun	# it in the Import File for the 'aix-soname' feature, so we have
5390*4882a593Smuzhiyun	# to replace the "-B" option with "-P" for AIX nm.
5391*4882a593Smuzhiyun	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5392*4882a593Smuzhiyun	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
5393*4882a593Smuzhiyun	else
5394*4882a593Smuzhiyun	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
5395*4882a593Smuzhiyun	fi
5396*4882a593Smuzhiyun	aix_use_runtimelinking=no
5397*4882a593Smuzhiyun
5398*4882a593Smuzhiyun	# Test if we are trying to use run time linking or normal
5399*4882a593Smuzhiyun	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5400*4882a593Smuzhiyun	# have runtime linking enabled, and use it for executables.
5401*4882a593Smuzhiyun	# For shared libraries, we enable/disable runtime linking
5402*4882a593Smuzhiyun	# depending on the kind of the shared library created -
5403*4882a593Smuzhiyun	# when "with_aix_soname,aix_use_runtimelinking" is:
5404*4882a593Smuzhiyun	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5405*4882a593Smuzhiyun	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5406*4882a593Smuzhiyun	#            lib.a           static archive
5407*4882a593Smuzhiyun	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5408*4882a593Smuzhiyun	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5409*4882a593Smuzhiyun	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5410*4882a593Smuzhiyun	#            lib.a(lib.so.V) shared, rtl:no
5411*4882a593Smuzhiyun	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5412*4882a593Smuzhiyun	#            lib.a           static archive
5413*4882a593Smuzhiyun	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5414*4882a593Smuzhiyun	  for ld_flag in $LDFLAGS; do
5415*4882a593Smuzhiyun	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5416*4882a593Smuzhiyun	    aix_use_runtimelinking=yes
5417*4882a593Smuzhiyun	    break
5418*4882a593Smuzhiyun	  fi
5419*4882a593Smuzhiyun	  done
5420*4882a593Smuzhiyun	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5421*4882a593Smuzhiyun	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5422*4882a593Smuzhiyun	    # so we don't have lib.a shared libs to link our executables.
5423*4882a593Smuzhiyun	    # We have to force runtime linking in this case.
5424*4882a593Smuzhiyun	    aix_use_runtimelinking=yes
5425*4882a593Smuzhiyun	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5426*4882a593Smuzhiyun	  fi
5427*4882a593Smuzhiyun	  ;;
5428*4882a593Smuzhiyun	esac
5429*4882a593Smuzhiyun
5430*4882a593Smuzhiyun	exp_sym_flag='-bexport'
5431*4882a593Smuzhiyun	no_entry_flag='-bnoentry'
5432*4882a593Smuzhiyun      fi
5433*4882a593Smuzhiyun
5434*4882a593Smuzhiyun      # When large executables or shared objects are built, AIX ld can
5435*4882a593Smuzhiyun      # have problems creating the table of contents.  If linking a library
5436*4882a593Smuzhiyun      # or program results in "error TOC overflow" add -mminimal-toc to
5437*4882a593Smuzhiyun      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5438*4882a593Smuzhiyun      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5439*4882a593Smuzhiyun
5440*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)=''
5441*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5442*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5443*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5444*4882a593Smuzhiyun      _LT_TAGVAR(link_all_deplibs, $1)=yes
5445*4882a593Smuzhiyun      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5446*4882a593Smuzhiyun      case $with_aix_soname,$aix_use_runtimelinking in
5447*4882a593Smuzhiyun      aix,*) ;; # traditional, no import file
5448*4882a593Smuzhiyun      svr4,* | *,yes) # use import file
5449*4882a593Smuzhiyun	# The Import File defines what to hardcode.
5450*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct, $1)=no
5451*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5452*4882a593Smuzhiyun	;;
5453*4882a593Smuzhiyun      esac
5454*4882a593Smuzhiyun
5455*4882a593Smuzhiyun      if test yes = "$GCC"; then
5456*4882a593Smuzhiyun	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5457*4882a593Smuzhiyun	# We only want to do this on AIX 4.2 and lower, the check
5458*4882a593Smuzhiyun	# below for broken collect2 doesn't work under 4.3+
5459*4882a593Smuzhiyun	  collect2name=`$CC -print-prog-name=collect2`
5460*4882a593Smuzhiyun	  if test -f "$collect2name" &&
5461*4882a593Smuzhiyun	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5462*4882a593Smuzhiyun	  then
5463*4882a593Smuzhiyun	  # We have reworked collect2
5464*4882a593Smuzhiyun	  :
5465*4882a593Smuzhiyun	  else
5466*4882a593Smuzhiyun	  # We have old collect2
5467*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5468*4882a593Smuzhiyun	  # It fails to find uninstalled libraries when the uninstalled
5469*4882a593Smuzhiyun	  # path is not listed in the libpath.  Setting hardcode_minus_L
5470*4882a593Smuzhiyun	  # to unsupported forces relinking
5471*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5472*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5473*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5474*4882a593Smuzhiyun	  fi
5475*4882a593Smuzhiyun	  ;;
5476*4882a593Smuzhiyun	esac
5477*4882a593Smuzhiyun	shared_flag='-shared'
5478*4882a593Smuzhiyun	if test yes = "$aix_use_runtimelinking"; then
5479*4882a593Smuzhiyun	  shared_flag="$shared_flag "'$wl-G'
5480*4882a593Smuzhiyun	fi
5481*4882a593Smuzhiyun	# Need to ensure runtime linking is disabled for the traditional
5482*4882a593Smuzhiyun	# shared library, or the linker may eventually find shared libraries
5483*4882a593Smuzhiyun	# /with/ Import File - we do not want to mix them.
5484*4882a593Smuzhiyun	shared_flag_aix='-shared'
5485*4882a593Smuzhiyun	shared_flag_svr4='-shared $wl-G'
5486*4882a593Smuzhiyun      else
5487*4882a593Smuzhiyun	# not using gcc
5488*4882a593Smuzhiyun	if test ia64 = "$host_cpu"; then
5489*4882a593Smuzhiyun	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5490*4882a593Smuzhiyun	# chokes on -Wl,-G. The following line is correct:
5491*4882a593Smuzhiyun	  shared_flag='-G'
5492*4882a593Smuzhiyun	else
5493*4882a593Smuzhiyun	  if test yes = "$aix_use_runtimelinking"; then
5494*4882a593Smuzhiyun	    shared_flag='$wl-G'
5495*4882a593Smuzhiyun	  else
5496*4882a593Smuzhiyun	    shared_flag='$wl-bM:SRE'
5497*4882a593Smuzhiyun	  fi
5498*4882a593Smuzhiyun	  shared_flag_aix='$wl-bM:SRE'
5499*4882a593Smuzhiyun	  shared_flag_svr4='$wl-G'
5500*4882a593Smuzhiyun	fi
5501*4882a593Smuzhiyun      fi
5502*4882a593Smuzhiyun
5503*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5504*4882a593Smuzhiyun      # It seems that -bexpall does not export symbols beginning with
5505*4882a593Smuzhiyun      # underscore (_), so it is better to generate a list of symbols to export.
5506*4882a593Smuzhiyun      _LT_TAGVAR(always_export_symbols, $1)=yes
5507*4882a593Smuzhiyun      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5508*4882a593Smuzhiyun	# Warning - without using the other runtime loading flags (-brtl),
5509*4882a593Smuzhiyun	# -berok will link without error, but may produce a broken library.
5510*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5511*4882a593Smuzhiyun        # Determine the default libpath from the value encoded in an
5512*4882a593Smuzhiyun        # empty executable.
5513*4882a593Smuzhiyun        _LT_SYS_MODULE_PATH_AIX([$1])
5514*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5515*4882a593Smuzhiyun        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5516*4882a593Smuzhiyun      else
5517*4882a593Smuzhiyun	if test ia64 = "$host_cpu"; then
5518*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5519*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5520*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
5521*4882a593Smuzhiyun	else
5522*4882a593Smuzhiyun	 # Determine the default libpath from the value encoded in an
5523*4882a593Smuzhiyun	 # empty executable.
5524*4882a593Smuzhiyun	 _LT_SYS_MODULE_PATH_AIX([$1])
5525*4882a593Smuzhiyun	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5526*4882a593Smuzhiyun	  # Warning - without using the other run time loading flags,
5527*4882a593Smuzhiyun	  # -berok will link without error, but may produce a broken library.
5528*4882a593Smuzhiyun	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5529*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5530*4882a593Smuzhiyun	  if test yes = "$with_gnu_ld"; then
5531*4882a593Smuzhiyun	    # We only use this code for GNU lds that support --whole-archive.
5532*4882a593Smuzhiyun	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5533*4882a593Smuzhiyun	  else
5534*4882a593Smuzhiyun	    # Exported symbols can be pulled into shared objects from archives
5535*4882a593Smuzhiyun	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5536*4882a593Smuzhiyun	  fi
5537*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5538*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5539*4882a593Smuzhiyun	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5540*4882a593Smuzhiyun	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5541*4882a593Smuzhiyun	  if test svr4 != "$with_aix_soname"; then
5542*4882a593Smuzhiyun	    # This is similar to how AIX traditionally builds its shared libraries.
5543*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5544*4882a593Smuzhiyun	  fi
5545*4882a593Smuzhiyun	  if test aix != "$with_aix_soname"; then
5546*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5547*4882a593Smuzhiyun	  else
5548*4882a593Smuzhiyun	    # used by -dlpreopen to get the symbols
5549*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5550*4882a593Smuzhiyun	  fi
5551*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5552*4882a593Smuzhiyun	fi
5553*4882a593Smuzhiyun      fi
5554*4882a593Smuzhiyun      ;;
5555*4882a593Smuzhiyun
5556*4882a593Smuzhiyun    amigaos*)
5557*4882a593Smuzhiyun      case $host_cpu in
5558*4882a593Smuzhiyun      powerpc)
5559*4882a593Smuzhiyun            # see comment about AmigaOS4 .so support
5560*4882a593Smuzhiyun            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5561*4882a593Smuzhiyun            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5562*4882a593Smuzhiyun        ;;
5563*4882a593Smuzhiyun      m68k)
5564*4882a593Smuzhiyun            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
5565*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5566*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5567*4882a593Smuzhiyun        ;;
5568*4882a593Smuzhiyun      esac
5569*4882a593Smuzhiyun      ;;
5570*4882a593Smuzhiyun
5571*4882a593Smuzhiyun    bsdi[[45]]*)
5572*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5573*4882a593Smuzhiyun      ;;
5574*4882a593Smuzhiyun
5575*4882a593Smuzhiyun    cygwin* | mingw* | pw32* | cegcc*)
5576*4882a593Smuzhiyun      # When not using gcc, we currently assume that we are using
5577*4882a593Smuzhiyun      # Microsoft Visual C++.
5578*4882a593Smuzhiyun      # hardcode_libdir_flag_spec is actually meaningless, as there is
5579*4882a593Smuzhiyun      # no search path for DLLs.
5580*4882a593Smuzhiyun      case $cc_basename in
5581*4882a593Smuzhiyun      cl*)
5582*4882a593Smuzhiyun	# Native MSVC
5583*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5584*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5585*4882a593Smuzhiyun	_LT_TAGVAR(always_export_symbols, $1)=yes
5586*4882a593Smuzhiyun	_LT_TAGVAR(file_list_spec, $1)='@'
5587*4882a593Smuzhiyun	# Tell ltmain to make .lib files, not .a files.
5588*4882a593Smuzhiyun	libext=lib
5589*4882a593Smuzhiyun	# Tell ltmain to make .dll files, not .so files.
5590*4882a593Smuzhiyun	shrext_cmds=.dll
5591*4882a593Smuzhiyun	# FIXME: Setting linknames here is a bad hack.
5592*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5593*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5594*4882a593Smuzhiyun            cp "$export_symbols" "$output_objdir/$soname.def";
5595*4882a593Smuzhiyun            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5596*4882a593Smuzhiyun          else
5597*4882a593Smuzhiyun            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5598*4882a593Smuzhiyun          fi~
5599*4882a593Smuzhiyun          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5600*4882a593Smuzhiyun          linknames='
5601*4882a593Smuzhiyun	# The linker will not automatically build a static lib if we build a DLL.
5602*4882a593Smuzhiyun	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5603*4882a593Smuzhiyun	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5604*4882a593Smuzhiyun	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5605*4882a593Smuzhiyun	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
5606*4882a593Smuzhiyun	# Don't use ranlib
5607*4882a593Smuzhiyun	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5608*4882a593Smuzhiyun	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5609*4882a593Smuzhiyun          lt_tool_outputfile="@TOOL_OUTPUT@"~
5610*4882a593Smuzhiyun          case $lt_outputfile in
5611*4882a593Smuzhiyun            *.exe|*.EXE) ;;
5612*4882a593Smuzhiyun            *)
5613*4882a593Smuzhiyun              lt_outputfile=$lt_outputfile.exe
5614*4882a593Smuzhiyun              lt_tool_outputfile=$lt_tool_outputfile.exe
5615*4882a593Smuzhiyun              ;;
5616*4882a593Smuzhiyun          esac~
5617*4882a593Smuzhiyun          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5618*4882a593Smuzhiyun            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5619*4882a593Smuzhiyun            $RM "$lt_outputfile.manifest";
5620*4882a593Smuzhiyun          fi'
5621*4882a593Smuzhiyun	;;
5622*4882a593Smuzhiyun      *)
5623*4882a593Smuzhiyun	# Assume MSVC wrapper
5624*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5625*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5626*4882a593Smuzhiyun	# Tell ltmain to make .lib files, not .a files.
5627*4882a593Smuzhiyun	libext=lib
5628*4882a593Smuzhiyun	# Tell ltmain to make .dll files, not .so files.
5629*4882a593Smuzhiyun	shrext_cmds=.dll
5630*4882a593Smuzhiyun	# FIXME: Setting linknames here is a bad hack.
5631*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5632*4882a593Smuzhiyun	# The linker will automatically build a .lib file if we build a DLL.
5633*4882a593Smuzhiyun	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5634*4882a593Smuzhiyun	# FIXME: Should let the user specify the lib program.
5635*4882a593Smuzhiyun	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5636*4882a593Smuzhiyun	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5637*4882a593Smuzhiyun	;;
5638*4882a593Smuzhiyun      esac
5639*4882a593Smuzhiyun      ;;
5640*4882a593Smuzhiyun
5641*4882a593Smuzhiyun    darwin* | rhapsody*)
5642*4882a593Smuzhiyun      _LT_DARWIN_LINKER_FEATURES($1)
5643*4882a593Smuzhiyun      ;;
5644*4882a593Smuzhiyun
5645*4882a593Smuzhiyun    dgux*)
5646*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5647*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5648*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5649*4882a593Smuzhiyun      ;;
5650*4882a593Smuzhiyun
5651*4882a593Smuzhiyun    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5652*4882a593Smuzhiyun    # support.  Future versions do this automatically, but an explicit c++rt0.o
5653*4882a593Smuzhiyun    # does not break anything, and helps significantly (at the cost of a little
5654*4882a593Smuzhiyun    # extra space).
5655*4882a593Smuzhiyun    freebsd2.2*)
5656*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5657*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5658*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5659*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5660*4882a593Smuzhiyun      ;;
5661*4882a593Smuzhiyun
5662*4882a593Smuzhiyun    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5663*4882a593Smuzhiyun    freebsd2.*)
5664*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5665*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5666*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5667*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5668*4882a593Smuzhiyun      ;;
5669*4882a593Smuzhiyun
5670*4882a593Smuzhiyun    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5671*4882a593Smuzhiyun    freebsd* | dragonfly*)
5672*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5673*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5674*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5675*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5676*4882a593Smuzhiyun      ;;
5677*4882a593Smuzhiyun
5678*4882a593Smuzhiyun    hpux9*)
5679*4882a593Smuzhiyun      if test yes = "$GCC"; then
5680*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5681*4882a593Smuzhiyun      else
5682*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5683*4882a593Smuzhiyun      fi
5684*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5685*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5686*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5687*4882a593Smuzhiyun
5688*4882a593Smuzhiyun      # hardcode_minus_L: Not really in the search PATH,
5689*4882a593Smuzhiyun      # but as the default location of the library.
5690*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5691*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5692*4882a593Smuzhiyun      ;;
5693*4882a593Smuzhiyun
5694*4882a593Smuzhiyun    hpux10*)
5695*4882a593Smuzhiyun      if test yes,no = "$GCC,$with_gnu_ld"; then
5696*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5697*4882a593Smuzhiyun      else
5698*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5699*4882a593Smuzhiyun      fi
5700*4882a593Smuzhiyun      if test no = "$with_gnu_ld"; then
5701*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5702*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5703*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct, $1)=yes
5704*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5705*4882a593Smuzhiyun	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5706*4882a593Smuzhiyun	# hardcode_minus_L: Not really in the search PATH,
5707*4882a593Smuzhiyun	# but as the default location of the library.
5708*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5709*4882a593Smuzhiyun      fi
5710*4882a593Smuzhiyun      ;;
5711*4882a593Smuzhiyun
5712*4882a593Smuzhiyun    hpux11*)
5713*4882a593Smuzhiyun      if test yes,no = "$GCC,$with_gnu_ld"; then
5714*4882a593Smuzhiyun	case $host_cpu in
5715*4882a593Smuzhiyun	hppa*64*)
5716*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5717*4882a593Smuzhiyun	  ;;
5718*4882a593Smuzhiyun	ia64*)
5719*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5720*4882a593Smuzhiyun	  ;;
5721*4882a593Smuzhiyun	*)
5722*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5723*4882a593Smuzhiyun	  ;;
5724*4882a593Smuzhiyun	esac
5725*4882a593Smuzhiyun      else
5726*4882a593Smuzhiyun	case $host_cpu in
5727*4882a593Smuzhiyun	hppa*64*)
5728*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5729*4882a593Smuzhiyun	  ;;
5730*4882a593Smuzhiyun	ia64*)
5731*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5732*4882a593Smuzhiyun	  ;;
5733*4882a593Smuzhiyun	*)
5734*4882a593Smuzhiyun	m4_if($1, [], [
5735*4882a593Smuzhiyun	  # Older versions of the 11.00 compiler do not understand -b yet
5736*4882a593Smuzhiyun	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5737*4882a593Smuzhiyun	  _LT_LINKER_OPTION([if $CC understands -b],
5738*4882a593Smuzhiyun	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5739*4882a593Smuzhiyun	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5740*4882a593Smuzhiyun	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5741*4882a593Smuzhiyun	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5742*4882a593Smuzhiyun	  ;;
5743*4882a593Smuzhiyun	esac
5744*4882a593Smuzhiyun      fi
5745*4882a593Smuzhiyun      if test no = "$with_gnu_ld"; then
5746*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5747*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5748*4882a593Smuzhiyun
5749*4882a593Smuzhiyun	case $host_cpu in
5750*4882a593Smuzhiyun	hppa*64*|ia64*)
5751*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=no
5752*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5753*4882a593Smuzhiyun	  ;;
5754*4882a593Smuzhiyun	*)
5755*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=yes
5756*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5757*4882a593Smuzhiyun	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5758*4882a593Smuzhiyun
5759*4882a593Smuzhiyun	  # hardcode_minus_L: Not really in the search PATH,
5760*4882a593Smuzhiyun	  # but as the default location of the library.
5761*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5762*4882a593Smuzhiyun	  ;;
5763*4882a593Smuzhiyun	esac
5764*4882a593Smuzhiyun      fi
5765*4882a593Smuzhiyun      ;;
5766*4882a593Smuzhiyun
5767*4882a593Smuzhiyun    irix5* | irix6* | nonstopux*)
5768*4882a593Smuzhiyun      if test yes = "$GCC"; then
5769*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5770*4882a593Smuzhiyun	# Try to use the -exported_symbol ld option, if it does not
5771*4882a593Smuzhiyun	# work, assume that -exports_file does not work either and
5772*4882a593Smuzhiyun	# implicitly export all symbols.
5773*4882a593Smuzhiyun	# This should be the same for all languages, so no per-tag cache variable.
5774*4882a593Smuzhiyun	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5775*4882a593Smuzhiyun	  [lt_cv_irix_exported_symbol],
5776*4882a593Smuzhiyun	  [save_LDFLAGS=$LDFLAGS
5777*4882a593Smuzhiyun	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5778*4882a593Smuzhiyun	   AC_LINK_IFELSE(
5779*4882a593Smuzhiyun	     [AC_LANG_SOURCE(
5780*4882a593Smuzhiyun	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5781*4882a593Smuzhiyun			      [C++], [[int foo (void) { return 0; }]],
5782*4882a593Smuzhiyun			      [Fortran 77], [[
5783*4882a593Smuzhiyun      subroutine foo
5784*4882a593Smuzhiyun      end]],
5785*4882a593Smuzhiyun			      [Fortran], [[
5786*4882a593Smuzhiyun      subroutine foo
5787*4882a593Smuzhiyun      end]])])],
5788*4882a593Smuzhiyun	      [lt_cv_irix_exported_symbol=yes],
5789*4882a593Smuzhiyun	      [lt_cv_irix_exported_symbol=no])
5790*4882a593Smuzhiyun           LDFLAGS=$save_LDFLAGS])
5791*4882a593Smuzhiyun	if test yes = "$lt_cv_irix_exported_symbol"; then
5792*4882a593Smuzhiyun          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
5793*4882a593Smuzhiyun	fi
5794*4882a593Smuzhiyun      else
5795*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5796*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
5797*4882a593Smuzhiyun      fi
5798*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5799*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5800*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5801*4882a593Smuzhiyun      _LT_TAGVAR(inherit_rpath, $1)=yes
5802*4882a593Smuzhiyun      _LT_TAGVAR(link_all_deplibs, $1)=yes
5803*4882a593Smuzhiyun      ;;
5804*4882a593Smuzhiyun
5805*4882a593Smuzhiyun    linux*)
5806*4882a593Smuzhiyun      case $cc_basename in
5807*4882a593Smuzhiyun      tcc*)
5808*4882a593Smuzhiyun	# Fabrice Bellard et al's Tiny C Compiler
5809*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=yes
5810*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5811*4882a593Smuzhiyun	;;
5812*4882a593Smuzhiyun      esac
5813*4882a593Smuzhiyun      ;;
5814*4882a593Smuzhiyun
5815*4882a593Smuzhiyun    netbsd*)
5816*4882a593Smuzhiyun      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5817*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5818*4882a593Smuzhiyun      else
5819*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5820*4882a593Smuzhiyun      fi
5821*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5822*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5823*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5824*4882a593Smuzhiyun      ;;
5825*4882a593Smuzhiyun
5826*4882a593Smuzhiyun    newsos6)
5827*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5828*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5829*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5830*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5831*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5832*4882a593Smuzhiyun      ;;
5833*4882a593Smuzhiyun
5834*4882a593Smuzhiyun    *nto* | *qnx*)
5835*4882a593Smuzhiyun      ;;
5836*4882a593Smuzhiyun
5837*4882a593Smuzhiyun    openbsd* | bitrig*)
5838*4882a593Smuzhiyun      if test -f /usr/libexec/ld.so; then
5839*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct, $1)=yes
5840*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5841*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5842*4882a593Smuzhiyun	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5843*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5844*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5845*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5846*4882a593Smuzhiyun	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5847*4882a593Smuzhiyun	else
5848*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5849*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5850*4882a593Smuzhiyun	fi
5851*4882a593Smuzhiyun      else
5852*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
5853*4882a593Smuzhiyun      fi
5854*4882a593Smuzhiyun      ;;
5855*4882a593Smuzhiyun
5856*4882a593Smuzhiyun    os2*)
5857*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5858*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5859*4882a593Smuzhiyun      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5860*4882a593Smuzhiyun      shrext_cmds=.dll
5861*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5862*4882a593Smuzhiyun	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5863*4882a593Smuzhiyun	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5864*4882a593Smuzhiyun	$ECHO EXPORTS >> $output_objdir/$libname.def~
5865*4882a593Smuzhiyun	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5866*4882a593Smuzhiyun	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5867*4882a593Smuzhiyun	emximp -o $lib $output_objdir/$libname.def'
5868*4882a593Smuzhiyun      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5869*4882a593Smuzhiyun	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5870*4882a593Smuzhiyun	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5871*4882a593Smuzhiyun	$ECHO EXPORTS >> $output_objdir/$libname.def~
5872*4882a593Smuzhiyun	prefix_cmds="$SED"~
5873*4882a593Smuzhiyun	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5874*4882a593Smuzhiyun	  prefix_cmds="$prefix_cmds -e 1d";
5875*4882a593Smuzhiyun	fi~
5876*4882a593Smuzhiyun	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5877*4882a593Smuzhiyun	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5878*4882a593Smuzhiyun	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5879*4882a593Smuzhiyun	emximp -o $lib $output_objdir/$libname.def'
5880*4882a593Smuzhiyun      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5881*4882a593Smuzhiyun      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5882*4882a593Smuzhiyun      ;;
5883*4882a593Smuzhiyun
5884*4882a593Smuzhiyun    osf3*)
5885*4882a593Smuzhiyun      if test yes = "$GCC"; then
5886*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5887*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5888*4882a593Smuzhiyun      else
5889*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5890*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5891*4882a593Smuzhiyun      fi
5892*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5893*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5894*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5895*4882a593Smuzhiyun      ;;
5896*4882a593Smuzhiyun
5897*4882a593Smuzhiyun    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5898*4882a593Smuzhiyun      if test yes = "$GCC"; then
5899*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5900*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
5901*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5902*4882a593Smuzhiyun      else
5903*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5904*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
5905*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
5906*4882a593Smuzhiyun          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
5907*4882a593Smuzhiyun
5908*4882a593Smuzhiyun	# Both c and cxx compiler support -rpath directly
5909*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5910*4882a593Smuzhiyun      fi
5911*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5912*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5913*4882a593Smuzhiyun      ;;
5914*4882a593Smuzhiyun
5915*4882a593Smuzhiyun    solaris*)
5916*4882a593Smuzhiyun      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5917*4882a593Smuzhiyun      if test yes = "$GCC"; then
5918*4882a593Smuzhiyun	wlarc='$wl'
5919*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5920*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5921*4882a593Smuzhiyun          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5922*4882a593Smuzhiyun      else
5923*4882a593Smuzhiyun	case `$CC -V 2>&1` in
5924*4882a593Smuzhiyun	*"Compilers 5.0"*)
5925*4882a593Smuzhiyun	  wlarc=''
5926*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5927*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5928*4882a593Smuzhiyun            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5929*4882a593Smuzhiyun	  ;;
5930*4882a593Smuzhiyun	*)
5931*4882a593Smuzhiyun	  wlarc='$wl'
5932*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5933*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5934*4882a593Smuzhiyun            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5935*4882a593Smuzhiyun	  ;;
5936*4882a593Smuzhiyun	esac
5937*4882a593Smuzhiyun      fi
5938*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5939*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5940*4882a593Smuzhiyun      case $host_os in
5941*4882a593Smuzhiyun      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5942*4882a593Smuzhiyun      *)
5943*4882a593Smuzhiyun	# The compiler driver will combine and reorder linker options,
5944*4882a593Smuzhiyun	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5945*4882a593Smuzhiyun	# but is careful enough not to reorder.
5946*4882a593Smuzhiyun	# Supported since Solaris 2.6 (maybe 2.5.1?)
5947*4882a593Smuzhiyun	if test yes = "$GCC"; then
5948*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5949*4882a593Smuzhiyun	else
5950*4882a593Smuzhiyun	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5951*4882a593Smuzhiyun	fi
5952*4882a593Smuzhiyun	;;
5953*4882a593Smuzhiyun      esac
5954*4882a593Smuzhiyun      _LT_TAGVAR(link_all_deplibs, $1)=yes
5955*4882a593Smuzhiyun      ;;
5956*4882a593Smuzhiyun
5957*4882a593Smuzhiyun    sunos4*)
5958*4882a593Smuzhiyun      if test sequent = "$host_vendor"; then
5959*4882a593Smuzhiyun	# Use $CC to link under sequent, because it throws in some extra .o
5960*4882a593Smuzhiyun	# files that make .init and .fini sections work.
5961*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5962*4882a593Smuzhiyun      else
5963*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5964*4882a593Smuzhiyun      fi
5965*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5966*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_direct, $1)=yes
5967*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5968*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5969*4882a593Smuzhiyun      ;;
5970*4882a593Smuzhiyun
5971*4882a593Smuzhiyun    sysv4)
5972*4882a593Smuzhiyun      case $host_vendor in
5973*4882a593Smuzhiyun	sni)
5974*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5975*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5976*4882a593Smuzhiyun	;;
5977*4882a593Smuzhiyun	siemens)
5978*4882a593Smuzhiyun	  ## LD is ld it makes a PLAMLIB
5979*4882a593Smuzhiyun	  ## CC just makes a GrossModule.
5980*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5981*4882a593Smuzhiyun	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5982*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=no
5983*4882a593Smuzhiyun        ;;
5984*4882a593Smuzhiyun	motorola)
5985*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5986*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5987*4882a593Smuzhiyun	;;
5988*4882a593Smuzhiyun      esac
5989*4882a593Smuzhiyun      runpath_var='LD_RUN_PATH'
5990*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5991*4882a593Smuzhiyun      ;;
5992*4882a593Smuzhiyun
5993*4882a593Smuzhiyun    sysv4.3*)
5994*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5995*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5996*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5997*4882a593Smuzhiyun      ;;
5998*4882a593Smuzhiyun
5999*4882a593Smuzhiyun    sysv4*MP*)
6000*4882a593Smuzhiyun      if test -d /usr/nec; then
6001*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6002*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6003*4882a593Smuzhiyun	runpath_var=LD_RUN_PATH
6004*4882a593Smuzhiyun	hardcode_runpath_var=yes
6005*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=yes
6006*4882a593Smuzhiyun      fi
6007*4882a593Smuzhiyun      ;;
6008*4882a593Smuzhiyun
6009*4882a593Smuzhiyun    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6010*4882a593Smuzhiyun      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6011*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6012*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6013*4882a593Smuzhiyun      runpath_var='LD_RUN_PATH'
6014*4882a593Smuzhiyun
6015*4882a593Smuzhiyun      if test yes = "$GCC"; then
6016*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6017*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6018*4882a593Smuzhiyun      else
6019*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6020*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6021*4882a593Smuzhiyun      fi
6022*4882a593Smuzhiyun      ;;
6023*4882a593Smuzhiyun
6024*4882a593Smuzhiyun    sysv5* | sco3.2v5* | sco5v6*)
6025*4882a593Smuzhiyun      # Note: We CANNOT use -z defs as we might desire, because we do not
6026*4882a593Smuzhiyun      # link with -lc, and that would cause any symbols used from libc to
6027*4882a593Smuzhiyun      # always be unresolved, which means just about no library would
6028*4882a593Smuzhiyun      # ever link correctly.  If we're not using GNU ld we use -z text
6029*4882a593Smuzhiyun      # though, which does catch some bad symbols but isn't as heavy-handed
6030*4882a593Smuzhiyun      # as -z defs.
6031*4882a593Smuzhiyun      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6032*4882a593Smuzhiyun      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6033*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6034*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6035*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6036*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6037*4882a593Smuzhiyun      _LT_TAGVAR(link_all_deplibs, $1)=yes
6038*4882a593Smuzhiyun      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6039*4882a593Smuzhiyun      runpath_var='LD_RUN_PATH'
6040*4882a593Smuzhiyun
6041*4882a593Smuzhiyun      if test yes = "$GCC"; then
6042*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6043*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6044*4882a593Smuzhiyun      else
6045*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6046*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6047*4882a593Smuzhiyun      fi
6048*4882a593Smuzhiyun      ;;
6049*4882a593Smuzhiyun
6050*4882a593Smuzhiyun    uts4*)
6051*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6052*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6053*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6054*4882a593Smuzhiyun      ;;
6055*4882a593Smuzhiyun
6056*4882a593Smuzhiyun    *)
6057*4882a593Smuzhiyun      _LT_TAGVAR(ld_shlibs, $1)=no
6058*4882a593Smuzhiyun      ;;
6059*4882a593Smuzhiyun    esac
6060*4882a593Smuzhiyun
6061*4882a593Smuzhiyun    if test sni = "$host_vendor"; then
6062*4882a593Smuzhiyun      case $host in
6063*4882a593Smuzhiyun      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6064*4882a593Smuzhiyun	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6065*4882a593Smuzhiyun	;;
6066*4882a593Smuzhiyun      esac
6067*4882a593Smuzhiyun    fi
6068*4882a593Smuzhiyun  fi
6069*4882a593Smuzhiyun])
6070*4882a593SmuzhiyunAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6071*4882a593Smuzhiyuntest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6072*4882a593Smuzhiyun
6073*4882a593Smuzhiyun_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6074*4882a593Smuzhiyun
6075*4882a593Smuzhiyun_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6076*4882a593Smuzhiyun_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6077*4882a593Smuzhiyun_LT_DECL([], [extract_expsyms_cmds], [2],
6078*4882a593Smuzhiyun    [The commands to extract the exported symbol list from a shared archive])
6079*4882a593Smuzhiyun
6080*4882a593Smuzhiyun#
6081*4882a593Smuzhiyun# Do we need to explicitly link libc?
6082*4882a593Smuzhiyun#
6083*4882a593Smuzhiyuncase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6084*4882a593Smuzhiyunx|xyes)
6085*4882a593Smuzhiyun  # Assume -lc should be added
6086*4882a593Smuzhiyun  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6087*4882a593Smuzhiyun
6088*4882a593Smuzhiyun  if test yes,yes = "$GCC,$enable_shared"; then
6089*4882a593Smuzhiyun    case $_LT_TAGVAR(archive_cmds, $1) in
6090*4882a593Smuzhiyun    *'~'*)
6091*4882a593Smuzhiyun      # FIXME: we may have to deal with multi-command sequences.
6092*4882a593Smuzhiyun      ;;
6093*4882a593Smuzhiyun    '$CC '*)
6094*4882a593Smuzhiyun      # Test whether the compiler implicitly links with -lc since on some
6095*4882a593Smuzhiyun      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6096*4882a593Smuzhiyun      # to ld, don't add -lc before -lgcc.
6097*4882a593Smuzhiyun      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6098*4882a593Smuzhiyun	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6099*4882a593Smuzhiyun	[$RM conftest*
6100*4882a593Smuzhiyun	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6101*4882a593Smuzhiyun
6102*4882a593Smuzhiyun	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6103*4882a593Smuzhiyun	  soname=conftest
6104*4882a593Smuzhiyun	  lib=conftest
6105*4882a593Smuzhiyun	  libobjs=conftest.$ac_objext
6106*4882a593Smuzhiyun	  deplibs=
6107*4882a593Smuzhiyun	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6108*4882a593Smuzhiyun	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6109*4882a593Smuzhiyun	  compiler_flags=-v
6110*4882a593Smuzhiyun	  linker_flags=-v
6111*4882a593Smuzhiyun	  verstring=
6112*4882a593Smuzhiyun	  output_objdir=.
6113*4882a593Smuzhiyun	  libname=conftest
6114*4882a593Smuzhiyun	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6115*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)=
6116*4882a593Smuzhiyun	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6117*4882a593Smuzhiyun	  then
6118*4882a593Smuzhiyun	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6119*4882a593Smuzhiyun	  else
6120*4882a593Smuzhiyun	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6121*4882a593Smuzhiyun	  fi
6122*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6123*4882a593Smuzhiyun	else
6124*4882a593Smuzhiyun	  cat conftest.err 1>&5
6125*4882a593Smuzhiyun	fi
6126*4882a593Smuzhiyun	$RM conftest*
6127*4882a593Smuzhiyun	])
6128*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6129*4882a593Smuzhiyun      ;;
6130*4882a593Smuzhiyun    esac
6131*4882a593Smuzhiyun  fi
6132*4882a593Smuzhiyun  ;;
6133*4882a593Smuzhiyunesac
6134*4882a593Smuzhiyun
6135*4882a593Smuzhiyun_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6136*4882a593Smuzhiyun    [Whether or not to add -lc for building shared libraries])
6137*4882a593Smuzhiyun_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6138*4882a593Smuzhiyun    [enable_shared_with_static_runtimes], [0],
6139*4882a593Smuzhiyun    [Whether or not to disallow shared libs when runtime libs are static])
6140*4882a593Smuzhiyun_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6141*4882a593Smuzhiyun    [Compiler flag to allow reflexive dlopens])
6142*4882a593Smuzhiyun_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6143*4882a593Smuzhiyun    [Compiler flag to generate shared objects directly from archives])
6144*4882a593Smuzhiyun_LT_TAGDECL([], [compiler_needs_object], [1],
6145*4882a593Smuzhiyun    [Whether the compiler copes with passing no objects directly])
6146*4882a593Smuzhiyun_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6147*4882a593Smuzhiyun    [Create an old-style archive from a shared archive])
6148*4882a593Smuzhiyun_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6149*4882a593Smuzhiyun    [Create a temporary old-style archive to link instead of a shared archive])
6150*4882a593Smuzhiyun_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6151*4882a593Smuzhiyun_LT_TAGDECL([], [archive_expsym_cmds], [2])
6152*4882a593Smuzhiyun_LT_TAGDECL([], [module_cmds], [2],
6153*4882a593Smuzhiyun    [Commands used to build a loadable module if different from building
6154*4882a593Smuzhiyun    a shared archive.])
6155*4882a593Smuzhiyun_LT_TAGDECL([], [module_expsym_cmds], [2])
6156*4882a593Smuzhiyun_LT_TAGDECL([], [with_gnu_ld], [1],
6157*4882a593Smuzhiyun    [Whether we are building with GNU ld or not])
6158*4882a593Smuzhiyun_LT_TAGDECL([], [allow_undefined_flag], [1],
6159*4882a593Smuzhiyun    [Flag that allows shared libraries with undefined symbols to be built])
6160*4882a593Smuzhiyun_LT_TAGDECL([], [no_undefined_flag], [1],
6161*4882a593Smuzhiyun    [Flag that enforces no undefined symbols])
6162*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6163*4882a593Smuzhiyun    [Flag to hardcode $libdir into a binary during linking.
6164*4882a593Smuzhiyun    This must work even if $libdir does not exist])
6165*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6166*4882a593Smuzhiyun    [Whether we need a single "-rpath" flag with a separated argument])
6167*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_direct], [0],
6168*4882a593Smuzhiyun    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6169*4882a593Smuzhiyun    DIR into the resulting binary])
6170*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6171*4882a593Smuzhiyun    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6172*4882a593Smuzhiyun    DIR into the resulting binary and the resulting library dependency is
6173*4882a593Smuzhiyun    "absolute", i.e impossible to change by setting $shlibpath_var if the
6174*4882a593Smuzhiyun    library is relocated])
6175*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_minus_L], [0],
6176*4882a593Smuzhiyun    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6177*4882a593Smuzhiyun    into the resulting binary])
6178*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6179*4882a593Smuzhiyun    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6180*4882a593Smuzhiyun    into the resulting binary])
6181*4882a593Smuzhiyun_LT_TAGDECL([], [hardcode_automatic], [0],
6182*4882a593Smuzhiyun    [Set to "yes" if building a shared library automatically hardcodes DIR
6183*4882a593Smuzhiyun    into the library and all subsequent libraries and executables linked
6184*4882a593Smuzhiyun    against it])
6185*4882a593Smuzhiyun_LT_TAGDECL([], [inherit_rpath], [0],
6186*4882a593Smuzhiyun    [Set to yes if linker adds runtime paths of dependent libraries
6187*4882a593Smuzhiyun    to runtime path list])
6188*4882a593Smuzhiyun_LT_TAGDECL([], [link_all_deplibs], [0],
6189*4882a593Smuzhiyun    [Whether libtool must link a program against all its dependency libraries])
6190*4882a593Smuzhiyun_LT_TAGDECL([], [always_export_symbols], [0],
6191*4882a593Smuzhiyun    [Set to "yes" if exported symbols are required])
6192*4882a593Smuzhiyun_LT_TAGDECL([], [export_symbols_cmds], [2],
6193*4882a593Smuzhiyun    [The commands to list exported symbols])
6194*4882a593Smuzhiyun_LT_TAGDECL([], [exclude_expsyms], [1],
6195*4882a593Smuzhiyun    [Symbols that should not be listed in the preloaded symbols])
6196*4882a593Smuzhiyun_LT_TAGDECL([], [include_expsyms], [1],
6197*4882a593Smuzhiyun    [Symbols that must always be exported])
6198*4882a593Smuzhiyun_LT_TAGDECL([], [prelink_cmds], [2],
6199*4882a593Smuzhiyun    [Commands necessary for linking programs (against libraries) with templates])
6200*4882a593Smuzhiyun_LT_TAGDECL([], [postlink_cmds], [2],
6201*4882a593Smuzhiyun    [Commands necessary for finishing linking programs])
6202*4882a593Smuzhiyun_LT_TAGDECL([], [file_list_spec], [1],
6203*4882a593Smuzhiyun    [Specify filename containing input files])
6204*4882a593Smuzhiyundnl FIXME: Not yet implemented
6205*4882a593Smuzhiyundnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6206*4882a593Smuzhiyundnl    [Compiler flag to generate thread safe objects])
6207*4882a593Smuzhiyun])# _LT_LINKER_SHLIBS
6208*4882a593Smuzhiyun
6209*4882a593Smuzhiyun
6210*4882a593Smuzhiyun# _LT_LANG_C_CONFIG([TAG])
6211*4882a593Smuzhiyun# ------------------------
6212*4882a593Smuzhiyun# Ensure that the configuration variables for a C compiler are suitably
6213*4882a593Smuzhiyun# defined.  These variables are subsequently used by _LT_CONFIG to write
6214*4882a593Smuzhiyun# the compiler configuration to 'libtool'.
6215*4882a593Smuzhiyunm4_defun([_LT_LANG_C_CONFIG],
6216*4882a593Smuzhiyun[m4_require([_LT_DECL_EGREP])dnl
6217*4882a593Smuzhiyunlt_save_CC=$CC
6218*4882a593SmuzhiyunAC_LANG_PUSH(C)
6219*4882a593Smuzhiyun
6220*4882a593Smuzhiyun# Source file extension for C test sources.
6221*4882a593Smuzhiyunac_ext=c
6222*4882a593Smuzhiyun
6223*4882a593Smuzhiyun# Object file extension for compiled C test sources.
6224*4882a593Smuzhiyunobjext=o
6225*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
6226*4882a593Smuzhiyun
6227*4882a593Smuzhiyun# Code to be used in simple compile tests
6228*4882a593Smuzhiyunlt_simple_compile_test_code="int some_variable = 0;"
6229*4882a593Smuzhiyun
6230*4882a593Smuzhiyun# Code to be used in simple link tests
6231*4882a593Smuzhiyunlt_simple_link_test_code='int main(){return(0);}'
6232*4882a593Smuzhiyun
6233*4882a593Smuzhiyun_LT_TAG_COMPILER
6234*4882a593Smuzhiyun# Save the default compiler, since it gets overwritten when the other
6235*4882a593Smuzhiyun# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6236*4882a593Smuzhiyuncompiler_DEFAULT=$CC
6237*4882a593Smuzhiyun
6238*4882a593Smuzhiyun# save warnings/boilerplate of simple test code
6239*4882a593Smuzhiyun_LT_COMPILER_BOILERPLATE
6240*4882a593Smuzhiyun_LT_LINKER_BOILERPLATE
6241*4882a593Smuzhiyun
6242*4882a593Smuzhiyun## CAVEAT EMPTOR:
6243*4882a593Smuzhiyun## There is no encapsulation within the following macros, do not change
6244*4882a593Smuzhiyun## the running order or otherwise move them around unless you know exactly
6245*4882a593Smuzhiyun## what you are doing...
6246*4882a593Smuzhiyunif test -n "$compiler"; then
6247*4882a593Smuzhiyun  _LT_COMPILER_NO_RTTI($1)
6248*4882a593Smuzhiyun  _LT_COMPILER_PIC($1)
6249*4882a593Smuzhiyun  _LT_COMPILER_C_O($1)
6250*4882a593Smuzhiyun  _LT_COMPILER_FILE_LOCKS($1)
6251*4882a593Smuzhiyun  _LT_LINKER_SHLIBS($1)
6252*4882a593Smuzhiyun  _LT_SYS_DYNAMIC_LINKER($1)
6253*4882a593Smuzhiyun  _LT_LINKER_HARDCODE_LIBPATH($1)
6254*4882a593Smuzhiyun  LT_SYS_DLOPEN_SELF
6255*4882a593Smuzhiyun  _LT_CMD_STRIPLIB
6256*4882a593Smuzhiyun
6257*4882a593Smuzhiyun  # Report what library types will actually be built
6258*4882a593Smuzhiyun  AC_MSG_CHECKING([if libtool supports shared libraries])
6259*4882a593Smuzhiyun  AC_MSG_RESULT([$can_build_shared])
6260*4882a593Smuzhiyun
6261*4882a593Smuzhiyun  AC_MSG_CHECKING([whether to build shared libraries])
6262*4882a593Smuzhiyun  test no = "$can_build_shared" && enable_shared=no
6263*4882a593Smuzhiyun
6264*4882a593Smuzhiyun  # On AIX, shared libraries and static libraries use the same namespace, and
6265*4882a593Smuzhiyun  # are all built from PIC.
6266*4882a593Smuzhiyun  case $host_os in
6267*4882a593Smuzhiyun  aix3*)
6268*4882a593Smuzhiyun    test yes = "$enable_shared" && enable_static=no
6269*4882a593Smuzhiyun    if test -n "$RANLIB"; then
6270*4882a593Smuzhiyun      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6271*4882a593Smuzhiyun      postinstall_cmds='$RANLIB $lib'
6272*4882a593Smuzhiyun    fi
6273*4882a593Smuzhiyun    ;;
6274*4882a593Smuzhiyun
6275*4882a593Smuzhiyun  aix[[4-9]]*)
6276*4882a593Smuzhiyun    if test ia64 != "$host_cpu"; then
6277*4882a593Smuzhiyun      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6278*4882a593Smuzhiyun      yes,aix,yes) ;;			# shared object as lib.so file only
6279*4882a593Smuzhiyun      yes,svr4,*) ;;			# shared object as lib.so archive member only
6280*4882a593Smuzhiyun      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6281*4882a593Smuzhiyun      esac
6282*4882a593Smuzhiyun    fi
6283*4882a593Smuzhiyun    ;;
6284*4882a593Smuzhiyun  esac
6285*4882a593Smuzhiyun  AC_MSG_RESULT([$enable_shared])
6286*4882a593Smuzhiyun
6287*4882a593Smuzhiyun  AC_MSG_CHECKING([whether to build static libraries])
6288*4882a593Smuzhiyun  # Make sure either enable_shared or enable_static is yes.
6289*4882a593Smuzhiyun  test yes = "$enable_shared" || enable_static=yes
6290*4882a593Smuzhiyun  AC_MSG_RESULT([$enable_static])
6291*4882a593Smuzhiyun
6292*4882a593Smuzhiyun  _LT_CONFIG($1)
6293*4882a593Smuzhiyunfi
6294*4882a593SmuzhiyunAC_LANG_POP
6295*4882a593SmuzhiyunCC=$lt_save_CC
6296*4882a593Smuzhiyun])# _LT_LANG_C_CONFIG
6297*4882a593Smuzhiyun
6298*4882a593Smuzhiyun
6299*4882a593Smuzhiyun# _LT_LANG_CXX_CONFIG([TAG])
6300*4882a593Smuzhiyun# --------------------------
6301*4882a593Smuzhiyun# Ensure that the configuration variables for a C++ compiler are suitably
6302*4882a593Smuzhiyun# defined.  These variables are subsequently used by _LT_CONFIG to write
6303*4882a593Smuzhiyun# the compiler configuration to 'libtool'.
6304*4882a593Smuzhiyunm4_defun([_LT_LANG_CXX_CONFIG],
6305*4882a593Smuzhiyun[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6306*4882a593Smuzhiyunm4_require([_LT_DECL_EGREP])dnl
6307*4882a593Smuzhiyunm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6308*4882a593Smuzhiyunif test -n "$CXX" && ( test no != "$CXX" &&
6309*4882a593Smuzhiyun    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6310*4882a593Smuzhiyun    (test g++ != "$CXX"))); then
6311*4882a593Smuzhiyun  AC_PROG_CXXCPP
6312*4882a593Smuzhiyunelse
6313*4882a593Smuzhiyun  _lt_caught_CXX_error=yes
6314*4882a593Smuzhiyunfi
6315*4882a593Smuzhiyun
6316*4882a593SmuzhiyunAC_LANG_PUSH(C++)
6317*4882a593Smuzhiyun_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6318*4882a593Smuzhiyun_LT_TAGVAR(allow_undefined_flag, $1)=
6319*4882a593Smuzhiyun_LT_TAGVAR(always_export_symbols, $1)=no
6320*4882a593Smuzhiyun_LT_TAGVAR(archive_expsym_cmds, $1)=
6321*4882a593Smuzhiyun_LT_TAGVAR(compiler_needs_object, $1)=no
6322*4882a593Smuzhiyun_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6323*4882a593Smuzhiyun_LT_TAGVAR(hardcode_direct, $1)=no
6324*4882a593Smuzhiyun_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6325*4882a593Smuzhiyun_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6326*4882a593Smuzhiyun_LT_TAGVAR(hardcode_libdir_separator, $1)=
6327*4882a593Smuzhiyun_LT_TAGVAR(hardcode_minus_L, $1)=no
6328*4882a593Smuzhiyun_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6329*4882a593Smuzhiyun_LT_TAGVAR(hardcode_automatic, $1)=no
6330*4882a593Smuzhiyun_LT_TAGVAR(inherit_rpath, $1)=no
6331*4882a593Smuzhiyun_LT_TAGVAR(module_cmds, $1)=
6332*4882a593Smuzhiyun_LT_TAGVAR(module_expsym_cmds, $1)=
6333*4882a593Smuzhiyun_LT_TAGVAR(link_all_deplibs, $1)=unknown
6334*4882a593Smuzhiyun_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6335*4882a593Smuzhiyun_LT_TAGVAR(reload_flag, $1)=$reload_flag
6336*4882a593Smuzhiyun_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6337*4882a593Smuzhiyun_LT_TAGVAR(no_undefined_flag, $1)=
6338*4882a593Smuzhiyun_LT_TAGVAR(whole_archive_flag_spec, $1)=
6339*4882a593Smuzhiyun_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6340*4882a593Smuzhiyun
6341*4882a593Smuzhiyun# Source file extension for C++ test sources.
6342*4882a593Smuzhiyunac_ext=cpp
6343*4882a593Smuzhiyun
6344*4882a593Smuzhiyun# Object file extension for compiled C++ test sources.
6345*4882a593Smuzhiyunobjext=o
6346*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
6347*4882a593Smuzhiyun
6348*4882a593Smuzhiyun# No sense in running all these tests if we already determined that
6349*4882a593Smuzhiyun# the CXX compiler isn't working.  Some variables (like enable_shared)
6350*4882a593Smuzhiyun# are currently assumed to apply to all compilers on this platform,
6351*4882a593Smuzhiyun# and will be corrupted by setting them based on a non-working compiler.
6352*4882a593Smuzhiyunif test yes != "$_lt_caught_CXX_error"; then
6353*4882a593Smuzhiyun  # Code to be used in simple compile tests
6354*4882a593Smuzhiyun  lt_simple_compile_test_code="int some_variable = 0;"
6355*4882a593Smuzhiyun
6356*4882a593Smuzhiyun  # Code to be used in simple link tests
6357*4882a593Smuzhiyun  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6358*4882a593Smuzhiyun
6359*4882a593Smuzhiyun  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6360*4882a593Smuzhiyun  _LT_TAG_COMPILER
6361*4882a593Smuzhiyun
6362*4882a593Smuzhiyun  # save warnings/boilerplate of simple test code
6363*4882a593Smuzhiyun  _LT_COMPILER_BOILERPLATE
6364*4882a593Smuzhiyun  _LT_LINKER_BOILERPLATE
6365*4882a593Smuzhiyun
6366*4882a593Smuzhiyun  # Allow CC to be a program name with arguments.
6367*4882a593Smuzhiyun  lt_save_CC=$CC
6368*4882a593Smuzhiyun  lt_save_CFLAGS=$CFLAGS
6369*4882a593Smuzhiyun  lt_save_LD=$LD
6370*4882a593Smuzhiyun  lt_save_GCC=$GCC
6371*4882a593Smuzhiyun  GCC=$GXX
6372*4882a593Smuzhiyun  lt_save_with_gnu_ld=$with_gnu_ld
6373*4882a593Smuzhiyun  lt_save_path_LD=$lt_cv_path_LD
6374*4882a593Smuzhiyun  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6375*4882a593Smuzhiyun    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6376*4882a593Smuzhiyun  else
6377*4882a593Smuzhiyun    $as_unset lt_cv_prog_gnu_ld
6378*4882a593Smuzhiyun  fi
6379*4882a593Smuzhiyun  if test -n "${lt_cv_path_LDCXX+set}"; then
6380*4882a593Smuzhiyun    lt_cv_path_LD=$lt_cv_path_LDCXX
6381*4882a593Smuzhiyun  else
6382*4882a593Smuzhiyun    $as_unset lt_cv_path_LD
6383*4882a593Smuzhiyun  fi
6384*4882a593Smuzhiyun  test -z "${LDCXX+set}" || LD=$LDCXX
6385*4882a593Smuzhiyun  CC=${CXX-"c++"}
6386*4882a593Smuzhiyun  CFLAGS=$CXXFLAGS
6387*4882a593Smuzhiyun  compiler=$CC
6388*4882a593Smuzhiyun  _LT_TAGVAR(compiler, $1)=$CC
6389*4882a593Smuzhiyun  _LT_CC_BASENAME([$compiler])
6390*4882a593Smuzhiyun
6391*4882a593Smuzhiyun  if test -n "$compiler"; then
6392*4882a593Smuzhiyun    # We don't want -fno-exception when compiling C++ code, so set the
6393*4882a593Smuzhiyun    # no_builtin_flag separately
6394*4882a593Smuzhiyun    if test yes = "$GXX"; then
6395*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6396*4882a593Smuzhiyun    else
6397*4882a593Smuzhiyun      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6398*4882a593Smuzhiyun    fi
6399*4882a593Smuzhiyun
6400*4882a593Smuzhiyun    if test yes = "$GXX"; then
6401*4882a593Smuzhiyun      # Set up default GNU C++ configuration
6402*4882a593Smuzhiyun
6403*4882a593Smuzhiyun      LT_PATH_LD
6404*4882a593Smuzhiyun
6405*4882a593Smuzhiyun      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6406*4882a593Smuzhiyun      # archiving commands below assume that GNU ld is being used.
6407*4882a593Smuzhiyun      if test yes = "$with_gnu_ld"; then
6408*4882a593Smuzhiyun        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6409*4882a593Smuzhiyun        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6410*4882a593Smuzhiyun
6411*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6412*4882a593Smuzhiyun        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6413*4882a593Smuzhiyun
6414*4882a593Smuzhiyun        # If archive_cmds runs LD, not CC, wlarc should be empty
6415*4882a593Smuzhiyun        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6416*4882a593Smuzhiyun        #     investigate it a little bit more. (MM)
6417*4882a593Smuzhiyun        wlarc='$wl'
6418*4882a593Smuzhiyun
6419*4882a593Smuzhiyun        # ancient GNU ld didn't support --whole-archive et. al.
6420*4882a593Smuzhiyun        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6421*4882a593Smuzhiyun	  $GREP 'no-whole-archive' > /dev/null; then
6422*4882a593Smuzhiyun          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6423*4882a593Smuzhiyun        else
6424*4882a593Smuzhiyun          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6425*4882a593Smuzhiyun        fi
6426*4882a593Smuzhiyun      else
6427*4882a593Smuzhiyun        with_gnu_ld=no
6428*4882a593Smuzhiyun        wlarc=
6429*4882a593Smuzhiyun
6430*4882a593Smuzhiyun        # A generic and very simple default shared library creation
6431*4882a593Smuzhiyun        # command for GNU C++ for the case where it uses the native
6432*4882a593Smuzhiyun        # linker, instead of GNU ld.  If possible, this setting should
6433*4882a593Smuzhiyun        # overridden to take advantage of the native linker features on
6434*4882a593Smuzhiyun        # the platform it is being used on.
6435*4882a593Smuzhiyun        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6436*4882a593Smuzhiyun      fi
6437*4882a593Smuzhiyun
6438*4882a593Smuzhiyun      # Commands to make compiler produce verbose output that lists
6439*4882a593Smuzhiyun      # what "hidden" libraries, object files and flags are used when
6440*4882a593Smuzhiyun      # linking a shared library.
6441*4882a593Smuzhiyun      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6442*4882a593Smuzhiyun
6443*4882a593Smuzhiyun    else
6444*4882a593Smuzhiyun      GXX=no
6445*4882a593Smuzhiyun      with_gnu_ld=no
6446*4882a593Smuzhiyun      wlarc=
6447*4882a593Smuzhiyun    fi
6448*4882a593Smuzhiyun
6449*4882a593Smuzhiyun    # PORTME: fill in a description of your system's C++ link characteristics
6450*4882a593Smuzhiyun    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6451*4882a593Smuzhiyun    _LT_TAGVAR(ld_shlibs, $1)=yes
6452*4882a593Smuzhiyun    case $host_os in
6453*4882a593Smuzhiyun      aix3*)
6454*4882a593Smuzhiyun        # FIXME: insert proper C++ library support
6455*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
6456*4882a593Smuzhiyun        ;;
6457*4882a593Smuzhiyun      aix[[4-9]]*)
6458*4882a593Smuzhiyun        if test ia64 = "$host_cpu"; then
6459*4882a593Smuzhiyun          # On IA64, the linker does run time linking by default, so we don't
6460*4882a593Smuzhiyun          # have to do anything special.
6461*4882a593Smuzhiyun          aix_use_runtimelinking=no
6462*4882a593Smuzhiyun          exp_sym_flag='-Bexport'
6463*4882a593Smuzhiyun          no_entry_flag=
6464*4882a593Smuzhiyun        else
6465*4882a593Smuzhiyun          aix_use_runtimelinking=no
6466*4882a593Smuzhiyun
6467*4882a593Smuzhiyun          # Test if we are trying to use run time linking or normal
6468*4882a593Smuzhiyun          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6469*4882a593Smuzhiyun          # have runtime linking enabled, and use it for executables.
6470*4882a593Smuzhiyun          # For shared libraries, we enable/disable runtime linking
6471*4882a593Smuzhiyun          # depending on the kind of the shared library created -
6472*4882a593Smuzhiyun          # when "with_aix_soname,aix_use_runtimelinking" is:
6473*4882a593Smuzhiyun          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6474*4882a593Smuzhiyun          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6475*4882a593Smuzhiyun          #            lib.a           static archive
6476*4882a593Smuzhiyun          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6477*4882a593Smuzhiyun          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6478*4882a593Smuzhiyun          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6479*4882a593Smuzhiyun          #            lib.a(lib.so.V) shared, rtl:no
6480*4882a593Smuzhiyun          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6481*4882a593Smuzhiyun          #            lib.a           static archive
6482*4882a593Smuzhiyun          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6483*4882a593Smuzhiyun	    for ld_flag in $LDFLAGS; do
6484*4882a593Smuzhiyun	      case $ld_flag in
6485*4882a593Smuzhiyun	      *-brtl*)
6486*4882a593Smuzhiyun	        aix_use_runtimelinking=yes
6487*4882a593Smuzhiyun	        break
6488*4882a593Smuzhiyun	        ;;
6489*4882a593Smuzhiyun	      esac
6490*4882a593Smuzhiyun	    done
6491*4882a593Smuzhiyun	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6492*4882a593Smuzhiyun	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6493*4882a593Smuzhiyun	      # so we don't have lib.a shared libs to link our executables.
6494*4882a593Smuzhiyun	      # We have to force runtime linking in this case.
6495*4882a593Smuzhiyun	      aix_use_runtimelinking=yes
6496*4882a593Smuzhiyun	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6497*4882a593Smuzhiyun	    fi
6498*4882a593Smuzhiyun	    ;;
6499*4882a593Smuzhiyun          esac
6500*4882a593Smuzhiyun
6501*4882a593Smuzhiyun          exp_sym_flag='-bexport'
6502*4882a593Smuzhiyun          no_entry_flag='-bnoentry'
6503*4882a593Smuzhiyun        fi
6504*4882a593Smuzhiyun
6505*4882a593Smuzhiyun        # When large executables or shared objects are built, AIX ld can
6506*4882a593Smuzhiyun        # have problems creating the table of contents.  If linking a library
6507*4882a593Smuzhiyun        # or program results in "error TOC overflow" add -mminimal-toc to
6508*4882a593Smuzhiyun        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6509*4882a593Smuzhiyun        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6510*4882a593Smuzhiyun
6511*4882a593Smuzhiyun        _LT_TAGVAR(archive_cmds, $1)=''
6512*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_direct, $1)=yes
6513*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6514*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6515*4882a593Smuzhiyun        _LT_TAGVAR(link_all_deplibs, $1)=yes
6516*4882a593Smuzhiyun        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6517*4882a593Smuzhiyun        case $with_aix_soname,$aix_use_runtimelinking in
6518*4882a593Smuzhiyun        aix,*) ;;	# no import file
6519*4882a593Smuzhiyun        svr4,* | *,yes) # use import file
6520*4882a593Smuzhiyun          # The Import File defines what to hardcode.
6521*4882a593Smuzhiyun          _LT_TAGVAR(hardcode_direct, $1)=no
6522*4882a593Smuzhiyun          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6523*4882a593Smuzhiyun          ;;
6524*4882a593Smuzhiyun        esac
6525*4882a593Smuzhiyun
6526*4882a593Smuzhiyun        if test yes = "$GXX"; then
6527*4882a593Smuzhiyun          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6528*4882a593Smuzhiyun          # We only want to do this on AIX 4.2 and lower, the check
6529*4882a593Smuzhiyun          # below for broken collect2 doesn't work under 4.3+
6530*4882a593Smuzhiyun	  collect2name=`$CC -print-prog-name=collect2`
6531*4882a593Smuzhiyun	  if test -f "$collect2name" &&
6532*4882a593Smuzhiyun	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6533*4882a593Smuzhiyun	  then
6534*4882a593Smuzhiyun	    # We have reworked collect2
6535*4882a593Smuzhiyun	    :
6536*4882a593Smuzhiyun	  else
6537*4882a593Smuzhiyun	    # We have old collect2
6538*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6539*4882a593Smuzhiyun	    # It fails to find uninstalled libraries when the uninstalled
6540*4882a593Smuzhiyun	    # path is not listed in the libpath.  Setting hardcode_minus_L
6541*4882a593Smuzhiyun	    # to unsupported forces relinking
6542*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6543*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6544*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6545*4882a593Smuzhiyun	  fi
6546*4882a593Smuzhiyun          esac
6547*4882a593Smuzhiyun          shared_flag='-shared'
6548*4882a593Smuzhiyun	  if test yes = "$aix_use_runtimelinking"; then
6549*4882a593Smuzhiyun	    shared_flag=$shared_flag' $wl-G'
6550*4882a593Smuzhiyun	  fi
6551*4882a593Smuzhiyun	  # Need to ensure runtime linking is disabled for the traditional
6552*4882a593Smuzhiyun	  # shared library, or the linker may eventually find shared libraries
6553*4882a593Smuzhiyun	  # /with/ Import File - we do not want to mix them.
6554*4882a593Smuzhiyun	  shared_flag_aix='-shared'
6555*4882a593Smuzhiyun	  shared_flag_svr4='-shared $wl-G'
6556*4882a593Smuzhiyun        else
6557*4882a593Smuzhiyun          # not using gcc
6558*4882a593Smuzhiyun          if test ia64 = "$host_cpu"; then
6559*4882a593Smuzhiyun	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6560*4882a593Smuzhiyun	  # chokes on -Wl,-G. The following line is correct:
6561*4882a593Smuzhiyun	  shared_flag='-G'
6562*4882a593Smuzhiyun          else
6563*4882a593Smuzhiyun	    if test yes = "$aix_use_runtimelinking"; then
6564*4882a593Smuzhiyun	      shared_flag='$wl-G'
6565*4882a593Smuzhiyun	    else
6566*4882a593Smuzhiyun	      shared_flag='$wl-bM:SRE'
6567*4882a593Smuzhiyun	    fi
6568*4882a593Smuzhiyun	    shared_flag_aix='$wl-bM:SRE'
6569*4882a593Smuzhiyun	    shared_flag_svr4='$wl-G'
6570*4882a593Smuzhiyun          fi
6571*4882a593Smuzhiyun        fi
6572*4882a593Smuzhiyun
6573*4882a593Smuzhiyun        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6574*4882a593Smuzhiyun        # It seems that -bexpall does not export symbols beginning with
6575*4882a593Smuzhiyun        # underscore (_), so it is better to generate a list of symbols to
6576*4882a593Smuzhiyun	# export.
6577*4882a593Smuzhiyun        _LT_TAGVAR(always_export_symbols, $1)=yes
6578*4882a593Smuzhiyun	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6579*4882a593Smuzhiyun          # Warning - without using the other runtime loading flags (-brtl),
6580*4882a593Smuzhiyun          # -berok will link without error, but may produce a broken library.
6581*4882a593Smuzhiyun          # The "-G" linker flag allows undefined symbols.
6582*4882a593Smuzhiyun          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6583*4882a593Smuzhiyun          # Determine the default libpath from the value encoded in an empty
6584*4882a593Smuzhiyun          # executable.
6585*4882a593Smuzhiyun          _LT_SYS_MODULE_PATH_AIX([$1])
6586*4882a593Smuzhiyun          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6587*4882a593Smuzhiyun
6588*4882a593Smuzhiyun          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6589*4882a593Smuzhiyun        else
6590*4882a593Smuzhiyun          if test ia64 = "$host_cpu"; then
6591*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6592*4882a593Smuzhiyun	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6593*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
6594*4882a593Smuzhiyun          else
6595*4882a593Smuzhiyun	    # Determine the default libpath from the value encoded in an
6596*4882a593Smuzhiyun	    # empty executable.
6597*4882a593Smuzhiyun	    _LT_SYS_MODULE_PATH_AIX([$1])
6598*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6599*4882a593Smuzhiyun	    # Warning - without using the other run time loading flags,
6600*4882a593Smuzhiyun	    # -berok will link without error, but may produce a broken library.
6601*4882a593Smuzhiyun	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6602*4882a593Smuzhiyun	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6603*4882a593Smuzhiyun	    if test yes = "$with_gnu_ld"; then
6604*4882a593Smuzhiyun	      # We only use this code for GNU lds that support --whole-archive.
6605*4882a593Smuzhiyun	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6606*4882a593Smuzhiyun	    else
6607*4882a593Smuzhiyun	      # Exported symbols can be pulled into shared objects from archives
6608*4882a593Smuzhiyun	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6609*4882a593Smuzhiyun	    fi
6610*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6611*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6612*4882a593Smuzhiyun	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6613*4882a593Smuzhiyun	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6614*4882a593Smuzhiyun	    if test svr4 != "$with_aix_soname"; then
6615*4882a593Smuzhiyun	      # This is similar to how AIX traditionally builds its shared
6616*4882a593Smuzhiyun	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6617*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6618*4882a593Smuzhiyun	    fi
6619*4882a593Smuzhiyun	    if test aix != "$with_aix_soname"; then
6620*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6621*4882a593Smuzhiyun	    else
6622*4882a593Smuzhiyun	      # used by -dlpreopen to get the symbols
6623*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6624*4882a593Smuzhiyun	    fi
6625*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6626*4882a593Smuzhiyun          fi
6627*4882a593Smuzhiyun        fi
6628*4882a593Smuzhiyun        ;;
6629*4882a593Smuzhiyun
6630*4882a593Smuzhiyun      beos*)
6631*4882a593Smuzhiyun	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6632*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6633*4882a593Smuzhiyun	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6634*4882a593Smuzhiyun	  # support --undefined.  This deserves some investigation.  FIXME
6635*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6636*4882a593Smuzhiyun	else
6637*4882a593Smuzhiyun	  _LT_TAGVAR(ld_shlibs, $1)=no
6638*4882a593Smuzhiyun	fi
6639*4882a593Smuzhiyun	;;
6640*4882a593Smuzhiyun
6641*4882a593Smuzhiyun      chorus*)
6642*4882a593Smuzhiyun        case $cc_basename in
6643*4882a593Smuzhiyun          *)
6644*4882a593Smuzhiyun	  # FIXME: insert proper C++ library support
6645*4882a593Smuzhiyun	  _LT_TAGVAR(ld_shlibs, $1)=no
6646*4882a593Smuzhiyun	  ;;
6647*4882a593Smuzhiyun        esac
6648*4882a593Smuzhiyun        ;;
6649*4882a593Smuzhiyun
6650*4882a593Smuzhiyun      cygwin* | mingw* | pw32* | cegcc*)
6651*4882a593Smuzhiyun	case $GXX,$cc_basename in
6652*4882a593Smuzhiyun	,cl* | no,cl*)
6653*4882a593Smuzhiyun	  # Native MSVC
6654*4882a593Smuzhiyun	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6655*4882a593Smuzhiyun	  # no search path for DLLs.
6656*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6657*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6658*4882a593Smuzhiyun	  _LT_TAGVAR(always_export_symbols, $1)=yes
6659*4882a593Smuzhiyun	  _LT_TAGVAR(file_list_spec, $1)='@'
6660*4882a593Smuzhiyun	  # Tell ltmain to make .lib files, not .a files.
6661*4882a593Smuzhiyun	  libext=lib
6662*4882a593Smuzhiyun	  # Tell ltmain to make .dll files, not .so files.
6663*4882a593Smuzhiyun	  shrext_cmds=.dll
6664*4882a593Smuzhiyun	  # FIXME: Setting linknames here is a bad hack.
6665*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6666*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6667*4882a593Smuzhiyun              cp "$export_symbols" "$output_objdir/$soname.def";
6668*4882a593Smuzhiyun              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6669*4882a593Smuzhiyun            else
6670*4882a593Smuzhiyun              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6671*4882a593Smuzhiyun            fi~
6672*4882a593Smuzhiyun            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6673*4882a593Smuzhiyun            linknames='
6674*4882a593Smuzhiyun	  # The linker will not automatically build a static lib if we build a DLL.
6675*4882a593Smuzhiyun	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6676*4882a593Smuzhiyun	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6677*4882a593Smuzhiyun	  # Don't use ranlib
6678*4882a593Smuzhiyun	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6679*4882a593Smuzhiyun	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6680*4882a593Smuzhiyun            lt_tool_outputfile="@TOOL_OUTPUT@"~
6681*4882a593Smuzhiyun            case $lt_outputfile in
6682*4882a593Smuzhiyun              *.exe|*.EXE) ;;
6683*4882a593Smuzhiyun              *)
6684*4882a593Smuzhiyun                lt_outputfile=$lt_outputfile.exe
6685*4882a593Smuzhiyun                lt_tool_outputfile=$lt_tool_outputfile.exe
6686*4882a593Smuzhiyun                ;;
6687*4882a593Smuzhiyun            esac~
6688*4882a593Smuzhiyun            func_to_tool_file "$lt_outputfile"~
6689*4882a593Smuzhiyun            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6690*4882a593Smuzhiyun              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6691*4882a593Smuzhiyun              $RM "$lt_outputfile.manifest";
6692*4882a593Smuzhiyun            fi'
6693*4882a593Smuzhiyun	  ;;
6694*4882a593Smuzhiyun	*)
6695*4882a593Smuzhiyun	  # g++
6696*4882a593Smuzhiyun	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6697*4882a593Smuzhiyun	  # as there is no search path for DLLs.
6698*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6699*4882a593Smuzhiyun	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6700*4882a593Smuzhiyun	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6701*4882a593Smuzhiyun	  _LT_TAGVAR(always_export_symbols, $1)=no
6702*4882a593Smuzhiyun	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6703*4882a593Smuzhiyun
6704*4882a593Smuzhiyun	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6705*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6706*4882a593Smuzhiyun	    # If the export-symbols file already is a .def file, use it as
6707*4882a593Smuzhiyun	    # is; otherwise, prepend EXPORTS...
6708*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6709*4882a593Smuzhiyun              cp $export_symbols $output_objdir/$soname.def;
6710*4882a593Smuzhiyun            else
6711*4882a593Smuzhiyun              echo EXPORTS > $output_objdir/$soname.def;
6712*4882a593Smuzhiyun              cat $export_symbols >> $output_objdir/$soname.def;
6713*4882a593Smuzhiyun            fi~
6714*4882a593Smuzhiyun            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
6715*4882a593Smuzhiyun	  else
6716*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
6717*4882a593Smuzhiyun	  fi
6718*4882a593Smuzhiyun	  ;;
6719*4882a593Smuzhiyun	esac
6720*4882a593Smuzhiyun	;;
6721*4882a593Smuzhiyun      darwin* | rhapsody*)
6722*4882a593Smuzhiyun        _LT_DARWIN_LINKER_FEATURES($1)
6723*4882a593Smuzhiyun	;;
6724*4882a593Smuzhiyun
6725*4882a593Smuzhiyun      os2*)
6726*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6727*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6728*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6729*4882a593Smuzhiyun	shrext_cmds=.dll
6730*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6731*4882a593Smuzhiyun	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6732*4882a593Smuzhiyun	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6733*4882a593Smuzhiyun	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6734*4882a593Smuzhiyun	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6735*4882a593Smuzhiyun	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6736*4882a593Smuzhiyun	  emximp -o $lib $output_objdir/$libname.def'
6737*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6738*4882a593Smuzhiyun	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6739*4882a593Smuzhiyun	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6740*4882a593Smuzhiyun	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6741*4882a593Smuzhiyun	  prefix_cmds="$SED"~
6742*4882a593Smuzhiyun	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6743*4882a593Smuzhiyun	    prefix_cmds="$prefix_cmds -e 1d";
6744*4882a593Smuzhiyun	  fi~
6745*4882a593Smuzhiyun	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6746*4882a593Smuzhiyun	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6747*4882a593Smuzhiyun	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6748*4882a593Smuzhiyun	  emximp -o $lib $output_objdir/$libname.def'
6749*4882a593Smuzhiyun	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6750*4882a593Smuzhiyun	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6751*4882a593Smuzhiyun	;;
6752*4882a593Smuzhiyun
6753*4882a593Smuzhiyun      dgux*)
6754*4882a593Smuzhiyun        case $cc_basename in
6755*4882a593Smuzhiyun          ec++*)
6756*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
6757*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
6758*4882a593Smuzhiyun	    ;;
6759*4882a593Smuzhiyun          ghcx*)
6760*4882a593Smuzhiyun	    # Green Hills C++ Compiler
6761*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
6762*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
6763*4882a593Smuzhiyun	    ;;
6764*4882a593Smuzhiyun          *)
6765*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
6766*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
6767*4882a593Smuzhiyun	    ;;
6768*4882a593Smuzhiyun        esac
6769*4882a593Smuzhiyun        ;;
6770*4882a593Smuzhiyun
6771*4882a593Smuzhiyun      freebsd2.*)
6772*4882a593Smuzhiyun        # C++ shared libraries reported to be fairly broken before
6773*4882a593Smuzhiyun	# switch to ELF
6774*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
6775*4882a593Smuzhiyun        ;;
6776*4882a593Smuzhiyun
6777*4882a593Smuzhiyun      freebsd-elf*)
6778*4882a593Smuzhiyun        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6779*4882a593Smuzhiyun        ;;
6780*4882a593Smuzhiyun
6781*4882a593Smuzhiyun      freebsd* | dragonfly*)
6782*4882a593Smuzhiyun        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6783*4882a593Smuzhiyun        # conventions
6784*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=yes
6785*4882a593Smuzhiyun        ;;
6786*4882a593Smuzhiyun
6787*4882a593Smuzhiyun      haiku*)
6788*4882a593Smuzhiyun        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6789*4882a593Smuzhiyun        _LT_TAGVAR(link_all_deplibs, $1)=yes
6790*4882a593Smuzhiyun        ;;
6791*4882a593Smuzhiyun
6792*4882a593Smuzhiyun      hpux9*)
6793*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6794*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6795*4882a593Smuzhiyun        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6796*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_direct, $1)=yes
6797*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6798*4882a593Smuzhiyun				             # but as the default
6799*4882a593Smuzhiyun				             # location of the library.
6800*4882a593Smuzhiyun
6801*4882a593Smuzhiyun        case $cc_basename in
6802*4882a593Smuzhiyun          CC*)
6803*4882a593Smuzhiyun            # FIXME: insert proper C++ library support
6804*4882a593Smuzhiyun            _LT_TAGVAR(ld_shlibs, $1)=no
6805*4882a593Smuzhiyun            ;;
6806*4882a593Smuzhiyun          aCC*)
6807*4882a593Smuzhiyun            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6808*4882a593Smuzhiyun            # Commands to make compiler produce verbose output that lists
6809*4882a593Smuzhiyun            # what "hidden" libraries, object files and flags are used when
6810*4882a593Smuzhiyun            # linking a shared library.
6811*4882a593Smuzhiyun            #
6812*4882a593Smuzhiyun            # There doesn't appear to be a way to prevent this compiler from
6813*4882a593Smuzhiyun            # explicitly linking system object files so we need to strip them
6814*4882a593Smuzhiyun            # from the output so that they don't get included in the library
6815*4882a593Smuzhiyun            # dependencies.
6816*4882a593Smuzhiyun            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6817*4882a593Smuzhiyun            ;;
6818*4882a593Smuzhiyun          *)
6819*4882a593Smuzhiyun            if test yes = "$GXX"; then
6820*4882a593Smuzhiyun              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6821*4882a593Smuzhiyun            else
6822*4882a593Smuzhiyun              # FIXME: insert proper C++ library support
6823*4882a593Smuzhiyun              _LT_TAGVAR(ld_shlibs, $1)=no
6824*4882a593Smuzhiyun            fi
6825*4882a593Smuzhiyun            ;;
6826*4882a593Smuzhiyun        esac
6827*4882a593Smuzhiyun        ;;
6828*4882a593Smuzhiyun
6829*4882a593Smuzhiyun      hpux10*|hpux11*)
6830*4882a593Smuzhiyun        if test no = "$with_gnu_ld"; then
6831*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6832*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6833*4882a593Smuzhiyun
6834*4882a593Smuzhiyun          case $host_cpu in
6835*4882a593Smuzhiyun            hppa*64*|ia64*)
6836*4882a593Smuzhiyun              ;;
6837*4882a593Smuzhiyun            *)
6838*4882a593Smuzhiyun	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6839*4882a593Smuzhiyun              ;;
6840*4882a593Smuzhiyun          esac
6841*4882a593Smuzhiyun        fi
6842*4882a593Smuzhiyun        case $host_cpu in
6843*4882a593Smuzhiyun          hppa*64*|ia64*)
6844*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_direct, $1)=no
6845*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6846*4882a593Smuzhiyun            ;;
6847*4882a593Smuzhiyun          *)
6848*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_direct, $1)=yes
6849*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6850*4882a593Smuzhiyun            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6851*4882a593Smuzhiyun					         # but as the default
6852*4882a593Smuzhiyun					         # location of the library.
6853*4882a593Smuzhiyun            ;;
6854*4882a593Smuzhiyun        esac
6855*4882a593Smuzhiyun
6856*4882a593Smuzhiyun        case $cc_basename in
6857*4882a593Smuzhiyun          CC*)
6858*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
6859*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
6860*4882a593Smuzhiyun	    ;;
6861*4882a593Smuzhiyun          aCC*)
6862*4882a593Smuzhiyun	    case $host_cpu in
6863*4882a593Smuzhiyun	      hppa*64*)
6864*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6865*4882a593Smuzhiyun	        ;;
6866*4882a593Smuzhiyun	      ia64*)
6867*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6868*4882a593Smuzhiyun	        ;;
6869*4882a593Smuzhiyun	      *)
6870*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6871*4882a593Smuzhiyun	        ;;
6872*4882a593Smuzhiyun	    esac
6873*4882a593Smuzhiyun	    # Commands to make compiler produce verbose output that lists
6874*4882a593Smuzhiyun	    # what "hidden" libraries, object files and flags are used when
6875*4882a593Smuzhiyun	    # linking a shared library.
6876*4882a593Smuzhiyun	    #
6877*4882a593Smuzhiyun	    # There doesn't appear to be a way to prevent this compiler from
6878*4882a593Smuzhiyun	    # explicitly linking system object files so we need to strip them
6879*4882a593Smuzhiyun	    # from the output so that they don't get included in the library
6880*4882a593Smuzhiyun	    # dependencies.
6881*4882a593Smuzhiyun	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6882*4882a593Smuzhiyun	    ;;
6883*4882a593Smuzhiyun          *)
6884*4882a593Smuzhiyun	    if test yes = "$GXX"; then
6885*4882a593Smuzhiyun	      if test no = "$with_gnu_ld"; then
6886*4882a593Smuzhiyun	        case $host_cpu in
6887*4882a593Smuzhiyun	          hppa*64*)
6888*4882a593Smuzhiyun	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6889*4882a593Smuzhiyun	            ;;
6890*4882a593Smuzhiyun	          ia64*)
6891*4882a593Smuzhiyun	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6892*4882a593Smuzhiyun	            ;;
6893*4882a593Smuzhiyun	          *)
6894*4882a593Smuzhiyun	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6895*4882a593Smuzhiyun	            ;;
6896*4882a593Smuzhiyun	        esac
6897*4882a593Smuzhiyun	      fi
6898*4882a593Smuzhiyun	    else
6899*4882a593Smuzhiyun	      # FIXME: insert proper C++ library support
6900*4882a593Smuzhiyun	      _LT_TAGVAR(ld_shlibs, $1)=no
6901*4882a593Smuzhiyun	    fi
6902*4882a593Smuzhiyun	    ;;
6903*4882a593Smuzhiyun        esac
6904*4882a593Smuzhiyun        ;;
6905*4882a593Smuzhiyun
6906*4882a593Smuzhiyun      interix[[3-9]]*)
6907*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_direct, $1)=no
6908*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6909*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6910*4882a593Smuzhiyun	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6911*4882a593Smuzhiyun	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6912*4882a593Smuzhiyun	# Instead, shared libraries are loaded at an image base (0x10000000 by
6913*4882a593Smuzhiyun	# default) and relocated if they conflict, which is a slow very memory
6914*4882a593Smuzhiyun	# consuming and fragmenting process.  To avoid this, we pick a random,
6915*4882a593Smuzhiyun	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6916*4882a593Smuzhiyun	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6917*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6918*4882a593Smuzhiyun	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
6919*4882a593Smuzhiyun	;;
6920*4882a593Smuzhiyun      irix5* | irix6*)
6921*4882a593Smuzhiyun        case $cc_basename in
6922*4882a593Smuzhiyun          CC*)
6923*4882a593Smuzhiyun	    # SGI C++
6924*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
6925*4882a593Smuzhiyun
6926*4882a593Smuzhiyun	    # Archives containing C++ object files must be created using
6927*4882a593Smuzhiyun	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6928*4882a593Smuzhiyun	    # necessary to make sure instantiated templates are included
6929*4882a593Smuzhiyun	    # in the archive.
6930*4882a593Smuzhiyun	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6931*4882a593Smuzhiyun	    ;;
6932*4882a593Smuzhiyun          *)
6933*4882a593Smuzhiyun	    if test yes = "$GXX"; then
6934*4882a593Smuzhiyun	      if test no = "$with_gnu_ld"; then
6935*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
6936*4882a593Smuzhiyun	      else
6937*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
6938*4882a593Smuzhiyun	      fi
6939*4882a593Smuzhiyun	    fi
6940*4882a593Smuzhiyun	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6941*4882a593Smuzhiyun	    ;;
6942*4882a593Smuzhiyun        esac
6943*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6944*4882a593Smuzhiyun        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6945*4882a593Smuzhiyun        _LT_TAGVAR(inherit_rpath, $1)=yes
6946*4882a593Smuzhiyun        ;;
6947*4882a593Smuzhiyun
6948*4882a593Smuzhiyun      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6949*4882a593Smuzhiyun        case $cc_basename in
6950*4882a593Smuzhiyun          KCC*)
6951*4882a593Smuzhiyun	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6952*4882a593Smuzhiyun
6953*4882a593Smuzhiyun	    # KCC will only create a shared library if the output file
6954*4882a593Smuzhiyun	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6955*4882a593Smuzhiyun	    # to its proper name (with version) after linking.
6956*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
6957*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
6958*4882a593Smuzhiyun	    # Commands to make compiler produce verbose output that lists
6959*4882a593Smuzhiyun	    # what "hidden" libraries, object files and flags are used when
6960*4882a593Smuzhiyun	    # linking a shared library.
6961*4882a593Smuzhiyun	    #
6962*4882a593Smuzhiyun	    # There doesn't appear to be a way to prevent this compiler from
6963*4882a593Smuzhiyun	    # explicitly linking system object files so we need to strip them
6964*4882a593Smuzhiyun	    # from the output so that they don't get included in the library
6965*4882a593Smuzhiyun	    # dependencies.
6966*4882a593Smuzhiyun	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6967*4882a593Smuzhiyun
6968*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6969*4882a593Smuzhiyun	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6970*4882a593Smuzhiyun
6971*4882a593Smuzhiyun	    # Archives containing C++ object files must be created using
6972*4882a593Smuzhiyun	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6973*4882a593Smuzhiyun	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6974*4882a593Smuzhiyun	    ;;
6975*4882a593Smuzhiyun	  icpc* | ecpc* )
6976*4882a593Smuzhiyun	    # Intel C++
6977*4882a593Smuzhiyun	    with_gnu_ld=yes
6978*4882a593Smuzhiyun	    # version 8.0 and above of icpc choke on multiply defined symbols
6979*4882a593Smuzhiyun	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6980*4882a593Smuzhiyun	    # earlier do not add the objects themselves.
6981*4882a593Smuzhiyun	    case `$CC -V 2>&1` in
6982*4882a593Smuzhiyun	      *"Version 7."*)
6983*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6984*4882a593Smuzhiyun		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6985*4882a593Smuzhiyun		;;
6986*4882a593Smuzhiyun	      *)  # Version 8.0 or newer
6987*4882a593Smuzhiyun	        tmp_idyn=
6988*4882a593Smuzhiyun	        case $host_cpu in
6989*4882a593Smuzhiyun		  ia64*) tmp_idyn=' -i_dynamic';;
6990*4882a593Smuzhiyun		esac
6991*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6992*4882a593Smuzhiyun		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
6993*4882a593Smuzhiyun		;;
6994*4882a593Smuzhiyun	    esac
6995*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6996*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6997*4882a593Smuzhiyun	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6998*4882a593Smuzhiyun	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6999*4882a593Smuzhiyun	    ;;
7000*4882a593Smuzhiyun          pgCC* | pgcpp*)
7001*4882a593Smuzhiyun            # Portland Group C++ compiler
7002*4882a593Smuzhiyun	    case `$CC -V` in
7003*4882a593Smuzhiyun	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7004*4882a593Smuzhiyun	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7005*4882a593Smuzhiyun               rm -rf $tpldir~
7006*4882a593Smuzhiyun               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7007*4882a593Smuzhiyun               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7008*4882a593Smuzhiyun	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7009*4882a593Smuzhiyun                rm -rf $tpldir~
7010*4882a593Smuzhiyun                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7011*4882a593Smuzhiyun                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7012*4882a593Smuzhiyun                $RANLIB $oldlib'
7013*4882a593Smuzhiyun	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7014*4882a593Smuzhiyun                rm -rf $tpldir~
7015*4882a593Smuzhiyun                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7016*4882a593Smuzhiyun                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7017*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7018*4882a593Smuzhiyun                rm -rf $tpldir~
7019*4882a593Smuzhiyun                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7020*4882a593Smuzhiyun                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7021*4882a593Smuzhiyun	      ;;
7022*4882a593Smuzhiyun	    *) # Version 6 and above use weak symbols
7023*4882a593Smuzhiyun	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7024*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
7025*4882a593Smuzhiyun	      ;;
7026*4882a593Smuzhiyun	    esac
7027*4882a593Smuzhiyun
7028*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7029*4882a593Smuzhiyun	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7030*4882a593Smuzhiyun	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7031*4882a593Smuzhiyun            ;;
7032*4882a593Smuzhiyun	  cxx*)
7033*4882a593Smuzhiyun	    # Compaq C++
7034*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7035*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
7036*4882a593Smuzhiyun
7037*4882a593Smuzhiyun	    runpath_var=LD_RUN_PATH
7038*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7039*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7040*4882a593Smuzhiyun
7041*4882a593Smuzhiyun	    # Commands to make compiler produce verbose output that lists
7042*4882a593Smuzhiyun	    # what "hidden" libraries, object files and flags are used when
7043*4882a593Smuzhiyun	    # linking a shared library.
7044*4882a593Smuzhiyun	    #
7045*4882a593Smuzhiyun	    # There doesn't appear to be a way to prevent this compiler from
7046*4882a593Smuzhiyun	    # explicitly linking system object files so we need to strip them
7047*4882a593Smuzhiyun	    # from the output so that they don't get included in the library
7048*4882a593Smuzhiyun	    # dependencies.
7049*4882a593Smuzhiyun	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
7050*4882a593Smuzhiyun	    ;;
7051*4882a593Smuzhiyun	  xl* | mpixl* | bgxl*)
7052*4882a593Smuzhiyun	    # IBM XL 8.0 on PPC, with GNU ld
7053*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7054*4882a593Smuzhiyun	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7055*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7056*4882a593Smuzhiyun	    if test yes = "$supports_anon_versioning"; then
7057*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7058*4882a593Smuzhiyun                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7059*4882a593Smuzhiyun                echo "local: *; };" >> $output_objdir/$libname.ver~
7060*4882a593Smuzhiyun                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7061*4882a593Smuzhiyun	    fi
7062*4882a593Smuzhiyun	    ;;
7063*4882a593Smuzhiyun	  *)
7064*4882a593Smuzhiyun	    case `$CC -V 2>&1 | sed 5q` in
7065*4882a593Smuzhiyun	    *Sun\ C*)
7066*4882a593Smuzhiyun	      # Sun C++ 5.9
7067*4882a593Smuzhiyun	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7068*4882a593Smuzhiyun	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7069*4882a593Smuzhiyun	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
7070*4882a593Smuzhiyun	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7071*4882a593Smuzhiyun	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
7072*4882a593Smuzhiyun	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7073*4882a593Smuzhiyun
7074*4882a593Smuzhiyun	      # Not sure whether something based on
7075*4882a593Smuzhiyun	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7076*4882a593Smuzhiyun	      # would be better.
7077*4882a593Smuzhiyun	      output_verbose_link_cmd='func_echo_all'
7078*4882a593Smuzhiyun
7079*4882a593Smuzhiyun	      # Archives containing C++ object files must be created using
7080*4882a593Smuzhiyun	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7081*4882a593Smuzhiyun	      # necessary to make sure instantiated templates are included
7082*4882a593Smuzhiyun	      # in the archive.
7083*4882a593Smuzhiyun	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7084*4882a593Smuzhiyun	      ;;
7085*4882a593Smuzhiyun	    esac
7086*4882a593Smuzhiyun	    ;;
7087*4882a593Smuzhiyun	esac
7088*4882a593Smuzhiyun	;;
7089*4882a593Smuzhiyun
7090*4882a593Smuzhiyun      lynxos*)
7091*4882a593Smuzhiyun        # FIXME: insert proper C++ library support
7092*4882a593Smuzhiyun	_LT_TAGVAR(ld_shlibs, $1)=no
7093*4882a593Smuzhiyun	;;
7094*4882a593Smuzhiyun
7095*4882a593Smuzhiyun      m88k*)
7096*4882a593Smuzhiyun        # FIXME: insert proper C++ library support
7097*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
7098*4882a593Smuzhiyun	;;
7099*4882a593Smuzhiyun
7100*4882a593Smuzhiyun      mvs*)
7101*4882a593Smuzhiyun        case $cc_basename in
7102*4882a593Smuzhiyun          cxx*)
7103*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7104*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7105*4882a593Smuzhiyun	    ;;
7106*4882a593Smuzhiyun	  *)
7107*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7108*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7109*4882a593Smuzhiyun	    ;;
7110*4882a593Smuzhiyun	esac
7111*4882a593Smuzhiyun	;;
7112*4882a593Smuzhiyun
7113*4882a593Smuzhiyun      netbsd*)
7114*4882a593Smuzhiyun        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7115*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7116*4882a593Smuzhiyun	  wlarc=
7117*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7118*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=yes
7119*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7120*4882a593Smuzhiyun	fi
7121*4882a593Smuzhiyun	# Workaround some broken pre-1.5 toolchains
7122*4882a593Smuzhiyun	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7123*4882a593Smuzhiyun	;;
7124*4882a593Smuzhiyun
7125*4882a593Smuzhiyun      *nto* | *qnx*)
7126*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=yes
7127*4882a593Smuzhiyun	;;
7128*4882a593Smuzhiyun
7129*4882a593Smuzhiyun      openbsd* | bitrig*)
7130*4882a593Smuzhiyun	if test -f /usr/libexec/ld.so; then
7131*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct, $1)=yes
7132*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7133*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7134*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7135*4882a593Smuzhiyun	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7136*4882a593Smuzhiyun	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7137*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
7138*4882a593Smuzhiyun	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7139*4882a593Smuzhiyun	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7140*4882a593Smuzhiyun	  fi
7141*4882a593Smuzhiyun	  output_verbose_link_cmd=func_echo_all
7142*4882a593Smuzhiyun	else
7143*4882a593Smuzhiyun	  _LT_TAGVAR(ld_shlibs, $1)=no
7144*4882a593Smuzhiyun	fi
7145*4882a593Smuzhiyun	;;
7146*4882a593Smuzhiyun
7147*4882a593Smuzhiyun      osf3* | osf4* | osf5*)
7148*4882a593Smuzhiyun        case $cc_basename in
7149*4882a593Smuzhiyun          KCC*)
7150*4882a593Smuzhiyun	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7151*4882a593Smuzhiyun
7152*4882a593Smuzhiyun	    # KCC will only create a shared library if the output file
7153*4882a593Smuzhiyun	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7154*4882a593Smuzhiyun	    # to its proper name (with version) after linking.
7155*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
7156*4882a593Smuzhiyun
7157*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7158*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7159*4882a593Smuzhiyun
7160*4882a593Smuzhiyun	    # Archives containing C++ object files must be created using
7161*4882a593Smuzhiyun	    # the KAI C++ compiler.
7162*4882a593Smuzhiyun	    case $host in
7163*4882a593Smuzhiyun	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7164*4882a593Smuzhiyun	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7165*4882a593Smuzhiyun	    esac
7166*4882a593Smuzhiyun	    ;;
7167*4882a593Smuzhiyun          RCC*)
7168*4882a593Smuzhiyun	    # Rational C++ 2.4.1
7169*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7170*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7171*4882a593Smuzhiyun	    ;;
7172*4882a593Smuzhiyun          cxx*)
7173*4882a593Smuzhiyun	    case $host in
7174*4882a593Smuzhiyun	      osf3*)
7175*4882a593Smuzhiyun	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7176*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7177*4882a593Smuzhiyun	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7178*4882a593Smuzhiyun		;;
7179*4882a593Smuzhiyun	      *)
7180*4882a593Smuzhiyun	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7181*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
7182*4882a593Smuzhiyun	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7183*4882a593Smuzhiyun                  echo "-hidden">> $lib.exp~
7184*4882a593Smuzhiyun                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
7185*4882a593Smuzhiyun                  $RM $lib.exp'
7186*4882a593Smuzhiyun	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7187*4882a593Smuzhiyun		;;
7188*4882a593Smuzhiyun	    esac
7189*4882a593Smuzhiyun
7190*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7191*4882a593Smuzhiyun
7192*4882a593Smuzhiyun	    # Commands to make compiler produce verbose output that lists
7193*4882a593Smuzhiyun	    # what "hidden" libraries, object files and flags are used when
7194*4882a593Smuzhiyun	    # linking a shared library.
7195*4882a593Smuzhiyun	    #
7196*4882a593Smuzhiyun	    # There doesn't appear to be a way to prevent this compiler from
7197*4882a593Smuzhiyun	    # explicitly linking system object files so we need to strip them
7198*4882a593Smuzhiyun	    # from the output so that they don't get included in the library
7199*4882a593Smuzhiyun	    # dependencies.
7200*4882a593Smuzhiyun	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
7201*4882a593Smuzhiyun	    ;;
7202*4882a593Smuzhiyun	  *)
7203*4882a593Smuzhiyun	    if test yes,no = "$GXX,$with_gnu_ld"; then
7204*4882a593Smuzhiyun	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7205*4882a593Smuzhiyun	      case $host in
7206*4882a593Smuzhiyun	        osf3*)
7207*4882a593Smuzhiyun	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7208*4882a593Smuzhiyun		  ;;
7209*4882a593Smuzhiyun	        *)
7210*4882a593Smuzhiyun	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
7211*4882a593Smuzhiyun		  ;;
7212*4882a593Smuzhiyun	      esac
7213*4882a593Smuzhiyun
7214*4882a593Smuzhiyun	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7215*4882a593Smuzhiyun	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7216*4882a593Smuzhiyun
7217*4882a593Smuzhiyun	      # Commands to make compiler produce verbose output that lists
7218*4882a593Smuzhiyun	      # what "hidden" libraries, object files and flags are used when
7219*4882a593Smuzhiyun	      # linking a shared library.
7220*4882a593Smuzhiyun	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7221*4882a593Smuzhiyun
7222*4882a593Smuzhiyun	    else
7223*4882a593Smuzhiyun	      # FIXME: insert proper C++ library support
7224*4882a593Smuzhiyun	      _LT_TAGVAR(ld_shlibs, $1)=no
7225*4882a593Smuzhiyun	    fi
7226*4882a593Smuzhiyun	    ;;
7227*4882a593Smuzhiyun        esac
7228*4882a593Smuzhiyun        ;;
7229*4882a593Smuzhiyun
7230*4882a593Smuzhiyun      psos*)
7231*4882a593Smuzhiyun        # FIXME: insert proper C++ library support
7232*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
7233*4882a593Smuzhiyun        ;;
7234*4882a593Smuzhiyun
7235*4882a593Smuzhiyun      sunos4*)
7236*4882a593Smuzhiyun        case $cc_basename in
7237*4882a593Smuzhiyun          CC*)
7238*4882a593Smuzhiyun	    # Sun C++ 4.x
7239*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7240*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7241*4882a593Smuzhiyun	    ;;
7242*4882a593Smuzhiyun          lcc*)
7243*4882a593Smuzhiyun	    # Lucid
7244*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7245*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7246*4882a593Smuzhiyun	    ;;
7247*4882a593Smuzhiyun          *)
7248*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7249*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7250*4882a593Smuzhiyun	    ;;
7251*4882a593Smuzhiyun        esac
7252*4882a593Smuzhiyun        ;;
7253*4882a593Smuzhiyun
7254*4882a593Smuzhiyun      solaris*)
7255*4882a593Smuzhiyun        case $cc_basename in
7256*4882a593Smuzhiyun          CC* | sunCC*)
7257*4882a593Smuzhiyun	    # Sun C++ 4.2, 5.x and Centerline C++
7258*4882a593Smuzhiyun            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7259*4882a593Smuzhiyun	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7260*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7261*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7262*4882a593Smuzhiyun              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7263*4882a593Smuzhiyun
7264*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7265*4882a593Smuzhiyun	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7266*4882a593Smuzhiyun	    case $host_os in
7267*4882a593Smuzhiyun	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7268*4882a593Smuzhiyun	      *)
7269*4882a593Smuzhiyun		# The compiler driver will combine and reorder linker options,
7270*4882a593Smuzhiyun		# but understands '-z linker_flag'.
7271*4882a593Smuzhiyun	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7272*4882a593Smuzhiyun		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7273*4882a593Smuzhiyun	        ;;
7274*4882a593Smuzhiyun	    esac
7275*4882a593Smuzhiyun	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7276*4882a593Smuzhiyun
7277*4882a593Smuzhiyun	    output_verbose_link_cmd='func_echo_all'
7278*4882a593Smuzhiyun
7279*4882a593Smuzhiyun	    # Archives containing C++ object files must be created using
7280*4882a593Smuzhiyun	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7281*4882a593Smuzhiyun	    # necessary to make sure instantiated templates are included
7282*4882a593Smuzhiyun	    # in the archive.
7283*4882a593Smuzhiyun	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7284*4882a593Smuzhiyun	    ;;
7285*4882a593Smuzhiyun          gcx*)
7286*4882a593Smuzhiyun	    # Green Hills C++ Compiler
7287*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7288*4882a593Smuzhiyun
7289*4882a593Smuzhiyun	    # The C++ compiler must be used to create the archive.
7290*4882a593Smuzhiyun	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7291*4882a593Smuzhiyun	    ;;
7292*4882a593Smuzhiyun          *)
7293*4882a593Smuzhiyun	    # GNU C++ compiler with Solaris linker
7294*4882a593Smuzhiyun	    if test yes,no = "$GXX,$with_gnu_ld"; then
7295*4882a593Smuzhiyun	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7296*4882a593Smuzhiyun	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7297*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7298*4882a593Smuzhiyun	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7299*4882a593Smuzhiyun                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7300*4882a593Smuzhiyun
7301*4882a593Smuzhiyun	        # Commands to make compiler produce verbose output that lists
7302*4882a593Smuzhiyun	        # what "hidden" libraries, object files and flags are used when
7303*4882a593Smuzhiyun	        # linking a shared library.
7304*4882a593Smuzhiyun	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7305*4882a593Smuzhiyun	      else
7306*4882a593Smuzhiyun	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7307*4882a593Smuzhiyun	        # platform.
7308*4882a593Smuzhiyun	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7309*4882a593Smuzhiyun	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7310*4882a593Smuzhiyun                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7311*4882a593Smuzhiyun
7312*4882a593Smuzhiyun	        # Commands to make compiler produce verbose output that lists
7313*4882a593Smuzhiyun	        # what "hidden" libraries, object files and flags are used when
7314*4882a593Smuzhiyun	        # linking a shared library.
7315*4882a593Smuzhiyun	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7316*4882a593Smuzhiyun	      fi
7317*4882a593Smuzhiyun
7318*4882a593Smuzhiyun	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7319*4882a593Smuzhiyun	      case $host_os in
7320*4882a593Smuzhiyun		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7321*4882a593Smuzhiyun		*)
7322*4882a593Smuzhiyun		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7323*4882a593Smuzhiyun		  ;;
7324*4882a593Smuzhiyun	      esac
7325*4882a593Smuzhiyun	    fi
7326*4882a593Smuzhiyun	    ;;
7327*4882a593Smuzhiyun        esac
7328*4882a593Smuzhiyun        ;;
7329*4882a593Smuzhiyun
7330*4882a593Smuzhiyun    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7331*4882a593Smuzhiyun      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7332*4882a593Smuzhiyun      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7333*4882a593Smuzhiyun      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7334*4882a593Smuzhiyun      runpath_var='LD_RUN_PATH'
7335*4882a593Smuzhiyun
7336*4882a593Smuzhiyun      case $cc_basename in
7337*4882a593Smuzhiyun        CC*)
7338*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7339*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7340*4882a593Smuzhiyun	  ;;
7341*4882a593Smuzhiyun	*)
7342*4882a593Smuzhiyun	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7343*4882a593Smuzhiyun	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7344*4882a593Smuzhiyun	  ;;
7345*4882a593Smuzhiyun      esac
7346*4882a593Smuzhiyun      ;;
7347*4882a593Smuzhiyun
7348*4882a593Smuzhiyun      sysv5* | sco3.2v5* | sco5v6*)
7349*4882a593Smuzhiyun	# Note: We CANNOT use -z defs as we might desire, because we do not
7350*4882a593Smuzhiyun	# link with -lc, and that would cause any symbols used from libc to
7351*4882a593Smuzhiyun	# always be unresolved, which means just about no library would
7352*4882a593Smuzhiyun	# ever link correctly.  If we're not using GNU ld we use -z text
7353*4882a593Smuzhiyun	# though, which does catch some bad symbols but isn't as heavy-handed
7354*4882a593Smuzhiyun	# as -z defs.
7355*4882a593Smuzhiyun	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7356*4882a593Smuzhiyun	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7357*4882a593Smuzhiyun	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7358*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7359*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7360*4882a593Smuzhiyun	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7361*4882a593Smuzhiyun	_LT_TAGVAR(link_all_deplibs, $1)=yes
7362*4882a593Smuzhiyun	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7363*4882a593Smuzhiyun	runpath_var='LD_RUN_PATH'
7364*4882a593Smuzhiyun
7365*4882a593Smuzhiyun	case $cc_basename in
7366*4882a593Smuzhiyun          CC*)
7367*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7368*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7369*4882a593Smuzhiyun	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7370*4882a593Smuzhiyun              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7371*4882a593Smuzhiyun	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7372*4882a593Smuzhiyun              '"$_LT_TAGVAR(reload_cmds, $1)"
7373*4882a593Smuzhiyun	    ;;
7374*4882a593Smuzhiyun	  *)
7375*4882a593Smuzhiyun	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7376*4882a593Smuzhiyun	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7377*4882a593Smuzhiyun	    ;;
7378*4882a593Smuzhiyun	esac
7379*4882a593Smuzhiyun      ;;
7380*4882a593Smuzhiyun
7381*4882a593Smuzhiyun      tandem*)
7382*4882a593Smuzhiyun        case $cc_basename in
7383*4882a593Smuzhiyun          NCC*)
7384*4882a593Smuzhiyun	    # NonStop-UX NCC 3.20
7385*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7386*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7387*4882a593Smuzhiyun	    ;;
7388*4882a593Smuzhiyun          *)
7389*4882a593Smuzhiyun	    # FIXME: insert proper C++ library support
7390*4882a593Smuzhiyun	    _LT_TAGVAR(ld_shlibs, $1)=no
7391*4882a593Smuzhiyun	    ;;
7392*4882a593Smuzhiyun        esac
7393*4882a593Smuzhiyun        ;;
7394*4882a593Smuzhiyun
7395*4882a593Smuzhiyun      vxworks*)
7396*4882a593Smuzhiyun        # FIXME: insert proper C++ library support
7397*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
7398*4882a593Smuzhiyun        ;;
7399*4882a593Smuzhiyun
7400*4882a593Smuzhiyun      *)
7401*4882a593Smuzhiyun        # FIXME: insert proper C++ library support
7402*4882a593Smuzhiyun        _LT_TAGVAR(ld_shlibs, $1)=no
7403*4882a593Smuzhiyun        ;;
7404*4882a593Smuzhiyun    esac
7405*4882a593Smuzhiyun
7406*4882a593Smuzhiyun    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7407*4882a593Smuzhiyun    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7408*4882a593Smuzhiyun
7409*4882a593Smuzhiyun    _LT_TAGVAR(GCC, $1)=$GXX
7410*4882a593Smuzhiyun    _LT_TAGVAR(LD, $1)=$LD
7411*4882a593Smuzhiyun
7412*4882a593Smuzhiyun    ## CAVEAT EMPTOR:
7413*4882a593Smuzhiyun    ## There is no encapsulation within the following macros, do not change
7414*4882a593Smuzhiyun    ## the running order or otherwise move them around unless you know exactly
7415*4882a593Smuzhiyun    ## what you are doing...
7416*4882a593Smuzhiyun    _LT_SYS_HIDDEN_LIBDEPS($1)
7417*4882a593Smuzhiyun    _LT_COMPILER_PIC($1)
7418*4882a593Smuzhiyun    _LT_COMPILER_C_O($1)
7419*4882a593Smuzhiyun    _LT_COMPILER_FILE_LOCKS($1)
7420*4882a593Smuzhiyun    _LT_LINKER_SHLIBS($1)
7421*4882a593Smuzhiyun    _LT_SYS_DYNAMIC_LINKER($1)
7422*4882a593Smuzhiyun    _LT_LINKER_HARDCODE_LIBPATH($1)
7423*4882a593Smuzhiyun
7424*4882a593Smuzhiyun    _LT_CONFIG($1)
7425*4882a593Smuzhiyun  fi # test -n "$compiler"
7426*4882a593Smuzhiyun
7427*4882a593Smuzhiyun  CC=$lt_save_CC
7428*4882a593Smuzhiyun  CFLAGS=$lt_save_CFLAGS
7429*4882a593Smuzhiyun  LDCXX=$LD
7430*4882a593Smuzhiyun  LD=$lt_save_LD
7431*4882a593Smuzhiyun  GCC=$lt_save_GCC
7432*4882a593Smuzhiyun  with_gnu_ld=$lt_save_with_gnu_ld
7433*4882a593Smuzhiyun  lt_cv_path_LDCXX=$lt_cv_path_LD
7434*4882a593Smuzhiyun  lt_cv_path_LD=$lt_save_path_LD
7435*4882a593Smuzhiyun  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7436*4882a593Smuzhiyun  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7437*4882a593Smuzhiyunfi # test yes != "$_lt_caught_CXX_error"
7438*4882a593Smuzhiyun
7439*4882a593SmuzhiyunAC_LANG_POP
7440*4882a593Smuzhiyun])# _LT_LANG_CXX_CONFIG
7441*4882a593Smuzhiyun
7442*4882a593Smuzhiyun
7443*4882a593Smuzhiyun# _LT_FUNC_STRIPNAME_CNF
7444*4882a593Smuzhiyun# ----------------------
7445*4882a593Smuzhiyun# func_stripname_cnf prefix suffix name
7446*4882a593Smuzhiyun# strip PREFIX and SUFFIX off of NAME.
7447*4882a593Smuzhiyun# PREFIX and SUFFIX must not contain globbing or regex special
7448*4882a593Smuzhiyun# characters, hashes, percent signs, but SUFFIX may contain a leading
7449*4882a593Smuzhiyun# dot (in which case that matches only a dot).
7450*4882a593Smuzhiyun#
7451*4882a593Smuzhiyun# This function is identical to the (non-XSI) version of func_stripname,
7452*4882a593Smuzhiyun# except this one can be used by m4 code that may be executed by configure,
7453*4882a593Smuzhiyun# rather than the libtool script.
7454*4882a593Smuzhiyunm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7455*4882a593SmuzhiyunAC_REQUIRE([_LT_DECL_SED])
7456*4882a593SmuzhiyunAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7457*4882a593Smuzhiyunfunc_stripname_cnf ()
7458*4882a593Smuzhiyun{
7459*4882a593Smuzhiyun  case @S|@2 in
7460*4882a593Smuzhiyun  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7461*4882a593Smuzhiyun  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7462*4882a593Smuzhiyun  esac
7463*4882a593Smuzhiyun} # func_stripname_cnf
7464*4882a593Smuzhiyun])# _LT_FUNC_STRIPNAME_CNF
7465*4882a593Smuzhiyun
7466*4882a593Smuzhiyun
7467*4882a593Smuzhiyun# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7468*4882a593Smuzhiyun# ---------------------------------
7469*4882a593Smuzhiyun# Figure out "hidden" library dependencies from verbose
7470*4882a593Smuzhiyun# compiler output when linking a shared library.
7471*4882a593Smuzhiyun# Parse the compiler output and extract the necessary
7472*4882a593Smuzhiyun# objects, libraries and library flags.
7473*4882a593Smuzhiyunm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7474*4882a593Smuzhiyun[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7475*4882a593SmuzhiyunAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7476*4882a593Smuzhiyun# Dependencies to place before and after the object being linked:
7477*4882a593Smuzhiyun_LT_TAGVAR(predep_objects, $1)=
7478*4882a593Smuzhiyun_LT_TAGVAR(postdep_objects, $1)=
7479*4882a593Smuzhiyun_LT_TAGVAR(predeps, $1)=
7480*4882a593Smuzhiyun_LT_TAGVAR(postdeps, $1)=
7481*4882a593Smuzhiyun_LT_TAGVAR(compiler_lib_search_path, $1)=
7482*4882a593Smuzhiyun
7483*4882a593Smuzhiyundnl we can't use the lt_simple_compile_test_code here,
7484*4882a593Smuzhiyundnl because it contains code intended for an executable,
7485*4882a593Smuzhiyundnl not a library.  It's possible we should let each
7486*4882a593Smuzhiyundnl tag define a new lt_????_link_test_code variable,
7487*4882a593Smuzhiyundnl but it's only used here...
7488*4882a593Smuzhiyunm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7489*4882a593Smuzhiyunint a;
7490*4882a593Smuzhiyunvoid foo (void) { a = 0; }
7491*4882a593Smuzhiyun_LT_EOF
7492*4882a593Smuzhiyun], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7493*4882a593Smuzhiyunclass Foo
7494*4882a593Smuzhiyun{
7495*4882a593Smuzhiyunpublic:
7496*4882a593Smuzhiyun  Foo (void) { a = 0; }
7497*4882a593Smuzhiyunprivate:
7498*4882a593Smuzhiyun  int a;
7499*4882a593Smuzhiyun};
7500*4882a593Smuzhiyun_LT_EOF
7501*4882a593Smuzhiyun], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7502*4882a593Smuzhiyun      subroutine foo
7503*4882a593Smuzhiyun      implicit none
7504*4882a593Smuzhiyun      integer*4 a
7505*4882a593Smuzhiyun      a=0
7506*4882a593Smuzhiyun      return
7507*4882a593Smuzhiyun      end
7508*4882a593Smuzhiyun_LT_EOF
7509*4882a593Smuzhiyun], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7510*4882a593Smuzhiyun      subroutine foo
7511*4882a593Smuzhiyun      implicit none
7512*4882a593Smuzhiyun      integer a
7513*4882a593Smuzhiyun      a=0
7514*4882a593Smuzhiyun      return
7515*4882a593Smuzhiyun      end
7516*4882a593Smuzhiyun_LT_EOF
7517*4882a593Smuzhiyun], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7518*4882a593Smuzhiyunpublic class foo {
7519*4882a593Smuzhiyun  private int a;
7520*4882a593Smuzhiyun  public void bar (void) {
7521*4882a593Smuzhiyun    a = 0;
7522*4882a593Smuzhiyun  }
7523*4882a593Smuzhiyun};
7524*4882a593Smuzhiyun_LT_EOF
7525*4882a593Smuzhiyun], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7526*4882a593Smuzhiyunpackage foo
7527*4882a593Smuzhiyunfunc foo() {
7528*4882a593Smuzhiyun}
7529*4882a593Smuzhiyun_LT_EOF
7530*4882a593Smuzhiyun])
7531*4882a593Smuzhiyun
7532*4882a593Smuzhiyun_lt_libdeps_save_CFLAGS=$CFLAGS
7533*4882a593Smuzhiyuncase "$CC $CFLAGS " in #(
7534*4882a593Smuzhiyun*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7535*4882a593Smuzhiyun*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7536*4882a593Smuzhiyun*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7537*4882a593Smuzhiyunesac
7538*4882a593Smuzhiyun
7539*4882a593Smuzhiyundnl Parse the compiler output and extract the necessary
7540*4882a593Smuzhiyundnl objects, libraries and library flags.
7541*4882a593Smuzhiyunif AC_TRY_EVAL(ac_compile); then
7542*4882a593Smuzhiyun  # Parse the compiler output and extract the necessary
7543*4882a593Smuzhiyun  # objects, libraries and library flags.
7544*4882a593Smuzhiyun
7545*4882a593Smuzhiyun  # Sentinel used to keep track of whether or not we are before
7546*4882a593Smuzhiyun  # the conftest object file.
7547*4882a593Smuzhiyun  pre_test_object_deps_done=no
7548*4882a593Smuzhiyun
7549*4882a593Smuzhiyun  for p in `eval "$output_verbose_link_cmd"`; do
7550*4882a593Smuzhiyun    case $prev$p in
7551*4882a593Smuzhiyun
7552*4882a593Smuzhiyun    -L* | -R* | -l*)
7553*4882a593Smuzhiyun       # Some compilers place space between "-{L,R}" and the path.
7554*4882a593Smuzhiyun       # Remove the space.
7555*4882a593Smuzhiyun       if test x-L = "$p" ||
7556*4882a593Smuzhiyun          test x-R = "$p"; then
7557*4882a593Smuzhiyun	 prev=$p
7558*4882a593Smuzhiyun	 continue
7559*4882a593Smuzhiyun       fi
7560*4882a593Smuzhiyun
7561*4882a593Smuzhiyun       # Expand the sysroot to ease extracting the directories later.
7562*4882a593Smuzhiyun       if test -z "$prev"; then
7563*4882a593Smuzhiyun         case $p in
7564*4882a593Smuzhiyun         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7565*4882a593Smuzhiyun         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7566*4882a593Smuzhiyun         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7567*4882a593Smuzhiyun         esac
7568*4882a593Smuzhiyun       fi
7569*4882a593Smuzhiyun       case $p in
7570*4882a593Smuzhiyun       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7571*4882a593Smuzhiyun       esac
7572*4882a593Smuzhiyun       if test no = "$pre_test_object_deps_done"; then
7573*4882a593Smuzhiyun	 case $prev in
7574*4882a593Smuzhiyun	 -L | -R)
7575*4882a593Smuzhiyun	   # Internal compiler library paths should come after those
7576*4882a593Smuzhiyun	   # provided the user.  The postdeps already come after the
7577*4882a593Smuzhiyun	   # user supplied libs so there is no need to process them.
7578*4882a593Smuzhiyun	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7579*4882a593Smuzhiyun	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7580*4882a593Smuzhiyun	   else
7581*4882a593Smuzhiyun	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7582*4882a593Smuzhiyun	   fi
7583*4882a593Smuzhiyun	   ;;
7584*4882a593Smuzhiyun	 # The "-l" case would never come before the object being
7585*4882a593Smuzhiyun	 # linked, so don't bother handling this case.
7586*4882a593Smuzhiyun	 esac
7587*4882a593Smuzhiyun       else
7588*4882a593Smuzhiyun	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7589*4882a593Smuzhiyun	   _LT_TAGVAR(postdeps, $1)=$prev$p
7590*4882a593Smuzhiyun	 else
7591*4882a593Smuzhiyun	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7592*4882a593Smuzhiyun	 fi
7593*4882a593Smuzhiyun       fi
7594*4882a593Smuzhiyun       prev=
7595*4882a593Smuzhiyun       ;;
7596*4882a593Smuzhiyun
7597*4882a593Smuzhiyun    *.lto.$objext) ;; # Ignore GCC LTO objects
7598*4882a593Smuzhiyun    *.$objext)
7599*4882a593Smuzhiyun       # This assumes that the test object file only shows up
7600*4882a593Smuzhiyun       # once in the compiler output.
7601*4882a593Smuzhiyun       if test "$p" = "conftest.$objext"; then
7602*4882a593Smuzhiyun	 pre_test_object_deps_done=yes
7603*4882a593Smuzhiyun	 continue
7604*4882a593Smuzhiyun       fi
7605*4882a593Smuzhiyun
7606*4882a593Smuzhiyun       if test no = "$pre_test_object_deps_done"; then
7607*4882a593Smuzhiyun	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7608*4882a593Smuzhiyun	   _LT_TAGVAR(predep_objects, $1)=$p
7609*4882a593Smuzhiyun	 else
7610*4882a593Smuzhiyun	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7611*4882a593Smuzhiyun	 fi
7612*4882a593Smuzhiyun       else
7613*4882a593Smuzhiyun	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7614*4882a593Smuzhiyun	   _LT_TAGVAR(postdep_objects, $1)=$p
7615*4882a593Smuzhiyun	 else
7616*4882a593Smuzhiyun	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7617*4882a593Smuzhiyun	 fi
7618*4882a593Smuzhiyun       fi
7619*4882a593Smuzhiyun       ;;
7620*4882a593Smuzhiyun
7621*4882a593Smuzhiyun    *) ;; # Ignore the rest.
7622*4882a593Smuzhiyun
7623*4882a593Smuzhiyun    esac
7624*4882a593Smuzhiyun  done
7625*4882a593Smuzhiyun
7626*4882a593Smuzhiyun  # Clean up.
7627*4882a593Smuzhiyun  rm -f a.out a.exe
7628*4882a593Smuzhiyunelse
7629*4882a593Smuzhiyun  echo "libtool.m4: error: problem compiling $1 test program"
7630*4882a593Smuzhiyunfi
7631*4882a593Smuzhiyun
7632*4882a593Smuzhiyun$RM -f confest.$objext
7633*4882a593SmuzhiyunCFLAGS=$_lt_libdeps_save_CFLAGS
7634*4882a593Smuzhiyun
7635*4882a593Smuzhiyun# PORTME: override above test on systems where it is broken
7636*4882a593Smuzhiyunm4_if([$1], [CXX],
7637*4882a593Smuzhiyun[case $host_os in
7638*4882a593Smuzhiyuninterix[[3-9]]*)
7639*4882a593Smuzhiyun  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7640*4882a593Smuzhiyun  # hack all around it, let's just trust "g++" to DTRT.
7641*4882a593Smuzhiyun  _LT_TAGVAR(predep_objects,$1)=
7642*4882a593Smuzhiyun  _LT_TAGVAR(postdep_objects,$1)=
7643*4882a593Smuzhiyun  _LT_TAGVAR(postdeps,$1)=
7644*4882a593Smuzhiyun  ;;
7645*4882a593Smuzhiyunesac
7646*4882a593Smuzhiyun])
7647*4882a593Smuzhiyun
7648*4882a593Smuzhiyuncase " $_LT_TAGVAR(postdeps, $1) " in
7649*4882a593Smuzhiyun*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7650*4882a593Smuzhiyunesac
7651*4882a593Smuzhiyun _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7652*4882a593Smuzhiyunif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7653*4882a593Smuzhiyun _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7654*4882a593Smuzhiyunfi
7655*4882a593Smuzhiyun_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7656*4882a593Smuzhiyun    [The directories searched by this compiler when creating a shared library])
7657*4882a593Smuzhiyun_LT_TAGDECL([], [predep_objects], [1],
7658*4882a593Smuzhiyun    [Dependencies to place before and after the objects being linked to
7659*4882a593Smuzhiyun    create a shared library])
7660*4882a593Smuzhiyun_LT_TAGDECL([], [postdep_objects], [1])
7661*4882a593Smuzhiyun_LT_TAGDECL([], [predeps], [1])
7662*4882a593Smuzhiyun_LT_TAGDECL([], [postdeps], [1])
7663*4882a593Smuzhiyun_LT_TAGDECL([], [compiler_lib_search_path], [1],
7664*4882a593Smuzhiyun    [The library search path used internally by the compiler when linking
7665*4882a593Smuzhiyun    a shared library])
7666*4882a593Smuzhiyun])# _LT_SYS_HIDDEN_LIBDEPS
7667*4882a593Smuzhiyun
7668*4882a593Smuzhiyun
7669*4882a593Smuzhiyun# _LT_LANG_F77_CONFIG([TAG])
7670*4882a593Smuzhiyun# --------------------------
7671*4882a593Smuzhiyun# Ensure that the configuration variables for a Fortran 77 compiler are
7672*4882a593Smuzhiyun# suitably defined.  These variables are subsequently used by _LT_CONFIG
7673*4882a593Smuzhiyun# to write the compiler configuration to 'libtool'.
7674*4882a593Smuzhiyunm4_defun([_LT_LANG_F77_CONFIG],
7675*4882a593Smuzhiyun[AC_LANG_PUSH(Fortran 77)
7676*4882a593Smuzhiyunif test -z "$F77" || test no = "$F77"; then
7677*4882a593Smuzhiyun  _lt_disable_F77=yes
7678*4882a593Smuzhiyunfi
7679*4882a593Smuzhiyun
7680*4882a593Smuzhiyun_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7681*4882a593Smuzhiyun_LT_TAGVAR(allow_undefined_flag, $1)=
7682*4882a593Smuzhiyun_LT_TAGVAR(always_export_symbols, $1)=no
7683*4882a593Smuzhiyun_LT_TAGVAR(archive_expsym_cmds, $1)=
7684*4882a593Smuzhiyun_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7685*4882a593Smuzhiyun_LT_TAGVAR(hardcode_direct, $1)=no
7686*4882a593Smuzhiyun_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7687*4882a593Smuzhiyun_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7688*4882a593Smuzhiyun_LT_TAGVAR(hardcode_libdir_separator, $1)=
7689*4882a593Smuzhiyun_LT_TAGVAR(hardcode_minus_L, $1)=no
7690*4882a593Smuzhiyun_LT_TAGVAR(hardcode_automatic, $1)=no
7691*4882a593Smuzhiyun_LT_TAGVAR(inherit_rpath, $1)=no
7692*4882a593Smuzhiyun_LT_TAGVAR(module_cmds, $1)=
7693*4882a593Smuzhiyun_LT_TAGVAR(module_expsym_cmds, $1)=
7694*4882a593Smuzhiyun_LT_TAGVAR(link_all_deplibs, $1)=unknown
7695*4882a593Smuzhiyun_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7696*4882a593Smuzhiyun_LT_TAGVAR(reload_flag, $1)=$reload_flag
7697*4882a593Smuzhiyun_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7698*4882a593Smuzhiyun_LT_TAGVAR(no_undefined_flag, $1)=
7699*4882a593Smuzhiyun_LT_TAGVAR(whole_archive_flag_spec, $1)=
7700*4882a593Smuzhiyun_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7701*4882a593Smuzhiyun
7702*4882a593Smuzhiyun# Source file extension for f77 test sources.
7703*4882a593Smuzhiyunac_ext=f
7704*4882a593Smuzhiyun
7705*4882a593Smuzhiyun# Object file extension for compiled f77 test sources.
7706*4882a593Smuzhiyunobjext=o
7707*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
7708*4882a593Smuzhiyun
7709*4882a593Smuzhiyun# No sense in running all these tests if we already determined that
7710*4882a593Smuzhiyun# the F77 compiler isn't working.  Some variables (like enable_shared)
7711*4882a593Smuzhiyun# are currently assumed to apply to all compilers on this platform,
7712*4882a593Smuzhiyun# and will be corrupted by setting them based on a non-working compiler.
7713*4882a593Smuzhiyunif test yes != "$_lt_disable_F77"; then
7714*4882a593Smuzhiyun  # Code to be used in simple compile tests
7715*4882a593Smuzhiyun  lt_simple_compile_test_code="\
7716*4882a593Smuzhiyun      subroutine t
7717*4882a593Smuzhiyun      return
7718*4882a593Smuzhiyun      end
7719*4882a593Smuzhiyun"
7720*4882a593Smuzhiyun
7721*4882a593Smuzhiyun  # Code to be used in simple link tests
7722*4882a593Smuzhiyun  lt_simple_link_test_code="\
7723*4882a593Smuzhiyun      program t
7724*4882a593Smuzhiyun      end
7725*4882a593Smuzhiyun"
7726*4882a593Smuzhiyun
7727*4882a593Smuzhiyun  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7728*4882a593Smuzhiyun  _LT_TAG_COMPILER
7729*4882a593Smuzhiyun
7730*4882a593Smuzhiyun  # save warnings/boilerplate of simple test code
7731*4882a593Smuzhiyun  _LT_COMPILER_BOILERPLATE
7732*4882a593Smuzhiyun  _LT_LINKER_BOILERPLATE
7733*4882a593Smuzhiyun
7734*4882a593Smuzhiyun  # Allow CC to be a program name with arguments.
7735*4882a593Smuzhiyun  lt_save_CC=$CC
7736*4882a593Smuzhiyun  lt_save_GCC=$GCC
7737*4882a593Smuzhiyun  lt_save_CFLAGS=$CFLAGS
7738*4882a593Smuzhiyun  CC=${F77-"f77"}
7739*4882a593Smuzhiyun  CFLAGS=$FFLAGS
7740*4882a593Smuzhiyun  compiler=$CC
7741*4882a593Smuzhiyun  _LT_TAGVAR(compiler, $1)=$CC
7742*4882a593Smuzhiyun  _LT_CC_BASENAME([$compiler])
7743*4882a593Smuzhiyun  GCC=$G77
7744*4882a593Smuzhiyun  if test -n "$compiler"; then
7745*4882a593Smuzhiyun    AC_MSG_CHECKING([if libtool supports shared libraries])
7746*4882a593Smuzhiyun    AC_MSG_RESULT([$can_build_shared])
7747*4882a593Smuzhiyun
7748*4882a593Smuzhiyun    AC_MSG_CHECKING([whether to build shared libraries])
7749*4882a593Smuzhiyun    test no = "$can_build_shared" && enable_shared=no
7750*4882a593Smuzhiyun
7751*4882a593Smuzhiyun    # On AIX, shared libraries and static libraries use the same namespace, and
7752*4882a593Smuzhiyun    # are all built from PIC.
7753*4882a593Smuzhiyun    case $host_os in
7754*4882a593Smuzhiyun      aix3*)
7755*4882a593Smuzhiyun        test yes = "$enable_shared" && enable_static=no
7756*4882a593Smuzhiyun        if test -n "$RANLIB"; then
7757*4882a593Smuzhiyun          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7758*4882a593Smuzhiyun          postinstall_cmds='$RANLIB $lib'
7759*4882a593Smuzhiyun        fi
7760*4882a593Smuzhiyun        ;;
7761*4882a593Smuzhiyun      aix[[4-9]]*)
7762*4882a593Smuzhiyun	if test ia64 != "$host_cpu"; then
7763*4882a593Smuzhiyun	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7764*4882a593Smuzhiyun	  yes,aix,yes) ;;		# shared object as lib.so file only
7765*4882a593Smuzhiyun	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7766*4882a593Smuzhiyun	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7767*4882a593Smuzhiyun	  esac
7768*4882a593Smuzhiyun	fi
7769*4882a593Smuzhiyun        ;;
7770*4882a593Smuzhiyun    esac
7771*4882a593Smuzhiyun    AC_MSG_RESULT([$enable_shared])
7772*4882a593Smuzhiyun
7773*4882a593Smuzhiyun    AC_MSG_CHECKING([whether to build static libraries])
7774*4882a593Smuzhiyun    # Make sure either enable_shared or enable_static is yes.
7775*4882a593Smuzhiyun    test yes = "$enable_shared" || enable_static=yes
7776*4882a593Smuzhiyun    AC_MSG_RESULT([$enable_static])
7777*4882a593Smuzhiyun
7778*4882a593Smuzhiyun    _LT_TAGVAR(GCC, $1)=$G77
7779*4882a593Smuzhiyun    _LT_TAGVAR(LD, $1)=$LD
7780*4882a593Smuzhiyun
7781*4882a593Smuzhiyun    ## CAVEAT EMPTOR:
7782*4882a593Smuzhiyun    ## There is no encapsulation within the following macros, do not change
7783*4882a593Smuzhiyun    ## the running order or otherwise move them around unless you know exactly
7784*4882a593Smuzhiyun    ## what you are doing...
7785*4882a593Smuzhiyun    _LT_COMPILER_PIC($1)
7786*4882a593Smuzhiyun    _LT_COMPILER_C_O($1)
7787*4882a593Smuzhiyun    _LT_COMPILER_FILE_LOCKS($1)
7788*4882a593Smuzhiyun    _LT_LINKER_SHLIBS($1)
7789*4882a593Smuzhiyun    _LT_SYS_DYNAMIC_LINKER($1)
7790*4882a593Smuzhiyun    _LT_LINKER_HARDCODE_LIBPATH($1)
7791*4882a593Smuzhiyun
7792*4882a593Smuzhiyun    _LT_CONFIG($1)
7793*4882a593Smuzhiyun  fi # test -n "$compiler"
7794*4882a593Smuzhiyun
7795*4882a593Smuzhiyun  GCC=$lt_save_GCC
7796*4882a593Smuzhiyun  CC=$lt_save_CC
7797*4882a593Smuzhiyun  CFLAGS=$lt_save_CFLAGS
7798*4882a593Smuzhiyunfi # test yes != "$_lt_disable_F77"
7799*4882a593Smuzhiyun
7800*4882a593SmuzhiyunAC_LANG_POP
7801*4882a593Smuzhiyun])# _LT_LANG_F77_CONFIG
7802*4882a593Smuzhiyun
7803*4882a593Smuzhiyun
7804*4882a593Smuzhiyun# _LT_LANG_FC_CONFIG([TAG])
7805*4882a593Smuzhiyun# -------------------------
7806*4882a593Smuzhiyun# Ensure that the configuration variables for a Fortran compiler are
7807*4882a593Smuzhiyun# suitably defined.  These variables are subsequently used by _LT_CONFIG
7808*4882a593Smuzhiyun# to write the compiler configuration to 'libtool'.
7809*4882a593Smuzhiyunm4_defun([_LT_LANG_FC_CONFIG],
7810*4882a593Smuzhiyun[AC_LANG_PUSH(Fortran)
7811*4882a593Smuzhiyun
7812*4882a593Smuzhiyunif test -z "$FC" || test no = "$FC"; then
7813*4882a593Smuzhiyun  _lt_disable_FC=yes
7814*4882a593Smuzhiyunfi
7815*4882a593Smuzhiyun
7816*4882a593Smuzhiyun_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7817*4882a593Smuzhiyun_LT_TAGVAR(allow_undefined_flag, $1)=
7818*4882a593Smuzhiyun_LT_TAGVAR(always_export_symbols, $1)=no
7819*4882a593Smuzhiyun_LT_TAGVAR(archive_expsym_cmds, $1)=
7820*4882a593Smuzhiyun_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7821*4882a593Smuzhiyun_LT_TAGVAR(hardcode_direct, $1)=no
7822*4882a593Smuzhiyun_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7823*4882a593Smuzhiyun_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7824*4882a593Smuzhiyun_LT_TAGVAR(hardcode_libdir_separator, $1)=
7825*4882a593Smuzhiyun_LT_TAGVAR(hardcode_minus_L, $1)=no
7826*4882a593Smuzhiyun_LT_TAGVAR(hardcode_automatic, $1)=no
7827*4882a593Smuzhiyun_LT_TAGVAR(inherit_rpath, $1)=no
7828*4882a593Smuzhiyun_LT_TAGVAR(module_cmds, $1)=
7829*4882a593Smuzhiyun_LT_TAGVAR(module_expsym_cmds, $1)=
7830*4882a593Smuzhiyun_LT_TAGVAR(link_all_deplibs, $1)=unknown
7831*4882a593Smuzhiyun_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7832*4882a593Smuzhiyun_LT_TAGVAR(reload_flag, $1)=$reload_flag
7833*4882a593Smuzhiyun_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7834*4882a593Smuzhiyun_LT_TAGVAR(no_undefined_flag, $1)=
7835*4882a593Smuzhiyun_LT_TAGVAR(whole_archive_flag_spec, $1)=
7836*4882a593Smuzhiyun_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7837*4882a593Smuzhiyun
7838*4882a593Smuzhiyun# Source file extension for fc test sources.
7839*4882a593Smuzhiyunac_ext=${ac_fc_srcext-f}
7840*4882a593Smuzhiyun
7841*4882a593Smuzhiyun# Object file extension for compiled fc test sources.
7842*4882a593Smuzhiyunobjext=o
7843*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
7844*4882a593Smuzhiyun
7845*4882a593Smuzhiyun# No sense in running all these tests if we already determined that
7846*4882a593Smuzhiyun# the FC compiler isn't working.  Some variables (like enable_shared)
7847*4882a593Smuzhiyun# are currently assumed to apply to all compilers on this platform,
7848*4882a593Smuzhiyun# and will be corrupted by setting them based on a non-working compiler.
7849*4882a593Smuzhiyunif test yes != "$_lt_disable_FC"; then
7850*4882a593Smuzhiyun  # Code to be used in simple compile tests
7851*4882a593Smuzhiyun  lt_simple_compile_test_code="\
7852*4882a593Smuzhiyun      subroutine t
7853*4882a593Smuzhiyun      return
7854*4882a593Smuzhiyun      end
7855*4882a593Smuzhiyun"
7856*4882a593Smuzhiyun
7857*4882a593Smuzhiyun  # Code to be used in simple link tests
7858*4882a593Smuzhiyun  lt_simple_link_test_code="\
7859*4882a593Smuzhiyun      program t
7860*4882a593Smuzhiyun      end
7861*4882a593Smuzhiyun"
7862*4882a593Smuzhiyun
7863*4882a593Smuzhiyun  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7864*4882a593Smuzhiyun  _LT_TAG_COMPILER
7865*4882a593Smuzhiyun
7866*4882a593Smuzhiyun  # save warnings/boilerplate of simple test code
7867*4882a593Smuzhiyun  _LT_COMPILER_BOILERPLATE
7868*4882a593Smuzhiyun  _LT_LINKER_BOILERPLATE
7869*4882a593Smuzhiyun
7870*4882a593Smuzhiyun  # Allow CC to be a program name with arguments.
7871*4882a593Smuzhiyun  lt_save_CC=$CC
7872*4882a593Smuzhiyun  lt_save_GCC=$GCC
7873*4882a593Smuzhiyun  lt_save_CFLAGS=$CFLAGS
7874*4882a593Smuzhiyun  CC=${FC-"f95"}
7875*4882a593Smuzhiyun  CFLAGS=$FCFLAGS
7876*4882a593Smuzhiyun  compiler=$CC
7877*4882a593Smuzhiyun  GCC=$ac_cv_fc_compiler_gnu
7878*4882a593Smuzhiyun
7879*4882a593Smuzhiyun  _LT_TAGVAR(compiler, $1)=$CC
7880*4882a593Smuzhiyun  _LT_CC_BASENAME([$compiler])
7881*4882a593Smuzhiyun
7882*4882a593Smuzhiyun  if test -n "$compiler"; then
7883*4882a593Smuzhiyun    AC_MSG_CHECKING([if libtool supports shared libraries])
7884*4882a593Smuzhiyun    AC_MSG_RESULT([$can_build_shared])
7885*4882a593Smuzhiyun
7886*4882a593Smuzhiyun    AC_MSG_CHECKING([whether to build shared libraries])
7887*4882a593Smuzhiyun    test no = "$can_build_shared" && enable_shared=no
7888*4882a593Smuzhiyun
7889*4882a593Smuzhiyun    # On AIX, shared libraries and static libraries use the same namespace, and
7890*4882a593Smuzhiyun    # are all built from PIC.
7891*4882a593Smuzhiyun    case $host_os in
7892*4882a593Smuzhiyun      aix3*)
7893*4882a593Smuzhiyun        test yes = "$enable_shared" && enable_static=no
7894*4882a593Smuzhiyun        if test -n "$RANLIB"; then
7895*4882a593Smuzhiyun          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7896*4882a593Smuzhiyun          postinstall_cmds='$RANLIB $lib'
7897*4882a593Smuzhiyun        fi
7898*4882a593Smuzhiyun        ;;
7899*4882a593Smuzhiyun      aix[[4-9]]*)
7900*4882a593Smuzhiyun	if test ia64 != "$host_cpu"; then
7901*4882a593Smuzhiyun	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7902*4882a593Smuzhiyun	  yes,aix,yes) ;;		# shared object as lib.so file only
7903*4882a593Smuzhiyun	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7904*4882a593Smuzhiyun	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7905*4882a593Smuzhiyun	  esac
7906*4882a593Smuzhiyun	fi
7907*4882a593Smuzhiyun        ;;
7908*4882a593Smuzhiyun    esac
7909*4882a593Smuzhiyun    AC_MSG_RESULT([$enable_shared])
7910*4882a593Smuzhiyun
7911*4882a593Smuzhiyun    AC_MSG_CHECKING([whether to build static libraries])
7912*4882a593Smuzhiyun    # Make sure either enable_shared or enable_static is yes.
7913*4882a593Smuzhiyun    test yes = "$enable_shared" || enable_static=yes
7914*4882a593Smuzhiyun    AC_MSG_RESULT([$enable_static])
7915*4882a593Smuzhiyun
7916*4882a593Smuzhiyun    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7917*4882a593Smuzhiyun    _LT_TAGVAR(LD, $1)=$LD
7918*4882a593Smuzhiyun
7919*4882a593Smuzhiyun    ## CAVEAT EMPTOR:
7920*4882a593Smuzhiyun    ## There is no encapsulation within the following macros, do not change
7921*4882a593Smuzhiyun    ## the running order or otherwise move them around unless you know exactly
7922*4882a593Smuzhiyun    ## what you are doing...
7923*4882a593Smuzhiyun    _LT_SYS_HIDDEN_LIBDEPS($1)
7924*4882a593Smuzhiyun    _LT_COMPILER_PIC($1)
7925*4882a593Smuzhiyun    _LT_COMPILER_C_O($1)
7926*4882a593Smuzhiyun    _LT_COMPILER_FILE_LOCKS($1)
7927*4882a593Smuzhiyun    _LT_LINKER_SHLIBS($1)
7928*4882a593Smuzhiyun    _LT_SYS_DYNAMIC_LINKER($1)
7929*4882a593Smuzhiyun    _LT_LINKER_HARDCODE_LIBPATH($1)
7930*4882a593Smuzhiyun
7931*4882a593Smuzhiyun    _LT_CONFIG($1)
7932*4882a593Smuzhiyun  fi # test -n "$compiler"
7933*4882a593Smuzhiyun
7934*4882a593Smuzhiyun  GCC=$lt_save_GCC
7935*4882a593Smuzhiyun  CC=$lt_save_CC
7936*4882a593Smuzhiyun  CFLAGS=$lt_save_CFLAGS
7937*4882a593Smuzhiyunfi # test yes != "$_lt_disable_FC"
7938*4882a593Smuzhiyun
7939*4882a593SmuzhiyunAC_LANG_POP
7940*4882a593Smuzhiyun])# _LT_LANG_FC_CONFIG
7941*4882a593Smuzhiyun
7942*4882a593Smuzhiyun
7943*4882a593Smuzhiyun# _LT_LANG_GCJ_CONFIG([TAG])
7944*4882a593Smuzhiyun# --------------------------
7945*4882a593Smuzhiyun# Ensure that the configuration variables for the GNU Java Compiler compiler
7946*4882a593Smuzhiyun# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7947*4882a593Smuzhiyun# to write the compiler configuration to 'libtool'.
7948*4882a593Smuzhiyunm4_defun([_LT_LANG_GCJ_CONFIG],
7949*4882a593Smuzhiyun[AC_REQUIRE([LT_PROG_GCJ])dnl
7950*4882a593SmuzhiyunAC_LANG_SAVE
7951*4882a593Smuzhiyun
7952*4882a593Smuzhiyun# Source file extension for Java test sources.
7953*4882a593Smuzhiyunac_ext=java
7954*4882a593Smuzhiyun
7955*4882a593Smuzhiyun# Object file extension for compiled Java test sources.
7956*4882a593Smuzhiyunobjext=o
7957*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
7958*4882a593Smuzhiyun
7959*4882a593Smuzhiyun# Code to be used in simple compile tests
7960*4882a593Smuzhiyunlt_simple_compile_test_code="class foo {}"
7961*4882a593Smuzhiyun
7962*4882a593Smuzhiyun# Code to be used in simple link tests
7963*4882a593Smuzhiyunlt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7964*4882a593Smuzhiyun
7965*4882a593Smuzhiyun# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7966*4882a593Smuzhiyun_LT_TAG_COMPILER
7967*4882a593Smuzhiyun
7968*4882a593Smuzhiyun# save warnings/boilerplate of simple test code
7969*4882a593Smuzhiyun_LT_COMPILER_BOILERPLATE
7970*4882a593Smuzhiyun_LT_LINKER_BOILERPLATE
7971*4882a593Smuzhiyun
7972*4882a593Smuzhiyun# Allow CC to be a program name with arguments.
7973*4882a593Smuzhiyunlt_save_CC=$CC
7974*4882a593Smuzhiyunlt_save_CFLAGS=$CFLAGS
7975*4882a593Smuzhiyunlt_save_GCC=$GCC
7976*4882a593SmuzhiyunGCC=yes
7977*4882a593SmuzhiyunCC=${GCJ-"gcj"}
7978*4882a593SmuzhiyunCFLAGS=$GCJFLAGS
7979*4882a593Smuzhiyuncompiler=$CC
7980*4882a593Smuzhiyun_LT_TAGVAR(compiler, $1)=$CC
7981*4882a593Smuzhiyun_LT_TAGVAR(LD, $1)=$LD
7982*4882a593Smuzhiyun_LT_CC_BASENAME([$compiler])
7983*4882a593Smuzhiyun
7984*4882a593Smuzhiyun# GCJ did not exist at the time GCC didn't implicitly link libc in.
7985*4882a593Smuzhiyun_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7986*4882a593Smuzhiyun
7987*4882a593Smuzhiyun_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7988*4882a593Smuzhiyun_LT_TAGVAR(reload_flag, $1)=$reload_flag
7989*4882a593Smuzhiyun_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7990*4882a593Smuzhiyun
7991*4882a593Smuzhiyun## CAVEAT EMPTOR:
7992*4882a593Smuzhiyun## There is no encapsulation within the following macros, do not change
7993*4882a593Smuzhiyun## the running order or otherwise move them around unless you know exactly
7994*4882a593Smuzhiyun## what you are doing...
7995*4882a593Smuzhiyunif test -n "$compiler"; then
7996*4882a593Smuzhiyun  _LT_COMPILER_NO_RTTI($1)
7997*4882a593Smuzhiyun  _LT_COMPILER_PIC($1)
7998*4882a593Smuzhiyun  _LT_COMPILER_C_O($1)
7999*4882a593Smuzhiyun  _LT_COMPILER_FILE_LOCKS($1)
8000*4882a593Smuzhiyun  _LT_LINKER_SHLIBS($1)
8001*4882a593Smuzhiyun  _LT_LINKER_HARDCODE_LIBPATH($1)
8002*4882a593Smuzhiyun
8003*4882a593Smuzhiyun  _LT_CONFIG($1)
8004*4882a593Smuzhiyunfi
8005*4882a593Smuzhiyun
8006*4882a593SmuzhiyunAC_LANG_RESTORE
8007*4882a593Smuzhiyun
8008*4882a593SmuzhiyunGCC=$lt_save_GCC
8009*4882a593SmuzhiyunCC=$lt_save_CC
8010*4882a593SmuzhiyunCFLAGS=$lt_save_CFLAGS
8011*4882a593Smuzhiyun])# _LT_LANG_GCJ_CONFIG
8012*4882a593Smuzhiyun
8013*4882a593Smuzhiyun
8014*4882a593Smuzhiyun# _LT_LANG_GO_CONFIG([TAG])
8015*4882a593Smuzhiyun# --------------------------
8016*4882a593Smuzhiyun# Ensure that the configuration variables for the GNU Go compiler
8017*4882a593Smuzhiyun# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8018*4882a593Smuzhiyun# to write the compiler configuration to 'libtool'.
8019*4882a593Smuzhiyunm4_defun([_LT_LANG_GO_CONFIG],
8020*4882a593Smuzhiyun[AC_REQUIRE([LT_PROG_GO])dnl
8021*4882a593SmuzhiyunAC_LANG_SAVE
8022*4882a593Smuzhiyun
8023*4882a593Smuzhiyun# Source file extension for Go test sources.
8024*4882a593Smuzhiyunac_ext=go
8025*4882a593Smuzhiyun
8026*4882a593Smuzhiyun# Object file extension for compiled Go test sources.
8027*4882a593Smuzhiyunobjext=o
8028*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
8029*4882a593Smuzhiyun
8030*4882a593Smuzhiyun# Code to be used in simple compile tests
8031*4882a593Smuzhiyunlt_simple_compile_test_code="package main; func main() { }"
8032*4882a593Smuzhiyun
8033*4882a593Smuzhiyun# Code to be used in simple link tests
8034*4882a593Smuzhiyunlt_simple_link_test_code='package main; func main() { }'
8035*4882a593Smuzhiyun
8036*4882a593Smuzhiyun# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8037*4882a593Smuzhiyun_LT_TAG_COMPILER
8038*4882a593Smuzhiyun
8039*4882a593Smuzhiyun# save warnings/boilerplate of simple test code
8040*4882a593Smuzhiyun_LT_COMPILER_BOILERPLATE
8041*4882a593Smuzhiyun_LT_LINKER_BOILERPLATE
8042*4882a593Smuzhiyun
8043*4882a593Smuzhiyun# Allow CC to be a program name with arguments.
8044*4882a593Smuzhiyunlt_save_CC=$CC
8045*4882a593Smuzhiyunlt_save_CFLAGS=$CFLAGS
8046*4882a593Smuzhiyunlt_save_GCC=$GCC
8047*4882a593SmuzhiyunGCC=yes
8048*4882a593SmuzhiyunCC=${GOC-"gccgo"}
8049*4882a593SmuzhiyunCFLAGS=$GOFLAGS
8050*4882a593Smuzhiyuncompiler=$CC
8051*4882a593Smuzhiyun_LT_TAGVAR(compiler, $1)=$CC
8052*4882a593Smuzhiyun_LT_TAGVAR(LD, $1)=$LD
8053*4882a593Smuzhiyun_LT_CC_BASENAME([$compiler])
8054*4882a593Smuzhiyun
8055*4882a593Smuzhiyun# Go did not exist at the time GCC didn't implicitly link libc in.
8056*4882a593Smuzhiyun_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8057*4882a593Smuzhiyun
8058*4882a593Smuzhiyun_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8059*4882a593Smuzhiyun_LT_TAGVAR(reload_flag, $1)=$reload_flag
8060*4882a593Smuzhiyun_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8061*4882a593Smuzhiyun
8062*4882a593Smuzhiyun## CAVEAT EMPTOR:
8063*4882a593Smuzhiyun## There is no encapsulation within the following macros, do not change
8064*4882a593Smuzhiyun## the running order or otherwise move them around unless you know exactly
8065*4882a593Smuzhiyun## what you are doing...
8066*4882a593Smuzhiyunif test -n "$compiler"; then
8067*4882a593Smuzhiyun  _LT_COMPILER_NO_RTTI($1)
8068*4882a593Smuzhiyun  _LT_COMPILER_PIC($1)
8069*4882a593Smuzhiyun  _LT_COMPILER_C_O($1)
8070*4882a593Smuzhiyun  _LT_COMPILER_FILE_LOCKS($1)
8071*4882a593Smuzhiyun  _LT_LINKER_SHLIBS($1)
8072*4882a593Smuzhiyun  _LT_LINKER_HARDCODE_LIBPATH($1)
8073*4882a593Smuzhiyun
8074*4882a593Smuzhiyun  _LT_CONFIG($1)
8075*4882a593Smuzhiyunfi
8076*4882a593Smuzhiyun
8077*4882a593SmuzhiyunAC_LANG_RESTORE
8078*4882a593Smuzhiyun
8079*4882a593SmuzhiyunGCC=$lt_save_GCC
8080*4882a593SmuzhiyunCC=$lt_save_CC
8081*4882a593SmuzhiyunCFLAGS=$lt_save_CFLAGS
8082*4882a593Smuzhiyun])# _LT_LANG_GO_CONFIG
8083*4882a593Smuzhiyun
8084*4882a593Smuzhiyun
8085*4882a593Smuzhiyun# _LT_LANG_RC_CONFIG([TAG])
8086*4882a593Smuzhiyun# -------------------------
8087*4882a593Smuzhiyun# Ensure that the configuration variables for the Windows resource compiler
8088*4882a593Smuzhiyun# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8089*4882a593Smuzhiyun# to write the compiler configuration to 'libtool'.
8090*4882a593Smuzhiyunm4_defun([_LT_LANG_RC_CONFIG],
8091*4882a593Smuzhiyun[AC_REQUIRE([LT_PROG_RC])dnl
8092*4882a593SmuzhiyunAC_LANG_SAVE
8093*4882a593Smuzhiyun
8094*4882a593Smuzhiyun# Source file extension for RC test sources.
8095*4882a593Smuzhiyunac_ext=rc
8096*4882a593Smuzhiyun
8097*4882a593Smuzhiyun# Object file extension for compiled RC test sources.
8098*4882a593Smuzhiyunobjext=o
8099*4882a593Smuzhiyun_LT_TAGVAR(objext, $1)=$objext
8100*4882a593Smuzhiyun
8101*4882a593Smuzhiyun# Code to be used in simple compile tests
8102*4882a593Smuzhiyunlt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8103*4882a593Smuzhiyun
8104*4882a593Smuzhiyun# Code to be used in simple link tests
8105*4882a593Smuzhiyunlt_simple_link_test_code=$lt_simple_compile_test_code
8106*4882a593Smuzhiyun
8107*4882a593Smuzhiyun# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8108*4882a593Smuzhiyun_LT_TAG_COMPILER
8109*4882a593Smuzhiyun
8110*4882a593Smuzhiyun# save warnings/boilerplate of simple test code
8111*4882a593Smuzhiyun_LT_COMPILER_BOILERPLATE
8112*4882a593Smuzhiyun_LT_LINKER_BOILERPLATE
8113*4882a593Smuzhiyun
8114*4882a593Smuzhiyun# Allow CC to be a program name with arguments.
8115*4882a593Smuzhiyunlt_save_CC=$CC
8116*4882a593Smuzhiyunlt_save_CFLAGS=$CFLAGS
8117*4882a593Smuzhiyunlt_save_GCC=$GCC
8118*4882a593SmuzhiyunGCC=
8119*4882a593SmuzhiyunCC=${RC-"windres"}
8120*4882a593SmuzhiyunCFLAGS=
8121*4882a593Smuzhiyuncompiler=$CC
8122*4882a593Smuzhiyun_LT_TAGVAR(compiler, $1)=$CC
8123*4882a593Smuzhiyun_LT_CC_BASENAME([$compiler])
8124*4882a593Smuzhiyun_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8125*4882a593Smuzhiyun
8126*4882a593Smuzhiyunif test -n "$compiler"; then
8127*4882a593Smuzhiyun  :
8128*4882a593Smuzhiyun  _LT_CONFIG($1)
8129*4882a593Smuzhiyunfi
8130*4882a593Smuzhiyun
8131*4882a593SmuzhiyunGCC=$lt_save_GCC
8132*4882a593SmuzhiyunAC_LANG_RESTORE
8133*4882a593SmuzhiyunCC=$lt_save_CC
8134*4882a593SmuzhiyunCFLAGS=$lt_save_CFLAGS
8135*4882a593Smuzhiyun])# _LT_LANG_RC_CONFIG
8136*4882a593Smuzhiyun
8137*4882a593Smuzhiyun
8138*4882a593Smuzhiyun# LT_PROG_GCJ
8139*4882a593Smuzhiyun# -----------
8140*4882a593SmuzhiyunAC_DEFUN([LT_PROG_GCJ],
8141*4882a593Smuzhiyun[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8142*4882a593Smuzhiyun  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8143*4882a593Smuzhiyun    [AC_CHECK_TOOL(GCJ, gcj,)
8144*4882a593Smuzhiyun      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8145*4882a593Smuzhiyun      AC_SUBST(GCJFLAGS)])])[]dnl
8146*4882a593Smuzhiyun])
8147*4882a593Smuzhiyun
8148*4882a593Smuzhiyun# Old name:
8149*4882a593SmuzhiyunAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8150*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
8151*4882a593Smuzhiyundnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8152*4882a593Smuzhiyun
8153*4882a593Smuzhiyun
8154*4882a593Smuzhiyun# LT_PROG_GO
8155*4882a593Smuzhiyun# ----------
8156*4882a593SmuzhiyunAC_DEFUN([LT_PROG_GO],
8157*4882a593Smuzhiyun[AC_CHECK_TOOL(GOC, gccgo,)
8158*4882a593Smuzhiyun])
8159*4882a593Smuzhiyun
8160*4882a593Smuzhiyun
8161*4882a593Smuzhiyun# LT_PROG_RC
8162*4882a593Smuzhiyun# ----------
8163*4882a593SmuzhiyunAC_DEFUN([LT_PROG_RC],
8164*4882a593Smuzhiyun[AC_CHECK_TOOL(RC, windres,)
8165*4882a593Smuzhiyun])
8166*4882a593Smuzhiyun
8167*4882a593Smuzhiyun# Old name:
8168*4882a593SmuzhiyunAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8169*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
8170*4882a593Smuzhiyundnl AC_DEFUN([LT_AC_PROG_RC], [])
8171*4882a593Smuzhiyun
8172*4882a593Smuzhiyun
8173*4882a593Smuzhiyun# _LT_DECL_EGREP
8174*4882a593Smuzhiyun# --------------
8175*4882a593Smuzhiyun# If we don't have a new enough Autoconf to choose the best grep
8176*4882a593Smuzhiyun# available, choose the one first in the user's PATH.
8177*4882a593Smuzhiyunm4_defun([_LT_DECL_EGREP],
8178*4882a593Smuzhiyun[AC_REQUIRE([AC_PROG_EGREP])dnl
8179*4882a593SmuzhiyunAC_REQUIRE([AC_PROG_FGREP])dnl
8180*4882a593Smuzhiyuntest -z "$GREP" && GREP=grep
8181*4882a593Smuzhiyun_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8182*4882a593Smuzhiyun_LT_DECL([], [EGREP], [1], [An ERE matcher])
8183*4882a593Smuzhiyun_LT_DECL([], [FGREP], [1], [A literal string matcher])
8184*4882a593Smuzhiyundnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8185*4882a593SmuzhiyunAC_SUBST([GREP])
8186*4882a593Smuzhiyun])
8187*4882a593Smuzhiyun
8188*4882a593Smuzhiyun
8189*4882a593Smuzhiyun# _LT_DECL_OBJDUMP
8190*4882a593Smuzhiyun# --------------
8191*4882a593Smuzhiyun# If we don't have a new enough Autoconf to choose the best objdump
8192*4882a593Smuzhiyun# available, choose the one first in the user's PATH.
8193*4882a593Smuzhiyunm4_defun([_LT_DECL_OBJDUMP],
8194*4882a593Smuzhiyun[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8195*4882a593Smuzhiyuntest -z "$OBJDUMP" && OBJDUMP=objdump
8196*4882a593Smuzhiyun_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8197*4882a593SmuzhiyunAC_SUBST([OBJDUMP])
8198*4882a593Smuzhiyun])
8199*4882a593Smuzhiyun
8200*4882a593Smuzhiyun# _LT_DECL_DLLTOOL
8201*4882a593Smuzhiyun# ----------------
8202*4882a593Smuzhiyun# Ensure DLLTOOL variable is set.
8203*4882a593Smuzhiyunm4_defun([_LT_DECL_DLLTOOL],
8204*4882a593Smuzhiyun[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8205*4882a593Smuzhiyuntest -z "$DLLTOOL" && DLLTOOL=dlltool
8206*4882a593Smuzhiyun_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8207*4882a593SmuzhiyunAC_SUBST([DLLTOOL])
8208*4882a593Smuzhiyun])
8209*4882a593Smuzhiyun
8210*4882a593Smuzhiyun# _LT_DECL_SED
8211*4882a593Smuzhiyun# ------------
8212*4882a593Smuzhiyun# Check for a fully-functional sed program, that truncates
8213*4882a593Smuzhiyun# as few characters as possible.  Prefer GNU sed if found.
8214*4882a593Smuzhiyunm4_defun([_LT_DECL_SED],
8215*4882a593Smuzhiyun[AC_PROG_SED
8216*4882a593Smuzhiyuntest -z "$SED" && SED=sed
8217*4882a593SmuzhiyunXsed="$SED -e 1s/^X//"
8218*4882a593Smuzhiyun_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8219*4882a593Smuzhiyun_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8220*4882a593Smuzhiyun    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8221*4882a593Smuzhiyun])# _LT_DECL_SED
8222*4882a593Smuzhiyun
8223*4882a593Smuzhiyunm4_ifndef([AC_PROG_SED], [
8224*4882a593Smuzhiyun############################################################
8225*4882a593Smuzhiyun# NOTE: This macro has been submitted for inclusion into   #
8226*4882a593Smuzhiyun#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8227*4882a593Smuzhiyun#  a released version of Autoconf we should remove this    #
8228*4882a593Smuzhiyun#  macro and use it instead.                               #
8229*4882a593Smuzhiyun############################################################
8230*4882a593Smuzhiyun
8231*4882a593Smuzhiyunm4_defun([AC_PROG_SED],
8232*4882a593Smuzhiyun[AC_MSG_CHECKING([for a sed that does not truncate output])
8233*4882a593SmuzhiyunAC_CACHE_VAL(lt_cv_path_SED,
8234*4882a593Smuzhiyun[# Loop through the user's path and test for sed and gsed.
8235*4882a593Smuzhiyun# Then use that list of sed's as ones to test for truncation.
8236*4882a593Smuzhiyunas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8237*4882a593Smuzhiyunfor as_dir in $PATH
8238*4882a593Smuzhiyundo
8239*4882a593Smuzhiyun  IFS=$as_save_IFS
8240*4882a593Smuzhiyun  test -z "$as_dir" && as_dir=.
8241*4882a593Smuzhiyun  for lt_ac_prog in sed gsed; do
8242*4882a593Smuzhiyun    for ac_exec_ext in '' $ac_executable_extensions; do
8243*4882a593Smuzhiyun      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8244*4882a593Smuzhiyun        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8245*4882a593Smuzhiyun      fi
8246*4882a593Smuzhiyun    done
8247*4882a593Smuzhiyun  done
8248*4882a593Smuzhiyundone
8249*4882a593SmuzhiyunIFS=$as_save_IFS
8250*4882a593Smuzhiyunlt_ac_max=0
8251*4882a593Smuzhiyunlt_ac_count=0
8252*4882a593Smuzhiyun# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8253*4882a593Smuzhiyun# along with /bin/sed that truncates output.
8254*4882a593Smuzhiyunfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8255*4882a593Smuzhiyun  test ! -f "$lt_ac_sed" && continue
8256*4882a593Smuzhiyun  cat /dev/null > conftest.in
8257*4882a593Smuzhiyun  lt_ac_count=0
8258*4882a593Smuzhiyun  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8259*4882a593Smuzhiyun  # Check for GNU sed and select it if it is found.
8260*4882a593Smuzhiyun  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8261*4882a593Smuzhiyun    lt_cv_path_SED=$lt_ac_sed
8262*4882a593Smuzhiyun    break
8263*4882a593Smuzhiyun  fi
8264*4882a593Smuzhiyun  while true; do
8265*4882a593Smuzhiyun    cat conftest.in conftest.in >conftest.tmp
8266*4882a593Smuzhiyun    mv conftest.tmp conftest.in
8267*4882a593Smuzhiyun    cp conftest.in conftest.nl
8268*4882a593Smuzhiyun    echo >>conftest.nl
8269*4882a593Smuzhiyun    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8270*4882a593Smuzhiyun    cmp -s conftest.out conftest.nl || break
8271*4882a593Smuzhiyun    # 10000 chars as input seems more than enough
8272*4882a593Smuzhiyun    test 10 -lt "$lt_ac_count" && break
8273*4882a593Smuzhiyun    lt_ac_count=`expr $lt_ac_count + 1`
8274*4882a593Smuzhiyun    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8275*4882a593Smuzhiyun      lt_ac_max=$lt_ac_count
8276*4882a593Smuzhiyun      lt_cv_path_SED=$lt_ac_sed
8277*4882a593Smuzhiyun    fi
8278*4882a593Smuzhiyun  done
8279*4882a593Smuzhiyundone
8280*4882a593Smuzhiyun])
8281*4882a593SmuzhiyunSED=$lt_cv_path_SED
8282*4882a593SmuzhiyunAC_SUBST([SED])
8283*4882a593SmuzhiyunAC_MSG_RESULT([$SED])
8284*4882a593Smuzhiyun])#AC_PROG_SED
8285*4882a593Smuzhiyun])#m4_ifndef
8286*4882a593Smuzhiyun
8287*4882a593Smuzhiyun# Old name:
8288*4882a593SmuzhiyunAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8289*4882a593Smuzhiyundnl aclocal-1.4 backwards compatibility:
8290*4882a593Smuzhiyundnl AC_DEFUN([LT_AC_PROG_SED], [])
8291*4882a593Smuzhiyun
8292*4882a593Smuzhiyun
8293*4882a593Smuzhiyun# _LT_CHECK_SHELL_FEATURES
8294*4882a593Smuzhiyun# ------------------------
8295*4882a593Smuzhiyun# Find out whether the shell is Bourne or XSI compatible,
8296*4882a593Smuzhiyun# or has some other useful features.
8297*4882a593Smuzhiyunm4_defun([_LT_CHECK_SHELL_FEATURES],
8298*4882a593Smuzhiyun[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8299*4882a593Smuzhiyun  lt_unset=unset
8300*4882a593Smuzhiyunelse
8301*4882a593Smuzhiyun  lt_unset=false
8302*4882a593Smuzhiyunfi
8303*4882a593Smuzhiyun_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8304*4882a593Smuzhiyun
8305*4882a593Smuzhiyun# test EBCDIC or ASCII
8306*4882a593Smuzhiyuncase `echo X|tr X '\101'` in
8307*4882a593Smuzhiyun A) # ASCII based system
8308*4882a593Smuzhiyun    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8309*4882a593Smuzhiyun  lt_SP2NL='tr \040 \012'
8310*4882a593Smuzhiyun  lt_NL2SP='tr \015\012 \040\040'
8311*4882a593Smuzhiyun  ;;
8312*4882a593Smuzhiyun *) # EBCDIC based system
8313*4882a593Smuzhiyun  lt_SP2NL='tr \100 \n'
8314*4882a593Smuzhiyun  lt_NL2SP='tr \r\n \100\100'
8315*4882a593Smuzhiyun  ;;
8316*4882a593Smuzhiyunesac
8317*4882a593Smuzhiyun_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8318*4882a593Smuzhiyun_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8319*4882a593Smuzhiyun])# _LT_CHECK_SHELL_FEATURES
8320*4882a593Smuzhiyun
8321*4882a593Smuzhiyun
8322*4882a593Smuzhiyun# _LT_PATH_CONVERSION_FUNCTIONS
8323*4882a593Smuzhiyun# -----------------------------
8324*4882a593Smuzhiyun# Determine what file name conversion functions should be used by
8325*4882a593Smuzhiyun# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8326*4882a593Smuzhiyun# for certain cross-compile configurations and native mingw.
8327*4882a593Smuzhiyunm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8328*4882a593Smuzhiyun[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8329*4882a593SmuzhiyunAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8330*4882a593SmuzhiyunAC_MSG_CHECKING([how to convert $build file names to $host format])
8331*4882a593SmuzhiyunAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8332*4882a593Smuzhiyun[case $host in
8333*4882a593Smuzhiyun  *-*-mingw* )
8334*4882a593Smuzhiyun    case $build in
8335*4882a593Smuzhiyun      *-*-mingw* ) # actually msys
8336*4882a593Smuzhiyun        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8337*4882a593Smuzhiyun        ;;
8338*4882a593Smuzhiyun      *-*-cygwin* )
8339*4882a593Smuzhiyun        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8340*4882a593Smuzhiyun        ;;
8341*4882a593Smuzhiyun      * ) # otherwise, assume *nix
8342*4882a593Smuzhiyun        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8343*4882a593Smuzhiyun        ;;
8344*4882a593Smuzhiyun    esac
8345*4882a593Smuzhiyun    ;;
8346*4882a593Smuzhiyun  *-*-cygwin* )
8347*4882a593Smuzhiyun    case $build in
8348*4882a593Smuzhiyun      *-*-mingw* ) # actually msys
8349*4882a593Smuzhiyun        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8350*4882a593Smuzhiyun        ;;
8351*4882a593Smuzhiyun      *-*-cygwin* )
8352*4882a593Smuzhiyun        lt_cv_to_host_file_cmd=func_convert_file_noop
8353*4882a593Smuzhiyun        ;;
8354*4882a593Smuzhiyun      * ) # otherwise, assume *nix
8355*4882a593Smuzhiyun        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8356*4882a593Smuzhiyun        ;;
8357*4882a593Smuzhiyun    esac
8358*4882a593Smuzhiyun    ;;
8359*4882a593Smuzhiyun  * ) # unhandled hosts (and "normal" native builds)
8360*4882a593Smuzhiyun    lt_cv_to_host_file_cmd=func_convert_file_noop
8361*4882a593Smuzhiyun    ;;
8362*4882a593Smuzhiyunesac
8363*4882a593Smuzhiyun])
8364*4882a593Smuzhiyunto_host_file_cmd=$lt_cv_to_host_file_cmd
8365*4882a593SmuzhiyunAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8366*4882a593Smuzhiyun_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8367*4882a593Smuzhiyun         [0], [convert $build file names to $host format])dnl
8368*4882a593Smuzhiyun
8369*4882a593SmuzhiyunAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8370*4882a593SmuzhiyunAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8371*4882a593Smuzhiyun[#assume ordinary cross tools, or native build.
8372*4882a593Smuzhiyunlt_cv_to_tool_file_cmd=func_convert_file_noop
8373*4882a593Smuzhiyuncase $host in
8374*4882a593Smuzhiyun  *-*-mingw* )
8375*4882a593Smuzhiyun    case $build in
8376*4882a593Smuzhiyun      *-*-mingw* ) # actually msys
8377*4882a593Smuzhiyun        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8378*4882a593Smuzhiyun        ;;
8379*4882a593Smuzhiyun    esac
8380*4882a593Smuzhiyun    ;;
8381*4882a593Smuzhiyunesac
8382*4882a593Smuzhiyun])
8383*4882a593Smuzhiyunto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8384*4882a593SmuzhiyunAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8385*4882a593Smuzhiyun_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8386*4882a593Smuzhiyun         [0], [convert $build files to toolchain format])dnl
8387*4882a593Smuzhiyun])# _LT_PATH_CONVERSION_FUNCTIONS
8388