diff --git a/autogen.sh b/autogen.sh index 36fdea1..6e80142 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,11 +1,42 @@ #!/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) -which gnome-autogen.sh || { - echo "You need to install gnome-common from GNOME Git (or from" - echo "your OS vendor's package manager)." +cd $srcdir + +(test -f configure.ac) || { + echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***" exit 1 } -. 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 + +mkdir -p m4 + +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 618dad0..212c67a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ AC_INIT(xapp, 1.0.2) AC_CONFIG_SRCDIR(libxapp) +m4_ifdef([AX_IS_RELEASE], [AX_IS_RELEASE([always])]) AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz tar-ustar]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -8,6 +9,7 @@ AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) +AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \${ACLOCAL_FLAGS}"]) # Before making a release, the LT_VERSION string should be modified. # The string is of the form C:R:A. @@ -28,10 +30,10 @@ AC_PROG_CC PKG_PROG_PKG_CONFIG +m4_ifdef([AX_COMPILER_FLAGS], + [AX_COMPILER_FLAGS([WARN_CFLAGS],[WARN_LDFLAGS])]) + GTK_DOC_CHECK([1.0],[--flavour=no-tmpl]) - -GNOME_COMPILE_WARNINGS([maximum]) -GNOME_MAINTAINER_MODE_DEFINES AC_ARG_ENABLE(deprecation_flags, [AC_HELP_STRING([--enable-deprecation-flags], diff --git a/libxapp/Makefile.am b/libxapp/Makefile.am index d7ef07e..aeafbad 100644 --- a/libxapp/Makefile.am +++ b/libxapp/Makefile.am @@ -5,8 +5,9 @@ AM_CPPFLAGS = \ -I$(top_srcdir) \ - $(XAPP_CFLAGS) \ - $(XLIB_CFLAGS) \ + $(XAPP_CFLAGS) \ + $(XLIB_CFLAGS) \ + $(WARN_CFLAGS) \ -DG_LOG_DOMAIN=\"XApp\" \ -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale\"" \ $(DISABLE_DEPRECATED_CFLAGS) @@ -26,6 +27,7 @@ -lrt libxapp_la_LDFLAGS = \ + $(WARN_LDFLAGS) \ -version-info $(LT_VERSION) \ -export-symbols-regex "^xapp_.*" \ -no-undefined @@ -49,10 +51,10 @@ XApp_1_0_gir_INCLUDES = GObject-2.0 Gtk-3.0 XApp_1_0_gir_PACKAGES = gdk-pixbuf-2.0 glib-2.0 gobject-2.0 gio-2.0 gtk+-3.0 XApp_1_0_gir_EXPORT_PACKAGES = xapp -XApp_1_0_gir_CFLAGS = -I$(top_srcdir) -DWITH_INTROSPECTION +XApp_1_0_gir_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir) -DWITH_INTROSPECTION XApp_1_0_gir_LIBS = libxapp.la XApp_1_0_gir_FILES = $(introspection_sources) $(libxapp_HEADERS) -XApp_1_0_gir_SCANNERFLAGS = --identifier-prefix=XApp --symbol-prefix=xapp_ +XApp_1_0_gir_SCANNERFLAGS = $(WARN_SCANNERFLAGS) --identifier-prefix=XApp --symbol-prefix=xapp_ INTROSPECTION_GIRS += XApp-1.0.gir girdir = $(datadir)/gir-1.0