2 # Run this to generate all the initial makefiles, etc.
4 #this was originally taken from the gnome macros/autogen.sh scripts
7 test -z "$srcdir" && srcdir=.
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"
19 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
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/"
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 || {
31 echo "**Error**: You must have \`glib-gettextize' installed."
32 echo "glib-gettextize is a part of glib"
37 # if no automake, don't bother testing for aclocal
38 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
40 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
41 echo "installed doesn't appear recent enough."
42 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
43 echo "(or a newer version if it is available)"
47 if test "$DIE" -eq 1; then
52 echo "**Warning**: I am going to run \`configure' with no arguments."
53 echo "If you wish to pass any to it, please specify them on the"
54 echo \`$0\'" command line."
60 am_opt=--include-deps;;
63 for coin in `find $srcdir -name configure.in -print`
66 if test -f $dr/NO-AUTO-GEN; then
67 echo skipping $dr -- flagged as no auto-gen
70 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
72 aclocalinclude="$ACLOCAL_FLAGS"
73 for k in $macrodirs; do
75 aclocalinclude="$aclocalinclude -I $k"
77 ## echo "**Warning**: No such directory \`$k'. Ignored."
80 if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
81 if grep "sed.*POTFILES" configure.in >/dev/null; then
82 : do nothing -- we still have an old unmodified configure.in
84 echo "Creating $dr/aclocal.m4 ..."
85 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
86 echo "Running glib-gettextize..."
87 echo "no" | glib-gettextize --force --copy
88 echo "Making $dr/aclocal.m4 writable ..."
89 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
92 echo "Running aclocal $aclocalinclude ..."
93 aclocal $aclocalinclude
94 if grep "^AC_CONFIG_HEADER" configure.in >/dev/null; then
95 echo "Running autoheader..."
98 echo "Running automake --gnu $am_opt ..."
99 automake --add-missing --gnu $am_opt
100 echo "Running autoconf ..."
106 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
108 if test x$NOCONFIGURE = x; then
109 echo Running $srcdir/configure $conf_flags "$@" ...
110 $srcdir/configure $conf_flags "$@" \
111 && echo Now type \`make\' to compile $PKG_NAME
113 echo Skipping configure process.