Index: libmpcdec/trunk/configure.ac
===================================================================
--- libmpcdec/trunk/configure.ac	(revision 154)
+++ libmpcdec/trunk/configure.ac	(revision 198)
@@ -12,6 +12,4 @@
 
 AC_HEADER_STDC
-AC_CHECK_HEADERS([inttypes.h string.h])
-
 AC_HEADER_STDBOOL
 AC_C_CONST
@@ -19,171 +17,53 @@
 AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
-AC_CHECK_TYPES([ptrdiff_t])
+AC_TYPE_INT16_T
+AC_TYPE_UINT16_T
+AC_TYPE_INT32_T
+AC_TYPE_UINT32_T
+AC_TYPE_INT64_T
+
+if test "x$ac_cv_header_inttypes_h" = "xyes" ; then
+	INTTYPES_H="#include <inttypes.h>"
+else
+	INTTYPES_H=""
+fi
+
+if test "x$ac_cv_c_int16_t" = "xno" ; then
+        AC_MSG_ERROR([No signed 16 bit type found on this platform.])
+elif test "x$ac_cv_c_int16_t" = "xyes" ; then
+	ac_cv_c_int16_t=int16_t
+fi
+
+if test "x$ac_cv_c_uint16_t" = "xno" ; then
+        AC_MSG_ERROR([No unsigned 16 bit type found on this platform.])
+elif test "x$ac_cv_c_uint16_t" = "xyes" ; then
+	ac_cv_c_uint16_t=uint16_t
+fi
+
+if test "x$ac_cv_c_int32_t" = "xno" ; then
+        AC_MSG_ERROR([No signed 32 bit type found on this platform.])
+elif test "x$ac_cv_c_int32_t" = "xyes" ; then
+	ac_cv_c_int32_t=int32_t
+fi
+
+if test "x$ac_cv_c_uint32_t" = "xno" ; then
+        AC_MSG_ERROR([No unsigned 32 bit type found on this platform.])
+elif test "x$ac_cv_c_uint32_t" = "xyes" ; then
+	ac_cv_c_uint32_t=uint32_t
+fi
+
+if test "x$ac_cv_c_uint64_t" = "xno" ; then
+        AC_MSG_ERROR([No signed 64 bit type found on this platform.])
+elif test "x$ac_cv_c_int64_t" = "xyes" ; then
+	ac_cv_c_int64_t=int64_t
+fi
 
 AC_FUNC_MEMCMP
-AC_CHECK_FUNCS([memmove memset sqrt])
-
-AC_MSG_CHECKING(for int16_t)
-AC_CACHE_VAL(has_int16_t,
-[AC_TRY_RUN([
-int16_t foo;
-int main() {return 0;}
-],
-has_int16_t=yes,
-has_int16_t=no,
-has_int16_t=no
-)])
-AC_MSG_RESULT($has_int16_t)
-
-AC_MSG_CHECKING(for int32_t)
-AC_CACHE_VAL(has_int32_t,
-[AC_TRY_RUN([
-int32_t foo;
-int main() {return 0;}
-],
-has_int32_t=yes,
-has_int32_t=no,
-has_int32_t=no
-)])
-AC_MSG_RESULT($has_int32_t)
-
-AC_MSG_CHECKING(for uint32_t)
-AC_CACHE_VAL(has_uint32_t,
-[AC_TRY_RUN([
-uint32_t foo;
-int main() {return 0;}
-],
-has_uint32_t=yes,
-has_uint32_t=no,
-has_uint32_t=no
-)])
-AC_MSG_RESULT($has_uint32_t)
-
-AC_MSG_CHECKING(for uint16_t)
-AC_CACHE_VAL(has_uint16_t,
-[AC_TRY_RUN([
-uint16_t foo;
-int main() {return 0;}
-],
-has_uint16_t=yes,
-has_uint16_t=no,
-has_uint16_t=no
-)])
-AC_MSG_RESULT($has_uint16_t)
-
-AC_MSG_CHECKING(for u_int32_t)
-AC_CACHE_VAL(has_u_int32_t,
-[AC_TRY_RUN([
-u_int32_t foo;
-int main() {return 0;}
-],
-has_u_int32_t=yes,
-has_u_int32_t=no,
-has_u_int32_t=no
-)])
-AC_MSG_RESULT($has_u_int32_t)
-
-AC_MSG_CHECKING(for u_int16_t)
-AC_CACHE_VAL(has_u_int16_t,
-[AC_TRY_RUN([
-u_int16_t foo;
-int main() {return 0;}
-],
-has_u_int16_t=yes,
-has_u_int16_t=no,
-has_u_int16_t=no
-)])
-AC_MSG_RESULT($has_u_int16_t)
-
-AC_MSG_CHECKING(for int64_t)
-AC_CACHE_VAL(has_int64_t,
-[AC_TRY_RUN([
-int64_t foo;
-int main() {return 0;}
-],
-has_int64_t=yes,
-has_int64_t=no,
-has_int64_t=no
-)])
-AC_MSG_RESULT($has_int64_t)
-
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-
-
-if test x$has_int16_t = "xyes" ; then
-        SIZE16="int16_t"
-else
-        case 2 in
-                $ac_cv_sizeof_short) SIZE16="short";;
-                $ac_cv_sizeof_int) SIZE16="int";;
-        esac
+if test "x$ac_cv_func_memcmp_working" = "xno" ; then
+	AC_MSG_ERROR([working memcmp is not available.])
 fi
 
