File: configure.ac

package info (click to toggle)
gupnp 1.0.5-0%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,212 kB
  • sloc: ansic: 15,300; sh: 4,241; xml: 1,253; python: 416; makefile: 312
file content (181 lines) | stat: -rw-r--r-- 4,782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
AC_PREREQ([2.64])
AC_INIT([gupnp],
        [1.0.5],
        [https://gitlab.gnome.org/GNOME/gupnp/issues/new],
        [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])

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

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

AM_SILENT_RULES([yes])

AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK])
AX_CHECK_ENABLE_DEBUG([yes])

# Check for programs
AC_PROG_CC
AC_FUNC_MMAP
AC_SYS_LARGEFILE

AX_IS_RELEASE([git-directory])
AX_COMPILER_FLAGS([WARN_CFLAGS])

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT

GUUL_CHECK_UUID([internal])
UUID_LIBS=$GUUL_PKG
AC_SUBST([UUID_LIBS])

AC_MSG_CHECKING([operating system])
os_win32=no
case "$target_os" in
     mingw*|cygwin*)
        os_win32=yes
        AC_MSG_RESULT(Win32)
        ;;
     darwin*)
        AC_MSG_RESULT(Darwin)
        ;;
     *)
        AC_MSG_RESULT($target_os)
        ;;
esac

PKG_CHECK_MODULES(LIBGUPNP, glib-2.0 >= 2.40.0 \
                            gio-2.0 \
                            gmodule-2.0 \
                            gssdp-1.0 >= 0.14.15 \
                            libsoup-2.4 >= 2.48.0 \
                            libxml-2.0)
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)

AM_CONDITIONAL(OS_WIN32, test "x$os_win32" = "xyes")
if test "x$os_win32" = "xno"; then
    AC_ARG_WITH([context_manager],
            AS_HELP_STRING(
                        [--with-context-manager=@<:@network-manager/connman/unix/linux@:>@],
                        [Context Manager backend to use]),,
            [with_context_manager="none"])
else
    with_context_manager="windows"
fi

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

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([ifaddrs.h],
                 [ HAVE_IFADDRS_H=yes ],
                 [ HAVE_IFADDRS_H=no ])
AM_CONDITIONAL([HAVE_IFADDRS_H], [test "x$HAVE_IFADDRS_H" = "xyes"])
AC_SUBST(HAVE_IFADDRS_H)

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

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"])

AM_CONDITIONAL([USE_CONNMAN],
               [test "x$with_context_manager" = "xconnman"])

USE_NETLINK=no
AS_IF([test "x$with_context_manager" = "xlinux"],
      [AS_IF([test "x$HAVE_NETLINK" = "xno"],
             [AS_IF([test "x$HAVE_IFADDRS" = "xyes"],
	     AC_MSG_NOTICE([No rtnetlink found, falling back to static context manager]),
	     AC_MSG_ERROR([No rtnetlink nor ifaddrs.h found]))],
             [USE_NETLINK=yes])
      ],[])

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

# glib-genmarshal
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
AC_SUBST(GLIB_GENMARSHAL)

GOBJECT_INTROSPECTION_CHECK([0.6.4])

# vapigen
have_vapigen=no
AS_IF([test "x$found_introspection" = "xyes"],
      [
       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])
      ]
)
AS_IF([test "x$VAPIGEN" != "x"], [have_vapigen=yes])
AM_CONDITIONAL([HAVE_VAPIGEN], [test "x$VAPIGEN" != "x"])

# Gtk-doc
GTK_DOC_CHECK([1.14],[--flavour no-tmpl])

AC_CONFIG_FILES([
Makefile
libgupnp/Makefile
examples/Makefile
tools/Makefile
tests/Makefile
tests/gtest/Makefile
doc/Makefile
doc/version.xml
vala/Makefile
gupnp-1.0.pc
gupnp-1.0-uninstalled.pc
])
AC_OUTPUT

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

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