struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / packihx / configure.ac
blobb036582164cef9f4f13e3fd837cdfec69ca0c1a0
1 AC_INIT(packihx.c)
2 AC_CONFIG_HEADER(config.h:config_in.h)
3 AC_PREREQ(2.60)
5 AC_PROG_CC
7 AC_CHECK_SIZEOF(char, 1)
8 AC_CHECK_SIZEOF(short, 2)
9 AC_CHECK_SIZEOF(int, 4)
10 AC_CHECK_SIZEOF(long, 4)
11 AC_CHECK_SIZEOF(long long, 8)
13 type_name()
15     if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
16         echo "char"
17         exit
18     fi
19     if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
20         echo "short"
21         exit
22     fi
23     if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
24         echo "int"
25         exit
26     fi
27     if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
28         echo "long"
29         exit
30     fi
31     if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
32         echo "long long"
33         exit
34     fi
35     echo "long long"
38 # Try to append a c99 flag
39 AC_PROG_CC_C99
40 if test "$ac_cv_prog_cc_c99" != "no"; then
41   CFLAGS="$ac_cv_prog_cc_c99 ${CFLAGS}"
44 AC_MSG_CHECKING(type name for byte)
45 TYPE_BYTE=`type_name 1`
46 AC_MSG_RESULT($TYPE_BYTE)
47 AC_MSG_CHECKING(type name for word)
48 TYPE_WORD=`type_name 2`
49 AC_MSG_RESULT($TYPE_WORD)
50 AC_DEFINE_UNQUOTED(TYPE_BYTE, [$TYPE_BYTE], [XXX])
51 AC_DEFINE_UNQUOTED(TYPE_WORD, [$TYPE_WORD], [XXX])
52 AC_DEFINE_UNQUOTED(TYPE_UBYTE, [unsigned $TYPE_BYTE], [XXX])
53 AC_DEFINE_UNQUOTED(TYPE_UWORD, [unsigned $TYPE_WORD], [XXX])
55 AH_BOTTOM([typedef TYPE_UBYTE Uint8;
56 typedef TYPE_UWORD Uint16;])
58 AC_OUTPUT(Makefile)