Merged silc_1_0_branch to trunk.
[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 #endif _DIST_DEFAULT
26 EOF
27
28 cat << EOF > Makefile.ad
29 SUBDIRS=        \
30 #ifdef _DIST_NODEF
31         nodef   \
32 #endif _DIST_NODEF
33 #endif
34 EOF
35
36 rm -rf distdir subdir
37 mkdir -p subdir || exit 1
38
39 cat << EOF > subdir/configure.ad
40 # subdir/configure.ad fragment
41 #ifndef _DIST_NODEF
42 echo "_DIST_NODEF ok"
43 #endif _DIST_NODEF
44 EOF
45
46 $AUTODIST -i || exit 1
47 if test '!' -d distdir; then
48   echo "error: distdir/ does no exist"
49   exit 1
50 fi 
51
52 cp -p ../../default distdir || exit 1
53 cp -p ../../autodist.conf distdir || exit 1
54
55 touch README NEWS AUTHORS ChangeLog
56
57 $AUTODIST || exit 1
58
59 ./configure || exit 1
60 make || exit 1
61 echo make ok
62
63 echo test ok
64
65 # Cleanup
66 rm -rf subdir distdir
67