开发者

can't compile ffmpeg on Solaris 10 sparc

Has anyone compiled ffmpeg 0.6.1 for Solaris 10 sparc? I'm getting the following errors:

    uname -a
SunOS SERVERNAME 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire-V440

bwddmadm@bwddmliv>/export/home/USERID/ffmpeg-0.6.1/configure --prefix=/export/home/USERID/ffmpegX --extra-cflags="-fPIC" --disable-mmx --disable-protocol=udp --disable-encoder=nellymoser
Broken shell detected.  Trying alternatives.
Trying shell bash
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
Unknown C compiler gcc
awk: syntax error near line 1
awk: illegal statement near line 1
grep: illegal option -- q
Usage: grep -hblcnsviw pattern file . . .
install prefix            /export/home/USERID/ffmpegX
source path               /export/home/USERID/ffmpeg-0.6.1
C compiler                gcc
.align is power-of-two    no
ARCH                      sparc (generic)
big-endian                no
runtime cpu detection     no
VIS enabled               yes
gprof enabled             no
debug symbols             yes
strip symbols             yes
optimizations             yes
static                    yes
shared                    no
postprocessing support    no
new filter support        no
filters using lavformat   no
network support           yes
threading support         no
SDL support               no
Sun medialib support      no
AVISynth enabled          no
libdc1394 support         no
libdirac enabled          no
libfaac enabled           no
libfaad enabled           no
libfaad dlopened          no
libgsm enabled            no
libmp3lame enabled        no
libnut enabled            no
libopencore-amrnb support no
libopencore-amrwb support no
libopenjpeg enabled       no
librtmp enabled           no
libschroedinger enabled   no
libspeex enabled          no
libtheora enabled         no
libvorbis enabled         no
libvpx enabled            no
libx264 enabled           no
libxvid enabled           no
zlib enabled              no
bzlib enabled             no

Enabled decoders:
pr:  -- empty file

Enabled encoders:
pr:  -- empty file

Enabled hwaccels:
pr:  -- empty file

Enabled parsers:
pr:  -- empty file

Enabled demuxers:
pr:  -- empty file

Enabled muxers:
pr:  -- empty file

Enabled protocols:
pr:  -- empty file

Enabled filters:
pr:  -- empty file

Enabled bsfs:
pr:  -- empty file

Enabled indevs:
pr:  -- empty file

Enabled outdevs:
pr:  -- empty file

License: LGPL version 2.1 or later
Creating config.mak and config.h...
bwddmadm@bwddmliv> gmake
/export/home/USERID/ffmpeg-0.6.1/version.sh: syntax error at line 4: `revision=$' unexpected
CC      libavdevice/alldevices.o
libavdevice/alldevices.c: In function `avdevice_register_all':
libavdevice/alldevices.c:42: error: `CONFIG_ALSA_OUTDEV' undeclared (first use in this function)
libavdevice/alldevices.c:42: error: (Each undeclared identifier is reported only once
libavdevice/alldevices.c:42: erro开发者_如何学编程r: for each function it appears in.)
libavdevice/alldevices.c:42: error: `CONFIG_ALSA_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:43: error: `CONFIG_AUDIO_BEOS_OUTDEV' undeclared (first use in this function)
libavdevice/alldevices.c:43: error: `CONFIG_AUDIO_BEOS_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:44: error: `CONFIG_BKTR_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:45: error: `CONFIG_DV1394_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:46: error: `CONFIG_JACK_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:47: error: `CONFIG_OSS_OUTDEV' undeclared (first use in this function)
libavdevice/alldevices.c:47: error: `CONFIG_OSS_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:48: error: `CONFIG_V4L2_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:49: error: `CONFIG_V4L_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:50: error: `CONFIG_VFWCAP_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:51: error: `CONFIG_X11_GRAB_DEVICE_INDEV' undeclared (first use in this function)
libavdevice/alldevices.c:54: error: `CONFIG_LIBDC1394_INDEV' undeclared (first use in this function)
gmake: *** [libavdevice/alldevices.o] Error 1
bwddmadm@bwddmliv> exit

script done on Fri Jan 14 11:34:05 2011


1.- Make sure gcc is installed

install gcc if needed
# pkg search gcc
# pkg install pkg:/developer/gcc-45@4.5.2-0.175.1.0.0.24.0

2.- Make sure yams is installed

install yams if needed
download from http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
unzip, untar in local dir
#./configure
#make install
add the path
# PATH=$PATH:/usr/local/bin

3.- Make sure GNU Make is installed

Installed if required
# pkg search gnu make
# pkg install pkg:/developer/build/gnu-make@3.82-0.175.1.0.0.24.0

4.- Make sure that it picks up the correct grep

e.g. by aliasing grep to /usr/sfw/bin/ggrep if you have the Sun Freeware package installed

5.- Download source code : http://ffmpeg.org/releases/ffmpeg-1.0.tar.gz

a.- unzip, untar in local dir
b.- edit configure
    1.- replace awk by nawk
    2.- follow the patch configuration from https://trac.handbrake.fr/browser/trunk/contrib/patch-ffmpeg-solaris.patch?rev=1531
        Some details about the reasons here : http://www.techques.com/question/1-4690966/can't-compile-ffmpeg-on-Solaris-10-sparc
        Be careful the line numbers are not valid for version 1.0
        place the modifications suggested accordingly 
c.- #./configure
d.- # gmake

Noël Jaffré


Unfortunately, Solaris /usr/bin/grep does not support the -q flag, it looks like you'll need to set your path to either find GNU grep or the POSIX-compliant /usr/xpg4/bin/grep as the grep command. Google can also find a couple patches to ffmpeg that people have written to solve this.

The ffmpeg authors know of this problem, but refuse to change their configure script, since they rely on POSIX-compliance.


It looks like the build script is expecting to find the GNU versions of helpers like grep. Make sure that it picks up the correct ones, e.g. by aliasing grep to /usr/sfw/bin/ggrep if you have the Sun Freeware package installed.


After spending several hours on this topic I finally installed ffmpeg 2.2.2 on Solaris 5.1 SPARC. Steps:

  • Download tar source of latest version from http://www.ffmpeg.org/download.html
  • Extract the tar
  • Grep should refer to GGREP - alias grep = /usr/sfw/bin/ggrep
  • Use bash instead of sh - 1st row of configuration and version.sh files needs to be modified
  • Use nawk instead of awk
  • The config handles implicit-function-declaration warning as error. This might cause problem - I had to set it back to warning level as it caused an error regarding a missing reference (which was a standard library so it should not be a problem)
  • Regarding the 4-6 points apply the following commands
  • sed 's/\/bin\/sh/\/bin\/bash/' configure > configure.mod
  • sed 's/awk/nawk/' configure.mod > configure.mod2
  • sed '/implicit-function-declaration/d' configure.mod2 > configure.mod3

  • cp configure.mod3 configure

  • sed 's/\/bin\/sh/\/bin\/bash/' version.sh > version.sh.mod
  • cp version.sh.mod version.sh

  • Run configure

  • configure --extra-cflags="-fpic" --disable-mmx --disable-protocol=udp --disable-encoder=nellymoser --disable-debug --arch=sparc --target-os=sunos

  • gmake install

  • start ffmpeg : ./ffmpeg
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