1
1

Added OMPI_WHICH macro as an alternative to using {{{`which

<prog>`}}} in `configure`. It is preferable to simply using {{{`which
<prog>`}}} because backticks (`) (aka backquotes) invoke a sub-shell
which may source a "noisy" `~/.whatever` file, and we do not want the
error messages to be part of the assignment in {{{foo=`which
<prog>`}}}.

This commit was SVN r16955.
Этот коммит содержится в:
Ethan Mallove 2007-12-14 02:39:58 +00:00
родитель d05d3afaed
Коммит cb7c435a9c
5 изменённых файлов: 40 добавлений и 4 удалений

Просмотреть файл

@ -10,6 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -268,6 +269,37 @@ dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
# Macro that serves as an alternative to using `which <prog>`. It is
# preferable to simply using `which <prog>` because backticks (`) (aka
# backquotes) invoke a sub-shell which may source a "noisy"
# ~/.whatever file (and we do not want the error messages to be part
# of the assignment in foo=`which <prog>`). This macro ensures that we
# get a sane executable value.
AC_DEFUN([OMPI_WHICH],[
# 1 is the variable name to do "which" on
# 2 is the variable name to assign the return value to
OMPI_VAR_SCOPE_PUSH([ompi_prog ompi_file ompi_dir ompi_sentinel])
ompi_prog=$1
IFS_SAVE=$IFS
IFS="$PATH_SEPARATOR"
for ompi_dir in $PATH; do
if test -x "$ompi_dir/$ompi_prog"; then
$2="$ompi_dir/$ompi_prog"
break
fi
done
IFS=$IFS_SAVE
OMPI_VAR_SCOPE_POP
])dnl
dnl #######################################################################
dnl #######################################################################
dnl #######################################################################
# Declare some variables; use OMPI_VAR_SCOPE_END to ensure that they
# are cleaned up / undefined.
AC_DEFUN([OMPI_VAR_SCOPE_PUSH],[

Просмотреть файл

@ -10,6 +10,7 @@ dnl Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2006 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -306,6 +307,6 @@ AC_DEFUN([_OMPI_PROG_CC],[
AC_DEFINE_UNQUOTED(OMPI_CC, "$CC", [OMPI underlying C compiler])
set dummy $CC
ompi_cc_argv0=[$]2
OMPI_CC_ABSOLUTE="`which $ompi_cc_argv0`"
OMPI_WHICH([$ompi_cc_argv0], [OMPI_CC_ABSOLUTE])
AC_SUBST(OMPI_CC_ABSOLUTE)
])

Просмотреть файл

@ -12,6 +12,7 @@ dnl Copyright (c) 2004-2006 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -255,7 +256,7 @@ AC_DEFUN([_OMPI_PROG_CXX],[
AC_DEFINE_UNQUOTED(OMPI_CXX, "$CXX", [OMPI underlying C++ compiler])
set dummy $CXX
ompi_cxx_argv0=[$]2
OMPI_CXX_ABSOLUTE="`which $ompi_cxx_argv0`"
OMPI_WHICH([$ompi_cxx_argv0], [OMPI_CXX_ABSOLUTE])
AC_SUBST(OMPI_CXX_ABSOLUTE)
OMPI_CXX_COMPILER_VENDOR([ompi_cxx_vendor])

Просмотреть файл

@ -12,6 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2006 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -63,7 +64,7 @@ else
set dummy $OMPI_F77
OMPI_F77_ARGV0=[$]2
BASEF77="`basename $OMPI_F77_ARGV0`"
OMPI_F77_ABSOLUTE="`which $OMPI_F77_ARGV0`"
OMPI_WHICH([$OMPI_F77_ARGV0], [OMPI_F77_ABSOLUTE])
if test "$OMPI_WANT_F77_BINDINGS" = "0" ; then
AC_MSG_WARN([*** Fortran 77 bindings disabled by user])

Просмотреть файл

@ -12,6 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
@ -93,7 +94,7 @@ else
set dummy $OMPI_F90
OMPI_F90_ARGV0=[$]2
BASEF90="`basename $OMPI_F90_ARGV0`"
OMPI_F90_ABSOLUTE="`which $OMPI_F90_ARGV0`"
OMPI_WHICH([$OMPI_F90_ARGV0], [OMPI_F90_ABSOLUTE])
fi
fi
# make sure the compiler actually works, if not cross-compiling