--- trunk/OOPSE-3.0/ac-tools/configure.in 2005/02/14 23:16:48 2022 +++ trunk/OOPSE-3.0/ac-tools/configure.in 2005/04/13 22:30:22 2190 @@ -156,25 +156,41 @@ AC_PATH_PROG(PS_PATH, ps) exit 1 fi -AC_PATH_PROG(PS_PATH, ps) -AC_CACHE_CHECK([for POSIX ps], ac_cv_prog_ps_posix, [ - USER=${USER:-${LOGNAME:-`logname`}} - if $PS_PATH -U $USER -opid,args >/dev/null 2>&1; then - ac_cv_prog_ps_posix=yes +AC_PATH_PROG(PS, ps) +AC_CACHE_CHECK([for POSIX or BSD ps syntax], ac_cv_prog_ps_syntax, [ + if $PS ax -o rss > /dev/null 2>&1; then + ac_cv_prog_ps_ax=yes else - ac_cv_prog_ps_posix=no + ac_cv_prog_ps_ax=no fi + if $PS -ef -o rss > /dev/null 2>&1; then + ac_cv_prog_ps_ef=yes + else + ac_cv_prog_ps_ef=no + fi + if test "$ac_cv_prog_ps_ax" = yes; then + ac_cv_prog_ps_syntax=BSD + else + if test "$ac_cv_prog_ps_ef" = yes; then + ac_cv_prog_ps_syntax=POSIX + else + AC_MSG_ERROR(Could not determine ps syntax) + fi + fi ]) -if test "$ac_cv_prog_ps_posix" = yes; then - BSD_PS=yes + +AC_DEFINE_UNQUOTED(PSCOMMAND, $PS, [Path to ps program]) + +if test "$ac_cv_prog_ps_syntax" = BSD; then + AC_DEFINE(PSTYPE_IS_BSD, 1) else - POSIX_PS=yes + if test "$ac_cv_prog_ps_syntax" = POSIX; then + AC_DEFINE(PSTYPE_IS_POSIX, 1) + else + AC_MSG_ERROR(Unknown ps syntax type!) + fi fi -AC_SUBST(PS_PATH) -AC_SUBST(BSD_PS) -AC_SUBST(POSIX_PS) - AC_ARG_WITH(mpi, [AC_HELP_STRING([--with-mpi=], [compile with MPI installed in [default=no]])], @@ -194,28 +210,230 @@ AC_ARG_WITH(sprng, fi AC_SUBST(USE_MPI) -AC_ARG_WITH(sprng, - [AC_HELP_STRING([--with-sprng=], - [compile with SPRNG installed in [default=/usr/local]])], - with_sprng=$withval, - with_sprng="/usr/local") - -case "x$with_sprng" in - xyes | "x") USE_SPRNG=yes;; - xno) USE_SPRNG=no ;; - *) SPRNG="$with_sprng"; USE_SPRNG=yes ;; -esac -if test "$USE_SPRNG" = "yes" -a -z "$with_sprng"; then - SPRNG="/usr/local" -fi -if test "$USE_SPRNG" = "yes"; then - ACX_SPRNG -fi -AC_SUBST(USE_SPRNG) +dnl AC_ARG_WITH(sprng, +dnl [AC_HELP_STRING([--with-sprng=], +dnl [compile with SPRNG installed in [default=/usr/local]])], +dnl with_sprng=$withval, +dnl with_sprng="/usr/local") +dnl +dnl case "x$with_sprng" in +dnl xyes | "x") USE_SPRNG=yes;; +dnl xno) USE_SPRNG=no ;; +dnl *) SPRNG="$with_sprng"; USE_SPRNG=yes ;; +dnl esac +dnl if test "$USE_SPRNG" = "yes" -a -z "$with_sprng"; then +dnl SPRNG="/usr/local" +dnl fi +dnl if test "$USE_SPRNG" = "yes"; then +dnl ACX_SPRNG +dnl fi +dnl AC_SUBST(USE_SPRNG) +dnl ######################################## +dnl # Check for CGAL headers and libraries # +dnl ######################################## -CHECK_MKL +USE_CGAL=no +cgal_makefile=auto +AC_ARG_WITH(cgal-makefile,[ --with-cgal-makefile=FILE CGAL makefile that should be used], cgal_makefile="$withval") + +if test "x$cgal_makefile" != xno; then + + if test "x$cgal_makefile" = xauto -a "x$CGAL_MAKEFILE" != x; then + cgal_makefile="$CGAL_MAKEFILE" + fi + + echo "cgal_makefile $cgal_makefile" + + if test -f "$cgal_makefile"; then + + cat >config.tmp.Makefile <config.tmp.cgalvariables + @echo CGAL_INCLDIR=\"\${CGAL_INCL_DIR}\" >>config.tmp.cgalvariables + @echo CGAL_INCLCONFDIR=\"\${CGAL_INCL_CONF_DIR}\" >>config.tmp.cgalvariables + @echo CGAL_LIBDIR=\"\${CGAL_LIB_DIR}/\${CGAL_OS_COMPILER}\" >>config.tmp.cgalvariables + @echo CGAL_RLIBDIR=\"\${CGAL_LIB_DIR}/\${CGAL_OS_COMPILER}\" >>config.tmp.cgalvariables + @echo CGAL_CXXFLAGS=\"\${CGAL_CXXFLAGS}\" >>config.tmp.cgalvariables + @echo GMP_INCLDIR=\"\${GMP_INCL_DIR}\" >>config.tmp.cgalvariables + @echo GMP_LIBDIR=\"\${GMP_LIB_DIR}\" >>config.tmp.cgalvariables + @echo GMP_RLIBDIR=\"\${GMP_LIB_DIR}\" >>config.tmp.cgalvariables + @echo LEDA_INCLDIR=\"\${LEDA_INCL_DIR}\" >>config.tmp.cgalvariables + @echo LEDA_LIBDIR=\"\${LEDA_LIB_DIR}\" >>config.tmp.cgalvariables + @echo LEDA_RLIBDIR=\"\${LEDA_LIB_DIR}\" >>config.tmp.cgalvariables +EOF + + make -s -f config.tmp.Makefile + . config.tmp.cgalvariables + + rm -f config.tmp.Makefile config.tmp.cgalvariables + + if test "x$CGAL_INCLDIR" = "x"; then + CGAL_INCLDIR="" + fi + + if test "x$CGAL_LIBDIR" = "x"; then + CGAL_LIBDIR="" + fi + + if test "x$CGAL_RLIBDIR" = "x"; then + CGAL_RLIBDIR="" + fi + + if test "x$LEDA_INCLDIR" = "x"; then + LEDA_INCLDIR="" + fi + + if test "x$LEDA_LIBDIR" = "x"; then + LEDA_LIBDIR="" + fi + + if test "x$LEDA_RLIBDIR" = "x"; then + LEDA_RLIBDIR="" + fi + + if test "x$GMP_INCLDIR" = "x"; then + GMP_INCLDIR="" + fi + if test "x$GMP_LIBDIR" = "x"; then + GMP_LIBDIR="" + fi + + if test "x$GMP_RLIBDIR" = "x"; then + GMP_RLIBDIR="" + fi + + echo "CGAL_OS_COMPILER $CGAL_OS_COMPILER" + echo "CGAL_INCLDIR $CGAL_INCLDIR" + echo "CGAL_INCLCONFDIR $CGAL_INCLCONFDIR" + echo "CGAL_LIBDIR $CGAL_LIBDIR" + echo "CGAL_CXXFLAGS $CGAL_CXXFLAGS" + echo "LEDA_INCLDIR $LEDA_INCLDIR" + echo "LEDA_LIBDIR $LEDA_LIBDIR" + echo "GMP_INCLDIR $GMP_INCLDIR" + echo "GMP_LIBDIR $GMP_LIBDIR" + + AC_LANG_PUSH(C++) + save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -I$CGAL_INCLDIR -I$CGAL_INCLCONFDIR" + AC_CHECK_HEADER(CGAL/Cartesian.h, cgal=yes, cgal=no) + CXXFLAGS="$save_CXXFLAGS" + + if test "x$cgal" = xyes; then + AC_MSG_CHECKING([for CGAL version]) + LOCATION=${CGAL_INCLDIR} + LOCATION=${LOCATION:-/usr/include} + if test -f $LOCATION/CGAL/version.h; then + CGAL_VERSION=`grep '#define.*\.*' $LOCATION/CGAL/version.h | sed 's/[^0-9\.]*//g'` + else + CGAL_VERSION=`grep '#define.*\.*' $LOCATION/CGAL/config.h | sed 's/[^0-9\.]*//g'` + fi +changequote({, })dnl + if echo $CGAL_VERSION | grep -q "^[3456789]"; then +changequote([, ])dnl + AC_MSG_RESULT([($CGAL_VERSION) yes]) + else + AC_MSG_RESULT([($CGAL_VERSION) no]) + cgal=no + fi + fi + + if test "x$cgal" = xyes; then + CGAL_LIBS="-lCGAL" + AC_MSG_CHECKING([whether CGAL uses LEDA]) + if echo $CGAL_CXXFLAGS | grep -q -- -DCGAL_USE_LEDA; then + CGAL_USES_LEDA=yes + AC_MSG_RESULT([yes]) + CGAL_DEFINES="-DCGAL_USE_LEDA -DLEDA_PREFIX" + else + AC_MSG_RESULT([no]) + CGAL_USES_LEDA=no + fi + + AC_MSG_CHECKING([whether CGAL uses GMP]) + if echo $CGAL_CXXFLAGS | grep -q -- -DCGAL_USE_GMP; then + CGAL_USES_GMP=yes + AC_MSG_RESULT([yes]) + CGAL_DEFINES="-DCGAL_USE_GMP $CGAL_DEFINES" + else + AC_MSG_RESULT([no]) + CGAL_USES_GMP=no + fi + + CGAL_LIBS="$CGAL_LIBS -lm" + + CGAL_CXXFLAGS="-ftemplate-depth-50" + + echo "CGAL_USES_LEDA $CGAL_USES_LEDA" + echo "CGAL_USES_GMP $CGAL_USES_GMP" + echo "CGAL_INCLDIR $CGAL_INCLDIR" + echo "CGAL_LIBDIR $CGAL_LIBDIR" + echo "CGAL_DEFINES $CGAL_DEFINES" + echo "CGAL_CXXFLAGS $CGAL_CXXFLAGS" + echo "CGAL_LIBS $CGAL_LIBS" + fi + + if test "x$cgal" = xyes; then + save_LIBS="$LIBS" + LIBS="$LIBS -L$CGAL_LIBDIR" + if test "x$CGAL_USES_LEDA" = xyes; then + LIBS="-lL $LIBS -L$LEDA_LIBDIR" + fi + # if test "x$CGAL_USES_GMP" = xyes; then + # LIBS="-lgmp $LIBS $GMP_LIBDIR" + # fi + AC_CHECK_CXX_LIB(CGAL, ::CGAL::Cartesian::Point_2, [#include ], [::CGAL::Cartesian::Point_2 P], [cgal=yes], [cgal=no], -I$CGAL_INCLDIR -I$CGAL_INCLCONFDIR) + LIBS="$save_LIBS" + fi + + fi + AC_LANG_POP() + +fi + +if test "x$cgal" = xyes; then + USE_CGAL=yes + AC_DEFINE(HAVE_CGAL, 1, [Is defined if the CGAL library is available.]) + AC_DEFINE_UNQUOTED(CGAL_VERSION, $CGAL_VERSION, [The CGAL version number.]) +changequote({, })dnl + if ! echo $CGAL_VERSION | grep -q "^3.0"; then +changequote([, ])dnl + AC_MSG_WARN(*****************************************************) + AC_MSG_WARN(*** Warning: Your CGAL version is newer than the ***) + AC_MSG_WARN(*** supported versions. It may still work though. ***) + AC_MSG_WARN(*****************************************************) + fi +else + if test "x$cgal_makefile" != xno; then + AC_MSG_WARN(*********************************************************) + AC_MSG_WARN(*** Warning: CGAL was not found. ***) + AC_MSG_WARN(*** Run \"configure\" with the appropriate options. ***) + AC_MSG_WARN(*** CGAL support will be disabled. ***) + AC_MSG_WARN(*********************************************************) + fi + CGAL_INCLDIR= + CGAL_LIBDIR= + CGAL_RLIBDIR= + CGAL_DEFINES= + CGAL_CXXFLAGS= + CGAL_LIBS= +fi + +AC_SUBST(USE_CGAL) +CGAL_INC_DIR="${CGAL_INCLDIR} ${CGAL_INCLCONFDIR}" +AC_SUBST(CGAL_INC_DIR) +CGAL_LIB_DIR=${CGAL_LIBDIR} +AC_SUBST(CGAL_LIB_DIR) +CGAL_RLIB_DIR=${CGAL_RLIBDIR} +AC_SUBST(CGAL_RLIB_DIR) +AC_SUBST(CGAL_DEFINES) +AC_SUBST(CGAL_CXXFLAGS) +AC_SUBST(CGAL_LIBS) + +dnl CHECK_MKL + BB_ENABLE_DOXYGEN AC_EXEEXT @@ -278,6 +496,6 @@ AC_CONFIG_FILES([make/Makefile src/utils/Makefile]) AC_SUBST(PREPDEFFLAG) AC_SUBST(F90_MODULE_NAMES) AC_CONFIG_HEADER([src/config.h]) -AC_CONFIG_FILES([make/Makefile src/utils/Makefile]) +AC_CONFIG_FILES([make/Makefile src/utils/Makefile src/applications/nanoRodBuilder/Makefile]) AC_OUTPUT