]> git.ipfire.org Git - thirdparty/openssl.git/blame - shlib/hpux10-cc.sh
[crypto/asn1/x_bignum.c] Explicit test against NULL
[thirdparty/openssl.git] / shlib / hpux10-cc.sh
CommitLineData
a4709b3d 1#!/usr/bin/sh
3bead95b
RL
2#
3# Run this script from the OpenSSL root directory:
4# sh shlib/hpux10-cc.sh
a4709b3d
UM
5#
6# HP-UX (10.20) shared library installation:
7# Compile and install OpenSSL with best possible optimization:
8# - shared libraries are compiled and installed with +O4 optimization
9# - executable(s) are compiled and installed with +O4 optimization
10# - static libraries are compiled and installed with +O3 optimization,
11# to avoid the time consuming +O4 link-time optimization when using
12# these libraries. (The shared libs are already optimized during build
13# at +O4.)
14#
15# This script must be run with appropriate privileges to install into
16# /usr/local/ssl. HP-UX prevents used executables and shared libraries
17# from being deleted or overwritten. Stop all processes using already
18# installed items of OpenSSL.
19#
20# WARNING: At high optimization levels, HP's ANSI-C compiler can chew up
21# large amounts of memory and CPU time. Make sure to have at least
3bead95b 22# 128MB of RAM available and that your kernel is configured to allow
ed001528
AP
23# at least 128MB data size (maxdsiz parameter which can be obtained
24# by multiplying 'echo maxdsiz/D | adb -k /stand/vmunix /dev/kmem'
25# by 'getconf PAGE_SIZE').
a4709b3d 26# The installation process can take several hours, even on fast
3bead95b 27# machines. +O4 optimization of the libcrypto.sl shared library may
a4709b3d
UM
28# take 1 hour on a C200 (200MHz PA8200 CPU), +O3 compilation of
29# fcrypt_b.c can take 20 minutes on this machine. Stay patient.
30#
31# SITEFLAGS: site specific flags. I do use +DAportable, since I have to
32# support older PA1.1-type CPUs. Your mileage may vary.
33# +w1 enables enhanced warnings, useful when working with snaphots.
34#
35SITEFLAGS="+DAportable +w1"
36#
37# Set the default additions to build with HP-UX.
38# -D_REENTRANT must/should be defined on HP-UX manually, since we do call
3bead95b 39# Configure directly.
a4709b3d
UM
40# +Oall increases the optimization done.
41#
42MYFLAGS="-D_REENTRANT +Oall $SITEFLAGS"
43
44# Configure for pic and build the static pic libraries
b4a26283 45perl5 Configure no-shared hpux-parisc-cc-o4 +Z ${MYFLAGS}
a4709b3d
UM
46make clean
47make DIRS="crypto ssl"
48# Rename the static pic libs and build dynamic libraries from them
49# Be prepared to see a lot of warnings about shared libraries being built
50# with optimizations higher than +O2. When using these libraries, it is
51# not possible to replace internal library functions with functions from
52# the program to be linked.
53#
54make -f shlib/Makefile.hpux10-cc
55
56# Copy the libraries to /usr/local/ssl/lib (they have to be in their
57# final location when linking applications).
58# If the directories are still there, no problem.
59mkdir /usr/local
60mkdir /usr/local/ssl
61mkdir /usr/local/ssl/lib
62chmod 444 lib*_pic.a
b4a26283
LJ
63chmod 555 lib*.sl.0.9.8
64cp -p lib*_pic.a lib*.sl.0.9.8 /usr/local/ssl/lib
65(cd /usr/local/ssl/lib ; ln -sf libcrypto.sl.0.9.8 libcrypto.sl ; ln -sf libssl.sl.0.9.8 libssl.sl)
a4709b3d
UM
66
67# Reconfigure without pic to compile the executables. Unfortunately, while
68# performing this task we have to recompile the library components, even
69# though we use the already installed shared libs anyway.
70#
b4a26283 71perl5 Configure no-shared hpux-parisc-cc-o4 ${MYFLAGS}
a4709b3d
UM
72
73make clean
74
75# Hack the Makefiles to pick up the dynamic libraries during linking
76#
b4a26283 77sed 's/^PEX_LIBS=.*$/PEX_LIBS=-L\/usr\/local\/ssl\/lib/' Makefile.ssl >xxx; mv xxx Makefile.ssl
a4709b3d
UM
78sed 's/-L\.\.//' apps/Makefile.ssl >xxx; mv xxx apps/Makefile.ssl
79sed 's/-L\.\.//' test/Makefile.ssl >xxx; mv xxx test/Makefile.ssl
80# Build the static libs and the executables in one make.
81make
82# Install everything
83make install
84
85# Finally build the static libs with +O3. This time we only need the libraries,
86# once created, they are simply copied into place.
87#
b4a26283 88perl5 Configure no-shared hpux-parisc-cc ${MYFLAGS}
a4709b3d
UM
89make clean
90make DIRS="crypto ssl"
91chmod 644 libcrypto.a libssl.a
92cp -p libcrypto.a libssl.a /usr/local/ssl/lib