~drizzle-trunk/drizzle/development

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
51
52
53
54
55
dnl  Copyright (C) 2009 Sun Microsystems, Inc.
dnl This file is free software; Sun Microsystems, Inc.
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

#--------------------------------------------------------------------
# Check for libuuid
#--------------------------------------------------------------------


AC_DEFUN([_PANDORA_SEARCH_LIBUUID],[
  AC_REQUIRE([AC_LIB_PREFIX])

  dnl Do this by hand. Need to check for uuid/uuid.h, but uuid may or may
  dnl not be a lib is weird.
  AC_CHECK_HEADERS(uuid/uuid.h)
  AC_LIB_HAVE_LINKFLAGS(uuid,,
  [
    #include <uuid/uuid.h>
  ],
  [
    uuid_t uout;
    uuid_generate(uout);
  ])

  AM_CONDITIONAL(HAVE_LIBUUID, [test "x${ac_cv_libuuid}" = "xyes"])
])

AC_DEFUN([_PANDORA_HAVE_LIBUUID],[

  AC_ARG_ENABLE([libuuid],
    [AS_HELP_STRING([--disable-libuuid],
      [Build with libuuid support @<:@default=on@:>@])],
    [ac_enable_libuuid="$enableval"],
    [ac_enable_libuuid="yes"])

  _PANDORA_SEARCH_LIBUUID
])


AC_DEFUN([PANDORA_HAVE_LIBUUID],[
  AC_REQUIRE([_PANDORA_HAVE_LIBUUID])
])

AC_DEFUN([_PANDORA_REQUIRE_LIBUUID],[
  ac_enable_libuuid="yes"
  _PANDORA_SEARCH_LIBUUID
  AS_IF([test "x$ac_cv_header_uuid_uuid_h" = "xno"],[
    AC_MSG_ERROR([Couldn't find uuid/uuid.h. On Debian this can be found in uuid-dev. On Redhat this can be found in e2fsprogs-devel.])
  ])
])

AC_DEFUN([PANDORA_REQUIRE_LIBUUID],[
  AC_REQUIRE([_PANDORA_REQUIRE_LIBUUID])
])