[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 62/156: configure: fixed checking for system libs, fixed
From: |
gnunet |
Subject: |
[libmicrohttpd] 62/156: configure: fixed checking for system libs, fixed .pc file |
Date: |
Sun, 28 May 2023 17:51:55 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to tag v0.9.77
in repository libmicrohttpd.
commit 665144db334b47968e1adb1150897ad90d9cfb90
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Mar 14 16:52:56 2023 +0300
configure: fixed checking for system libs, fixed .pc file
Fixed compiler warning when checking for libraries.
The private libraries var (used when linking with static lib) were fixed
in pkg-conf file.
---
configure.ac | 114 +++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 91 insertions(+), 23 deletions(-)
diff --git a/configure.ac b/configure.ac
index 345a6aff..b238f5f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,7 +85,8 @@ AC_CHECK_HEADERS_ONCE([stdio.h string.h stdint.h errno.h
limits.h fcntl.h], [],
[AC_MSG_ERROR([Compiling libmicrohttpd requires standard POSIX headers
files])], [AC_INCLUDES_DEFAULT])
# Check for basic optional headers
-AC_CHECK_HEADERS([stddef.h stdlib.h inttypes.h sys/types.h sys/stat.h
unistd.h], [], [], [AC_INCLUDES_DEFAULT])
+AC_CHECK_HEADERS([stddef.h stdlib.h inttypes.h sys/types.h sys/stat.h unistd.h
\
+ sys/uio.h], [], [], [AC_INCLUDES_DEFAULT])
# Check for clock-specific optional headers
AC_CHECK_HEADERS([sys/time.h time.h], [], [], [AC_INCLUDES_DEFAULT])
@@ -567,8 +568,7 @@ AS_CASE(["$host_os"],
AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno does not
work])
mhd_host_os='Solaris'
AC_MSG_RESULT([[$mhd_host_os]])
- AC_SEARCH_LIBS(gethostbyname, nsl)
- AC_SEARCH_LIBS(socket, socket)],
+ AC_SEARCH_LIBS([gethostbyname], [nsl])],
[*arm-linux*],
[AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
mhd_host_os='ARM Linux'
@@ -589,7 +589,6 @@ AS_CASE(["$host_os"],
AC_DEFINE([WINDOWS],[1],[This is a Windows system])
mhd_host_os='Windows/MinGW'
AC_MSG_RESULT([[$mhd_host_os]])
- LIBS="$LIBS -lws2_32"
AC_CHECK_HEADERS([winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([[Winsock2
headers are required for W32]])], [AC_INCLUDES_DEFAULT])
AC_CACHE_CHECK([for MS lib utility], [ac_cv_use_ms_lib_tool],
[mslibcheck=`lib 2>&1`
@@ -1165,12 +1164,36 @@ AM_CONDITIONAL([W32_SHARED_LIB_EXP], [test
"x$w32_shared_lib_exp" = "xyes"])
AM_CONDITIONAL([USE_MS_LIB_TOOL], [test "x$ac_cv_use_ms_lib_tool" = "xyes"])
AM_CONDITIONAL([USE_EXPORT_FILE], [test "x$use_expfile" = "xyes"])
+MHD_FIND_LIB([socket],
+ [[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SOCKLIB_H
+#include <sockLib.h>
+#endif
+#if defined(_WIN32) && ! defined(__CYGWIN__)
+#include <winsock2.h>
+#endif
+ ]],
+ [(void)socket(0, 0, 0);],
+ [socket ws2_32],
+ [
+ AS_VAR_IF([[mhd_cv_find_lib_socket]],[["none required"]], [],
+ [
+ MHD_LIBDEPS_PKGCFG="${mhd_cv_find_lib_socket} $MHD_LIBDEPS_PKGCFG"
+ ]
+ )
+ ],
+ [AC_MSG_ERROR([[cannot find header or library required for function
socket()]])]
+)
+
MHD_CHECK_SOCKET_SHUTDOWN_TRIGGER([AC_DEFINE([HAVE_LISTEN_SHUTDOWN],[1],[can
use shutdown on listen sockets])])
AM_CONDITIONAL([HAVE_LISTEN_SHUTDOWN], [test
"x$mhd_cv_host_shtdwn_trgr_select" = "xyes"])
-# SENDMSG. Should we check for SCM_RIGHTS instead?
-# https://lists.x.org/archives/xorg-devel/2013-November/038687.html
-AC_SEARCH_LIBS([sendmsg], [socket], [AC_DEFINE([HAVE_SENDMSG],[1],[Define if
your platform supports sendmsg])])
MHD_CHECK_FUNC([writev],
[[#include <sys/uio.h>]],
[[
@@ -1182,6 +1205,51 @@ MHD_CHECK_FUNC([writev],
return 2;
]]
)
+MHD_FIND_LIB([sendmsg],
+ [[
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SOCKLIB_H
+#include <sockLib.h>
+#endif
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>
+#endif
+ ]],
+ [[
+ struct msghdr msg;
+ struct iovec iov;
+ unsigned int i;
+ char some_str[5] = "test";
+
+ iov.iov_base = (void*)some_str;
+ iov.iov_len = 4;
+
+ for (i = 0; i < (unsigned int) sizeof(msg); i++)
+ {
+ *(((unsigned char *)&msg) + i) = 0;
+ }
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+
+ if (0 > sendmsg(1, &msg, 0))
+ return -1;
+ ]],
+ [socket],
+ [
+ AC_DEFINE([HAVE_SENDMSG],[1],[Define to '1' if your have sendmsg()
function])
+ AS_VAR_IF([[mhd_cv_find_lib_sendmsg]],[["none required"]], [],
+ [
+ MHD_LIBDEPS_PKGCFG="${mhd_cv_find_lib_sendmsg} $MHD_LIBDEPS_PKGCFG"
+ ]
+ )
+ ],[],
+ [MHD_LIBDEPS]
+)
# set GCC options
# use '-fno-strict-aliasing', but only if the compiler
@@ -2002,23 +2070,23 @@ AC_CHECK_DECL([SOCK_NONBLOCK],
[AC_DEFINE([HAVE_SOCK_NONBLOCK], [1], [SOCK_NONBL
]]
)
-
-AC_CHECK_DECL([[clock_gettime]],
+MHD_FIND_LIB([clock_gettime],[[#include <time.h>]],
+ [[
+ struct timespec tp;
+ if (0 > clock_gettime(CLOCK_REALTIME, &tp))
+ return 3;
+ ]],
+ [rt],
[
- SAVE_LIBS="$LIBS"
- AC_SEARCH_LIBS([clock_gettime], [rt],
- [
- AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])
- AS_VAR_IF([[ac_cv_search_clock_gettime]],[["none required"]], [],
- [
- MHD_LIBDEPS="$ac_cv_search_clock_gettime $MHD_LIBDEPS"
- MHD_LIBDEPS_PKGCFG="$ac_cv_search_clock_gettime $MHD_LIBDEPS_PKGCFG"
- ])
- ], [], [$MHD_LIBDEPS])
- LIBS="$SAVE_LIBS"
- ], [], [[
-#include <time.h>
- ]])
+ AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define to '1' if you have
clock_gettime() function])
+ AS_VAR_IF([[mhd_cv_find_lib_clock_gettime]],[["none required"]], [],
+ [
+ MHD_LIBDEPS_PKGCFG="${mhd_cv_find_lib_clock_gettime}
$MHD_LIBDEPS_PKGCFG"
+ ]
+ )
+ ],[],
+ [MHD_LIBDEPS]
+)
AC_MSG_CHECKING([[for clock_get_time]])
AC_LINK_IFELSE(
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 50/156: mhd_check_func.m4: updated, (continued)
- [libmicrohttpd] 50/156: mhd_check_func.m4: updated, gnunet, 2023/05/28
- [libmicrohttpd] 53/156: mhd_find_lib.m4: fixed compatibility with old autoconf, gnunet, 2023/05/28
- [libmicrohttpd] 52/156: mhd_find_lib.m4: added new autoconf macro, gnunet, 2023/05/28
- [libmicrohttpd] 59/156: configure: fixed some compiler warnings for checks, gnunet, 2023/05/28
- [libmicrohttpd] 58/156: mhd_shutdown_socket_trigger.m4: fixed compiler warning, gnunet, 2023/05/28
- [libmicrohttpd] 61/156: libcurl.m4: patched to fix compiler warning, gnunet, 2023/05/28
- [libmicrohttpd] 60/156: libcurl.m4: updated to the latest version, gnunet, 2023/05/28
- [libmicrohttpd] 63/156: configure: fixed more compiler warnings in log, gnunet, 2023/05/28
- [libmicrohttpd] 56/156: configure: fixed checks for tsearch() and related, gnunet, 2023/05/28
- [libmicrohttpd] 57/156: Makefile: fixed build with 'make' without nested vars support, gnunet, 2023/05/28
- [libmicrohttpd] 62/156: configure: fixed checking for system libs, fixed .pc file,
gnunet <=
- [libmicrohttpd] 65/156: configure: cosmetics, gnunet, 2023/05/28
- [libmicrohttpd] 64/156: configure: fixed potential compiler warnings, added usage of cache vars, gnunet, 2023/05/28
- [libmicrohttpd] 68/156: mhd_shutdown_socket_trigger.m4: fixed preprocessor conditional, gnunet, 2023/05/28
- [libmicrohttpd] 72/156: HTTPS test: fixed unmatched function declaration, gnunet, 2023/05/28
- [libmicrohttpd] 73/156: Disabled badly broken TLS tests, gnunet, 2023/05/28
- [libmicrohttpd] 84/156: autoinit_funcs.h: improved formatting, gnunet, 2023/05/28
- [libmicrohttpd] 85/156: Fixed many macros, gnunet, 2023/05/28
- [libmicrohttpd] 79/156: Updated libtool fixes, gnunet, 2023/05/28
- [libmicrohttpd] 90/156: autoinit_funcs.h: unified English spelling (prefer GB over US), gnunet, 2023/05/28
- [libmicrohttpd] 94/156: test_postform: updated to support the new libcurl API, gnunet, 2023/05/28