diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2011-05-17 04:34:53 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-05-17 04:38:56 +0300 |
commit | f85118caecec67bf6c6b83b06adac055441fd2a5 (patch) | |
tree | 0377a615de78833a80245a96ab1a37c0cdaee32b /configure.in | |
parent | 84fbaed77de78c37ddae2da17f182aa148ef5776 (diff) |
Allow for lack of AC_CHECK_ALIGNOF unless cross-compiling
The Autoconf 2.59 on Mac OS X 10.4 for instance lacks
AC_CHECK_ALIGNOF.
This means we can't get rid of the typesconfig program in
sal/typesconfig until we can require a newer Autoconf.
Also correct the hardcoded alignments for MSVC. (Not that they get
used; As we are not cross-compiling with MSVC we will run the
typesconfig program for it.)
Diffstat (limited to 'configure.in')
-rwxr-xr-x | configure.in | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/configure.in b/configure.in index 5b652d213c4e..36ea2759a9bf 100755 --- a/configure.in +++ b/configure.in @@ -2463,10 +2463,6 @@ dnl =================================================================== AC_CHECK_SIZEOF(long long) AC_CHECK_SIZEOF(double) AC_CHECK_SIZEOF(void*) - AC_CHECK_ALIGNOF(short) - AC_CHECK_ALIGNOF(int) - AC_CHECK_ALIGNOF(long) - AC_CHECK_ALIGNOF(double) SIZEOF_SHORT=$ac_cv_sizeof_short SIZEOF_INT=$ac_cv_sizeof_int @@ -2475,6 +2471,28 @@ dnl =================================================================== SIZEOF_DOUBLE=$ac_cv_sizeof_double SIZEOF_POINTER=$ac_cv_sizeof_voidp + dnl Allow build without AC_CHECK_ALIGNOF, grrr + m4_pattern_allow([AC_CHECK_ALIGNOF]) + m4_ifdef([AC_CHECK_ALIGNOF], + , + [ + dnl We know that the ALIGNOF_ variables are used only when cross-compiling + dnl in sal/typesconfig/makefile.mk... + if test "$cross_compiling" = "yes"; then + AC_MSG_ERROR([When cross-compiling you must use a recent Autoconf with [AC_][CHECK_ALIGNOF]]) + fi + m4_define([AC_CHECK_ALIGNOF], + [ + AC_MSG_WARN([Cannot determine alignment of $1]) + AS_TR_SH([ac_cv_alignof_$3])=unknown + ]) + ]) + + AC_CHECK_ALIGNOF(short,[#include <stddef.h>]) + AC_CHECK_ALIGNOF(int,[#include <stddef.h>]) + AC_CHECK_ALIGNOF(long,[#include <stddef.h>]) + AC_CHECK_ALIGNOF(double,[#include <stddef.h>]) + ALIGNOF_SHORT=$ac_cv_alignof_short ALIGNOF_INT=$ac_cv_alignof_int ALIGNOF_LONG=$ac_cv_alignof_long @@ -2502,10 +2520,10 @@ else else SIZEOF_POINTER=8 fi - ALIGNOF_SHORT=1 - ALIGNOF_INT=1 - ALIGNOF_LONG=1 - ALIGNOF_DOUBLE=1 + ALIGNOF_SHORT=2 + ALIGNOF_INT=4 + ALIGNOF_LONG=4 + ALIGNOF_DOUBLE=8 WORDS_BIGENDIAN=no LFS_CFLAGS='' fi |