UPDATED 2009-06-12 With GCC 4 instructions
--------------------------------------------------------------------------------
SETUP
--------------------------------------------------------------------------------
First, let's talk a bit about setup for compiling.
I followed this blog post for my build tools:
http://blogs.sun.com/lewiz/entry/compil ... laris_2008
Namely:
root@wd40:~# $ pfexec pkg set-authority -O http://blastwave.network.com:10000/ Blastwave
root@wd40:~# $ pfexec pkg install SUNWgcc SUNWgmake IPSgawk SUNWxorg-headers
And my path is:
root@wd40:~# export PATH=/usr/gnu/bin:/opt/csw/gnu:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin:/usr/local/bin
Additionally, we need to make sure /usr/local/lib is in our library path or else some stuff bombs out
root@wd40:~# crle
Configuration file [version 4]: /var/ld/ld.config
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
No /usr/local/lib listed, so I ran:
root@wd40:~# crle -l /usr/local/lib -u
And now:
root@wd40:~# crle
Configuration file [version 4]: /var/ld/ld.config
Platform: 32-bit LSB 80386
Default Library Path (ELF): /lib:/usr/lib:/usr/local/lib
Trusted Directories (ELF): /lib/secure:/usr/lib/secure (system default)
Command line:
crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib
Also, we need to use ginstall instead of install. Let's make a link:
root@wd40:~# ln -s /usr/bin/ginstall /usr/bin/install
Due to our path order, this install will be hit first (rather than the default install binary which won't work for some things)
After a lot of troubleshooting, it was determined that we must use GCC4. Get GCC4 from the Solaris Package Manager tool.
You'll need: gcc-432 and gcc-runtime-432
After that is installed:
root@wd40:~# cd /usr/gnu/bin/
root@wd40:~# mv cc cc.bak
root@wd40:~# ln -s /usr/bin/gcc-4.3.2 cc
root@wd40:/usr/gnu/bin# cd /usr/bin/
root@wd40:/usr/bin# mv gcc gcc.bak
root@wd40:/usr/bin# ln -s /usr/bin/gcc-4.3.2 gcc
Let's make sure we are using version 4 for both gcc and cc
root@wd40:/usr/bin# gcc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.3.2/configure --prefix=/usr --program-suffix=-4.3.2 --infodir=/usr/share/info --mandir=/usr/share/man --libexecdir=/usr/lib --enable-shared --disable-static --disable-libtool-lock --target= --enable-objc-gc --
enable-concept-checks --disable-libada --enable-libssp --enable-languages=c,c++,objc,fortran --enable-threads=posix --enable-tls=yes --with-system-zlib --without-gnu-ld --with-ld=/usr/ccs/bin/ld --with-gnu-as --with-as=/usr/sfw/bin/gas
--with-gmp-include=/usr/include/gmp --with-gmp-lib=/usr/lib --with-mpfr-include=/usr/include/mpfr --with-mpfr-lib=/usr/lib --enable-c99 --enable-nls --enable-wchar_t --enable-libstdcxx-allocator=mt --with-pic
Thread model: posix
gcc version 4.3.2 (GCC)
root@wd40:/usr/bin# cc -v
Using built-in specs.
Target: i386-pc-solaris2.11
Configured with: ../gcc-4.3.2/configure --prefix=/usr --program-suffix=-4.3.2 --infodir=/usr/share/info --mandir=/usr/share/man --libexecdir=/usr/lib --enable-shared --disable-static --disable-libtool-lock --target= --enable-objc-gc --
enable-concept-checks --disable-libada --enable-libssp --enable-languages=c,c++,objc,fortran --enable-threads=posix --enable-tls=yes --with-system-zlib --without-gnu-ld --with-ld=/usr/ccs/bin/ld --with-gnu-as --with-as=/usr/sfw/bin/gas
--with-gmp-include=/usr/include/gmp --with-gmp-lib=/usr/lib --with-mpfr-include=/usr/include/mpfr --with-mpfr-lib=/usr/lib --enable-c99 --enable-nls --enable-wchar_t --enable-libstdcxx-allocator=mt --with-pic
Thread model: posix
gcc version 4.3.2 (GCC)
--------------------------------------------------------------------------------
LAME
--------------------------------------------------------------------------------
Downloaded lame source to /usr/local/src
root@wd40:/usr/local/src# wget http://superb-east.dl.sourceforge.net/s ... 8-2.tar.gz
root@wd40:/usr/local/src# tar -xvf lame-398-2.tar.gz
root@wd40:/usr/local/src# cd lame-398-2
root@wd40:/usr/local/src/lame-398-2# ./configure
root@wd40:/usr/local/src/lame-398-2# gmake
root@wd40:/usr/local/src/lame-398-2# gmake install
That should be it! Let's just make sure lame shows up where it should:
root@wd40:/usr/local/src/lame-398-2# which lame
/usr/local/bin/lame
Yep!
--------------------------------------------------------------------------------
Mplayer
--------------------------------------------------------------------------------
Downloaded latest Mplayer subversion snap to /usr/local/src
root@wd40:/usr/local/src/lame-398-2# cd /usr/local/src/
root@wd40:/usr/local/src# wget http://www.mplayerhq.hu/MPlayer/release ... ot.tar.bz2
root@wd40:/usr/local/src# tar -xvf mplayer-checkout-snapshot.tar.bz2
root@wd40:/usr/local/src# cd mplayer-checkout-2009-06-12/
Before we configure, we need to edit the configure script to disable the -rdynamic option, otherwise cc will complain later
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# vi configure
You can use whatever editor you want. Basically we need to remove the lines:
if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 ; then
_ld_dl_dynamic='-rdynamic'
fi
And then save
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# ./configure --enable-debug --extra-cflags=-fomit-frame-pointer
I can't get it to work unless we use debug mode! Also, you must pass the extra cflag to get debug mode to work!
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# gmake
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# gmake install
Let's make sure our binaries are where they should be:
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# which mplayer
/usr/local/bin/mplayer
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# which mencoder
/usr/local/bin/mencoder
Yep!
--------------------------------------------------------------------------------
ffmpeg
--------------------------------------------------------------------------------
Downloaded the latest snapshot of ffmpeg
root@wd40:/usr/local/src/mplayer-checkout-2009-06-12# cd /usr/local/src/
root@wd40:/usr/local/src# wget http://ffmpeg.org/releases/ffmpeg-expor ... ot.tar.bz2
root@wd40:/usr/local/src# tar -xvf ffmpeg-export-snapshot.tar.bz2
root@wd40:/usr/local/src# cd ffmpeg-export-2009-06-12/
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# ./configure
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# gmake
After a while, this will bomb out with the output:
gcc -DHAVE_AV_CONFIG_H -I. -I"/usr/local/src/ffmpeg-export-2009-06-12" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__EXTENSIONS__ -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -fno-math-errno -fno-signed-zeros -c -o libavcodec/x86/mlpdsp.o libavcodec/x86/mlpdsp.c
/var/tmp//ccKWa4Vq.s: Assembler messages:
/var/tmp//ccKWa4Vq.s:96: Error: unbalanced parenthesis in operand 1.
/var/tmp//ccKWa4Vq.s:101: Error: unbalanced parenthesis in operand 1.
/var/tmp//ccKWa4Vq.s:106: Error: unbalanced parenthesis in operand 1.
/var/tmp//ccKWa4Vq.s:111: Error: unbalanced parenthesis in operand 1.
/var/tmp//ccKWa4Vq.s:128: Error: unbalanced parenthesis in operand 2.
gmake: *** [libavcodec/x86/mlpdsp.o] Error 1
I found the solution to this problem here:
http://opensolaris.org/jive/thread.jspa ... eID=383406
Run the command:
- Code: Select all
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# gcc -save-temps -DHAVE_AV_CONFIG_H -I. -I"/usr/local/src/ffmpeg-export-2009-06-12" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__EXTENSIONS__ -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -fno-math-errno -fno-signed-zeros -c -o libavcodec/x86/mlpdsp.o libavcodec/x86/mlpdsp.c
This will bomb out
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# vi mlpdsp.s
Use whatever editor you want. We need to replace:
4*(8 + (40 * (192000 / 48000)))
with
672
Once again, there will be 5 replacements needed
Then run this command:
- Code: Select all
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# gcc -DHAVE_AV_CONFIG_H -I. -I"/usr/local/src/ffmpeg-export-2009-06-12" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__EXTENSIONS__ -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -fno-math-errno -fno-signed-zeros -c -o libavcodec/x86/mlpdsp.o mlpdsp.s
And let's finish out make
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# gmake
This should finish without any errors
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# gmake install
Let's make sure we have our binary
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# which ffmpeg
/usr/local/bin/ffmpeg
YEP
--------------------------------------------------------------------------------
Done!
--------------------------------------------------------------------------------
Well, there you have it! lame, mplayer (including mencoder) and ffmpeg from source on OpenSolaris 2009.06.
--------------------------------------------------------------------------------
Cleanup
--------------------------------------------------------------------------------
Let's put gcc and cc back the way that we found them
root@wd40:/usr/local/src/ffmpeg-export-2009-06-12# cd /usr/bin/
root@wd40:/usr/bin# mv gcc.bak gcc
root@wd40:/usr/bin# cd /usr/gnu/bin/
root@wd40:/usr/gnu/bin# mv cc.bak cc
Just make sure the /usr/local/bin is in your path when you launch PS3 Media Server and things should be great!
export PATH=/usr/gnu/bin:/opt/csw/gnu:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin:/usr/local/bin
