summaryrefslogtreecommitdiff
path: root/test/compile
blob: 2c2e8fc4e95174eebe142ac53afc4adf4621fbca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh

if test x"$srcdir" != x""; then
    builddir="."	# running from make check, but it does not define that
else
    srcdir=`echo "$0" | sed s,[^/]*$,,`
    test "$srcdir" = "$0" && srcdir=.
    test -z "$srcdir" && srcdir=.
    builddir="$srcdir"	# running manually, have to assume
fi

srcdir=`cd $srcdir;pwd`
builddir=`cd $builddir;pwd`

basedir=".."
cd $srcdir; if [ ! -d $basedir -o ! -f $basedir/src/mpeg2dec.c -o \
    ! -f $basedir/mpeg2dec-*.tar.gz ]; then
    cd ..; if [ ! -d $basedir -o ! -f $basedir/src/mpeg2dec.c -o \
	! -f $basedir/mpeg2dec-*.tar.gz ]; then
	exit 77
    fi
fi
basedir=`cd $basedir;pwd`

cd $builddir
rm -fr compile_test

for compiler in cc gcc gcc272 gcc-2.95 gcc-3.0 gcc-3.1 gcc-3.2 gcc-3.3 \
		gcc-3.4 gcc-4.0 gcc-4.1 gcc-4.2 c89 \
		c++ g++ g++-2.95 g++-3.0 g++-3.1 g++-3.2 g++-3.3 g++-3.4 \
		g++-4.0 g++-4.1 g++-4.2 \
		ccmalloc-gcc bgcc checkergcc tendracc icc \
		i586-mingw32msvc-gcc; do
    compiler_path=`which $compiler`
    if test x"$compiler_path" = x""; then continue; fi

    mkdir compile_test
    cd compile_test; tar xzpf $basedir/mpeg2dec-*.tar.gz; cd mpeg2dec-*
    case "$compiler" in
	i586-mingw32msvc-gcc)
	    opts="--host=i586-mingw32msvc --enable-warnings --disable-sdl"
	    if test -f "/usr/local/opt/ddraw/ddraw.h"; then
		opts="$opts --with-directx=/usr/local/opt/ddraw"
	    fi;;
	c89)		opts="";;
	ccmalloc-gcc)	opts="--enable-warnings --enable-debug";;
	tcc-*)		opts="--enable-warnings --disable-sdl";;
	checkergcc)	opts="--disable-largefile";;
	gcc272|*-2.95)	opts="";;
	*)		opts="--enable-warnings";;
    esac
    error=1; CC=$compiler ./configure $opts && make && error=0
    if test x"$error" != x"0"; then exit 1; fi
    cd ../..
    rm -fr compile_test
done

exit 0