aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-02-28 15:38:48 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-02-28 15:38:48 +0300
commita44c8f339c62b3d0c2c276e24058c30ebd29a31e (patch)
tree3fb384e9b6f74aae20aed59d091070be44717eac
parente462a50176474c8e0c791c77a6c4863753af1e5d (diff)
downloadlibmicrohttpd-a44c8f339c62b3d0c2c276e24058c30ebd29a31e.tar.gz
libmicrohttpd-a44c8f339c62b3d0c2c276e24058c30ebd29a31e.zip
configure.ac: fixed detection of tsearch-related functions and header.
Precompiler macro HAVE_SEARCH_H is used by code and must be appropriately defined.
-rw-r--r--configure.ac12
-rw-r--r--src/microhttpd/Makefile.am2
2 files changed, 11 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 5f26a61b..d1ce5d42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -701,8 +701,16 @@ AC_CHECK_HEADERS([sys/types.h sys/time.h sys/msg.h time.h sys/mman.h sys/ioctl.h
701 inttypes.h stddef.h unistd.h \ 701 inttypes.h stddef.h unistd.h \
702 sockLib.h inetLib.h net/if.h], [], [], [AC_INCLUDES_DEFAULT]) 702 sockLib.h inetLib.h net/if.h], [], [], [AC_INCLUDES_DEFAULT])
703 703
704gl_FUNC_TSEARCH 704AC_CHECK_HEADER([[search.h]],
705AM_CONDITIONAL([HAVE_TSEARCH], [test "x$HAVE_TSEARCH" = "x1"]) 705 [
706 gl_FUNC_TSEARCH
707 AS_IF([[test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]],
708 [AC_DEFINE([[HAVE_SEARCH_H]], [[1]],
709 [Define to 1 if you have the <search.h> header file and your system have properly functioning tsearch(), tfind() and tdelete() functions])])
710 ],
711 [], [AC_INCLUDES_DEFAULT])
712
713AM_CONDITIONAL([MHD_HAVE_TSEARCH], [[test "x$ac_cv_header_search_h" = xyes && test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]])
706 714
707# Check for generic functions 715# Check for generic functions
708AC_CHECK_FUNCS([rand random]) 716AC_CHECK_FUNCS([rand random])
diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am
index 9bf5acea..7573fa7a 100644
--- a/src/microhttpd/Makefile.am
+++ b/src/microhttpd/Makefile.am
@@ -110,7 +110,7 @@ if USE_COVERAGE
110 AM_CFLAGS += --coverage 110 AM_CFLAGS += --coverage
111endif 111endif
112 112
113if !HAVE_TSEARCH 113if !MHD_HAVE_TSEARCH
114libmicrohttpd_la_SOURCES += \ 114libmicrohttpd_la_SOURCES += \
115 tsearch.c tsearch.h 115 tsearch.c tsearch.h
116endif 116endif