dnl Process this file with autoconf to produce a configure script. AC_INIT(rotgen.f) AC_ARG_WITH(g77, [ --with-g77 use G77 to compile --without-g77 use the default f77 to compile]) AC_ARG_WITH(ccp4-prefix, AC_HELP_STRING( [--with-ccp4-prefix=PFX], [ set ccp4 libraries prefix] ), [if test "x${withval}" != xyes; then ccp4_prefix=$withval else AC_MSG_ERROR([incorrect use of --with-ccp4-prefix]) fi ], ccp4_prefix="" ) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(rotgen, 3.1) AM_MAINTAINER_MODE case ${with_g77} in "yes" ) CC="gcc" GCC=yes F77=g77 ;; "no" ) : ${CC=cc} F77=f77 ;; esac AC_PROG_F77 AC_PROG_CXX AC_PROG_INSTALL AC_PATH_X AC_PATH_XTRA X_PRE_LIBS="-lXt -lX11 $X_PRE_LIBS" AC_PROG_CXX AC_CXX_LIBRARY_LDFLAGS AC_LANG_FORTRAN77 dnl try to identify the fortran name mangling _AC_F77_NAME_MANGLING dnl The alternatives in the cases here could be left over from a previous dnl config.cache -- autoconf changed. echo "$ac_cv_f77_mangling"-- case "$ac_cv_f77_mangling" in "upper case, no underscore, no extra underscore" | \ "upper case, no underscores") AC_DEFINE(LINKTYP, 2) ;; "lower case, no underscore, no extra underscore" | \ "lower case, no underscores" ) AC_DEFINE(LINKTYP, 3) ;; "lower case, underscore, no extra underscore" | \ "lower case, single underscores") AC_DEFINE(LINKTYP, 1) ;; "lower case, underscore, extra underscore" | \ "lower case, double underscores") AC_DEFINE(LINKTYP, 1) # We aren't set up for f2c-style double underscoring. if test "$G77" = yes; then AC_MSG_WARN([ *** You need to use option -fno-second-underscore with g77 *** to compile Fortran to link with xdl_view. ]) FFLAGS="-fno-second-underscore $FFLAGS" else AC_MSG_WARN([ *** Your Fortran compiler looks like f2c. *** You can't currently link xdl_view routines with Fortran compiled with it. *** You could use g77 with option `'-fno-second-underscore' instead.]) fi ;; *) AC_MSG_ERROR([Unknown sort of Fortran name mangling]) ;; esac case $target in *linux* ) case $F77 in *ifc | *efc ) LDFLAGS="$LDFLAGS -Vaxlib" esac esac test "$CLIB" && LDFLAGS="$LDFLAGS -L$CLIB" test "${with_ccp4_prefix+set}" = set && LDFLAGS="$LDFLAGS -L$ccp4_prefix/lib" AC_LANG_PUSH(C) AC_CHECK_LIB(m,sqrt) AC_LANG_POP(C) CCP4_CHECK_LIB CCP4_CHECK_XDL_VIEW JWC_CHECK_FLIB AS_IF( [test $ac_cv_lib_ccp4f_qisnan != yes || test $ac_cv_lib_xdl_view_xdlf_open_view != yes || test $ac_cv_lib_jwc_f_kdmstr != yes ], AS_IF( [ test "${with_ccp4_prefix+set}" = set ], [ test $ac_cv_lib_ccp4f_qisnan != yes && LIBS="-lccp4f -lccp4c -lmmdb2 $LIBS" && LDFLAGS="$LDFLAGS -L$ccp4_prefix/src" test $ac_cv_lib_jwc_f_kdmstr != yes && LIBS="-ljwc_f -ljwc_c $LIBS" test $ac_cv_lib_xdl_view_xdlf_open_view != yes && LIBS="-lxdl_view -lxdl_viewextra $LIBS" ], AC_MSG_ERROR([missing necessary libraries]) ) , ) AC_SUBST(rotgen_LDFLAGS) AC_OUTPUT(Makefile)