Remove --enable-compile-warnings from autogen.sh, it was passed to configure which...
[geeqie.git] / autogen.sh
1 #!/bin/sh
2 # Run this to generate all the initial makefiles, etc.
3
4 #this was originally taken from the gnome macros/autogen.sh scripts
5
6 srcdir=`dirname $0`
7 test -z "$srcdir" && srcdir=.
8
9 (test -f $srcdir/configure.in \
10   && test -f $srcdir/src/main.c \
11   && test -f $srcdir/src/main.h) || {
12     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
13     echo " top-level geeqie directory"
14     exit 1
15 }
16
17 DIE=0
18
19 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
20   echo
21   echo "**Error**: You must have \`autoconf' installed."
22   echo "Download the appropriate package for your distribution,"
23   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
24   DIE=1
25 }
26
27 (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && {
28   (grep "sed.*POTFILES" $srcdir/configure.in) >/dev/null || \
29   (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
30     echo
31     echo "**Error**: You must have \`glib-gettextize' installed."
32     echo "glib-gettextize is a part of glib."
33     echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
34     DIE=1
35   }
36 }
37
38 (automake --version) < /dev/null > /dev/null 2>&1 || {
39   echo
40   echo "**Error**: You must have \`automake' installed."
41   echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
42   DIE=1
43   NO_AUTOMAKE=yes
44 }
45
46 # if no automake, don't bother testing for aclocal
47 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
48   echo
49   echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
50   echo "installed doesn't appear recent enough."
51   echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
52   DIE=1
53 }
54
55 if test "$DIE" -eq 1; then
56   exit 1
57 fi
58
59 if test -z "$*"; then
60   echo "**Warning**: I am going to run \`configure' with no arguments."
61   echo "If you wish to pass any to it, please specify them on the"
62   echo \`$0\'" command line."
63   echo
64 fi
65
66 case $CC in
67 xlc )
68   am_opt=--include-deps;;
69 esac
70
71 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $srcdir/configure.in`"
72 if test -n "$auxdir"; then
73   if test ! -d "$srcdir/$auxdir"; then
74     mkdir -p "$srcdir/$auxdir"
75   fi                                                                            fi
76
77 for coin in `find $srcdir -name configure.in -print`
78 do 
79   dr=`dirname $coin`
80   if test -f $dr/NO-AUTO-GEN; then
81     echo skipping $dr -- flagged as no auto-gen
82   else
83     echo processing $dr
84     macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
85     ( cd $dr
86       aclocalinclude="$ACLOCAL_FLAGS"
87       for k in $macrodirs; do
88         if test -d $k; then
89           aclocalinclude="$aclocalinclude -I $k"
90         ##else 
91         ##  echo "**Warning**: No such directory \`$k'.  Ignored."
92         fi
93       done
94       if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
95         if grep "sed.*POTFILES" configure.in >/dev/null; then
96           : do nothing -- we still have an old unmodified configure.in
97         else
98           echo "Creating $dr/aclocal.m4 ..."
99           test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
100           echo "Running glib-gettextize..."
101           echo "no" | glib-gettextize --force --copy
102           if [ -r po/Makefile.in.in.patch ]; then
103                 patch po/Makefile.in.in < po/Makefile.in.in.patch
104           fi
105           echo "Making $dr/aclocal.m4 writable ..."
106           test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
107         fi
108       fi
109       echo "Running aclocal $aclocalinclude ..."
110       aclocal $aclocalinclude
111       if grep "^AC_CONFIG_HEADER" configure.in >/dev/null; then
112         echo "Running autoheader..."
113         autoheader
114       fi
115       echo "Running automake --gnu $am_opt ..."
116       automake --add-missing --gnu $am_opt
117       echo "Running autoconf ..."
118       autoconf
119     )
120   fi
121 done
122
123 conf_flags="--enable-maintainer-mode" #--enable-iso-c
124
125 if test x$NOCONFIGURE = x; then
126   echo Running $srcdir/configure $conf_flags "$@" ...
127   $srcdir/configure $conf_flags "$@" \
128   && echo Now type \`make\' to compile $PKG_NAME
129 else
130   echo Skipping configure process.
131 fi