Archive

Posts Tagged ‘OpenSolaris’

Installing ffmpeg on OpenSolaris

September 1, 2008 Indraneel 3 comments

We have been using Joyent accelerators to host Alpha and Beta versions of some of our products. One of the products that we are building needed ffmpeg to convert videos to flv format for streaming. Joyent accelerators use OpenSolaris 5.11. I thought I would just get ffmpeg and install it from source. “make” went along fine for sometime but bombed with the following error:

In file included from /usr/include/sys/int_types.h:55,
from /usr/include/sys/stdint.h:38,
from /usr/include/stdint.h:38,
from ./libavcodec/bitstream.h:29,
from libavformat/rtpdec.c:25:
/usr/include/sys/feature_tests.h:353:2:
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications and pre-2001 POSIX applications"

So I opened up “configure” and saw the following c99 directives:
check_cflags -std=c99 and
add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112

I look inside the file rtpdec.c inside the directory libavformat and I find this:
#define _XOPEN_SOURCE 500
This clearly conflicts with the “-std=c99″ settings.
So I change it to
#define _XOPEN_SOURCE 600
Two other files utils.c inside libavcodec directory and ffmpeg.c had the same problem. I applied the same fix there.
It compiled fine thereafter and that saved my day.

Categories: Ruby on Rails Tags: ,