Merges from Irssi CVS.
[runtime.git] / apps / irssi / autogen.sh
index 5ad69a2724375d696038fbb29bc27b8967ea7a45..791563091a22f919f76d695365e8e3195b4abcc8 100755 (executable)
@@ -88,14 +88,34 @@ xlc )
   am_opt=--include-deps;;
 esac
 
-rm -f aclocal.m4
+rm -f aclocal.m4 glib.m4 glib-2.0.m4
 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
   echo "Running libtoolize..."
   libtoolize --force --copy
 fi
 aclocalinclude="$ACLOCAL_FLAGS -I ."
 echo "Running aclocal $aclocalinclude ..."
+
+# see if we don't have glib.m4 or glib-2.0.m4 there yet
+error=`aclocal $aclocalinclude 2>&1`
+if test "x`echo $error|grep 'AM_PATH_GLIB[^_]'`" != "x"; then
+  cp glib.m4_ glib.m4
+  error=`aclocal $aclocalinclude 2>&1`
+fi
+if test "x`echo $error|grep AM_PATH_GLIB_2_0`" != "x"; then
+  cp glib-2.0.m4_ glib-2.0.m4
+fi
+
 aclocal $aclocalinclude
+
+# aclocal for some reason doesn't complain about glib2, so we still need
+# to check it later again..
+if grep "^AC_DEFUN.AM_PATH_GLIB_2_0" aclocal.m4 >/dev/null; then :;
+else
+  cp glib-2.0.m4_ glib-2.0.m4
+  aclocal $aclocalinclude
+fi
+
 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
   echo "Running autoheader..."
   autoheader