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/gqview.h) || {
12 echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
13 echo " top-level gqview 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_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
28 grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
29 (gettext --version) < /dev/null > /dev/null 2>&1 || {
31 echo "**Error**: You must have \`gettext' installed."
32 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
33 echo "(or a newer version if it is available)"
38 # if no automake, don't bother testing for aclocal
39 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
41 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
42 echo "installed doesn't appear recent enough."
43 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
44 echo "(or a newer version if it is available)"
48 if test "$DIE" -eq 1; then
53 echo "**Warning**: I am going to run \`configure' with no arguments."
54 echo "If you wish to pass any to it, please specify them on the"
55 echo \`$0\'" command line."
61 am_opt=--include-deps;;
64 for coin in `find $srcdir -name configure.in -print`
67 if test -f $dr/NO-AUTO-GEN; then
68 echo skipping $dr -- flagged as no auto-gen
71 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
73 aclocalinclude="$ACLOCAL_FLAGS"
74 for k in $macrodirs; do
76 aclocalinclude="$aclocalinclude -I $k"
78 ## echo "**Warning**: No such directory \`$k'. Ignored."
81 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
82 if grep "sed.*POTFILES" configure.in >/dev/null; then
83 : do nothing -- we still have an old unmodified configure.in
85 echo "Creating $dr/aclocal.m4 ..."
86 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
87 echo "Running gettextize... Ignore non-fatal messages."
88 echo "no" | gettextize --force --copy
89 echo "Making $dr/aclocal.m4 writable ..."
90 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
93 echo "Running aclocal $aclocalinclude ..."
94 aclocal $aclocalinclude
95 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
96 echo "Running autoheader..."
99 echo "Running automake --gnu $am_opt ..."
100 automake --add-missing --gnu $am_opt
101 echo "Running autoconf ..."
107 conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
109 if test x$NOCONFIGURE = x; then
110 echo Running $srcdir/configure $conf_flags "$@" ...
111 $srcdir/configure $conf_flags "$@" \
112 && echo Now type \`make\' to compile $PKG_NAME
114 echo Skipping configure process.