new distributions system.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 27 May 2001 19:39:26 +0000 (19:39 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 27 May 2001 19:39:26 +0000 (19:39 +0000)
CHANGES
Makefile.am.pre [moved from Makefile.am with 98% similarity]
distributions [new file with mode: 0644]
lib/Makefile.am.pre [moved from lib/Makefile.am with 97% similarity]
prepare
prepare-clean

diff --git a/CHANGES b/CHANGES
index 2c6d8bccbe5083eebcffb53b9a220e42e57430c6..70c4c1e53e7b909217cf6a8ce59ac54a83b6d4e2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,18 @@
+Sun May 27 22:24:57 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Created new distribution system.  Added file `distributions'
+         that defines all the distributions that can be created out of
+         the SILC source tree.  The ./prepare script now reads that
+         file to determine how to prepare the distributions.  The
+         first argument to the ./prepare is the name of the distribution
+         and second is the version of the distribution.  If given
+         without arguments it creates the default (toolkit) distribution
+         with the default version (defined in ./prepare).
+
+         All Makefile.am files that are subject to the distributions
+         are now named as Makefile.am.pre.  These are ./Makefile.am
+         and lib/Makefile.am.  Others may be changed later.
+
 Sun May 27 15:57:17 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added invite list, ban list, some key management and connection
similarity index 98%
rename from Makefile.am
rename to Makefile.am.pre
index 142dbe69aff53cd1132a49e618b51dc97978e83c..0723031d1bbafb6e3f6a2c1463d05dd9d8f98bb4 100644 (file)
@@ -19,6 +19,7 @@
 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
 SUBDIRS = lib silc silcd doc includes
+DIST_SUBDIRS = SILC_DISTRIBUTION_SUBDIRS
 
 dist-bzip: distdir
        -chmod -R a+r $(distdir)
diff --git a/distributions b/distributions
new file mode 100644 (file)
index 0000000..30d1be1
--- /dev/null
@@ -0,0 +1,42 @@
+#
+# Distributions
+#
+# Distributions file describing the different distributions that are
+# created out of the SILC source tree.  The ./prepare script will read
+# this file to determine what kind of distributions are created.
+#
+# Give the name of the distribution and the version as arguments to the
+# ./prepare script to prepare the source tree for the specific
+# distribution.
+#
+# The format of this file is as follows:
+#
+# _<name>_SUBDIRS                      Subdirs for the distribution
+# _<name>_SUBIDRS_<dir>                 Subdirs under <dir>
+#
+# NOTE: For now this supports only one sublevel of the directories.
+#       Also make sure that the <dir> directory includes Makefile.am.pre
+#       instead of Makefile.am, otherwise it won't work.  The Makefile.am.pre
+#       must have DIST_SUBDIRS = SILC_DISTRIBUTIONS_SUBDIRS line in it.
+#
+# NOTE: Also note that if any subdirectory has Makefile.am.pre then you
+#       must list it here as _<name>_SUBDIRS_<dir> and either define the
+#       directories one by one or use $(SUBDIRS) to use default to that
+#       Makefile.  Otherwise, ./prepare cannot create correct Makefile.am.
+#
+# Example:
+#
+# _xyz_SUBDIRS=lib irssi doc includes
+# _xyz_SUBDIRS_lib=$(SUBDIRS)
+#
+# To prepare the distribution give command ./prepare xyz 1.0.4
+#
+
+_toolkit_SUBDIRS=lib silc silcd doc includes
+_toolkit_SUBDIRS_lib=$(SUBDIRS)
+
+_client_SUBDIRS=lib irssi doc includes
+_client_SUBDIRS_lib=$(SUBDIRS)
+
+_server_SUBDIRS=lib silcd doc includes
+_server_SUBDIRS_lib=contrib silccore silccrypt silcsim silcmath silcske silcutil trq dotconf
similarity index 97%
rename from lib/Makefile.am
rename to lib/Makefile.am.pre
index 6053b2584bc4c05e0b6edf356085925bdd0e3256..1978d221d0ef478089b3a73a46a15898d1c16ac6 100644 (file)
@@ -30,6 +30,7 @@ SUBDIRS = \
        trq \
        dotconf
 #        zlib
+DIST_SUBDIRS = SILC_DISTRIBUTION_SUBDIRS
 
 # SILC Library dirs
 SILCLIB_DIRS = \
diff --git a/prepare b/prepare
index 78acb8d91887bf30200d82b7dfe72d2ddfde0916..740cbc943f01d82a093a6d1e2cca21e69be4ffbf 100755 (executable)
--- a/prepare
+++ b/prepare
 # temporary files (including these prepare* scripts) are removed.
 #
 
-SILC_VERSION=0.2.6
+#
+# SILC Distribution versions. Set here or give the version on the command
+# line, as argument.
+#
+SILC_VERSION=0.2.6                     # Base version
+
+
+#############################################################################
+
+echo "Preparing SILC source tree for configuration and compilation..."
 
-version=$1
+distribution=$1
+if test "$distribution" = ""; then
+  distribution="toolkit";
+fi
+
+version=$2
 if test "$version" = ""; then
   version=$SILC_VERSION;
 fi
 
-echo "Preparing SILC source tree for configuration and compilation..."
+echo "Preparing $distribution distribution version $version"
+
+# Go though the subdirs and create the Makefile.ams from the
+# Makefile.am.pre files.
+
+subdirs=`grep _"$distribution"_SUBDIRS= distributions |cut -d=  -f2`
+sed -e "/SILC_DISTRIBUTION_SUBDIRS/s//$subdirs/" Makefile.am.pre >Makefile.am
+path=`pwd`
+for i in $subdirs
+do
+  cd $i
+  sub=`grep _"$distribution"_SUBDIRS_"$i"= $path/distributions |cut -d=  -f2`
+  if test "$sub" = ""; then
+    cd $path
+    continue;
+  fi
+  sed -e "/SILC_DISTRIBUTION_SUBDIRS/s//$sub/" Makefile.am.pre >Makefile.am 2>/dev/null
+  cd $path
+done
+cd $path
 
 # Replace version string and create configure.in
 sed -e "/SILC_VERSION/s//$version/" configure.in.pre >configure.in
index ec80979264f36ce6e3a46e0e97d7a8405e4a50fe..23fc356e1318ebf979b01be386b314990ed995d7 100755 (executable)
@@ -27,6 +27,8 @@ echo "Cleaning entire SILC source tree..."
 echo "All errors and warnings may be safely ignored."
 make clean -k
 make distclean -k
+rm -f Makefile.am
+rm -f lib/Makefile.am
 rm -f configure.in
 rm -f includes/stamp-*
 rm -f includes/silcconfig.*