[FFmpeg-cvslog] configure: Check if "-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" is needed for localtime_r()

Michael Niedermayer git at videolan.org
Wed Sep 24 05:41:58 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Sep 24 05:04:24 2014 +0200| [170e2fd7c39c430b334ea80a1e4dfb10c6fd1e95] | committer: Michael Niedermayer

configure: Check if "-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" is needed for localtime_r()

Fixes build with musl

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=170e2fd7c39c430b334ea80a1e4dfb10c6fd1e95
---

 configure |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configure b/configure
index 64a5bf9..53a1e38 100755
--- a/configure
+++ b/configure
@@ -4234,6 +4234,15 @@ probe_libc(){
         eval ${pfx}libc_type=solaris
         add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
     fi
+    check_${pfx}cc <<EOF
+#include <time.h>
+void *v = localtime_r;
+EOF
+test "$?" != 0 && check_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
+#include <time.h>
+void *v = localtime_r;
+EOF
+
 }
 
 probe_libc



More information about the ffmpeg-cvslog mailing list