File: gen-backends-am.sh

package info (click to toggle)
syncevolution 2.0.0-3.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,836 kB
  • sloc: cpp: 63,872; ansic: 14,604; python: 11,373; xml: 9,152; perl: 1,452; sh: 841; makefile: 322
file content (38 lines) | stat: -rwxr-xr-x 852 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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