diff options
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r-- | libgfortran/acinclude.m4 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index ebee89df856..87dc72283f9 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -83,3 +83,22 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN]) AC_DEFUN([AC_PROG_LD]) ]) +dnl Check whether the target is ILP32. +AC_DEFUN([LIBGFOR_TARGET_ILP32], [ + AC_CACHE_CHECK([whether the target is ILP32], target_ilp32, [ + save_CFLAGS="$CFLAGS" + CFLAGS="-O2" + AC_TRY_LINK(,[ +if (sizeof(int) == 4 && sizeof(long) == 4 && sizeof(void *) == 4) + ; +else + undefined_function (); + ], + target_ilp32=yes, + target_ilp32=no) + CFLAGS="$save_CFLAGS"]) + if test $target_ilp32 = yes; then + AC_DEFINE(TARGET_ILP32, 1, + [Define to 1 if the target is ILP32.]) + fi + ]) |