From 3de6b28c52758ac6376383eea6c8a546662444ef Mon Sep 17 00:00:00 2001 From: carns Date: Tue, 11 May 2010 18:38:53 +0000 Subject: [PATCH] update configure so that --with-mpi argument overrides whatever mpicc is found in path git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@233 3b7491f3-a168-0410-bf4b-c445ed680a29 --- configure | 45 +++++++++++++++++++++++---------------------- configure.in | 31 ++++++++++++++++--------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/configure b/configure index 27fe98b..5f33f9e 100755 --- a/configure +++ b/configure @@ -3191,7 +3191,23 @@ fi -# Extract the first word of "mpicc", so it can be a program name with args. + +# Check whether --with-mpi or --without-mpi was given. +if test "${with_mpi+set}" = set; then + withval="$with_mpi" + if test x$withval = xyes; then + { { echo "$as_me:$LINENO: error: --with-mpi must be given a pathname" >&5 +echo "$as_me: error: --with-mpi must be given a pathname" >&2;} + { (exit 1); exit 1; }; } + else + MPICC="${withval}/bin/mpicc" + HAVE_MPICC="yes" + fi + +fi; + +if test x$HAVE_MPICC != xyes; then + # Extract the first word of "mpicc", so it can be a program name with args. set dummy mpicc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 @@ -3227,24 +3243,9 @@ else echo "${ECHO_T}no" >&6 fi -if test x$HAVE_MPICC != xyes; then - -# Check whether --with-mpi or --without-mpi was given. -if test "${with_mpi+set}" = set; then - withval="$with_mpi" - if test x$withval = xyes; then - { { echo "$as_me:$LINENO: error: --with-mpi must be given a pathname" >&5 -echo "$as_me: error: --with-mpi must be given a pathname" >&2;} - { (exit 1); exit 1; }; } - else - MPICC="${withval}/bin/mpicc" - GOT_MPICC="1" - fi - -fi; -else - GOT_MPICC="1" - MPICC=mpicc + if test x$HAVE_MPICC = xyes; then + MPICC=mpicc + fi fi @@ -3306,9 +3307,9 @@ fi; saveCC="$CC" CC="$MPICC" -if test x$GOT_MPICC != x1; then - { { echo "$as_me:$LINENO: error: must provide --with-mpi= argument to configure." >&5 -echo "$as_me: error: must provide --with-mpi= argument to configure." >&2;} +if test x$HAVE_MPICC != "xyes"; then + { { echo "$as_me:$LINENO: error: must provide --with-mpi= argument to configure if mpicc is not in path." >&5 +echo "$as_me: error: must provide --with-mpi= argument to configure if mpicc is not in path." >&2;} { (exit 1); exit 1; }; } fi if test x$GOT_ALIGNMENT != x1; then diff --git a/configure.in b/configure.in index 4869e54..c2e43d6 100644 --- a/configure.in +++ b/configure.in @@ -13,20 +13,21 @@ AC_PROG_INSTALL CHECK_ZLIB -AC_CHECK_PROG(HAVE_MPICC, mpicc, yes, no) +AC_ARG_WITH(mpi, +[ --with-mpi= Location of the MPI installation], + if test x$withval = xyes; then + AC_MSG_ERROR(--with-mpi must be given a pathname) + else + MPICC="${withval}/bin/mpicc" + HAVE_MPICC="yes" + fi +) + if test x$HAVE_MPICC != xyes; then - AC_ARG_WITH(mpi, - [ --with-mpi= Location of the MPI installation], - if test x$withval = xyes; then - AC_MSG_ERROR(--with-mpi must be given a pathname) - else - MPICC="${withval}/bin/mpicc" - GOT_MPICC="1" - fi - ) -else - GOT_MPICC="1" - MPICC=mpicc + AC_CHECK_PROG(HAVE_MPICC, mpicc, yes, no) + if test x$HAVE_MPICC = xyes; then + MPICC=mpicc + fi fi AC_SUBST(MPICC) @@ -65,8 +66,8 @@ AC_ARG_WITH(log-path, saveCC="$CC" CC="$MPICC" -if test x$GOT_MPICC != x1; then - AC_MSG_ERROR(must provide --with-mpi= argument to configure.) +if test x$HAVE_MPICC != "xyes"; then + AC_MSG_ERROR(must provide --with-mpi= argument to configure if mpicc is not in path.) fi if test x$GOT_ALIGNMENT != x1; then AC_MSG_ERROR(must provide --with-mem-align= argument to configure.) -- 2.26.2