[PATCH] alix2: correct h/w configuration
[openwrt.git] / tools / missing-macros / src / m4 / mfx_limits.m4
1 # serial 3
2
3 AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
4 AC_CACHE_CHECK([whether limits.h is sane],
5 mfx_cv_header_sane_limits_h,
6 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
7 #if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
8 # if defined(__APPLE__) && defined(__GNUC__)
9 # error "your preprocessor is broken - use compiler option -no-cpp-precomp"
10 # else
11 # include "your preprocessor is broken"
12 # endif
13 #endif
14 #define MFX_0xffff 0xffff
15 #define MFX_0xffffffffL 4294967295ul
16 #if !defined(CHAR_BIT) || (CHAR_BIT != 8)
17 # include "error CHAR_BIT"
18 #endif
19 #if !defined(UCHAR_MAX)
20 # include "error UCHAR_MAX 1"
21 #endif
22 #if !defined(USHRT_MAX)
23 # include "error USHRT_MAX 1"
24 #endif
25 #if !defined(UINT_MAX)
26 # include "error UINT_MAX 1"
27 #endif
28 #if !defined(ULONG_MAX)
29 # include "error ULONG_MAX 1"
30 #endif
31 #if !defined(SHRT_MAX)
32 # include "error SHRT_MAX 1"
33 #endif
34 #if !defined(INT_MAX)
35 # include "error INT_MAX 1"
36 #endif
37 #if !defined(LONG_MAX)
38 # include "error LONG_MAX 1"
39 #endif
40 #if (UCHAR_MAX < 1)
41 # include "error UCHAR_MAX 2"
42 #endif
43 #if (USHRT_MAX < 1)
44 # include "error USHRT_MAX 2"
45 #endif
46 #if (UINT_MAX < 1)
47 # include "error UINT_MAX 2"
48 #endif
49 #if (ULONG_MAX < 1)
50 # include "error ULONG_MAX 2"
51 #endif
52 #if (UCHAR_MAX < 0xff)
53 # include "error UCHAR_MAX 3"
54 #endif
55 #if (USHRT_MAX < MFX_0xffff)
56 # include "error USHRT_MAX 3"
57 #endif
58 #if (UINT_MAX < MFX_0xffff)
59 # include "error UINT_MAX 3"
60 #endif
61 #if (ULONG_MAX < MFX_0xffffffffL)
62 # include "error ULONG_MAX 3"
63 #endif
64 #if (USHRT_MAX > UINT_MAX)
65 # include "error USHRT_MAX vs UINT_MAX"
66 #endif
67 #if (UINT_MAX > ULONG_MAX)
68 # include "error UINT_MAX vs ULONG_MAX"
69 #endif
70 ]], [[
71 #if (USHRT_MAX == MFX_0xffff)
72 { typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
73 #elif (USHRT_MAX >= MFX_0xffff)
74 { typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
75 #endif
76 #if (UINT_MAX == MFX_0xffff)
77 { typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
78 #elif (UINT_MAX >= MFX_0xffff)
79 { typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
80 #endif
81 #if (ULONG_MAX == MFX_0xffff)
82 { typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
83 #elif (ULONG_MAX >= MFX_0xffff)
84 { typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
85 #endif
86 #if !defined(_CRAY1) /* CRAY PVP systems */
87 #if (USHRT_MAX == MFX_0xffffffffL)
88 { typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
89 #elif (USHRT_MAX >= MFX_0xffffffffL)
90 { typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
91 #endif
92 #endif /* _CRAY1 */
93 #if (UINT_MAX == MFX_0xffffffffL)
94 { typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
95 #elif (UINT_MAX >= MFX_0xffffffffL)
96 { typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
97 #endif
98 #if (ULONG_MAX == MFX_0xffffffffL)
99 { typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
100 #elif (ULONG_MAX >= MFX_0xffffffffL)
101 { typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
102 #endif
103 ]])],
104 [mfx_cv_header_sane_limits_h=yes],
105 [mfx_cv_header_sane_limits_h=no])])
106 ])
107
108 # /***********************************************************************
109 # // standard
110 # ************************************************************************/
111
112 AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
113 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.])])
114 ])#
115
116
117 # /***********************************************************************
118 # //
119 # ************************************************************************/
120
121 dnl more types which are not yet covered by ACC
122
123 AC_DEFUN([mfx_CHECK_SIZEOF], [
124 AC_CHECK_SIZEOF(__int32)
125 AC_CHECK_SIZEOF(intmax_t)
126 AC_CHECK_SIZEOF(uintmax_t)
127 AC_CHECK_SIZEOF(intptr_t)
128 AC_CHECK_SIZEOF(uintptr_t)
129
130 AC_CHECK_SIZEOF(float)
131 AC_CHECK_SIZEOF(double)
132 AC_CHECK_SIZEOF(long double)
133
134 AC_CHECK_SIZEOF(dev_t)
135 AC_CHECK_SIZEOF(fpos_t)
136 AC_CHECK_SIZEOF(mode_t)
137 AC_CHECK_SIZEOF(off_t)
138 AC_CHECK_SIZEOF(ssize_t)
139 AC_CHECK_SIZEOF(time_t)
140 ])#
141
142
143
144 AC_DEFUN([mfx_CHECK_LIB_WINMM], [
145 if test "X$GCC" = Xyes; then
146 case $host_os in
147 cygwin* | mingw* | pw32*)
148 test "X$LIBS" != "X" && LIBS="$LIBS "
149 LIBS="${LIBS}-lwinmm" ;;
150 *)
151 ;;
152 esac
153 fi
154 ])#
This page took 0.047876 seconds and 5 git commands to generate.