hpux10-cc.sh 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 which can be obtained
  24. # by multiplying 'echo maxdsiz/D | adb -k /stand/vmunix /dev/kmem'
  25. # by 'getconf PAGE_SIZE').
  26. # The installation process can take several hours, even on fast
  27. # machines. +O4 optimization of the libcrypto.sl shared library may
  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. #
  35. SITEFLAGS="+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
  39. # Configure directly.
  40. # +Oall increases the optimization done.
  41. #
  42. MYFLAGS="-D_REENTRANT +Oall $SITEFLAGS"
  43. # Configure for pic and build the static pic libraries
  44. perl5 Configure no-shared hpux-parisc-cc-o4 +Z ${MYFLAGS}
  45. make clean
  46. make DIRS="crypto ssl"
  47. # Rename the static pic libs and build dynamic libraries from them
  48. # Be prepared to see a lot of warnings about shared libraries being built
  49. # with optimizations higher than +O2. When using these libraries, it is
  50. # not possible to replace internal library functions with functions from
  51. # the program to be linked.
  52. #
  53. make -f shlib/Makefile.hpux10-cc
  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*.sl.0.9.8
  62. cp -p lib*_pic.a lib*.sl.0.9.8 /usr/local/ssl/lib
  63. (cd /usr/local/ssl/lib ; ln -sf libcrypto.sl.0.9.8 libcrypto.sl ; ln -sf libssl.sl.0.9.8 libssl.sl)
  64. # Reconfigure without pic to compile the executables. Unfortunately, while
  65. # performing this task we have to recompile the library components, even
  66. # though we use the already installed shared libs anyway.
  67. #
  68. perl5 Configure no-shared hpux-parisc-cc-o4 ${MYFLAGS}
  69. make clean
  70. # Hack the Makefiles to pick up the dynamic libraries during linking
  71. #
  72. sed 's/^PEX_LIBS=.*$/PEX_LIBS=-L\/usr\/local\/ssl\/lib/' Makefile.ssl >xxx; mv xxx Makefile.ssl
  73. sed 's/-L\.\.//' apps/Makefile.ssl >xxx; mv xxx apps/Makefile.ssl
  74. sed 's/-L\.\.//' test/Makefile.ssl >xxx; mv xxx test/Makefile.ssl
  75. # Build the static libs and the executables in one make.
  76. make
  77. # Install everything
  78. make install
  79. # Finally build the static libs with +O3. This time we only need the libraries,
  80. # once created, they are simply copied into place.
  81. #
  82. perl5 Configure no-shared hpux-parisc-cc ${MYFLAGS}
  83. make clean
  84. make DIRS="crypto ssl"
  85. chmod 644 libcrypto.a libssl.a
  86. cp -p libcrypto.a libssl.a /usr/local/ssl/lib