Skip to content

Commit

Permalink
Merge pull request #251 from maxyz/gnome-common_macros_deprecation
Browse files Browse the repository at this point in the history
Migrate away from gnome-common deprecated vars and macros
  • Loading branch information
clefebvre committed Sep 12, 2016
2 parents d78829c + 06394ce commit e5a8ad9
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 88 deletions.
2 changes: 0 additions & 2 deletions 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
Expand Down
48 changes: 33 additions & 15 deletions 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
71 changes: 10 additions & 61 deletions configure.ac
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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])
Expand All @@ -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],
Expand All @@ -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)])
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <GL/glx.h>])

#### 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
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/Makefile.am
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions src/Makefile.am
Expand Up @@ -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 \
Expand Down Expand Up @@ -153,7 +154,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
Expand Down Expand Up @@ -235,7 +236,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

Expand All @@ -247,8 +248,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

Expand Down
6 changes: 3 additions & 3 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion src/tools/Makefile.am
Expand Up @@ -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\"
Expand Down
2 changes: 1 addition & 1 deletion src/wm-tester/Makefile.am
@@ -1,5 +1,5 @@

AM_CPPFLAGS=@MUFFIN_CFLAGS@
AM_CPPFLAGS=$(WARN_CFLAGS) @MUFFIN_CFLAGS@

wm_tester_SOURCES= \
main.c
Expand Down

0 comments on commit e5a8ad9

Please sign in to comment.