[libbluray-devel] [PATCH] Set POSIX_C_SOURCE appropriately
Sean McGovern
gseanmcg at gmail.com
Tue Nov 27 07:15:45 CET 2012
Solaris 10 doesn't support POSIX.1-2008. Truthfully, this
seems to be only to gain access to strdup() and getline().
The code that uses getline() is for Linux only, and strdup()
usage has already been switched to an internal implementation.
---
configure.ac | 6 ++++++
src/Makefile.am | 2 +-
src/examples/Makefile.am | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index ab82d57..99d6a44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -263,6 +263,11 @@ if [[ $use_bdjava = "yes" ]]; then
fi
AM_CONDITIONAL([USING_BDJAVA], [ test $use_bdjava = "yes" ])
+case $target_os in
+ solaris*) POSIX_C_SOURCE=200112L ;;
+ *) POSIX_C_SOURCE=200809L ;;
+esac
+
# generate documentation
DX_INIT_DOXYGEN(libbluray, doc/doxygen-config, [doc/doxygen])
@@ -281,6 +286,7 @@ AC_SUBST(LT_VERSION_INFO)
# generate output files
AC_SUBST(BDJAVA_CFLAGS)
AC_SUBST(DLOPEN_LIBS)
+AC_SUBST(POSIX_C_SOURCE)
AC_SUBST(SET_WARNINGS)
AC_SUBST(SET_OPTIMIZATIONS)
AC_SUBST(SET_DEBUG_OPTS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 5afebc7..3b4472f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,7 +2,7 @@ LIB_VERSION_INFO="@LT_VERSION_INFO@"
SUBDIRS= . examples
-SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200809L -D_REENTRANT
+SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=@POSIX_C_SOURCE@ -D_REENTRANT
SET_WARNINGS = @SET_WARNINGS@
SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@
SET_DEBUG_OPTS = @SET_DEBUG_OPTS@
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 274be1a..d54d9e1 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -1,4 +1,4 @@
-SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200809L -D_REENTRANT
+SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=@POSIX_C_SOURCE@ -D_REENTRANT
SET_WARNINGS = @SET_WARNINGS@
SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@
SET_DEBUG_OPTS = @SET_DEBUG_OPTS@
--
1.7.12
More information about the libbluray-devel
mailing list