1 dnl AC_C_ATTRIBUTE_ALIGNED
2 dnl define ATTRIBUTE_ALIGNED_MAX to the maximum alignment if this is supported
3 AC_DEFUN([AC_C_ATTRIBUTE_ALIGNED],
4 [AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5 [ac_cv_c_attribute_aligned],
6 [ac_cv_c_attribute_aligned=0
7 for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
9 [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
10 [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
12 if test x"$ac_cv_c_attribute_aligned" != x"0"; then
13 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
14 [$ac_cv_c_attribute_aligned],[maximum supported data alignment])
17 dnl AC_TRY_CFLAGS (CFLAGS, [ACTION-IF-WORKS], [ACTION-IF-FAILS])
18 dnl check if $CC supports a given set of cflags
19 AC_DEFUN([AC_TRY_CFLAGS],
20 [AC_MSG_CHECKING([if $CC supports $1 flags])
23 AC_TRY_COMPILE([],[],[ac_cv_try_cflags_ok=yes],[ac_cv_try_cflags_ok=no])
25 AC_MSG_RESULT([$ac_cv_try_cflags_ok])
26 if test x"$ac_cv_try_cflags_ok" = x"yes"; then
27 ifelse([$2],[],[:],[$2])
29 ifelse([$3],[],[:],[$3])
33 dnl AC_CHECK_GENERATE_INTTYPES_H (INCLUDE-DIRECTORY)
34 dnl generate a default inttypes.h if the header file does not exist already
35 AC_DEFUN([AC_CHECK_GENERATE_INTTYPES],
36 [AC_CHECK_HEADER([inttypes.h],[],
37 [AC_CHECK_SIZEOF([char])
38 AC_CHECK_SIZEOF([short])
39 AC_CHECK_SIZEOF([int])
40 if test x"$ac_cv_sizeof_char" != x"1" -o \
41 x"$ac_cv_sizeof_short" != x"2" -o \
42 x"$ac_cv_sizeof_int" != x"4"; then
43 AC_MSG_ERROR([can not build a default inttypes.h])
45 cat >$1/inttypes.h << EOF
46 /* default inttypes.h for people who do not have it on their system */
50 #if (!defined __int8_t_defined) && (!defined __BIT_TYPES_DEFINED__)
51 #define __int8_t_defined
52 typedef signed char int8_t;
53 typedef signed short int16_t;
54 typedef signed int int32_t;
56 typedef signed long long int64_t;
59 #if (!defined _LINUX_TYPES_H)
60 typedef unsigned char uint8_t;
61 typedef unsigned short uint16_t;
62 typedef unsigned int uint32_t;
64 typedef unsigned long long uint64_t;