/proc/cpuinfo can have several lines containing the word "type". We want the one...
[openssl.git] / shlib / hpux10-cc.sh
1 #!/usr/bin/sh
2 #
3 # Run this script from the OpenSSL root directory:
4 # sh shlib/hpux10-cc.sh
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
22 #          128MB of RAM available and that your kernel is configured to allow
23 #          at least 128MB data size (maxdsiz parameter).
24 #          The installation process can take several hours, even on fast
25 #          machines. +O4 optimization of the libcrypto.sl shared library may
26 #          take 1 hour on a C200 (200MHz PA8200 CPU), +O3 compilation of
27 #          fcrypt_b.c can take 20 minutes on this machine. Stay patient.
28 #
29 # SITEFLAGS: site specific flags. I do use +DAportable, since I have to
30 # support older PA1.1-type CPUs. Your mileage may vary.
31 # +w1 enables enhanced warnings, useful when working with snaphots.
32 #
33 SITEFLAGS="+DAportable +w1"
34 #
35 # Set the default additions to build with HP-UX.
36 # -D_REENTRANT must/should be defined on HP-UX manually, since we do call
37 # Configure directly.
38 # +Oall increases the optimization done.
39 #
40 MYFLAGS="-D_REENTRANT +Oall $SITEFLAGS"
41
42 # Configure for pic and build the static pic libraries
43 perl5 Configure hpux-parisc-cc-o4 +z ${MYFLAGS}
44 make clean
45 make DIRS="crypto ssl"
46 # Rename the static pic libs and build dynamic libraries from them
47 # Be prepared to see a lot of warnings about shared libraries being built
48 # with optimizations higher than +O2. When using these libraries, it is
49 # not possible to replace internal library functions with functions from
50 # the program to be linked.
51 #
52 make -f shlib/Makefile.hpux10-cc
53
54 # Copy the libraries to /usr/local/ssl/lib (they have to be in their
55 # final location when linking applications).
56 # If the directories are still there, no problem.
57 mkdir /usr/local
58 mkdir /usr/local/ssl
59 mkdir /usr/local/ssl/lib
60 chmod 444 lib*_pic.a
61 chmod 555 lib*.so.1
62 cp -p lib*_pic.a lib*.so.1 /usr/local/ssl/lib
63 (cd /usr/local/ssl/lib ; ln -sf libcrypto.so.1 libcrypto.sl ; ln -sf libssl.so.1 libssl.sl)
64
65 # Reconfigure without pic to compile the executables. Unfortunately, while
66 # performing this task we have to recompile the library components, even
67 # though we use the already installed shared libs anyway.
68 #
69 perl5 Configure hpux-parisc-cc-o4 ${MYFLAGS}
70
71 make clean
72
73 # Hack the Makefiles to pick up the dynamic libraries during linking
74 #
75 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
76 sed 's/-L\.\.//' apps/Makefile.ssl >xxx; mv xxx apps/Makefile.ssl
77 sed 's/-L\.\.//' test/Makefile.ssl >xxx; mv xxx test/Makefile.ssl
78 # Build the static libs and the executables in one make.
79 make
80 # Install everything
81 make install
82
83 # Finally build the static libs with +O3. This time we only need the libraries,
84 # once created, they are simply copied into place.
85 #
86 perl5 Configure hpux-parisc-cc ${MYFLAGS}
87 make clean
88 make DIRS="crypto ssl"
89 chmod 644 libcrypto.a libssl.a
90 cp -p libcrypto.a libssl.a /usr/local/ssl/lib