[Xfce4-commits] <xfce4-dev-tools:master> do @REVISION@ and @LINGUAS@ substitution in xdt-autogen

Brian J. Tarricone brian at tarricone.org
Wed Aug 19 05:32:01 CEST 2009


Updating branch refs/heads/master
         to 37d405679d49f9bff0fdc1d70cff9ea560c08222 (commit)
       from 0b27b7072a807c3aff15c85aee9bf5fe4317b958 (commit)

commit 37d405679d49f9bff0fdc1d70cff9ea560c08222
Author: Brian J. Tarricone <brian at tarricone.org>
Date:   Tue Aug 18 18:47:24 2009 -0700

    do @REVISION@ and @LINGUAS@ substitution in xdt-autogen

 NEWS                      |    7 ++++-
 scripts/xdt-autogen.in.in |   66 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 70 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index d280e43..8a8365a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,15 @@
-4.6.2
+4.7.0
 =====
+- Do @REVISION@ and @LINGUAS@ substitutions in xdt-autogen instead of
+  requiring people to put it in their autogen.sh files.
 - Also support the newer IT_PROG_INTLTOOL macro
 - Added --version and -V options to display the xdt-autogen version
 - Added ability for autogen.sh scripts to set an environment
   variable XDT_AUTOGEN_REQUIRED_VERSION to depend on a particular version
   of xdt-autogen.
+- Add a bunch more compiler warnings for --enable-debug, and a new macro
+  XDT_SUPPORTED_FLAGS() that tests whether the compiler supports particular
+  option flags.
 
 4.6.0
 =====
diff --git a/scripts/xdt-autogen.in.in b/scripts/xdt-autogen.in.in
index c3b9f77..552cb6f 100644
--- a/scripts/xdt-autogen.in.in
+++ b/scripts/xdt-autogen.in.in
@@ -32,6 +32,12 @@ XDT_AUTOGEN_VERSION_MICRO="@VERSION_MICRO@"
 XDT_AUTOGEN_VERSION_NANO="@VERSION_NANO@"
 XDT_AUTOGEN_VERSION_REVISION="@VERSION_REVISION@"
 
+
+parse_configure_subdirs()
+{
+  cat "$1" | tr '\\n\\t\\\\' '   ' | sed -ne 's|.*AC_CONFIG_SUBDIRS(\[\{0,1\}\([[:alnum:]_ @/-]\{1,\}\).*|\1|p'
+}
+
 ##
 ## Helper function to lookup configure.{in,ac} files recursively.
 ## Sets $CONFIGURE_FILES to the list of configure files found.
@@ -57,12 +63,32 @@ EOF
     CONFIGURE_FILES="$CONFIGURE_FILES $configure_file";
   fi
 
-  subdirs=`cat ${configure_file} | tr '\\n\\t\\\\' '   ' | sed -ne 's|.*AC_CONFIG_SUBDIRS(\[\{0,1\}\([[:alnum:]_ @/-]\{1,\}\).*|\1|p'`
+  subdirs=`parse_configure_subdirs ${configure_file}`
   for subdir in $subdirs; do
     lookup_configure_files "$1/$subdir";
   done
 }
 
+lookup_configure_ac_in_files()
+{
+  configure_file=""
+
+  if test -f "$1/configure.ac.in"; then
+    configure_file="$1/configure.ac.in";
+  elif test -f "$1/configure.in.in"; then
+    configure_file="$1/configure.in.in";
+  fi
+
+  test "x$configure_file" != "x" && echo -n "$configure_file "
+
+  subdirs=`parse_configure_subdirs ${configure_file}`
+  for subdir in $subdirs; do
+    lookup_configure_ac_in_files "$1/$subdir";
+  done
+}
+
+
+
 ##
 ## check command-line args
 ##
@@ -150,11 +176,47 @@ XDG_DATA_DIRS="${XDG_DATA_HOME}:${XDG_DATA_DIRS}"
 export XDG_DATA_DIRS XDG_DATA_HOME
 
 
+MASTER_DIR=`pwd`; test -z "${MASTER_DIR}" && MASTER_DIR="."
+
+##
+## First we do some substitutions to generate configure.{ac,in} if necessary
+##
+CONFIGURE_AC_IN_FILES=`lookup_configure_ac_in_files "$MASTER_DIR"`
+for conf_ac_in in $CONFIGURE_AC_IN_FILES; do
+  conf_ac="`echo $conf_ac_in | sed -e 's:\.in$::'`"
+
+  # first generate a revision id
+  if test -d .git/svn; then
+    revision=`git svn find-rev trunk 2>/dev/null ||
+              git svn find-rev origin/trunk 2>/dev/null ||
+              git svn find-rev HEAD 2>/dev/null ||
+              git svn find-rev master 2>/dev/null`
+  elif test -d .git; then
+    revision=`git rev-parse --short HEAD`
+  elif test -d .svn; then
+    revision=`LC_ALL=C svn info $0 | awk '/^Revision: / {printf "%05d\n", $2}'`
+  fi
+
+  if test "x$revision" = "x"; then
+    revision="UNKNOWN"
+  fi
+
+  # find out what languages we support
+  conf_dir=`dirname $conf_ac`
+  linguas=`cd "$conf_dir/po" 2>/dev/null && ls *.po 2>/dev/null | awk 'BEGIN { FS="."; ORS=" " } { print $1 }'`
+
+  # and do the substitution
+  sed -e "s/@REVISION@/${revision}/g" \
+      -e "s/@LINGUAS@/${linguas}/g" \
+      < "$conf_ac_in" > "$conf_ac"
+
+done
+
+
 ##
 ## Search for the configure.{ac,in} files
 ##
 CONFIGURE_FILES=""
-MASTER_DIR=`pwd`; test -z "${MASTER_DIR}" && MASTER_DIR="."
 lookup_configure_files "$MASTER_DIR"
 
 



More information about the Xfce4-commits mailing list