[FFmpeg-devel] [PATCH] Enable C99 in Solaris C library

Jeff Downs heydowns
Wed Jun 10 22:17:38 CEST 2009


By default, the Solaris C library does not run in C99 standard compliant 
mode.  C99 operation can be enabled by linking in a specific object file 
(values-xpg6.o) provided by Solaris.  This is explained in 
the standards manpage
(http://docs.sun.com/app/docs/doc/816-5175/standards-5?a=view).

Regression tests currently fail on Solaris because of this (specifically, 
strtod() lacks hex string support without C99 mode enabled).

Attached patch causes configure to look for, and add to the os-specific 
library list, this object file.

	-Jeff
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 19144)
+++ configure	(working copy)
@@ -1602,6 +1602,21 @@
         SHFLAGS='-shared -Wl,-h,$$(@F)'
         network_extralibs="-lsocket -lnsl"
         add_cflags -D__EXTENSIONS__
+
+        # Solaris needs values-xpg6.o linked in to enable C99 behavior 
+        # in the C library. See standards(5)
+        for xpg6path in 64 32 ; do
+            echo "int main(void){ return 0; }" | 
+                check_ld "/usr/lib/$xpg6path/values-xpg6.o" && 
+                osextralibs="/usr/lib/$xpg6path/values-xpg6.o"
+        done
+        if test -z "$osextralibs" ; then 
+            echo "WARNING: Unable to find values-xpg6.o appropriate for $arch."
+            echo "         The Solaris C library needs this to function in C99"
+            echo "         mode, which is needed for proper ffmpeg operation."
+            echo "         If you have this file, pass it to configure using:"
+            echo "              --extra-libs=/full/path/values-xpg6.o"
+        fi
         ;;
     netbsd)
         oss_demuxer_extralibs="-lossaudio"



More information about the ffmpeg-devel mailing list