subdirs are defined in configure.ac

Note we also mkdir m4 (just in case)
And touch some needed files (README NEWS ...) to prevent warnings/errors.
It may be better to add those files and commit them, or copy from parent dir.

Signed-off-by: Uri Lublin <u...@redhat.com>
---
 autogen.sh |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 2619803..140a31d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -154,11 +154,35 @@ do_cmd() {
 # Run for top level directory

 printbold "Setting up $PACKAGE toplevel"
-do_cmd $LIBTOOLIZE $LIBTOOLIZE_FLAGS
-do_cmd $ACLOCAL $ACLOCAL_FLAGS
-do_cmd $AUTOHEADER
-do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
-do_cmd $AUTOCONF
+
+config_specific_directory ()
+{
+    local d=${1:-.}
+    local cur=$(pwd)
+    if [ "$d" != "." ]; then
+        cd $d
+        printbold " -----    Entering  $d -----"
+    fi
+    touch NEWS README AUTHORS ChangeLog ### ToDo: define those.
+    mkdir -p m4
+    do_cmd $LIBTOOLIZE $LIBTOOLIZE_FLAGS
+    do_cmd $ACLOCAL $ACLOCAL_FLAGS
+    do_cmd $AUTOHEADER
+    do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
+    do_cmd $AUTOCONF --force
+    if [ "$d" != "." ]; then
+        cd $cur
+        printbold " -----    Exiting   $d -----"
+    fi
+}
+
+subdirs=$(grep '^AC_CONFIG_SUBDIRS' configure.ac | \
+          sed 's/AC_CONFIG_SUBDIRS(\[\(.*\)\]) *$/\1/')
+printbold "subdirs are $subdirs"
+
+for sd in $subdirs .; do
+   config_specific_directory $sd
+done

 cd $ORIGDIR || exit $?
 rm -f config.cache
-- 
1.6.5.2


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Spice-space-devel mailing list
Spice-space-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spice-space-devel

Reply via email to