[jhbuild] autogen.sh: fix configuration without autotools, and cleanup (bgo#706497)



commit 3d03dc2487d128b949cde5e8b3b5a06d9ab40f89
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Aug 21 15:29:08 2013 +0200

    autogen.sh: fix configuration without autotools, and cleanup (bgo#706497)
    
    Configuring without autotools was broken (because the "hack" in place to
    force autotools if NOCONFIGURE is specified, didn't take in account the
    dependencies for using autotools). Besides, the code to check this has
    been slightly improved:
    - Before, it was a bit confusing ("have_autotools" and "enable_autotools"
    variables didn't express full meaning of how they were being used)
    - It was barely readable (using $TRUE and $FALSE variables, instead of 0/1,
    helps a bit).
    - The dependencies of autotools now give suggestions of package names that
    could contain them.

 autogen.sh |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index efdf68b..5a26e2d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -32,6 +32,9 @@
 
 PKG_NAME=jhbuild
 
+FALSE=1
+TRUE=0
+
 srcdir=`dirname $0`
 test -z "$srcdir" && srcdir=.
 test -z "$MAKE" && MAKE=make
@@ -76,7 +79,7 @@ setup_i18n()
 # on Solaris, BSD and MacOS.
 parse_commandline()
 {
-  enable_autotools=1
+  enable_autotools=$FALSE
 
   while [ -n "$1" ]; do
     # substring operations available in all sh?
@@ -85,7 +88,7 @@ parse_commandline()
       key=${keyvalue%%=*}
       value=${keyvalue##*=}
       if [ "$key" = "simple-install" ]; then
-        enable_autotools=0
+        enable_autotools=$TRUE
       fi
       echo $key | grep -E '^[A-Za-z_][A-Za-z_0-9]*$' > /dev/null 2>&1
       if [ $? -eq 0 ]; then
@@ -200,27 +203,36 @@ yelp_tools_available=$?
 
 parse_commandline $*
 
-have_autotools=1
-if [ $gnome_autogen_available -eq 0 -a \
-     $yelp_tools_available -eq 0 -a \
-     $enable_autotools -eq 1 ]; then
-    have_autotools=0
+autotools_dependencies_met=$FALSE
+if [ $gnome_autogen_available -eq $TRUE -a \
+     $yelp_tools_available -eq $TRUE ]; then
+    autotools_dependencies_met=$TRUE
 fi
+
 # As a hack, force use of autotools if NOCONFIGURE is specified; this
 # allows the gnome-ostree build system to work which doesn't have
 # yelp, but also can't pass options to autogen.sh
+force_autotools=$FALSE
 if test -z "$NOCONFIGURE"; then
-    have_autotools=0
+  force_autotools=$TRUE
+fi
+
+use_autotools=$FALSE
+if [ $enable_autotools -eq $TRUE -a $autotools_dependencies_met -eq $TRUE ]; then
+  use_autotools=$TRUE
+fi
+if [ $force_autotools -eq $TRUE -a $autotools_dependencies_met -eq $TRUE ]; then
+  use_autotools=$TRUE
 fi
 
-if [ $have_autotools -eq 0 ]; then
+if [ $use_autotools -eq $TRUE ]; then
   configure_with_autotools $*
 else
-  if [ $gnome_autogen_available -ne 0 ]; then
-    gettext "gnome-autogen.sh not available"; echo
+  if [ $gnome_autogen_available -ne $TRUE ]; then
+    gettext "WARNING: gnome-autogen.sh not available (usually part of package 'gnome-common')"; echo
   fi
-  if [ $yelp_tools_available -ne 0 ]; then
-    gettext "yelp-tools not available"; echo
+  if [ $yelp_tools_available -ne $TRUE ]; then
+    gettext "WARNING: yelp-tools not available (usually part of package 'yelp-tools')"; echo
   fi
   configure_without_autotools
 fi


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