From 06394ce4d22a247664ae164236f439f18f958a9b Mon Sep 17 00:00:00 2001 From: Maximiliano Curia Date: Fri, 22 Jul 2016 15:05:09 +0200 Subject: [PATCH] Migrate away from gnome-common deprecated vars and macros gnome-common is deprecating some vars and macros, listed here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829932 This change follows the gnome recommendations from: https://wiki.gnome.org/Projects/GnomeCommon/Migration --- Makefile.am | 2 - autogen.sh | 48 +++++++++++++------- configure.ac | 71 +++++------------------------- doc/reference/Makefile.am | 2 +- src/Makefile.am | 9 ++-- src/compositor/plugins/Makefile.am | 6 +-- src/tools/Makefile.am | 2 +- src/wm-tester/Makefile.am | 2 +- 8 files changed, 54 insertions(+), 88 deletions(-) diff --git a/Makefile.am b/Makefile.am index e42ae9c75..a5e2fb9e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,6 @@ SUBDIRS=src po doc data -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} - EXTRA_DIST = HACKING MAINTAINERS rationales.txt DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc diff --git a/autogen.sh b/autogen.sh index 441ec1d52..51988b536 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,22 +1,40 @@ -#!/bin/bash +#!/bin/sh # Run this to generate all the initial makefiles, etc. +test -n "$srcdir" || srcdir=$(dirname "$0") +test -n "$srcdir" || srcdir=. -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. +olddir=$(pwd) -PKG_NAME="muffin" -REQUIRED_AUTOMAKE_VERSION=1.10 +cd $srcdir -(test -f $srcdir/configure.ac \ - && test -d $srcdir/src) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level muffin directory" +(test -f configure.ac) || { + echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***" exit 1 } -which gnome-autogen.sh || { - echo "You need to install gnome-common from GNOME Subversion (or from" - echo "your distribution's package manager)." - exit 1 -} -USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh +# 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 +glib-gettextize --force --copy || exit 1 +gtkdocize --copy || exit 1 +intltoolize --force --copy --automake || 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 index 84e74a13d..a15debc09 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,7 @@ m4_define([muffin_plugin_api_version], [3]) AC_INIT([muffin], [muffin_version], [https://github.com/linuxmint/muffin/issues]) +AX_IS_RELEASE([git-directory]) AC_CONFIG_SRCDIR(src/core/display.c) AC_CONFIG_HEADERS(config.h) @@ -33,7 +34,7 @@ MUFFIN_PLUGIN_DIR="$libdir/$PACKAGE/plugins" AC_SUBST(MUFFIN_PLUGIN_DIR) # Honor aclocal flags -AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}") +AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"]) GETTEXT_PACKAGE=muffin AC_SUBST(GETTEXT_PACKAGE) @@ -96,6 +97,7 @@ AC_ARG_ENABLE(verbose-mode, AC_HELP_STRING([--disable-verbose-mode], [disable muffin's ability to do verbose logging, for embedded/size-sensitive custom builds]),, enable_verbose_mode=yes) +dnl ' if test x$enable_verbose_mode = xyes; then AC_DEFINE(WITH_VERBOSE_MODE,1,[Build with verbose mode support]) @@ -110,11 +112,14 @@ AC_ARG_ENABLE(sm, AC_HELP_STRING([--disable-sm], [disable muffin's session management support, for embedded/size-sensitive custom non-GNOME builds]),, enable_sm=auto) +dnl ' + AC_ARG_ENABLE(startup-notification, AC_HELP_STRING([--disable-startup-notification], [disable muffin's startup notification support, for embedded/size-sensitive custom non-GNOME builds]),, enable_startup_notification=auto) +dnl ' AC_ARG_WITH(libcanberra, AC_HELP_STRING([--without-libcanberra], @@ -125,11 +130,13 @@ AC_ARG_ENABLE(xsync, AC_HELP_STRING([--disable-xsync], [disable muffin's use of the XSync extension]),, enable_xsync=auto) +dnl ' AC_ARG_ENABLE(shape, AC_HELP_STRING([--disable-shape], [disable muffin's use of the shaped window extension]),, enable_shape=auto) +dnl ' ## try definining HAVE_BACKTRACE AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)]) @@ -240,6 +247,7 @@ AC_ARG_ENABLE(xinerama, AC_HELP_STRING([--disable-xinerama], [disable muffin's use of the Xinerama extension]), try_xinerama=$enable_xinerama,try_xinerama=yes) +dnl ' use_solaris_xinerama=no use_xfree_xinerama=no @@ -423,66 +431,7 @@ AC_CHECK_DECL([GL_EXT_x11_sync_object], [AC_MSG_ERROR([GL_EXT_x11_sync_object definition not found, please update your GL headers])], [#include ]) -#### Warnings (last since -Werror can disturb other tests) - -# Stay command-line compatible with the gnome-common configure option. Here -# minimum/yes/maximum are the same, however. -AC_ARG_ENABLE(compile_warnings, - AS_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],[Turn on compiler warnings]),, - enable_compile_warnings=yes) - -changequote(,)dnl -if test "$enable_compile_warnings" != no ; then - if test "x$GCC" = "xyes"; then - case " $CFLAGS " in - *[\ \ ]-Wall[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wall" ;; - esac - -# case " $CFLAGS " in -# *[\ \ ]-Wshadow[\ \ ]*) ;; -# *) CFLAGS="$CFLAGS -Wshadow" ;; -# esac - - case " $CFLAGS " in - *[\ \ ]-Wchar-subscripts[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wchar-subscripts" ;; - esac - - case " $CFLAGS " in - *[\ \ ]-Wmissing-declarations[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wmissing-declarations" ;; - esac - - case " $CFLAGS " in - *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;; - esac - - case " $CFLAGS " in - *[\ \ ]-Wnested-externs[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wnested-externs" ;; - esac - - case " $CFLAGS " in - *[\ \ ]-Wpointer-arith[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wpointer-arith" ;; - esac - - case " $CFLAGS " in - *[\ \ ]-Wsign-compare[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wsign-compare" ;; - esac - - if test "$enable_compile_warnings" = error; then - case " $CFLAGS " in - *[\ \ ]-Werror[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Werror -Wno-error=deprecated-declarations" ;; - esac - fi - fi -fi -changequote([,])dnl +AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS]) AC_CONFIG_FILES([ Makefile diff --git a/doc/reference/Makefile.am b/doc/reference/Makefile.am index 5f7713084..3cbc05e49 100644 --- a/doc/reference/Makefile.am +++ b/doc/reference/Makefile.am @@ -138,7 +138,7 @@ expand_content_files= \ # 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=$(MUFFIN_CFLAGS) +GTKDOC_CFLAGS=$(WARN_CFLAGS) $(MUFFIN_CFLAGS) GTKDOC_LIBS=$(MUFFIN_LIBS) $(top_builddir)/src/libmuffin.la # This includes the standard gtk-doc make rules, copied by gtkdocize. diff --git a/src/Makefile.am b/src/Makefile.am index 55da40d9e..fa589223a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -8,6 +8,7 @@ SUBDIRS=wm-tester tools compositor/plugins AM_CPPFLAGS= \ -DCLUTTER_ENABLE_EXPERIMENTAL_API \ -DCOGL_ENABLE_EXPERIMENTAL_API \ + $(WARN_CFLAGS) \ $(MUFFIN_CFLAGS) \ -I$(srcdir) \ -I$(srcdir)/core \ @@ -151,7 +152,7 @@ libmuffin_la_SOURCES = \ ui/preview-widget.c \ $(muffin_built_sources) -libmuffin_la_LDFLAGS = -no-undefined +libmuffin_la_LDFLAGS = $(WARN_LDFLAGS) -no-undefined libmuffin_la_LIBADD = $(MUFFIN_LIBS) -lclutter-glx-1.0 # Headers installed for plugins; introspected information will @@ -233,7 +234,7 @@ Meta-$(api_version).gir: libmuffin.la muffin-enum-types.h \ $(libmuffininclude_base_headers) \ $(filter %.c,$(libmuffin_la_SOURCES)) -@META_GIR@_SCANNERFLAGS = --warn-all --warn-error +@META_GIR@_SCANNERFLAGS = $(WARN_SCANNERFLAGS) --warn-all --warn-error endif @@ -245,8 +246,8 @@ testasyncgetprop_SOURCES = core/testasyncgetprop.c core/async-getprop.c # NO-OP: work around the fact that source code tested by the programs are # compiled for library -testasyncgetprop_CFLAGS = $(AM_CFLAGS) -testboxes_CFLAGS = $(AM_CFLAGS) +testasyncgetprop_CFLAGS = $(WARN_CFLAGS) $(AM_CFLAGS) +testboxes_CFLAGS = $(WARN_CFLAGS) $(AM_CFLAGS) noinst_PROGRAMS=testboxes testgradient testasyncgetprop diff --git a/src/compositor/plugins/Makefile.am b/src/compositor/plugins/Makefile.am index 5941c7b57..056ab2ef8 100644 --- a/src/compositor/plugins/Makefile.am +++ b/src/compositor/plugins/Makefile.am @@ -1,11 +1,11 @@ pkglibdir=@MUFFIN_PLUGIN_DIR@ -AM_CPPFLAGS=@MUFFIN_CFLAGS@ -I $(top_srcdir)/src -DMUFFIN_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUFFIN_PKGDATADIR=\"$(pkgdatadir)\" -DMUFFIN_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"muffin\" -DSN_API_NOT_YET_FROZEN=1 -DMUFFIN_MAJOR_VERSION=$(MUFFIN_MAJOR_VERSION) -DMUFFIN_MINOR_VERSION=$(MUFFIN_MINOR_VERSION) -DMUFFIN_MICRO_VERSION=$(MUFFIN_MICRO_VERSION) -DMUFFIN_PLUGIN_API_VERSION=$(MUFFIN_PLUGIN_API_VERSION) -DMUFFIN_PLUGIN_DIR=\"@MUFFIN_PLUGIN_DIR@\" +AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_CFLAGS@ -I $(top_srcdir)/src -DMUFFIN_LIBEXECDIR=\"$(libexecdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMUFFIN_PKGDATADIR=\"$(pkgdatadir)\" -DMUFFIN_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"muffin\" -DSN_API_NOT_YET_FROZEN=1 -DMUFFIN_MAJOR_VERSION=$(MUFFIN_MAJOR_VERSION) -DMUFFIN_MINOR_VERSION=$(MUFFIN_MINOR_VERSION) -DMUFFIN_MICRO_VERSION=$(MUFFIN_MICRO_VERSION) -DMUFFIN_PLUGIN_API_VERSION=$(MUFFIN_PLUGIN_API_VERSION) -DMUFFIN_PLUGIN_DIR=\"@MUFFIN_PLUGIN_DIR@\" -default_la_CFLAGS = -fPIC +default_la_CFLAGS = $(WARN_CFLAGS) -fPIC default_la_SOURCES = default.c -default_la_LDFLAGS = -module -avoid-version -no-undefined +default_la_LDFLAGS = $(WARN_LDFLAGS) -module -avoid-version -no-undefined default_la_LIBADD = @CLUTTER_LIBS@ pkglib_LTLIBRARIES = default.la diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index 3415542e9..d20971c88 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -3,7 +3,7 @@ icondir=$(pkgdatadir)/icons icon_DATA=muffin-window-demo.png -AM_CPPFLAGS=@MUFFIN_WINDOW_DEMO_CFLAGS@ @MUFFIN_MESSAGE_CFLAGS@ \ +AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_WINDOW_DEMO_CFLAGS@ @MUFFIN_MESSAGE_CFLAGS@ \ -I$(top_srcdir)/src \ -DMUFFIN_ICON_DIR=\"$(pkgdatadir)/icons\" \ -DMUFFIN_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" diff --git a/src/wm-tester/Makefile.am b/src/wm-tester/Makefile.am index fcf5e61ce..54d47247b 100644 --- a/src/wm-tester/Makefile.am +++ b/src/wm-tester/Makefile.am @@ -1,5 +1,5 @@ -AM_CPPFLAGS=@MUFFIN_CFLAGS@ +AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_CFLAGS@ wm_tester_SOURCES= \ main.c