Commit 1e4272b4 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠 Committed by Olivier Crête
Browse files

Remove autotools build

Remove dist check on the CI, since it doesn't really
add anything in the Meson case (tarball is based
on files checked into git and srcdir != builddir).
parent 7581462a
Pipeline #150461 passed with stages
in 4 minutes and 33 seconds
...@@ -3,63 +3,6 @@ stages: ...@@ -3,63 +3,6 @@ stages:
- test - test
- deploy - deploy
build autotools:
stage: build
image: registry.freedesktop.org/libnice/libnice/centos7/autotools-build
except:
- schedules
script:
- ifconfig
- export BUILD_ID="libnice-$CI_JOB_NAME_$CI_COMMIT_SHA-$CI_JOB_ID"
- export PREFIX="$(pwd)/prefix-$BUILD_ID"
- export MAKEFLAGS="-j4"
- mkdir "$PREFIX"
- ./autogen.sh --prefix="$PREFIX" --enable-compile-warnings=error --enable-gtk-doc --enable-introspection
- make
- make install
artifacts:
untracked: true
test autotools:
stage: test
image: registry.freedesktop.org/libnice/libnice/centos7/autotools-build
except:
- schedules
needs:
- build autotools
script:
- ifconfig
- make check
artifacts:
when: always
paths:
- config.log
- nice/test-suite.log
- random/test-suite.log
- tests/test-suite.log
- stun/tests/test-suite.log
- docs/reference/libnice/test-suite.log
test autotools valgrind:
extends: test autotools
script:
- ifconfig
- make check-valgrind
distcheck autotools:
stage: test
image: registry.freedesktop.org/libnice/libnice/centos7/autotools-build
except:
- schedules
needs:
- build autotools
script:
- ifconfig
- make distcheck
artifacts:
paths:
- libnice-*.tar.gz
build meson: build meson:
stage: build stage: build
image: registry.freedesktop.org/libnice/libnice/centos7/meson-build image: registry.freedesktop.org/libnice/libnice/centos7/meson-build
...@@ -240,8 +183,7 @@ submit-to-coverity: ...@@ -240,8 +183,7 @@ submit-to-coverity:
- tar czvf libnice.tgz cov-int - tar czvf libnice.tgz cov-int
- curl --form token=$COVERITY_TOKEN --form email=olivier.crete@ocrete.ca --form file=@libnice.tgz --form version="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}" --form description="CI weekly run" https://scan.coverity.com/builds?project=libnice - curl --form token=$COVERITY_TOKEN --form email=olivier.crete@ocrete.ca --form file=@libnice.tgz --form version="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}" --form description="CI weekly run" https://scan.coverity.com/builds?project=libnice
pages:
documentation:
stage: deploy stage: deploy
dependencies: dependencies:
- doc-and-install meson - doc-and-install meson
......
#
# Makefile.am for the Nice Glib ICE library
#
# (C) 2006, 2007 Collabora Ltd.
# (C) 2006, 2007 Nokia Corporation. All rights reserved.
#
# Licensed under MPL 1.1/LGPL 2.1. See file COPYING.
include common.mk
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = \
stun \
socket \
random \
agent \
nice \
gst \
tests \
docs \
examples
DISTCHECK_CONFIGURE_FLAGS = --disable-assert -enable-gtk-doc --enable-introspection
EXTRA_DIST = \
COPYING.LGPL \
COPYING.MPL \
autogen.sh \
common.mk \
scripts/lcov.mk \
scripts/lcov.sh \
scripts/valgrind-test-driver \
m4/introspection.m4 \
meson.build \
meson_options.txt
MAINTAINERCLEANFILES = ar-lib
dist_check_SCRIPTS = \
scripts/check-symbols.sh \
scripts/make-symbol-list.sh
lcov:
find -name '*.gcda' -delete
$(MAKE) $(AM_MAKEFLAGS) check
find -type d -name '.libs' | while read d ; do \
mv -fv $$d/*.gc* $$d/.. 2>/dev/null || true ; \
done
$(MAKE) lcov-report
lcov-report:
mkdir -p lcov
lcov -d . -c > lcov/lcov.info
lcov -l lcov/lcov.info 2>/dev/null | \
egrep '(^/usr|/test.*\.c)' | \
cut -d: -f1 > lcov/lcov.remove
lcov -r lcov/lcov.info `cat lcov/lcov.remove` 2>/dev/null > lcov/lcov.info.clean
genhtml -o lcov lcov/lcov.info.clean
clean-local:
rm -rf doc
.PHONY: doc lcov-report lcov
...@@ -20,14 +20,23 @@ Requirements ...@@ -20,14 +20,23 @@ Requirements
pkg-config pkg-config
gnutls >= 2.12.0 or OpenSSL gnutls >= 2.12.0 or OpenSSL
gupnp-igd >= 0.1.2 (optional) gupnp-igd >= 0.1.2 (optional)
gstreamer-0.10 >= 0.10.0 (optional) gstreamer-0.10 (optional)
gstreamer-1.0 (optional) gstreamer-1.0 (optional)
Build instructions Build instructions
------------------ ------------------
To build, you need Python 3 and Meson. Then need to do: libnice uses the Meson Build System: https://mesonbuild.com
meson build && ninja -C build && sudo ninja -C build install
To build on Linux and Mac, you only need to type the usual commands :
meson builddir
ninja -C builddir
ninja -C builddir test (or "meson test -C builddir" for more control)
sudo ninja -C builddir install
See https://mesonbuild.com/Quick-guide.html#compiling-a-meson-project
for more details and how to install the Meson build system.
Structure Structure
--------- ---------
......
#
# Makefile.am for the Nice Glib ICE library
#
# (C) 2006, 2007 Collabora Ltd.
# (C) 2006, 2007 Nokia Corporation. All rights reserved.
#
# Licensed under MPL 1.1/LGPL 2.1. See file COPYING.
include $(top_srcdir)/common.mk
AM_CFLAGS = \
-DG_LOG_DOMAIN=\"libnice\" \
$(LIBNICE_CFLAGS) \
$(GLIB_CFLAGS) \
$(GUPNP_CFLAGS) \
-I $(top_srcdir) \
-I $(top_srcdir)/random \
-I $(top_srcdir)/socket \
-I $(top_srcdir)/stun
if WINDOWS
AM_CFLAGS += -DWINVER=0x0501 # _WIN32_WINNT_WINXP
endif
BUILT_SOURCES = \
agent-enum-types.h \
agent-enum-types.c
CLEANFILES += $(BUILT_SOURCES)
noinst_LTLIBRARIES = libagent.la
pkginclude_HEADERS = \
agent.h \
candidate.h \
debug.h \
address.h \
interfaces.h \
pseudotcp.h \
$(NULL)
libagent_la_SOURCES = \
address.h \
address.c \
debug.h \
debug.c \
candidate.h \
candidate.c \
component.h \
component.c \
agent.h \
agent-priv.h \
agent.c \
stream.h \
stream.c \
conncheck.c \
conncheck.h \
discovery.c \
discovery.h \
interfaces.c \
interfaces.h \
pseudotcp.h \
pseudotcp.c \
iostream.h \
iostream.c \
inputstream.h \
inputstream.c \
outputstream.h \
outputstream.c \
$(BUILT_SOURCES)
agent-enum-types.h: $(pkginclude_HEADERS) Makefile
$(AM_V_GEN)$(GLIB_MKENUMS) \
--fhead "#ifndef __AGENT_ENUM_TYPES_H__\n#define __AGENT_ENUM_TYPES_H__ 1\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define NICE_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
--ftail "G_END_DECLS\n\n#endif /* !AGENT_ENUM_TYPES_H */" \
$(addprefix $(srcdir)/,$(pkginclude_HEADERS)) > $@
agent-enum-types.c: $(pkginclude_HEADERS) Makefile agent-enum-types.h
$(AM_V_GEN)$(GLIB_MKENUMS) \
--fhead "#include <config.h>\n#include <glib-object.h>\n#include \"agent.h\"\n#include \"pseudotcp.h\"\n#include \"agent-enum-types.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType type = 0;\n if (!type) {\n static const G@Type@Value values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n };\n type = g_@type@_register_static (\"@EnumName@\", values);\n }\n return type;\n}\n\n" \
$(addprefix $(srcdir)/,$(pkginclude_HEADERS)) > $@
libagent_la_LIBADD = \
$(top_builddir)/random/libnice-random.la \
$(top_builddir)/socket/libsocket.la \
$(top_builddir)/stun/libstun.la \
$(GLIB_LIBS) \
$(GUPNP_LIBS) \
$(NULL)
libagent_la_DEPENDENCIES = \
$(top_builddir)/random/libnice-random.la \
$(top_builddir)/socket/libsocket.la \
$(top_builddir)/stun/libstun.la
if WINDOWS
libagent_la_LIBADD += -liphlpapi -lws2_32
endif
#
# GObject introspection
#
# We need --accept-unprefixed because of PseudoTcp and TurnServer.
#
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all --accept-unprefixed
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
if HAVE_INTROSPECTION
introspection_sources = $(pkginclude_HEADERS)
Nice-0.1.gir: libagent.la
Nice_0_1_gir_INCLUDES = GObject-2.0 Gio-2.0
Nice_0_1_gir_EXPORT_PACKAGES = nice
Nice_0_1_gir_CFLAGS = $(AM_CFLAGS)
Nice_0_1_gir_LIBS = libagent.la
Nice_0_1_gir_FILES = $(introspection_sources)
INTROSPECTION_GIRS += Nice-0.1.gir
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
EXTRA_DIST = meson.build
#!/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
CLEANFILES = *.gcno *.gcda
pkgincludedir = $(includedir)/nice
check-valgrind:
$(MAKE) TESTS_ENVIRONMENT="USE_VALGRIND=1 " check
LOG_DRIVER=$(top_srcdir)/scripts/valgrind-test-driver
.PHONY: check-valgrind
AC_PREREQ(2.62)
dnl Always compile with -Wall; if --enable-compile-warnings=error is passed,
dnl also use -Werror. git and pre-releases default to -Werror
dnl use a three digit version number for releases, and four for cvs/prerelease
AC_INIT([libnice],[0.1.17.1])
LIBNICE_RELEASE="no"
AC_CANONICAL_TARGET
AC_CONFIG_SRCDIR([agent/agent.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.12 -Wall -Wno-portability subdir-objects])
AC_CONFIG_FILES([
Makefile
agent/Makefile
stun/Makefile
stun/tests/Makefile
stun/tools/Makefile
socket/Makefile
nice/Makefile
nice/nice.pc
random/Makefile
gst/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/libnice/Makefile
tests/Makefile
examples/Makefile
])
# Set the libtool C/A/R version info
# If the source code was changed, but there were no interface changes:
# Increment REVISION.
# If there was a compatible interface change:
# Increment CURRENT and AGE. Set REVISION to 0
# If there was an incompatible interface change:
# Increment CURRENT. Set AGE and REVISION to 0
LIBNICE_CURRENT=20
LIBNICE_REVISION=0
LIBNICE_AGE=10
LIBNICE_LIBVERSION=${LIBNICE_CURRENT}:${LIBNICE_REVISION}:${LIBNICE_AGE}
LIBNICE_LT_LDFLAGS="-version-info ${LIBNICE_LIBVERSION} -no-undefined"
AC_SUBST(LIBNICE_LT_LDFLAGS)
dnl use pretty build output
AM_SILENT_RULES([yes])
# Checks for programs.
AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AM_PROG_AR
LT_PREREQ([2.2.6])
LT_INIT([dlopen win32-dll disable-static])
AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
# Check Operating System
AC_MSG_CHECKING([operating system])
case "$host" in
*-*-*mingw*|*-*-*cygwin*)
platform=win32
AC_MSG_RESULT($platform)
;;
*)
platform=linux/other
AC_MSG_RESULT($platform)
;;
esac
AM_CONDITIONAL([WINDOWS], [test "$platform" = "win32"])
# Checks for compiler features
AC_C_RESTRICT
AC_C_VARARRAYS
AC_HEADER_ASSERT
AC_HEADER_STDBOOL
AH_VERBATIM([_FORTIFY_SOURCE],
[/* Define to `2' to get GNU/libc warnings. */
/* Only define if -O1 or more is enabled */
#if defined __OPTIMIZE__ && __OPTIMIZE__ > 0
# define _FORTIFY_SOURCE 2
#endif])
AC_DEFINE([NICEAPI_EXPORT], [ ], [Public library function implementation])
AC_CHECK_HEADERS([arpa/inet.h net/in.h netdb.h])
AC_CHECK_HEADERS([ifaddrs.h],
[AC_CHECK_FUNCS([getifaddrs],
[AC_DEFINE(HAVE_GETIFADDRS, [1],
[Whether getifaddrs() is available on the system])])])
AC_CHECK_TYPES([size_t, ssize_t])
# Also put matching version in LIBNICE_CFLAGS
GLIB_REQ=2.54
LIBNICE_CFLAGS="-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_54 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_54"
dnl Support different levels of compiler error reporting.
dnl This configure flag is designed to mimic one from gnome-common,
dnl Defaults to "error" except for releases where it defaults to "yes"
AC_ARG_ENABLE(compile-warnings,
AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
[Enable different levels of compiler warnings]),,
[AS_IF([test "$LIBNICE_RELEASE" = "yes"],
[enable_compile_warnings="yes"],
[enable_compile_warnings="error"])])
AC_DEFUN([NICE_ADD_FLAG],
AS_COMPILER_FLAG([-Werror $1], LIBNICE_CFLAGS="$LIBNICE_CFLAGS $1", [])
)
NICE_ADD_FLAG([-fno-strict-aliasing])
AS_IF([test "$enable_compile_warnings" != "no"],[
NICE_ADD_FLAG([-Wall])
])
AS_IF([test "x$enable_compile_warnings" != "xno" -a \
"x$enable_compile_warnings" != "xminimum"],[
NICE_ADD_FLAG([-Wextra])
NICE_ADD_FLAG([-Wundef])
NICE_ADD_FLAG([-Wnested-externs])
NICE_ADD_FLAG([-Wwrite-strings])
NICE_ADD_FLAG([-Wpointer-arith])
NICE_ADD_FLAG([-Wmissing-declarations])
NICE_ADD_FLAG([-Wmissing-prototypes])
NICE_ADD_FLAG([-Wstrict-prototypes])
NICE_ADD_FLAG([-Wredundant-decls])
NICE_ADD_FLAG([-Wno-unused-parameter])
NICE_ADD_FLAG([-Wno-missing-field-initializers])
NICE_ADD_FLAG([-Wdeclaration-after-statement])
NICE_ADD_FLAG([-Wformat=2])
NICE_ADD_FLAG([-Wold-style-definition])
NICE_ADD_FLAG([-Wcast-align])
NICE_ADD_FLAG([-Wformat-nonliteral])
NICE_ADD_FLAG([-Wformat-security])
NICE_ADD_FLAG([-Wno-cast-function-type])
])
AS_IF([test "$enable_compile_warnings" = "yes" -o \
"$enable_compile_warnings" = "maximum" -o \
"$enable_compile_warnings" = "error"],[
NICE_ADD_FLAG([-Wsign-compare])
NICE_ADD_FLAG([-Wstrict-aliasing])
NICE_ADD_FLAG([-Wshadow])
NICE_ADD_FLAG([-Winline])
NICE_ADD_FLAG([-Wpacked])
NICE_ADD_FLAG([-Wmissing-format-attribute])
NICE_ADD_FLAG([-Winit-self])
NICE_ADD_FLAG([-Wredundant-decls])
NICE_ADD_FLAG([-Wmissing-include-dirs])
NICE_ADD_FLAG([-Wunused-but-set-variable])
NICE_ADD_FLAG([-Warray-bounds])
])
AS_IF([test "$enable_compile_warnings" = "maximum" -o \
"$enable_compile_warnings" = "error"],[
NICE_ADD_FLAG([-Wswitch-default])
NICE_ADD_FLAG([-Waggregate-return])
])
AS_IF([test "x$enable_compile_warnings" = "xerror"],[
NICE_ADD_FLAG([-Werror])
NICE_ADD_FLAG([-Wno-suggest-attribute=format])
])
#
# Fixes for Solaris
#
AC_SEARCH_LIBS([inet_pton],[nsl])
AC_SEARCH_LIBS([socket],[socket inet])
case $host in
*-*-solaris* )
AC_DEFINE(_XOPEN_SOURCE, 600, Needed to get declarations for msg_control and msg_controllen on Solaris)
AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
;;
esac
AC_SUBST(LIBNICE_CFLAGS)
AC_MSG_NOTICE([set LIBNICE_CFLAGS to $LIBNICE_CFLAGS])
# Checks for libraries.
AC_CHECK_LIB(rt, clock_gettime, [LIBRT="-lrt"], [LIBRT=""])
AC_CHECK_FUNCS([poll])
AC_SUBST(LIBRT)
# Dependencies
NICE_PACKAGES_PUBLIC="glib-2.0 >= $GLIB_REQ gio-2.0 >= $GLIB_REQ gobject-2.0 >= $GLIB_REQ"
NICE_PACKAGES_PRIVATE="gthread-2.0"
PKG_CHECK_MODULES(GLIB, [$NICE_PACKAGES_PUBLIC $NICE_PACKAGES_PRIVATE])
AC_ARG_WITH(crypto-library,
AS_HELP_STRING([--with-crypto-library=\{gnutls,openssl,auto\}],[select Crypto library (gnutls or openssl)]),
[with_crypto_library=${withval}],
[with_crypto_library=auto])
AS_IF([test "$with_crypto_library" != "openssl"],
[
GNUTLS_PACKAGES_PRIVATE="gnutls >= 2.12.0"
PKG_CHECK_MODULES(GNUTLS, [$GNUTLS_PACKAGES_PRIVATE],
[
AC_DEFINE([HAVE_GNUTLS], [1], [Use GnuTLS])
GNUTLS_FOUND=yes
NICE_PACKAGES_PRIVATE="$NICE_PACKAGES_PRIVATE $GNUTLS_PACKAGES_PRIVATE"
],
[
AS_IF([test "$with_crypto_library" == "gnutls"],
[
AC_MSG_ERROR([Neither GnuTLS is not available])
]
)
]
)
]
)
AS_IF([test "x${GNUTLS_FOUND}" != "xyes"],
[
AX_CHECK_OPENSSL(
[
AC_DEFINE([HAVE_OPENSSL], [1], [Use OpenSSL])
NICE_PACKAGES_PRIVATE="$NICE_PACKAGES_PRIVATE libcrypto"
AC_MSG_NOTICE([OpenSSL selected])
],
[
AC_MSG_ERROR([Neither GnuTLS or OpenSSL is available])
]
)
],
[
AC_MSG_NOTICE([GnuTLS selected])
]
)
AC_SUBST([NICE_PACKAGES_PUBLIC])
AC_SUBST([NICE_PACKAGES_PRIVATE])
AC_ARG_WITH(gstreamer,
AS_HELP_STRING([--with-gstreamer],[build GStreamer plugin]),
[with_gstreamer=${withval}],
[with_gstreamer=auto])
AC_ARG_WITH(gstreamer-0.10,
AS_HELP_STRING([--with-gstreamer-0.10],[build GStreamer 0.10 plugin]),
[with_gstreamer010=${withval}],
[with_gstreamer010=auto])
AS_IF([test "$with_gstreamer" != no], [
PKG_CHECK_MODULES(GST, [
gstreamer-1.0 >= 0.11.91
gstreamer-base-1.0 >= 0.11.91
],
[
with_gstreamer=yes
GST_MAJORMINOR=1.0
gstplugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
],
[
AS_IF([test "$with_gstreamer" = yes], [
AC_MSG_ERROR([GStreamer 1.0 support was requested but GStreamer 1.0 libraries are not available])
])
with_gstreamer=no
])
PKG_CHECK_MODULES(GST_CHECK, [
gstreamer-check-1.0 >= 0.11.91
],
[
have_gst_check=yes
],
[
have_gst_check=no
])
])