We need to explicitly define _GNU_SOURCE when building our code as we use it
configure when running the tests and it's not predefined by Sun CC, unlike g++
so we need to add it to CXXFLAGS ourselves.
An alternative solution would be to run the tests without _GNU_SOURCE but this
would lose too much functionality so it doesn't seem like a good idea.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69936
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#define _GNU_SOURCE 1
_ACEOF
#define _GNU_SOURCE 1
_ACEOF
+
+ GNU_SOURCE_FLAG="-D_GNU_SOURCE"
+ CFLAGS="$GNU_SOURCE_FLAG $CFLAGS"
fi
if test "x$USE_AIX" = "x1"; then
fi
if test "x$USE_AIX" = "x1"; then
if test "x$SUNCXX" = xyes; then
if test "x$SUNCXX" = xyes; then
- CXXFLAGS="-features=tmplife $CXXFLAGS"
+ CXXFLAGS="-features=tmplife $GNU_SOURCE_FLAG $CXXFLAGS"
fi
if test "x$SUNCC" = xyes; then
fi
if test "x$SUNCC" = xyes; then
dnl succeed, otherwise things like pthread_mutexattr_settype() (and many
dnl others) wouldn't be detected.
AC_DEFINE(_GNU_SOURCE)
dnl succeed, otherwise things like pthread_mutexattr_settype() (and many
dnl others) wouldn't be detected.
AC_DEFINE(_GNU_SOURCE)
+
+ dnl For non-g++ compilers (including gcc, as mentioned above) we need to
+ dnl add this flag explicitly when building our own code later too.
+ GNU_SOURCE_FLAG="-D_GNU_SOURCE"
+ CFLAGS="$GNU_SOURCE_FLAG $CFLAGS"
fi
if test "x$USE_AIX" = "x1"; then
fi
if test "x$USE_AIX" = "x1"; then
dnl With Sun CC, temporaries have block scope by default. This flag is needed
dnl to get the expression scope behaviour that conforms to the standard.
if test "x$SUNCXX" = xyes; then
dnl With Sun CC, temporaries have block scope by default. This flag is needed
dnl to get the expression scope behaviour that conforms to the standard.
if test "x$SUNCXX" = xyes; then
- CXXFLAGS="-features=tmplife $CXXFLAGS"
+ CXXFLAGS="-features=tmplife $GNU_SOURCE_FLAG $CXXFLAGS"
fi
dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do
fi
dnl Sun X11 headers are (still, in 2005!) non-ANSI and the best they could do