summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in117
1 files changed, 92 insertions, 25 deletions
diff --git a/configure.in b/configure.in
index 867f1a3df..c5759dff6 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,74 @@
-
AC_INIT(src)
+GNOME_REQUIRED=1.2.8
+GNOME_LIBS_REQUIRED=1.2.11
+GTK_REQUIRED=1.2.9
+GLIB_REQUIRED=1.2.9
+BONOBO_REQUIRED=0.33
+OAF_REQUIRED=0.6.2
+GCONF_REQUIRED=0.12
+
+dnl ===========================================================================
+
+dnl EAZEL_VERSION_CANON(version)
+dnl 1
+
+AC_DEFUN(EAZEL_VERSION_CANON, [`
+
+ dnl Assumes that there are no more than 999 revisions at a level,
+ dnl no more than three levels of revision.
+ dnl
+ dnl Any more than that, and test starts messing up the numeric
+ dnl comparisons because its integers overflow, and there's no
+ dnl way to do string comparisons in the shell. Grr.
+ dnl
+ dnl Must come up with some way to fix this.
+
+ echo "$1" |
+ tr . '\012' |
+ sed -e 's/^/000/' -e 's/^.*\(...\)/\1/' |
+ tr -d '\012' |
+ sed 's/$/000000000/
+ s/^\(.........\).*/\1/'
+`])
+
+dnl EAZEL_VERSION_INSIST(package, get-version-cmd, operator, want-version-var)
+dnl 1 2 3 4
+
+AC_DEFUN(EAZEL_VERSION_INSIST, [
+ ez_want_version=[$]$4
+
+ case "$3" in
+ ">") ez_operator=-gt ;;
+ ">=") ez_operator=-ge ;;
+ "<") ez_operator=-lt ;;
+ "<=") ez_operator=-le ;;
+ "=") ez_operator=-eq ;;
+ "!=") ez_operator=-ne ;;
+ *) AC_ERROR(Unknown operator $3 in configure script) ;;
+ esac
+
+ AC_MSG_CHECKING(for $1 $3 [$ez_want_version])
+
+ if ez_installed_version="`$2`"
+ then
+ AC_MSG_RESULT([$ez_installed_version])
+ else
+ AC_ERROR($2 failed)
+ fi
+
+ if test "EAZEL_VERSION_CANON([$ez_installed_version])" "$ez_operator" \
+ "EAZEL_VERSION_CANON([$ez_want_version])"
+ then
+ :
+ AC_SUBST($4)
+ else
+ AC_ERROR($1 version [$ez_want_version] is required.)
+ fi
+])
+
+dnl ===========================================================================
+
if test -n "$GNOME2_PATH"; then
PATH="$GNOME2_PATH/bin:$PATH"
export PATH
@@ -520,17 +588,30 @@ dnl = End rpmview checks
dnl ====================================
dnl Checks for libraries.
-AM_PATH_GLIB(1.2.9,,
+AM_PATH_GLIB($GLIB_REQUIRED,,
AC_MSG_ERROR([
-*** GLIB 1.2.9 or better is required. The latest version of GLIB
+*** GLIB $GLIB_REQUIRED or better is required. The latest version of GLIB
*** is always available from ftp://ftp.gtk.org/.]))
-AM_PATH_GTK(1.2.9,,
+AC_SUBST(GLIB_REQUIRED)
+
+AM_PATH_GTK($GTK_REQUIRED,,
AC_MSG_ERROR([
-*** Gtk+ 1.2.9 or better is required. The latest version of GTK
+*** Gtk+ $GTK_REQUIRED or better is required. The latest version of GTK
*** is always available from ftp://ftp.gtk.org/.]))
-AM_PATH_GNOME(1.2.8,,AC_MSG_ERROR([*** GNOME 1.2.8 or better is required.]), gnomecanvaspixbuf bonobo bonobox bonobox_print vfs idl)
+AC_SUBST(GTK_REQUIRED)
+
+AM_PATH_GNOME($GNOME_REQUIRED,,AC_MSG_ERROR([*** GNOME $GNOME_REQUIRED or better is required.]), gnomecanvaspixbuf bonobo bonobox bonobox_print vfs idl)
+
+AC_SUBST(GNOME_REQUIRED)
+
+AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
+if test x$GNOME_CONFIG = xno; then
+ AC_MSG_ERROR(Couldn't find gnome-config. Please install the GNOME package)
+fi
+
+EAZEL_VERSION_INSIST(gnome-libs, $GNOME_CONFIG --version | awk '{print $2}', >=, GNOME_LIBS_REQUIRED)
dnl check for gnome_canvas_set_dither existence
_libs="$LIBS"
@@ -539,23 +620,7 @@ AC_CHECK_FUNCS(gnome_canvas_set_dither)
LIBS="$_libs"
dnl Bonobo
-AC_MSG_CHECKING(for Bonobo >= 0.32)
-if gnome-config --libs bonobox > /dev/null 2>&1; then
- vers=`gnome-config --modversion bonobo | sed -e "s/bonobo-//" | \
- awk 'BEGIN { FS = "."; } { printf "%d", $1 * 1000 + $2;}'`
- if test "$vers" -ge 32; then
- bonobo_ok=true
- else
- bonobo_ok=false
- fi
-else
- bonobo_ok=false
-fi
-if $bonobo_ok; then
- AC_MSG_RESULT($vers found)
-else
- AC_MSG_ERROR(Bonobo 0.32 or newer is required to compile Nautilus)
-fi
+EAZEL_VERSION_INSIST(bonobo, $GNOME_CONFIG --modversion bonobo | awk -F- '{print $2}', >=, BONOBO_REQUIRED)
AC_SUBST(GNOMECANVASPIXBUF_LIBS)
AC_SUBST(GNOMECANVASPIXBUF_INCLUDEDIR)
@@ -574,9 +639,11 @@ echo "IDL_CFLAGS: $IDL_CFLAGS"
AC_SUBST(IDL_CFLAGS)
-AM_PATH_OAF(0.6.1)
+AM_PATH_OAF($OAF_REQUIRED)
+AC_SUBST(OAF_REQUIRED)
-AM_PATH_GCONF(0.11,,,gconf-gtk)
+AM_PATH_GCONF($GCONF_REQUIRED,,,gconf-gtk)
+AC_SUBST(GCONF_REQUIRED)
AC_PATH_PROG(XML_CONFIG,xml-config,no)
if test x$XML_CONFIG = xno; then