2 dnl Copyright (C) 2002-2004, 2007-2010 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_FUNC_MEMCMP],
9 if test $cross_compiling != no; then
10 # AC_FUNC_MEMCMP as of 2.62 defaults to 'no' when cross compiling.
11 # We default to yes if memcmp appears to exist, which works
13 AC_CACHE_CHECK([whether cross-compiling target has memcmp],
14 [ac_cv_func_memcmp_working],
16 AC_LANG_PROGRAM([[#include <string.h>
17 ]], [[int ret = memcmp ("foo", "bar", 0);]])],
18 [ac_cv_func_memcmp_working=yes],
19 [ac_cv_func_memcmp_working=no])])
22 dnl Note: AC_FUNC_MEMCMP does AC_LIBOBJ([memcmp]).
23 if test $ac_cv_func_memcmp_working = no; then
24 AC_DEFINE([memcmp], [rpl_memcmp],
25 [Define to rpl_memcmp if the replacement function should be used.])
30 # Prerequisites of lib/memcmp.c.
31 AC_DEFUN([gl_PREREQ_MEMCMP], [:])