configure: Check if "-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600" is needed for...
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Sep 2014 03:04:24 +0000 (05:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Sep 2014 03:04:24 +0000 (05:04 +0200)
Fixes build with musl

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

index 64a5bf9..53a1e38 100755 (executable)
--- 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