summaryrefslogtreecommitdiffstats
path: root/autogen.sh
blob: e62afaace3f6141f36973a7fde308974040a318c (plain) (blame)
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
72
73
74
75
76
77
78
79
#!/bin/sh
#
# Copyright (c) 2003-2010 by FlashCode <flashcode@flashtux.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

###
### common stuff
###
OK="\\033[70G[\\033[1;32mOK\\033[1;00m]"
FAIL="\\033[70G[\\033[1;31mFAILED\\033[1;00m]"

AUTOGEN_LOG=autogen.log

err ()
{
    echo "-------"
    echo "Error :"
    echo "---8<-----------------------------------"
    cat $AUTOGEN_LOG
    echo "----------------------------------->8---"
    exit 1
}

run ()
{
    echo -n "Running \"$@\""
    eval $@ >$AUTOGEN_LOG 2>&1
    if [ $? = 0 ] ; then
        echo -e $OK
    else
        echo -e $FAIL
        err
    fi
}

###
### cleanning part
###
#  remove autotools stuff
run "rm -rf config"
run "rm -f config.h.in"
run "rm -f aclocal.m4 configure config.log config.status"
run "rm -rf autom4te*.cache"
# remove libtool stuff
run "rm -f libtool"
# remove gettext stuff
run "rm -f ABOUT-NLS"
run "rm -rf intl"

###
### configuration part
###
# create the config directory
run "mkdir -p config/m4"
run "mkdir intl"

# execute autotools cmds
run "autopoint -f"
run "libtoolize --automake --force --copy"
run "aclocal --force -I config/m4"
run "autoheader"
run "autoconf"
run "automake --add-missing --copy --gnu"

# ending
rm -f $AUTOGEN_LOG