aboutsummaryrefslogtreecommitdiffstats
path: root/autogen.sh
blob: 333a1512370f42faeee5ba85f767f78232ca8251 (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/bin/sh

PACKAGE="opkg"

srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.

cd "$srcdir"
DIE=0

if [ \( $# -eq 1 \) -a \( "$1" = "--clean" \) ]; then
    # Deep clean of all generated files
    echo "Removing old files (no Makefile around?) ..."
    rm -f configure
    rm -f config.log config.status
    rm -f libtool
    rm -f aclocal.m4
    rm -f libopkg.pc
    rm -f man/opkg.1 man/opkg.conf.5 man/opkg-key.1
    rm -f Makefile Makefile.in
    rm -f libopkg/Makefile libopkg/Makefile.in
    rm -f man/Makefile man/Makefile.in
    rm -f utils/Makefile utils/Makefile.in
    rm -f src/Makefile src/Makefile.in
    rm -f config.h config.h.in
    rm -f m4/lt*.m4 m4/libtool.m4 m4/pkg.m4
    rm -rf po conf autom4te.cache
    rm -rf libopkg/.deps src/.deps
    rm -rf libopkg/.libs src/.libs

    rm -f libopkg/*.o src/*.o
    rm -f libopkg/*.lo
    rm -f libopkg/*.la
    rm -f src/opkg
    rm -f stamp-h1

    rm -f tests/*.pyc tests/*.pyo
    rm -rf tests/__pycache__

    echo "Done. If you want regenerate the Autotool files call 'autogen.sh' without the '--clean' argument."
    exit 0
fi

(autoconf --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "You must have autoconf installed to compile $PACKAGE."
    echo "Download the appropriate PACKAGE for your system,"
    echo "or get the source from one of the GNU ftp sites"
    echo "listed in http://www.gnu.org/order/ftp.html"
    DIE=1
}

(automake --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "You must have automake installed to compile $PACKAGE."
    echo "Download the appropriate PACKAGE for your system,"
    echo "or get the source from one of the GNU ftp sites"
    echo "listed in http://www.gnu.org/order/ftp.html"
    DIE=1
}

(libtool --version) < /dev/null > /dev/null 2>&1 || {
    echo
    echo "You must have libtool installed to compile $PACKAGE."
    echo "Download the appropriate PACKAGE for your system,"
    echo "or get the source from one of the GNU ftp sites"
    echo "listed in http://www.gnu.org/order/ftp.html"
    DIE=1
}

# currently gettext is not used, no need to check
#(gettext --version) < /dev/null > /dev/null 2>&1 || {
#   echo
#   echo "You must have gettext installed to compile $PACKAGE."
#   echo "Download the appropriate PACKAGE for your system,"
#   echo "or get the source from one of the GNU ftp sites"
#   echo "listed in http://www.gnu.org/order/ftp.html"
#   DIE=1
#}

if test "$DIE" -eq 1; then
    exit 1
fi

# Suppress warning about 'm4' directory not existing
mkdir -p m4

echo "Generating configuration files for $PACKAGE, please wait...."
if [ "$ACLOCAL_FLAGS" = "" ]; then
    echo "No option for 'aclocal' given. Possibly you have forgotten to use 'ACLOCAL_FLAGS='?"
fi

echo "  aclocal --install -I m4 $ACLOCAL_FLAGS"
aclocal --install -I m4 $ACLOCAL_FLAGS
if [ "$?" = "1" ]; then
    echo "aclocal failed!" && exit 1
fi

echo "  libtoolize --automake --install"
libtoolize --automake --install
if [ "$?" = "1" ]; then
    echo "libtoolize failed!" && exit 1
fi

#echo "  gettextize"
#gettextize
#if [ "$?" = "1" ]; then
#   "echo gettextsize failed!" && exit 1
#fi
echo "  autoconf"
autoconf
if [ "$?" = "1" ]; then
    echo "autoconf failed!" && exit 1
fi

echo "  autoheader"
autoheader
if [ "$?" = "1" ]; then
    echo "autoheader failed!" && exit 1
fi

echo "  automake --add-missing"
automake --add-missing
if [ "$?" = "1" ]; then
    echo "automake failed!" && exit 1
fi

echo "You can now run 'configure [options]' to configure $PACKAGE."