4 +# /***********************************************************************
5 +# // standard ACC macros
6 +# ************************************************************************/
8 +AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
9 +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.])])
12 +AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
14 +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])
17 +AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
18 +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)
22 +AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
23 +AC_CHECK_SIZEOF(short)
25 +AC_CHECK_SIZEOF(long)
27 +AC_CHECK_SIZEOF(long long)
28 +AC_CHECK_SIZEOF(__int16)
29 +AC_CHECK_SIZEOF(__int32)
30 +AC_CHECK_SIZEOF(__int64)
32 +AC_CHECK_SIZEOF(void *)
33 +AC_CHECK_SIZEOF(char *)
34 +AC_CHECK_SIZEOF(size_t)
35 +AC_CHECK_SIZEOF(ptrdiff_t)
39 +# /***********************************************************************
40 +# // Check for ACC_conformance
41 +# ************************************************************************/
43 +AC_DEFUN([mfx_ACC_ACCCHK], [
45 +mfx_save_CPPFLAGS=$CPPFLAGS
46 +dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
47 +test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
49 +AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
51 +AC_LANG_CONFTEST([AC_LANG_PROGRAM(
52 +[[#define ACC_CONFIG_NO_HEADER 1
54 +#include "acc/acc_incd.h"
56 +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
57 +#include "acc/acc_chk.ch"
59 +static void test_acc_compile_time_assert(void) {
60 +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
61 +#include "acc/acc_chk.ch"
66 +static int test_acc_run_time_assert(int r) {
67 +#define ACCCHK_ASSERT(expr) assert(expr);
68 +#include "acc/acc_chk.ch"
73 +test_acc_compile_time_assert();
74 +if (test_acc_run_time_assert(1) != 1) return 1;
79 +_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
80 +rm -f conftest.$ac_ext conftest.$ac_objext
82 +CPPFLAGS=$mfx_save_CPPFLAGS
84 +AC_MSG_RESULT([$mfx_tmp])
89 + AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
90 + AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
91 + AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
92 + AC_MSG_NOTICE([Thanks for your support.])
94 + AC_MSG_ERROR([ACC conformance test failed. Stop.])
101 +# /***********************************************************************
102 +# // Check for ACC_conformance
103 +# ************************************************************************/
105 +AC_DEFUN([mfx_MINIACC_ACCCHK], [
107 +mfx_save_CPPFLAGS=$CPPFLAGS
108 +dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
109 +test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
111 +AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
113 +AC_LANG_CONFTEST([AC_LANG_PROGRAM(
114 +[[#define ACC_CONFIG_NO_HEADER 1
115 +#define ACC_WANT_ACC_INCD_H 1
118 +#define ACC_WANT_ACC_CHK_CH 1
119 +#undef ACCCHK_ASSERT
120 +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
123 +#define ACC_WANT_ACC_CHK_CH 1
124 +#undef ACCCHK_ASSERT
125 +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
126 +static void test_acc_compile_time_assert(void) {
132 +#define ACC_WANT_ACC_CHK_CH 1
133 +#undef ACCCHK_ASSERT
134 +#define ACCCHK_ASSERT(expr) assert(expr);
135 +static int test_acc_run_time_assert(int r) {
140 +test_acc_compile_time_assert();
141 +if (test_acc_run_time_assert(1) != 1) return 1;
146 +_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
147 +rm -f conftest.$ac_ext conftest.$ac_objext
149 +CPPFLAGS=$mfx_save_CPPFLAGS
151 +AC_MSG_RESULT([$mfx_tmp])
156 + AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
157 + AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
158 + AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
159 + AC_MSG_NOTICE([Thanks for your support.])
161 + AC_MSG_ERROR([ACC conformance test failed. Stop.])
165 +])# mfx_MINIACC_ACCCHK
171 +AC_DEFUN([mfx_PROG_CPPFLAGS], [
172 +AC_MSG_CHECKING([whether the C preprocessor needs special flags])
174 +AC_LANG_CONFTEST([AC_LANG_PROGRAM(
175 +[[#include <limits.h>
176 +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
177 +# include "your C preprocessor is broken 1"
178 +#elif (0xffffu == 0xfffffffful)
179 +# include "your C preprocessor is broken 2"
180 +#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
181 +# include "your C preprocessor is broken 3"
186 +mfx_save_CPPFLAGS=$CPPFLAGS
188 +for mfx_arg in "" -no-cpp-precomp
190 + CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
191 + _AC_COMPILE_IFELSE([],
195 +CPPFLAGS=$mfx_save_CPPFLAGS
196 +rm -f conftest.$ac_ext conftest.$ac_objext
199 + AC_MSG_RESULT([none needed]) ;;
201 + AC_MSG_RESULT([ERROR])
202 + AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
205 + AC_MSG_RESULT([$mfx_tmp])
206 + CPPFLAGS="$mfx_tmp $CPPFLAGS"
209 +])# mfx_PROG_CPPFLAGS
213 +AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
214 +AC_CACHE_CHECK([whether limits.h is sane],
215 +mfx_cv_header_sane_limits_h,
216 +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
217 +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
218 +# if defined(__APPLE__) && defined(__GNUC__)
219 +# error "your preprocessor is broken - use compiler option -no-cpp-precomp"
221 +# include "your preprocessor is broken"
224 +#define MFX_0xffff 0xffff
225 +#define MFX_0xffffffffL 4294967295ul
226 +#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
227 +# include "error CHAR_BIT"
229 +#if !defined(UCHAR_MAX)
230 +# include "error UCHAR_MAX 1"
232 +#if !defined(USHRT_MAX)
233 +# include "error USHRT_MAX 1"
235 +#if !defined(UINT_MAX)
236 +# include "error UINT_MAX 1"
238 +#if !defined(ULONG_MAX)
239 +# include "error ULONG_MAX 1"
241 +#if !defined(SHRT_MAX)
242 +# include "error SHRT_MAX 1"
244 +#if !defined(INT_MAX)
245 +# include "error INT_MAX 1"
247 +#if !defined(LONG_MAX)
248 +# include "error LONG_MAX 1"
251 +# include "error UCHAR_MAX 2"
254 +# include "error USHRT_MAX 2"
257 +# include "error UINT_MAX 2"
260 +# include "error ULONG_MAX 2"
262 +#if (UCHAR_MAX < 0xff)
263 +# include "error UCHAR_MAX 3"
265 +#if (USHRT_MAX < MFX_0xffff)
266 +# include "error USHRT_MAX 3"
268 +#if (UINT_MAX < MFX_0xffff)
269 +# include "error UINT_MAX 3"
271 +#if (ULONG_MAX < MFX_0xffffffffL)
272 +# include "error ULONG_MAX 3"
274 +#if (USHRT_MAX > UINT_MAX)
275 +# include "error USHRT_MAX vs UINT_MAX"
277 +#if (UINT_MAX > ULONG_MAX)
278 +# include "error UINT_MAX vs ULONG_MAX"
281 +#if (USHRT_MAX == MFX_0xffff)
282 +{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
283 +#elif (USHRT_MAX >= MFX_0xffff)
284 +{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
286 +#if (UINT_MAX == MFX_0xffff)
287 +{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
288 +#elif (UINT_MAX >= MFX_0xffff)
289 +{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
291 +#if (ULONG_MAX == MFX_0xffff)
292 +{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
293 +#elif (ULONG_MAX >= MFX_0xffff)
294 +{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
296 +#if !defined(_CRAY1) /* CRAY PVP systems */
297 +#if (USHRT_MAX == MFX_0xffffffffL)
298 +{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
299 +#elif (USHRT_MAX >= MFX_0xffffffffL)
300 +{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
303 +#if (UINT_MAX == MFX_0xffffffffL)
304 +{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
305 +#elif (UINT_MAX >= MFX_0xffffffffL)
306 +{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
308 +#if (ULONG_MAX == MFX_0xffffffffL)
309 +{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
310 +#elif (ULONG_MAX >= MFX_0xffffffffL)
311 +{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
314 +[mfx_cv_header_sane_limits_h=yes],
315 +[mfx_cv_header_sane_limits_h=no])])
318 +# /***********************************************************************
320 +# ************************************************************************/
322 +AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
323 +AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
327 +# /***********************************************************************
329 +# ************************************************************************/
331 +dnl more types which are not yet covered by ACC
333 +AC_DEFUN([mfx_CHECK_SIZEOF], [
334 +AC_CHECK_SIZEOF(__int32)
335 +AC_CHECK_SIZEOF(intmax_t)
336 +AC_CHECK_SIZEOF(uintmax_t)
337 +AC_CHECK_SIZEOF(intptr_t)
338 +AC_CHECK_SIZEOF(uintptr_t)
340 +AC_CHECK_SIZEOF(float)
341 +AC_CHECK_SIZEOF(double)
342 +AC_CHECK_SIZEOF(long double)
344 +AC_CHECK_SIZEOF(dev_t)
345 +AC_CHECK_SIZEOF(fpos_t)
346 +AC_CHECK_SIZEOF(mode_t)
347 +AC_CHECK_SIZEOF(off_t)
348 +AC_CHECK_SIZEOF(ssize_t)
349 +AC_CHECK_SIZEOF(time_t)
354 +AC_DEFUN([mfx_CHECK_LIB_WINMM], [
355 +if test "X$GCC" = Xyes; then
357 +cygwin* | mingw* | pw32*)
358 + test "X$LIBS" != "X" && LIBS="$LIBS "
359 + LIBS="${LIBS}-lwinmm" ;;