#!/bin/sh # # prepare # # Author: Pekka Riikonen # # Copyright (C) 2000 - 2001 Pekka Riikonen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # # Prepares SILC source tree for configuration and compilation. This is # done only after checkout from CVS. This is only for developers of SILC # and will never appear in public distribution. When creating distributions # this is always run first. After the distribution is created all # temporary files (including these prepare* scripts) are removed. # # # Usage: ./prepare [ ] # # If is omitted is used as package # version. The package version appears in the package name and in those # distributions that used the SILC_DIST_VERSION_STRING define in the # code. The base version is the SILC_VERSION_STRING define. # # # 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..." distribution=$1 if test "$distribution" = ""; then distribution="toolkit"; fi version=$2 if test "$version" = ""; then version=$SILC_VERSION; fi dist_version=$3 if test "$dist_version" = ""; then dist_version=$version fi 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 if [ -f Makefile.am.pre ]; then sed -e "/SILC_DISTRIBUTION_SUBDIRS/s//$sub/" Makefile.am.pre >Makefile.am 2>/dev/null fi cd $path done cd $path # Replace version string and create 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 # # Prepare the Makefile.defines and Makefile.defines_int # cp Makefile.defines.pre Makefile.defines.in cp Makefile.defines.in Makefile.defines cp Makefile.defines.in irssi cp Makefile.defines.in irssi/Makefile.defines cp Makefile.defines_int.pre Makefile.defines_int.in cp Makefile.defines_int.in Makefile.defines_int cp Makefile.defines_int.in irssi cp Makefile.defines_int.in irssi/Makefile.defines_int aclocal autoconf autoheader automake cd lib/trq aclocal autoconf autoheader automake >/dev/null 2>/dev/null cd ../.. file=includes/version_internal.h 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 # preparing irssi cd irssi sh autogen.sh 2>/dev/null 1>/dev/null cd .. file=irssi/irssi-version.h.in version_date=`date +%Y%m%d` echo "/* automatically created by autogen.sh */" > $file echo "#define IRSSI_VERSION \"$dist_version (Irssi base: @VERSION@ - SILC base: SILC Toolkit $version)\"" >>$file echo "#define IRSSI_VERSION_DATE \"$version_date\"" >> $file echo "Done, now run ./configure and make."