summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am13
-rwxr-xr-xautogen.sh38
-rw-r--r--configure.ac184
-rw-r--r--doc/Makefile.am118
-rw-r--r--doc/meson.build27
-rw-r--r--examples/Makefile.am15
-rw-r--r--examples/meson.build12
-rw-r--r--gupnp-1.2-uninstalled.pc.in11
-rw-r--r--gupnp-1.2.pc.in11
-rw-r--r--libgupnp/Makefile.am201
-rw-r--r--libgupnp/gupnp-enums.c.template33
-rw-r--r--libgupnp/gupnp-enums.h.template26
-rw-r--r--libgupnp/meson.build128
-rw-r--r--m4/ax_append_compile_flags.m467
-rw-r--r--m4/ax_append_flag.m471
-rw-r--r--m4/ax_append_link_flags.m465
-rw-r--r--m4/ax_check_compile_flag.m474
-rw-r--r--m4/ax_check_enable_debug.m4124
-rw-r--r--m4/ax_check_link_flag.m474
-rw-r--r--m4/ax_compiler_flags.m4158
-rw-r--r--m4/ax_compiler_flags_cflags.m4133
-rw-r--r--m4/ax_compiler_flags_gir.m460
-rw-r--r--m4/ax_compiler_flags_ldflags.m475
-rw-r--r--m4/ax_is_release.m469
-rw-r--r--m4/ax_require_defined.m437
-rw-r--r--m4/guul.m454
-rw-r--r--m4/introspection.m494
-rw-r--r--m4/vapigen.m443
-rw-r--r--meson.build55
-rw-r--r--meson_options.txt5
-rw-r--r--subprojects/guul/guul.c (renamed from libgupnp/guul.c)0
-rw-r--r--subprojects/guul/guul.h (renamed from libgupnp/guul.h)4
-rw-r--r--subprojects/guul/meson.build33
-rw-r--r--tests/Makefile.am43
-rw-r--r--tests/gtest/Makefile.am19
-rw-r--r--tests/gtest/meson.build12
-rw-r--r--tests/meson.build9
-rw-r--r--tools/Makefile.am1
-rw-r--r--tools/meson.build1
-rw-r--r--vala/GUPnP-1.2.metadata1
-rw-r--r--vala/Makefile.am21
-rw-r--r--vala/meson.build5
42 files changed, 346 insertions, 1878 deletions
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index f9df539..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-
-SUBDIRS = libgupnp tools examples tests doc vala
-
-pkgconfig_DATA= gupnp-1.2.pc
-pkgconfigdir = $(libdir)/pkgconfig
-
-EXTRA_DIST = gupnp-1.2.pc.in gupnp-1.2-uninstalled.pc.in
-
-DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection
-
-# Extra clean files so that maintainer-clean removes *everything*
-MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh Makefile.in missing config.h.in
diff --git a/autogen.sh b/autogen.sh
deleted file mode 100755
index b6efba6..0000000
--- a/autogen.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-test -n "$srcdir" || srcdir=$(dirname "$0")
-test -n "$srcdir" || srcdir=.
-
-olddir=$(pwd)
-
-cd $srcdir
-
-(test -f configure.ac) || {
- echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
- exit 1
-}
-
-# shellcheck disable=SC2016
-PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
-
-if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
- echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
- echo "*** If you wish to pass any to it, please specify them on the" >&2
- echo "*** '$0' command line." >&2
- echo "" >&2
-fi
-
-aclocal --install || exit 1
-gtkdocize --copy || exit 1
-autoreconf --verbose --force --install || exit 1
-
-cd "$olddir"
-if [ "$NOCONFIGURE" = "" ]; then
- $srcdir/configure "$@" || exit 1
-
- if [ "$1" = "--help" ]; then exit 0 else
- echo "Now type 'make' to compile $PKG_NAME" || exit 1
- fi
-else
- echo "Skipping configure process."
-fi
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index f73b3c5..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,184 +0,0 @@
-AC_PREREQ([2.64])
-AC_INIT([gupnp],
- [1.1.0],
- [http://bugzilla.gnome.org/enter_bug.cgi?product=gupnp&component=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])
-
-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.2 >= 1.1.0 \
- 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)
-
-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_MSG_CHECKING([for glib-mkenums script])
-GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
-AS_IF([test "x$GLIB_MKENUMS" = "x"],
- [AC_MSG_ERROR([glib-mkenums not listed in glib-2.0 pkg-config file])],
- [AC_SUBST([GLIB_MKENUMS])
- AC_MSG_RESULT([$GLIB_MKENUMS])])
-
-AC_CONFIG_FILES([
-Makefile
-libgupnp/Makefile
-examples/Makefile
-tools/Makefile
-tests/Makefile
-tests/gtest/Makefile
-doc/Makefile
-doc/version.xml
-vala/Makefile
-gupnp-1.2.pc
-gupnp-1.2-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}
-"
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index b6e5fba..0000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,118 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-# We require automake 1.6 at least.
-AUTOMAKE_OPTIONS = 1.6
-
-# This is a blank Makefile.am for using gtk-doc.
-# Copy this to your project's API docs directory and modify the variables to
-# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
-# of using the various options.
-
-# The name of the module, e.g. 'glib'.
-DOC_MODULE=gupnp
-
-# Uncomment for versioned docs and specify the version of the module, e.g. '2'.
-#DOC_MODULE_VERSION=2
-
-
-# The top-level SGML file. You can change this if you want to.
-DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
-
-# Directories containing the source code.
-# gtk-doc will search all .c and .h files beneath these paths
-# for inline comments documenting functions and macros.
-# e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk
-DOC_SOURCE_DIR=../libgupnp
-
-# Extra options to pass to gtkdoc-scangobj. Not normally needed.
-SCANGOBJ_OPTIONS=
-
-# Extra options to supply to gtkdoc-scan.
-# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
-SCAN_OPTIONS=--deprecated-guards="GUPNP_DISABLE_DEPRECATED"
-
-# Extra options to supply to gtkdoc-mkdb.
-# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
-MKDB_OPTIONS=--xml-mode --output-format=xml
-
-# Extra options to supply to gtkdoc-mktmpl
-# e.g. MKTMPL_OPTIONS=--only-section-tmpl
-MKTMPL_OPTIONS=
-
-# Extra options to supply to gtkdoc-mkhtml
-MKHTML_OPTIONS=
-
-# Extra options to supply to gtkdoc-fixref. Not normally needed.
-# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
-FIXXREF_OPTIONS=
-
-# Used for dependencies. The docs will be rebuilt if any of these change.
-# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
-# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
-HFILE_GLOB=$(top_srcdir)/libgupnp/*.h
-CFILE_GLOB=$(top_srcdir)/libgupnp/*.c
-
-# Extra header to include when scanning, which are not under DOC_SOURCE_DIR
-# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h
-EXTRA_HFILES=
-
-# Header files or dirs to ignore when scanning. Use base file/dir names
-# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
-IGNORE_HFILES=gena-protocol.h \
- xml-util.h \
- gvalue-util.h \
- http-headers.h \
- gupnp-marshal.h \
- gupnp-context-private.h \
- gupnp-linux-context-manager.h \
- gupnp-network-manager.h \
- gupnp-unix-context-manager.h \
- gupnp-device-info-private.h \
- gupnp-error-private.h \
- gupnp-resource-factory-private.h \
- gupnp-service-introspection-private.h \
- gupnp-types-private.h
-
-# Images to copy into HTML directory.
-# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
-HTML_IMAGES=
-
-# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
-# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
-content_files=overview.xml client-tutorial.xml server-tutorial.xml gupnp-binding-tool.xml device-description.rnc service-description.rnc glossary.xml
-
-# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
-# These files must be listed here *and* in content_files
-# e.g. expand_content_files=running.sgml
-expand_content_files=client-tutorial.xml server-tutorial.xml
-
-# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
-# Only needed if you are using gtkdoc-scangobj to dynamically query widget
-# signals and properties.
-# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
-# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
-GTKDOC_CFLAGS=-I$(top_srcdir) $(LIBGUPNP_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/libgupnp/libgupnp-1.2.la $(LIBGUPNP_LIBS)
-
-# This includes the standard gtk-doc make rules, copied by gtkdocize.
-include $(top_srcdir)/gtk-doc.make
-
-# Other files to distribute
-# e.g. EXTRA_DIST += version.xml.in
-EXTRA_DIST += version.xml.in
-
-# Files not to distribute
-# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
-# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
-#DISTCLEANFILES +=
-
-# Comment this out if you want 'make check' to test you doc status
-# and run some sanity checks
-if ENABLE_GTK_DOC
-TESTS_ENVIRONMENT = cd $(srcdir) && \
- DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
- SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
-# TESTS = $(GTKDOC_CHECK)
-endif
-
--include $(top_srcdir)/git.mk
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 0000000..cfaec18
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,27 @@
+entities = configuration_data()
+entities.set('VERSION', meson.project_version())
+configure_file(input: 'version.xml.in',
+ output: 'version.xml', configuration:
+ entities)
+
+gnome.gtkdoc('gupnp',
+ main_xml : 'gupnp-docs.xml',
+ src_dir : [join_paths(meson.source_root(), 'libgupnp'),
+ join_paths(meson.build_root(), 'libgupnp')],
+ dependencies : libgupnp,
+ ignore_headers : [
+ 'gena-protocol.h',
+ 'xml-util.h',
+ 'gvalue-util.h',
+ 'http-headers.h',
+ 'gupnp-context-private.h',
+ 'gupnp-linux-context-manager.h',
+ 'gupnp-network-manager.h',
+ 'gupnp-unix-context-manager.h',
+ 'gupnp-device-info-private.h',
+ 'gupnp-error-private.h',
+ 'gupnp-resource-factory-private.h',
+ 'gupnp-service-introspection-private.h',
+ 'gupnp-types-private.h'
+ ],
+ install : true)
diff --git a/examples/Makefile.am b/examples/Makefile.am
deleted file mode 100644
index 58e569a..0000000
--- a/examples/Makefile.am
+++ /dev/null
@@ -1,15 +0,0 @@
-AM_CFLAGS = $(LIBGUPNP_CFLAGS) -I$(top_srcdir) -I$(top_builddir) $(GTHREAD_CFLAGS)
-LDADD = $(top_builddir)/libgupnp/libgupnp-1.2.la
-
-noinst_PROGRAMS = light-server light-client
-
-light_server_SOURCES = light-server.c
-light_server_LDFLAGS = -export-dynamic $(GTHREAD_LIBS) $(LIBGUPNP_LIBS)
-
-light_client_SOURCES = light-client.c
-light_client_LDFLAGS = $(GTHREAD_LIBS) $(LIBGUPNP_LIBS)
-
-MAINTAINERCLEANFILES = Makefile.in
-
-EXTRA_DIST = BinaryLight1.xml \
- SwitchPower1.xml
diff --git a/examples/meson.build b/examples/meson.build
new file mode 100644
index 0000000..dccd47b
--- /dev/null
+++ b/examples/meson.build
@@ -0,0 +1,12 @@
+executable(
+ 'light-server',
+ 'light-server.c',
+ export_dynamic : true,
+ dependencies : gupnp
+)
+
+executable(
+ 'light-client',
+ 'light-client.c',
+ dependencies : gupnp
+)
diff --git a/gupnp-1.2-uninstalled.pc.in b/gupnp-1.2-uninstalled.pc.in
deleted file mode 100644
index cd7128e..0000000
--- a/gupnp-1.2-uninstalled.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=
-exec_prefix=
-libdir=${pcfiledir}/libgupnp
-includedir=${pcfiledir}/
-
-Name: gupnp-1.2
-Description: GObject-based UPnP library
-Version: @VERSION@
-Libs: ${libdir}/libgupnp-1.2.la
-Cflags: -I${includedir}
-Requires.private: gssdp-1.0 libxml-2.0 libsoup-2.4 @UUID_LIBS@
diff --git a/gupnp-1.2.pc.in b/gupnp-1.2.pc.in
deleted file mode 100644
index 71f2830..0000000
--- a/gupnp-1.2.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: gupnp-1.2
-Description: GObject-based UPnP library
-Version: @VERSION@
-Libs: -L${libdir} -lgupnp-1.2
-Cflags: -I${includedir}/gupnp-1.2
-Requires.private: gssdp-1.0 libxml-2.0 libsoup-2.4 @UUID_LIBS@
diff --git a/libgupnp/Makefile.am b/libgupnp/Makefile.am
deleted file mode 100644
index 2b5a5dd..0000000
--- a/libgupnp/Makefile.am
+++ /dev/null
@@ -1,201 +0,0 @@
-LTVERSION = 0:0:0
-
-if OS_WIN32
-CONTEXT_MANAGER_IMPL = gupnp-windows-context-manager.c \
- gupnp-windows-context-manager.h
-CONTEXT_MANAGER_CFLAGS =
-CONTEXT_MANAGER_LIBS = -lws2_32 -liphlpapi
-WIN32_LDFLAGS = -no-undefined
-else
-if HAVE_IFADDRS_H
-CONTEXT_MANAGER_IMPL = gupnp-unix-context-manager.c \
- gupnp-unix-context-manager.h
-else
-CONTEXT_MANAGER_IMPL =
-endif
-if USE_NETWORK_MANAGER
-CONTEXT_MANAGER_IMPL += gupnp-network-manager.c \
- gupnp-network-manager.h
-CONTEXT_MANAGER_CFLAGS = -DUSE_NETWORK_MANAGER
-else
-if USE_CONNMAN
-CONTEXT_MANAGER_IMPL += gupnp-connman-manager.c \
- gupnp-connman-manager.h
-CONTEXT_MANAGER_CFLAGS = -DUSE_CONNMAN
-endif
-endif
-endif
-
-if HAVE_NETLINK
-CONTEXT_MANAGER_IMPL += \
- gupnp-linux-context-manager.c \
- gupnp-linux-context-manager.h
-endif
-
-if USE_NETLINK
-NETLINK_CFLAGS = -DUSE_NETLINK
-else
-NETLINK_CFLAGS =
-endif
-
-AM_CFLAGS = $(LIBGUPNP_CFLAGS) \
- $(DBUS_GLIB_CFLAGS) \
- $(NETLINK_CFLAGS) \
- $(GUUL_CFLAGS) \
- -I$(top_srcdir) \
- $(CONTEXT_MANAGER_CFLAGS) \
- $(WARN_CFLAGS)
-
-libgupnpincdir = $(includedir)/gupnp-1.2/libgupnp
-
-lib_LTLIBRARIES = libgupnp-1.2.la
-
-libgupnpinc_HEADERS = gupnp-acl.h \
- gupnp-context.h \
- gupnp-context-manager.h \
- gupnp-control-point.h \
- gupnp-device.h \
- gupnp-device-info.h \
- gupnp-device-proxy.h \
- gupnp-error.h \
- gupnp-resource-factory.h \
- gupnp-root-device.h \
- gupnp-service.h \
- gupnp-service-info.h \
- gupnp-service-proxy.h \
- gupnp-service-introspection.h \
- gupnp-xml-doc.h \
- gupnp-white-list.h \
- gupnp-types.h \
- gupnp-uuid.h \
- gupnp.h
-
-introspection_sources = $(libgupnpinc_HEADERS) \
- gupnp-acl.c \
- gupnp-context.c \
- gupnp-context-manager.c \
- gupnp-control-point.c \
- gupnp-device.c \
- gupnp-device-info.c \
- gupnp-device-proxy.c \
- gupnp-error.c \
- gupnp-resource-factory.c \
- gupnp-root-device.c \
- gupnp-service.c \
- gupnp-service-info.c \
- gupnp-service-proxy.c \
- gupnp-service-introspection.c \
- gupnp-xml-doc.c \
- gupnp-white-list.c \
- gupnp-types.c
-
-libgupnp_1_2_la_LDFLAGS = -version-info $(LTVERSION) $(WIN32_LDFLAGS) $(WARN_LDFLAGS)
-
-libgupnp_1_2_la_SOURCES = $(introspection_sources) \
- http-headers.c \
- http-headers.h \
- gupnp-context-private.h \
- $(CONTEXT_MANAGER_IMPL) \
- gupnp-simple-context-manager.h \
- gupnp-simple-context-manager.c \
- gupnp-device-info-private.h \
- gupnp-error-private.h \
- gupnp-resource-factory-private.h \
- gupnp-service-introspection-private.h \
- gupnp-acl-private.h \
- gupnp-types-private.h \
- gvalue-util.c \
- gvalue-util.h \
- xml-util.c \
- xml-util.h \
- gena-protocol.h \
- guul.c \
- guul.h \
- $(BUILT_SOURCES)
-
-libgupnp_1_2_la_LIBADD = $(LIBGUPNP_LIBS) $(DBUS_GLIB_LIBS) $(CONTEXT_MANAGER_LIBS) $(GUUL_LIBS)
-
-EXTRA_DIST = gupnp-marshal.list \
- gupnp-network-manager.c \
- gupnp-network-manager.h \
- gupnp-connman-manager.c \
- gupnp-connman-manager.h \
- gupnp-linux-context-manager.c \
- gupnp-linux-context-manager.h \
- gupnp-unix-context-manager.c \
- gupnp-unix-context-manager.h \
- gupnp-windows-context-manager.c \
- gupnp-windows-context-manager.h
-
-enumheaders = \
- $(srcdir)/gupnp-error.h \
- $(srcdir)/gupnp-service-introspection.h
-
-BUILT_SOURCES = \
- gupnp-enums.c \
- gupnp-enums.h
-
-gupnp-enums.c: $(enumheaders) Makefile
- $(AM_V_GEN)$(GLIB_MKENUMS) \
- --identifier-prefix GUPnP \
- --symbol-prefix gupnp \
- --fhead "#include \"gupnp-enums.h\"\n\n" \
- --fprod "/* enumerations from \"@filename@\" */\n" \
- --fprod "#include \"@filename@\"\n" \
- --vhead "GType\n@enum_name@_get_type (void)\n{\n" \
- --vhead " static GType type = 0;\n\n" \
- --vhead " if (!type)\n {\n" \
- --vhead " static const G@Type@Value _@enum_name@_values[] = {" \
- --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
- --vtail " { 0, NULL, NULL }\n };\n\n" \
- --vtail " type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n }\n\n" \
- --vtail " return type;\n}\n\n" \
- $(enumheaders) > $@
-
-gupnp-enums.h: $(enumheaders) Makefile
- $(AM_V_GEN)$(GLIB_MKENUMS) \
- --identifier-prefix GUPnP \
- --symbol-prefix gupnp \
- --fhead "#ifndef GUPNP_ENUMS_H\n" \
- --fhead "#define GUPNP_ENUMS_H\n\n" \
- --fhead "#include <glib-object.h>\n\n" \
- --fhead "G_BEGIN_DECLS\n\n" \
- --fprod "/* enumerations from @filename@ */\n" \
- --vhead "GType @enum_name@_get_type (void);\n" \
- --vhead "#define GUPNP_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
- --ftail "G_END_DECLS\n\n" \
- --ftail "#endif /* GUPNP_ENUMS_H */" \
- $(enumheaders) > $@
-
-
--include $(INTROSPECTION_MAKEFILE)
-INTROSPECTION_GIRS =
-INTROSPECTION_SCANNER_ARGS = \
- --symbol-prefix=gupnp \
- --identifier-prefix=GUPnP \
- --add-include-path=$(top_srcdir) \
- --pkg-export=gupnp-1.2 \
- $(WARN_SCANNERFLAGS)
-INTROSPECTION_COMPILER_ARGS = --includedir=$(top_srcdir)
-
-if HAVE_INTROSPECTION
-GUPnP-1.2.gir: libgupnp-1.2.la
-GUPnP_1_2_gir_INCLUDES = libxml2-2.0 GObject-2.0 Soup-2.4 GSSDP-1.0
-GUPnP_1_2_gir_CFLAGS = -DGOBJECT_INTROSPECTION_SKIP $(INCLUDES) $(AM_CFLAGS)
-GUPnP_1_2_gir_LIBS = libgupnp-1.2.la
-GUPnP_1_2_gir_FILES = $(introspection_sources)
-GUPnP_1_2_gir_NAMESPACE = GUPnP
-GUPnP_1_2_gir_VERSION = 1.2
-
-INTROSPECTION_GIRS += GUPnP-1.2.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = GUPnP-1.2.gir
-
-typelibdir = $(libdir)/girepository-1.0/
-typelib_DATA = $(gir_DATA:.gir=.typelib)
-endif
-
-CLEANFILES = $(BUILT_SOURCES) $(gir_DATA) $(typelib_DATA)
-DISTCLEANFILES = $(BUILT_SOURCES)
-MAINTAINERCLEANFILES = Makefile.in $(BUILT_SOURCES)
diff --git a/libgupnp/gupnp-enums.c.template b/libgupnp/gupnp-enums.c.template
new file mode 100644
index 0000000..3ce5fa4
--- /dev/null
+++ b/libgupnp/gupnp-enums.c.template
@@ -0,0 +1,33 @@
+/*** BEGIN file-header ***/
+#include "gupnp-enums.h"
+
+/*** END file-header ***/
+/*** BEGIN file-production ***/
+/* enumerations from "@filename@" */
+#include "@filename@"
+/*** END file-production ***/
+/*** BEGIN value-header ***/
+GType
+@enum_name@_get_type (void)
+{
+ static GType type = 0;
+
+
+ if (!type)
+ {
+ static const G@Type@Value _@enum_name@_values[] = {
+/*** END value-header ***/
+/*** BEGIN value-production ***/
+ { @VALUENAME@, "@VALUENAME@", "@valuenick@" },
+/*** END value-production ***/
+/*** BEGIN value-tail ***/
+ { 0, NULL, NULL }
+ };
+
+ type = g_@type@_register_static ("@EnumName@", _@enum_name@_values);
+ }
+
+
+ return type;
+}
+/*** END value-tail ***/
diff --git a/libgupnp/gupnp-enums.h.template b/libgupnp/gupnp-enums.h.template
new file mode 100644
index 0000000..e88ffab
--- /dev/null
+++ b/libgupnp/gupnp-enums.h.template
@@ -0,0 +1,26 @@
+/*** BEGIN file-header ***/
+#ifndef GUPNP_ENUMS_H
+#define GUPNP_ENUMS_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from @basename@ */
+
+/*** END file-production ***/
+
+/*** BEGIN enumeration-production ***/
+GType @enum_name@_get_type (void);
+#define GUPNP_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
+
+/*** END enumeration-production ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* GUPNP_ENUMS_H */
+/*** END file-tail ***/
diff --git a/libgupnp/meson.build b/libgupnp/meson.build
new file mode 100644
index 0000000..b86771a
--- /dev/null
+++ b/libgupnp/meson.build
@@ -0,0 +1,128 @@
+context_manager_impl = []
+context_manager_args = []
+
+if host_machine.system() == 'windows'
+ context_manager_impl += 'gupnp-windows-context-manager.c'
+else
+ if ifaddrs_available
+ context_manager_impl += 'gupnp-unix-context-manager.c'
+ endif
+ if get_option('context_manager') == 'network-manager'
+ context_manager_impl += 'gupnp-network-manager.c'
+ context_manager_args += '-DUSE_NETWORK_MANAGER'
+ endif
+ if get_option('context_manager') == 'connman'
+ context_manager_impl += 'gupnp-connman-manager.c'
+ context_manager_args += '-DUSE_CONNMAN'
+ endif
+endif
+
+if netlink_available
+ context_manager_impl += 'gupnp-linux-context-manager.c'
+endif
+
+if get_option('context_manager') == 'linux'
+ context_manager_args += '-DUSE_NETLINK'
+endif
+
+enums = gnome.mkenums(
+ 'gupnp-enums',
+ sources : [
+ 'gupnp-error.h',
+ 'gupnp-service-introspection.h'
+ ],
+ identifier_prefix : 'GUPnP',
+ symbol_prefix : 'gupnp',
+ c_template : 'gupnp-enums.c.template',
+ h_template : 'gupnp-enums.h.template',
+ install_header : true,
+ install_dir : join_paths (get_option('includedir'), 'gupnp-1.2/libgupnp')
+)
+
+headers = files(
+ 'gupnp-acl.h',
+ 'gupnp-context.h',
+ 'gupnp-context-manager.h',
+ 'gupnp-control-point.h',
+ 'gupnp-device.h',
+ 'gupnp-device-info.h',
+ 'gupnp-device-proxy.h',
+ 'gupnp-error.h',
+ 'gupnp.h',
+ 'gupnp-resource-factory.h',
+ 'gupnp-root-device.h',
+ 'gupnp-service.h',
+ 'gupnp-service-info.h',
+ 'gupnp-service-introspection.h',
+ 'gupnp-service-proxy.h',
+ 'gupnp-types.h',
+ 'gupnp-uuid.h',
+ 'gupnp-white-list.h',
+ 'gupnp-xml-doc.h'
+)
+install_headers(headers, subdir : 'gupnp-1.2/libgupnp')
+
+sources = files(
+ 'gupnp-acl.c',
+ 'gupnp-context.c',
+ 'gupnp-context-manager.c',
+ 'gupnp-control-point.c',
+ 'gupnp-device.c',
+ 'gupnp-device-info.c',
+ 'gupnp-device-proxy.c',
+ 'gupnp-error.c',
+ 'gupnp-resource-factory.c',
+ 'gupnp-root-device.c',
+ 'gupnp-service.c',
+ 'gupnp-service-info.c',
+ 'gupnp-service-introspection.c',
+ 'gupnp-service-proxy.c',
+ 'gupnp-simple-context-manager.c',
+ 'gupnp-types.c',
+ 'gupnp-white-list.c',
+ 'gupnp-xml-doc.c',
+ 'gvalue-util.c',
+ 'http-headers.c',
+ 'xml-util.c'
+)
+
+libgupnp = library(
+ 'gupnp-1.2',
+ sources + context_manager_impl + enums,
+ version : '0.0.0',
+ dependencies : dependencies,
+ c_args : context_manager_args,
+ include_directories: include_directories('..'),
+ install: true
+)
+
+gupnp = declare_dependency(
+ link_with: libgupnp,
+ include_directories : include_directories('..'),
+ dependencies : dependencies
+)
+
+pkg.generate(
+ libraries : libgupnp,
+ subdirs: 'gupnp-1.2',
+ name : 'gupnp-1.2',
+ description : 'GObject-based UPnP library',
+ version : meson.project_version(),
+ filebase : 'gupnp-1.2'
+)
+
+if get_option('introspection')
+ gir = gnome.generate_gir(
+ libgupnp,
+ sources : headers + sources + enums,
+ namespace : 'GUPnP',
+ nsversion : '1.2',
+ header : 'libgupnp/gupnp.h',
+ symbol_prefix : 'gupnp',
+ identifier_prefix : 'GUPnP',
+ export_packages : 'gupnp-1.2',
+ includes : ['GObject-2.0', 'Gio-2.0', 'Soup-2.4', 'GSSDP-1.2', 'libxml2-2.0'],
+ install : true,
+ extra_args : '-DGOBJECT_INTROSPECTION_SKIP'
+ )
+endif
diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4
deleted file mode 100644
index 2bb27ef..0000000
--- a/m4/ax_append_compile_flags.m4
+++ /dev/null
@@ -1,67 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
-#
-# DESCRIPTION
-#
-# For every FLAG1, FLAG2 it is checked whether the compiler works with the
-# flag. If it does, the flag is added FLAGS-VARIABLE
-#
-# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
-# CFLAGS) is used. During the check the flag is always added to the
-# current language's flags.
-#
-# If EXTRA-FLAGS is defined, it is added to the current language's default
-# flags (e.g. CFLAGS) when the check is done. The check is thus made with
-# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
-# force the compiler to issue an error when a bad flag is given.
-#
-# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
-#
-# NOTE: This macro depends on the AX_APPEND_FLAG and
-# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
-# AX_APPEND_LINK_FLAGS.
-#
-# LICENSE
-#
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 5
-
-AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
-[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
-AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
-for flag in $1; do
- AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
-done
-])dnl AX_APPEND_COMPILE_FLAGS
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
deleted file mode 100644
index 08f2e07..0000000
--- a/m4/ax_append_flag.m4
+++ /dev/null
@@ -1,71 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
-#
-# DESCRIPTION
-#
-# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
-# added in between.
-#
-# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
-# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
-# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
-# FLAG.
-#
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 6
-
-AC_DEFUN([AX_APPEND_FLAG],
-[dnl
-AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
-AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
-AS_VAR_SET_IF(FLAGS,[
- AS_CASE([" AS_VAR_GET(FLAGS) "],
- [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
- [
- AS_VAR_APPEND(FLAGS,[" $1"])
- AC_RUN_LOG([: FLAGS="$FLAGS"])
- ])
- ],
- [
- AS_VAR_SET(FLAGS,[$1])
- AC_RUN_LOG([: FLAGS="$FLAGS"])
- ])
-AS_VAR_POPDEF([FLAGS])dnl
-])dnl AX_APPEND_FLAG
diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4
deleted file mode 100644
index fd70fc7..0000000
--- a/m4/ax_append_link_flags.m4
+++ /dev/null
@@ -1,65 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
-#
-# DESCRIPTION
-#
-# For every FLAG1, FLAG2 it is checked whether the linker works with the
-# flag. If it does, the flag is added FLAGS-VARIABLE
-#
-# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
-# used. During the check the flag is always added to the linker's flags.
-#
-# If EXTRA-FLAGS is defined, it is added to the linker's default flags
-# when the check is done. The check is thus made with the flags: "LDFLAGS
-# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
-# issue an error when a bad flag is given.
-#
-# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
-#
-# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
-# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
-#
-# LICENSE
-#
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 5
-
-AC_DEFUN([AX_APPEND_LINK_FLAGS],
-[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
-AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
-for flag in $1; do
- AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
-done
-])dnl AX_APPEND_LINK_FLAGS
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
deleted file mode 100644
index ca36397..0000000
--- a/m4/ax_check_compile_flag.m4
+++ /dev/null
@@ -1,74 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
-#
-# DESCRIPTION
-#
-# Check whether the given FLAG works with the current language's compiler
-# or gives an error. (Warnings, however, are ignored)
-#
-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-# success/failure.
-#
-# If EXTRA-FLAGS is defined, it is added to the current language's default
-# flags (e.g. CFLAGS) when the check is done. The check is thus made with
-# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
-# force the compiler to issue an error when a bad flag is given.
-#
-# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
-#
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
-# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 4
-
-AC_DEFUN([AX_CHECK_COMPILE_FLAG],
-[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
-AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
- ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
- _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
- AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
- [AS_VAR_SET(CACHEVAR,[yes])],
- [AS_VAR_SET(CACHEVAR,[no])])
- _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
-AS_VAR_IF(CACHEVAR,yes,
- [m4_default([$2], :)],
- [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4
deleted file mode 100644
index f99d75f..0000000
--- a/m4/ax_check_enable_debug.m4
+++ /dev/null
@@ -1,124 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no], [ENABLE DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...], [IS-RELEASE])
-#
-# DESCRIPTION
-#
-# Check for the presence of an --enable-debug option to configure, with
-# the specified default value used when the option is not present. Return
-# the value in the variable $ax_enable_debug.
-#
-# Specifying 'yes' adds '-g -O0' to the compilation flags for all
-# languages. Specifying 'info' adds '-g' to the compilation flags.
-# Specifying 'profile' adds '-g -pg' to the compilation flags and '-pg' to
-# the linking flags. Otherwise, nothing is added.
-#
-# Define the variables listed in the second argument if debug is enabled,
-# defaulting to no variables. Defines the variables listed in the third
-# argument if debug is disabled, defaulting to NDEBUG. All lists of
-# variables should be space-separated.
-#
-# If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
-# Should be invoked prior to any AC_PROG_* compiler checks.
-#
-# IS-RELEASE can be used to change the default to 'no' when making a
-# release. Set IS-RELEASE to 'yes' or 'no' as appropriate. By default, it
-# uses the value of $ax_is_release, so if you are using the AX_IS_RELEASE
-# macro, there is no need to pass this parameter.
-#
-# AX_IS_RELEASE([git-directory])
-# AX_CHECK_ENABLE_DEBUG()
-#
-# LICENSE
-#
-# Copyright (c) 2011 Rhys Ulerich <rhys.ulerich@gmail.com>
-# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-#serial 5
-
-AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
- AC_BEFORE([$0],[AC_PROG_CC])dnl
- AC_BEFORE([$0],[AC_PROG_CXX])dnl
- AC_BEFORE([$0],[AC_PROG_F77])dnl
- AC_BEFORE([$0],[AC_PROG_FC])dnl
-
- AC_MSG_CHECKING(whether to enable debugging)
-
- ax_enable_debug_default=m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))
- ax_enable_debug_is_release=m4_tolower(m4_normalize(ifelse([$4],,
- [$ax_is_release],
- [$4])))
-
- # If this is a release, override the default.
- AS_IF([test "$ax_enable_debug_is_release" = "yes"],
- [ax_enable_debug_default="no"])
-
- m4_define(ax_enable_debug_vars,[m4_normalize(ifelse([$2],,,[$2]))])
- m4_define(ax_disable_debug_vars,[m4_normalize(ifelse([$3],,[NDEBUG],[$3]))])
-
- AC_ARG_ENABLE(debug,
- [AS_HELP_STRING([--enable-debug=]@<:@yes/info/profile/no@:>@,[compile with debugging])],
- [],enable_debug=$ax_enable_debug_default)
-
- # empty mean debug yes
- AS_IF([test "x$enable_debug" = "x"],
- [enable_debug="yes"])
-
- # case of debug
- AS_CASE([$enable_debug],
- [yes],[
- AC_MSG_RESULT(yes)
- CFLAGS="${CFLAGS} -g -O0"
- CXXFLAGS="${CXXFLAGS} -g -O0"
- FFLAGS="${FFLAGS} -g -O0"
- FCFLAGS="${FCFLAGS} -g -O0"
- OBJCFLAGS="${OBJCFLAGS} -g -O0"
- ],
- [info],[
- AC_MSG_RESULT(info)
- CFLAGS="${CFLAGS} -g"
- CXXFLAGS="${CXXFLAGS} -g"
- FFLAGS="${FFLAGS} -g"
- FCFLAGS="${FCFLAGS} -g"
- OBJCFLAGS="${OBJCFLAGS} -g"
- ],
- [profile],[
- AC_MSG_RESULT(profile)
- CFLAGS="${CFLAGS} -g -pg"
- CXXFLAGS="${CXXFLAGS} -g -pg"
- FFLAGS="${FFLAGS} -g -pg"
- FCFLAGS="${FCFLAGS} -g -pg"
- OBJCFLAGS="${OBJCFLAGS} -g -pg"
- LDFLAGS="${LDFLAGS} -pg"
- ],
- [
- AC_MSG_RESULT(no)
- dnl Ensure AC_PROG_CC/CXX/F77/FC/OBJC will not enable debug flags
- dnl by setting any unset environment flag variables
- AS_IF([test "x${CFLAGS+set}" != "xset"],
- [CFLAGS=""])
- AS_IF([test "x${CXXFLAGS+set}" != "xset"],
- [CXXFLAGS=""])
- AS_IF([test "x${FFLAGS+set}" != "xset"],
- [FFLAGS=""])
- AS_IF([test "x${FCFLAGS+set}" != "xset"],
- [FCFLAGS=""])
- AS_IF([test "x${OBJCFLAGS+set}" != "xset"],
- [OBJCFLAGS=""])
- ])
-
- dnl Define various variables if debugging is disabled.
- dnl assert.h is a NOP if NDEBUG is defined, so define it by default.
- AS_IF([test "x$enable_debug" = "xyes"],
- [m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is enabled])])],
- [m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is disabled])])])
- ax_enable_debug=$enable_debug
-])
diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4
deleted file mode 100644
index eb01a6c..0000000
--- a/m4/ax_check_link_flag.m4
+++ /dev/null
@@ -1,74 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
-#
-# DESCRIPTION
-#
-# Check whether the given FLAG works with the linker or gives an error.
-# (Warnings, however, are ignored)
-#
-# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
-# success/failure.
-#
-# If EXTRA-FLAGS is defined, it is added to the linker's default flags
-# when the check is done. The check is thus made with the flags: "LDFLAGS
-# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
-# issue an error when a bad flag is given.
-#
-# INPUT gives an alternative input source to AC_LINK_IFELSE.
-#
-# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
-# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
-# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 4
-
-AC_DEFUN([AX_CHECK_LINK_FLAG],
-[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
-AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
-AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
- ax_check_save_flags=$LDFLAGS
- LDFLAGS="$LDFLAGS $4 $1"
- AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
- [AS_VAR_SET(CACHEVAR,[yes])],
- [AS_VAR_SET(CACHEVAR,[no])])
- LDFLAGS=$ax_check_save_flags])
-AS_VAR_IF(CACHEVAR,yes,
- [m4_default([$2], :)],
- [m4_default([$3], :)])
-AS_VAR_POPDEF([CACHEVAR])dnl
-])dnl AX_CHECK_LINK_FLAGS
diff --git a/m4/ax_compiler_flags.m4 b/m4/ax_compiler_flags.m4
deleted file mode 100644
index 6cfe398..0000000
--- a/m4/ax_compiler_flags.m4
+++ /dev/null
@@ -1,158 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPILER_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [IS-RELEASE], [EXTRA-BASE-CFLAGS], [EXTRA-YES-CFLAGS], [UNUSED], [UNUSED], [UNUSED], [EXTRA-BASE-LDFLAGS], [EXTRA-YES-LDFLAGS], [UNUSED], [UNUSED], [UNUSED])
-#
-# DESCRIPTION
-#
-# Check for the presence of an --enable-compile-warnings option to
-# configure, defaulting to "error" in normal operation, or "yes" if
-# IS-RELEASE is equal to "yes". Return the value in the variable
-# $ax_enable_compile_warnings.
-#
-# Depending on the value of --enable-compile-warnings, different compiler
-# warnings are checked to see if they work with the current compiler and,
-# if so, are appended to CFLAGS-VARIABLE and LDFLAGS-VARIABLE. This
-# allows a consistent set of baseline compiler warnings to be used across
-# a code base, irrespective of any warnings enabled locally by individual
-# developers. By standardising the warnings used by all developers of a
-# project, the project can commit to a zero-warnings policy, using -Werror
-# to prevent compilation if new warnings are introduced. This makes
-# catching bugs which are flagged by warnings a lot easier.
-#
-# By providing a consistent --enable-compile-warnings argument across all
-# projects using this macro, continuous integration systems can easily be
-# configured the same for all projects. Automated systems or build
-# systems aimed at beginners may want to pass the --disable-Werror
-# argument to unconditionally prevent warnings being fatal.
-#
-# --enable-compile-warnings can take the values:
-#
-# * no: Base compiler warnings only; not even -Wall.
-# * yes: The above, plus a broad range of useful warnings.
-# * error: The above, plus -Werror so that all warnings are fatal.
-# Use --disable-Werror to override this and disable fatal
-# warnings.
-#
-# The set of base and enabled flags can be augmented using the
-# EXTRA-*-CFLAGS and EXTRA-*-LDFLAGS variables, which are tested and
-# appended to the output variable if --enable-compile-warnings is not
-# "no". Flags should not be disabled using these arguments, as the entire
-# point of AX_COMPILER_FLAGS is to enforce a consistent set of useful
-# compiler warnings on code, using warnings which have been chosen for low
-# false positive rates. If a compiler emits false positives for a
-# warning, a #pragma should be used in the code to disable the warning
-# locally. See:
-#
-# https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
-#
-# The EXTRA-* variables should only be used to supply extra warning flags,
-# and not general purpose compiler flags, as they are controlled by
-# configure options such as --disable-Werror.
-#
-# IS-RELEASE can be used to disable -Werror when making a release, which
-# is useful for those hairy moments when you just want to get the release
-# done as quickly as possible. Set it to "yes" to disable -Werror. By
-# default, it uses the value of $ax_is_release, so if you are using the
-# AX_IS_RELEASE macro, there is no need to pass this parameter. For
-# example:
-#
-# AX_IS_RELEASE([git-directory])
-# AX_COMPILER_FLAGS()
-#
-# CFLAGS-VARIABLE defaults to WARN_CFLAGS, and LDFLAGS-VARIABLE defaults
-# to WARN_LDFLAGS. Both variables are AC_SUBST-ed by this macro, but must
-# be manually added to the CFLAGS and LDFLAGS variables for each target in
-# the code base.
-#
-# If C++ language support is enabled with AC_PROG_CXX, which must occur
-# before this macro in configure.ac, warning flags for the C++ compiler
-# are AC_SUBST-ed as WARN_CXXFLAGS, and must be manually added to the
-# CXXFLAGS variables for each target in the code base. EXTRA-*-CFLAGS can
-# be used to augment the base and enabled flags.
-#
-# Warning flags for g-ir-scanner (from GObject Introspection) are
-# AC_SUBST-ed as WARN_SCANNERFLAGS. This variable must be manually added
-# to the SCANNERFLAGS variable for each GIR target in the code base. If
-# extra g-ir-scanner flags need to be enabled, the AX_COMPILER_FLAGS_GIR
-# macro must be invoked manually.
-#
-# AX_COMPILER_FLAGS may add support for other tools in future, in addition
-# to the compiler and linker. No extra EXTRA-* variables will be added
-# for those tools, and all extra support will still use the single
-# --enable-compile-warnings configure option. For finer grained control
-# over the flags for individual tools, use AX_COMPILER_FLAGS_CFLAGS,
-# AX_COMPILER_FLAGS_LDFLAGS and AX_COMPILER_FLAGS_* for new tools.
-#
-# The UNUSED variables date from a previous version of this macro, and are
-# automatically appended to the preceding non-UNUSED variable. They should
-# be left empty in new uses of the macro.
-#
-# LICENSE
-#
-# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
-# Copyright (c) 2015 David King <amigadave@amigadave.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 13
-
-# _AX_COMPILER_FLAGS_LANG([LANGNAME])
-m4_defun([_AX_COMPILER_FLAGS_LANG],
-[m4_ifdef([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [],
- [m4_define([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [])dnl
- AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_]$1[FLAGS])])dnl
-])
-
-AC_DEFUN([AX_COMPILER_FLAGS],[
- # C support is enabled by default.
- _AX_COMPILER_FLAGS_LANG([C])
- # Only enable C++ support if AC_PROG_CXX is called. The redefinition of
- # AC_PROG_CXX is so that a fatal error is emitted if this macro is called
- # before AC_PROG_CXX, which would otherwise cause no C++ warnings to be
- # checked.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AX_COMPILER_FLAGS_LANG([CXX])],
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AX_COMPILER_FLAGS_LANG([CXX])])])
- AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_LDFLAGS])
-
- # Default value for IS-RELEASE is $ax_is_release
- ax_compiler_flags_is_release=m4_tolower(m4_normalize(ifelse([$3],,
- [$ax_is_release],
- [$3])))
-
- AC_ARG_ENABLE([compile-warnings],
- AS_HELP_STRING([--enable-compile-warnings=@<:@no/yes/error@:>@],
- [Enable compiler warnings and errors]),,
- [AS_IF([test "$ax_compiler_flags_is_release" = "yes"],
- [enable_compile_warnings="yes"],
- [enable_compile_warnings="error"])])
- AC_ARG_ENABLE([Werror],
- AS_HELP_STRING([--disable-Werror],
- [Unconditionally make all compiler warnings non-fatal]),,
- [enable_Werror=maybe])
-
- # Return the user's chosen warning level
- AS_IF([test "$enable_Werror" = "no" -a \
- "$enable_compile_warnings" = "error"],[
- enable_compile_warnings="yes"
- ])
-
- ax_enable_compile_warnings=$enable_compile_warnings
-
- AX_COMPILER_FLAGS_CFLAGS([$1],[$ax_compiler_flags_is_release],
- [$4],[$5 $6 $7 $8])
- m4_ifdef([_AX_COMPILER_FLAGS_LANG_CXX_enabled],
- [AX_COMPILER_FLAGS_CXXFLAGS([WARN_CXXFLAGS],
- [$ax_compiler_flags_is_release],
- [$4],[$5 $6 $7 $8])])
- AX_COMPILER_FLAGS_LDFLAGS([$2],[$ax_compiler_flags_is_release],
- [$9],[$10 $11 $12 $13])
- AX_COMPILER_FLAGS_GIR([WARN_SCANNERFLAGS],[$ax_compiler_flags_is_release])
-])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_compiler_flags_cflags.m4 b/m4/ax_compiler_flags_cflags.m4
deleted file mode 100644
index f470f8f..0000000
--- a/m4/ax_compiler_flags_cflags.m4
+++ /dev/null
@@ -1,133 +0,0 @@
-# ============================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_cflags.html
-# ============================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPILER_FLAGS_CFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
-#
-# DESCRIPTION
-#
-# Add warning flags for the C compiler to VARIABLE, which defaults to
-# WARN_CFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be
-# manually added to the CFLAGS variable for each target in the code base.
-#
-# This macro depends on the environment set up by AX_COMPILER_FLAGS.
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide
-# which flags to enable.
-#
-# LICENSE
-#
-# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 11
-
-AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
- AC_REQUIRE([AC_PROG_SED])
- AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
- AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
-
- # Variable names
- m4_define(ax_warn_cflags_variable,
- [m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))])
-
- AC_LANG_PUSH([C])
-
- # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
- # flags, otherwise they are always appended to the warn_cflags variable, and
- # Clang warns on them for every compilation unit.
- # If this is passed to GCC, it will explode, so the flag must be enabled
- # conditionally.
- AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
- ax_compiler_flags_test="-Werror=unknown-warning-option"
- ],[
- ax_compiler_flags_test=""
- ])
-
- # Base flags
- AX_APPEND_COMPILE_FLAGS([ dnl
- -fno-strict-aliasing dnl
- $3 dnl
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
-
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[
- # "yes" flags
- AX_APPEND_COMPILE_FLAGS([ dnl
- -Wall dnl
- -Wextra dnl
- -Wundef dnl
- -Wnested-externs dnl
- -Wwrite-strings dnl
- -Wpointer-arith dnl
- -Wmissing-declarations dnl
- -Wmissing-prototypes dnl
- -Wstrict-prototypes dnl
- -Wredundant-decls dnl
- -Wno-unused-parameter dnl
- -Wno-missing-field-initializers dnl
- -Wdeclaration-after-statement dnl
- -Wformat=2 dnl
- -Wold-style-definition dnl
- -Wcast-align dnl
- -Wformat-nonliteral dnl
- -Wformat-security dnl
- -Wsign-compare dnl
- -Wstrict-aliasing dnl
- -Wshadow dnl
- -Winline dnl
- -Wpacked dnl
- -Wmissing-format-attribute dnl
- -Wmissing-noreturn dnl
- -Winit-self dnl
- -Wredundant-decls dnl
- -Wmissing-include-dirs dnl
- -Wunused-but-set-variable dnl
- -Warray-bounds dnl
- -Wimplicit-function-declaration dnl
- -Wreturn-type dnl
- -Wswitch-enum dnl
- -Wswitch-default dnl
- $4 dnl
- $5 dnl
- $6 dnl
- $7 dnl
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
- ])
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[
- # "error" flags; -Werror has to be appended unconditionally because
- # it's not possible to test for
- #
- # suggest-attribute=format is disabled because it gives too many false
- # positives
- AX_APPEND_FLAG([-Werror],ax_warn_cflags_variable)
-
- AX_APPEND_COMPILE_FLAGS([ dnl
- -Wno-suggest-attribute=format dnl
- ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
- ])
-
- # In the flags below, when disabling specific flags, always add *both*
- # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example)
- # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall,
- # which effectively turns that flag back on again as an error.
- for flag in $ax_warn_cflags_variable; do
- AS_CASE([$flag],
- [-Wno-*=*],[],
- [-Wno-*],[
- AX_APPEND_COMPILE_FLAGS([-Wno-error=$(AS_ECHO([$flag]) | $SED 's/^-Wno-//')],
- ax_warn_cflags_variable,
- [$ax_compiler_flags_test])
- ])
- done
-
- AC_LANG_POP([C])
-
- # Substitute the variables
- AC_SUBST(ax_warn_cflags_variable)
-])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_compiler_flags_gir.m4 b/m4/ax_compiler_flags_gir.m4
deleted file mode 100644
index 180f50d..0000000
--- a/m4/ax_compiler_flags_gir.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
-#
-# DESCRIPTION
-#
-# Add warning flags for the g-ir-scanner (from GObject Introspection) to
-# VARIABLE, which defaults to WARN_SCANNERFLAGS. VARIABLE is AC_SUBST-ed
-# by this macro, but must be manually added to the SCANNERFLAGS variable
-# for each GIR target in the code base.
-#
-# This macro depends on the environment set up by AX_COMPILER_FLAGS.
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide
-# which flags to enable.
-#
-# LICENSE
-#
-# Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 4
-
-AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
-
- # Variable names
- m4_define(ax_warn_scannerflags_variable,
- [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
-
- # Base flags
- AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable)
-
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[
- # "yes" flags
- AX_APPEND_FLAG([ dnl
- --warn-all dnl
- $4 dnl
- $5 dnl
- $6 dnl
- $7 dnl
- ],ax_warn_scannerflags_variable)
- ])
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[
- # "error" flags
- AX_APPEND_FLAG([ dnl
- --warn-error dnl
- ],ax_warn_scannerflags_variable)
- ])
-
- # Substitute the variables
- AC_SUBST(ax_warn_scannerflags_variable)
-])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_compiler_flags_ldflags.m4 b/m4/ax_compiler_flags_ldflags.m4
deleted file mode 100644
index 228471e..0000000
--- a/m4/ax_compiler_flags_ldflags.m4
+++ /dev/null
@@ -1,75 +0,0 @@
-# =============================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_compiler_flags_ldflags.html
-# =============================================================================
-#
-# SYNOPSIS
-#
-# AX_COMPILER_FLAGS_LDFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
-#
-# DESCRIPTION
-#
-# Add warning flags for the linker to VARIABLE, which defaults to
-# WARN_LDFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be
-# manually added to the LDFLAGS variable for each target in the code base.
-#
-# This macro depends on the environment set up by AX_COMPILER_FLAGS.
-# Specifically, it uses the value of $ax_enable_compile_warnings to decide
-# which flags to enable.
-#
-# LICENSE
-#
-# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 5
-
-AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
- AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
- AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
- AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
-
- # Variable names
- m4_define(ax_warn_ldflags_variable,
- [m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))])
-
- # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
- # flags, otherwise they are always appended to the warn_ldflags variable,
- # and Clang warns on them for every compilation unit.
- # If this is passed to GCC, it will explode, so the flag must be enabled
- # conditionally.
- AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
- ax_compiler_flags_test="-Werror=unknown-warning-option"
- ],[
- ax_compiler_flags_test=""
- ])
-
- # Base flags
- AX_APPEND_LINK_FLAGS([ dnl
- -Wl,--no-as-needed dnl
- $3 dnl
- ],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
-
- AS_IF([test "$ax_enable_compile_warnings" != "no"],[
- # "yes" flags
- AX_APPEND_LINK_FLAGS([$4 $5 $6 $7],
- ax_warn_ldflags_variable,
- [$ax_compiler_flags_test])
- ])
- AS_IF([test "$ax_enable_compile_warnings" = "error"],[
- # "error" flags; -Werror has to be appended unconditionally because
- # it's not possible to test for
- #
- # suggest-attribute=format is disabled because it gives too many false
- # positives
- AX_APPEND_LINK_FLAGS([ dnl
- -Wl,--fatal-warnings dnl
- ],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
- ])
-
- # Substitute the variables
- AC_SUBST(ax_warn_ldflags_variable)
-])dnl AX_COMPILER_FLAGS
diff --git a/m4/ax_is_release.m4 b/m4/ax_is_release.m4
deleted file mode 100644
index 9ec6746..0000000
--- a/m4/ax_is_release.m4
+++ /dev/null
@@ -1,69 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_is_release.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_IS_RELEASE(POLICY)
-#
-# DESCRIPTION
-#
-# Determine whether the code is being configured as a release, or from
-# git. Set the ax_is_release variable to 'yes' or 'no'.
-#
-# If building a release version, it is recommended that the configure
-# script disable compiler errors and debug features, by conditionalising
-# them on the ax_is_release variable. If building from git, these
-# features should be enabled.
-#
-# The POLICY parameter specifies how ax_is_release is determined. It can
-# take the following values:
-#
-# * git-directory: ax_is_release will be 'no' if a '.git' directory exists
-# * minor-version: ax_is_release will be 'no' if the minor version number
-# in $PACKAGE_VERSION is odd; this assumes
-# $PACKAGE_VERSION follows the 'major.minor.micro' scheme
-# * micro-version: ax_is_release will be 'no' if the micro version number
-# in $PACKAGE_VERSION is odd; this assumes
-# $PACKAGE_VERSION follows the 'major.minor.micro' scheme
-# * always: ax_is_release will always be 'yes'
-# * never: ax_is_release will always be 'no'
-#
-# Other policies may be added in future.
-#
-# LICENSE
-#
-# Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved.
-
-#serial 3
-
-AC_DEFUN([AX_IS_RELEASE],[
- AC_BEFORE([AC_INIT],[$0])
-
- m4_case([$1],
- [git-directory],[
- # $is_release = (.git directory does not exist)
- AS_IF([test -d .git],[ax_is_release=no],[ax_is_release=yes])
- ],
- [minor-version],[
- # $is_release = ($minor_version is even)
- minor_version=`echo "$PACKAGE_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
- AS_IF([test "$(( $minor_version % 2 ))" -ne 0],
- [ax_is_release=no],[ax_is_release=yes])
- ],
- [micro-version],[
- # $is_release = ($micro_version is even)
- micro_version=`echo "$PACKAGE_VERSION" | sed 's/[[^.]]*\.[[^.]]*\.\([[^.]]*\).*/\1/'`
- AS_IF([test "$(( $micro_version % 2 ))" -ne 0],
- [ax_is_release=no],[ax_is_release=yes])
- ],
- [always],[ax_is_release=yes],
- [never],[ax_is_release=no],
- [
- AC_MSG_ERROR([Invalid policy. Valid policies: git-directory, minor-version.])
- ])
-])
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
deleted file mode 100644
index cae1111..0000000
--- a/m4/ax_require_defined.m4
+++ /dev/null
@@ -1,37 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_require_defined.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_REQUIRE_DEFINED(MACRO)
-#
-# DESCRIPTION
-#
-# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
-# been defined and thus are available for use. This avoids random issues
-# where a macro isn't expanded. Instead the configure script emits a
-# non-fatal:
-#
-# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
-#
-# It's like AC_REQUIRE except it doesn't expand the required macro.
-#
-# Here's an example:
-#
-# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
-#
-# LICENSE
-#
-# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 1
-
-AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
- m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
-])dnl AX_REQUIRE_DEFINED
diff --git a/m4/guul.m4 b/m4/guul.m4
deleted file mode 100644
index 5bc3620..0000000
--- a/m4/guul.m4
+++ /dev/null
@@ -1,54 +0,0 @@
-AC_DEFUN([GUUL_CHECK_UUID],
-[
- AS_IF([test "x$1" = "xinternal"],
- [AC_DEFINE([GUUL_INTERNAL],[1],[GUUL will be used internally])])
-
- GUUL_LIBS=
- GUUL_CFLAGS=
- AC_MSG_CHECKING([for uuid library])
- case "$host" in
- *-*-mingw*)
- uuid_found=windows
- AC_DEFINE([GUUL_PLATFORM_WINDOWS],[1],[Compiling for windows])
- GUUL_LIBS=-lrpcrt4
- ;;
- *darwin*)
- uuid_found=macosx
- AC_DEFINE([GUUL_PLATFORM_OSX],[1],[Compiling for OS X])
- ;;
- *bsd*)
- uuid_found=bsd
- ;;
- *)
- uuid_found=generic
- ;;
- esac
-
- dnl do fallback if we have a BSD that does not have the necessary functions
- AS_IF([test "x$uuid_found" = "xbsd"],
- [AC_SEARCH_LIBS([uuid_to_string], [c],
- [UUID_LIBS=
- AC_DEFINE([GUUL_PLATFORM_BSD],[1],[Compiling for BSD flavor])
- ],
- [uuid_found=generic])
- ])
-
- dnl for other platforms, use libuuid from the e2fs project
- AS_IF([test "x$uuid_found" = "xgeneric"],
- [PKG_CHECK_MODULES(UUID, [uuid],
- [
- AC_DEFINE([GUUL_PLATFORM_GENERIC],[1],[Using external library])
- GUUL_LIBS="$UUID_LIBS"
- GUUL_CFLAGS="$UUID_CFLAGS"
- GUUL_PKG=uuid
- ],
- [AC_MSG_ERROR([none])
- ])
- ])
-
- AC_SUBST(GUUL_LIBS)
- AC_SUBST(GUUL_CFLAGS)
- AC_SUBST(GUUL_PKG)
- GUUL_FLAVOR=$uuid_found
- AC_MSG_RESULT([using flavor $uuid_found])
-])
diff --git a/m4/introspection.m4 b/m4/introspection.m4
deleted file mode 100644
index bfc52be..0000000
--- a/m4/introspection.m4
+++ /dev/null
@@ -1,94 +0,0 @@
-dnl -*- mode: autoconf -*-
-dnl Copyright 2009 Johan Dahlin
-dnl
-dnl This file is free software; the author(s) gives unlimited
-dnl permission to copy and/or distribute it, with or without
-dnl modifications, as long as this notice is preserved.
-dnl
-
-# serial 1
-
-m4_define([_GOBJECT_INTROSPECTION_CHECK_INTERNAL],
-[
- AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
- AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
-
- dnl enable/disable introspection
- m4_if([$2], [require],
- [dnl
- enable_introspection=yes
- ],[dnl
- AC_ARG_ENABLE(introspection,
- AS_HELP_STRING([--enable-introspection[=@<:@no/auto/yes@:>@]],
- [Enable introspection for this build]),,
- [enable_introspection=auto])
- ])dnl
-
- AC_MSG_CHECKING([for gobject-introspection])
-
- dnl presence/version checking
- AS_CASE([$enable_introspection],
- [no], [dnl
- found_introspection="no (disabled, use --enable-introspection to enable)"
- ],dnl
- [yes],[dnl
- PKG_CHECK_EXISTS([gobject-introspection-1.0],,
- AC_MSG_ERROR([gobject-introspection-1.0 is not installed]))
- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1],
- found_introspection=yes,
- AC_MSG_ERROR([You need to have gobject-introspection >= $1 installed to build AC_PACKAGE_NAME]))
- ],dnl
- [auto],[dnl
- PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no)
- ],dnl
- [dnl
- AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@])
- ])dnl
-
- AC_MSG_RESULT([$found_introspection])
-
- INTROSPECTION_SCANNER=
- INTROSPECTION_COMPILER=
- INTROSPECTION_GENERATE=
- INTROSPECTION_GIRDIR=
- INTROSPECTION_TYPELIBDIR=
- if test "x$found_introspection" = "xyes"; then
- INTROSPECTION_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0`
- INTROSPECTION_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0`
- INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
- INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
- INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
- INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
- INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
- INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
- fi
- AC_SUBST(INTROSPECTION_SCANNER)
- AC_SUBST(INTROSPECTION_COMPILER)
- AC_SUBST(INTROSPECTION_GENERATE)
- AC_SUBST(INTROSPECTION_GIRDIR)
- AC_SUBST(INTROSPECTION_TYPELIBDIR)
- AC_SUBST(INTROSPECTION_CFLAGS)
- AC_SUBST(INTROSPECTION_LIBS)
- AC_SUBST(INTROSPECTION_MAKEFILE)
-
- AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
-])
-
-
-dnl Usage:
-dnl GOBJECT_INTROSPECTION_CHECK([minimum-g-i-version])
-
-AC_DEFUN([GOBJECT_INTROSPECTION_CHECK],
-[
- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1])
-])
-
-dnl Usage:
-dnl GOBJECT_INTROSPECTION_REQUIRE([minimum-g-i-version])
-
-
-AC_DEFUN([GOBJECT_INTROSPECTION_REQUIRE],
-[
- _GOBJECT_INTROSPECTION_CHECK_INTERNAL([$1], [require])
-])
diff --git a/m4/vapigen.m4 b/m4/vapigen.m4
deleted file mode 100644
index c909726..0000000
--- a/m4/vapigen.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-
-dnl vala.m4
-dnl
-dnl Copyright 2010 Marc-Andre Lureau
-dnl Copyright 2011 Rodney Dawes <dobey.pwns@gmail.com>
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-dnl dropped everything but VALA_PROG_VAPIGEN - Jens Georg <mail@jensge.org>
-
-# Check whether the Vala API Generator exists in `PATH'. If it is found,
-# the variable VAPIGEN is set. Optionally a minimum release number of the
-# generator can be requested.
-#
-# VALA_PROG_VAPIGEN([MINIMUM-VERSION])
-# ------------------------------------
-AC_DEFUN([GUPNP_PROG_VAPIGEN],
-[AC_PATH_PROG([VAPIGEN], [vapigen], [])
- AS_IF([test -z "$VAPIGEN"],
- [AC_MSG_WARN([No Vala API Generator found. You will not be able to generate .vapi files.])],
- [AS_IF([test -n "$1"],
- [AC_MSG_CHECKING([$VAPIGEN is at least version $1])
- am__vapigen_version=`$VAPIGEN --version | sed 's/Vala API Generator *//'`
- AS_VERSION_COMPARE([$1], ["$am__vapigen_version"],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_WARN([Vala API Generator $1 not found.])
- VAPIGEN=""
- ])])])
-])
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..e948cb0
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,55 @@
+project('gupnp', 'c', version : '1.1.0')
+gnome = import('gnome')
+pkg = import('pkgconfig')
+
+cc = meson.get_compiler('c')
+
+conf = configuration_data()
+conf.set_quoted('VERSION', meson.project_version())
+
+netlink_test = '''#include <sys/socket.h>
+#include <linux/rtnetlink.h>
+'''
+netlink_available = cc.compiles(netlink_test, name : 'linux/rtnetlink.h availability')
+conf.set('HAVE_NETLINK', netlink_available)
+
+ifaddrs_test = '#include <ifaddrs.h>'
+ifaddrs_available = cc.compiles(ifaddrs_test, name : 'ifaddrs.h availability')
+conf.set('HAVE_IFADDRS_H', ifaddrs_available)
+
+wireless_test ='''#include <sys/socket.h>
+#include <linux/wireless.h>
+'''
+conf.set('HAVE_LINUX_WIRELESS_H',
+ cc.compiles(wireless_test, name : 'linux/wireless.h availability'))
+
+config_h = configure_file(output : 'config.h', configuration : conf)
+add_global_arguments('-DHAVE_CONFIG_H=1', language : 'c')
+
+guul = subproject('guul', default_options : ['default_library=static'])
+
+dependencies = [
+ dependency('glib-2.0', version : '>= 2.40'),
+ dependency('gio-2.0', version : '>= 2.40'),
+ dependency('gmodule-2.0', version : '>= 2.40'),
+ dependency('gssdp-1.2', version : '>= 1.1'),
+ dependency('libsoup-2.4', version : '>= 2.48.0'),
+ dependency('libxml-2.0'),
+ guul.get_variable('guul')
+]
+
+subdir('libgupnp')
+subdir('tests')
+subdir('tools')
+
+if get_option('vapi') and get_option('introspection')
+ subdir('vala')
+endif
+
+if get_option('gtk_doc')
+ subdir('doc')
+endif
+
+if get_option('examples')
+ subdir('examples')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..3fa5392
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,5 @@
+option('context_manager', type : 'combo', choices : ['linux', 'network-manager', 'connman', 'system'], value : 'system', description: 'Which context manager to use for detecting network interfaces')
+option('introspection', type : 'boolean', value : 'true', description : 'Enable / disable the GObject-Introspection integration')
+option('vapi', type : 'boolean', value : 'true', description : ' Enable / disable VALA API file generation (needs -Dintrospection=true)')
+option('gtk_doc', type : 'boolean', value : 'false', description : 'Enable generation of the API documentation (needs GTK-Doc)')
+option('examples', type : 'boolean', value : 'true', description : 'Enable / disable building the examples')
diff --git a/libgupnp/guul.c b/subprojects/guul/guul.c
index 420cf1c..420cf1c 100644
--- a/libgupnp/guul.c
+++ b/subprojects/guul/guul.c
diff --git a/libgupnp/guul.h b/subprojects/guul/guul.h
index be0dde9..b96bab1 100644
--- a/libgupnp/guul.h
+++ b/subprojects/guul/guul.h
@@ -20,10 +20,6 @@
#ifndef __GUUL_H
#define __GUUL_H
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <glib.h>
G_BEGIN_DECLS
diff --git a/subprojects/guul/meson.build b/subprojects/guul/meson.build
new file mode 100644
index 0000000..aea40c4
--- /dev/null
+++ b/subprojects/guul/meson.build
@@ -0,0 +1,33 @@
+project('guul', 'c', version : '0.1')
+
+cc = meson.get_compiler('c')
+dependencies = [
+ dependency('glib-2.0')
+]
+args = []
+
+if host_machine.system() == 'windows'
+ args += '-DGUUL_PLATFORM_WINDOWS'
+ dependencies += cc.find_library('rpcrt4')
+elif host_machine.system() == 'darwin'
+ args += '-DGUUL_PLATFORM_OSX'
+else
+ if not cc.has_function('uuid_to_string')
+ dependencies += dependency('uuid')
+ args += '-DGUUL_PLATFORM_GENERIC'
+ else
+ args += '-DGUUL_PLATFORM_BSD'
+ endif
+endif
+
+guul_lib = static_library(
+ 'guul',
+ sources : 'guul.c',
+ c_args : args,
+ dependencies : dependencies
+)
+
+guul = declare_dependency (
+ link_with : guul_lib,
+ include_directories: include_directories('.')
+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
deleted file mode 100644
index b7571a8..0000000
--- a/tests/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-SUBDIRS = gtest
-
-AM_CFLAGS = $(LIBGUPNP_CFLAGS) $(GTHREAD_CFLAGS) -I$(top_srcdir) $(WARN_CFLAGS)
-
-noinst_PROGRAMS = test-browsing \
- test-proxy \
- test-server \
- test-introspection \
- test-white-list
-
-test_browsing_SOURCES = test-browsing.c
-test_browsing_LDADD = $(top_builddir)/libgupnp/libgupnp-1.2.la \
- $(GTHREAD_LIBS) \
- $(LIBGUPNP_LIBS)
-test_browsing_LDFLAGS = $(WARN_LDFLAGS)
-
-test_proxy_SOURCES = test-proxy.c
-test_proxy_LDADD = $(top_builddir)/libgupnp/libgupnp-1.2.la \
- $(GTHREAD_LIBS) \
- $(LIBGUPNP_LIBS)
-test_proxy_LDFLAGS = $(WARN_LDFLAGS)
-
-test_introspection_SOURCES = test-introspection.c
-test_introspection_LDADD = $(top_builddir)/libgupnp/libgupnp-1.2.la \
- $(GTHREAD_LIBS) \
- $(LIBGUPNP_LIBS)
-test_introspection_LDFLAGS = $(WARN_LDFLAGS)
-
-test_server_SOURCES = test-server.c
-test_server_LDADD = $(top_builddir)/libgupnp/libgupnp-1.2.la \
- $(GTHREAD_LIBS) \
- $(LIBGUPNP_LIBS)
-test_server_LDFLAGS = -export-dynamic $(WARN_LDFLAGS)
-
-test_white_list_SOURCES = test-white-list.c
-test_white_list_LDADD = $(top_builddir)/libgupnp/libgupnp-1.2.la \
- $(GTHREAD_LIBS) \
- $(LIBGUPNP_LIBS)
-test_white_list_LDFLAGS = $(WARN_LDFLAGS)
-
-CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES = $(BUILT_SOURCES)
-MAINTAINERCLEANFILES = Makefile.in $(BUILT_SOURCES)
diff --git a/tests/gtest/Makefile.am b/tests/gtest/Makefile.am
deleted file mode 100644
index 5fe33f4..0000000
--- a/tests/gtest/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-TESTS_ENVIRONMENT = G_SLICE=debug-blocks \
- LD_LIBRARY_PATH=$(top_builddir)/libgupnp/.libs:$(LD_LIBRARY_PATH)
-
-TESTS=$(check_PROGRAMS)
-
-check_PROGRAMS = test-context test-bugs
-
-test_context_SOURCES = test-context.c
-test_bugs_SOURCES = test-bugs.c
-
-LDADD = \
- $(top_builddir)/libgupnp/libgupnp-1.2.la \
- $(LIBGUPNP_LIBS)
-AM_CFLAGS = \
- $(LIBGUPNP_CFLAGS) \
- -I $(top_srcdir) \
- -DDATA_PATH="\"$(srcdir)/data\""
-
-EXTRA_DIST=data/random4k.bin data/TestService.xml data/TestDevice.xml
diff --git a/tests/gtest/meson.build b/tests/gtest/meson.build
new file mode 100644
index 0000000..33637d7
--- /dev/null
+++ b/tests/gtest/meson.build
@@ -0,0 +1,12 @@
+foreach program : ['context', 'bugs']
+ test(
+ program,
+ executable(
+ 'test-' + program,
+ 'test-@0@.c'.format (program),
+ dependencies : gupnp,
+ c_args : '-DDATA_PATH="@0@/data"'.format(meson.current_source_dir())
+ ),
+ is_parallel : false
+ )
+endforeach
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..61b91bc
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,9 @@
+foreach program : ['browsing', 'proxy', 'server', 'introspection', 'white-list']
+ executable(
+ 'test-' + program,
+ sources : 'test-@0@.c'.format(program),
+ dependencies : gupnp
+ )
+endforeach
+
+subdir('gtest')
diff --git a/tools/Makefile.am b/tools/Makefile.am
deleted file mode 100644
index 6de9db4..0000000
--- a/tools/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-dist_bin_SCRIPTS = gupnp-binding-tool
diff --git a/tools/meson.build b/tools/meson.build
new file mode 100644
index 0000000..5960fba
--- /dev/null
+++ b/tools/meson.build
@@ -0,0 +1 @@
+install_data('gupnp-binding-tool', install_dir : 'bin')
diff --git a/vala/GUPnP-1.2.metadata b/vala/GUPnP-1.2.metadata
index e3e6af2..4f0aedf 100644
--- a/vala/GUPnP-1.2.metadata
+++ b/vala/GUPnP-1.2.metadata
@@ -1,4 +1,3 @@
-GUPnP cheader_filename="libgupnp/gupnp.h"
Acl
.is_allowed skip
.is_allowed_async skip
diff --git a/vala/Makefile.am b/vala/Makefile.am
deleted file mode 100644
index 0ad4f35..0000000
--- a/vala/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-if HAVE_INTROSPECTION
-if HAVE_VAPIGEN
-gupnp-1.2.vapi: gupnp-1.2.stamp
- @true
-
-gupnp-1.2.stamp: $(top_builddir)/libgupnp/GUPnP-1.2.gir \
- $(srcdir)/GUPnP-1.2.metadata \
- $(srcdir)/gupnp-1.2-custom.vala
- $(AM_V_GEN)$(VAPIGEN) --metadatadir=$(srcdir) \
- --pkg=libsoup-2.4 \
- --library=gupnp-1.2 --pkg=gio-2.0 --pkg=libxml-2.0 \
- $(top_builddir)/libgupnp/GUPnP-1.2.gir \
- $(srcdir)/gupnp-1.2-custom.vala && \
- echo timestmap > $(@F)
-
-vapidir = $(datadir)/vala/vapi
-vapi_DATA = gupnp-1.2.vapi $(srcdir)/gupnp-1.2.deps
-CLEANFILES = gupnp-1.2.vapi gupnp-1.2.stamp
-EXTRA_DIST = gupnp-1.2.deps GUPnP-1.2.metadata gupnp-1.2-custom.vala gupnp-1.2.vapi gupnp-1.2.stamp
-endif
-endif
diff --git a/vala/meson.build b/vala/meson.build
new file mode 100644
index 0000000..6a9f9df
--- /dev/null
+++ b/vala/meson.build
@@ -0,0 +1,5 @@
+
+gnome.generate_vapi('gupnp-1.2',
+ sources : [gir.get(0), 'gupnp-1.2-custom.vala'],
+ packages : ['gio-2.0', 'libsoup-2.4', 'libxml-2.0'],
+ install : true)