Commit | Line | Data |
---|---|---|
a7a8349d MV |
1 | #! /bin/sh |
2 | ||
3 | # ltconfig - Create a system-specific libtool. | |
4 | # Generated automatically from ltconfig.in by configure. | |
96abf47d | 5 | # Copyright (C) 1996, 1997, Free Software Foundation, Inc. |
a7a8349d MV |
6 | # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
7 | # | |
8 | # This file is free software; you can redistribute it and/or modify it | |
9 | # under the terms of the GNU General Public License as published by | |
10 | # the Free Software Foundation; either version 2 of the License, or | |
11 | # (at your option) any later version. | |
12 | # | |
13 | # This program is distributed in the hope that it will be useful, but | |
14 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | # General Public License for more details. | |
17 | # | |
18 | # You should have received a copy of the GNU General Public License | |
19 | # along with this program; if not, write to the Free Software | |
20 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 | # | |
22 | # As a special exception to the GNU General Public License, if you | |
23 | # distribute this file as part of a program that contains a | |
24 | # configuration script generated by Autoconf, you may include it under | |
25 | # the same distribution terms that you use for the rest of that program. | |
26 | ||
27 | # A lot of this script is taken from autoconf-2.10. | |
28 | ||
29 | # The name of this program. | |
30 | progname=`echo "$0" | sed 's%^.*/%%'` | |
31 | ||
32 | # Constants: | |
33 | PROGRAM=ltconfig | |
34 | PACKAGE=libtool | |
476f3c84 | 35 | VERSION=1.0c |
a7a8349d | 36 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5' |
553f653a | 37 | ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5' |
a7a8349d MV |
38 | rm="rm -f" |
39 | ||
40 | help="Try \`$progname --help' for more information." | |
41 | ||
553f653a JB |
42 | # Sed substitution that helps us do robust quoting. It backslashifies |
43 | # metacharacters that are still active within double-quoted strings. | |
44 | sed_quote_subst='s/\([\\"$]\)/\\\1/g' | |
45 | ||
a7a8349d | 46 | # Global variables: |
96abf47d | 47 | can_build_shared=yes |
a7a8349d MV |
48 | enable_shared=yes |
49 | # All known linkers require a `.a' archive for static linking. | |
50 | enable_static=yes | |
553f653a | 51 | ltmain= |
a7a8349d MV |
52 | silent= |
53 | srcdir= | |
54 | ac_config_guess= | |
55 | ac_config_sub= | |
553f653a JB |
56 | host= |
57 | nonopt= | |
a7a8349d MV |
58 | verify_host=yes |
59 | with_gcc=no | |
553f653a | 60 | with_gnu_ld=no |
a7a8349d | 61 | |
4cdcd100 | 62 | old_AR="$AR" |
a7a8349d MV |
63 | old_CC="$CC" |
64 | old_CFLAGS="$CFLAGS" | |
65 | old_CPPFLAGS="$CPPFLAGS" | |
66 | old_LD="$LD" | |
553f653a JB |
67 | old_LN_S="$LN_S" |
68 | old_NM="$NM" | |
a7a8349d MV |
69 | old_RANLIB="$RANLIB" |
70 | ||
71 | # Parse the command line options. | |
72 | args= | |
73 | prev= | |
74 | for option | |
75 | do | |
76 | case "$option" in | |
77 | -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; | |
78 | *) optarg= ;; | |
79 | esac | |
80 | ||
81 | # If the previous option needs an argument, assign it. | |
82 | if test -n "$prev"; then | |
83 | eval "$prev=\$option" | |
84 | prev= | |
85 | continue | |
86 | fi | |
87 | ||
88 | case "$option" in | |
89 | --help) cat <<EOM | |
90 | Usage: $progname [OPTION]... LTMAIN [HOST] | |
91 | ||
92 | Generate a system-specific libtool script. | |
93 | ||
94 | --disable-shared do not build shared libraries | |
393e4e4d | 95 | --disable-static do not build static libraries |
a7a8349d MV |
96 | --help display this help and exit |
97 | --no-verify do not verify that HOST is a valid host type | |
98 | --quiet same as \`--silent' | |
99 | --silent don't print informational messages | |
100 | --srcdir=DIR find \`config.guess' in DIR | |
101 | --version output version information and exit | |
102 | --with-gcc assume that the GNU C compiler will be used | |
553f653a | 103 | --with-gnu-ld assume that the C compiler uses the GNU linker |
a7a8349d MV |
104 | |
105 | LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool | |
106 | functionality. | |
107 | ||
108 | HOST is the canonical host system name [default=guessed]. | |
109 | EOM | |
110 | exit 0 | |
111 | ;; | |
112 | ||
113 | --disable-shared) enable_shared=no ;; | |
114 | ||
393e4e4d JB |
115 | --disable-static) enable_static=no ;; |
116 | ||
a7a8349d MV |
117 | --quiet | --silent) silent=yes ;; |
118 | ||
119 | --srcdir) prev=srcdir ;; | |
120 | --srcdir=*) srcdir="$optarg" ;; | |
121 | ||
122 | --no-verify) verify_host=no ;; | |
123 | ||
124 | --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;; | |
125 | ||
126 | --with-gcc) with_gcc=yes ;; | |
553f653a | 127 | --with-gnu-ld) with_gnu_ld=yes ;; |
a7a8349d MV |
128 | |
129 | -*) | |
130 | echo "$progname: unrecognized option \`$option'" 1>&2 | |
131 | echo "$help" 1>&2 | |
132 | exit 1 | |
133 | ;; | |
134 | ||
135 | *) | |
553f653a | 136 | if test -z "$ltmain"; then |
a7a8349d | 137 | ltmain="$option" |
553f653a | 138 | elif test -z "$host"; then |
a7a8349d MV |
139 | # FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 |
140 | # if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then | |
141 | # echo "$progname: warning \`$option' is not a valid host type" 1>&2 | |
142 | # fi | |
143 | host="$option" | |
144 | else | |
145 | echo "$progname: too many arguments" 1>&2 | |
146 | echo "$help" 1>&2 | |
147 | exit 1 | |
148 | fi ;; | |
149 | esac | |
150 | done | |
151 | ||
553f653a | 152 | if test -z "$ltmain"; then |
a7a8349d MV |
153 | echo "$progname: you must specify a LTMAIN file" 1>&2 |
154 | echo "$help" 1>&2 | |
155 | exit 1 | |
156 | fi | |
157 | ||
158 | if test -f "$ltmain"; then : | |
159 | else | |
160 | echo "$progname: warning: \`$ltmain' does not exist" 1>&2 | |
161 | fi | |
162 | ||
163 | # Quote any args containing shell metacharacters. | |
164 | ltconfig_args= | |
165 | for arg | |
166 | do | |
167 | case "$arg" in | |
168 | *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) | |
169 | ltconfig_args="$ltconfig_args '$arg'" ;; | |
170 | *) ltconfig_args="$ltconfig_args $arg" ;; | |
171 | esac | |
172 | done | |
173 | ||
174 | # A relevant subset of AC_INIT. | |
175 | ||
176 | # File descriptor usage: | |
177 | # 0 standard input | |
178 | # 1 file creation | |
179 | # 2 errors and warnings | |
180 | # 3 some systems may open it to /dev/tty | |
181 | # 4 used on the Kubota Titan | |
182 | # 5 compiler messages saved in config.log | |
183 | # 6 checking for... messages and results | |
184 | if test "$silent" = yes; then | |
185 | exec 6>/dev/null | |
186 | else | |
187 | exec 6>&1 | |
188 | fi | |
189 | exec 5>>./config.log | |
190 | ||
191 | # NLS nuisances. | |
192 | # Only set LANG and LC_ALL to C if already set. | |
193 | # These must not be set unconditionally because not all systems understand | |
194 | # e.g. LANG=C (notably SCO). | |
195 | if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi | |
196 | if test "${LANG+set}" = set; then LANG=C; export LANG; fi | |
197 | ||
198 | if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then | |
199 | # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. | |
200 | if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then | |
201 | ac_n= ac_c=' | |
202 | ' ac_t=' ' | |
203 | else | |
204 | ac_n=-n ac_c= ac_t= | |
205 | fi | |
206 | else | |
207 | ac_n= ac_c='\c' ac_t= | |
208 | fi | |
209 | ||
210 | if test -z "$srcdir"; then | |
211 | # Assume the source directory is the same one as the path to ltmain.sh. | |
212 | srcdir=`echo "$ltmain" | sed 's%/[^/]*$%%'` | |
213 | test "$srcdir" = "$ltmain" && srcdir=. | |
214 | fi | |
215 | ||
553f653a | 216 | trap "$rm conftest*; exit 1" 1 2 15 |
a7a8349d MV |
217 | if test "$verify_host" = yes; then |
218 | # Check for config.guess and config.sub. | |
219 | ac_aux_dir= | |
220 | for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do | |
221 | if test -f $ac_dir/config.guess; then | |
222 | ac_aux_dir=$ac_dir | |
223 | break | |
224 | fi | |
225 | done | |
226 | if test -z "$ac_aux_dir"; then | |
227 | echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 | |
228 | echo "$help" 1>&2 | |
229 | exit 1 | |
230 | fi | |
231 | ac_config_guess=$ac_aux_dir/config.guess | |
232 | ac_config_sub=$ac_aux_dir/config.sub | |
233 | ||
234 | # Make sure we can run config.sub. | |
235 | if $ac_config_sub sun4 >/dev/null 2>&1; then : | |
236 | else | |
237 | echo "$progname: cannot run $ac_config_sub" 1>&2 | |
238 | echo "$help" 1>&2 | |
239 | exit 1 | |
240 | fi | |
241 | ||
242 | echo $ac_n "checking host system type""... $ac_c" 1>&6 | |
243 | ||
244 | host_alias=$host | |
245 | case "$host_alias" in | |
553f653a | 246 | "") |
a7a8349d MV |
247 | if host_alias=`$ac_config_guess`; then : |
248 | else | |
249 | echo "$progname: cannot guess host type; you must specify one" 1>&2 | |
250 | echo "$help" 1>&2 | |
251 | exit 1 | |
252 | fi ;; | |
253 | esac | |
254 | host=`$ac_config_sub $host_alias` | |
255 | echo "$ac_t""$host" 1>&6 | |
256 | ||
553f653a | 257 | elif test -z "$host"; then |
a7a8349d MV |
258 | echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 |
259 | echo "$help" 1>&2 | |
260 | exit 1 | |
96abf47d | 261 | else |
a7a8349d MV |
262 | host_alias=$host |
263 | fi | |
264 | ||
4cdcd100 JB |
265 | # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts. |
266 | case "$host" in | |
267 | *-*-linux-gnu*) ;; | |
268 | *-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` | |
269 | esac | |
270 | ||
393e4e4d JB |
271 | host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` |
272 | host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` | |
273 | host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` | |
a7a8349d MV |
274 | |
275 | # Determine commands to create old-style static archives. | |
4cdcd100 | 276 | old_archive_cmds='$AR cru $oldlib$oldobjs' |
a7a8349d MV |
277 | old_postinstall_cmds='chmod 644 $oldlib' |
278 | ||
553f653a JB |
279 | # Set a sane default for `AR'. |
280 | test -z "$AR" && AR=ar | |
281 | ||
a7a8349d MV |
282 | # If RANLIB is not set, then run the test. |
283 | if test "${RANLIB+set}" != "set"; then | |
284 | result=no | |
285 | ||
286 | echo $ac_n "checking for ranlib... $ac_c" 1>&6 | |
553f653a JB |
287 | IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" |
288 | for dir in $PATH; do | |
289 | test -z "$dir" && dir=. | |
290 | if test -f $dir/ranlib; then | |
291 | RANLIB="ranlib" | |
292 | result="ranlib" | |
293 | break | |
294 | fi | |
295 | done | |
296 | IFS="$save_ifs" | |
a7a8349d MV |
297 | |
298 | echo $ac_t "$result" 1>&6 | |
299 | fi | |
300 | ||
301 | if test -n "$RANLIB"; then | |
302 | old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib" | |
303 | old_postinstall_cmds="$old_postinstall_cmds;\$RANLIB \$oldlib" | |
304 | fi | |
305 | ||
a7a8349d | 306 | # Check to see if we are using GCC. |
553f653a | 307 | if test "$with_gcc" != yes || test -z "$CC"; then |
a7a8349d MV |
308 | # If CC is not set, then try to find GCC or a usable CC. |
309 | if test -z "$CC"; then | |
310 | echo $ac_n "checking for gcc... $ac_c" 1>&6 | |
311 | IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" | |
312 | for dir in $PATH; do | |
313 | IFS="$save_ifs" | |
314 | test -z "$dir" && dir=. | |
315 | if test -f $dir/gcc; then | |
316 | CC="gcc" | |
317 | break | |
318 | fi | |
319 | done | |
320 | IFS="$save_ifs" | |
321 | ||
322 | if test -n "$CC"; then | |
323 | echo "$ac_t""$CC" 1>&6 | |
324 | else | |
325 | echo "$ac_t""no" 1>&6 | |
326 | fi | |
327 | fi | |
328 | ||
329 | # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". | |
330 | if test -z "$CC"; then | |
331 | echo $ac_n "checking for cc... $ac_c" 1>&6 | |
332 | IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" | |
333 | cc_rejected=no | |
334 | for dir in $PATH; do | |
335 | test -z "$dir" && dir=. | |
336 | if test -f $dir/cc; then | |
337 | if test "$dir/cc" = "/usr/ucb/cc"; then | |
338 | cc_rejected=yes | |
339 | continue | |
340 | fi | |
341 | CC="cc" | |
342 | break | |
343 | fi | |
344 | done | |
345 | IFS="$save_ifs" | |
346 | if test $cc_rejected = yes; then | |
347 | # We found a bogon in the path, so make sure we never use it. | |
348 | set dummy $CC | |
349 | shift | |
350 | if test $# -gt 0; then | |
351 | # We chose a different compiler from the bogus one. | |
352 | # However, it has the same name, so the bogon will be chosen | |
353 | # first if we set CC to just the name; use the full file name. | |
354 | shift | |
355 | set dummy "$dir/cc" "$@" | |
356 | shift | |
357 | CC="$@" | |
358 | fi | |
359 | fi | |
360 | ||
361 | if test -n "$CC"; then | |
362 | echo "$ac_t""$CC" 1>&6 | |
363 | else | |
364 | echo "$ac_t""no" 1>&6 | |
365 | fi | |
366 | ||
367 | if test -z "$CC"; then | |
368 | echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 | |
369 | exit 1 | |
370 | fi | |
371 | fi | |
372 | ||
373 | # Now see if the compiler is really GCC. | |
374 | with_gcc=no | |
375 | echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 | |
553f653a | 376 | echo "$progname:376: checking whether we are using GNU C" >&5 |
a7a8349d | 377 | |
a7a8349d MV |
378 | $rm conftest.c |
379 | cat > conftest.c <<EOF | |
380 | #ifdef __GNUC__ | |
381 | yes; | |
382 | #endif | |
383 | EOF | |
553f653a | 384 | if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then |
a7a8349d MV |
385 | with_gcc=yes |
386 | fi | |
387 | $rm conftest.c | |
388 | echo $ac_t "$with_gcc" 1>&6 | |
389 | fi | |
390 | ||
391 | # Allow CC to be a program name with arguments. | |
392 | set dummy $CC | |
393 | compiler="$2" | |
394 | ||
395 | echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 | |
396 | pic_flag= | |
397 | profile_flag_pattern= | |
96abf47d | 398 | special_shlib_compile_flags= |
a7a8349d MV |
399 | wl= |
400 | link_static_flag= | |
553f653a | 401 | no_builtin_flag= |
a7a8349d MV |
402 | |
403 | if test "$with_gcc" = yes; then | |
a7a8349d MV |
404 | profile_flag_pattern='-pg?' |
405 | wl='-Wl,' | |
406 | link_static_flag='-static' | |
553f653a JB |
407 | no_builtin_flag=' -fno-builtin' |
408 | ||
409 | case "$host_os" in | |
410 | irix5* | irix6*) | |
411 | # PIC is the default for these OSes. | |
412 | pic_flag= | |
413 | ;; | |
414 | *) | |
415 | pic_flag='-fPIC' | |
416 | ;; | |
417 | esac | |
a7a8349d MV |
418 | else |
419 | # PORTME Check for PIC flags for the system compiler. | |
393e4e4d JB |
420 | case "$host_os" in |
421 | aix3* | aix4*) | |
a7a8349d MV |
422 | # FIXME All rs/6000 code is PIC, but is there any non-rs/6000 AIX platform? |
423 | link_static_flag='-bnso -bI:/lib/syscalls.exp' | |
424 | ;; | |
425 | ||
393e4e4d | 426 | hpux9* | hpux10*) |
96abf47d MD |
427 | # FIXME is there a better link_static_flag that works with the bundled CC? |
428 | wl='-Wl,' | |
429 | link_static_flag='${wl}-a ${wl}archive' | |
a7a8349d MV |
430 | ;; |
431 | ||
393e4e4d | 432 | irix5* | irix6*) |
96abf47d MD |
433 | wl='-Wl,' |
434 | link_static_flag='-non_shared' | |
435 | # PIC (with -KPIC) is the default. | |
436 | pic_flag= | |
437 | ;; | |
438 | ||
393e4e4d | 439 | osf3* | osf4*) |
96abf47d MD |
440 | # FIXME - pic_flag is probably required for hppa*-osf* and i860-osf* |
441 | wl='-Wl,' | |
442 | link_static_flag='-non_shared' | |
443 | ;; | |
444 | ||
393e4e4d | 445 | sco3.2v5*) |
96abf47d MD |
446 | pic_flag='-Kpic' |
447 | link_static_flag='-dn' | |
448 | special_shlib_compile_flags='-belf' | |
a7a8349d MV |
449 | ;; |
450 | ||
393e4e4d | 451 | solaris2*) |
a7a8349d MV |
452 | pic_flag='-KPIC' |
453 | link_static_flag='-Bstatic' | |
a6a5a664 | 454 | wl='-Wl,' |
a7a8349d MV |
455 | ;; |
456 | ||
393e4e4d | 457 | sunos4*) |
a7a8349d MV |
458 | pic_flag='-PIC' |
459 | link_static_flag='-Bstatic' | |
460 | wl='-Qoption ld ' | |
461 | ;; | |
462 | ||
463 | *) | |
464 | can_build_shared=no | |
465 | ;; | |
466 | esac | |
467 | fi | |
468 | ||
393e4e4d | 469 | case "$host_cpu" in |
553f653a | 470 | alpha | rs6000 | powerpc | powerpcle) |
96abf47d | 471 | # Yippee! All RS/6000 and PowerPC code is position-independent. |
553f653a | 472 | # Apparently, so is DEC alpha! |
a7a8349d MV |
473 | pic_flag= |
474 | ;; | |
475 | esac | |
476 | ||
477 | if test -n "$pic_flag"; then | |
478 | echo $ac_t "$pic_flag" 1>&6 | |
553f653a JB |
479 | |
480 | # Check to make sure the pic_flag actually works. | |
481 | echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 | |
482 | $rm conftest* | |
483 | echo > conftest.c | |
484 | save_CFLAGS="$CFLAGS" | |
485 | CFLAGS="$CFLAGS $pic_flag -DPIC" | |
486 | echo "$progname:486: checking if $compiler PIC flag $pic_flag works" >&5 | |
487 | if { (eval echo $progname:487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then | |
488 | # Append any errors to the config.log. | |
489 | cat conftest.err 1>&5 | |
490 | ||
491 | # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also | |
492 | # reports no error. So, we need to grep stderr for (Bundled). | |
493 | if grep '(Bundled)' conftest.err >/dev/null; then | |
494 | echo $ac_t no 1>&6 | |
495 | can_build_shared=no | |
496 | pic_flag= | |
497 | else | |
498 | echo $ac_t yes 1>&6 | |
499 | pic_flag=" $pic_flag" | |
500 | fi | |
501 | else | |
502 | # Append any errors to the config.log. | |
503 | cat conftest.err 1>&5 | |
504 | can_build_shared=no | |
505 | pic_flag= | |
506 | echo $ac_t no 1>&6 | |
507 | fi | |
508 | CFLAGS="$save_CFLAGS" | |
509 | $rm conftest* | |
a7a8349d MV |
510 | else |
511 | echo $ac_t none 1>&6 | |
512 | fi | |
513 | ||
96abf47d MD |
514 | # Check for any special shared library compilation flags. |
515 | if test -n "$special_shlib_compile_flags"; then | |
516 | echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 | |
517 | if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : | |
518 | else | |
519 | echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 | |
520 | can_build_shared=no | |
521 | fi | |
522 | fi | |
523 | ||
553f653a JB |
524 | echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 |
525 | $rm conftest* | |
526 | echo 'main(){return(0);}' > conftest.c | |
527 | save_LDFLAGS="$LDFLAGS" | |
528 | LDFLAGS="$LDFLAGS $link_static_flag" | |
529 | echo "$progname:529: checking if $compiler static flag $link_static_flag works" >&5 | |
530 | if { (eval echo $progname:530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then | |
a7a8349d MV |
531 | echo $ac_t "$link_static_flag" 1>&6 |
532 | else | |
533 | echo $ac_t none 1>&6 | |
553f653a | 534 | link_static_flag= |
a7a8349d | 535 | fi |
553f653a JB |
536 | LDFLAGS="$save_LDFLAGS" |
537 | $rm conftest* | |
538 | ||
539 | if test -z "$LN_S"; then | |
540 | # Check to see if we can use ln -s, or we need hard links. | |
541 | echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 | |
542 | $rm conftestdata | |
543 | if ln -s X conftestdata 2>/dev/null; then | |
544 | $rm conftestdata | |
545 | LN_S="ln -s" | |
a6a5a664 | 546 | else |
553f653a | 547 | LN_S=ln |
a6a5a664 | 548 | fi |
553f653a JB |
549 | if test "$LN_S" = "ln -s"; then |
550 | echo "$ac_t"yes 1>&6 | |
551 | else | |
552 | echo "$ac_t"no 1>&6 | |
a6a5a664 JB |
553 | fi |
554 | fi | |
555 | ||
553f653a JB |
556 | # Make sure LD is an absolute path. |
557 | case "$LD" in | |
558 | /*) ;; | |
559 | *) | |
560 | ac_prog=ld | |
561 | if test "$with_gcc" = yes; then | |
562 | # Check if gcc -print-prog-name=ld gives a path. | |
563 | echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 | |
564 | echo "$progname:564: checking for ld used by GCC" >&5 | |
565 | ac_prog=`($CC -print-prog-name=ld) 2>&5` | |
566 | case "$ac_prog" in | |
567 | # Accept absolute paths. | |
568 | /*) ;; | |
569 | "") | |
570 | # If it fails, then pretend we aren't using GCC. | |
571 | ac_prog=ld | |
572 | ;; | |
573 | *) | |
574 | # If it is relative, then search for the first ld in PATH. | |
575 | with_gnu_ld=unknown | |
576 | ;; | |
577 | esac | |
578 | elif test "$with_gnu_ld" = yes; then | |
579 | echo $ac_n "checking for GNU ld... $ac_c" 1>&6 | |
580 | echo "$progname:580: checking for GNU ld" >&5 | |
581 | else | |
582 | echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 | |
583 | echo "$progname:583: checking for non-GNU ld" >&5 | |
584 | fi | |
585 | LD=${LD-$ac_prog} | |
586 | case "$LD" in | |
587 | /*) | |
588 | ac_cv_path_LD="$LD" # Let the user override the test with a path. | |
589 | ;; | |
590 | *) | |
591 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
592 | for ac_dir in $PATH; do | |
593 | test -z "$ac_dir" && ac_dir=. | |
594 | if test -f "$ac_dir/$ac_prog"; then | |
595 | LD="$ac_dir/$ac_prog" | |
596 | # Check to see if the program is GNU ld. I'd rather use --version, | |
597 | # but apparently some GNU ld's only accept -v. | |
598 | # Break only if it was the GNU/non-GNU ld that we prefer. | |
599 | if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then | |
600 | test "$with_gnu_ld" != no && break | |
601 | else | |
602 | test "$with_gnu_ld" != yes && break | |
603 | fi | |
604 | fi | |
605 | done | |
606 | IFS="$ac_save_ifs" | |
607 | ;; | |
608 | esac | |
609 | echo $ac_t "$with_gnu_ld" 1>&6 | |
610 | ;; | |
611 | esac | |
a7a8349d | 612 | |
476f3c84 MD |
613 | # Check to see if it really is or isn't GNU ld. |
614 | echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 | |
615 | # I'd rather use --version here, but apparently some GNU ld's only accept -v. | |
616 | if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then | |
617 | with_gnu_ld=yes | |
618 | else | |
619 | with_gnu_ld=no | |
620 | fi | |
621 | echo $ac_t "$with_gnu_ld" 1>&6 | |
622 | ||
a7a8349d | 623 | # See if the linker supports building shared libraries. |
553f653a | 624 | echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 |
a7a8349d | 625 | |
393e4e4d | 626 | allow_undefined_flag= |
a7a8349d | 627 | archive_cmds= |
553f653a | 628 | export_dynamic_flag_spec= |
4cdcd100 JB |
629 | hardcode_libdir_flag_spec= |
630 | hardcode_libdir_separator= | |
96abf47d | 631 | hardcode_direct=no |
a7a8349d | 632 | hardcode_minus_L=no |
393e4e4d | 633 | hardcode_runpath_var=no |
96abf47d | 634 | hardcode_shlibpath_var=unsupported |
393e4e4d | 635 | runpath_var= |
a7a8349d MV |
636 | |
637 | ld_shlibs=yes | |
638 | if test "$with_gnu_ld" = yes; then | |
639 | # See if GNU ld supports shared libraries. | |
640 | ||
393e4e4d JB |
641 | case "$host_os" in |
642 | sunos4*) | |
a7a8349d | 643 | ld_shlibs=yes |
96abf47d MD |
644 | hardcode_direct=yes |
645 | hardcode_shlibpath_var=no | |
a7a8349d MV |
646 | ;; |
647 | ||
648 | *) | |
649 | if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then | |
393e4e4d JB |
650 | runpath_var=LD_RUN_PATH |
651 | hardcode_runpath_var=yes | |
a7a8349d MV |
652 | ld_shlibs=yes |
653 | else | |
654 | ld_shlibs=no | |
655 | fi | |
656 | ;; | |
657 | esac | |
658 | ||
659 | if test "$ld_shlibs" = yes; then | |
553f653a | 660 | archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs' |
4cdcd100 | 661 | hardcode_libdir_flag_spec='${wl}-rpath $wl$libdir' |
553f653a | 662 | export_dynamic_flag_spec='${wl}-export-dynamic' |
a7a8349d MV |
663 | fi |
664 | else | |
665 | # PORTME fill in a description of your system's linker (not GNU ld) | |
393e4e4d JB |
666 | case "$host_os" in |
667 | aix3*) | |
668 | allow_undefined_flag=unsupported | |
553f653a | 669 | archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '"'s/.* //'"' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE -lc$deplibs;$AR cru $lib $objdir/$soname' |
4cdcd100 JB |
670 | # Note: this linker hardcodes the directories in LIBPATH if there |
671 | # are no directories specified by -L. | |
a7a8349d | 672 | hardcode_minus_L=yes |
553f653a JB |
673 | if test "$with_gcc" = yes && test -z "$link_static_flag"; then |
674 | # Neither direct hardcoding nor static linking is supported with a | |
675 | # broken collect2. | |
676 | hardcode_direct=unsupported | |
677 | fi | |
a7a8349d MV |
678 | ;; |
679 | ||
393e4e4d JB |
680 | aix4*) |
681 | allow_undefined_flag=unsupported | |
553f653a | 682 | archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '"'s/.* //'"' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry$deplibs;$AR cru $lib $objdir/$soname' |
79131585 | 683 | hardcode_direct=yes |
a7a8349d MV |
684 | hardcode_minus_L=yes |
685 | ;; | |
686 | ||
393e4e4d JB |
687 | # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor |
688 | # support. Future versions do this automatically, but an explicit c++rt0.o | |
689 | # doesn't break anything, and helps significantly (at the cost of a little | |
690 | # extra space). | |
691 | freebsd2.2*) | |
692 | archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs /usr/lib/c++rt0.o' | |
693 | hardcode_direct=yes | |
694 | hardcode_minus_L=yes | |
695 | hardcode_shlibpath_var=no | |
696 | ;; | |
697 | ||
698 | # Unfortunately, older versions of FreeBSD 2 don't have this feature. | |
699 | freebsd2*) | |
a7a8349d | 700 | archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' |
96abf47d MD |
701 | hardcode_direct=yes |
702 | hardcode_minus_L=yes | |
703 | hardcode_shlibpath_var=no | |
704 | ;; | |
705 | ||
393e4e4d JB |
706 | # FreeBSD 3, at last, uses gcc -shared to do shared libraries. |
707 | freebsd3*) | |
708 | archive_cmds='$CC -shared -o $lib$libobjs$deplibs' | |
476f3c84 | 709 | hardcode_libdir_flag_spec='-R$libdir' |
393e4e4d | 710 | hardcode_direct=yes |
476f3c84 | 711 | hardcode_minus_L=yes |
393e4e4d JB |
712 | hardcode_shlibpath_var=no |
713 | ;; | |
714 | ||
715 | hpux9*) | |
96abf47d | 716 | archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs$deplibs;mv $objdir/$soname $lib' |
4cdcd100 | 717 | hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' |
96abf47d | 718 | hardcode_direct=yes |
a7a8349d MV |
719 | hardcode_minus_L=yes |
720 | ;; | |
721 | ||
393e4e4d | 722 | hpux10*) |
a7a8349d | 723 | archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs$deplibs' |
4cdcd100 | 724 | hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' |
96abf47d | 725 | hardcode_direct=yes |
a7a8349d | 726 | hardcode_minus_L=yes |
96abf47d MD |
727 | ;; |
728 | ||
393e4e4d | 729 | irix5* | irix6*) |
96abf47d | 730 | archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs' |
4cdcd100 | 731 | hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' |
a7a8349d MV |
732 | ;; |
733 | ||
393e4e4d | 734 | netbsd* | openbsd*) |
a7a8349d MV |
735 | # Tested with NetBSD 1.2 ld |
736 | archive_cmds='$LD -Bshareable -o $lib$libobjs$deplibs' | |
4cdcd100 | 737 | hardcode_libdir_flag_spec='-R$libdir' |
96abf47d MD |
738 | hardcode_direct=yes |
739 | hardcode_shlibpath_var=no | |
a7a8349d MV |
740 | ;; |
741 | ||
393e4e4d JB |
742 | osf3* | osf4*) |
743 | allow_undefined_flag=' -expect_unresolved' | |
744 | archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs -lc$deplibs' | |
4cdcd100 JB |
745 | hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' |
746 | hardcode_libdir_separator=: | |
96abf47d MD |
747 | ;; |
748 | ||
393e4e4d | 749 | sco3.2v5*) |
96abf47d MD |
750 | archive_cmds='$LD -G -o $lib$libobjs$deplibs' |
751 | hardcode_direct=yes | |
a7a8349d MV |
752 | ;; |
753 | ||
393e4e4d | 754 | solaris2*) |
a7a8349d | 755 | archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs$deplibs' |
4cdcd100 | 756 | hardcode_libdir_flag_spec='-R$libdir' |
96abf47d | 757 | hardcode_shlibpath_var=no |
a7a8349d MV |
758 | ;; |
759 | ||
393e4e4d | 760 | sunos4*) |
96abf47d | 761 | archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs' |
4cdcd100 | 762 | hardcode_libdir_flag_spec='-L$libdir' |
96abf47d | 763 | hardcode_direct=yes |
a7a8349d | 764 | hardcode_minus_L=yes |
96abf47d | 765 | hardcode_shlibpath_var=no |
a7a8349d MV |
766 | ;; |
767 | ||
768 | *) | |
769 | ld_shlibs=no | |
770 | can_build_shared=no | |
771 | ;; | |
772 | esac | |
773 | fi | |
774 | echo $ac_t "$ld_shlibs" 1>&6 | |
775 | ||
553f653a JB |
776 | if test -z "$NM"; then |
777 | echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 | |
778 | case "$NM" in | |
779 | /*) ;; # Let the user override the test with a path. | |
780 | *) | |
781 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" | |
782 | for ac_dir in /usr/ucb:$PATH:/bin; do | |
783 | test -z "$ac_dir" && dir=. | |
784 | if test -f $ac_dir/nm; then | |
785 | # Check to see if the nm accepts a BSD-compat flag. | |
786 | if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then | |
787 | NM="$ac_dir/nm -B" | |
788 | elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then | |
789 | NM="$ac_dir/nm -p" | |
790 | else | |
791 | NM="$ac_dir/nm" | |
792 | fi | |
793 | break | |
794 | fi | |
795 | done | |
796 | IFS="$ac_save_ifs" | |
797 | test -z "$NM" && NM=nm | |
798 | ;; | |
799 | esac | |
800 | echo "$ac_t$NM" 1>&6 | |
801 | fi | |
802 | ||
803 | # Check for command to grab the raw symbol name followed by C symbol from nm. | |
804 | echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 | |
805 | ||
476f3c84 MD |
806 | # These are sane defaults that work on at least a few old systems. |
807 | # [They come from Ultrix. What could be older than Ultrix?!! ;)] | |
808 | ||
809 | # Character class describing NM global symbol codes. | |
810 | symcode='[BCDEGRSTU]' | |
811 | ||
812 | # Regexp to match symbols that can be accessed directly from C. | |
813 | sympat='\([_A-Za-z][_A-Za-z0-9]*\)' | |
814 | ||
815 | # Transform the above into a raw symbol and a C symbol. | |
816 | symxfrm='\1 \1' | |
817 | ||
818 | # Define system-specific variables. | |
819 | case "$host_os" in | |
820 | aix*) | |
821 | symcode='[BCDTU]' | |
822 | ;; | |
823 | solaris2*) | |
824 | symcode='[BDTU]' | |
825 | ;; | |
826 | esac | |
553f653a | 827 | |
476f3c84 | 828 | # If we're using GNU nm, then use its standard symbol codes. |
553f653a | 829 | if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then |
476f3c84 | 830 | symcode='[ABCDGISTU]' |
553f653a JB |
831 | fi |
832 | ||
476f3c84 MD |
833 | # Delete symbols that are not valid C identifiers. |
834 | global_symbol_pipe="sed -e '/^.* $symcode $sympat$/!d'" | |
835 | ||
836 | # Write the raw and C identifiers. | |
837 | global_symbol_pipe="$global_symbol_pipe -e 's/^.* $symcode $sympat$/$symxfrm/'" | |
838 | ||
553f653a JB |
839 | # Check to see that the pipe works correctly. |
840 | pipe_works=no | |
841 | $rm conftest* | |
842 | cat > conftest.c <<EOF | |
843 | char nm_test_var; | |
844 | void nm_test_func(){} | |
845 | main(){nm_test_var='a';nm_test_func();return(0);} | |
846 | EOF | |
847 | ||
476f3c84 MD |
848 | echo "$progname:848: checking if global_symbol_pipe works" >&5 |
849 | if { (eval echo $progname:849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then | |
553f653a JB |
850 | # Now try to grab the symbols. |
851 | nlist=conftest.nm | |
476f3c84 | 852 | if { echo "$progname:852: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then |
553f653a JB |
853 | |
854 | # Try sorting and uniquifying the output. | |
855 | if sort "$nlist" | uniq > "$nlist"T; then | |
856 | mv -f "$nlist"T "$nlist" | |
857 | wcout=`wc "$nlist" 2>/dev/null` | |
858 | count=`echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'` | |
859 | test "$wcout" = "$count" && count=-1 | |
860 | else | |
861 | rm -f "$nlist"T | |
862 | count=-1 | |
863 | fi | |
864 | ||
865 | # Make sure that we snagged all the symbols we need. | |
866 | if egrep ' nm_test_var$' "$nlist" >/dev/null; then | |
867 | if egrep ' nm_test_func$' "$nlist" >/dev/null; then | |
868 | # Now generate the symbol file. | |
869 | sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" > conftest.c | |
870 | ||
871 | cat <<EOF >> conftest.c | |
872 | #if defined (__STDC__) && __STDC__ | |
873 | # define __ptr_t void * | |
874 | #else | |
875 | # define __ptr_t char * | |
876 | #endif | |
877 | ||
878 | /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */ | |
879 | int dld_preloaded_symbol_count = $count; | |
880 | ||
881 | /* The mapping between symbol names and symbols. */ | |
882 | struct { | |
883 | char *name; | |
884 | __ptr_t address; | |
885 | } | |
886 | dld_preloaded_symbols[] = | |
887 | { | |
888 | EOF | |
889 | sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> conftest.c | |
890 | cat <<\EOF >> conftest.c | |
891 | {0}, | |
892 | }; | |
893 | EOF | |
894 | # Now try linking the two files. | |
895 | mv conftest.o conftestm.o | |
896 | save_LIBS="$LIBS" | |
897 | save_CFLAGS="$CFLAGS" | |
898 | LIBS='conftestm.o' | |
899 | CFLAGS="$CFLAGS$no_builtin_flag" | |
476f3c84 | 900 | if { (eval echo $progname:900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then |
553f653a JB |
901 | pipe_works=yes |
902 | else | |
903 | echo "$progname: failed program was:" >&5 | |
904 | cat conftest.c >&5 | |
905 | fi | |
906 | LIBS="$save_LIBS" | |
907 | fi | |
908 | else | |
909 | echo "cannot find nm_test_func in $nlist" >&5 | |
910 | fi | |
911 | else | |
912 | echo "cannot find nm_test_var in $nlist" >&5 | |
913 | fi | |
914 | else | |
915 | echo "$progname: failed program was:" >&5 | |
916 | cat conftest.c >&5 | |
917 | fi | |
918 | $rm conftest* | |
919 | ||
920 | # Don't use the global_symbol_pipe unless it works. | |
921 | echo "$ac_t$pipe_works" 1>&6 | |
922 | test "$pipe_works" = yes || global_symbol_pipe= | |
923 | ||
96abf47d MD |
924 | # Check hardcoding attributes. |
925 | echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 | |
926 | hardcode_action= | |
393e4e4d JB |
927 | if test -n "$hardcode_libdir_flag_spec" || \ |
928 | test "$hardcode_runpath_var" = yes; then | |
929 | ||
96abf47d | 930 | # We can hardcode non-existant directories. |
393e4e4d JB |
931 | if test "$hardcode_direct" != no && \ |
932 | test "$hardcode_minus_L" != no && \ | |
96abf47d MD |
933 | test "$hardcode_shlibpath_var" != no; then |
934 | ||
79131585 | 935 | # Linking always hardcodes the temporary library directory. |
96abf47d MD |
936 | hardcode_action=relink |
937 | else | |
79131585 | 938 | # We can link without hardcoding, and we can hardcode nonexisting dirs. |
4cdcd100 | 939 | hardcode_action=immediate |
96abf47d | 940 | fi |
393e4e4d JB |
941 | elif test "$hardcode_direct" != yes && \ |
942 | test "$hardcode_minus_L" != yes && \ | |
79131585 | 943 | test "$hardcode_shlibpath_var" != yes; then |
96abf47d MD |
944 | # We can't hardcode anything. |
945 | hardcode_action=unsupported | |
79131585 JB |
946 | else |
947 | # We can only hardcode existing directories. | |
948 | hardcode_action=relink | |
a7a8349d | 949 | fi |
96abf47d MD |
950 | echo $ac_t "$hardcode_action" 1>&6 |
951 | test "$hardcode_action" = unsupported && can_build_shared=no | |
952 | ||
a7a8349d MV |
953 | |
954 | reload_flag= | |
955 | reload_cmds='$LD$reload_flag -o $output$reload_objs' | |
553f653a | 956 | echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 |
a7a8349d MV |
957 | # PORTME Some linker may need a different reload flag. |
958 | reload_flag='-r' | |
959 | echo $ac_t "$reload_flag" | |
960 | test -n "$reload_flag" && reload_flag=" $reload_flag" | |
961 | ||
962 | # PORTME Fill in your ld.so characteristics | |
4cdcd100 | 963 | library_names_spec= |
a7a8349d MV |
964 | soname_spec= |
965 | postinstall_cmds= | |
966 | finish_cmds= | |
967 | shlibpath_var= | |
968 | version_type=none | |
969 | dynamic_linker="$host_os ld.so" | |
970 | ||
971 | echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 | |
393e4e4d JB |
972 | case "$host_os" in |
973 | aix3* | aix4*) | |
a7a8349d | 974 | version_type=linux |
4cdcd100 | 975 | library_names_spec='$libname.so.$versuffix $libname.a' |
a7a8349d MV |
976 | shlibpath_var=LIBPATH |
977 | ||
978 | # AIX has no versioning support, so we append a major version to the name. | |
979 | soname_spec='$libname.so.$major' | |
980 | ;; | |
981 | ||
393e4e4d | 982 | freebsd2* | freebsd3*) |
a7a8349d | 983 | version_type=sunos |
4cdcd100 | 984 | library_names_spec='$libname.so.$versuffix $libname.so' |
553f653a | 985 | finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' |
a7a8349d MV |
986 | shlibpath_var=LD_LIBRARY_PATH |
987 | ;; | |
988 | ||
393e4e4d JB |
989 | gnu*) |
990 | version_type=sunos | |
991 | library_names_spec='$libname.so.$versuffix' | |
992 | shlibpath_var=LD_LIBRARY_PATH | |
993 | ;; | |
a7a8349d | 994 | |
393e4e4d | 995 | hpux9* | hpux10*) |
a7a8349d MV |
996 | # Give a soname corresponding to the major version so that dld.sl refuses to |
997 | # link against other versions. | |
998 | dynamic_linker="$host_os dld.sl" | |
999 | version_type=sunos | |
1000 | shlibpath_var=SHLIB_PATH | |
4cdcd100 | 1001 | library_names_spec='$libname.sl.$versuffix $libname.sl.$major $libname.sl' |
a7a8349d MV |
1002 | soname_spec='$libname.sl.$major' |
1003 | # HP-UX runs *really* slowly unless shared libraries are mode 555. | |
1004 | postinstall_cmds='chmod 555 $lib' | |
1005 | ;; | |
1006 | ||
393e4e4d | 1007 | irix5* | irix6*) |
96abf47d MD |
1008 | version_type=osf |
1009 | soname_spec='$libname.so' | |
4cdcd100 | 1010 | library_names_spec='$libname.so.$versuffix $libname.so' |
96abf47d MD |
1011 | shlibpath_var=LD_LIBRARY_PATH |
1012 | ;; | |
1013 | ||
4cdcd100 | 1014 | # No shared lib support for Linux oldld, aout, or coff. |
393e4e4d | 1015 | linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) |
a7a8349d | 1016 | dynamic_linker=no |
a7a8349d MV |
1017 | ;; |
1018 | ||
4cdcd100 | 1019 | # This must be Linux ELF. |
393e4e4d | 1020 | linux-gnu*) |
a7a8349d | 1021 | version_type=linux |
4cdcd100 | 1022 | library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' |
a7a8349d | 1023 | soname_spec='$libname.so.$major' |
553f653a | 1024 | finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' |
a7a8349d | 1025 | shlibpath_var=LD_LIBRARY_PATH |
553f653a JB |
1026 | |
1027 | if test -f /lib/ld.so.1; then | |
1028 | dynamic_linker='GNU ld.so' | |
1029 | else | |
1030 | # Only the GNU ld.so supports shared libraries on MkLinux. | |
1031 | case "$host_cpu" in | |
1032 | powerpc*) dynamic_linker=no ;; | |
1033 | *) dynamic_linker='Linux ld.so' ;; | |
1034 | esac | |
1035 | fi | |
a7a8349d MV |
1036 | ;; |
1037 | ||
393e4e4d | 1038 | netbsd* | openbsd*) |
a7a8349d | 1039 | version_type=sunos |
4cdcd100 | 1040 | library_names_spec='$libname.so.$versuffix' |
553f653a | 1041 | finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' |
a7a8349d MV |
1042 | shlibpath_var=LD_LIBRARY_PATH |
1043 | ;; | |
1044 | ||
393e4e4d | 1045 | osf3* | osf4*) |
a7a8349d MV |
1046 | version_type=osf |
1047 | soname_spec='$libname.so' | |
4cdcd100 | 1048 | library_names_spec='$libname.so.$versuffix $libname.so' |
a7a8349d MV |
1049 | shlibpath_var=LD_LIBRARY_PATH |
1050 | ;; | |
1051 | ||
393e4e4d | 1052 | sco3.2v5*) |
96abf47d MD |
1053 | version_type=osf |
1054 | soname_spec='$libname.so.$major' | |
4cdcd100 | 1055 | library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' |
96abf47d MD |
1056 | shlibpath_var=LD_LIBRARY_PATH |
1057 | ;; | |
1058 | ||
393e4e4d | 1059 | solaris2*) |
a7a8349d | 1060 | version_type=linux |
4cdcd100 | 1061 | library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' |
a7a8349d MV |
1062 | soname_spec='$libname.so.$major' |
1063 | shlibpath_var=LD_LIBRARY_PATH | |
1064 | ;; | |
1065 | ||
393e4e4d | 1066 | sunos4*) |
a7a8349d | 1067 | version_type=sunos |
4cdcd100 | 1068 | library_names_spec='$libname.so.$versuffix' |
553f653a | 1069 | finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' |
a7a8349d MV |
1070 | shlibpath_var=LD_LIBRARY_PATH |
1071 | ;; | |
1072 | ||
1073 | *) | |
1074 | dynamic_linker=no | |
a7a8349d MV |
1075 | ;; |
1076 | esac | |
1077 | echo "$ac_t""$dynamic_linker" | |
553f653a | 1078 | test "$dynamic_linker" = no && can_build_shared=no |
a7a8349d | 1079 | |
96abf47d MD |
1080 | # FIXME need to add library stripping features |
1081 | # strip -x works for most platforms, though not for static libraries on NetBSD | |
1082 | # HP-UX requires "-r" for library stripping | |
1083 | striplib= | |
1084 | old_striplib= | |
1085 | ||
1086 | #echo $ac_n "checking for static library strip program... $ac_c" 1>&6 | |
1087 | #if test -n "$old_striplib"; then | |
1088 | # echo $ac_t "$old_striplib" 1>&6 | |
1089 | #else | |
1090 | # echo $ac_t none 1>&6 | |
1091 | #fi | |
1092 | ||
1093 | #if test "$can_build_shared" = yes; then | |
1094 | # echo $ac_n "checking for shared library strip program... $ac_c" 1>&6 | |
1095 | # | |
1096 | # if test -n "$striplib"; then | |
1097 | # echo $ac_t "$striplib" 1>&6 | |
1098 | # else | |
1099 | # echo $ac_t none 1>&6 | |
1100 | # fi | |
1101 | #fi | |
1102 | ||
a7a8349d MV |
1103 | # Report the consequences. |
1104 | echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 | |
1105 | ||
1106 | echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 | |
1107 | test "$can_build_shared" = "no" && enable_shared=no | |
1108 | ||
4cdcd100 JB |
1109 | # On AIX, shared libraries and static libraries use the same namespace. |
1110 | case "$host_os" in | |
1111 | aix*) | |
1112 | test "$enable_shared" = yes && enable_static=no | |
1113 | if test -n "$RANLIB"; then | |
1114 | archive_cmds="$archive_cmds;\$RANLIB \$lib" | |
1115 | postinstall_cmds='$RANLIB $lib' | |
1116 | fi | |
1117 | ;; | |
1118 | esac | |
a7a8349d MV |
1119 | |
1120 | echo "$ac_t""$enable_shared" 1>&6 | |
1121 | ||
4cdcd100 JB |
1122 | # Make sure either enable_shared or enable_static is yes. |
1123 | test "$enable_shared" = yes || enable_static=yes | |
a7a8349d | 1124 | |
393e4e4d JB |
1125 | echo "checking whether to build static libraries... $enable_static" 1>&6 |
1126 | ||
553f653a JB |
1127 | # Now quote all the things that may contain metacharacters. |
1128 | for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \ | |
1129 | old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \ | |
1130 | link_static_flag no_builtin_flag export_dynamic_flag_spec \ | |
1131 | profile_flag_pattern library_names_spec soname_spec RANLIB \ | |
1132 | old_archive_cmds old_postinstall_cmds archive_cmds postinstall_cmds \ | |
1133 | allow_undefined_flag finish_cmds global_symbol_pipe striplib old_striplib \ | |
1134 | hardcode_libdir_flag_spec hardcode_libdir_separator; do | |
1135 | ||
1136 | eval "$var=\`echo \"\$$var\" | sed \"\$sed_quote_subst\"\`" | |
1137 | done | |
1138 | ||
a7a8349d MV |
1139 | ofile=libtool |
1140 | trap "$rm $ofile; exit 1" 1 2 15 | |
1141 | echo creating $ofile | |
553f653a | 1142 | $rm $ofile |
a7a8349d MV |
1143 | cat <<EOF > $ofile |
1144 | #! /bin/sh | |
1145 | ||
1146 | # libtool - Provide generalized library-building support services. | |
1147 | # | |
1148 | # Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION | |
1149 | # This program was configured as follows, | |
1150 | # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
1151 | # | |
553f653a JB |
1152 | # CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\ |
1153 | # LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\ | |
a7a8349d MV |
1154 | # $0$ltconfig_args |
1155 | # | |
1156 | # Compiler and other test output produced by $progname, useful for | |
1157 | # debugging $progname, is in ./config.log if it exists. | |
1158 | ||
1159 | # The version of $progname that generated this script. | |
1160 | LTCONFIG_VERSION="$VERSION" | |
1161 | ||
1162 | # Whether or not to build libtool libraries. | |
1163 | build_libtool_libs=$enable_shared | |
1164 | ||
1165 | # Whether or not to build old-style libraries. | |
1166 | build_old_libs=$enable_static | |
1167 | ||
1168 | # The host system. | |
1169 | host_alias="$host_alias" | |
1170 | host="$host" | |
1171 | ||
4cdcd100 | 1172 | # The archiver. |
553f653a JB |
1173 | AR="$AR" |
1174 | ||
1175 | # The default C compiler. | |
1176 | CC="$CC" | |
4cdcd100 | 1177 | |
a7a8349d | 1178 | # The linker used to build libraries. |
553f653a JB |
1179 | LD="$LD" |
1180 | ||
1181 | # Whether we need hard or soft links. | |
1182 | LN_S="$LN_S" | |
1183 | ||
1184 | # A BSD-compatible nm program. | |
1185 | NM="$NM" | |
a7a8349d MV |
1186 | |
1187 | # How to create reloadable object files. | |
553f653a JB |
1188 | reload_flag="$reload_flag" |
1189 | reload_cmds="$reload_cmds" | |
a7a8349d MV |
1190 | |
1191 | # How to pass a linker flag through the compiler. | |
553f653a | 1192 | wl="$wl" |
a7a8349d MV |
1193 | |
1194 | # Additional compiler flags for building library objects. | |
553f653a | 1195 | pic_flag="$pic_flag" |
a7a8349d MV |
1196 | |
1197 | # Compiler flag to prevent dynamic linking. | |
553f653a JB |
1198 | link_static_flag="$link_static_flag" |
1199 | ||
1200 | # Compiler flag to turn off builtin functions. | |
1201 | no_builtin_flag="$no_builtin_flag" | |
a7a8349d | 1202 | |
4cdcd100 | 1203 | # Compiler flag to allow reflexive dlopens. |
553f653a | 1204 | export_dynamic_flag_spec="$export_dynamic_flag_spec" |
4cdcd100 | 1205 | |
a7a8349d | 1206 | # Pattern to match compiler flags for creating libNAME_p libraries: |
553f653a | 1207 | profile_flag_pattern="$profile_flag_pattern" |
a7a8349d MV |
1208 | |
1209 | # Library versioning type. | |
1210 | version_type=$version_type | |
1211 | ||
1212 | # List of archive names. First name is the real one, the rest are links. | |
96abf47d | 1213 | # The last name is the one that the linker finds with -lNAME. |
553f653a | 1214 | library_names_spec="$library_names_spec" |
a7a8349d MV |
1215 | |
1216 | # The coded name of the library, if different from the real name. | |
553f653a | 1217 | soname_spec="$soname_spec" |
a7a8349d MV |
1218 | |
1219 | # Commands used to build and install an old-style archive. | |
553f653a JB |
1220 | RANLIB="$RANLIB" |
1221 | old_archive_cmds="$old_archive_cmds" | |
1222 | old_postinstall_cmds="$old_postinstall_cmds" | |
a7a8349d MV |
1223 | |
1224 | # Commands used to build and install a shared archive. | |
553f653a JB |
1225 | archive_cmds="$archive_cmds" |
1226 | postinstall_cmds="$postinstall_cmds" | |
a7a8349d | 1227 | |
393e4e4d | 1228 | # Flag that allows shared libraries with undefined symbols to be built. |
553f653a | 1229 | allow_undefined_flag="$allow_undefined_flag" |
393e4e4d | 1230 | |
a7a8349d | 1231 | # Commands used to finish a libtool library installation in a directory. |
553f653a JB |
1232 | finish_cmds="$finish_cmds" |
1233 | ||
1234 | # Take the output of nm and produce a listing of raw symbols and C names | |
1235 | global_symbol_pipe="$global_symbol_pipe" | |
a7a8349d | 1236 | |
a7a8349d | 1237 | # How to strip a library file. |
553f653a JB |
1238 | striplib="$striplib" |
1239 | old_striplib="$old_striplib" | |
a7a8349d | 1240 | |
393e4e4d JB |
1241 | # This is the shared library runtime path variable. |
1242 | runpath_var=$runpath_var | |
1243 | ||
a7a8349d MV |
1244 | # This is the shared library path variable. |
1245 | shlibpath_var=$shlibpath_var | |
1246 | ||
96abf47d MD |
1247 | # How to hardcode a shared library path into an executable. |
1248 | hardcode_action=$hardcode_action | |
1249 | ||
1250 | # Flag to hardcode \$libdir into a binary during linking. | |
1251 | # This must work even if \$libdir does not exist. | |
553f653a | 1252 | hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec" |
4cdcd100 JB |
1253 | |
1254 | # Whether we need a single -rpath flag with a separated argument. | |
553f653a | 1255 | hardcode_libdir_separator="$hardcode_libdir_separator" |
96abf47d MD |
1256 | |
1257 | # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the | |
1258 | # resulting binary. | |
1259 | hardcode_direct=$hardcode_direct | |
a7a8349d MV |
1260 | |
1261 | # Set to yes if using the -LDIR flag during linking hardcodes DIR into the | |
1262 | # resulting binary. | |
1263 | hardcode_minus_L=$hardcode_minus_L | |
1264 | ||
393e4e4d JB |
1265 | # Set to yes if using RUNPATH_VAR=DIR during linking hardcodes DIR into the |
1266 | # resulting binary. | |
1267 | hardcode_runpath_var=$hardcode_runpath_var | |
1268 | ||
1269 | # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into | |
96abf47d MD |
1270 | # the resulting binary. |
1271 | hardcode_shlibpath_var=$hardcode_shlibpath_var | |
1272 | ||
a7a8349d MV |
1273 | EOF |
1274 | ||
1275 | # Detect if we are using a relative or absolute path to ltmain.sh. | |
1276 | case "$ltmain" in | |
1277 | /*) cat <<EOF2 >> $ofile | |
1278 | # Execute the libtool backend. | |
1279 | . $ltmain | |
1280 | EOF2 | |
1281 | ;; | |
1282 | *) cat <<EOF3 >> $ofile | |
1283 | # Find the path to this script. | |
1284 | thisdir=\`echo "\$0" | sed -e 's%/[^/]*\$%%'\` | |
1285 | test "X\$0" = "X\$thisdir" && thisdir=. | |
1286 | ||
1287 | # Execute the libtool backend. | |
1288 | . \$thisdir/$ltmain | |
1289 | EOF3 | |
1290 | ;; | |
1291 | esac | |
1292 | ||
1293 | echo 'exit 1' >> $ofile | |
1294 | ||
1295 | chmod +x $ofile | |
1296 | exit 0 | |
1297 | ||
1298 | # Local Variables: | |
1299 | # mode:shell-script | |
1300 | # sh-indentation:2 | |
1301 | # End: |