diff options
author | Mike Gorse <mgorse@novell.com> | 2010-10-26 10:41:15 -0400 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2010-10-26 10:41:15 -0400 |
commit | 516c2a8527776ff696c707b21e8e0d0362af52ef (patch) | |
tree | 5aa60c29e5610158bef2456c078c5fc95fcd50f3 | |
parent | b5710a7cfe8964d2a39fc3fdd44285dc2df8761d (diff) | |
download | at-spi2-core-516c2a8527776ff696c707b21e8e0d0362af52ef.tar.gz |
More fixes for dbind
-rw-r--r-- | acinclude.m4 | 43 | ||||
-rw-r--r-- | configure.ac | 13 |
2 files changed, 56 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 00000000..6eb7916d --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,43 @@ +####################### +# 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 +]) + diff --git a/configure.ac b/configure.ac index 4b49b4ae..7100a414 100644 --- a/configure.ac +++ b/configure.ac @@ -175,6 +175,19 @@ fi AM_CONDITIONAL(RELOCATE, test x$enable_relocate = xyes) AC_SUBST(enable_relocate) +dnl find sizes & alignments +orig_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS" +DBIND_CHECK_ALIGNOF(char) +DBIND_CHECK_ALIGNOF(dbus_bool_t) +DBIND_CHECK_ALIGNOF(dbus_int16_t) +DBIND_CHECK_ALIGNOF(dbus_int32_t) +DBIND_CHECK_ALIGNOF(dbus_int64_t) +DBIND_CHECK_ALIGNOF(double) +DBIND_CHECK_ALIGNOF(dbind_pointer) +DBIND_CHECK_ALIGNOF(dbind_struct) + +CPPFLAGS=$orig_CPPFLAGS AC_CONFIG_FILES([Makefile xml/Makefile dbind/Makefile |