From be12770bee0a3ec2bddfe9e56258739419600c60 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 4 Dec 2002 19:10:57 +0000 Subject: [PATCH] Added libtoolfix to fix *all* problems of libtool. --- CHANGES | 6 +++++ TODO | 2 -- lib/silccrypt/Makefile.am | 4 ++++ lib/silcsim/Makefile.am | 4 ++++ libtoolfix | 47 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) create mode 100755 libtoolfix diff --git a/CHANGES b/CHANGES index b9b33026..e7c4de0d 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,12 @@ Wed Dec 4 18:29:13 EET 2002 Pekka Riikonen decoded and encoded public key. Affected files are lib/silccore/silcmessage.[ch]. + * Added libtoolfix script that makes the libtool more generic + and configurable in run-time. Now we can specify in run-time + if what kind of libraries we want to create, regardless of + configuration. SIMs are now creates even if --disable-shared + was explicitly given. + Tue Dec 3 23:26:55 EET 2002 Pekka Riikonen * Fixed founder key sending in CMODE command in client. diff --git a/TODO b/TODO index 5100e53a..c972651c 100644 --- a/TODO +++ b/TODO @@ -23,8 +23,6 @@ TODO for SILC Server 1.0 TODO/bugs In SILC Libraries =========================== - o libtool hack to compile SIM even when disable-shared - o Test cases for all cryptographic primitive in lib/silccrypt/ o Test cases for all payload encoding and decoding routins in lib/silccore/ diff --git a/lib/silccrypt/Makefile.am b/lib/silccrypt/Makefile.am index c3f058f0..ec36004d 100644 --- a/lib/silccrypt/Makefile.am +++ b/lib/silccrypt/Makefile.am @@ -20,6 +20,10 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign noinst_LTLIBRARIES = libsilccrypt.la +# Compile silccrypt always also as shared library since the SIMs will +# need it. +LIBTOOL_ENABLE_SHARED=yes + libsilccrypt_la_SOURCES = \ none.c \ rc5.c \ diff --git a/lib/silcsim/Makefile.am b/lib/silcsim/Makefile.am index e02b1526..4ff1af45 100644 --- a/lib/silcsim/Makefile.am +++ b/lib/silcsim/Makefile.am @@ -52,6 +52,10 @@ if SILC_SIM all: $(SIM_CIPHER_OBJS) $(SIM_HASH_OBJS) endif +# Libtool to compile always SIM as shared library +LIBTOOL_ENABLE_SHARED=yes +LIBTOOL_ENABLE_STATIC=no + $(SIM_CIPHER_OBJS): @if test '!' -f lib$*.la ; then \ $(LIBTOOL) --mode=link $(CCLD) -rpath $(silc_modulesdir) \ diff --git a/libtoolfix b/libtoolfix new file mode 100755 index 00000000..4f2a01ff --- /dev/null +++ b/libtoolfix @@ -0,0 +1,47 @@ +#!/bin/sh +# +# No Copyright 2002 Pekka Riikonen +# +# This script fixes the fundamental problem of libtool: it is not +# configurable in run-time. This changes the libtool so that it becomes +# more generic and configurable in run-time. It is possible to specify +# how the libtool should behave by environment variables. +# +# Environment variables: +# +# LIBTOOL_ENABLE_SHARED +# LIBTOOL_ENABLE_STATIC +# +# Set either to "yes" or "no" value. "no" is equivalent to being disabled. +# If environment variables are not given then the default settings apply. +# + +# Sanity checks +if test '!' -f ./libtool; then + echo "./libtool does not exist" + exit 0 +fi + +# Take configuration from the ./libtool +sed '/^# ltmain\.sh/q' ./libtool >./libtool.tmp + +# Put our wrapper to the new libtool. This allows the run-time +# configuration of the libtool. This could include a lot of other +# things like command line arguments too. +cat << EOF >> ./libtool.tmp +if test "\$LIBTOOL_ENABLE_SHARED" != ""; then + build_libtool_libs=\$LIBTOOL_ENABLE_SHARED +fi +if test "\$LIBTOOL_ENABLE_STATIC" != ""; then + build_old_libs=\$LIBTOOL_ENABLE_STATIC +fi +EOF + +# Do a trick with the ltmain.sh to make these settings valid +ltmain=`pwd`/ltmain.sh +echo ". $ltmain" >> ./libtool.tmp +mv ./libtool ./libtool.orig +mv ./libtool.tmp ./libtool +chmod +x ./libtool + +exit 1 -- 2.24.0