#!/bin/sh # $Id; chklibmpeg.sh $ # # Author: Tomi Ollila <> # # Copyright (c) 2008 Tomi Ollila # All rights reserved # # Created: Sat May 03 22:23:46 EEST 2008 too # Last modified: Sun May 04 19:57:43 EEST 2008 too test -d config || mkdir config rm -f config/mpeg2.conf flags_only=`pkg-config --cflags --libs libmpeg2` flags_both=`pkg-config --cflags --libs libmpeg2 libmpeg2convert` case $flags_both in '') test -d /usr/include/mpeg2dec || exit 1 test -f /usr/lib/libmpeg2.a -o -f /usr/lib/libmpeg2.so || exit 1 test -f /usr/lib/libmpeg2convert.a -o -f /usr/lib/libmpeg2convert.so \ || exit 1 flags_only='-I /usr/include/mpeg2dec -lmpeg2' flags_both='-I /usr/include/mpeg2dec -lmpeg2 -lmpeg2convert' ;; esac trap 'rm -f tstlibmpeg.c tstlibmpeg' 0 cat > tstlibmpeg.c < #include int main(void) { return !(MPEG2_RELEASE >= (5 << 8)); } EOF gcc -o tstlibmpeg tstlibmpeg.c $flags_both ./tstlibmpeg && { echo mpeg2_only=\"$flags_only\" echo mpeg2_both=\"$flags_both\" } > config/mpeg2.conf