Commit 9837f974 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Frediano Ziglio

Drop autotools

Maintaining 1 build system is hard. Maintaining 2 is even harder.

It seems the meson build system is now in good shape to replace
autotools. Like many desktop projects, let's move entirely to meson
and drop autotools support.

Known changes:
- generating changelog files in the dist tarball. This is not strictly
  required, and can be added back later.
- generated files are not included in the dist tarball. In some ways,
  this can be considered a good thing.
Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso's avatarVictor Toso <victortoso@redhat.com>
parent 0c761fe1
image: fedora:latest
variables:
DEPS_COMMON: git libtool make python3 python3-six redhat-rpm-config
DEPS_COMMON: git make python3 python3-six redhat-rpm-config
python3-pyparsing meson ninja-build gtk-doc glib2-devel
gettext gettext-devel
gettext gettext-devel gcc
DEPS_FEDORA: zlib-devel openssl-devel intltool gtk3-devel
gobject-introspection-devel cyrus-sasl-devel
......@@ -18,56 +18,7 @@ variables:
mingw64-gtk3 mingw64-json-glib mingw64-opus
mingw64-gstreamer1-plugins-base mingw64-gstreamer1-plugins-good
fedora-autotools:
artifacts:
paths:
- tests/*.log
when: always
expire_in: 1 week
before_script:
- dnf install -y $DEPS_COMMON $DEPS_FEDORA
- git clone ${CI_REPOSITORY_URL/spice-gtk/spice-protocol}
- (cd spice-protocol && ./autogen.sh --prefix=/usr && make install)
script:
- git clean -xfd
- git submodule foreach --recursive git clean -xfd
# Run with default options + out-of-tree
- mkdir build
- cd build
- ../autogen.sh --enable-static
- make -j4
- make check
- cd ..
# Run dist, check we don't have -dirty in the build
- git clean -xfd
- git submodule foreach --recursive git clean -xfd
- git reset --hard HEAD
- ./autogen.sh --disable-dependency-tracking --enable-celt051
- make gitignore
- (cd subprojects/spice-common && make gitignore)
- ./autogen.sh --disable-dependency-tracking --enable-celt051
- if grep -q 'VERSION=.*-dirty' configure; then echo 'Version is dirty!'; false; fi
- make -j4
- make dist
- test -e spice-gtk-*.tar.bz2
- test \! -e spice-gtk-*-dirty.tar.bz2
# Run without features
- git clean -xfd
- git submodule foreach --recursive git clean -xfd
- ./autogen.sh --enable-static
--enable-lz4=no
--enable-webdav=no
--with-sasl=no
--with-coroutine=auto
--enable-pulse=no
--enable-smartcard=no
--enable-usbredir=no
- make -j4
- make check
fedora-meson:
fedora:
artifacts:
paths:
- build-*/meson-logs/*.txt
......@@ -95,18 +46,7 @@ fedora-meson:
- ninja -C build-feat-disabled
- ninja -C build-feat-disabled test
windows-autotools:
before_script:
- dnf install -y $DEPS_COMMON $DEPS_MINGW
- git clone ${CI_REPOSITORY_URL/spice-gtk/spice-protocol}
- (cd spice-protocol && autoreconf -if && mingw64-configure --prefix=/usr && make install)
script:
- NOCONFIGURE=yes ./autogen.sh
- PYTHON=python3 mingw64-configure --enable-static
- make -j4
windows-meson:
windows:
artifacts:
paths:
- build-win64/meson-logs/*.txt
......
ACLOCAL_AMFLAGS = -I m4
NULL =
SUBDIRS = subprojects/spice-common src man po doc data tools tests
if HAVE_INTROSPECTION
if WITH_VALA
SUBDIRS += vapi
endif
endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
spice-client-glib-2.0.pc \
$(NULL)
if WITH_GTK
pkgconfig_DATA += spice-client-gtk-3.0.pc
endif
DISTCLEANFILES = $(pkgconfig_DATA)
EXTRA_DIST = \
README.md \
CHANGELOG.md \
meson.build \
meson_options.txt \
po/meson.build \
build-aux/git-version-gen \
build-aux/meson-dist \
gtk-doc.make \
.version \
$(NULL)
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \
$(GITIGNORE_MAINTAINERCLEANFILES_M4_GETTEXT) \
m4/gtk-doc.m4 \
gtk-doc.make \
$(NULL)
# see git-version-gen
dist-hook: gen-THANKS
echo $(VERSION) > $(distdir)/.tarball-version
BUILT_SOURCES = $(top_srcdir)/.version
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
DISTCHECK_CONFIGURE_FLAGS = \
--enable-introspection \
--disable-celt051 \
--disable-vala \
--disable-usbredir \
--enable-gtk-doc \
--enable-werror \
--with-gtk=3.0 \
$(NULL)
# Generate the THANKS file
# and insert it into the directory we're about to use to create a tarball.
.PHONY: gen-THANKS
gen-THANKS:
$(AM_V_GEN)if test -d .git || test -d ../.git; then \
echo "The spice-gtk team would like to thank the following contributors:" > $(distdir)/t-t; \
echo >> $(distdir)/t-t; \
git log --format='%aN <%aE>' | sort -u >> $(distdir)/t-t; \
rm -f $(distdir)/THANKS; \
mv $(distdir)/t-t $(distdir)/THANKS; \
fi
-include $(top_srcdir)/git.mk
......@@ -52,8 +52,9 @@ Build dependencies:
* or install:
>>>
gtk3-devel spice-protocol openssl-devel pulseaudio-libs-devel pixman-devel
meson ninja gtk3-devel spice-protocol openssl-devel pulseaudio-libs-devel pixman-devel
gobject-introspection-devel libjpeg-turbo-devel zlib-devel cyrus-sasl-devel gtk-doc
gettext-devel vala vala-tools python3 python3-pyparsing
>>>
The GStreamer backend needs:
......@@ -61,11 +62,3 @@ The GStreamer backend needs:
>>>
gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-plugins-good gstreamer1-plugins-bad-free
>>>
* If you build from git, you'll also need:
>>>
libtool automake gettext-devel vala vala-tools
python3 python3-pyparsing
# or python2 python2-pyparsing
>>>
#!/bin/sh
set -e # exit on errors
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
(
cd "$srcdir"
git submodule update --init --recursive
gtkdocize
autoreconf -v --force --install
)
CONFIGURE_ARGS="--enable-maintainer-mode --enable-gtk-doc --with-gtk=3.0 --enable-vala --enable-python-checks --disable-celt051"
if [ -z "$NOCONFIGURE" ]; then
echo "Running configure with $CONFIGURE_ARGS $@"
"$srcdir/configure" $CONFIGURE_ARGS "$@"
fi
This diff is collapsed.
NULL=
EXTRA_DIST = \
meson.build \
org.spice-space.lowlevelusbaccess.policy \
$(NULL)
policydir = $(POLICYDIR)
policy_DATA = org.spice-space.lowlevelusbaccess.policy
-include $(top_srcdir)/git.mk
SUBDIRS = reference
EXTRA_DIST = meson.build
-include $(top_srcdir)/git.mk
NULL =
AUTOMAKE_OPTIONS = 1.6
DOC_MODULE = spice-gtk
# The top-level SGML file
DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.xml
# Source code location
DOC_SOURCE_DIR = $(top_srcdir)/src
# Extra options to supply to gtkdoc-scan.
SCAN_OPTIONS = \
--deprecated-guards="SPICE_DISABLE_DEPRECATED" \
--ignore-decorators="G_GNUC_INTERNAL"
# Extra options to supply to gtkdoc-mkdb.
MKDB_OPTIONS = --xml-mode --output-format=xml
# Used for dependencies. The docs will be rebuilt if any of these change.
HFILE_GLOB = $(top_srcdir)/src/*.h
CFILE_GLOB = $(top_srcdir)/src/*.c
# Header files to ignore when scanning. Use base file name, no paths
IGNORE_HFILES= \
bio-gio.h \
channel-display-priv.h \
channel-usbredir-priv.h \
client_sw_canvas.h \
continuation.h \
coroutine.h \
decode.h \
desktop-integration.h \
display \
gio-coroutine.h \
giopipe.h \
smartcard-manager-priv.h \
spice-audio-priv.h \
spice-channel-cache.h \
spice-channel-priv.h \
spice-cmdline.h \
spice-common.h \
spice-file-transfer-task-priv.h \
spice-grabsequence-priv.h \
spice-gstaudio.h \
spice-gtk-session-priv.h \
spice-marshal.h \
spice-pulse.h \
spice-session-priv.h \
spice-uri-priv.h \
spice-util-priv.h \
spice-widget-priv.h \
spicy-connect.h \
usb-acl-helper.h \
usb-device-manager-priv.h \
usbdk_api.h \
usbutil.h \
vmcstream.h \
vncdisplaykeymap.h \
win-usb-dev.h \
$(NULL)
# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
GTKDOC_CFLAGS = -I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src $(SPICE_GLIB_CFLAGS) $(SPICE_GTK_CFLAGS) $(COMMON_CFLAGS) -DSPICE_COMPILATION
GTKDOC_LIBS = $(top_builddir)/src/libspice-client-glib-2.0.la $(top_builddir)/src/libspice-client-gtk-3.0.la $(GTK_LIBS)
include $(top_srcdir)/gtk-doc.make
EXTRA_DIST += meson.build
# 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
This diff is collapsed.
dnl Check whether the linker supports --version-script.
dnl
dnl Probes whether the linker supports --version-script with a simple version
dnl script that only defines a single version. Sets the Automake conditional
dnl HAVE_LD_VERSION_SCRIPT based on whether it is supported.
dnl
dnl Written by Russ Allbery <rra@stanford.edu>
dnl Based on the gnulib ld-version-script macro from Simon Josefsson
dnl Copyright 2010 Board of Trustees, Leland Stanford Jr. University
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation gives unlimited
dnl permission to copy and/or distribute it, with or without modifications, as
dnl long as this notice is preserved.
AC_DEFUN([RRA_LD_VERSION_SCRIPT],
[AC_CACHE_CHECK([if -Wl,--version-script works], [rra_cv_ld_version_script],
[save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
cat > conftest.map <<EOF
VERSION_1 {
global:
sym;
local:
*;
};
EOF
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[rra_cv_ld_version_script=yes], [rra_cv_ld_version_script=no])
rm -f conftest.map
LDFLAGS="$save_LDFLAGS"])
AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT],
[test x"$rra_cv_ld_version_script" = xyes])])
# manywarnings.m4 serial 8
dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Simon Josefsson
# gl_MANYWARN_COMPLEMENT(OUTVAR, LISTVAR, REMOVEVAR)
# --------------------------------------------------
# Copy LISTVAR to OUTVAR except for the entries in REMOVEVAR.
# Elements separated by whitespace. In set logic terms, the function
# does OUTVAR = LISTVAR \ REMOVEVAR.
AC_DEFUN([gl_MANYWARN_COMPLEMENT],
[
gl_warn_set=
set x $2; shift
for gl_warn_item
do
case " $3 " in
*" $gl_warn_item "*)
;;
*)
gl_warn_set="$gl_warn_set $gl_warn_item"
;;
esac
done
$1=$gl_warn_set
])
# gl_MANYWARN_ALL_GCC(VARIABLE)
# -----------------------------
# Add all documented GCC warning parameters to variable VARIABLE.
# Note that you need to test them using gl_WARN_ADD if you want to
# make sure your gcc understands it.
AC_DEFUN([gl_MANYWARN_ALL_GCC],
[
dnl First, check for some issues that only occur when combining multiple
dnl gcc warning categories.
AC_REQUIRE([AC_PROG_CC])
if test -n "$GCC"; then
dnl Check if -W -Werror -Wno-missing-field-initializers is supported
dnl with the current $CC $CFLAGS $CPPFLAGS.
AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_cc_nomfi_supported=yes],
[gl_cv_cc_nomfi_supported=no])
CFLAGS="$gl_save_CFLAGS"])
AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
if test "$gl_cv_cc_nomfi_supported" = yes; then
dnl Now check whether -Wno-missing-field-initializers is needed
dnl for the { 0, } construct.
AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -W -Werror"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[void f (void)
{
typedef struct { int a; int b; } s_t;
s_t s1 = { 0, };
}
]],
[[]])],
[gl_cv_cc_nomfi_needed=no],
[gl_cv_cc_nomfi_needed=yes])
CFLAGS="$gl_save_CFLAGS"
])
AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
fi
dnl Next, check if -Werror -Wuninitialized is useful with the
dnl user's choice of $CFLAGS; some versions of gcc warn that it
dnl has no effect if -O is not also used
AC_MSG_CHECKING([whether -Wuninitialized is supported])
AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [
gl_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror -Wuninitialized"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[gl_cv_cc_uninitialized_supported=yes],
[gl_cv_cc_uninitialized_supported=no])
CFLAGS="$gl_save_CFLAGS"])
AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
fi
# List all gcc warning categories.
# To compare this list to your installed GCC's, run this Bash command:
#
# comm -3 \
# <(sed -n 's/^ *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
# <(gcc --help=warnings | sed -n 's/^ \(-[^ ]*\) .*/\1/p' | sort |
# grep -v -x -f <(
# awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
gl_manywarn_set=
for gl_manywarn_item in \
-W \
-Wabi \
-Waddress \
-Waggressive-loop-optimizations \
-Wall \
-Wattributes \
-Wbad-function-cast \
-Wbool-compare \
-Wbuiltin-macro-redefined \
-Wcast-align \
-Wchar-subscripts \
-Wclobbered \
-Wcomment \
-Wcomments \
-Wcoverage-mismatch \
-Wcpp \
-Wdate-time \
-Wdeprecated \
-Wdeprecated-declarations \
-Wdesignated-init \
-Wdisabled-optimization \
-Wdiscarded-array-qualifiers \
-Wdiscarded-qualifiers \
-Wdiv-by-zero \
-Wdouble-promotion \
-Wduplicated-cond \
-Wempty-body \
-Wendif-labels \
-Wenum-compare \
-Wextra \
-Wformat-contains-nul \
-Wformat-extra-args \
-Wformat-nonliteral \
-Wformat-security \
-Wformat-signedness \
-Wformat-y2k \
-Wformat-zero-length \
-Wframe-address \
-Wfree-nonheap-object \
-Whsa \
-Wignored-attributes \
-Wignored-qualifiers \
-Wimplicit \
-Wimplicit-function-declaration \
-Wimplicit-int \
-Wincompatible-pointer-types \
-Winit-self \
-Winline \
-Wint-conversion \
-Wint-to-pointer-cast \
-Winvalid-memory-model \
-Winvalid-pch \
-Wjump-misses-init \
-Wlogical-not-parentheses \
-Wlogical-op \
-Wmain \
-Wmaybe-uninitialized \
-Wmemset-transposed-args \
-Wmisleading-indentation \
-Wmissing-braces \
-Wmissing-declarations \
-Wmissing-field-initializers \
-Wmissing-include-dirs \
-Wmissing-parameter-type \
-Wmissing-prototypes \
-Wmultichar \
-Wnarrowing \
-Wnested-externs \
-Wnonnull \
-Wnonnull-compare \
-Wnull-dereference \
-Wodr \
-Wold-style-declaration \
-Wold-style-definition \
-Wopenmp-simd \
-Woverflow \
-Woverlength-strings \
-Woverride-init \
-Wpacked \
-Wpacked-bitfield-compat \
-Wparentheses \
-Wpointer-arith \
-Wpointer-sign \
-Wpointer-to-int-cast \
-Wpragmas \
-Wreturn-local-addr \
-Wreturn-type \
-Wscalar-storage-order \
-Wsequence-point \
-Wshadow \
-Wshift-count-negative \
-Wshift-count-overflow \
-Wshift-negative-value \
-Wsizeof-array-argument \
-Wsizeof-pointer-memaccess \
-Wstack-protector \
-Wstrict-aliasing \
-Wstrict-overflow \
-Wstrict-prototypes \
-Wsuggest-attribute=const \
-Wsuggest-attribute=format \
-Wsuggest-attribute=noreturn \
-Wsuggest-attribute=pure \
-Wsuggest-final-methods \
-Wsuggest-final-types \
-Wswitch \
-Wswitch-bool \
-Wswitch-default \
-Wsync-nand \
-Wsystem-headers \
-Wtautological-compare \
-Wtrampolines \
-Wtrigraphs \
-Wtype-limits \
-Wuninitialized \
-Wunknown-pragmas \
-Wunsafe-loop-optimizations \
-Wunused \
-Wunused-but-set-parameter \
-Wunused-but-set-variable \
-Wunused-function \
-Wunused-label \
-Wunused-local-typedefs \
-Wunused-macros \
-Wunused-parameter \
-Wunused-result \
-Wunused-value \
-Wunused-variable \
-Wvarargs \
-Wvariadic-macros \
-Wvector-operation-performance \
-Wvla \
-Wvolatile-register-var \
-Wwrite-strings \
\
; do
gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
done
# gcc --help=warnings outputs an unusual form for these options; list
# them here so that the above 'comm' command doesn't report a false match.
gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
# These are needed for older GCC versions.
if test -n "$GCC"; then
case `($CC --version) 2>/dev/null` in
'gcc (GCC) '[[0-3]].* | \
'gcc (GCC) '4.[[0-7]].*)
gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
;;
esac
fi
# Disable specific options as needed.
if test "$gl_cv_cc_nomfi_needed" = yes; then
gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
fi
if test "$gl_cv_cc_uninitialized_supported" = no; then
gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
fi
$1=$gl_manywarn_set
])
# SPICE_COMPILE_WARNINGS(DONTWARN)
# --------------------------------------------------------
# Enable all known GCC compiler warnings, except for those
# we can't yet cope with
#
AC_DEFUN([SPICE_COMPILE_WARNINGS],[
dnl ******************************
dnl More compiler warnings
dnl ******************************
AC_ARG_ENABLE([werror],
AS_HELP_STRING([--enable-werror], [Use -Werror (if supported)]),
[set_werror="$enableval"],
[if test -d $srcdir/.git; then
is_git_version=true
set_werror=yes
else
set_werror=no
fi])
# List of warnings that are not relevant / wanted
dontwarn=$1
# Don't care about C++ compiler compat
dontwarn="$dontwarn -Wc++-compat"
dontwarn="$dontwarn -Wabi"
dontwarn="$dontwarn -Wdeprecated"
# Don't care about ancient C standard compat
dontwarn="$dontwarn -Wtraditional"
# Don't care about ancient C standard compat
dontwarn="$dontwarn -Wtraditional-conversion"
# Ignore warnings in /usr/include
dontwarn="$dontwarn -Wsystem-headers"
# Happy for compiler to add struct padding
dontwarn="$dontwarn -Wpadded"
# GCC very confused with -O2
dontwarn="$dontwarn -Wunreachable-code"
dontwarn="$dontwarn -Wconversion"
dontwarn="$dontwarn -Wsign-conversion"
dontwarn="$dontwarn -Wvla"
dontwarn="$dontwarn -Wundef"
dontwarn="$dontwarn -Wcast-qual"
dontwarn="$dontwarn -Wlong-long"
dontwarn="$dontwarn -Wswitch-default"
dontwarn="$dontwarn -Wswitch-enum"
dontwarn="$dontwarn -Wstrict-overflow"
dontwarn="$dontwarn -Wunsafe-loop-optimizations"
dontwarn="$dontwarn -Wformat-nonliteral"
dontwarn="$dontwarn -Wfloat-equal"
dontwarn="$dontwarn -Wdeclaration-after-statement"
dontwarn="$dontwarn -Wpacked"
dontwarn="$dontwarn -Wunused-macros"
dontwarn="$dontwarn -Woverlength-strings"
dontwarn="$dontwarn -Wstack-protector"
dontwarn="$dontwarn -Winline"
dontwarn="$dontwarn -Wbad-function-cast"
dontwarn="$dontwarn -Wshadow"
# Get all possible GCC warnings
gl_MANYWARN_ALL_GCC([maybewarn])
# Remove the ones we don't want, blacklisted earlier
gl_MANYWARN_COMPLEMENT([wantwarn], [$maybewarn], [$dontwarn])
# Check for $CC support of each warning
for w in $wantwarn; do
gl_WARN_ADD([$w])
done
# GNULIB uses '-W' (aka -Wextra) which includes a bunch of stuff.
# Unfortunately, this means you can't simply use '-Wsign-compare'
# with gl_MANYWARN_COMPLEMENT
# So we have -W enabled, and then have to explicitly turn off...
gl_WARN_ADD([-Wno-sign-compare])
gl_WARN_ADD([-Wno-unused-parameter])
gl_WARN_ADD([-Wno-missing-field-initializers])
# We can't enable this due to horrible spice_usb_device_get_description
# signature
gl_WARN_ADD([-Wno-format-nonliteral])
# We use some deprecated functions to avoid #ifdef hell while maintaining
# compat with older gtk / glib versions
gl_WARN_ADD([-Wno-error=deprecated-declarations])
# g_source_set_callback() can't be compatible with this warning. Its API
# doc states:
# "The exact type of func depends on the type of source; ie. you should
# not count on func being called with data as its first parameter."
gl_WARN_ADD([-Wno-cast-function-type])
# GNULIB expects this to be part of -Wc++-compat, but we turn
# that one off, so we need to manually enable this again
gl_WARN_ADD([-Wjump-misses-init])
# This should be < 1024 really. pixman_utils is the blackspot
# preventing lower usage
gl_WARN_ADD([-Wframe-larger-than=9216])
# Use improved glibc headers
AH_VERBATIM([FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings. */
#if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
])
# Extra special flags
dnl -fstack-protector stuff passes gl_WARN_ADD with gcc
dnl on Mingw32, but fails when actually used
case $host in
*-*-linux*)
dnl Fedora only uses -fstack-protector, but doesn't seem to
dnl be great overhead in adding -fstack-protector-all instead
dnl gl_WARN_ADD([-fstack-protector])
gl_WARN_ADD([-fstack-protector-all])
gl_WARN_ADD([--param=ssp-buffer-size=4])
;;
esac
gl_WARN_ADD([-fexceptions])
gl_WARN_ADD([-fasynchronous-unwind-tables])
gl_WARN_ADD([-fdiagnostics-show-option])
gl_WARN_ADD([-funit-at-a-time])
# Need -fipa-pure-const in order to make -Wsuggest-attribute=pure
# fire even without -O.
gl_WARN_ADD([-fipa-pure-const])
# We should eventually enable this, but right now there are at
# least 75 functions triggering warnings.
gl_WARN_ADD([-Wno-suggest-attribute=pure])
gl_WARN_ADD([-Wno-suggest-attribute=const])
if test "$set_werror" = "yes"
then
gl_WARN_ADD([-Werror])
fi
WARN_LDFLAGS=$WARN_CFLAGS
AC_SUBST([WARN_CFLAGS])
AC_SUBST([WARN_LDFLAGS])
gl_WARN_ADD([-Wno-write-strings])
WARN_PYFLAGS=$WARN_CFLAGS
AC_SUBST([WARN_PYFLAGS])
])
# warnings.m4 serial 11
dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Simon Josefsson
# gl_AS_VAR_APPEND(VAR, VALUE)