[gnome-builder] library-template: Update autogen.sh to use latest GNOME recommendation



commit e404e91a147474e4a6f2292520b02a6b5636f5ed
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Sun Jan 31 10:49:51 2016 +0100

    library-template: Update autogen.sh to use latest GNOME recommendation
    
    Port the template autogen.sh to use the latest recommendation from
    https://wiki.gnome.org/Projects/GnomeCommon/Migration#autogen.sh.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761356

 .../library_template/shared-library/autogen.sh     |   42 +++++++++++--------
 .../library_template/shared-library/configure.ac   |    2 +-
 2 files changed, 25 insertions(+), 19 deletions(-)
---
diff --git a/plugins/library-template/library_template/shared-library/autogen.sh 
b/plugins/library-template/library_template/shared-library/autogen.sh
index 1b15457..44134b3 100644
--- a/plugins/library-template/library_template/shared-library/autogen.sh
+++ b/plugins/library-template/library_template/shared-library/autogen.sh
@@ -1,21 +1,28 @@
 #!/bin/sh
-
 # Run this to generate all the initial makefiles, etc.
+test -n "$srcdir" || srcdir=$(dirname "$0")
+test -n "$srcdir" || srcdir=.
+
+olddir=$(pwd)
 
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
+cd $srcdir
 
-(test -f $srcdir/configure.ac) || {
-    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
-    echo " top-level {{name}} directory"
-    exit 1
+(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)
 
-touch ChangeLog
-touch INSTALL
+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 -I m4 || exit 1
+aclocal --install || exit 1
 {{if enable_i18n}}
 glib-gettextize --force --copy || exit 1
 intltoolize --force --copy --automake || exit 1
@@ -23,16 +30,15 @@ intltoolize --force --copy --automake || exit 1
 {{if enable_gtk_doc}}
 gtkdocize || exit 1
 {{end}}
-autoreconf --force --install -Wno-portability || exit 1
+autoreconf --verbose --force --install || exit 1
 
+cd "$olddir"
 if [ "$NOCONFIGURE" = "" ]; then
-        $srcdir/configure "$@" || exit 1
+       $srcdir/configure "$@" || exit 1
 
-        if [ "$1" = "--help" ]; then exit 0 else
-                echo "Now type \`make\' to compile" || exit 1
-        fi
+       if [ "$1" = "--help" ]; then exit 0 else
+               echo "Now type 'make' to compile $PKG_NAME" || exit 1
+       fi
 else
-        echo "Skipping configure process."
+       echo "Skipping configure process."
 fi
-
-set +x
diff --git a/plugins/library-template/library_template/shared-library/configure.ac 
b/plugins/library-template/library_template/shared-library/configure.ac
index 52bc791..51df302 100644
--- a/plugins/library-template/library_template/shared-library/configure.ac
+++ b/plugins/library-template/library_template/shared-library/configure.ac
@@ -39,7 +39,7 @@ dnl ***********************************************************************
 dnl Initialize automake
 dnl ***********************************************************************
 AM_SILENT_RULES([yes])
-AM_INIT_AUTOMAKE([1.11 foreign subdir-objects tar-ustar no-dist-gzip dist-xz])
+AM_INIT_AUTOMAKE([1.11 foreign subdir-objects tar-ustar no-dist-gzip dist-xz -Wno-portability])
 AM_MAINTAINER_MODE([enable])
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]