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.])],