build: Fix configure.ac indentation

Use the same style as the newly added code, which should make the code
more readable, and produce more conforming C output.
This commit is contained in:
Guillem Jover 2022-12-13 03:31:38 +01:00
parent b7a8bc22c9
commit 80f1927dcd

View File

@ -6,7 +6,13 @@ AC_CONFIG_SRCDIR([src/strlcpy.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.11 foreign nostdinc subdir-objects no-dist-gzip dist-xz])
AM_INIT_AUTOMAKE(
[1.11]
[foreign]
[nostdinc]
[subdir-objects]
[no-dist-gzip dist-xz]
)
AM_SILENT_RULES([yes])
LIBBSD_ABI_MAJOR=0
@ -39,8 +45,7 @@ AC_CACHE_CHECK([if ld supports --version-script flag],
])
LDFLAGS="$save_LDFLAGS"
rm -f conftest.map
]
)
])
AM_CONDITIONAL([HAVE_LINKER_VERSION_SCRIPT],
[test "x$libbsd_cv_version_script" = "xyes"])
@ -143,7 +148,14 @@ AS_CASE([$host_os],
AM_CONDITIONAL([OS_WINDOWS], [test "x$is_windows" = "xyes"])
# Checks for header files.
AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h pwd.h grp.h])
AC_CHECK_HEADERS([\
sys/ndir.h \
sys/dir.h \
ndir.h \
dirent.h \
pwd.h \
grp.h \
])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
@ -156,30 +168,30 @@ AC_TYPE_UID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_DECL([F_CLOSEM],
[AC_DEFINE([HAVE_FCNTL_CLOSEM], [1],
[Define to 1 if you have fcntl(F_CLOSEM)])],
[],
[#include <limits.h>
#include <fcntl.h>])
AC_CHECK_DECL([F_CLOSEM], [
AC_DEFINE([HAVE_FCNTL_CLOSEM], [1],
[Define to 1 if you have fcntl(F_CLOSEM)])
], [], [[
#include <limits.h>
#include <fcntl.h>
]])
AC_CACHE_CHECK(
[for GNU .init_array section support],
[libbsd_cv_gnu_init_array_support],
[AC_RUN_IFELSE(
[AC_LANG_SOURCE(
[[
AC_CACHE_CHECK([for GNU .init_array section support],
[libbsd_cv_gnu_init_array_support], [
AC_RUN_IFELSE([
AC_LANG_SOURCE([[
static int rc = 1;
static void init(int argc) { if (argc == 1) rc = 0; }
void (*init_func)(int argc) __attribute__((__section__(".init_array"), __used__)) = init;
int main() { return rc; }
]]
)],
[libbsd_cv_gnu_init_array_support=yes],
[libbsd_cv_gnu_init_array_support=no],
[AC_PREPROC_IFELSE(
[AC_LANG_SOURCE(
[[
]])
], [
libbsd_cv_gnu_init_array_support=yes
], [
libbsd_cv_gnu_init_array_support=no
], [
AC_PREPROC_IFELSE([
AC_LANG_SOURCE([[
/* Look for a known libc that supports .init_array with the GNU extension
* to pass main() arguments to the init functions. */
#include <stdlib.h>
@ -197,53 +209,77 @@ int main() { return rc; }
*/
# error unknown whether libc supports GNU .init_array
#endif
]]
)],
[libbsd_cv_gnu_init_array_support=yes],
[libbsd_cv_gnu_init_array_support=no])
]
)]
)
]])
], [
libbsd_cv_gnu_init_array_support=yes
], [
libbsd_cv_gnu_init_array_support=no
])
])
])
AM_CONDITIONAL([BUILD_LIBBSD_CTOR],
[test "$libbsd_cv_gnu_init_array_support" = yes])
# 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],
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_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
AC_MSG_CHECKING([for __progname])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[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_LINK_IFELSE([
AC_LANG_PROGRAM([[
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 *);
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],
__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([yes])
], [
LIBBSD_LIBS="$LIBBSD_LIBS -pthread"
AC_MSG_RESULT([no])
])
])
AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
getauxval getentropy getexecname getline \
pstat_getproc sysconf])
AC_CHECK_FUNCS([\
clearenv \
dirfd \
fopencookie \
__fpurge \
getauxval \
getentropy \
getexecname \
getline \
pstat_getproc \
sysconf \
])
AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xyes"])
AM_CONDITIONAL([HAVE_FOPENCOOKIE], [test "x$ac_cv_func_fopencookie" = "xyes"])