~drizzle-trunk/drizzle/development

1192.3.27 by Monty Taylor
pandora-build v0.71. Added check for avahi.
1
dnl  Copyright (C) 2009 Sun Microsystems
2
dnl This file is free software; Sun Microsystems
3
dnl gives unlimited permission to copy and/or distribute it,
4
dnl with or without modifications, as long as this notice is preserved.
5
6
AC_DEFUN([_PANDORA_SEARCH_LIBAVAHI],[
7
  AC_REQUIRE([AC_LIB_PREFIX])
8
9
  dnl --------------------------------------------------------------------
10
  dnl  Check for libavahi
11
  dnl --------------------------------------------------------------------
12
13
  AC_ARG_ENABLE([libavahi],
14
    [AS_HELP_STRING([--disable-libavahi],
15
      [Build with libavahi support @<:@default=on@:>@])],
16
    [ac_enable_libavahi="$enableval"],
17
    [ac_enable_libavahi="yes"])
18
19
  AS_IF([test "x$ac_enable_libavahi" = "xyes"],[
20
    AC_LIB_HAVE_LINKFLAGS(avahi-client,avahi-common,[
21
      #include <avahi-client/client.h>
22
      #include <avahi-common/simple-watch.h>
23
    ],[
24
      AvahiSimplePoll *simple_poll= avahi_simple_poll_new();
25
    ])
26
  ],[
27
    ac_cv_libavahi="no"
28
  ])
29
30
  AM_CONDITIONAL(HAVE_LIBAVAHI, [test "x${ac_cv_libavahi}" = "xyes"])
31
])
32
33
AC_DEFUN([PANDORA_HAVE_LIBAVAHI],[
34
  AC_REQUIRE([_PANDORA_SEARCH_LIBAVAHI])
35
])
36
37
AC_DEFUN([PANDORA_REQUIRE_LIBAVAHI],[
38
  AC_REQUIRE([_PANDORA_SEARCH_LIBAVAHI])
39
  AS_IF([test "x${ac_cv_libavahi}" = "xno"],
40
    AC_MSG_ERROR([libavahi is required for ${PACKAGE}]))
41
])