# AC_CC_WARNINGS([ansi])
cc_ok=yes
+echo
+echo ---------------------------------------------
+echo testing Fortran
+echo ---------------------------------------------
+echo
+
+fortran_ok=no
+AC_PROG_F77
+AC_F77_LIBRARY_LDFLAGS
+AC_PROG_FC
+AC_FC_LIBRARY_LDFLAGS
+if test "X$FC" != "X" ; then
+ fortran_ok=yes
+fi
+
+echo
+
dnl Library libdl :
AC_CHECK_LIB(dl,dlopen)
echo
echo Configure
-variables="cc_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok"
+variables="cc_ok fortran_ok boost_ok lex_yacc_ok python_ok swig_ok threads_ok OpenGL_ok qt_ok vtk_ok hdf5_ok omniORB_ok occ_ok doxygen_ok graphviz_ok Kernel_ok Geom_ok SMesh_ok Netgen_ok"
for var in $variables
do
$(LIB): $(LIB_OBJ_O) $(LIB_OBJ_LO)
LIB_OBJ = $(LIB_OBJ_LO)
-ifeq ($(F77),gfortran)
-LDFLAGS += -lgfortran
-else
-LDFLAGS += -lg2c
-endif
-
-LDFLAGS += $(OCC_LDPATH) -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES
+LDFLAGS += $(OCC_LDPATH) $(FCLIBS) -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES
MOSTLYCLEAN += $(LIB_OBJ_O)