mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-14 15:05:39 +02:00
build: Refactor function checks into a new libbsd-funcs.m4 file
These are complex enough to clutter the main configure.ac. Move them into their own file.
This commit is contained in:
49
configure.ac
49
configure.ac
@@ -187,53 +187,8 @@ AC_CHECK_DECLS([environ], [], [], [[
|
||||
LIBBSD_HAS_GNU_INIT_ARRAY
|
||||
|
||||
# Checks for library functions.
|
||||
AC_MSG_CHECKING([for program_invocation_short_name])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <errno.h>
|
||||
]], [[
|
||||
const char *p = program_invocation_short_name;
|
||||
]])
|
||||
], [
|
||||
AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
|
||||
[Define to 1 if you have program_invocation_short_name])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for __progname])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <stdio.h>
|
||||
extern char *__progname;
|
||||
]], [[
|
||||
printf("%s", __progname);
|
||||
]])
|
||||
], [
|
||||
AC_DEFINE([HAVE___PROGNAME], [1], [Define to 1 if you have __progname])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([for __register_atfork])
|
||||
AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[
|
||||
#include <stddef.h>
|
||||
extern void *__dso_handle;
|
||||
extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
|
||||
]], [[
|
||||
__register_atfork(NULL, NULL, NULL, __dso_handle);
|
||||
]])
|
||||
], [
|
||||
AC_DEFINE([HAVE___REGISTER_ATFORK], [1],
|
||||
[Define to 1 if you have __register_atfork])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
LIBBSD_LIBS="$LIBBSD_LIBS -pthread"
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
LIBBSD_CHECK_PROGNAME
|
||||
LIBBSD_CHECK_REGISTER_ATFORK
|
||||
|
||||
AC_CHECK_FUNCS([\
|
||||
clearenv \
|
||||
|
Reference in New Issue
Block a user