If you only want to decode wav
from ogg vorbis
, you can simply use oggdec
utility to do that, instead of ogg123
(which has more dependencies).
To build a "static" version of oggdec
, you will first need to build static versions of libogg
and libvorbis
libraries, like this:
#Create staging directory
STAGING=$HOME/staging/vorbis-tools
mkdir -p $STAGING
#Sources
SRC=$STAGING/src
mkdir -p $SRC
#Build artifacts
OUT=$STAGING/build
mkdir -p $OUT
#Build a static version of "libogg"
wget downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.xz -qO-|tar -C $SRC -xJ
pushd $SRC/libogg*/
./configure --prefix=$OUT --disable-shared
make install
popd
#Build a static version of "libvorbis"
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.xz -qO-|tar -C $SRC -xJ
pushd $SRC/libvorbis*/
./configure --prefix=$OUT LDFLAGS="-L$OUT/lib" CPPFLAGS="-I$OUT/include" --disable-shared
make install
popd
Now you can build oggdec
(vorbis-tools), statically linked to libogg
and libvorbis
:
#Build "vorbis-tools"
wget downloads.xiph.org/releases/vorbis/vorbis-tools-1.4.0.tar.gz -qO- | tar -C $SRC -xz
pushd $SRC/vorbis-tools*/
./configure LDFLAGS="-L$OUT/lib" CPPFLAGS="-I$OUT/include"
make
popd
You can use ldd, to
check the list of dependencies for your newly built oggdec
binary:
ldd $SRC/vorbis-tools*/oggdec/oggdec
linux-vdso.so.1 (0x00007ffc85792000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbcba839000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbcba48e000)
/lib64/ld-linux-x86-64.so.2 (0x00007fbcbab3a000)
The resulting binary is not really fully "static", as it still exposes dependency on some system libraries (in particular "libc" and "libm"), but that should be just fine for running it under "Amazon Linux".
-fPIC
gcc flag although that won't solve this particular problem. Can you post a link to the source code that you're trying to compile?ogg123
is here github.com/xiph/vorbis-tools/tree/master/ogg123