[mm-common] Query auxiliary directory via Autoconf trace mode



commit 08f4c206e6d82a697e7e69a96fc78f17a8414e95
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Sun Aug 9 03:47:06 2009 +0200

    Query auxiliary directory via Autoconf trace mode
    
    * util/mm-common-prepare.in: Instead of using a sed program to parse
    configure.ac manually, invoke Autoconf in trace mode to collect the
    first argument to the AC_CONFIG_AUX_DIR() macro.

 util/mm-common-prepare.in |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/util/mm-common-prepare.in b/util/mm-common-prepare.in
index 460380a..1d86071 100644
--- a/util/mm-common-prepare.in
+++ b/util/mm-common-prepare.in
@@ -65,7 +65,7 @@ EOF
     exit 1
     ;;
   ?*)
-    srcdir=$arg
+    srcdir="${arg%/}"
     ;;
   esac
 done
@@ -76,16 +76,16 @@ test -f "$acfile" || {
   echo "$progname: error: $acfile not found" >&2
   exit 1
 }
-# The sed expression contains literal tab characters for portability
-auxdir=`sed -n 's/^[	 ]*AC_CONFIG_AUX_DIR([[	 ]*\([^]),$	 ]*\).*/\1/p' "$acfile"`
-auxdir=$srcdir${auxdir:+/}$auxdir
+# Extract the AC_CONFIG_AUX_DIR argument from configure.ac
+auxdir=`${AUTOCONF:-autoconf} --trace='AC_CONFIG_AUX_DIR:$1' "$acfile"`
+auxdir="$srcdir${auxdir:+/}$auxdir"
 
-echo "$progname: putting auxiliary files into $auxdir"
+echo "$progname: putting auxiliary files into '$auxdir'"
 
 for file in compile-binding.am dist-changelog.am doc-reference.am generate-binding.am
 do
   if test -n "$forceflag" || test ! -f "$auxdir/$file"; then
-    echo "$progname: $instaction file $file"
+    echo "$progname: $instaction file '$file'"
     $installcmd$forceflag "$pkgdatadir/build/$file" "$auxdir/$file"
   fi
 done



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