summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2011-05-11 17:52:51 +0200
committerDiego Biurrun <diego@biurrun.de>2011-05-12 11:41:59 +0200
commit046f081b46c8479820409cf8f530b988221bd15b (patch)
tree7926931a77448c75214f2af2498bba23524c8e34 /configure
parent45faf7fcd335b91e41b0e3ba4e397a9640d8c694 (diff)
configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.
Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems since it causes certain system functions to be hidden on some (BSD) systems. The solution is to only add the flag on systems that really require it, i.e. glibc-based ones. This change makes BSD systems compile out-of-the-box without the need for adding specific flags manually. It also allows dropping a number of flags set manually on a file-per-file basis, but were only present to work around breakage introduced by the presence of _POSIX_C_SOURCE. Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems. We use XSI extensions in several places already, so it is preferable to define it globally instead of littering source files with individual #defines only needed for glibc.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure6
1 files changed, 3 insertions, 3 deletions
diff --git a/configure b/configure
index 955a568684..40f30ddbb6 100755
--- a/configure
+++ b/configure
@@ -1664,7 +1664,7 @@ LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
CC_O='-o $@'
-host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
+host_cflags='-D_ISOC99_SOURCE -O3 -g -Wall'
host_libs='-lm'
target_path='$(CURDIR)'
@@ -2316,7 +2316,7 @@ if test "$?" != 0; then
die "C compiler test failed."
fi
-add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
+add_cppflags -D_ISOC99_SOURCE
check_cflags -std=c99
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
#include <stdlib.h>
@@ -2364,7 +2364,6 @@ case $target_os in
disable symver
oss_indev_extralibs="-lossaudio"
oss_outdev_extralibs="-lossaudio"
- add_cppflags -D_XOPEN_SOURCE=600
;;
openbsd)
enable malloc_aligned
@@ -2457,6 +2456,7 @@ case $target_os in
enable dos_paths
;;
linux)
+ add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
enable dv1394
;;
irix*)