summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorMark Doffman <mdoff@altair-voyager.(none)>2009-06-11 19:11:08 +0100
committerMark Doffman <mdoff@altair-voyager.(none)>2009-06-11 19:11:08 +0100
commit4bf5d81af18769c2d81ce6b904c04ef4c52e72a1 (patch)
tree1f6d6ca075e7be36d924a3dd77e91c35e223d089 /m4
parenta41d247913d13949f259e89e4222753643af04aa (diff)
downloadat-spi2-core-4bf5d81af18769c2d81ce6b904c04ef4c52e72a1.tar.gz
2009-06-20 Mark Doffman <mark.doffman@codethink.co.uk>
Remove unneccessary code from spi-common. Move M4 macros to the m4 directory.
Diffstat (limited to 'm4')
-rw-r--r--m4/dbind.m443
1 files changed, 43 insertions, 0 deletions
diff --git a/m4/dbind.m4 b/m4/dbind.m4
new file mode 100644
index 00000000..6eb7916d
--- /dev/null
+++ b/m4/dbind.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
+])
+