From 2ffcc80440e1f6d1965c82cdd36de208a7e15734 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 27 May 2001 19:39:26 +0000 Subject: [PATCH] new distributions system. --- CHANGES | 15 ++++++++++ Makefile.am => Makefile.am.pre | 1 + distributions | 42 ++++++++++++++++++++++++++++ lib/{Makefile.am => Makefile.am.pre} | 1 + prepare | 39 ++++++++++++++++++++++++-- prepare-clean | 2 ++ 6 files changed, 97 insertions(+), 3 deletions(-) rename Makefile.am => Makefile.am.pre (98%) create mode 100644 distributions rename lib/{Makefile.am => Makefile.am.pre} (97%) diff --git a/CHANGES b/CHANGES index 2c6d8bcc..70c4c1e5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,18 @@ +Sun May 27 22:24:57 EEST 2001 Pekka Riikonen + + * 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 * Added invite list, ban list, some key management and connection diff --git a/Makefile.am b/Makefile.am.pre similarity index 98% rename from Makefile.am rename to Makefile.am.pre index 142dbe69..0723031d 100644 --- a/Makefile.am +++ b/Makefile.am.pre @@ -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 index 00000000..30d1be12 --- /dev/null +++ b/distributions @@ -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: +# +# __SUBDIRS Subdirs for the distribution +# __SUBIDRS_ Subdirs under +# +# NOTE: For now this supports only one sublevel of the directories. +# Also make sure that the 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 __SUBDIRS_ 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 diff --git a/lib/Makefile.am b/lib/Makefile.am.pre similarity index 97% rename from lib/Makefile.am rename to lib/Makefile.am.pre index 6053b258..1978d221 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am.pre @@ -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 78acb8d9..740cbc94 100755 --- a/prepare +++ b/prepare @@ -25,14 +25,47 @@ # 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 diff --git a/prepare-clean b/prepare-clean index ec809792..23fc356e 100755 --- a/prepare-clean +++ b/prepare-clean @@ -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.* -- 2.24.0