3 dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
4 dnl the losing memcmp on some x86 Next systems.
5 AC_DEFUN(jm_AC_FUNC_MEMCMP,
6 [AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
12 /* Some versions of memcmp are not 8-bit clean. */
13 char c0 = 0x40, c1 = 0x80, c2 = 0x81;
14 if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
17 /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
18 or more and with at least one buffer not starting on a 4-byte boundary.
19 William Lewis provided this test program. */
24 for (i = 0; i < 4; i++)
28 strcpy (a, "--------01111111");
29 strcpy (b, "--------10000000");
30 if (memcmp (a, b, 16) >= 0)
38 jm_cv_func_memcmp_working=yes,
39 jm_cv_func_memcmp_working=no,
40 jm_cv_func_memcmp_working=no)])
41 test $jm_cv_func_memcmp_working = no \
42 && LIBOBJS="$LIBOBJS memcmp.$ac_objext"
46 AC_DEFUN(jm_FUNC_MEMCMP,
47 [AC_REQUIRE([jm_AC_FUNC_MEMCMP])dnl
48 if test $jm_cv_func_memcmp_working = no; then
49 AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp,
50 [Define to rpl_memcmp if the replacement function should be used.])