summaryrefslogtreecommitdiffstats
path: root/autogen.sh
blob: 4c396239490a5d077433f53684b59658acbb2810 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

PROG=`basename $0`

KEYFILE=src/librcc.c

# Some OS's have multiple versions (autoconf259, etc.) and don't have an 
# autoconf binary

AUTOCONF=`which autoconf`
if test x"${AUTOCONF}" != x -a -f "${AUTOCONF}"
then
    AUTOCONF=autoconf
    AUTOMAKE=automake
    ACLOCAL=aclocal
    LIBTOOLIZE=libtoolize
    AUTOHEADER=autoheader
else
    FINDPATH=`echo ${PATH}|sed -e 's,:, ,g'` 
    AUTOCONF=`find ${FINDPATH} -name "autoconf*"|sort -r|head -1`
    AUTOMAKE=`find ${FINDPATH} -name "automake*"|sort -r|head -1`
    ACLOCAL=`find ${FINDPATH} -name "aclocal*"|sort -r|head -1`
    LIBTOOLIZE=`find ${FINDPATH} -name "libtoolize*"|sort -r|head -1`
    AUTOHEADER=`find /usr/bin /usr/local/bin -name "autoheader*"|sort -r|head -1`
    echo "$0: autoconf: using ${AUTOCONF}"
    echo "$0: automake: using ${AUTOMAKE}"
    echo "$0: aclocal: using ${ACLOCAL}"
    echo "$0: libtoolize: using ${LIBTOOLIZE}"
    echo "$0: autoheader: using ${AUTOHEADER}"
fi

GETTEXTIZE_FLAGS=--no-changelog
AUTOPOINT_FLAGS=
LIBTOOLIZE_FLAGS=--copy

# Some OS's require /usr/local/share/aclocal

if test ! -d /usr/local/share/aclocal
then
  ACLOCAL_FLAGS='-I m4'
else
  ACLOCAL_FLAGS='-I m4 -I /usr/local/share/aclocal'
fi
AUTOHEADER_FLAGS=-Wall
AUTOMAKE_FLAGS='--add-missing --copy -Wall'
AUTOCONF_FLAGS=-Wno-obsolete

die()
{
    err=$?
    echo "$PROG: exited by previous error(s), return code was $err" >&2
    exit 1
}

if [ ! -f $KEYFILE ]
then
    echo "$PROG: key-file \`$KEYFILE' not found, exiting." >&2
    echo "$PROG: hint: you should run $PROG from top-level sourse directory." >&2
    exit 1
fi

# gettextize ${GETTEXTIZE_FLAGS}
# autopoint ${AUTOPOINT_FLAGS}
# xml-i18n-toolize       || die
# intltoolize            || die
${LIBTOOLIZE} ${LIBTOOLIZE_FLAGS} --force || die
${ACLOCAL} ${ACLOCAL_FLAGS}        || die
${AUTOHEADER} ${AUTOHEADER_FLAGS}  || die
${AUTOMAKE} ${AUTOMAKE_FLAGS}      || die
${AUTOCONF} ${AUTOCONF_FLAGS}      || die