From aae25346f5e3a0fd1b87a4476e81265bd6efff18 Mon Sep 17 00:00:00 2001 From: Terry Dontje Date: Tue, 21 Jul 2009 11:25:06 +0000 Subject: [PATCH] Change test from using AC_TRY_RUN to using AC_RUN_IFELSE so we can automatically pick up stdint.h by using AC_INCLUDES_DEFAULT. This is needed for the types like int8_t which were added last week. This commit was SVN r21721. --- config/c_get_alignment.m4 | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/config/c_get_alignment.m4 b/config/c_get_alignment.m4 index 782612452f..2e28d54b4c 100644 --- a/config/c_get_alignment.m4 +++ b/config/c_get_alignment.m4 @@ -24,21 +24,16 @@ dnl AC_DEFUN([OMPI_C_GET_ALIGNMENT],[ AC_CACHE_CHECK([alignment of $1], [AS_TR_SH([ompi_cv_c_align_$1])], - [AC_TRY_RUN([ -#include -#include -#include -struct foo { char c; $1 x; }; -int main(int argc, char * argv[]) -{ + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], +[[ + struct foo { char c; $1 x; }; struct foo *p = (struct foo *) malloc(sizeof(struct foo)); int diff; FILE *f=fopen("conftestval", "w"); if (!f) exit(1); diff = ((char *)&p->x) - ((char *)&p->c); fprintf(f, "%d\n", (diff >= 0) ? diff : -diff); - return 0; -}], [AS_TR_SH([ompi_cv_c_align_$1])=`cat conftestval`], +]])], [AS_TR_SH([ompi_cv_c_align_$1])=`cat conftestval`], [AC_MSG_WARN([*** Problem running configure test!]) AC_MSG_WARN([*** See config.log for details.]) AC_MSG_ERROR([*** Cannot continue.])],