configure.ac 2.99 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
AC_PREREQ([2.64])
AC_INIT([gupnp],
        [0.17.0],
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gupnp],
        [gupnp],
        [http://www.gupnp.org/])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([libgupnp/gupnp.h])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])

13
AM_INIT_AUTOMAKE()
14
AM_MAINTAINER_MODE([enable])
15

16
AM_SILENT_RULES([yes])
17

18
# Check for programs
19
AC_PROG_CC
20
AC_FUNC_MMAP
21
AC_SYS_LARGEFILE
22

23 24 25 26 27 28
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT

AC_CANONICAL_HOST

29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
AC_MSG_CHECKING([operating system])
case "$host_os" in
     mingw*|cygwin*)
        AC_MSG_RESULT(Win32)
        UUID=uuid
        ;;
     darwin*)
        AC_MSG_RESULT(Darwin)
        UUID=
        ;;
     *)
        AC_MSG_RESULT($host_os)
        UUID=uuid
        ;;
esac

45 46
PKG_CHECK_MODULES(LIBGUPNP, glib-2.0 >= 2.24.0 \
                            gio-2.0 \
47
                            gmodule-2.0 \
48
                            gssdp-1.0 >= 0.11.0 \
49
                            libsoup-2.4 >= 2.28.2 \
50
                            libxml-2.0 \
51
                            $UUID)
52

53 54
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)

55
AC_ARG_WITH([context_manager],
56
            AS_HELP_STRING(
Jens Georg's avatar
Jens Georg committed
57
                        [--with-context-manager=@<:@network-manager/unix/linux@:>@],
58
                        [Context Manager backend to use]),,
59
            [with_context_manager="unix"])
60 61 62 63 64 65 66

AC_MSG_CHECKING([Context Manager backend to use])
AC_MSG_RESULT([${with_context_manager}])

AM_CONDITIONAL([USE_NETWORK_MANAGER],
               [test "x$with_context_manager" = "xnetwork-manager"])

Jens Georg's avatar
Jens Georg committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
USE_NETLINK=no
if test "x$with_context_manager" = "xlinux"; then
       dnl check for netlink (Linux)
       AC_CHECK_HEADERS([sys/socket.h linux/rtnetlink.h],
                        [ USE_NETLINK=yes ],
                        [ USE_NETLINK=no ],
                        [ #ifdef HAVE_SYS_SOCKET_H
                          #include <sys/socket.h>
                          #endif
                        ])
       if test "x$USE_NETLINK" = "xno"
       then
               AC_MSG_NOTICE([No rtnetlink found, falling back to unix context
                              manager])
       else
               AC_CHECK_HEADERS([linux/wireless.h], [], [],
                                [ #ifdef HAVE_SYS_SOCKET_H
                                  #include <sys/socket.h>
                                  #endif
                                ])
       fi
fi

AM_CONDITIONAL(USE_NETLINK, test "x$USE_NETLINK" = "xyes")
AC_SUBST(USE_NETLINK)

93 94 95 96 97 98 99 100 101 102 103 104
# glib-genmarshal
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)

# Debugging
AC_ARG_ENABLE(debug,
	[  --enable-debug          enable debugging],,
        enable_debug=no)
if test "x$enable_debug" = "xyes"; then
        CFLAGS="$CFLAGS -g -Wall -Werror"
fi

Ross Burton's avatar
Ross Burton committed
105 106
GOBJECT_INTROSPECTION_CHECK([0.6.4])

107
# Gtk-doc
108 109
GTK_DOC_CHECK([1.0])

110
AC_CONFIG_FILES([
111 112
Makefile
libgupnp/Makefile
113
examples/Makefile
114
tools/Makefile
115 116
tests/Makefile
doc/Makefile
117
doc/version.xml
118
gupnp-1.0.pc
119
gupnp-1.0-uninstalled.pc
120
])
121
AC_OUTPUT