Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,21 @@ esac

dnl Detect musl libc
AC_MSG_CHECKING([whether we are using musl libc])
if command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1
then
AC_MSG_RESULT([yes])
AC_DEFINE([__MUSL__], [1], [Define to 1 when using musl libc.])
else
AC_MSG_RESULT([no])
fi
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <features.h>
#ifdef __USE_GNU
#error Not using musl
#endif
int main(void) { return 0; }
]])],
[AC_MSG_RESULT([yes])
AC_DEFINE([__MUSL__], [1], [Define to 1 when using musl libc.])],
[AC_MSG_RESULT([no])]
)

dnl Add _GNU_SOURCE compile definition because the php_config.h with definitions
dnl by AC_USE_SYSTEM_EXTENSIONS might be included after the system headers which
Expand Down