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