[FFmpeg-devel] [PATCH] Enable C99 in Solaris C library
Måns Rullgård
mans
Wed Jun 10 22:29:19 CEST 2009
Jeff Downs <heydowns at borg.com> writes:
> 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
>
> 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"
Does the Sun 'c99' compiler include this automatically as the man page
seems to suggest? If so, I would say the bug is in gcc, and we should
not be using this workaround. It will fail to link if gcc is fixed or
the Sun compiler is used.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list