]>
Commit | Line | Data |
---|---|---|
9df3ca55 AO |
1 | #### This script is meant to be sourced by ltconfig. |
2 | ||
3 | # ltcf-gcj.sh - Create a GCJ compiler specific configuration | |
4 | # | |
ef099754 | 5 | # Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc. |
9df3ca55 AO |
6 | # Originally by Gordon Matzigkeit <[email protected]>, 1996 |
7 | # | |
8 | # Original GCJ support by: | |
9 | # Alexandre Oliva <[email protected]> | |
10 | # | |
11 | # This file is free software; you can redistribute it and/or modify it | |
12 | # under the terms of the GNU General Public License as published by | |
13 | # the Free Software Foundation; either version 2 of the License, or | |
14 | # (at your option) any later version. | |
15 | # | |
16 | # This program is distributed in the hope that it will be useful, but | |
17 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 | # General Public License for more details. | |
20 | # | |
21 | # You should have received a copy of the GNU General Public License | |
22 | # along with this program; if not, write to the Free Software | |
23 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
24 | # | |
25 | # As a special exception to the GNU General Public License, if you | |
26 | # distribute this file as part of a program that contains a | |
27 | # configuration script generated by Autoconf, you may include it under | |
28 | # the same distribution terms that you use for the rest of that program. | |
29 | ||
30 | ||
31 | # Source file extension for Java test sources. | |
32 | ac_ext=java | |
33 | ||
34 | # Object file extension for compiled Java test sources. | |
35 | objext=o | |
36 | ||
37 | # Code to be used in simple compile tests | |
38 | lt_simple_compile_test_code="class foo {}" | |
39 | ||
40 | # Code to be used in simple link tests | |
ef099754 | 41 | lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' |
9df3ca55 AO |
42 | |
43 | ## Linker Characteristics | |
469b781c | 44 | case $host_os in |
9df3ca55 AO |
45 | cygwin* | mingw*) |
46 | # FIXME: the MSVC++ port hasn't been tested in a loooong time | |
47 | # When not using gcc, we currently assume that we are using | |
48 | # Microsoft Visual C++. | |
49 | if test "$with_gcc" != yes; then | |
50 | with_gnu_ld=no | |
51 | fi | |
52 | ;; | |
53 | ||
54 | esac | |
55 | ||
56 | ld_shlibs=yes | |
57 | if test "$with_gnu_ld" = yes; then | |
58 | # If archive_cmds runs LD, not CC, wlarc should be empty | |
59 | wlarc='${wl}' | |
60 | ||
61 | # See if GNU ld supports shared libraries. | |
469b781c | 62 | case $host_os in |
9df3ca55 AO |
63 | aix3* | aix4*) |
64 | # On AIX, the GNU linker is very broken | |
65 | ld_shlibs=no | |
66 | cat <<EOF 1>&2 | |
67 | ||
68 | *** Warning: the GNU linker, at least up to release 2.9.1, is reported | |
69 | *** to be unable to reliably create shared libraries on AIX. | |
70 | *** Therefore, libtool is disabling shared libraries support. If you | |
71 | *** really care for shared libraries, you may want to modify your PATH | |
72 | *** so that a non-GNU linker is found, and then restart. | |
73 | ||
74 | EOF | |
75 | ;; | |
76 | ||
77 | amigaos*) | |
78 | archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' | |
79 | hardcode_libdir_flag_spec='-L$libdir' | |
80 | hardcode_minus_L=yes | |
81 | ||
82 | # Samuel A. Falvo II <[email protected]> reports | |
83 | # that the semantics of dynamic libraries on AmigaOS, at least up | |
84 | # to version 4, is to share data among multiple programs linked | |
85 | # with the same dynamic library. Since this doesn't match the | |
86 | # behavior of shared libraries on other platforms, we can use | |
87 | # them. | |
88 | ld_shlibs=no | |
89 | ;; | |
90 | ||
91 | beos*) | |
92 | if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then | |
93 | allow_undefined_flag=unsupported | |
94 | # Joseph Beckenbach <[email protected]> says some releases of gcc | |
95 | # support --undefined. This deserves some investigation. FIXME | |
96 | archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | |
97 | else | |
98 | ld_shlibs=no | |
99 | fi | |
100 | ;; | |
101 | ||
102 | cygwin* | mingw*) | |
103 | # hardcode_libdir_flag_spec is actually meaningless, as there is | |
104 | # no search path for DLLs. | |
105 | hardcode_libdir_flag_spec='-L$libdir' | |
106 | allow_undefined_flag=unsupported | |
107 | always_export_symbols=yes | |
108 | ||
109 | extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ | |
110 | sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/impgen.c~ | |
111 | test -f $output_objdir/impgen.exe || (cd $output_objdir && \ | |
112 | if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ | |
113 | else $CC -o impgen impgen.c ; fi)~ | |
8cc32590 | 114 | $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' |
9df3ca55 AO |
115 | |
116 | old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' | |
117 | ||
118 | # cygwin and mingw dlls have different entry points and sets of symbols | |
119 | # to exclude. | |
120 | # FIXME: what about values for MSVC? | |
121 | dll_entry=__cygwin_dll_entry@12 | |
122 | dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ | |
469b781c | 123 | case $host_os in |
9df3ca55 AO |
124 | mingw*) |
125 | # mingw values | |
126 | dll_entry=_DllMainCRTStartup@12 | |
127 | dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ | |
128 | ;; | |
129 | esac | |
130 | ||
131 | # mingw and cygwin differ, and it's simplest to just exclude the union | |
132 | # of the two symbol sets. | |
133 | dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 | |
134 | ||
135 | # recent cygwin and mingw systems supply a stub DllMain which the user | |
136 | # can override, but on older systems we have to supply one (in ltdll.c) | |
137 | if test "x$lt_cv_need_dllmain" = "xyes"; then | |
138 | ltdll_obj='$output_objdir/$soname-ltdll.'"$objext " | |
139 | ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $output_objdir/$soname-ltdll.c~ | |
140 | test -f $output_objdir/$soname-ltdll.$objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' | |
141 | else | |
142 | ltdll_obj= | |
143 | ltdll_cmds= | |
144 | fi | |
145 | ||
146 | # Extract the symbol export list from an `--export-all' def file, | |
147 | # then regenerate the def file from the symbol export list, so that | |
148 | # the compiled dll only exports the symbol export list. | |
149 | # Be careful not to strip the DATA tag left be newer dlltools. | |
150 | export_symbols_cmds="$ltdll_cmds"' | |
151 | $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ | |
152 | sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' | |
153 | ||
469b781c AO |
154 | # If the export-symbols file already is a .def file (1st line |
155 | # is EXPORTS), use it as is. | |
9df3ca55 | 156 | # If DATA tags from a recent dlltool are present, honour them! |
469b781c AO |
157 | archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then |
158 | cp $export_symbols $output_objdir/$soname-def; | |
159 | else | |
160 | echo EXPORTS > $output_objdir/$soname-def; | |
161 | _lt_hint=1; | |
162 | cat $export_symbols | while read symbol; do | |
163 | set dummy \$symbol; | |
164 | case \[$]# in | |
165 | 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; | |
166 | *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; | |
167 | esac; | |
168 | _lt_hint=`expr 1 + \$_lt_hint`; | |
169 | done; | |
170 | fi~ | |
9df3ca55 | 171 | '"$ltdll_cmds"' |
8cc32590 | 172 | $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ |
9df3ca55 | 173 | $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ |
8cc32590 AO |
174 | $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ |
175 | $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ | |
176 | $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' | |
9df3ca55 AO |
177 | ;; |
178 | ||
179 | netbsd*) | |
180 | if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then | |
181 | archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' | |
182 | wlarc= | |
183 | else | |
6be7c12c AO |
184 | archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' |
185 | archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | |
9df3ca55 AO |
186 | fi |
187 | ;; | |
188 | ||
189 | solaris* | sysv5*) | |
190 | if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then | |
191 | ld_shlibs=no | |
192 | cat <<EOF 1>&2 | |
193 | ||
194 | *** Warning: The releases 2.8.* of the GNU linker cannot reliably | |
195 | *** create shared libraries on Solaris systems. Therefore, libtool | |
196 | *** is disabling shared libraries support. We urge you to upgrade GNU | |
197 | *** binutils to release 2.9.1 or newer. Another option is to modify | |
198 | *** your PATH or compiler configuration so that the native linker is | |
199 | *** used, and then restart. | |
200 | ||
201 | EOF | |
202 | elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then | |
203 | archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | |
204 | archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | |
205 | else | |
206 | ld_shlibs=no | |
207 | fi | |
208 | ;; | |
209 | ||
210 | sunos4*) | |
211 | archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' | |
212 | wlarc= | |
213 | hardcode_direct=yes | |
214 | hardcode_shlibpath_var=no | |
215 | ;; | |
216 | ||
217 | *) | |
218 | if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then | |
219 | archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | |
220 | archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | |
221 | else | |
222 | ld_shlibs=no | |
223 | fi | |
224 | ;; | |
225 | esac | |
226 | ||
227 | if test "$ld_shlibs" = yes; then | |
228 | runpath_var=LD_RUN_PATH | |
229 | hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' | |
230 | export_dynamic_flag_spec='${wl}--export-dynamic' | |
231 | case $host_os in | |
232 | cygwin* | mingw*) | |
233 | # dlltool doesn't understand --whole-archive et. al. | |
234 | whole_archive_flag_spec= | |
235 | ;; | |
236 | *) | |
237 | # ancient GNU ld didn't support --whole-archive et. al. | |
238 | if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then | |
239 | whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' | |
240 | else | |
241 | whole_archive_flag_spec= | |
242 | fi | |
243 | ;; | |
244 | esac | |
245 | fi | |
246 | else | |
247 | # PORTME fill in a description of your system's linker (not GNU ld) | |
469b781c | 248 | case $host_os in |
9df3ca55 AO |
249 | aix3*) |
250 | allow_undefined_flag=unsupported | |
251 | always_export_symbols=yes | |
252 | archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' | |
253 | # Note: this linker hardcodes the directories in LIBPATH if there | |
254 | # are no directories specified by -L. | |
255 | hardcode_minus_L=yes | |
256 | if test "$with_gcc" = yes && test -z "$link_static_flag"; then | |
257 | # Neither direct hardcoding nor static linking is supported with a | |
258 | # broken collect2. | |
259 | hardcode_direct=unsupported | |
260 | fi | |
261 | ;; | |
262 | ||
469b781c AO |
263 | aix4* | aix5*) |
264 | hardcode_direct=yes | |
9df3ca55 | 265 | hardcode_libdir_separator=':' |
469b781c AO |
266 | link_all_deplibs=yes |
267 | # When large executables or shared objects are built, AIX ld can | |
268 | # have problems creating the table of contents. If linking a library | |
269 | # or program results in "error TOC overflow" add -mminimal-toc to | |
270 | # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not | |
271 | # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. | |
9df3ca55 | 272 | if test "$with_gcc" = yes; then |
469b781c AO |
273 | case $host_os in aix4.[012]|aix4.[012].*) |
274 | # We only want to do this on AIX 4.2 and lower, the check | |
275 | # below for broken collect2 doesn't work under 4.3+ | |
276 | collect2name=`${CC} -print-prog-name=collect2` | |
277 | if test -f "$collect2name" && \ | |
278 | strings "$collect2name" | grep resolve_lib_name >/dev/null | |
279 | then | |
280 | # We have reworked collect2 | |
281 | hardcode_direct=yes | |
282 | else | |
283 | # We have old collect2 | |
284 | hardcode_direct=unsupported | |
285 | # It fails to find uninstalled libraries when the uninstalled | |
286 | # path is not listed in the libpath. Setting hardcode_minus_L | |
287 | # to unsupported forces relinking | |
288 | hardcode_minus_L=yes | |
289 | hardcode_libdir_flag_spec='-L$libdir' | |
290 | hardcode_libdir_separator= | |
291 | fi | |
292 | esac | |
9df3ca55 AO |
293 | shared_flag='-shared' |
294 | else | |
469b781c AO |
295 | # not using gcc |
296 | if test "$host_cpu" = ia64; then | |
297 | shared_flag='${wl}-G' | |
298 | else | |
299 | shared_flag='${wl}-bM:SRE' | |
300 | fi | |
9df3ca55 | 301 | fi |
7487e485 | 302 | |
469b781c AO |
303 | if test "$host_cpu" = ia64; then |
304 | # On IA64, the linker does run time linking by default, so we don't | |
305 | # have to do anything special. | |
306 | aix_use_runtimelinking=no | |
307 | exp_sym_flag='-Bexport' | |
308 | no_entry_flag="" | |
309 | else | |
310 | # Test if we are trying to use run time linking, or normal AIX style linking. | |
311 | # If -brtl is somewhere in LDFLAGS, we need to do run time linking. | |
312 | aix_use_runtimelinking=no | |
313 | for ld_flag in $LDFLAGS; do | |
314 | if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl" ); then | |
315 | aix_use_runtimelinking=yes | |
316 | break | |
317 | fi | |
318 | done | |
319 | exp_sym_flag='-bexport' | |
320 | no_entry_flag='-bnoentry' | |
321 | fi | |
322 | # -bexpall does not export symbols beginning with underscore (_) | |
323 | always_export_symbols=yes | |
324 | if test "$aix_use_runtimelinking" = yes; then | |
325 | # Warning - without using the other run time loading flags (-brtl), -berok will | |
326 | # link without error, but may produce a broken library. | |
327 | allow_undefined_flag=' ${wl}-berok' | |
328 | hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' | |
329 | archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" | |
330 | else | |
331 | if test "$host_cpu" = ia64; then | |
332 | hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' | |
333 | allow_undefined_flag="-z nodefs" | |
334 | archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" | |
335 | else | |
336 | allow_undefined_flag=' ${wl}-berok' | |
337 | # -bexpall does not export symbols beginning with underscore (_) | |
338 | always_export_symbols=yes | |
339 | # Exported symbols can be pulled into shared objects from archives | |
340 | whole_archive_flag_spec=' ' | |
341 | build_libtool_need_lc=yes | |
342 | hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' | |
343 | # This is similar to how AIX traditionally builds it's shared libraries. | |
344 | archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' | |
345 | fi | |
346 | fi | |
347 | ;; | |
9df3ca55 AO |
348 | |
349 | amigaos*) | |
350 | archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' | |
351 | hardcode_libdir_flag_spec='-L$libdir' | |
352 | hardcode_minus_L=yes | |
353 | # see comment about different semantics on the GNU ld section | |
354 | ld_shlibs=no | |
355 | ;; | |
356 | ||
357 | cygwin* | mingw*) | |
358 | # When not using gcc, we currently assume that we are using | |
359 | # Microsoft Visual C++. | |
360 | # hardcode_libdir_flag_spec is actually meaningless, as there is | |
361 | # no search path for DLLs. | |
362 | hardcode_libdir_flag_spec=' ' | |
363 | allow_undefined_flag=unsupported | |
364 | # Tell ltmain to make .lib files, not .a files. | |
365 | libext=lib | |
366 | # FIXME: Setting linknames here is a bad hack. | |
367 | archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' | |
368 | # The linker will automatically build a .lib file if we build a DLL. | |
369 | old_archive_from_new_cmds='true' | |
370 | # FIXME: Should let the user specify the lib program. | |
371 | old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' | |
469b781c | 372 | fix_srcfile_path='`cygpath -w "$srcfile"`' |
9df3ca55 AO |
373 | ;; |
374 | ||
375 | freebsd1*) | |
376 | ld_shlibs=no | |
377 | ;; | |
378 | ||
379 | # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor | |
380 | # support. Future versions do this automatically, but an explicit c++rt0.o | |
381 | # does not break anything, and helps significantly (at the cost of a little | |
382 | # extra space). | |
383 | freebsd2.2*) | |
384 | archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' | |
385 | hardcode_libdir_flag_spec='-R$libdir' | |
386 | hardcode_direct=yes | |
387 | hardcode_shlibpath_var=no | |
388 | ;; | |
389 | ||
390 | # Unfortunately, older versions of FreeBSD 2 do not have this feature. | |
391 | freebsd2*) | |
392 | archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' | |
393 | hardcode_direct=yes | |
394 | hardcode_minus_L=yes | |
395 | hardcode_shlibpath_var=no | |
396 | ;; | |
397 | ||
398 | # FreeBSD 3 and greater uses gcc -shared to do shared libraries. | |
399 | freebsd*) | |
400 | archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' | |
401 | hardcode_libdir_flag_spec='-R$libdir' | |
402 | hardcode_direct=yes | |
403 | hardcode_shlibpath_var=no | |
404 | ;; | |
405 | ||
406 | hpux9* | hpux10* | hpux11*) | |
469b781c | 407 | case $host_os in |
9df3ca55 AO |
408 | hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; |
409 | *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; | |
410 | esac | |
411 | hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' | |
412 | hardcode_libdir_separator=: | |
413 | hardcode_direct=yes | |
414 | hardcode_minus_L=yes # Not in the search PATH, but as the default | |
415 | # location of the library. | |
416 | export_dynamic_flag_spec='${wl}-E' | |
417 | ;; | |
418 | ||
419 | irix5* | irix6*) | |
420 | if test "$with_gcc" = yes; then | |
421 | archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' | |
422 | else | |
423 | archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' | |
424 | fi | |
425 | hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' | |
426 | hardcode_libdir_separator=: | |
427 | link_all_deplibs=yes | |
428 | ;; | |
429 | ||
430 | netbsd*) | |
431 | if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then | |
432 | archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out | |
433 | else | |
6be7c12c | 434 | archive_cmds='$LD -shared -nodefaultlibs -o $lib $libobjs $deplibs $linker_flags' # ELF |
9df3ca55 AO |
435 | fi |
436 | hardcode_libdir_flag_spec='${wl}-R$libdir' | |
437 | hardcode_direct=yes | |
438 | hardcode_shlibpath_var=no | |
439 | ;; | |
440 | ||
441 | openbsd*) | |
442 | archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' | |
443 | hardcode_libdir_flag_spec='-R$libdir' | |
444 | hardcode_direct=yes | |
445 | hardcode_shlibpath_var=no | |
446 | ;; | |
447 | ||
448 | os2*) | |
449 | hardcode_libdir_flag_spec='-L$libdir' | |
450 | hardcode_minus_L=yes | |
451 | allow_undefined_flag=unsupported | |
452 | archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' | |
453 | old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' | |
454 | ;; | |
455 | ||
456 | osf3*) | |
457 | if test "$with_gcc" = yes; then | |
458 | allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' | |
459 | archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' | |
460 | else | |
461 | allow_undefined_flag=' -expect_unresolved \*' | |
462 | archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' | |
463 | fi | |
464 | hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' | |
465 | hardcode_libdir_separator=: | |
466 | ;; | |
467 | ||
468 | osf4* | osf5*) # as osf3* with the addition of -msym flag | |
469 | if test "$with_gcc" = yes; then | |
470 | allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' | |
471 | archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' | |
472 | else | |
473 | allow_undefined_flag=' -expect_unresolved \*' | |
474 | archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' | |
475 | fi | |
476 | hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' | |
477 | hardcode_libdir_separator=: | |
478 | ;; | |
479 | ||
480 | sco3.2v5*) | |
481 | archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
482 | hardcode_shlibpath_var=no | |
483 | runpath_var=LD_RUN_PATH | |
484 | hardcode_runpath_var=yes | |
485 | ;; | |
486 | ||
487 | solaris*) | |
8cc32590 AO |
488 | no_undefined_flag=' ${wl}-z ${wl}defs' |
489 | archive_cmds='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib' | |
9df3ca55 | 490 | archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ |
8cc32590 AO |
491 | $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp' |
492 | ||
493 | # Commands to make compiler produce verbose output that lists | |
494 | # what "hidden" libraries, object files and flags are used when | |
495 | # linking a shared library. | |
496 | output_verbose_link_cmds="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\"" | |
497 | ||
498 | hardcode_libdir_flag_spec='${wl}-R $wl$libdir' | |
9df3ca55 | 499 | hardcode_shlibpath_var=no |
469b781c | 500 | case $host_os in |
9df3ca55 AO |
501 | solaris2.[0-5] | solaris2.[0-5].*) ;; |
502 | *) # Supported since Solaris 2.6 (maybe 2.5.1?) | |
8cc32590 | 503 | whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; |
9df3ca55 AO |
504 | esac |
505 | link_all_deplibs=yes | |
506 | ;; | |
507 | ||
508 | sunos4*) | |
509 | archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' | |
510 | hardcode_libdir_flag_spec='-L$libdir' | |
511 | hardcode_direct=yes | |
512 | hardcode_minus_L=yes | |
513 | hardcode_shlibpath_var=no | |
514 | ;; | |
515 | ||
516 | sysv4) | |
517 | archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
518 | runpath_var='LD_RUN_PATH' | |
519 | hardcode_shlibpath_var=no | |
520 | hardcode_direct=no #Motorola manual says yes, but my tests say they lie | |
521 | ;; | |
522 | ||
523 | sysv4.3*) | |
524 | archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
525 | hardcode_shlibpath_var=no | |
526 | export_dynamic_flag_spec='-Bexport' | |
527 | ;; | |
528 | ||
529 | sysv5*) | |
530 | no_undefined_flag=' -z text' | |
531 | # $CC -shared without GNU ld will not create a library from C++ | |
532 | # object files and a static libstdc++, better avoid it by now | |
533 | archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
534 | archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ | |
535 | $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' | |
536 | hardcode_libdir_flag_spec= | |
537 | hardcode_shlibpath_var=no | |
538 | runpath_var='LD_RUN_PATH' | |
539 | ;; | |
540 | ||
541 | uts4*) | |
542 | archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
543 | hardcode_libdir_flag_spec='-L$libdir' | |
544 | hardcode_shlibpath_var=no | |
545 | ;; | |
546 | ||
547 | dgux*) | |
548 | archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
549 | hardcode_libdir_flag_spec='-L$libdir' | |
550 | hardcode_shlibpath_var=no | |
551 | ;; | |
552 | ||
553 | sysv4*MP*) | |
554 | if test -d /usr/nec; then | |
555 | archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' | |
556 | hardcode_shlibpath_var=no | |
557 | runpath_var=LD_RUN_PATH | |
558 | hardcode_runpath_var=yes | |
559 | ld_shlibs=yes | |
560 | fi | |
561 | ;; | |
562 | ||
563 | sysv4.2uw2*) | |
564 | archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' | |
565 | hardcode_direct=yes | |
566 | hardcode_minus_L=no | |
567 | hardcode_shlibpath_var=no | |
568 | hardcode_runpath_var=yes | |
569 | runpath_var=LD_RUN_PATH | |
570 | ;; | |
571 | ||
6be7c12c AO |
572 | sysv5uw7* | unixware7*) |
573 | no_undefined_flag='${wl}-z ${wl}text' | |
574 | if test "$GCC" = yes; then | |
575 | archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' | |
576 | else | |
577 | archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' | |
578 | fi | |
9df3ca55 AO |
579 | runpath_var='LD_RUN_PATH' |
580 | hardcode_shlibpath_var=no | |
581 | ;; | |
582 | ||
583 | *) | |
584 | ld_shlibs=no | |
585 | ;; | |
586 | esac | |
587 | fi | |
588 | ||
589 | ## Compiler Characteristics: PIC flags, static flags, etc | |
590 | ||
591 | # We don't use cached values here since only the C compiler | |
592 | # characteristics should be cached. | |
593 | ac_cv_prog_cc_pic= | |
594 | ac_cv_prog_cc_shlib= | |
595 | ac_cv_prog_cc_wl= | |
596 | ac_cv_prog_cc_static= | |
597 | ac_cv_prog_cc_no_builtin= | |
598 | ac_cv_prog_cc_can_build_shared=$can_build_shared | |
599 | ||
600 | ac_cv_prog_cc_wl='-Wl,' | |
601 | ac_cv_prog_cc_static='-static' | |
602 | ||
469b781c | 603 | case $host_os in |
9df3ca55 AO |
604 | beos* | irix5* | irix6* | osf3* | osf4* | osf5*) |
605 | # PIC is the default for these OSes. | |
606 | ;; | |
607 | aix*) | |
608 | # Below there is a dirty hack to force normal static linking with -ldl | |
609 | # The problem is because libdl dynamically linked with both libc and | |
610 | # libC (AIX C++ library), which obviously doesn't included in libraries | |
611 | # list by gcc. This cause undefined symbols with -static flags. | |
612 | # This hack allows C programs to be linked with "-static -ldl", but | |
613 | # we not sure about C++ programs. | |
614 | ac_cv_prog_cc_static="$ac_cv_prog_cc_static ${ac_cv_prog_cc_wl}-lC" | |
615 | ;; | |
7389ff65 AO |
616 | *djgpp*) |
617 | # DJGPP does not suppot shared libraries at all | |
618 | ac_cv_prog_cc_pic= | |
619 | ;; | |
9df3ca55 AO |
620 | cygwin* | mingw* | os2*) |
621 | # This hack is so that the source file can tell whether it is being | |
622 | # built for inclusion in a dll (and should export symbols for example). | |
623 | ac_cv_prog_cc_pic='-DDLL_EXPORT' | |
624 | ;; | |
625 | amigaos*) | |
626 | # FIXME: we need at least 68020 code to build shared libraries, but | |
627 | # adding the `-m68020' flag to GCC prevents building anything better, | |
628 | # like `-m68040'. | |
629 | ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' | |
630 | ;; | |
631 | sysv4*MP*) | |
632 | if test -d /usr/nec; then | |
633 | ac_cv_prog_cc_pic=-Kconform_pic | |
634 | fi | |
635 | ;; | |
636 | *) | |
637 | ac_cv_prog_cc_pic='-fPIC' | |
638 | ;; | |
639 | esac | |
640 | ||
641 | # GCJ did not exist at the time GCC didn't implicitly link libc in. | |
642 | need_lc=no | |
469b781c AO |
643 | |
644 | # All existing releases of GCJ support `-c -o'. | |
645 | lt_cv_compiler_c_o=yes |