configure.ac 3.69 KB
Newer Older
1 2
AC_PREREQ([2.64])
AC_INIT([gupnp],
Jens Georg's avatar
Jens Georg committed
3
        [0.19.0],
Jens Georg's avatar
Jens Georg committed
4
        [http://bugzilla.gnome.org/enter_bug.cgi?product=gupnp&component=gupnp],
5 6 7 8 9 10 11 12
        [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 14 15
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

16
AM_INIT_AUTOMAKE([1.11 tar-ustar no-dist-gzip dist-xz])
17
AM_MAINTAINER_MODE([enable])
18

19
AM_SILENT_RULES([yes])
20

21
# Check for programs
22
AC_PROG_CC
23
AC_FUNC_MMAP
24
AC_SYS_LARGEFILE
25

26 27 28 29 30
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT


Jens Georg's avatar
Jens Georg committed
31 32 33
PKG_CHECK_MODULES(GTest, glib-2.0 >= 2.16, [gtest=yes], [gtest=no])
AM_CONDITIONAL(HAVE_GTEST, [test x$gtest = xyes])

34
AC_MSG_CHECKING([operating system])
35
case "$target_os" in
36 37 38 39 40 41 42 43 44
     mingw*|cygwin*)
        AC_MSG_RESULT(Win32)
        UUID=uuid
        ;;
     darwin*)
        AC_MSG_RESULT(Darwin)
        UUID=
        ;;
     *)
45
        AC_MSG_RESULT($target_os)
46 47 48 49
        UUID=uuid
        ;;
esac

Jens Georg's avatar
Jens Georg committed
50
PKG_CHECK_MODULES(LIBGUPNP, glib-2.0 >= 2.24.0 \
51
                            gio-2.0 \
52
                            gmodule-2.0 \
Jens Georg's avatar
Jens Georg committed
53
                            gssdp-1.0 >= 0.11.2 \
54
                            libsoup-2.4 >= 2.28.2 \
55
                            libxml-2.0 \
56
                            $UUID)
57

58 59
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)

60
AC_ARG_WITH([context_manager],
61
            AS_HELP_STRING(
62
                        [--with-context-manager=@<:@network-manager/connman/unix/linux@:>@],
63
                        [Context Manager backend to use]),,
64 65 66 67 68 69 70 71 72 73 74 75
            [with_context_manager="none"])

if test "x$with_context_manager" = "xnone"; then
        case "$target_os" in
        linux*)
                with_context_manager="linux"
                ;;
        *)
                with_context_manager="unix"
                ;;
        esac
fi
76

Jens Georg's avatar
Jens Georg committed
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
AC_CHECK_HEADERS([sys/socket.h linux/rtnetlink.h],
                [ HAVE_NETLINK=yes ],
                [ HAVE_NETLINK=no ],
                [ #ifdef HAVE_SYS_SOCKET_H
                  #include <sys/socket.h>
                  #endif
                ])
AM_CONDITIONAL([HAVE_NETLINK], [test "x$HAVE_NETLINK" = "xyes"])
AC_SUBST(HAVE_NETLINK)

AC_CHECK_HEADERS([linux/wireless.h], [], [],
                [ #ifdef HAVE_SYS_SOCKET_H
                  #include <sys/socket.h>
                  #endif
                ])

93 94 95 96 97
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
98 99
AS_IF([test "x$with_context_manager" = "xnetwork-manager"],
      [PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.26)])
100

101 102 103 104
AM_CONDITIONAL([USE_CONNMAN],
               [test "x$with_context_manager" = "xconnman"])

if test "x$with_context_manager" = "xconnman"; then
Jens Georg's avatar
Jens Georg committed
105
        PKG_CHECK_MODULES(CONNMAN, glib-2.0 >= 2.28 connman >= 0.80)
106 107
fi

Jens Georg's avatar
Jens Georg committed
108
USE_NETLINK=no
Jens Georg's avatar
Jens Georg committed
109 110 111 112 113
AS_IF([test "x$with_context_manager" = "xlinux"],
      [AS_IF([test "x$HAVE_NETLINK" = "xno"],
             [AC_MSG_NOTICE([No rtnetlink found, falling back to static context manager])],
             [USE_NETLINK=yes])
      ],[])
Jens Georg's avatar
Jens Georg committed
114 115 116 117

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

118 119 120 121 122 123
# glib-genmarshal
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)

# Debugging
AC_ARG_ENABLE(debug,
Ludovic Ferrandis's avatar
Ludovic Ferrandis committed
124
        AS_HELP_STRING([--enable-debug], [enable debugging]),,
125 126 127 128 129
        enable_debug=no)
if test "x$enable_debug" = "xyes"; then
        CFLAGS="$CFLAGS -g -Wall -Werror"
fi

Ross Burton's avatar
Ross Burton committed
130 131
GOBJECT_INTROSPECTION_CHECK([0.6.4])

132
# Gtk-doc
133 134
GTK_DOC_CHECK([1.0])

135
AC_CONFIG_FILES([
136 137
Makefile
libgupnp/Makefile
138
examples/Makefile
139
tools/Makefile
140
tests/Makefile
Jens Georg's avatar
Jens Georg committed
141
tests/gtest/Makefile
142
doc/Makefile
143
doc/version.xml
144
gupnp-1.0.pc
145
gupnp-1.0-uninstalled.pc
146
])
147
AC_OUTPUT