AC_DEFUN( [rlr_PROG_ELMER], [ _with_elmer="" _with_elmer_bin="" AC_ARG_WITH(elmer, [ --with-elmer=DIR Find bin/elmer, include/elmer/elmer.h, and lib/elmer/libelmer.a in DIR], _with_elmer=$withval) dnl dnl look for elmer in /usr/local if not specified with --with-elmer dnl if test "x$_with_elmer" = "x" ; then if test -r "/usr/local/bin/elmer" ; then _with-elmer="/usr/local" else AC_MSG_ERROR([/usr/local/bin/elmer not readable...must specify location of bin/elmer, include/elmer/elmer.h, and lib/elmer/libelmer.a with --with-elmer flag]) fi fi dnl dnl if flag not saved in cache, set cache value to command-line flag and dnl reset any associated vars dnl (NOTE: not using AC_CACHE_CHECK since the cached value will be printed, dnl but not necessarily used if the command-line overrides it...cache can be dnl simply checked by looking at _cv_ vars loaded during AC_INIT) dnl AC_MSG_CHECKING( [Elmer] ) _cachedMsg="" if test "x${_with_elmer_cv_}" = "x" ; then _with_elmer_cv_=${_with_elmer} ELMER_cv_="" ELMER_INCLUDES_cv_="" ELMER_LIB_NAME_cv_="" else dnl dnl if flag was defined in the cache, check that it is the same as dnl what was given on the command-line...if not, set cached value to dnl that of the command-line and reset any associated vars dnl if test "${_with_elmer_cv_}" != "${_with_elmer}" ; then _with_elmer_cv_=${_with_elmer} ELMER_cv_="" ELMER_INCLUDES_cv_="" ELMER_LIB_NAME_cv_="" else _cachedMsg="(cached) " fi fi AC_MSG_RESULT( [${_cachedMsg}${_with_elmer_cv_}] ) dnl dnl check and define (if necessary) ELMER dnl if test "x${ELMER_cv_}" = "x" ; then if test -r "${_with_elmer}/bin/elmer" ; then ELMER_cv_="${_with_elmer}/bin/elmer" else AC_MSG_ERROR(["could not find bin/elmer in ${_with_elmer}"]) fi fi ELMER=${ELMER_cv_} dnl dnl check and define (if necessary) ELMER_INCLUDES dnl if test "x${ELMER_INCLUDES_cv_}" = "x" ; then if test -r "${_with_elmer}/include/elmer/elmer.h" ; then ELMER_INCLUDES_cv_="${_with_elmer}/include/elmer" else AC_MSG_ERROR(["could not find include/elmer/elmer.h in ${_with_elmer}"]) fi fi ELMER_INCLUDES=${ELMER_INCLUDES_cv_} dnl dnl check and define (if necessary) ELMER_LIB_NAME dnl if test "x${ELMER_LIB_NAME_cv_}" = "x" ; then if test -r "${_with_elmer}/lib/elmer/libelmer.a" ; then ELMER_LIB_NAME_cv_="${_with_elmer}/lib/elmer/libelmer.a" else AC_MSG_ERROR(["could not find libelmer.a in ${_with_elmer}/lib/elmer"]) fi fi ELMER_LIB_NAME=${ELMER_LIB_NAME_cv_} dnl dnl export results of tests dnl AC_SUBST(ELMER) AC_SUBST(ELMER_INCLUDES) AC_SUBST(ELMER_LIB_NAME) ] )