Add what's needed to get shared libraries on HP-UX.
authorRichard Levitte <levitte@openssl.org>
Sat, 21 Oct 2000 21:24:11 +0000 (21:24 +0000)
committerRichard Levitte <levitte@openssl.org>
Sat, 21 Oct 2000 21:24:11 +0000 (21:24 +0000)
N.B.: This has not been tested at all, that's my next step.

CHANGES
Configure
Makefile.org
TABLE

diff --git a/CHANGES b/CHANGES
index e1a0fa4..2e02f87 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@
 
  Changes between 0.9.6 and 0.9.7  [xx XXX 2000]
 
+  *) Add the possibility to create shared libraries on HP-UX
+     [Richard Levitte]
+
   *) Fix for SHA1 assembly problem with MASM: it produces
      warnings about corrupt line number information when assembling
      with debugging information. This is caused by the overlapping
index 179af60..3f6d3ad 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -214,41 +214,41 @@ my %table=(
 #
 #!#"hpux-parisc-cc","cc:-Ae +O3 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
 # Since there is mention of this in shlib/hpux10-cc.sh
-"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
-"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
-"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn",
+"hpux-parisc-cc-o4","cc:-Ae +O4 +ESlit -z -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"hpux-parisc-gcc","gcc:-O3 -DB_ENDIAN -DBN_DIV2W:::-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"hpux64-parisc-cc","cc:-Ae +DD64 +O3 +ESlit -z -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 # More attempts at unified 10.X and 11.X targets for HP C compiler.
 #
 # Chris Ruemmler <ruemmler@cup.hp.com>
 # Kevin Steves <ks@hp.se>
-"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
-"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl",
-"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn",
-"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl",
+"hpux-parisc-cc","cc:+O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"hpux-parisc2-cc","cc:+DA2.0 +DS2.0 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:SIXTY_FOUR_BIT MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2.o:::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"hpux64-parisc2-cc","cc:+DD64 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldl:SIXTY_FOUR_BIT_LONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT:asm/pa-risc2W.o:::::::::dlfcn:hpux64-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"hpux-parisc1_1-cc","cc:+DA1.1 +DS1.1 +O3 +Optrs_strongly_typed +Olibcalls -Ae +ESlit -DB_ENDIAN -DMD32_XARRAY::-D_REENTRANT:-ldld:MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC1 DES_INT::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 # HPUX 9.X config.
 # Don't use the bundled cc.  It is broken.  Use HP ANSI C if possible, or
 # egcs.  gcc 2.8.1 is also broken.
 
-"hpux-cc",     "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux-cc",     "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 # If hpux-cc fails (e.g. during "make test"), try the next one; otherwise,
 # please report your OS and compiler version to the openssl-bugs@openssl.org
 # mailing list.
-"hpux-brokencc",       "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux-brokencc",       "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
-"hpux-gcc",    "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux-gcc",    "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 # If hpux-gcc fails, try this one:
-"hpux-brokengcc",      "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux-brokengcc",      "gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 # HPUX 10.X config.  Supports threads.
-"hpux10-cc",   "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux10-cc",   "cc:-DB_ENDIAN -DBN_DIV2W -DMD32_XARRAY -Ae +ESlit +O3 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 # If hpux10-cc fails, try this one (if still fails, try deleting BN_LLONG):
-"hpux10-brokencc",     "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux10-brokencc",     "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2 -z::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:+Z:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
-"hpux10-gcc",  "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux10-gcc",  "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 # If hpux10-gcc fails, try this one:
-"hpux10-brokengcc",    "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
+"hpux10-brokengcc",    "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl:hpux-shared:-fPIC:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 # HPUX 11.X from www.globus.org.
 # Only works on PA-RISC 2.0 cpus, and not optimized.  Why?
@@ -831,7 +831,16 @@ while (<IN>)
        s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
        s/^SHLIB_MARK=.*/SHLIB_MARK=$shared_mark/;
        s/^SHARED_LIBS=.*/SHARED_LIBS=\$(SHARED_CRYPTO) \$(SHARED_SSL)/ if (!$no_shared);
-       s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.so.\$(SHLIB_MAJOR) .so/ if ($shared_extension ne "" && $shared_extension !~ /^\.s[ol]$/);
+       if ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*$/)
+               {
+               my $sotmp = $1;
+               s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp/
+               }
+       elsif ($shared_extension ne "" && $shared_extension =~ /^\.s([ol])\.[^\.]*\.[^\.]*$/)
+               {
+               my $sotmp = $1;
+               s/^SHARED_LIBS_LINK_EXTS=.*/SHARED_LIBS_LINK_EXTS=.s$sotmp.\$(SHLIB_MAJOR) .s$sotmp/;
+               }
        print OUT $_."\n";
        }
 close(IN);
index 557cc43..1e6e5fc 100644 (file)
@@ -278,6 +278,24 @@ do_solaris-shared:
        libs="$$libs -L. -l$$i"; \
        done
 
+# This assumes that GNU utilities are *not* used
+do_hpux-shared:
+       libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; /usr/ccs/bin/ld -b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               -Fl lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -L. -l$$i"; \
+       done
+
+# This assumes that GNU utilities are *not* used
+do_hpux64-shared:
+       libs='${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
+       ( set -x; /usr/ccs/bin/ld -b -z -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
+               +forceload lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \
+       libs="$$libs -L. -l$$i"; \
+       done
+
 Makefile.ssl: Makefile.org
        @echo "Makefile.ssl is older than Makefile.org."
        @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
diff --git a/TABLE b/TABLE
index 4abc2fa..5731d07 100644 (file)
--- a/TABLE
+++ b/TABLE
@@ -1172,9 +1172,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-brokengcc
 $cc           = gcc
@@ -1193,9 +1193,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = -fPIC
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-cc
 $cc           = cc
@@ -1214,9 +1214,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-gcc
 $cc           = gcc
@@ -1235,9 +1235,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = -fPIC
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-parisc-cc
 $cc           = cc
@@ -1256,9 +1256,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-parisc-cc-o4
 $cc           = cc
@@ -1277,9 +1277,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-parisc-gcc
 $cc           = gcc
@@ -1298,9 +1298,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = -fPIC
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-parisc1_1-cc
 $cc           = cc
@@ -1319,9 +1319,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux-parisc2-cc
 $cc           = cc
@@ -1340,9 +1340,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux10-brokencc
 $cc           = cc
@@ -1361,9 +1361,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux10-brokengcc
 $cc           = gcc
@@ -1382,9 +1382,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = -fPIC
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux10-cc
 $cc           = cc
@@ -1403,9 +1403,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux10-gcc
 $cc           = gcc
@@ -1424,9 +1424,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dl
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux-shared
+$shared_cflag = -fPIC
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux64-parisc-cc
 $cc           = cc
@@ -1445,9 +1445,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dlfcn
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux64-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** hpux64-parisc2-cc
 $cc           = cc
@@ -1466,9 +1466,9 @@ $rc4_obj      =
 $rmd160_obj   = 
 $rc5_obj      = 
 $dso_scheme   = dlfcn
-$shared_target= 
-$shared_cflag = 
-$shared_extension = 
+$shared_target= hpux64-shared
+$shared_cflag = +Z
+$shared_extension = .sl.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 
 *** irix-cc
 $cc           = cc