* user-friendly(?) build system, based on linux Menuconfig script.
[vlc.git] / build-vlc
1 #!/bin/sh
2
3 FEATURES="
4 GNOME gnome
5 GTK gtk
6 DVDOLD dvd
7 DVDREAD dvdread
8 DVDPLAY dvdplay
9 VCD vcd
10 V4L v4l
11 SAT satellite
12 X11 x11
13 XVIDEO xvideo
14 SDL sdl
15 FB fb
16 OSS oss
17 ESD esd
18 A52 a52
19 MAD mad
20 FFMPEG ffmpeg
21 "
22 PATHS="
23 FFMPEG_TREE ffmpeg-tree
24 "
25 if [ ! -e .config ]
26 then
27    ./menuconfig
28 fi
29
30 echo -n "./configure " > .cmd
31 source .config
32
33 check_features () {
34 while [ -n "$1" ]
35 do
36    eval x="\$CONFIG_$1"
37    if [ "$x" == "y" ]
38    then
39       echo -n "--enable-$2 " >> .cmd
40    else
41       echo -n "--disable-$2 " >> .cmd
42    fi
43    shift; shift
44 done
45 }
46
47 check_paths () {
48 while [ -n "$1" ]
49 do
50    if [ -n $1 ]
51    then
52       eval x="\$CONFIG_$1"
53       echo -n "--with-$2=$x" >> .cmd
54    fi
55    shift; shift
56 done
57 }
58
59 check_features $FEATURES
60 check_paths $PATHS
61
62 if [ ! -e configure ]
63 then
64    ./bootstrap
65 fi
66
67 source .cmd
68 make
69 rm -f .cmd