-if test x$has_int32_t = "xyes" ; then
-        SIZE32="int32_t"
-else
-        case 4 in
-                $ac_cv_sizeof_short) SIZE32="short";;
-                $ac_cv_sizeof_int) SIZE32="int";;
-                $ac_cv_sizeof_long) SIZE32="long";;
-        esac
-fi
-
-if test x$has_uint32_t = "xyes" ; then
-        USIZE32="uint32_t"
-else
-        if test x$has_u_int32_t = "xyes" ; then
-                USIZE32="u_int32_t"
-        else
-                case 4 in
-                        $ac_cv_sizeof_short) USIZE32="unsigned short";;
-                        $ac_cv_sizeof_int) USIZE32="unsigned int";;
-                        $ac_cv_sizeof_long) USIZE32="unsigned long";;
-                esac
-        fi
-fi
-
-if test x$has_uint16_t = "xyes" ; then
-        USIZE16="uint16_t"
-else
-        if test x$has_u_int16_t = "xyes" ; then
-                USIZE16="u_int16_t"
-        else
-                case 2 in
-                        $ac_cv_sizeof_short) USIZE16="unsigned short";;
-                        $ac_cv_sizeof_int) USIZE16="unsigned int";;
-                        $ac_cv_sizeof_long) USIZE16="unsigned long";;
-                esac
-        fi
-fi
-
-if test x$has_int64_t = "xyes" ; then
-        SIZE64="int64_t"
-else
-case 8 in
-        $ac_cv_sizeof_int) SIZE64="int";;
-        $ac_cv_sizeof_long) SIZE64="long";;
-        $ac_cv_sizeof_long_long) SIZE64="long long";;
-esac
-fi
-
-if test -z "$SIZE16"; then
-        AC_MSG_ERROR(No 16 bit type found on this platform!)
-fi
-if test -z "$USIZE16"; then
-        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
-fi
-if test -z "$SIZE32"; then
-        AC_MSG_ERROR(No 32 bit type found on this platform!)
-fi
-if test -z "$USIZE32"; then
-        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
-fi
-if test -z "$SIZE64"; then
-        AC_MSG_WARN(No 64 bit type found on this platform!)
-fi
+AC_CHECK_FUNCS([memmove memset], [],
+        AC_MSG_ERROR([memset or memmove is missing.]))
 
 dnl Make substitutions
@@ -191,9 +71,10 @@
 AC_SUBST(VERSION)
 AC_SUBST(LIBTOOL_DEPS)
-AC_SUBST(SIZE16)
-AC_SUBST(USIZE16)
-AC_SUBST(SIZE32)
-AC_SUBST(USIZE32)
-AC_SUBST(SIZE64)
+AC_SUBST(INTTYPES_H)
+AC_SUBST(SIZE16, $ac_cv_c_int16_t)
+AC_SUBST(USIZE16, $ac_cv_c_uint16_t)
+AC_SUBST(SIZE32, $ac_cv_c_int32_t)
+AC_SUBST(USIZE32, $ac_cv_c_uint32_t)
+AC_SUBST(SIZE64, $ac_cv_c_int64_t)
 AC_SUBST(OPT)
 AC_SUBST(LIBS)
