libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit a44c8f339c62b3d0c2c276e24058c30ebd29a31e
parent e462a50176474c8e0c791c77a6c4863753af1e5d
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Tue, 28 Feb 2017 15:38:48 +0300

configure.ac: fixed detection of tsearch-related functions and header.
Precompiler macro HAVE_SEARCH_H is used by code and must be appropriately defined.

Diffstat:
Mconfigure.ac | 12++++++++++--
Msrc/microhttpd/Makefile.am | 2+-
2 files changed, 11 insertions(+), 3 deletions(-)

diff --git 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 inttypes.h stddef.h unistd.h \ sockLib.h inetLib.h net/if.h], [], [], [AC_INCLUDES_DEFAULT]) -gl_FUNC_TSEARCH -AM_CONDITIONAL([HAVE_TSEARCH], [test "x$HAVE_TSEARCH" = "x1"]) +AC_CHECK_HEADER([[search.h]], + [ + gl_FUNC_TSEARCH + AS_IF([[test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]], + [AC_DEFINE([[HAVE_SEARCH_H]], [[1]], + [Define to 1 if you have the <search.h> header file and your system have properly functioning tsearch(), tfind() and tdelete() functions])]) + ], + [], [AC_INCLUDES_DEFAULT]) + +AM_CONDITIONAL([MHD_HAVE_TSEARCH], [[test "x$ac_cv_header_search_h" = xyes && test "x$HAVE_TSEARCH" = "x1" && test "x$REPLACE_TSEARCH" != "x1"]]) # Check for generic functions AC_CHECK_FUNCS([rand random]) diff --git a/src/microhttpd/Makefile.am b/src/microhttpd/Makefile.am @@ -110,7 +110,7 @@ if USE_COVERAGE AM_CFLAGS += --coverage endif -if !HAVE_TSEARCH +if !MHD_HAVE_TSEARCH libmicrohttpd_la_SOURCES += \ tsearch.c tsearch.h endif