configure.ac 2.83 KB
Newer Older
1
AC_PREREQ(2.53)
2
AC_INIT(gupnp, 0.17.0, http://www.gupnp.org/)
3
AM_INIT_AUTOMAKE()
4
AC_CONFIG_SRCDIR(libgupnp/gupnp.h)
5 6
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
7
AC_CANONICAL_HOST
8

9 10
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

11 12 13 14
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL
15
AC_CONFIG_MACRO_DIR([m4])
16
AC_FUNC_MMAP
17
AC_SYS_LARGEFILE
18

19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
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

35 36
PKG_CHECK_MODULES(LIBGUPNP, glib-2.0 >= 2.24.0 \
                            gio-2.0 \
37
                            gmodule-2.0 \
38
                            gssdp-1.0 >= 0.11.0 \
39
                            libsoup-2.4 >= 2.28.2 \
40
                            libxml-2.0 \
41
                            $UUID)
42

43 44
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)

45
AC_ARG_WITH([context_manager],
46
            AS_HELP_STRING(
Jens Georg's avatar
Jens Georg committed
47
                        [--with-context-manager=@<:@network-manager/unix/linux@:>@],
48
                        [Context Manager backend to use]),,
49
            [with_context_manager="unix"])
50 51 52 53 54 55 56

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
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
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)

83 84 85 86 87 88 89 90 91 92 93 94
# 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
95 96
GOBJECT_INTROSPECTION_CHECK([0.6.4])

97
# Gtk-doc
98 99 100 101 102
GTK_DOC_CHECK([1.0])

AC_OUTPUT([
Makefile
libgupnp/Makefile
103
examples/Makefile
104
tools/Makefile
105 106
tests/Makefile
doc/Makefile
107
doc/version.xml
108
gupnp-1.0.pc
109
gupnp-1.0-uninstalled.pc
110
])