--- trunk/OOPSE/ac-tools/configure.in 2003/10/29 03:16:58 839 +++ trunk/OOPSE/ac-tools/configure.in 2003/10/29 14:29:12 840 @@ -29,13 +29,75 @@ dnl Checks for programs. # who am i AC_CANONICAL_HOST -dnl Checks for programs. +dnl Checks for C compiler AC_PROG_CC([icc xlc gcc cc]) + +dnl Checks for C++ compiler AC_PROG_CXX([icpc icc xlC CC g++ c++]) +dnl If we are not running g++ then we might need some other flags +dnl to get the templates compiled correctly +OOPSE_TEMPLATE_FLAGS="" +if test $ac_cv_prog_gxx = no; then + AC_MSG_CHECKING([checking whether ${CXX} accepts -ptused -no_prelink]) + echo 'void f(){}' > conftest.cc + if test -z "`${CXX} -ptused -no_prelink -c conftest.cc 2>&1`"; then + AC_MSG_RESULT(yes) + OOPSE_TEMPLATE_FLAGS="-ptused -no_prelink" + else + AC_MSG_RESULT(no) + fi + rm -f conftest* + AC_MSG_CHECKING([checking whether ${CXX} accepts -instances=static]) + echo 'void f(){}' > conftest.cc + if test -z "`${CXX} -instances=static -c conftest.cc 2>&1`"; then + AC_MSG_RESULT(yes) + OOPSE_TEMPLATE_FLAGS="-instances=static" + else + AC_MSG_RESULT(no) + fi + rm -f conftest* + AC_MSG_CHECKING([checking whether ${CXX} accepts -pto]) + echo 'void f(){}' > conftest.cc + if test -z "`${CXX} -pto -c conftest.cc 2>&1`"; then + AC_MSG_RESULT(yes) + OOPSE_TEMPLATE_FLAGS="-pto" + else + AC_MSG_RESULT(no) + fi + rm -f conftest* + AC_MSG_CHECKING([checking whether ${CXX} accepts -LANG:std]) + echo 'void f(){}' > conftest.cc + if test -z "`${CXX} -LANG:std -c conftest.cc 2>&1`"; then + AC_MSG_RESULT(yes) + EXTRA_CC_FLAG=${EXTRA_CC_FLAG}" -LANG:std" + else + AC_MSG_RESULT(no) + fi +fi +AC_SUBST(OOPSE_TEMPLATE_FLAGS) +AC_SUBST(EXTRA_CC_FLAG) + +dnl Fortran 90 compilation checks are next + AC_PROG_F90([ifc f90 xlf90 pgf90 epcf90 f95 xlf95 lf95 fort g95]) +dnl Check the flag for Fortran90 preprocessing ACX_PROG_F90_PREPFLAG +dnl Check to see if a flag is required for preprocessing defines ACX_PROG_F90_PREPDEFFLAG +AC_LANG_PUSH(Fortran 90) +AC_LANG_PREPROC(Fortran 90) +AC_F90_LIBRARY_LDFLAGS +dnl How does Fortran mangle function names +AC_F90_WRAPPERS +AC_SUBST(F90_FUNC) +AC_SUBST(F90_FUNC_) +dnl Fortran 90 module suffix +AC_CHECK_MODSUFFIX +dnl Fortran 90 module path specifier +AC_CHECK_MODDIRFLAG +dnl check for strong optimization options + case $debug in 1) ;; @@ -59,17 +121,6 @@ AC_LANG_PUSH(Fortran 90) exit 1 fi -AC_LANG_PUSH(Fortran 90) -AC_LANG_PREPROC(Fortran 90) -AC_F90_LIBRARY_LDFLAGS -dnl how Fortran mangles function names -AC_F90_WRAPPERS -AC_SUBST(F90_FUNC) -AC_SUBST(F90_FUNC_) -dnl module stuff -AC_CHECK_MODSUFFIX -AC_CHECK_MODDIRFLAG - AC_MSG_CHECKING([for mpi-directory]) AC_ARG_WITH(mpi_dir, [ --with-mpi_dir=MPIDIR give the path for MPI [/usr/local]],