aboutsummaryrefslogtreecommitdiffstats
path: root/macros/gnome-conduit-check.m4
blob: 2cc3655cb58144e255223ae60bfa1ac454ee702f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
dnl
dnl GNOME_CONDUIT_HOOK (script-if-xml-found, failflag)
dnl
dnl If failflag is "failure", script aborts due to lack of XML
dnl 
dnl Check for availability of the Pilot conduit framework
dnl

AC_DEFUN([CONDUIT_LIBS_CHECK], [
    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
    if test "$GNOME_CONFIG" = no; then
        if test x$2 = xfailure; then
            AC_MSG_ERROR(Could not find gnome-config)
        fi
    fi

    AC_MSG_CHECKING(for Palm conduit libs)
    if gnome-config --libs conduit > /dev/null 2>&1; then
        GNOME_CONDUIT_LIBS=`gnome-config --libs conduit`
        GNOME_CONDUIT_INCLUDEDIR=`gnome-config --cflags conduit`
        HAVE_GNOME_CONDUIT=yes
        AC_MSG_RESULT(yes)
    else
        AC_MSG_RESULT(no)
    fi

    AC_SUBST(HAVE_GNOME_CONDUIT)
    AC_SUBST(GNOME_CONDUIT_LIBS)
    AC_SUBST(GNOME_CONDUIT_INCLUDEDIR)
])

AC_DEFUN([GNOME_CONDUIT_HOOK], [
    AC_ARG_ENABLE(conduits,
        [ --disable-conduits    disable Palm conduits ], [
        if test x$enableval = xno; then
            # do nothing
            true
        else
            # try to find conduit libs. error if not found.
            CONDUIT_LIBS_CHECK
            if test x$HAVE_GNOME_CONDUIT = x; then
                AC_MSG_ERROR(Palm conduit libraries not found)
            fi
        fi ], [ 
        CONDUIT_LIBS_CHECK ])
])
        
AC_DEFUN([GNOME_CONDUIT_CHECK], [
    GNOME_CONDUIT_HOOK([],failure)
])