updates.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 5 Jun 2001 11:17:54 +0000 (11:17 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 5 Jun 2001 11:17:54 +0000 (11:17 +0000)
distributions
lib/Makefile.am.pre
prepare

index 400664bd55c1120c38848536d78ee6301c9340a2..6da1b27f8304efced39600468976d550df243a3e 100644 (file)
@@ -15,6 +15,8 @@
 # _<name>_SUBDIRS_<dir>                 Subdirs under <dir>
 # _<name>_DISTLABEL                     Preprocessor label
 #
+# DISTRBUTIONS=<distributions>
+#
 # The _SUBDIRS define all the subdirectories that the Makefile should
 # traverse.  The _SUBDIRS_<dir> defines all subdirectories in the 
 # subdirectory <dir>.  The _DISTLABEL defines a preprocessor label
@@ -23,6 +25,7 @@
 # used in the Makefiles by `if SILC_DIST_CLIENT' to define something in
 # the Makefile only for the specific distribution.
 #
+# The DISTRIBUTIONS defines all distributions in this file.
 #
 # NOTE: For now this supports only one sublevel of the directories.
 #       Also make sure that the <dir> directory includes Makefile.am.pre
@@ -55,3 +58,4 @@ _server_SUBDIRS=lib silcd doc includes
 _server_SUBDIRS_lib=contrib silccore silccrypt silcsim silcmath silcske silcutil trq dotconf
 _server_DISTLABEL=SILC_DIST_SERVER
 
+DISTRIBUTIONS=toolkit client server
index 1978d221d0ef478089b3a73a46a15898d1c16ac6..107912a835c0ba1afa5cfee1af480e19e15f3a07 100644 (file)
@@ -18,7 +18,7 @@
 
 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
-SUBDIRS = \
+COMMONDIRS = \
        contrib \
        silccore \
        silccrypt \
@@ -26,10 +26,16 @@ SUBDIRS = \
        silcmath \
        silcske \
        silcutil \
-       silcclient \
-       trq \
-       dotconf
+       dotconf \
+       trq
 #        zlib
+
+if SILC_DIST_CLIENT
+SUBDIRS = $(COMMONDIRS) silcclient
+else
+SUBDIRS = $(COMMONDIRS)
+endif
+
 DIST_SUBDIRS = SILC_DISTRIBUTION_SUBDIRS
 
 # SILC Library dirs
diff --git a/prepare b/prepare
index cc6f6d77da33ffe1ba7ff45c6d659458088a8f69..2a749e6e8dbbeb9effb02b7c5a0b97994257838a 100755 (executable)
--- a/prepare
+++ b/prepare
@@ -64,7 +64,7 @@ echo "Preparing $distribution distribution version $version"
 
 #
 # Go though the subdirs and create the Makefile.ams from the
-# Makefile.am.pre files.  Create also the acconfig.h for the distribution.
+# Makefile.am.pre files.
 #
 subdirs=`grep _"$distribution"_SUBDIRS= distributions |cut -d=  -f2`
 sed -e "/SILC_DISTRIBUTION_SUBDIRS/s//$subdirs/" Makefile.am.pre >Makefile.am
@@ -84,21 +84,36 @@ do
 done
 cd $path
 
-distlabel=`grep _"$distribution"_DISTLABEL= distributions |cut -d=  -f2`
-cp acconfig.h.pre acconfig.h
-echo "#undef $distlabel" >>acconfig.h
-
 
 #
 # Replace version string, package name and distribution infos, and create 
 # the actual configure.in
 #
 echo "# Automatically generated by ./prepare from configure.in.pre. Do not edit!" >configure.in2
-sed -e "/SILC_VERSION/s//$dist_version/" configure.in.pre >>configure.in2
-sed -e "/SILC_PACKAGE/s//silc-"$distribution"/" configure.in2  >configure.in3
-sed -e "/SILC_DIST_DEFINE/s//$distlabel/" configure.in3 >configure.in4
-sed -e "/SILC_DIST_DEFINE/s//$distlabel/" configure.in4 >configure.in
-rm -f configure.in2 configure.in3 configure.in4
+sed -e "/SILC_VERSION/s//$dist_version/" -e "/SILC_PACKAGE/s//silc-"$distribution"/" configure.in.pre >>configure.in2
+
+#
+# Create also the acconfig.h for the distribution. Note that this sets
+# also dist labels for distributions that are not defined.
+#
+cp acconfig.h.pre acconfig.h
+dists=`grep DISTRIBUTIONS= distributions |cut -d=  -f2`
+touch am_cond
+for i in $dists
+do
+  dl=`grep _"$i"_DISTLABEL= distributions |cut -d=  -f2`
+  echo "#undef $dl" >>acconfig.h
+  if test "$i" = "$distribution"; then
+    echo "AM_CONDITIONAL($dl, test xtrue = xtrue)" >>am_cond
+  else
+    echo "AM_CONDITIONAL($dl, test xtrue = xfalse)" >>am_cond
+  fi
+done
+
+sed '/SILC_DIST_DEFINE/ r am_cond' configure.in2 >configure.in3
+dl=`grep _"$distribution"_DISTLABEL= distributions |cut -d=  -f2`
+sed -e "/SILC_DIST_DEFINE/s//$dl/" configure.in3 >configure.in
+rm -f configure.in2 configure.in3 am_cond
 
 
 #