From: Pekka Riikonen Date: Thu, 31 May 2001 12:28:14 +0000 (+0000) Subject: updates X-Git-Tag: robodoc-323~254 X-Git-Url: http://git.silc.fi/gitweb/?a=commitdiff_plain;h=765901077719f14db6243f3eddce052666aa5a1e;p=silc.git updates --- diff --git a/CHANGES b/CHANGES index 5418a1e9..082c5354 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Thu May 31 13:57:33 CEST 2001 Pekka Riikonen + + * 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 * Added Makefile.defines_int to include the actual definitions diff --git a/acconfig.h b/acconfig.h.pre similarity index 93% rename from acconfig.h rename to acconfig.h.pre index ec943f9f..164fd2c6 100644 --- a/acconfig.h +++ b/acconfig.h.pre @@ -56,3 +56,5 @@ #undef Rdup2 #undef Rfclose #undef Rgethostbyname + +/* SILC distribution definitions (leave this at the end of file) */ diff --git a/configure.in.pre b/configure.in.pre index 1d0c64c2..0731f1cb 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -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 diff --git a/distributions b/distributions index 6d9a99f0..5f7b4909 100644 --- a/distributions +++ b/distributions @@ -13,6 +13,16 @@ # # __SUBDIRS Subdirs for the distribution # __SUBIDRS_ Subdirs under +# __DISTLABEL Preprocessor label +# +# The _SUBDIRS define all the subdirectories that the Makefile should +# traverse. The _SUBDIRS_ defines a subdirectories in the +# subdirectory . 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 directory includes Makefile.am.pre @@ -28,15 +38,20 @@ # # _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 3a0829de..cc6f6d77 100755 --- 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 diff --git a/prepare-clean b/prepare-clean index 9bcc5497..d84d3273 100755 --- a/prepare-clean +++ b/prepare-clean @@ -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