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.ac\
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.ac >/dev/null) && {
28 (grep "sed.*POTFILES" $srcdir/configure.ac) >/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."
33 echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
38 (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
40 echo "**Error**: You must have \`intltoolize' installed"
44 (automake --version) < /dev/null > /dev/null 2>&1 || {
46 echo "**Error**: You must have \`automake' installed."
47 echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
52 # if no automake, don't bother testing for aclocal
53 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
55 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
56 echo "installed doesn't appear recent enough."
57 echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
61 if test "$DIE" -eq 1; then
66 echo "**Warning**: I am going to run \`configure' with no arguments."
67 echo "If you wish to pass any to it, please specify them on the"
68 echo \`$0\'" command line."
74 am_opt=--include-deps;;
77 auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $srcdir/configure.ac`"
78 if test -n "$auxdir"; then
79 if test ! -d "$srcdir/$auxdir"; then
80 mkdir -p "$srcdir/$auxdir"
83 for coin in `find $srcdir -name configure.ac -print`
86 if test -f $dr/NO-AUTO-GEN; then
87 echo skipping $dr -- flagged as no auto-gen
90 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
92 aclocalinclude="$ACLOCAL_FLAGS"
93 for k in $macrodirs; do
95 aclocalinclude="$aclocalinclude -I $k"
97 ## echo "**Warning**: No such directory \`$k'. Ignored."
100 if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
101 if grep "sed.*POTFILES" configure.ac >/dev/null; then
102 : do nothing -- we still have an old unmodified configure.ac
104 echo "Creating $dr/aclocal.m4 ..."
105 test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
106 echo "Running glib-gettextize..."
107 echo "no" | glib-gettextize --force --copy
108 echo "Running intltoolize"
109 intltoolize --copy --force --automake
110 if intltoolize --version | grep -q ' 0.40.6'; then
111 echo "Workaround intltoolize 0.40.6 bug (LINGUAS)"
112 sed "s:'\^\$\$lang\$\$':\^\$\$lang\$\$:g" -i po/Makefile.in.in
114 echo "Making $dr/aclocal.m4 writable ..."
115 test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
118 echo "Running aclocal $aclocalinclude ..."
119 aclocal $aclocalinclude
120 if grep "^AC_CONFIG_HEADER" configure.ac >/dev/null; then
121 echo "Running autoheader..."
124 echo "Running automake --gnu $am_opt ..."
125 automake --add-missing --gnu $am_opt
126 echo "Running autoconf ..."
132 conf_flags="--enable-maintainer-mode" #--enable-iso-c
134 if test x$NOCONFIGURE = x; then
135 echo Running $srcdir/configure $conf_flags "$@" ...
136 $srcdir/configure $conf_flags "$@" \
137 && echo Now type \`make\' to compile $PKG_NAME
139 echo Skipping configure process.