1
# Configure paths for GNOME-PRINT
3
# stolen from Manish Singh again
4
# stolen back from Frank Belew
5
# stolen from Manish Singh
6
# Shamelessly stolen from Owen Taylor
8
dnl AM_PATH_GNOME_PRINT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
9
dnl Test for GNOME-PRINT, and define GNOME_PRINT_CFLAGS and GNOME_PRINT_LIBS
11
AC_DEFUN([AM_PATH_GNOME_PRINT],
13
min_version=ifelse([$1],,0.21,$1)
17
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
18
if test "$GNOME_CONFIG" = "no" ; then
19
AC_MSG_RESULT(gnome-config is missing, check your gnome installation)
21
AC_MSG_CHECKING(for GNOME-PRINT - version >= $min_version)
22
if `$GNOME_CONFIG --libs print > /dev/null 2>&1`; then
23
rqmajor=`echo "$min_version" | sed -e 's/cvs-//' | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
24
rqminor=`echo "$min_version" | sed -e 's/cvs-//' | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
25
major=`$GNOME_CONFIG --modversion print | sed -e 's/gnome-print-//' | sed -e 's/cvs-//' | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
26
minor=`$GNOME_CONFIG --modversion print | sed -e 's/gnome-print-//' | sed -e 's/cvs-//' | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
27
if test "$major" -ge "$rqmajor"; then
28
if test "$major" -gt "$rqmajor"; then
29
AC_MSG_RESULT("found $major.$minor")
32
if test "$minor" -ge "$rqminor"; then
33
AC_MSG_RESULT("found $major.$minor")
36
AC_MSG_RESULT("you have $major.$minor")
40
AC_MSG_RESULT("you have $major.$minor")
43
AC_MSG_RESULT("did not find any version")
47
if test "x$gnome_print_ok" != "x" ; then
48
GNOME_PRINT_CFLAGS=`$GNOME_CONFIG --cflags print`
49
GNOME_PRINT_LIBS=`$GNOME_CONFIG --libs print`
50
ifelse([$2], , :, [$2])
54
ifelse([$3], , :, [$3])
57
AC_SUBST(GNOME_PRINT_CFLAGS)
58
AC_SUBST(GNOME_PRINT_LIBS)
61
AC_DEFUN([GNOME_PRINT_CHECK], [
62
AM_PATH_GNOME_PRINT($1,,[AC_MSG_ERROR(GNOME-PRINT not found or wrong version)])