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