Changeset View
Changeset View
Standalone View
Standalone View
contrib/ldns/acx_nlnetlabs.m4
# acx_nlnetlabs.m4 - common macros for configure checks | # acx_nlnetlabs.m4 - common macros for configure checks | ||||
# Copyright 2009, Wouter Wijngaards, NLnet Labs. | # Copyright 2009, Wouter Wijngaards, NLnet Labs. | ||||
# BSD licensed. | # BSD licensed. | ||||
# | # | ||||
# Version 34 | # Version 41 | ||||
# 2021-07-30 fix for openssl use of lib64 directory. | |||||
# 2021-06-14 fix nonblocking test to use host instead of target for mingw test. | |||||
# 2021-05-17 fix nonblocking socket test from grep on mingw32 to mingw for | |||||
# 64bit compatibility. | |||||
# 2021-03-24 fix ACX_FUNC_DEPRECATED to use CPPFLAGS and CFLAGS. | |||||
# 2021-01-05 fix defun for aclocal | |||||
# 2021-01-05 autoconf 2.70 autoupdate and fixes, no AC_TRY_COMPILE | |||||
# 2020-08-24 Use EVP_sha256 instead of HMAC_Update (for openssl-3.0.0). | |||||
# 2016-03-21 Check -ldl -pthread for libcrypto for ldns and openssl 1.1.0. | # 2016-03-21 Check -ldl -pthread for libcrypto for ldns and openssl 1.1.0. | ||||
# 2016-03-21 Use HMAC_Update instead of HMAC_CTX_Init (for openssl-1.1.0). | # 2016-03-21 Use HMAC_Update instead of HMAC_CTX_Init (for openssl-1.1.0). | ||||
# 2016-01-04 -D_DEFAULT_SOURCE defined with -D_BSD_SOURCE for Linux glibc 2.20 | # 2016-01-04 -D_DEFAULT_SOURCE defined with -D_BSD_SOURCE for Linux glibc 2.20 | ||||
# 2015-12-11 FLTO check for new OSX, clang. | # 2015-12-11 FLTO check for new OSX, clang. | ||||
# 2015-11-18 spelling check fix. | # 2015-11-18 spelling check fix. | ||||
# 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly. | # 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly. | ||||
# 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added. | # 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added. | ||||
# 2015-03-17 AHX_CONFIG_REALLOCARRAY added | # 2015-03-17 AHX_CONFIG_REALLOCARRAY added | ||||
▲ Show 20 Lines • Show All 427 Lines • ▼ Show 20 Lines | |||||
dnl Check the printf-format attribute (if any) | dnl Check the printf-format attribute (if any) | ||||
dnl result in HAVE_ATTR_FORMAT. | dnl result in HAVE_ATTR_FORMAT. | ||||
dnl Make sure you also include the AHX_CONFIG_FORMAT_ATTRIBUTE. | dnl Make sure you also include the AHX_CONFIG_FORMAT_ATTRIBUTE. | ||||
AC_DEFUN([ACX_CHECK_FORMAT_ATTRIBUTE], | AC_DEFUN([ACX_CHECK_FORMAT_ATTRIBUTE], | ||||
[AC_REQUIRE([AC_PROG_CC]) | [AC_REQUIRE([AC_PROG_CC]) | ||||
AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "format" attribute) | AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "format" attribute) | ||||
AC_CACHE_VAL(ac_cv_c_format_attribute, | AC_CACHE_VAL(ac_cv_c_format_attribute, | ||||
[ac_cv_c_format_attribute=no | [ac_cv_c_format_attribute=no | ||||
AC_TRY_COMPILE( | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> | ||||
[#include <stdio.h> | |||||
void f (char *format, ...) __attribute__ ((format (printf, 1, 2))); | void f (char *format, ...) __attribute__ ((format (printf, 1, 2))); | ||||
void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2))); | void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2))); | ||||
], [ | ]], [[ | ||||
f ("%s", "str"); | f ("%s", "str"); | ||||
], | ]])],[ac_cv_c_format_attribute="yes"],[ac_cv_c_format_attribute="no"]) | ||||
[ac_cv_c_format_attribute="yes"], | |||||
[ac_cv_c_format_attribute="no"]) | |||||
]) | ]) | ||||
AC_MSG_RESULT($ac_cv_c_format_attribute) | AC_MSG_RESULT($ac_cv_c_format_attribute) | ||||
if test $ac_cv_c_format_attribute = yes; then | if test $ac_cv_c_format_attribute = yes; then | ||||
AC_DEFINE(HAVE_ATTR_FORMAT, 1, [Whether the C compiler accepts the "format" attribute]) | AC_DEFINE(HAVE_ATTR_FORMAT, 1, [Whether the C compiler accepts the "format" attribute]) | ||||
fi | fi | ||||
])dnl End of ACX_CHECK_FORMAT_ATTRIBUTE | ])dnl End of ACX_CHECK_FORMAT_ATTRIBUTE | ||||
Show All 12 Lines | |||||
dnl Check how to mark function arguments as unused. | dnl Check how to mark function arguments as unused. | ||||
dnl result in HAVE_ATTR_UNUSED. | dnl result in HAVE_ATTR_UNUSED. | ||||
dnl Make sure you include AHX_CONFIG_UNUSED_ATTRIBUTE also. | dnl Make sure you include AHX_CONFIG_UNUSED_ATTRIBUTE also. | ||||
AC_DEFUN([ACX_CHECK_UNUSED_ATTRIBUTE], | AC_DEFUN([ACX_CHECK_UNUSED_ATTRIBUTE], | ||||
[AC_REQUIRE([AC_PROG_CC]) | [AC_REQUIRE([AC_PROG_CC]) | ||||
AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "unused" attribute) | AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "unused" attribute) | ||||
AC_CACHE_VAL(ac_cv_c_unused_attribute, | AC_CACHE_VAL(ac_cv_c_unused_attribute, | ||||
[ac_cv_c_unused_attribute=no | [ac_cv_c_unused_attribute=no | ||||
AC_TRY_COMPILE( | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> | ||||
[#include <stdio.h> | |||||
void f (char *u __attribute__((unused))); | void f (char *u __attribute__((unused))); | ||||
], [ | ]], [[ | ||||
f ("x"); | f ("x"); | ||||
], | ]])],[ac_cv_c_unused_attribute="yes"],[ac_cv_c_unused_attribute="no"]) | ||||
[ac_cv_c_unused_attribute="yes"], | |||||
[ac_cv_c_unused_attribute="no"]) | |||||
]) | ]) | ||||
dnl Setup ATTR_UNUSED config.h parts. | dnl Setup ATTR_UNUSED config.h parts. | ||||
dnl make sure you call ACX_CHECK_UNUSED_ATTRIBUTE also. | dnl make sure you call ACX_CHECK_UNUSED_ATTRIBUTE also. | ||||
AC_DEFUN([AHX_CONFIG_UNUSED_ATTRIBUTE], | AC_DEFUN([AHX_CONFIG_UNUSED_ATTRIBUTE], | ||||
[ | [ | ||||
#if defined(DOXYGEN) | #if defined(DOXYGEN) | ||||
# define ATTR_UNUSED(x) x | # define ATTR_UNUSED(x) x | ||||
Show All 40 Lines | |||||
]) | ]) | ||||
dnl Perform libtool check, portably, only for C | dnl Perform libtool check, portably, only for C | ||||
AC_DEFUN([ACX_LIBTOOL_C_ONLY], [ | AC_DEFUN([ACX_LIBTOOL_C_ONLY], [ | ||||
dnl as a requirement so that is gets called before LIBTOOL | dnl as a requirement so that is gets called before LIBTOOL | ||||
dnl because libtools 'AC_REQUIRE' names are right after this one, before | dnl because libtools 'AC_REQUIRE' names are right after this one, before | ||||
dnl this function contents. | dnl this function contents. | ||||
AC_REQUIRE([ACX_LIBTOOL_C_PRE]) | AC_REQUIRE([ACX_LIBTOOL_C_PRE]) | ||||
AC_PROG_LIBTOOL | LT_INIT | ||||
]) | ]) | ||||
dnl Detect if u_char type is defined, otherwise define it. | dnl Detect if u_char type is defined, otherwise define it. | ||||
AC_DEFUN([ACX_TYPE_U_CHAR], | AC_DEFUN([ACX_TYPE_U_CHAR], | ||||
[AC_CHECK_TYPE([u_char], , | [AC_CHECK_TYPE([u_char], , | ||||
[AC_DEFINE([u_char], [unsigned char], [Define to 'unsigned char if not defined])], [ | [AC_DEFINE([u_char], [unsigned char], [Define to 'unsigned char if not defined])], [ | ||||
AC_INCLUDES_DEFAULT | AC_INCLUDES_DEFAULT | ||||
#ifdef HAVE_WINSOCK2_H | #ifdef HAVE_WINSOCK2_H | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | if test x_$withval != x_no; then | ||||
done | done | ||||
if test x_$found_ssl != x_yes; then | if test x_$found_ssl != x_yes; then | ||||
AC_MSG_ERROR(Cannot find the SSL libraries in $withval) | AC_MSG_ERROR(Cannot find the SSL libraries in $withval) | ||||
else | else | ||||
AC_MSG_RESULT(found in $ssldir) | AC_MSG_RESULT(found in $ssldir) | ||||
HAVE_SSL=yes | HAVE_SSL=yes | ||||
dnl assume /usr is already in the lib and dynlib paths. | dnl assume /usr is already in the lib and dynlib paths. | ||||
if test "$ssldir" != "/usr" -a "$ssldir" != ""; then | if test "$ssldir" != "/usr" -a "$ssldir" != ""; then | ||||
if test ! -d "$ssldir/lib" -a -d "$ssldir/lib64"; then | |||||
LDFLAGS="$LDFLAGS -L$ssldir/lib64" | |||||
LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib64" | |||||
ACX_RUNTIME_PATH_ADD([$ssldir/lib64]) | |||||
else | |||||
LDFLAGS="$LDFLAGS -L$ssldir/lib" | LDFLAGS="$LDFLAGS -L$ssldir/lib" | ||||
LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib" | LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib" | ||||
ACX_RUNTIME_PATH_ADD([$ssldir/lib]) | ACX_RUNTIME_PATH_ADD([$ssldir/lib]) | ||||
fi | fi | ||||
fi | |||||
AC_MSG_CHECKING([for HMAC_Update in -lcrypto]) | AC_MSG_CHECKING([for EVP_sha256 in -lcrypto]) | ||||
LIBS="$LIBS -lcrypto" | LIBS="$LIBS -lcrypto" | ||||
LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" | LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto" | ||||
AC_TRY_LINK(, [ | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ | ||||
int HMAC_Update(void); | int EVP_sha256(void); | ||||
(void)HMAC_Update(); | (void)EVP_sha256(); | ||||
], [ | ]])],[ | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
AC_DEFINE([HAVE_HMAC_UPDATE], 1, | AC_DEFINE([HAVE_EVP_SHA256], 1, | ||||
[If you have HMAC_Update]) | [If you have EVP_sha256]) | ||||
], [ | ],[ | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
# check if -lwsock32 or -lgdi32 are needed. | # check if -lwsock32 or -lgdi32 are needed. | ||||
BAKLIBS="$LIBS" | BAKLIBS="$LIBS" | ||||
BAKSSLLIBS="$LIBSSL_LIBS" | BAKSSLLIBS="$LIBSSL_LIBS" | ||||
LIBS="$LIBS -lgdi32" | LIBS="$LIBS -lgdi32 -lws2_32" | ||||
LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32" | LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32 -lws2_32" | ||||
AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) | AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) | ||||
AC_TRY_LINK([], [ | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ | ||||
int HMAC_Update(void); | int EVP_sha256(void); | ||||
(void)HMAC_Update(); | (void)EVP_sha256(); | ||||
],[ | ]])],[ | ||||
AC_DEFINE([HAVE_HMAC_UPDATE], 1, | AC_DEFINE([HAVE_EVP_SHA256], 1, | ||||
[If you have HMAC_Update]) | [If you have EVP_sha256]) | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
],[ | ],[ | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
LIBS="$BAKLIBS" | LIBS="$BAKLIBS" | ||||
LIBSSL_LIBS="$BAKSSLLIBS" | LIBSSL_LIBS="$BAKSSLLIBS" | ||||
LIBS="$LIBS -ldl" | LIBS="$LIBS -ldl" | ||||
LIBSSL_LIBS="$LIBSSL_LIBS -ldl" | LIBSSL_LIBS="$LIBSSL_LIBS -ldl" | ||||
AC_MSG_CHECKING([if -lcrypto needs -ldl]) | AC_MSG_CHECKING([if -lcrypto needs -ldl]) | ||||
AC_TRY_LINK([], [ | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ | ||||
int HMAC_Update(void); | int EVP_sha256(void); | ||||
(void)HMAC_Update(); | (void)EVP_sha256(); | ||||
],[ | ]])],[ | ||||
AC_DEFINE([HAVE_HMAC_UPDATE], 1, | AC_DEFINE([HAVE_EVP_SHA256], 1, | ||||
[If you have HMAC_Update]) | [If you have EVP_sha256]) | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
],[ | ],[ | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
LIBS="$BAKLIBS" | LIBS="$BAKLIBS" | ||||
LIBSSL_LIBS="$BAKSSLLIBS" | LIBSSL_LIBS="$BAKSSLLIBS" | ||||
LIBS="$LIBS -ldl -pthread" | LIBS="$LIBS -ldl -pthread" | ||||
LIBSSL_LIBS="$LIBSSL_LIBS -ldl -pthread" | LIBSSL_LIBS="$LIBSSL_LIBS -ldl -pthread" | ||||
AC_MSG_CHECKING([if -lcrypto needs -ldl -pthread]) | AC_MSG_CHECKING([if -lcrypto needs -ldl -pthread]) | ||||
AC_TRY_LINK([], [ | AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ | ||||
int HMAC_Update(void); | int EVP_sha256(void); | ||||
(void)HMAC_Update(); | (void)EVP_sha256(); | ||||
],[ | ]])],[ | ||||
AC_DEFINE([HAVE_HMAC_UPDATE], 1, | AC_DEFINE([HAVE_EVP_SHA256], 1, | ||||
[If you have HMAC_Update]) | [If you have EVP_sha256]) | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
],[ | ],[ | ||||
AC_MSG_RESULT(no) | AC_MSG_RESULT(no) | ||||
AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required]) | AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required]) | ||||
]) | ]) | ||||
]) | ]) | ||||
]) | ]) | ||||
]) | ]) | ||||
fi | fi | ||||
AC_SUBST(HAVE_SSL) | AC_SUBST(HAVE_SSL) | ||||
AC_SUBST(RUNTIME_PATH) | AC_SUBST(RUNTIME_PATH) | ||||
fi | fi | ||||
AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT]) | AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT]) | ||||
AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT]) | AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT]) | ||||
AC_CHECK_HEADERS([openssl/rand.h],,, [AC_INCLUDES_DEFAULT]) | AC_CHECK_HEADERS([openssl/rand.h],,, [AC_INCLUDES_DEFAULT]) | ||||
])dnl End of ACX_SSL_CHECKS | ])dnl End of ACX_SSL_CHECKS | ||||
dnl Check for SSL, where SSL is mandatory | dnl Check for SSL, where SSL is mandatory | ||||
dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found | dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found | ||||
dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. | dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. | ||||
dnl Checks main header files of SSL. | dnl Checks main header files of SSL. | ||||
dnl | dnl | ||||
AC_DEFUN([ACX_WITH_SSL], | AC_DEFUN([ACX_WITH_SSL], | ||||
[ | [ | ||||
AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], | AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl=pathname],[enable SSL (will check /usr/local/ssl | ||||
[enable SSL (will check /usr/local/ssl | |||||
/usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ | /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ | ||||
],[ | ],[ | ||||
withval="yes" | withval="yes" | ||||
]) | ]) | ||||
if test x_$withval = x_no; then | if test x_$withval = x_no; then | ||||
AC_MSG_ERROR([Need SSL library to do digital signature cryptography]) | AC_MSG_ERROR([Need SSL library to do digital signature cryptography]) | ||||
fi | fi | ||||
ACX_SSL_CHECKS($withval) | ACX_SSL_CHECKS($withval) | ||||
])dnl End of ACX_WITH_SSL | ])dnl End of ACX_WITH_SSL | ||||
dnl Check for SSL, where ssl is optional (--without-ssl is allowed) | dnl Check for SSL, where ssl is optional (--without-ssl is allowed) | ||||
dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found | dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found | ||||
dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. | dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. | ||||
dnl Checks main header files of SSL. | dnl Checks main header files of SSL. | ||||
dnl | dnl | ||||
AC_DEFUN([ACX_WITH_SSL_OPTIONAL], | AC_DEFUN([ACX_WITH_SSL_OPTIONAL], | ||||
[ | [ | ||||
AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], | AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl=pathname],[enable SSL (will check /usr/local/ssl | ||||
[enable SSL (will check /usr/local/ssl | |||||
/usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ | /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ | ||||
],[ | ],[ | ||||
withval="yes" | withval="yes" | ||||
]) | ]) | ||||
ACX_SSL_CHECKS($withval) | ACX_SSL_CHECKS($withval) | ||||
])dnl End of ACX_WITH_SSL_OPTIONAL | ])dnl End of ACX_WITH_SSL_OPTIONAL | ||||
dnl Setup to use -lssl | dnl Setup to use -lssl | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
]])], | ]])], | ||||
dnl this case on linux, solaris, bsd | dnl this case on linux, solaris, bsd | ||||
[ac_cv_func_getaddrinfo="yes" | [ac_cv_func_getaddrinfo="yes" | ||||
dnl see if on windows | dnl see if on windows | ||||
if test "$ac_cv_header_windows_h" = "yes"; then | if test "$ac_cv_header_windows_h" = "yes"; then | ||||
AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used]) | AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used]) | ||||
USE_WINSOCK="1" | USE_WINSOCK="1" | ||||
if echo $LIBS | grep 'lws2_32' >/dev/null; then | |||||
: | |||||
else | |||||
LIBS="$LIBS -lws2_32" | LIBS="$LIBS -lws2_32" | ||||
fi | fi | ||||
fi | |||||
], | ], | ||||
dnl no quick getaddrinfo, try mingw32 and winsock2 library. | dnl no quick getaddrinfo, try mingw32 and winsock2 library. | ||||
ORIGLIBS="$LIBS" | ORIGLIBS="$LIBS" | ||||
LIBS="$LIBS -lws2_32" | LIBS="$LIBS -lws2_32" | ||||
AC_LINK_IFELSE( | AC_LINK_IFELSE( | ||||
[AC_LANG_PROGRAM( | [AC_LANG_PROGRAM( | ||||
[ | [ | ||||
#ifdef HAVE_WS2TCPIP_H | #ifdef HAVE_WS2TCPIP_H | ||||
Show All 32 Lines | |||||
[ | [ | ||||
AC_REQUIRE([AC_PROG_CC]) | AC_REQUIRE([AC_PROG_CC]) | ||||
AC_MSG_CHECKING(if $1 is deprecated) | AC_MSG_CHECKING(if $1 is deprecated) | ||||
cache=`echo $1 | sed 'y%.=/+-%___p_%'` | cache=`echo $1 | sed 'y%.=/+-%___p_%'` | ||||
AC_CACHE_VAL(cv_cc_deprecated_$cache, | AC_CACHE_VAL(cv_cc_deprecated_$cache, | ||||
[ | [ | ||||
echo '$3' >conftest.c | echo '$3' >conftest.c | ||||
echo 'void f(){ $2 }' >>conftest.c | echo 'void f(){ $2 }' >>conftest.c | ||||
if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then | if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then | ||||
eval "cv_cc_deprecated_$cache=no" | eval "cv_cc_deprecated_$cache=no" | ||||
else | else | ||||
eval "cv_cc_deprecated_$cache=yes" | eval "cv_cc_deprecated_$cache=yes" | ||||
fi | fi | ||||
rm -f conftest conftest.o conftest.c | rm -f conftest conftest.o conftest.c | ||||
]) | ]) | ||||
if eval "test \"`echo '$cv_cc_deprecated_'$cache`\" = yes"; then | if eval "test \"`echo '$cv_cc_deprecated_'$cache`\" = yes"; then | ||||
AC_MSG_RESULT(yes) | AC_MSG_RESULT(yes) | ||||
Show All 9 Lines | |||||
dnl check if select and nonblocking sockets actually work. | dnl check if select and nonblocking sockets actually work. | ||||
dnl Needs fork(2) and select(2). | dnl Needs fork(2) and select(2). | ||||
dnl defines NONBLOCKING_IS_BROKEN, and if that is true multiple reads from | dnl defines NONBLOCKING_IS_BROKEN, and if that is true multiple reads from | ||||
dnl a nonblocking socket do not work, a new call to select is necessary. | dnl a nonblocking socket do not work, a new call to select is necessary. | ||||
AC_DEFUN([ACX_CHECK_NONBLOCKING_BROKEN], | AC_DEFUN([ACX_CHECK_NONBLOCKING_BROKEN], | ||||
[ | [ | ||||
AC_MSG_CHECKING([if nonblocking sockets work]) | AC_MSG_CHECKING([if nonblocking sockets work]) | ||||
if echo $target | grep mingw32 >/dev/null; then | if echo $host | grep mingw >/dev/null; then | ||||
AC_MSG_RESULT([no (windows)]) | AC_MSG_RESULT([no (windows)]) | ||||
AC_DEFINE([NONBLOCKING_IS_BROKEN], 1, [Define if the network stack does not fully support nonblocking io (causes lower performance).]) | AC_DEFINE([NONBLOCKING_IS_BROKEN], 1, [Define if the network stack does not fully support nonblocking io (causes lower performance).]) | ||||
else | else | ||||
AC_RUN_IFELSE([ | AC_RUN_IFELSE([ | ||||
AC_LANG_SOURCE([[ | AC_LANG_SOURCE([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | |||||
fi | fi | ||||
])dnl End of ACX_CHECK_NONBLOCKING_BROKEN | ])dnl End of ACX_CHECK_NONBLOCKING_BROKEN | ||||
dnl Check if mkdir has one or two arguments. | dnl Check if mkdir has one or two arguments. | ||||
dnl defines MKDIR_HAS_ONE_ARG | dnl defines MKDIR_HAS_ONE_ARG | ||||
AC_DEFUN([ACX_MKDIR_ONE_ARG], | AC_DEFUN([ACX_MKDIR_ONE_ARG], | ||||
[ | [ | ||||
AC_MSG_CHECKING([whether mkdir has one arg]) | AC_MSG_CHECKING([whether mkdir has one arg]) | ||||
AC_TRY_COMPILE([ | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#ifdef HAVE_WINSOCK2_H | #ifdef HAVE_WINSOCK2_H | ||||
#include <winsock2.h> | #include <winsock2.h> | ||||
#endif | #endif | ||||
#ifdef HAVE_SYS_STAT_H | #ifdef HAVE_SYS_STAT_H | ||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#endif | #endif | ||||
], [ | ]], [[ | ||||
(void)mkdir("directory"); | (void)mkdir("directory"); | ||||
], | ]])],[AC_MSG_RESULT(yes) | ||||
AC_MSG_RESULT(yes) | |||||
AC_DEFINE(MKDIR_HAS_ONE_ARG, 1, [Define if mkdir has one argument.]) | AC_DEFINE(MKDIR_HAS_ONE_ARG, 1, [Define if mkdir has one argument.]) | ||||
, | ],[AC_MSG_RESULT(no) | ||||
AC_MSG_RESULT(no) | ]) | ||||
) | |||||
])dnl end of ACX_MKDIR_ONE_ARG | ])dnl end of ACX_MKDIR_ONE_ARG | ||||
dnl Check for ioctlsocket function. works on mingw32 too. | dnl Check for ioctlsocket function. works on mingw32 too. | ||||
AC_DEFUN([ACX_FUNC_IOCTLSOCKET], | AC_DEFUN([ACX_FUNC_IOCTLSOCKET], | ||||
[ | [ | ||||
# check ioctlsocket | # check ioctlsocket | ||||
AC_MSG_CHECKING(for ioctlsocket) | AC_MSG_CHECKING(for ioctlsocket) | ||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([ | AC_LINK_IFELSE([AC_LANG_PROGRAM([ | ||||
▲ Show 20 Lines • Show All 367 Lines • Show Last 20 Lines |