Ignore:
Timestamp:
01/09/07 22:22:14 (18 years ago)
Author:
zorg
Message:
  • Fix missing internal.h in 'make dist'
  • Simplify types size detection in autotools

Patch by Lasse Collin <lasse.collin@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpcdec/trunk/configure.ac

    r154 r198  
    1212
    1313AC_HEADER_STDC
    14 AC_CHECK_HEADERS([inttypes.h string.h])
    15 
    1614AC_HEADER_STDBOOL
    1715AC_C_CONST
     
    1917AC_TYPE_OFF_T
    2018AC_TYPE_SIZE_T
    21 AC_CHECK_TYPES([ptrdiff_t])
     19AC_TYPE_INT16_T
     20AC_TYPE_UINT16_T
     21AC_TYPE_INT32_T
     22AC_TYPE_UINT32_T
     23AC_TYPE_INT64_T
     24
     25if test "x$ac_cv_header_inttypes_h" = "xyes" ; then
     26        INTTYPES_H="#include <inttypes.h>"
     27else
     28        INTTYPES_H=""
     29fi
     30
     31if test "x$ac_cv_c_int16_t" = "xno" ; then
     32        AC_MSG_ERROR([No signed 16 bit type found on this platform.])
     33elif test "x$ac_cv_c_int16_t" = "xyes" ; then
     34        ac_cv_c_int16_t=int16_t
     35fi
     36
     37if test "x$ac_cv_c_uint16_t" = "xno" ; then
     38        AC_MSG_ERROR([No unsigned 16 bit type found on this platform.])
     39elif test "x$ac_cv_c_uint16_t" = "xyes" ; then
     40        ac_cv_c_uint16_t=uint16_t
     41fi
     42
     43if test "x$ac_cv_c_int32_t" = "xno" ; then
     44        AC_MSG_ERROR([No signed 32 bit type found on this platform.])
     45elif test "x$ac_cv_c_int32_t" = "xyes" ; then
     46        ac_cv_c_int32_t=int32_t
     47fi
     48
     49if test "x$ac_cv_c_uint32_t" = "xno" ; then
     50        AC_MSG_ERROR([No unsigned 32 bit type found on this platform.])
     51elif test "x$ac_cv_c_uint32_t" = "xyes" ; then
     52        ac_cv_c_uint32_t=uint32_t
     53fi
     54
     55if test "x$ac_cv_c_uint64_t" = "xno" ; then
     56        AC_MSG_ERROR([No signed 64 bit type found on this platform.])
     57elif test "x$ac_cv_c_int64_t" = "xyes" ; then
     58        ac_cv_c_int64_t=int64_t
     59fi
    2260
    2361AC_FUNC_MEMCMP
    24 AC_CHECK_FUNCS([memmove memset sqrt])
    25 
    26 AC_MSG_CHECKING(for int16_t)
    27 AC_CACHE_VAL(has_int16_t,
    28 [AC_TRY_RUN([
    29 int16_t foo;
    30 int main() {return 0;}
    31 ],
    32 has_int16_t=yes,
    33 has_int16_t=no,
    34 has_int16_t=no
    35 )])
    36 AC_MSG_RESULT($has_int16_t)
    37 
    38 AC_MSG_CHECKING(for int32_t)
    39 AC_CACHE_VAL(has_int32_t,
    40 [AC_TRY_RUN([
    41 int32_t foo;
    42 int main() {return 0;}
    43 ],
    44 has_int32_t=yes,
    45 has_int32_t=no,
    46 has_int32_t=no
    47 )])
    48 AC_MSG_RESULT($has_int32_t)
    49 
    50 AC_MSG_CHECKING(for uint32_t)
    51 AC_CACHE_VAL(has_uint32_t,
    52 [AC_TRY_RUN([
    53 uint32_t foo;
    54 int main() {return 0;}
    55 ],
    56 has_uint32_t=yes,
    57 has_uint32_t=no,
    58 has_uint32_t=no
    59 )])
    60 AC_MSG_RESULT($has_uint32_t)
    61 
    62 AC_MSG_CHECKING(for uint16_t)
    63 AC_CACHE_VAL(has_uint16_t,
    64 [AC_TRY_RUN([
    65 uint16_t foo;
    66 int main() {return 0;}
    67 ],
    68 has_uint16_t=yes,
    69 has_uint16_t=no,
    70 has_uint16_t=no
    71 )])
    72 AC_MSG_RESULT($has_uint16_t)
    73 
    74 AC_MSG_CHECKING(for u_int32_t)
    75 AC_CACHE_VAL(has_u_int32_t,
    76 [AC_TRY_RUN([
    77 u_int32_t foo;
    78 int main() {return 0;}
    79 ],
    80 has_u_int32_t=yes,
    81 has_u_int32_t=no,
    82 has_u_int32_t=no
    83 )])
    84 AC_MSG_RESULT($has_u_int32_t)
    85 
    86 AC_MSG_CHECKING(for u_int16_t)
    87 AC_CACHE_VAL(has_u_int16_t,
    88 [AC_TRY_RUN([
    89 u_int16_t foo;
    90 int main() {return 0;}
    91 ],
    92 has_u_int16_t=yes,
    93 has_u_int16_t=no,
    94 has_u_int16_t=no
    95 )])
    96 AC_MSG_RESULT($has_u_int16_t)
    97 
    98 AC_MSG_CHECKING(for int64_t)
    99 AC_CACHE_VAL(has_int64_t,
    100 [AC_TRY_RUN([
    101 int64_t foo;
    102 int main() {return 0;}
    103 ],
    104 has_int64_t=yes,
    105 has_int64_t=no,
    106 has_int64_t=no
    107 )])
    108 AC_MSG_RESULT($has_int64_t)
    109 
    110 AC_CHECK_SIZEOF(short)
    111 AC_CHECK_SIZEOF(int)
    112 AC_CHECK_SIZEOF(long)
    113 AC_CHECK_SIZEOF(long long)
    114 
    115 
    116 if test x$has_int16_t = "xyes" ; then
    117         SIZE16="int16_t"
    118 else
    119         case 2 in
    120                 $ac_cv_sizeof_short) SIZE16="short";;
    121                 $ac_cv_sizeof_int) SIZE16="int";;
    122         esac
     62if test "x$ac_cv_func_memcmp_working" = "xno" ; then
     63        AC_MSG_ERROR([working memcmp is not available.])
    12364fi
    12465
    125 if test x$has_int32_t = "xyes" ; then
    126         SIZE32="int32_t"
    127 else
    128         case 4 in
    129                 $ac_cv_sizeof_short) SIZE32="short";;
    130                 $ac_cv_sizeof_int) SIZE32="int";;
    131                 $ac_cv_sizeof_long) SIZE32="long";;
    132         esac
    133 fi
    134 
    135 if test x$has_uint32_t = "xyes" ; then
    136         USIZE32="uint32_t"
    137 else
    138         if test x$has_u_int32_t = "xyes" ; then
    139                 USIZE32="u_int32_t"
    140         else
    141                 case 4 in
    142                         $ac_cv_sizeof_short) USIZE32="unsigned short";;
    143                         $ac_cv_sizeof_int) USIZE32="unsigned int";;
    144                         $ac_cv_sizeof_long) USIZE32="unsigned long";;
    145                 esac
    146         fi
    147 fi
    148 
    149 if test x$has_uint16_t = "xyes" ; then
    150         USIZE16="uint16_t"
    151 else
    152         if test x$has_u_int16_t = "xyes" ; then
    153                 USIZE16="u_int16_t"
    154         else
    155                 case 2 in
    156                         $ac_cv_sizeof_short) USIZE16="unsigned short";;
    157                         $ac_cv_sizeof_int) USIZE16="unsigned int";;
    158                         $ac_cv_sizeof_long) USIZE16="unsigned long";;
    159                 esac
    160         fi
    161 fi
    162 
    163 if test x$has_int64_t = "xyes" ; then
    164         SIZE64="int64_t"
    165 else
    166 case 8 in
    167         $ac_cv_sizeof_int) SIZE64="int";;
    168         $ac_cv_sizeof_long) SIZE64="long";;
    169         $ac_cv_sizeof_long_long) SIZE64="long long";;
    170 esac
    171 fi
    172 
    173 if test -z "$SIZE16"; then
    174         AC_MSG_ERROR(No 16 bit type found on this platform!)
    175 fi
    176 if test -z "$USIZE16"; then
    177         AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
    178 fi
    179 if test -z "$SIZE32"; then
    180         AC_MSG_ERROR(No 32 bit type found on this platform!)
    181 fi
    182 if test -z "$USIZE32"; then
    183         AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
    184 fi
    185 if test -z "$SIZE64"; then
    186         AC_MSG_WARN(No 64 bit type found on this platform!)
    187 fi
     66AC_CHECK_FUNCS([memmove memset], [],
     67        AC_MSG_ERROR([memset or memmove is missing.]))
    18868
    18969dnl Make substitutions
     
    19171AC_SUBST(VERSION)
    19272AC_SUBST(LIBTOOL_DEPS)
    193 AC_SUBST(SIZE16)
    194 AC_SUBST(USIZE16)
    195 AC_SUBST(SIZE32)
    196 AC_SUBST(USIZE32)
    197 AC_SUBST(SIZE64)
     73AC_SUBST(INTTYPES_H)
     74AC_SUBST(SIZE16, $ac_cv_c_int16_t)
     75AC_SUBST(USIZE16, $ac_cv_c_uint16_t)
     76AC_SUBST(SIZE32, $ac_cv_c_int32_t)
     77AC_SUBST(USIZE32, $ac_cv_c_uint32_t)
     78AC_SUBST(SIZE64, $ac_cv_c_int64_t)
    19879AC_SUBST(OPT)
    19980AC_SUBST(LIBS)
Note: See TracChangeset for help on using the changeset viewer.