Skip to content

Commit 909d331

Browse files
authored
Add _GNU_SOURCE definition unconditionally (#14651)
Since Autoconf >= 2.70 the _GNU_SOURCE and some other extensions are defined unconditionally regardless whether the __EXTENSIONS__ can be safely defined. Some obsolete Solaris systems once had issues with compiling a default set of standard system headers when __EXTENSIONS__ was defined. Autoconf 2.69 and earlier checked based on that and defined the _GNU_SOURCE conditionally. This condition is not relevant on current systems anymore.
1 parent 3cbf5aa commit 909d331

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

configure.ac

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,10 @@ else
259259
AC_MSG_RESULT(no)
260260
fi
261261

262-
dnl The effect of _GNU_SOURCE defined in config.h depeds on includes order
263-
if test "$ac_cv_safe_to_define___extensions__" = yes ; then
264-
AC_MSG_CHECKING(whether to use -D_GNU_SOURCE cflag)
265-
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
266-
AC_MSG_RESULT(yes)
267-
fi
262+
dnl Add _GNU_SOURCE compile definition because the php_config.h with definitions
263+
dnl by AC_USE_SYSTEM_EXTENSIONS might be included after the system headers which
264+
dnl require extensions to C and POSIX.
265+
AS_VAR_APPEND([CPPFLAGS], [" -D_GNU_SOURCE"])
268266

269267
dnl Include Zend configurations.
270268
dnl ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)