]> git.street.me.uk Git - andy/viking.git/blame - autogen.sh
GObjectify search dialog
[andy/viking.git] / autogen.sh
CommitLineData
1f8b0db7 1#!/bin/sh
2c8af686 2# Run this to generate all the initial makefiles, etc.
1f8b0db7 3
2c8af686
GB
4: ${AUTOCONF=autoconf}
5: ${AUTOHEADER=autoheader}
d88f5ec1
QT
6: ${AUTOMAKE=automake}
7: ${ACLOCAL=aclocal}
2c8af686
GB
8: ${LIBTOOLIZE=libtoolize}
9: ${INTLTOOLIZE=intltoolize}
10: ${LIBTOOL=libtool}
1f8b0db7 11
2c8af686
GB
12srcdir=`dirname $0`
13test -z "$srcdir" && srcdir=.
14
15ORIGDIR=`pwd`
16cd $srcdir
17PROJECT=viking
18TEST_TYPE=-f
19FILE=src/main.c
20CONFIGURE=configure.ac
21
a5daec1c
GB
22ACLOCAL_FLAGS="-I m4"
23
2c8af686
GB
24DIE=0
25
26($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
27 echo
28 echo "You must have autoconf installed to compile $PROJECT."
29 echo "Download the appropriate package for your distribution,"
30 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
31 DIE=1
32}
33
244c0e50 34(grep "^IT_PROG_INTLTOOL" $srcdir/$CONFIGURE >/dev/null) && {
2c8af686
GB
35 ($INTLTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
36 echo
37 echo "You must have \`intltoolize' installed to compile $PROJECT."
38 echo "Get ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/intltool-0.22.tar.gz"
39 echo "(or a newer version if it is available)"
40 DIE=1
41 }
42}
43
44($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
45 echo
46 echo "You must have automake installed to compile $PROJECT."
47 echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.7.tar.gz"
48 echo "(or a newer version if it is available)"
49 DIE=1
50}
51
52(grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
53 ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
54 echo
55 echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
56 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.4.tar.gz"
57 echo "(or a newer version if it is available)"
58 DIE=1
59 }
60}
61
62if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
63 if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then
64 GETTEXTIZE=""
65 else
66 if grep "^AM_GLIB_GNU_GETTEXT" "$CONFIGURE" >/dev/null; then
67 GETTEXTIZE="glib-gettextize"
68 GETTEXTIZE_URL="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.0.tar.gz"
69 else
70 GETTEXTIZE="gettextize"
71 GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
72 fi
73
74 $GETTEXTIZE --version < /dev/null > /dev/null 2>&1
75 if test $? -ne 0; then
76 echo
77 echo "**Error**: You must have \`$GETTEXTIZE' installed to compile $PKG_NAME."
78 echo "Get $GETTEXTIZE_URL"
79 echo "(or a newer version if it is available)"
80 DIE=1
81 fi
82 fi
83fi
84
85if test "$DIE" -eq 1; then
86 exit 1
87fi
88
89test $TEST_TYPE $FILE || {
90 echo "You must run this script in the top-level $PROJECT directory"
91 exit 1
92}
93
94#if test -z "$*"; then
95# echo "I am going to run ./configure with no arguments - if you wish "
96# echo "to pass any to it, please specify them on the $0 command line."
97#fi
98
99case $CC in
100*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
101esac
102
103for coin in .
104do
105 dr=`dirname $coin`
106 if test -f $dr/NO-AUTO-GEN; then
107 echo skipping $dr -- flagged as no auto-gen
108 else
109 echo processing $dr
110 macrodirs= #`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
111 ( cd $dr
112 aclocalinclude="$ACLOCAL_FLAGS"
113 for k in $macrodirs; do
114 if test -d $k; then
115 aclocalinclude="$aclocalinclude -I $k"
116 ##else
117 ## echo "**Warning**: No such directory \`$k'. Ignored."
118 fi
119 done
120 if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE >/dev/null; then
121 if grep "sed.*POTFILES" $CONFIGURE >/dev/null; then
122 : do nothing -- we still have an old unmodified configure.in
123 else
124 echo "Creating $dr/aclocal.m4 ..."
125 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
126 echo "Running glib-gettextize... Ignore non-fatal messages."
127 echo "no" | glib-gettextize --force --copy
128 echo "Making $dr/aclocal.m4 writable ..."
129 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
130 fi
131 fi
132 if grep "^AC_PROG_INTLTOOL" $CONFIGURE >/dev/null ||
133 grep "^IT_PROG_INTLTOOL" $CONFIGURE >/dev/null; then
244c0e50
RN
134 echo "Running $INTLTOOLIZE..."
135 $INTLTOOLIZE --copy --force --automake
2c8af686
GB
136 fi
137 if grep "^AM_PROG_LIBTOOL" $CONFIGURE >/dev/null; then
138 echo "Running $LIBTOOLIZE..."
139 $LIBTOOLIZE --force --copy
140 fi
141 echo "Running $ACLOCAL $aclocalinclude ..."
142 $ACLOCAL $aclocalinclude
4107128c 143 if grep "^A[CM]_CONFIG_HEADER" $CONFIGURE >/dev/null; then
2c8af686
GB
144 echo "Running $AUTOHEADER..."
145 $AUTOHEADER
146 fi
147 echo "Running $AUTOMAKE --gnu $am_opt ..."
148 $AUTOMAKE --add-missing --gnu $am_opt
149 echo "Running $AUTOCONF ..."
150 $AUTOCONF
151 )
152 fi
153done
154
155conf_flags="--enable-maintainer-mode"
156
157cd "$ORIGDIR"
158
159if test x$NOCONFIGURE = x; then
160 echo Running $srcdir/configure $conf_flags "$@" ...
161 $srcdir/configure $conf_flags "$@" \
162 && echo Now type \`make\' to compile $PROJECT || exit 1
163else
164 echo Skipping configure process.
165fi