Added SILC Thread Queue API
[silc.git] / apps / autodist / tests / autodist1.test
1 #!/bin/sh
2
3 AUTODIST=../../autodist
4
5 rm -rf test
6 mkdir test
7
8 cd test || exit 1
9
10 chmod +x $AUTODIST || exit 1
11
12 cat << EOF > configure.ad
13 AD_INIT
14 #ifdef _DIST_DEFAULT
15 AC_CANONICAL_BUILD
16 AM_INIT_AUTOMAKE
17 AC_PREREQ(2.52)
18 AC_CONFIG_HEADERS(config.h)
19 AD_INCLUDE_CONFIGURE
20 AC_CONFIG_FILES(
21 Makefile
22 )
23 AC_OUTPUT
24 echo configure.ad ok
25 #else !_DIST_DEFAULT
26 echo "ERROR"
27 exit 1
28 #endif _DIST_DEFAULT
29 EOF
30
31 cat << EOF > Makefile.ad
32 SUBDIRS=        \\
33 #ifdef _DIST_NODEF
34         nodef   \\
35         poa     \\
36         paa     \\
37 #endif _DIST_NODEF
38         .       \\
39         .       \\
40         .       \\
41         .       \\
42
43 EOF
44
45 rm -rf distdir subdir
46 mkdir -p subdir || exit 1
47
48 cat << EOF > subdir/configure.ad
49 # subdir/configure.ad fragment
50 #ifndef _DIST_NODEF
51 echo "_DIST_NODEF ok"
52 #else _DIST_NODEF
53 echo "ERROR"
54 exit 1
55 #endif _DIST_NODEF
56 EOF
57
58 $AUTODIST -i || exit 1
59 if test '!' -d distdir; then
60   echo "error: distdir/ does no exist"
61   exit 1
62 fi 
63
64 cp -p ../../default distdir || exit 1
65 cp -p ../../autodist.conf distdir || exit 1
66
67 touch README NEWS AUTHORS ChangeLog
68
69 $AUTODIST || exit 1
70
71 ./configure || exit 1
72 make || exit 1
73 echo make ok
74
75 echo update test
76 touch Makefile.ad
77 make || exit 1
78 echo update test ok
79
80 echo test ok
81
82 # Cleanup
83 rm -rf subdir distdir