summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Slater <joe.slater@windriver.com>2014-09-15 16:13:09 -0500
committerMike Gorse <mgorse@suse.com>2014-09-15 16:13:09 -0500
commit9630b21558ef3d01f0f12cc8100d9fe5a9cb65ba (patch)
tree8dabb9ab05b37645bcb5b8df4c073ec63c90cbc9
parent06fc5f5fd387e039c32e8ea788aeac21798115aa (diff)
downloadat-spi2-core-9630b21558ef3d01f0f12cc8100d9fe5a9cb65ba.tar.gz
fix alignof m4 macro
DBIND_CHECK_ALIGNOF does not work when cross-compiling, so we modify it to use AC_CHECK_ALIGNOF.
-rw-r--r--acinclude.m452
1 files changed, 15 insertions, 37 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 6eb7916d..a4904ce2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -2,42 +2,20 @@
# type alignment test #
#######################
-AC_DEFUN([DBIND_CHECK_ALIGNOF],
- [changequote(<<, >>)dnl
- dnl The name to #define.
- define(<<AC_TYPE_NAME>>,
- translit(dbind_alignof_$1, [a-z *], [A-Z_P]))dnl
- dnl The cache variable name.
- define(<<AC_CV_NAME>>,
- translit(ac_cv_alignof_$1, [ *], [_p]))dnl
- changequote([, ])dnl
- AC_MSG_CHECKING(alignment of $1)
- AC_CACHE_VAL(AC_CV_NAME,
- [AC_TRY_RUN(
- [ #include <stdio.h>
- #include <stdlib.h>
- #define DBUS_API_SUBJECT_TO_CHANGE
- #include <dbus/dbus.h>
- typedef struct {char s1;} dbind_struct;
- typedef void *dbind_pointer;
- struct test {char s1; $1 s2;};
- main()
- {
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", &(((struct test*)0)->s2));
- exit(0);
- } ],
- AC_CV_NAME=`cat conftestval`,
- AC_CV_NAME=0, AC_CV_NAME=0)
- ])dnl
- AC_MSG_RESULT($AC_CV_NAME)
- if test "$AC_CV_NAME" = "0" ; then
- AC_MSG_ERROR([Failed to find alignment. Check config.log for details.])
- fi
- AC_TYPE_NAME=$AC_CV_NAME
- AC_SUBST(AC_TYPE_NAME)
- undefine([AC_TYPE_NAME])dnl
- undefine([AC_CV_NAME])dnl
+AC_DEFUN([DBIND_CHECK_ALIGNOF],[
+AC_CHECK_ALIGNOF($1,[
+#include <stdio.h>
+#include <stdlib.h>
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+typedef struct {char s1;} dbind_struct;
+typedef void *dbind_pointer;
+])
+
+dnl Note that we substitute for names like @DBIND_ALIGNOF_DBIND_STRUCT@, but
+dnl we #define names like ALIGNOF_DBIND_STRUCT in config.h!
+dnl
+AC_SUBST(translit(dbind_alignof_$1, [a-z *], [A-Z_P]),[$ac_cv_alignof_$1])
+
])