tizen 2.3.1 release
[external/gupnp.git] / configure.ac
1 AC_PREREQ(2.53)
2 AC_INIT(gupnp, 0.14.1, http://www.gupnp.org/)
3 AM_INIT_AUTOMAKE()
4 AC_CONFIG_SRCDIR(libgupnp/gupnp.h)
5 AM_CONFIG_HEADER(config.h)
6 AM_MAINTAINER_MODE
7 AC_CANONICAL_HOST
8
9 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11 AC_ISC_POSIX
12 AC_PROG_CC
13 AC_STDC_HEADERS
14 AC_PROG_LIBTOOL
15 AC_CONFIG_MACRO_DIR([m4])
16 AC_FUNC_MMAP
17 AC_SYS_LARGEFILE
18
19 AC_MSG_CHECKING([operating system])
20 case "$host_os" in
21      mingw*|cygwin*)
22         AC_MSG_RESULT(Win32)
23         UUID=uuid
24         ;;
25      darwin*)
26         AC_MSG_RESULT(Darwin)
27         UUID=
28         ;;
29      *)
30         AC_MSG_RESULT($host_os)
31         UUID=uuid
32         ;;
33 esac
34
35 PKG_CHECK_MODULES(LIBGUPNP, glib-2.0 >= 2.18 \
36                             gobject-2.0 >= 2.18 \
37                             gmodule-2.0 \
38                             gssdp-1.0 >= 0.7.1 \
39                             libsoup-2.4 >= 2.4.1 \
40                             libxml-2.0 \
41                             $UUID)
42
43 PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
44
45 AC_ARG_WITH([context_manager],
46             AS_HELP_STRING(
47                         [--with-context-manager=@<:@network-manager/unix@:>@],
48                         [Context Manager backend to use]),,
49             [with_context_manager="unix"])
50
51 AC_MSG_CHECKING([Context Manager backend to use])
52 AC_MSG_RESULT([${with_context_manager}])
53
54 AM_CONDITIONAL([USE_NETWORK_MANAGER],
55                [test "x$with_context_manager" = "xnetwork-manager"])
56
57 USE_CONIC=no
58 if test "x$with_context_manager" = "xunix"; then
59         dnl Use libconic if it's available
60         PKG_CHECK_MODULES(LIBCONIC, conic >= 0.13,
61                           [ USE_CONIC=yes
62                             AC_SUBST(LIBCONIC_CFLAGS)
63                             AC_SUBST(LIBCONIC_LIBS)
64                           ],
65                           [ USE_CONIC=no
66                             AC_MSG_WARN([conic 0.13 or greater not found.])
67                           ])
68 fi
69
70 AM_CONDITIONAL(USE_CONIC, test x$USE_CONIC = xyes)
71 AC_SUBST(USE_CONIC)
72
73 # We need dbus-glib if either NetworkManager or libconic is used
74 if test "x$with_context_manager" = "xnetwork-manager" -o \
75         "x$with_context_manager" = "xunix" -a \
76         "x$USE_CONIC" = "xyes"; then
77         PKG_CHECK_MODULES(DBUS_GLIB, dbus-glib-1 >= 0.76)
78 fi
79
80 # glib-genmarshal
81 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
82 AC_SUBST(GLIB_GENMARSHAL)
83
84 # Debugging
85 AC_ARG_ENABLE(debug,
86         [  --enable-debug          enable debugging],,
87         enable_debug=no)
88 if test "x$enable_debug" = "xyes"; then
89         CFLAGS="$CFLAGS -g -Wall -Werror"
90 fi
91
92 GOBJECT_INTROSPECTION_CHECK([0.6.4])
93
94 # Gtk-doc
95 GTK_DOC_CHECK([1.0])
96
97 AC_OUTPUT([
98 Makefile
99 libgupnp/Makefile
100 examples/Makefile
101 tools/Makefile
102 tests/Makefile
103 doc/Makefile
104 doc/version.xml
105 gupnp-1.0.pc
106 gupnp-1.0-uninstalled.pc
107 ])