From: Ulf Möller Date: Mon, 28 Feb 2000 19:14:46 +0000 (+0000) Subject: Shared library support for Solaris and HPUX X-Git-Tag: OpenSSL_0_9_5a-beta1~150 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=a4709b3d88b5a8db2f5dd2b272bd82038fcf602a Shared library support for Solaris and HPUX by Lutz Behnke and by Lutz Jaenicke. Hopefully we'll have a unified way of handling shared libraries when we move to autoconf... --- diff --git a/CHANGES b/CHANGES index 670ecc0831..62d2ec1829 100644 --- a/CHANGES +++ b/CHANGES @@ -2,9 +2,13 @@ OpenSSL CHANGES _______________ - Changes between 0.9.5 and 0.9.6 [xx Xxx 2000] + Changes between 0.9.5 and 0.9.6 [XX XXX 2000] - *) + *) Shared library support for HPUX (in shlib/). + [Lutz Jaenicke and Anonymous] + + *) Shared library support for Solaris gcc. + [Lutz Behnke ] Changes between 0.9.4 and 0.9.5 [28 Feb 2000] diff --git a/Makefile.org b/Makefile.org index be6894426f..a216f40c02 100644 --- a/Makefile.org +++ b/Makefile.org @@ -385,4 +385,11 @@ install_docs: > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec); \ done +shlib: all + if [ ! -d shlib_dir ] ; then mkdir shlib_dir ; else rm -f shlib_dir/* ; fi + cd shlib_dir ; ar -x ../libcrypto.a && $(CC) -shared ./*.o -Wl,-soname -Wl,libcrypto.so.0.9 \ + -o ./libcrypto.so.0.9.4 && rm *.o + cd shlib_dir ; ar -x ../libssl.a && $(CC) -shared ./*.o -Wl,-soname -Wl,libssl.so.0.9 \ + -o ./libssl.so.0.9.4 && rm *.o + # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/STATUS b/STATUS index db5425f269..c9214c8378 100644 --- a/STATUS +++ b/STATUS @@ -1,6 +1,6 @@ OpenSSL STATUS Last modified at - ______________ $Date: 2000/02/28 12:11:37 $ + ______________ $Date: 2000/02/28 19:14:38 $ DEVELOPMENT STATE @@ -16,7 +16,6 @@ AVAILABLE PATCHES - o shared libraries o CA.pl patch (Damien Miller) IN PROGRESS diff --git a/shlib/Makefile.hpux10-cc b/shlib/Makefile.hpux10-cc new file mode 100644 index 0000000000..4dc62ebd9e --- /dev/null +++ b/shlib/Makefile.hpux10-cc @@ -0,0 +1,51 @@ +# Makefile.hpux-cc + +major=1 + +slib=libssl +sh_slib=$(slib).so.$(major) + +clib=libcrypto +sh_clib=$(clib).so.$(major) + +all : $(clib).sl $(slib).sl + + +$(clib)_pic.a : $(clib).a + echo "Copying $? to $@" + cp -p $? $@ + +$(slib)_pic.a : $(slib).a + echo "Copying $? to $@" + cp -p $? $@ + +$(sh_clib) : $(clib)_pic.a + echo "collecting all object files for $@" + find . -name \*.o -print > allobjs + for obj in `ar t $(clib)_pic.a`; \ + do \ + grep /$$obj allobjs; \ + done >objlist + echo "linking $@" + ld -b -s -z +h $@ -o $@ `cat objlist` -lc + rm allobjs objlist + +$(clib).sl : $(sh_clib) + rm -f $@ + ln -s $? $@ + +$(sh_slib) : $(slib)_pic.a $(clib).sl + echo "collecting all object files for $@" + find . -name \*.o -print > allobjs + for obj in `ar t $(slib)_pic.a`; \ + do \ + grep /$$obj allobjs; \ + done >objlist + echo "linking $@" + ld -b -s -z +h $@ +b /usr/local/ssl/lib:/usr/lib -o $@ `cat objlist` \ + -L. -lcrypto -lc + rm -f allobjs objlist + +$(slib).sl : $(sh_slib) + rm -f $@ + ln -s $? $@ diff --git a/shlib/hpux10-cc.sh b/shlib/hpux10-cc.sh new file mode 100644 index 0000000000..3e5d823c01 --- /dev/null +++ b/shlib/hpux10-cc.sh @@ -0,0 +1,87 @@ +#!/usr/bin/sh +# +# HP-UX (10.20) shared library installation: +# Compile and install OpenSSL with best possible optimization: +# - shared libraries are compiled and installed with +O4 optimization +# - executable(s) are compiled and installed with +O4 optimization +# - static libraries are compiled and installed with +O3 optimization, +# to avoid the time consuming +O4 link-time optimization when using +# these libraries. (The shared libs are already optimized during build +# at +O4.) +# +# This script must be run with appropriate privileges to install into +# /usr/local/ssl. HP-UX prevents used executables and shared libraries +# from being deleted or overwritten. Stop all processes using already +# installed items of OpenSSL. +# +# WARNING: At high optimization levels, HP's ANSI-C compiler can chew up +# large amounts of memory and CPU time. Make sure to have at least +# 128MB of RAM available and that you kernel is configure to allow +# 128MB data size (maxdsiz parameter). +# The installation process can take several hours, even on fast +# machines. +O4 Optimization of the libcrypto.sl shared library may +# take 1 hour on a C200 (200MHz PA8200 CPU), +O3 compilation of +# fcrypt_b.c can take 20 minutes on this machine. Stay patient. +# +# SITEFLAGS: site specific flags. I do use +DAportable, since I have to +# support older PA1.1-type CPUs. Your mileage may vary. +# +w1 enables enhanced warnings, useful when working with snaphots. +# +SITEFLAGS="+DAportable +w1" +# +# Set the default additions to build with HP-UX. +# -D_REENTRANT must/should be defined on HP-UX manually, since we do call +# Confiugure directly. +# +Oall increases the optimization done. +# +MYFLAGS="-D_REENTRANT +Oall $SITEFLAGS" + +# Configure for pic and build the static pic libraries +perl5 Configure hpux-parisc-cc-o4 +z ${MYFLAGS} +make clean +make DIRS="crypto ssl" +# Rename the static pic libs and build dynamic libraries from them +# Be prepared to see a lot of warnings about shared libraries being built +# with optimizations higher than +O2. When using these libraries, it is +# not possible to replace internal library functions with functions from +# the program to be linked. +# +make -f shlib/Makefile.hpux10-cc + +# Copy the libraries to /usr/local/ssl/lib (they have to be in their +# final location when linking applications). +# If the directories are still there, no problem. +mkdir /usr/local +mkdir /usr/local/ssl +mkdir /usr/local/ssl/lib +chmod 444 lib*_pic.a +chmod 555 lib*.so.1 +cp -p lib*_pic.a lib*.so.1 /usr/local/ssl/lib +(cd /usr/local/ssl/lib ; ln -sf libcrypto.so.1 libcrypto.sl ; ln -sf libssl.so.1 libssl.sl) + +# Reconfigure without pic to compile the executables. Unfortunately, while +# performing this task we have to recompile the library components, even +# though we use the already installed shared libs anyway. +# +perl5 Configure hpux-parisc-cc-o4 ${MYFLAGS} + +make clean + +# Hack the Makefiles to pick up the dynamic libraries during linking +# +sed 's/^PEX_LIBS=.*$/PEX_LIBS=-L\/usr\/local\/ssl\/lib -Wl,+b,\/usr\/local\/ssl\/lib:\/usr\/lib/' Makefile.ssl >xxx; mv xxx Makefile.ssl +sed 's/-L\.\.//' apps/Makefile.ssl >xxx; mv xxx apps/Makefile.ssl +sed 's/-L\.\.//' test/Makefile.ssl >xxx; mv xxx test/Makefile.ssl +# Build the static libs and the executables in one make. +make +# Install everything +make install + +# Finally build the static libs with +O3. This time we only need the libraries, +# once created, they are simply copied into place. +# +perl5 Configure hpux-parisc-cc ${MYFLAGS} +make clean +make DIRS="crypto ssl" +chmod 644 libcrypto.a libssl.a +cp -p libcrypto.a libssl.a /usr/local/ssl/lib