1#!/bin/sh
2win=$1
3
4#autopoint check
5(autopoint --version) > /dev/null 2>&1 ||
6{
7    echo
8    echo "Error: you must have autopoint installed to compile mp3splt !"
9    echo
10    exit 1
11}
12
13#autoconf check
14(autoconf --version && autoheader --version) > /dev/null 2>&1 ||
15{
16    echo
17    echo "Error: you must have autoconf installed to compile mp3splt !"
18    echo
19    exit 1
20}
21
22#automake check
23(aclocal --version) > /dev/null 2>&1 ||
24{
25    echo
26    echo "Error: you must have automake installed to compile mp3splt !"
27    echo
28    exit 1
29}
30
31#msgfmt check
32HAS_MSGFMT=yes
33(msgfmt --version) > /dev/null 2>&1 ||
34{
35  HAS_MSGFMT=no
36}
37
38if ! test -z $win ;then
39 WIN_ACLOCAL_FLAGS="-I /usr/share/aclocal"
40fi
41
42#we run aclocal, autoconf and automake
43echo -n "1/5 Running autopoint... " \
44&& autopoint --ver 0.13.1 -f && echo "done" \
45&& echo -n "2/5 Running aclocal... " \
46&& aclocal -I m4 $WIN_ACLOCAL_FLAGS $ACLOCAL_FLAGS && echo "done" \
47&& echo -n "3/5 Running autoheader... " \
48&& autoheader && echo "done" \
49&& echo -n "4/5 Running autoconf... " \
50&& autoconf && echo "done" \
51&& echo -n "5/5 Running automake... " \
52&& automake -a -c && echo "done"
53
54if ! test -z $win ;then
55  touch config.rpath
56  automake -a -c
57fi
58
59if test "x$HAS_MSGFMT" = xyes;then
60
61echo -n "Formatting language files with msgfmt... " && \
62{
63    cd po
64    for f in *.po; do
65        if test -r "$f"; then
66            lang=`echo $f | sed -e 's,\.po$,,'`
67            msgfmt -c -o $lang.gmo $lang.po
68        fi
69    done
70    cd ..
71} && echo "done"
72
73fi
74
75