source: trunk/third/gtkhtml/macros/gnome-print-check.m4 @ 16767

Revision 16767, 2.1 KB checked in by ghudson, 23 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r16766, which included commits to RCS files with non-trunk default branches.
Line 
1# Configure paths for GNOME-PRINT
2# Chris Lahey   99-2-5
3# stolen from Manish Singh again
4# stolen back from Frank Belew
5# stolen from Manish Singh
6# Shamelessly stolen from Owen Taylor
7
8dnl AM_PATH_GNOME_PRINT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
9dnl Test for GNOME-PRINT, and define GNOME_PRINT_CFLAGS and GNOME_PRINT_LIBS
10dnl
11AC_DEFUN([AM_PATH_GNOME_PRINT],
12[
13  min_version=ifelse([$1],,0.21,$1)
14
15  gnome_print_ok=""
16
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)
20  else
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")
30          gnome_print_ok="yes"
31        else
32          if test "$minor" -ge "$rqminor"; then
33            AC_MSG_RESULT("found $major.$minor")
34            gnome_print_ok="yes"
35          else
36            AC_MSG_RESULT("you have $major.$minor")
37          fi
38        fi
39      else
40        AC_MSG_RESULT("you have $major.$minor")
41      fi
42    else
43      AC_MSG_RESULT("did not find any version")
44    fi
45  fi
46
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])
51  else
52     GNOME_PRINT_CFLAGS=""
53     GNOME_PRINT_LIBS=""
54     ifelse([$3], , :, [$3])
55  fi
56
57  AC_SUBST(GNOME_PRINT_CFLAGS)
58  AC_SUBST(GNOME_PRINT_LIBS)
59])
60
61AC_DEFUN([GNOME_PRINT_CHECK], [
62        AM_PATH_GNOME_PRINT($1,,[AC_MSG_ERROR(GNOME-PRINT not found or wrong version)])
63])
Note: See TracBrowser for help on using the repository browser.