updates
authorPekka Riikonen <priikone@silcnet.org>
Thu, 31 May 2001 12:28:14 +0000 (12:28 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 31 May 2001 12:28:14 +0000 (12:28 +0000)
CHANGES
acconfig.h.pre [moved from acconfig.h with 93% similarity]
configure.in.pre
distributions
prepare
prepare-clean

diff --git a/CHANGES b/CHANGES
index 5418a1e95459d1b093617ac71652726124a52c59..082c5354db0b02f7d41d57955f54d07569250628 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Thu May 31 13:57:33 CEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Added new distribution feature, DISTLABEL.  Every distribution
+         can define own preprocessor label that can be used in the
+         source code.  For example: #ifdef SILC_DIST_CLIENT.  Affected
+         file distributions, acconfig.h.pre and prepare.
+
 Tue May 29 22:16:40 EEST 2001  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Added Makefile.defines_int to include the actual definitions
similarity index 93%
rename from acconfig.h
rename to acconfig.h.pre
index ec943f9feca013c7fdbc202cffd7d57a00b031ae..164fd2c61908575255c69ba14e8878d6e7cdcbad 100644 (file)
@@ -56,3 +56,5 @@
 #undef Rdup2
 #undef Rfclose
 #undef Rgethostbyname
+
+/* SILC distribution definitions (leave this at the end of file) */
index 1d0c64c2b69c85062506eae52e2285dcdde34846..0731f1cb8ac120d3e5cce5bf183a15ba9b86d192 100644 (file)
@@ -46,6 +46,11 @@ AC_ARG_PROGRAM
 AC_PROG_LN_S
 AC_SUBST(LN_S)
 
+# Distribution definition. ./prepare will automatically add here a correct
+# value. Do not edit!
+AC_DEFINE(SILC_DIST_DEFINE)
+AM_CONDITIONAL(SILC_DIST_DEFINE, test xtrue = xtrue)
+
 # XXX
 # Compiler flags
 if test "$GCC"; then
index 6d9a99f0980486fe14e7febc7f7528ded7e1eade..5f7b490909e3fe76c532dccb1b9648e935637626 100644 (file)
 #
 # _<name>_SUBDIRS                      Subdirs for the distribution
 # _<name>_SUBIDRS_<dir>                 Subdirs under <dir>
+# _<name>_DISTLABEL                     Preprocessor label
+#
+# The _SUBDIRS define all the subdirectories that the Makefile should
+# traverse.  The _SUBDIRS_<dir> defines a subdirectories in the 
+# subdirectory <dir>.  The _DISTLABEL defines a preprocessor label
+# that can be used in the source code like `#ifdef SILC_DIST_CLIENT' to
+# define code only for the specific distribution.  The label can also be
+# used in the Makefiles by `if SILC_DIST_CLIENT' to define something in
+# the Makefile only for the specific distribution.
+#
 #
 # NOTE: For now this supports only one sublevel of the directories.
 #       Also make sure that the <dir> directory includes Makefile.am.pre
 #
 # _xyz_SUBDIRS=lib irssi doc includes
 # _xyz_SUBDIRS_lib=$(SUBDIRS)
+# _xyz_DISTLABEL=SILC_DIST_XYZ
 #
 # To prepare the distribution give command ./prepare xyz 1.0.4
 #
 
 _toolkit_SUBDIRS=lib irssi silc silcd doc includes
 _toolkit_SUBDIRS_lib=$(SUBDIRS)
+_toolkit_DISTLABEL=SILC_DIST_TOOLKIT
 
 _client_SUBDIRS=lib irssi doc includes
 _client_SUBDIRS_lib=$(SUBDIRS)
+_client_DISTLABEL=SILC_DIST_CLIENT
 
 _server_SUBDIRS=lib silcd doc includes
 _server_SUBDIRS_lib=contrib silccore silccrypt silcsim silcmath silcske silcutil trq dotconf
+_server_DISTLABEL=SILC_DIST_SERVER
+
diff --git a/prepare b/prepare
index 3a0829de505fba91c8bc78901281e8d8518ee371..cc6f6d77da33ffe1ba7ff45c6d659458088a8f69 100755 (executable)
--- a/prepare
+++ b/prepare
@@ -62,9 +62,10 @@ fi
 
 echo "Preparing $distribution distribution version $version"
 
+#
 # Go though the subdirs and create the Makefile.ams from the
-# Makefile.am.pre files.
-
+# Makefile.am.pre files.  Create also the acconfig.h for the distribution.
+#
 subdirs=`grep _"$distribution"_SUBDIRS= distributions |cut -d=  -f2`
 sed -e "/SILC_DISTRIBUTION_SUBDIRS/s//$subdirs/" Makefile.am.pre >Makefile.am
 path=`pwd`
@@ -83,11 +84,22 @@ do
 done
 cd $path
 
-# Replace version string and create configure.in
+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.in
-rm -f 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
+
 
 #
 # Prepare the Makefile.defines
@@ -114,6 +126,8 @@ echo "/* Automatically generated by ./prepare */" >$file
 echo "#define SILC_VERSION_STRING \"$version\"" >>$file
 echo "#define SILC_DIST_VERSION_STRING \"$dist_version\"" >>$file
 echo "#define SILC_PROTOCOL_VERSION_STRING \"SILC-1.0-$version\"" >>$file
+echo "#define SILC_NAME \"SILC $distribution\"" >>$file
+
 
 # preparing irssi
 cd irssi
index 9bcc5497d9602b11b12dd87a6d49a4e2e5c354ba..d84d3273dbe863806fc00fec965ff374b54e2491 100755 (executable)
@@ -32,6 +32,7 @@ rm -f Makefile.defines
 rm -f Makefile.defines.in
 rm -f Makefile.defines_int
 rm -f Makefile.defines_int.in
+rm -f acconfig.h
 rm -f irssi/Makefile.defines
 rm -f irssi/Makefile.defines.in
 rm -f irssi/Makefile.defines_int