configure.ac 4.66 KB
Newer Older
1 2
AC_PREREQ([2.64])
AC_INIT([gupnp],
Jens Georg's avatar
Jens Georg committed
3
        [0.20.10],
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


31
AC_MSG_CHECKING([operating system])
32
os_win32=no
33
case "$target_os" in
34
     mingw*|cygwin*)
Jens Georg's avatar
Jens Georg committed
35
        os_win32=yes
36
        AC_MSG_RESULT(Win32)
Jens Georg's avatar
Jens Georg committed
37
        UUID=
38 39 40 41 42 43
        ;;
     darwin*)
        AC_MSG_RESULT(Darwin)
        UUID=
        ;;
     *)
44
        AC_MSG_RESULT($target_os)
45 46 47 48
        UUID=uuid
        ;;
esac

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

Jens Georg's avatar
Jens Georg committed
58 59 60
AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")
if test "x$os_win32" = "xno"; then
    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
            [with_context_manager="none"])
65 66
else
    LIBGUPNP_LIBS="$LIBGUPNP_LIBS -lrpcrt4"
67
    with_context_manager="windows"
Jens Georg's avatar
Jens Georg committed
68
fi
69 70 71 72 73 74 75 76 77 78 79

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

Jens Georg's avatar
Jens Georg committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
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
                ])

97 98 99 100 101
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
102 103
AS_IF([test "x$with_context_manager" = "xnetwork-manager"],
      [PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.26)])
104

105 106 107 108
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
109
        PKG_CHECK_MODULES(CONNMAN, glib-2.0 >= 2.28 connman >= 0.80)
110 111
fi

Jens Georg's avatar
Jens Georg committed
112
USE_NETLINK=no
Jens Georg's avatar
Jens Georg committed
113 114 115 116 117
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
118 119 120 121

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

122 123 124 125 126 127
# 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
128
        AS_HELP_STRING([--enable-debug], [enable debugging]),,
129 130 131 132 133
        enable_debug=no)
if test "x$enable_debug" = "xyes"; then
        CFLAGS="$CFLAGS -g -Wall -Werror"
fi

134
GOBJECT_INTROSPECTION_CHECK([0.6.4])
Jens Georg's avatar
Jens Georg committed
135 136

# vapigen
137
have_vapigen=no
Jens Georg's avatar
Jens Georg committed
138 139
AS_IF([test "x$found_introspection" = "xyes"],
      [
140 141 142 143 144 145 146 147 148 149
       dnl output of g-i >= 1.36.0 needs vapigen >= 0.20 to process
       AC_MSG_CHECKING([whether G-I is 1.36 or newer])
       VAPIGEN_MIN_VERSION=0.14
       AS_IF([pkg-config --atleast-version=1.36.0 gobject-introspection-1.0],
             [
              AC_MSG_RESULT([yes])
              VAPIGEN_MIN_VERSION=0.20
             ],[AC_MSG_RESULT([no])]
       )
       GUPNP_PROG_VAPIGEN([$VAPIGEN_MIN_VERSION])
Jens Georg's avatar
Jens Georg committed
150 151
      ]
)
152
AS_IF([test "x$VAPIGEN" != "x"], [have_vapigen=yes])
Jens Georg's avatar
Jens Georg committed
153
AM_CONDITIONAL([HAVE_VAPIGEN], [test "x$VAPIGEN" != "x"])
Ross Burton's avatar
Ross Burton committed
154

155
# Gtk-doc
Jens Georg's avatar
Jens Georg committed
156
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
157

158
AC_CONFIG_FILES([
159 160
Makefile
libgupnp/Makefile
161
examples/Makefile
162
tools/Makefile
163
tests/Makefile
Jens Georg's avatar
Jens Georg committed
164
tests/gtest/Makefile
165
doc/Makefile
166
doc/version.xml
Jens Georg's avatar
Jens Georg committed
167
vala/Makefile
168
gupnp-1.0.pc
169
gupnp-1.0-uninstalled.pc
170
])
171
AC_OUTPUT
172 173 174 175 176 177 178 179 180 181

echo "
    ${PACKAGE} ${VERSION}
    ---------------------

    Prefix:                ${prefix}
    GObject-Introspection: ${found_introspection}
    VALA bindings:         ${have_vapigen}
    Context manager:       ${with_context_manager}
"