libreplace: some systems don't have memmem()
[samba.git] / lib / replace / libreplace.m4
index a3a26ef43e48280ef4075b147649632bf7891e41..1353c1f7d2677c7e6106677af7e3446b120b42a3 100644 (file)
@@ -16,7 +16,7 @@ done
 if test x"$libreplacedir" = "x"; then
        AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
 fi
-LIBREPLACEOBJ="replace.o"
+LIBREPLACEOBJ="$libreplacedir/replace.o"
 AC_SUBST(LIBREPLACEOBJ)
 
 AC_CANONICAL_BUILD
@@ -46,10 +46,10 @@ if test x"$libreplacedir" = "x"; then
        AC_MSG_ERROR([cannot find libreplace in $libreplacepaths])
 fi
 
-LIBREPLACEOBJ="replace.o"
+LIBREPLACEOBJ="$libreplacedir/replace.o"
 AC_SUBST(LIBREPLACEOBJ)
 
-LIBREPLACEOBJ="${LIBREPLACEOBJ} snprintf.o"
+LIBREPLACEOBJ="${LIBREPLACEOBJ} $libreplacedir/snprintf.o"
 
 AC_TYPE_SIGNAL
 AC_TYPE_UID_T
@@ -228,6 +228,8 @@ AC_HAVE_DECL(environ, [#include <unistd.h>])
 AC_CHECK_FUNCS(strnlen)
 AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
 
+AC_CHECK_FUNCS(memmem)
+
 # this test disabled as we don't actually need __VA_ARGS__ yet
 AC_TRY_CPP([
 #define eprintf(...) fprintf(stderr, __VA_ARGS__)