File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -236,13 +236,21 @@ esac
236236
237237dnl Detect musl libc
238238AC_MSG_CHECKING ( [ whether we are using musl libc] )
239- if command -v ldd >/dev/null && ldd --version 2>&1 | grep ^musl >/dev/null 2>&1
240- then
241- AC_MSG_RESULT ( [ yes] )
242- AC_DEFINE ( [ __MUSL__] , [ 1] , [ Define to 1 when using musl libc.] )
243- else
244- AC_MSG_RESULT ( [ no] )
245- fi
239+ AC_COMPILE_IFELSE (
240+ [ AC_LANG_SOURCE ( [ [
241+ #ifndef _GNU_SOURCE
242+ #define _GNU_SOURCE
243+ #endif
244+ #include <features.h>
245+ #ifdef __USE_GNU
246+ #error Not using musl
247+ #endif
248+ int main() { return 0; }
249+ ] ] ) ] ,
250+ [ AC_MSG_RESULT ( [ yes] )
251+ AC_DEFINE ( [ __MUSL__] , [ 1] , [ Define to 1 when using musl libc.] ) ] ,
252+ [ AC_MSG_RESULT ( [ no] ) ]
253+ )
246254
247255dnl Add _GNU_SOURCE compile definition because the php_config.h with definitions
248256dnl by AC_USE_SYSTEM_EXTENSIONS might be included after the system headers which
You can’t perform that action at this time.
0 commit comments