summaryrefslogtreecommitdiff
path: root/build/gen-backends-am.sh
diff options
context:
space:
mode:
authorKrzesimir Nowak <krnowak@openismus.com>2011-08-30 16:24:58 +0200
committerKrzesimir Nowak <krnowak@openismus.com>2011-08-30 16:38:34 +0200
commita7ad98fabc965b053cb9e92db431d5b535adee26 (patch)
tree56a912b2390a0dab17a8b1ae85b5911d64840b31 /build/gen-backends-am.sh
parent36dd42a030f31bc281a8027bd947bbe226a0ea7a (diff)
Port build system to non-recursive Automake.
All but toplevel Makefile.am are replaced with their non-recursive counterparts. The generation of configure.in was removed (and thus configure-{pre,post}.in are also removed) in favor of configure.ac and m4 macros adding backend specific configure parts. Version number is generated like in old build system. There are still many things to improve, but for now there are no immediate regressions. AUTOTOOLS-TODO contains a list of possible improvements and fixes. AUTOTOOLS-TESTING contains what was tested with current build system (configure flags, make options).
Diffstat (limited to 'build/gen-backends-am.sh')
-rwxr-xr-xbuild/gen-backends-am.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/build/gen-backends-am.sh b/build/gen-backends-am.sh
new file mode 100755
index 00000000..f4fbb73a
--- /dev/null
+++ b/build/gen-backends-am.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+amfile='src/backends/backends.am'
+tmpfile="$amfile.$$"
+
+rm -f "$tmpfile"
+touch "$tmpfile"
+
+BACKENDS="`echo src/backends/*/configure-sub.in | sed -e 's%/configure-sub\.in%%g' | sort`"
+BACKEND_REGISTRIES="`echo src/backends/*/*Register.cpp | sort`"
+
+tf()
+{
+ echo "$1" >>"$tmpfile"
+}
+
+tf '# This is a stupid workaround for an absolute path in SYNCEVOLUTION_LIBS.'
+tf '# See AUTOTOOLS-TODO for details.'
+tf '@SYNCEVOLUTION_LIBS@: src/syncevo/libsyncevolution.la ; @true'
+tf ''
+tf "BACKENDS = $BACKENDS"
+tf ''
+tf "BACKEND_REGISTRIES = $BACKEND_REGISTRIES"
+tf ''
+tf '# backend includes'
+
+for backend in $BACKENDS
+do
+ name=`echo "$backend" | sed -e 's%src/backends/%%'`
+ tf "include \$(top_srcdir)/$backend/$name.am"
+done
+
+if test ! -f "$amfile" || ! cmp -s "$amfile" "$tmpfile"
+then
+ mv "$tmpfile" "$amfile"
+else
+ rm -f "$tmpfile"
+fi