Excellent -- many thanks Ralf!

One very minor question: I notice you added silent-rules to AM_INIT_AUTOMAKE 
(and bumped the required version, too), but still left in the call to 
AM_SILENT_RULES:

-AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.10 tar-ustar])
+AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.10c 
silent-rules tar-ustar])

# If Automake supports silent rules, enable them.
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

Is the call to AM_SILENT_RULES now moot because it's listed in AM_INIT_AUTOMAKE?


On Sep 23, 2010, at 1:12 AM, Ralf Wildenhues wrote:

> Hello OpenMPI developers,
> 
> just-released Autoconf 2.68 contains more stringent checks and warnings
> about stuff passed to AC_{COMPILE,LINK,RUN}_IFELSE and AC_TRY_* macros.
> Specifically, it will warn if C or C++ programs are not generated with
> AC_LANG_SOURCE or AC_LANG_PROGRAM, in order to avoid accidentally
> omitting needed headers, or mess up arguments in some way.  This has
> happened a few times to Autoconf users.
> 
> These checks make more stringent assumptions on correct m4 quoting of
> macros; IOW, there are mis-quotings which will cause false warnings to
> be emitted.
> 
> In cases where generating sources without AC_LANG_SOURCE or
> AC_LANG_PROGRAM is done intentionally, the macro
> AC_LANG_DEFINES_PROVIDED should be expanded inside the source.
> 
> The patch below silences all warnings.  I've used
> AC_LANG_DEFINES_PROVIDED a couple of times in
> config/ompi_check_vendor.m4, assuming that the tests are really meant
> to not include any headers.  In a couple of other cases, esp in
> opal/mca/if/windows/configure.m4 and
> opal/mca/installdirs/windows/configure.m4, I've added the default
> include headers, assuming that they should not hurt.
> 
> I've tested the patch with Autoconf 2.68 as well as Autoconf 2.67 on
> GNU/Linux, but done no other testing.
> 
> For complete absence of warnings from Autoconf 2.68 you will also need
> to update the Libtool macros from upcoming 2.4.0.
> 
> Cheers,
> Ralf
> 
> Index: opal/mca/installdirs/windows/configure.m4
> ===================================================================
> --- opal/mca/installdirs/windows/configure.m4 (revision 23790)
> +++ opal/mca/installdirs/windows/configure.m4 (working copy)
> @@ -27,18 +27,20 @@
>     # registry. We should first check that the function is defined,
>     # and then check for it's presence in the kernel32 library.
>     AC_MSG_CHECKING(for working RegOpenKeyEx)
> -    AC_TRY_RUN( [#include <windows.h>
> +    AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
> +#include <windows.h>], [
> int main( int argc, char** argv ) {
>     RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Open MPI", 0, KEY_READ, NULL);
> -    return 0; }],
> +    return 0; }])],
>         [AC_MSG_RESULT([yes])
>          $1],
>         [AC_MSG_RESULT([no])
>          $2],
> -        [AC_COMPILE_IFELSE([#include <windows.h>
> +        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
> +#include <windows.h>], [
> int main( int argc, char** argv ) {
>     RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Open MPI", 0, KEY_READ, NULL);
> -    return 0; }],
> +    return 0; }])],
>         [AC_MSG_RESULT([yes])
>          $1],
>         [AC_MSG_RESULT([no])
> Index: opal/mca/paffinity/hwloc/hwloc/config/hwloc.m4
> ===================================================================
> --- opal/mca/paffinity/hwloc/hwloc/config/hwloc.m4    (revision 23790)
> +++ opal/mca/paffinity/hwloc/hwloc/config/hwloc.m4    (working copy)
> @@ -430,13 +430,13 @@
> 
>     _HWLOC_CHECK_DECL([sched_setaffinity], [
>       AC_MSG_CHECKING([for old prototype of sched_setaffinity])
> -      AC_COMPILE_IFELSE(
> +      AC_COMPILE_IFELSE([
>         AC_LANG_PROGRAM([[
>           #define _GNU_SOURCE
>           #include <sched.h>
>           static unsigned long mask;
>           ]], [[ sched_setaffinity(0, (void*) &mask);
> -          ]]),
> +          ]])],
>         AC_DEFINE([HWLOC_HAVE_OLD_SCHED_SETAFFINITY], [1], [Define to 1 if 
> glibc provides the old prototype of sched_setaffinity()])
>         AC_MSG_RESULT([yes]),
>         AC_MSG_RESULT([no])
> @@ -447,19 +447,19 @@
> ]])
> 
>     AC_MSG_CHECKING([for working CPU_SET])
> -    AC_LINK_IFELSE(
> +    AC_LINK_IFELSE([
>       AC_LANG_PROGRAM([[
>         #include <sched.h>
>         cpu_set_t set;
>         ]], [[ CPU_ZERO(&set); CPU_SET(0, &set);
> -        ]]),
> +        ]])],
>         AC_DEFINE([HWLOC_HAVE_CPU_SET], [1], [Define to 1 if the CPU_SET 
> macro works])
>         AC_MSG_RESULT([yes]),
>         AC_MSG_RESULT([no])
>     )
> 
>     AC_MSG_CHECKING([for working CPU_SET_S])
> -    AC_LINK_IFELSE(
> +    AC_LINK_IFELSE([
>       AC_LANG_PROGRAM([[
>           #include <sched.h>
>           cpu_set_t *set;
> @@ -468,7 +468,7 @@
>           CPU_ZERO_S(CPU_ALLOC_SIZE(1024), set);
>           CPU_SET_S(CPU_ALLOC_SIZE(1024), 0, set);
>           CPU_FREE(set);
> -        ]]),
> +        ]])],
>         AC_DEFINE([HWLOC_HAVE_CPU_SET_S], [1], [Define to 1 if the CPU_SET_S 
> macro works])
>         AC_MSG_RESULT([yes]),
>         AC_MSG_RESULT([no])
> @@ -570,7 +570,7 @@
>     AC_MSG_CHECKING([for cpuid])
>     old_CPPFLAGS="$CPPFLAGS"
>     CFLAGS="$CFLAGS -I$HWLOC_top_srcdir/include"
> -    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
> +    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
>         #include <stdio.h>
>         #include <private/cpuid.h>
>       ]], [[
> @@ -580,7 +580,7 @@
>           printf("highest cpuid %x\n", eax);
>           return 0;
>         }
> -      ]]), [
> +      ]])], [
>       AC_MSG_RESULT([yes])
>       AC_DEFINE(HWLOC_HAVE_CPUID, 1, [Define to 1 if you have cpuid])
>       hwloc_have_cpuid=yes
> Index: opal/mca/if/windows/configure.m4
> ===================================================================
> --- opal/mca/if/windows/configure.m4  (revision 23790)
> +++ opal/mca/if/windows/configure.m4  (working copy)
> @@ -27,21 +27,23 @@
>     # registry. We should first check that the function is defined,
>     # and then check for it's presence in the kernel32 library.
>     AC_MSG_CHECKING([for working RegOpenKeyEx])
> -    AC_TRY_RUN( [#include <windows.h>
> +    AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
> +#include <windows.h>], [
> int main( int argc, char** argv ) {
>     RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Open MPI", 0, KEY_READ, NULL);
> -    return 0; }],
> +    return 0; }])],
>         [AC_MSG_RESULT([yes])
>          $1],
>         [AC_MSG_RESULT([no])
>          $2],
> -        [AC_COMPILE_IFELSE([#include <windows.h>
> +        [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
> +#include <windows.h>], [
> int main( int argc, char** argv ) {
>     RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Open MPI", 0, KEY_READ, NULL);
> -    return 0; }],
> +    return 0; }])],
>         [AC_MSG_RESULT([yes])
>          $1],
>         [AC_MSG_RESULT([no])
>          $2])])
> -])dnl
> +])])dnl
> 
> Index: opal/mca/memchecker/valgrind/configure.m4
> ===================================================================
> --- opal/mca/memchecker/valgrind/configure.m4 (revision 23790)
> +++ opal/mca/memchecker/valgrind/configure.m4 (working copy)
> @@ -42,11 +42,11 @@
>                   opal_memchecker_valgrind_save_CPPFLAGS=$CPPFLAGS])
>            AC_CHECK_HEADERS([valgrind/valgrind.h], 
>                  [AC_MSG_CHECKING([for VALGRIND_CHECK_MEM_IS_ADDRESSABLE])
> -                  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
> +                  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> #include "valgrind/memcheck.h"
> ]],
>                      [[char buffer = 0xff;
> -                       VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&buffer, 
> sizeof(buffer));]]),
> +                       VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&buffer, 
> sizeof(buffer));]])],
>                      [AC_MSG_RESULT([yes])
>                       opal_memchecker_valgrind_happy=yes],
>                      [AC_MSG_RESULT([no])
> Index: opal/config/opal_setup_libevent.m4
> ===================================================================
> --- opal/config/opal_setup_libevent.m4        (revision 23790)
> +++ opal/config/opal_setup_libevent.m4        (working copy)
> @@ -198,26 +198,26 @@
> 
>         haveepoll=no
>         AC_MSG_CHECKING([for working epoll library interface])
> -        AC_RUN_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT
> +        AC_RUN_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT[
> #include <sys/epoll.h>]],
> [[
>     struct epoll_event epevin;
>     struct epoll_event epevout;
>     int res;
>     int epfd;
> -    int fildes[[2]];
> +    int fildes[2];
> 
>     if ((epfd = epoll_create(1)) == -1)
>         exit(1);
> -    if (pipe(&fildes[[0]]) < 0)
> +    if (pipe(&fildes[0]) < 0)
>         exit(1);
>     memset(&epevin, 0, sizeof(epevin));
>     memset(&epevout, 0, sizeof(epevout));
>     memset(&epevin.data.ptr, 5, sizeof(epevin.data.ptr));
>     epevin.events = EPOLLIN | EPOLLOUT;
> 
> -    if (epoll_ctl(epfd, EPOLL_CTL_ADD, fildes[[1]], &epevin) == -1)
> +    if (epoll_ctl(epfd, EPOLL_CTL_ADD, fildes[1], &epevin) == -1)
>         exit(1);
> 
>     res = epoll_wait(epfd, &epevout, 1, 0);
> @@ -229,7 +229,7 @@
>         }
>     }
>     /* SUCCESS */
> -]]),
> +]])],
>         [haveepoll=yes
>         AC_DEFINE(HAVE_EPOLL, 1,
>                  [Define if your system supports the epoll interface])
> @@ -244,8 +244,8 @@
>         # OMPI: See comment above.  This test uses the epoll system call
>         # interface instead of the library interface.
>         AC_MSG_CHECKING(for working epoll system call)
> -        AC_RUN_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT
> +        AC_RUN_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT[
> #include <sys/syscall.h>
> #include <sys/epoll.h>]],
> [[  
> @@ -253,11 +253,11 @@
>     struct epoll_event epevout;
>     int res;
>     int epfd;
> -    int fildes[[2]];
> +    int fildes[2];
> 
>     if ((epfd = syscall(__NR_epoll_create, 1)) == -1)
>         exit(1);
> -    if (pipe(&fildes[[0]]) < 0)
> +    if (pipe(&fildes[0]) < 0)
>         exit(1);
>     memset(&epevin, 0, sizeof(epevin));
>     memset(&epevout, 0, sizeof(epevout));
> @@ -265,7 +265,7 @@
>     epevin.events = EPOLLIN | EPOLLOUT;
> 
>     if (syscall(__NR_epoll_ctl, epfd, 
> -        EPOLL_CTL_ADD, fildes[[1]], &epevin) == -1)
> +        EPOLL_CTL_ADD, fildes[1], &epevin) == -1)
>         exit(1);
> 
>     res = syscall(__NR_epoll_wait, epfd, &epevout, 1, 0);
> @@ -277,7 +277,7 @@
>         }
>     }
>     /* SUCCESS */
> -]]),
> +]])],
>         [haveepollsyscall=yes
>         AC_DEFINE(HAVE_EPOLL, 1,
>                  [Define if your system supports the epoll interface])
> @@ -313,7 +313,7 @@
>     esac
>       if test "x$havekqueue" = "xyes" ; then
>               AC_MSG_CHECKING(for working kqueue)
> -             AC_TRY_RUN(
> +             AC_TRY_RUN([
> #include <sys/types.h>
> #include <sys/time.h>
> #include <sys/event.h>
> @@ -327,30 +327,30 @@
> {
>       int kq;
>       int n;
> -     int fd[[2]];
> +     int fd[2];
>       struct kevent ev;
>       struct timespec ts;
> -     char buf[[8000]];
> +     char buf[8000];
> 
>       if (pipe(fd) == -1)
>               exit(1);
> -     if (fcntl(fd[[1]], F_SETFL, O_NONBLOCK) == -1)
> +     if (fcntl(fd[1], F_SETFL, O_NONBLOCK) == -1)
>               exit(1);
> 
> -     while ((n = write(fd[[1]], buf, sizeof(buf))) == sizeof(buf))
> +     while ((n = write(fd[1], buf, sizeof(buf))) == sizeof(buf))
>               ;
> 
>         if ((kq = kqueue()) == -1)
>               exit(1);
> 
> -     ev.ident = fd[[1]];
> +     ev.ident = fd[1];
>       ev.filter = EVFILT_WRITE;
>       ev.flags = EV_ADD | EV_ENABLE;
>       n = kevent(kq, &ev, 1, NULL, 0, NULL);
>       if (n == -1)
>               exit(1);
>       
> -     read(fd[[0]], buf, sizeof(buf));
> +     read(fd[0], buf, sizeof(buf));
> 
>       ts.tv_sec = 0;
>       ts.tv_nsec = 0;
> @@ -359,7 +359,7 @@
>               exit(1);
> 
>       exit(0);
> -}, [AC_MSG_RESULT(yes)
> +}], [AC_MSG_RESULT(yes)
>     AC_DEFINE(HAVE_WORKING_KQUEUE, 1,
>               [Define if kqueue works correctly with pipes])
>     sources="kqueue.c $sources"], [AC_MSG_RESULT(no)], [AC_MSG_RESULT(no)])
> Index: opal/config/opal_config_asm.m4
> ===================================================================
> --- opal/config/opal_config_asm.m4    (revision 23790)
> +++ opal/config/opal_config_asm.m4    (working copy)
> @@ -585,11 +585,11 @@
>                 ;;
>             *)
>                 if test ! "$assembly" = "" ; then
> -                        AC_RUN_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT]],
> +                        AC_RUN_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT],
> [[int ret = 1;
> __asm__ __volatile__ ($assembly);
> -return ret;]]),
> +return ret;]])],
>                     [asm_result="yes"], [asm_result="no"], 
>                     [asm_result="unknown"])
>                 else
> @@ -600,11 +600,11 @@
> 
>         # if we're cross compiling, just try to compile and figure good enough
>         if test "$asm_result" = "unknown" ; then
> -            AC_LINK_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT]],
> +            AC_LINK_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT],
> [[int ret = 1;
> __asm__ __volatile__ ($assembly);
> -return ret;]]),
> +return ret;]])],
>             [asm_result="yes"], [asm_result="no"])
>         fi
>     fi
> @@ -639,11 +639,11 @@
>             ;;
>         *)
>             if test ! "$assembly" = "" ; then
> -            AC_RUN_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT]],
> +            AC_RUN_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT],
> [[int ret = 1;
> __asm__ __volatile__ ($assembly);
> -return ret;]]),
> +return ret;]])],
>                     [asm_result="yes"], [asm_result="no"], 
>                     [asm_result="unknown"])
>             else
> @@ -653,11 +653,11 @@
>     esac
>     # if we're cross compiling, just try to compile and figure good enough
>     if test "$asm_result" = "unknown" ; then
> -        AC_LINK_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT]],
> +        AC_LINK_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT],
> [[int ret = 1;
> __asm__ __volatile__ ($assembly);
> -return ret;]]),
> +return ret;]])],
>             [asm_result="yes"], [asm_result="no"])
>     fi
> 
> @@ -690,11 +690,11 @@
> 
>     AC_MSG_CHECKING([if $CC supports DEC inline assembly])
> 
> -    AC_LINK_IFELSE(AC_LANG_PROGRAM([[
> +    AC_LINK_IFELSE([AC_LANG_PROGRAM([
> AC_INCLUDES_DEFAULT
> -#include <c_asm.h>]],
> +#include <c_asm.h>],
> [[asm("");
> -return 0;]]),
> +return 0;]])],
>         [asm_result="yes"], [asm_result="no"])
> 
>     AC_MSG_RESULT([$asm_result])
> @@ -717,11 +717,11 @@
>     AC_LANG_PUSH([C++])
>     AC_MSG_CHECKING([if $CXX supports DEC inline assembly])
> 
> -    AC_LINK_IFELSE(AC_LANG_PROGRAM([[
> +    AC_LINK_IFELSE([AC_LANG_PROGRAM([
> AC_INCLUDES_DEFAULT
> -#include <c_asm.h>]],
> +#include <c_asm.h>],
> [[asm("");
> -return 0;]]),
> +return 0;]])],
>         [asm_result="yes"], [asm_result="no"])
> 
>     AC_MSG_RESULT([$asm_result])
> Index: opal/config/opal_check_offsetof.m4
> ===================================================================
> --- opal/config/opal_check_offsetof.m4        (revision 23790)
> +++ opal/config/opal_check_offsetof.m4        (working copy)
> @@ -21,13 +21,13 @@
>     OMPI_VAR_SCOPE_PUSH([have_offsetof_msg])
> 
>     AC_MSG_CHECKING(for functional offsetof macro)
> -    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include<stddef.h>]],
> -                                      [[struct foo {int a, b;}; size_t 
> offset = offsetof(struct foo, b); ]]),
> +    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include<stddef.h>]],
> +                                      [[struct foo {int a, b;}; size_t 
> offset = offsetof(struct foo, b); ]])],
>                       [have_offsetof_msg="yes"], [have_offsetof_msg="no"])
>     if test "$have_offsetof_msg" = "no"; then
>         CPPFLAGS="$CPPFLAGS -DNO_PGI_OFFSET"
> -        AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include<stddef.h>]],
> -                                          [[struct foo {int a, b;}; size_t 
> offset = offsetof(struct foo, b); ]]),
> +        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include<stddef.h>]],
> +                                          [[struct foo {int a, b;}; size_t 
> offset = offsetof(struct foo, b); ]])],
>                           [have_offsetof_msg="yes"], [have_offsetof_msg="no"])
> 
>         if test "$have_offsetof_msg" = "no"; then
> Index: configure.ac
> ===================================================================
> --- configure.ac      (revision 23790)
> +++ configure.ac      (working copy)
> @@ -82,7 +82,7 @@
> #
> # Init automake
> #
> -AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.10 
> tar-ustar])
> +AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.10c 
> silent-rules tar-ustar])
> 
> # If Automake supports silent rules, enable them.
> m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
> @@ -409,9 +409,9 @@
> #
> 
> AC_MSG_CHECKING(for C bool type)
> -AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT]],
> -[[bool bar, foo = true; bar = foo;]]),
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT],
> +[[bool bar, foo = true; bar = foo;]])],
> [OPAL_NEED_C_BOOL=0 MSG=yes],[OPAL_NEED_C_BOOL=1 MSG=no])
> AC_DEFINE_UNQUOTED(OPAL_NEED_C_BOOL, $OPAL_NEED_C_BOOL,
>     [Whether the C compiler supports "bool" without any other help (such as 
> <stdbool.h>)])
> @@ -594,12 +594,12 @@
> AC_CHECK_HEADERS([stdbool.h], [have_stdbool_h=1], [have_stdbool_h=0])
> AC_MSG_CHECKING([if <stdbool.h> works])
> if test "$have_stdbool_h" = "1"; then
> -    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
> -AC_INCLUDES_DEFAULT
> +    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
> +AC_INCLUDES_DEFAULT[
> #if HAVE_STDBOOL_H
> #include <stdbool.h>
> #endif]],
> -[[bool bar, foo = true; bar = foo;]]),
> +[[bool bar, foo = true; bar = foo;]])],
> [OPAL_USE_STDBOOL_H=1 MSG=yes],[OPAL_USE_STDBOOL_H=0 MSG=no])
> else
>     OPAL_USE_STDBOOL_H=0
> Index: ompi/config/ompi_setup_f90.m4
> ===================================================================
> --- ompi/config/ompi_setup_f90.m4     (revision 23790)
> +++ ompi/config/ompi_setup_f90.m4     (working copy)
> @@ -197,8 +197,8 @@
> else
>     FCFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
>     AC_LANG_PUSH(Fortran)
> -    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [[ INTEGER I
> - I = 3]]),
> +    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ INTEGER I
> + I = 3]])],
>                       [AC_MSG_RESULT([yes])],
>                       [AC_MSG_RESULT([no])
>                        AC_MSG_WARN([C++ exception flags are different between 
> the C and C++ compilers; this configure script cannot currently handle this 
> scenario.  Either disable C++ exception support or send mail to the Open MPI 
> users list.])
> Index: ompi/config/cxx_have_exceptions.m4
> ===================================================================
> --- ompi/config/cxx_have_exceptions.m4        (revision 23790)
> +++ ompi/config/cxx_have_exceptions.m4        (working copy)
> @@ -32,7 +32,7 @@
> AC_MSG_CHECKING([for throw/catch])
> AC_LANG_SAVE
> AC_LANG_CPLUSPLUS
> -AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]]), 
> +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int i=1; throw(i);]])], 
>     OMPI_CXX_EXCEPTIONS=1, OMPI_CXX_EXCPTIONS=0)
> if test "$OMPI_CXX_EXCEPTIONS" = "1"; then
>     AC_MSG_RESULT([yes])
> Index: ompi/config/ompi_setup_cxx.m4
> ===================================================================
> --- ompi/config/ompi_setup_cxx.m4     (revision 23790)
> +++ ompi/config/ompi_setup_cxx.m4     (working copy)
> @@ -329,7 +329,7 @@
>             CFLAGS="$CFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
>             AC_LANG_SAVE
>             AC_LANG_C
> -            AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[int i = 0;]]),
> +            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int i = 0;]])],
>                               [AC_MSG_RESULT([yes])],
>                               [AC_MSG_RESULT([no])
>                                AC_MSG_WARN([C++ exception flags are different 
> between the C and C++ compilers; this configure script cannot currently 
> handle this scenario.  Either disable C++ exception support or send mail to 
> the Open MPI users list.])
> Index: ompi/config/ompi_setup_f77.m4
> ===================================================================
> --- ompi/config/ompi_setup_f77.m4     (revision 23790)
> +++ ompi/config/ompi_setup_f77.m4     (working copy)
> @@ -134,8 +134,8 @@
> else
>     FFLAGS="$FFLAGS $OMPI_CXX_EXCEPTIONS_CXXFLAGS"
>     AC_LANG_PUSH(Fortran 77)
> -    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([], [[        INTEGER I
> -        I = 3]]),
> +    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[        INTEGER I
> +        I = 3]])],
>                       [AC_MSG_RESULT([yes])],
>                       [AC_MSG_RESULT([no])
>                        AC_MSG_WARN([C++ exception flags are different between 
> the C and C++ compilers; this configure script cannot currently handle this 
> scenario.  Either disable C++ exception support or send mail to the Open MPI 
> users list.])
> Index: ompi/config/f77_get_fortran_handle_max.m4
> ===================================================================
> --- ompi/config/f77_get_fortran_handle_max.m4 (revision 23790)
> +++ ompi/config/f77_get_fortran_handle_max.m4 (working copy)
> @@ -44,13 +44,13 @@
>          # Get INT_MAX.  Compute a SWAG if we are cross compiling or something
>          # goes wrong.
>          rm -f conftest.out >/dev/null 2>&1
> -         AC_RUN_IFELSE(AC_LANG_PROGRAM([[
> +         AC_RUN_IFELSE([AC_LANG_PROGRAM([[
> #include <stdio.h>
> #include <limits.h>
> ]],[[FILE *fp = fopen("conftest.out", "w");
> long cint = INT_MAX;
> fprintf(fp, "%ld", cint);
> -fclose(fp);]]), 
> +fclose(fp);]])], 
>              [ompi_cint_max=`cat conftest.out`], 
>              [ompi_cint_max=0],
>              [ #cross compiling is fun.  compute INT_MAX same as INTEGER max
> Index: ompi/config/cxx_find_exception_flags.m4
> ===================================================================
> --- ompi/config/cxx_find_exception_flags.m4   (revision 23790)
> +++ ompi/config/cxx_find_exception_flags.m4   (working copy)
> @@ -58,13 +58,13 @@
> 
>     AC_LANG_SAVE
>     AC_LANG_CPLUSPLUS
> -    AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) 
> { int j = 2; }]]), ompi_happy=1, ompi_happy=0)
> +    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) 
> { int j = 2; }]])], ompi_happy=1, ompi_happy=0)
> 
>     if test "$ompi_happy" = "1"; then
>       ompi_exflags="-fexceptions";
>     else
>       CXXFLAGS="$CXXFLAGS_SAVE -fhandle-exceptions"
> -     AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[]], [[try { int i = 0; } catch(...) 
> { int j = 2; }]]), ompi_happy=1, ompi_happy=0)
> +     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[try { int i = 0; } 
> catch(...) { int j = 2; }]])], ompi_happy=1, ompi_happy=0)
>       if test "$ompi_happy" = "1"; then
>           ompi_exflags="-fhandle-exceptions";
>       fi
> Index: config/ompi_check_vendor.m4
> ===================================================================
> --- config/ompi_check_vendor.m4       (revision 23790)
> +++ config/ompi_check_vendor.m4       (working copy)
> @@ -57,6 +57,9 @@
>     $1="$ompi_cv_c_compiler_vendor"
> ])
> 
> +# workaround to avoid syntax error with Autoconf < 2.68:
> +m4_ifndef([AC_LANG_DEFINES_PROVIDED],
> +       [m4_define([AC_LANG_DEFINES_PROVIDED])])
> 
> # OMPI_IFDEF_IFELSE(symbol, [action-if-defined], 
> #                   [action-if-not-defined])
> @@ -64,7 +67,8 @@
> # Run compiler to determine if preprocessor symbol "symbol" is
> # defined by the compiler.
> AC_DEFUN([OMPI_IFDEF_IFELSE], [
> -    AC_COMPILE_IFELSE([#ifndef $1
> +    AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
> +#ifndef $1
> #error "symbol $1 not defined"
> choke me
> #endif], [$2], [$3])])
> @@ -76,7 +80,8 @@
> # Run compiler to determine if preprocessor symbol "symbol" is
> # defined by the compiler.
> AC_DEFUN([OMPI_IF_IFELSE], [
> -    AC_COMPILE_IFELSE([#if !( $1 )
> +    AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED
> +#if !( $1 )
> #error "condition $1 not met"
> choke me
> #endif], [$2], [$3])])
> _______________________________________________
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to