2010-08-19 06:01:43 +00:00
dnl ==================================================================
dnl Checks for library functions.
dnl ==================================================================
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_MMAP
2021-11-20 03:13:46 +00:00
2010-08-19 06:01:43 +00:00
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(
2021-05-31 06:47:54 +00:00
access _access bsearch_r connect dlopen execvp fcntl ftime _ftime \
getaddrinfo \
2012-08-19 04:03:48 +00:00
gethostbyname gethostname getnameinfo getpagesize gettimeofday getuid \
2021-03-27 11:09:37 +00:00
getwd ioctl mkdir _mkdir mprotect putenv qsort_r select sigaction \
snprintf _snprintf socket stat strcasestr strerror strerror_r strndup \
strnlen \
strsep strstr vsnprintf _vsnprintf wait
2010-08-19 06:01:43 +00:00
)
2016-01-03 12:16:23 +00:00
AC_FUNC_VA_COPY
AC_FUNC__VA_COPY
AH_VERBATIM([DEFINE_VA_COPY],
[#ifndef HAVE_VA_COPY
# ifdef HAVE__VA_COPY
# define va_copy(d,s) __va_copy ((d), (s))
# else
# define va_copy(d,s) memcpy (&(d), &(s), sizeof (va_list))
# endif
#endif])
2010-08-19 06:01:43 +00:00
DL_LIBS=""
if test "x$ac_cv_func_dlopen" != "xyes"; then
AC_CHECK_LIB(dl, dlopen,
2012-08-19 04:03:48 +00:00
AC_DEFINE(HAVE_DLOPEN, 1, [Define if you have the dlopen function.])
DL_LIBS="-ldl"
2010-08-19 06:01:43 +00:00
)
fi
AC_SUBST(DL_LIBS)
2019-07-08 15:44:48 +00:00
if test "x$DL_LIBS" != "x"; then
AC_MSG_CHECKING([for RTLD_NOW])
2021-11-20 03:13:46 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dlfcn.h>]], [[int foo = RTLD_NOW]])],[AC_DEFINE(HAVE_RTLD_NOW, 1, Define if you have RTLD_NOW.)
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
])
2019-07-08 15:44:48 +00:00
AC_MSG_CHECKING([for RTLD_DEEPBIND])
2021-11-20 03:13:46 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dlfcn.h>]], [[int foo = RTLD_DEEPBIND]])],[AC_DEFINE(HAVE_RTLD_DEEPBIND, 1, Define if you have RTLD_DEEPBIND.)
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
])
2019-07-08 15:44:48 +00:00
fi
2010-08-19 06:01:43 +00:00
dnl Checks for stricmp/strcasecmp
#AC_CHECK_FUNC(strcasecmp,
# ,
# AC_CHECK_FUNC(stricmp,
# AC_DEFINE(strcasecmp, stricmp)
# )
#)
AC_CHECK_FUNC(strcasecmp, strcasecmp=yes, strcasecmp=no)
if test "x$strcasecmp" = xno; then
AC_CHECK_FUNC(stricmp,
AC_DEFINE(strcasecmp, stricmp, [Define strcasecmp as stricmp if you have one but not the other]),
AC_MSG_ERROR([Neither stricmp nor strcasecmp found])
)
fi
dnl Check for vsnprintf
if test "x$ac_cv_func_vsnprintf" = "xno" -a \
"x$ac_cv_func__vsnprintf" = "xno"; then
dnl libdb may have this
AC_CHECK_LIB(db,vsnprintf)
fi
AC_CHECK_FUNCS(usleep)
AC_MSG_CHECKING(for fnmatch)
2021-11-20 03:13:46 +00:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[fnmatch();]])],[BUILD_FNMATCH=no
AC_MSG_RESULT(yes)],[BUILD_FNMATCH=yes
2010-08-19 06:01:43 +00:00
AC_MSG_RESULT(no)
2021-11-20 03:13:46 +00:00
])
2010-08-19 06:01:43 +00:00
AM_CONDITIONAL(BUILD_FNMATCH, test "x$BUILD_FNMATCH" = "xyes")
2012-08-18 03:12:45 +00:00
AC_MSG_CHECKING(for opendir)
2021-11-20 03:13:46 +00:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[opendir();]])],[BUILD_DIRENT=no
AC_MSG_RESULT(yes)],[BUILD_DIRENT=yes
2012-08-18 03:12:45 +00:00
AC_MSG_RESULT(no)
2021-11-20 03:13:46 +00:00
])
2012-08-18 03:12:45 +00:00
AM_CONDITIONAL(BUILD_DIRENT, test "x$BUILD_DIRENT" = "xyes")
2010-08-19 06:01:43 +00:00
AC_MSG_CHECKING(for getopt_long)
2021-11-20 03:13:46 +00:00
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[getopt_long();]])],[BUILD_GETOPT=no
AC_MSG_RESULT(yes)],[BUILD_GETOPT=yes
2010-08-19 06:01:43 +00:00
AC_MSG_RESULT(no)
2021-11-20 03:13:46 +00:00
])
2010-08-19 06:01:43 +00:00
AM_CONDITIONAL(BUILD_GETOPT, test "x$BUILD_GETOPT" = "xyes")
2012-02-05 05:23:33 +00:00
AC_MSG_CHECKING(for log2f)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <math.h>]], [float (*foo)(float) = log2f;])],
AC_DEFINE(HAVE_LOG2F, 1, [Define if you have log2f.])
[HAVE_LOG2F=yes],
[HAVE_LOG2F=no])
AC_MSG_RESULT($HAVE_LOG2F)