~ubuntu-branches/debian/lenny/ggz-server/lenny

« back to all changes in this revision

Viewing changes to m4/zeroconf.m4

  • Committer: Bazaar Package Importer
  • Author(s): Neil Williams
  • Date: 2008-08-30 22:28:31 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080830222831-lt2l462usl5opxfd
Tags: 0.0.14.1-1.2
* Non-maintainer upload.
* Improve the database.m4 fix to migrate to libdb4.6
  instead of 4.4 {request from Steve Langasek.}

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl =================================
 
2
dnl GGZ Gaming Zone - Zeroconf Macros
 
3
dnl =================================
 
4
dnl
 
5
dnl Looks for zeroconf library implementations and
 
6
dnl sets up the corresponding variables, that is,
 
7
dnl $zeroconf for display purposes and LIB_AVAHI/LIB_HOWL/
 
8
dnl AVAHI_INCLUDES/HOWL_INCLUDES depending on the choice.
 
9
dnl
 
10
dnl ------------------------------------------------------------------------
 
11
dnl Content of this file:
 
12
dnl ------------------------------------------------------------------------
 
13
dnl AC_GGZ_ZEROCONF - find a suitable zeroconf implementation
 
14
dnl
 
15
dnl ------------------------------------------------------------------------
 
16
dnl Internal functions:
 
17
dnl ------------------------------------------------------------------------
 
18
dnl AC_GGZ_ZEROCONF_HOWL - Howl library
 
19
dnl AC_GGZ_ZEROCONF_AVAHI - Avahi library
 
20
dnl
 
21
 
 
22
dnl Zeroconf checks for Howl and Avahi
 
23
dnl ==================================
 
24
AC_DEFUN([AC_GGZ_ZEROCONF],
 
25
[
 
26
        if test "$zeroconf" = yes || test "$zeroconf" = avahi; then
 
27
                AC_GGZ_ZEROCONF_AVAHI
 
28
        fi
 
29
        if test "$zeroconf" = yes || test "$zeroconf" = howl; then
 
30
                AC_GGZ_ZEROCONF_HOWL
 
31
        fi
 
32
 
 
33
        if test "$zeroconf" = "howl"; then
 
34
                AC_DEFINE(WITH_HOWL, 1, [Use howl for zeroconf mechanism])
 
35
                HOWL_INCLUDES="-I/usr/include/howl"
 
36
                LIB_HOWL="-lhowl -lpthread"
 
37
                AC_SUBST(HOWL_INCLUDES)
 
38
                AC_SUBST(LIB_HOWL)
 
39
                AC_C_BIGENDIAN
 
40
        elif test "$zeroconf" = "avahi"; then
 
41
                AC_DEFINE(WITH_AVAHI, 1, [Use avahi for zeroconf mechanism])
 
42
                AVAHI_INCLUDES="-I/usr/include"
 
43
                LIB_AVAHI="-lavahi-client"
 
44
                AC_SUBST(AVAHI_INCLUDES)
 
45
                AC_SUBST(LIB_AVAHI)
 
46
        else
 
47
                AC_MSG_WARN([Zeroconf disabled, neither howl nor avahi found.])
 
48
                zeroconf="(none)"
 
49
        fi
 
50
])
 
51
 
 
52
dnl Check for zeroconf implementation Howl
 
53
dnl ======================================
 
54
AC_DEFUN([AC_GGZ_ZEROCONF_HOWL],
 
55
[
 
56
        AC_CHECK_LIB(howl, sw_discovery_init,
 
57
        [
 
58
                AC_CHECK_HEADERS([howl/howl_config.h],
 
59
                [
 
60
                        zeroconf=howl
 
61
                ],
 
62
                [
 
63
                        if test "$zeroconf" = "howl"; then
 
64
                                AC_MSG_ERROR([cannot configure howl (headers needed)])
 
65
                        fi
 
66
                ])
 
67
        ],
 
68
        [
 
69
                if test "$zeroconf" = "howl"; then
 
70
                        AC_MSG_ERROR([cannot configure howl (library needed)])
 
71
                fi
 
72
        ],
 
73
        [-lpthread])
 
74
])
 
75
 
 
76
dnl Check for zeroconf implementation Avahi
 
77
dnl =======================================
 
78
AC_DEFUN([AC_GGZ_ZEROCONF_AVAHI],
 
79
[
 
80
        AC_CHECK_LIB(avahi-client, avahi_entry_group_add_service,
 
81
        [
 
82
                AC_CHECK_HEADERS([avahi-client/publish.h],
 
83
                [
 
84
                        zeroconf=avahi
 
85
                ],
 
86
                [
 
87
                        if test "$zeroconf" = "avahi"; then
 
88
                                AC_MSG_ERROR([cannot configure avahi (headers needed)])
 
89
                        fi
 
90
                ])
 
91
        ],
 
92
        [
 
93
                if test "$zeroconf" = "avahi"; then
 
94
                        AC_MSG_ERROR([cannot configure avahi (library needed)])
 
95
                fi
 
96
        ],
 
97
        [-lpthread])
 
98
])
 
99