1
1

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.
Этот коммит содержится в:
Terry Dontje 2009-07-21 11:25:06 +00:00
родитель 9a369d0fc1
Коммит aae25346f5

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

@ -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 <stddef.h>
#include <stdio.h>
#include <stdlib.h>
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.])],