[gjs] build: Modernize autogen.sh



commit 538a7c387c55b9d83a68108e7771338ff301882e
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon Sep 26 20:12:39 2016 -0700

    build: Modernize autogen.sh
    
    This gets rid of the dependency on the old gnome-autogen.sh and moves
    instead to the suggested autogen.sh given as an example in the
    gnome-common migration guide:
    https://wiki.gnome.org/Projects/GnomeCommon/Migration
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772027

 autogen.sh |   53 +++++++++++++++++++++--------------------------------
 1 files changed, 21 insertions(+), 32 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index e4d2bed..8c1e233 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,44 +1,33 @@
 #!/bin/sh
 # Run this to generate all the initial makefiles, etc.
-
-srcdir=`dirname $0`
+test -n "$srcdir" || srcdir=`dirname "$0"`
 test -z "$srcdir" && srcdir=.
+olddir=`pwd`
+cd "$srcdir"
 
-PKG_NAME="gjs"
-REQUIRED_AUTOCONF_VERSION=2.53
-REQUIRED_AUTOMAKE_VERSION=1.7.2
-
-(test -f $srcdir/configure.ac \
-  && test -f $srcdir/autogen.sh) || {
+(test -f configure.ac) || {
     echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
-    echo " top-level $PKG_NAME directory"
+    echo " top-level directory"
     exit 1
 }
 
-DIE=0
-
-# This is a bit complicated here since we can't use gnome-config yet.
-# It'll be easier after switching to pkg-config since we can then
-# use pkg-config to find the gnome-autogen.sh script.
+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
 
-gnome_autogen=
-gnome_datadir=
+aclocal --install || exit 1  # autoreconf will do this automatically in future
+autoreconf --verbose --force --install || exit 1
 
-ifs_save="$IFS"; IFS=":"
-for dir in $PATH ; do
-  test -z "$dir" && dir=.
-  if test -f $dir/gnome-autogen.sh ; then
-    gnome_autogen="$dir/gnome-autogen.sh"
-    gnome_datadir=`echo $dir | sed -e 's,/bin$,/share,'`
-    break
-  fi
-done
-IFS="$ifs_save"
+cd "$olddir"
+if [ "$NOCONFIGURE" = "" ]; then
+    "$srcdir/configure" "$@" || exit 1
 
-if test -z "$gnome_autogen" ; then
-  echo "You need to install the gnome-common module and make"
-  echo "sure the gnome-autogen.sh script is in your \$PATH."
-  exit 1
+    if [ "$1" = "--help" ]; then exit 0 else
+        echo "Now type 'make' to compile" || exit 1
+    fi
+else
+    echo "Skipping configure process."
 fi
-
-GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . $gnome_autogen


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