1 # acc.m4 serial 1 (ucl-1.03)
2 # /***********************************************************************
3 # // standard ACC macros
4 # ************************************************************************/
6 AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
7 AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
10 AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
12 AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/mman.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
15 AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
16 AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown clock_getcpuclockid clock_getres clock_gettime ctime difftime fstat getenv getpagesize getrusage gettimeofday gmtime isatty localtime longjmp lstat memcmp memcpy memmove memset mkdir mktime mmap mprotect munmap qsort raise rmdir setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
20 AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
21 AC_CHECK_SIZEOF(short)
25 AC_CHECK_SIZEOF(long long)
26 AC_CHECK_SIZEOF(__int16)
27 AC_CHECK_SIZEOF(__int32)
28 AC_CHECK_SIZEOF(__int64)
30 AC_CHECK_SIZEOF(void *)
31 AC_CHECK_SIZEOF(char *)
32 AC_CHECK_SIZEOF(size_t)
33 AC_CHECK_SIZEOF(ptrdiff_t)
37 # /***********************************************************************
38 # // Check for ACC_conformance
39 # ************************************************************************/
41 AC_DEFUN([mfx_ACC_ACCCHK], [
43 mfx_save_CPPFLAGS=$CPPFLAGS
44 dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
45 test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
47 AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
49 AC_LANG_CONFTEST([AC_LANG_PROGRAM(
50 [[#define ACC_CONFIG_NO_HEADER 1
52 #include "acc/acc_incd.h"
54 #define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
55 #include "acc/acc_chk.ch"
57 static void test_acc_compile_time_assert(void) {
58 #define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
59 #include "acc/acc_chk.ch"
64 static int test_acc_run_time_assert(int r) {
65 #define ACCCHK_ASSERT(expr) assert(expr);
66 #include "acc/acc_chk.ch"
71 test_acc_compile_time_assert();
72 if (test_acc_run_time_assert(1) != 1) return 1;
77 _AC_COMPILE_IFELSE([], [mfx_tmp=yes])
78 rm -f conftest.$ac_ext conftest.$ac_objext
80 CPPFLAGS=$mfx_save_CPPFLAGS
82 AC_MSG_RESULT([$mfx_tmp])
87 AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
88 AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
89 AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
90 AC_MSG_NOTICE([Thanks for your support.])
92 AC_MSG_ERROR([ACC conformance test failed. Stop.])
99 # /***********************************************************************
100 # // Check for ACC_conformance
101 # ************************************************************************/
103 AC_DEFUN([mfx_MINIACC_ACCCHK], [
105 mfx_save_CPPFLAGS=$CPPFLAGS
106 dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
107 test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
109 AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
111 AC_LANG_CONFTEST([AC_LANG_PROGRAM(
112 [[#define ACC_CONFIG_NO_HEADER 1
113 #define ACC_WANT_ACC_INCD_H 1
116 #define ACC_WANT_ACC_CHK_CH 1
118 #define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
121 #define ACC_WANT_ACC_CHK_CH 1
123 #define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
124 static void test_acc_compile_time_assert(void) {
130 #define ACC_WANT_ACC_CHK_CH 1
132 #define ACCCHK_ASSERT(expr) assert(expr);
133 static int test_acc_run_time_assert(int r) {
138 test_acc_compile_time_assert();
139 if (test_acc_run_time_assert(1) != 1) return 1;
144 _AC_COMPILE_IFELSE([], [mfx_tmp=yes])
145 rm -f conftest.$ac_ext conftest.$ac_objext
147 CPPFLAGS=$mfx_save_CPPFLAGS
149 AC_MSG_RESULT([$mfx_tmp])
154 AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
155 AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
156 AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
157 AC_MSG_NOTICE([Thanks for your support.])
159 AC_MSG_ERROR([ACC conformance test failed. Stop.])
163 ])# mfx_MINIACC_ACCCHK