Hi,
I have built openssl 0.9.6b on HPUX 10.10 & 10.20 with gcc and the
native HP linker .
The seperate script & makefile for bulding HPUX shared libs (with HPUX
compiler) is pretty clumsy and not necessary. I also dont use HPUX
development tools (GCC & friends are much better value for money 8-).
So I made changes to Configure and Makefile.org to integrate building
the shared librraies back into the main build process.
The biggest issues are that :
1. the HPUX linker doesnt have the capability to build shared libs (.sl)
directly from archive libs (.a)
2. shared libs must be executable to be loaded by the dynamic loader
To deal with (1) I updated all the HPUX-(PARISC/10)-GCC entries in the
Configure compile target table, and added some makefile macros, a suffix
rule and various targets that handle generating intermediate object file
lists and then assembling them into shared libraries based on the
previously generated archive libs.
To handle (2) I have introduced another Makefile macro - SHLIB_PERMS,
and a corresponding extra parameter in the Configure script -
$shared_perms. The default in Makefile.org is 644, but can be overidden
via an entry in the compile target parameter table, which needs to be
755 for HPUX10. There may be a better way to handle this, but I was in a
bit of a hurry.
Perhaps the same thing could be done for the HPUX compiler , but since I
dont own one, I have stuck to just supporting the gcc targets
Some work still needs to done on generating appropriate links to
alternate shared lib names that specify the library version. IN HPUX
speak its usually libssl.n linked to libssl.sl where n is the major
version number.
The current scripts cant deal with this namespace
Regards,
Peter Farmer | Custom XML software | Internet Engineering
Zveno Pty Ltd | Website XML Solutions | Training & Seminars
http://www.zveno.com/ | Open Source Tools | - XML XSL Tcl
[EMAIL PROTECTED] +------------------------+---------------------
Ph. +61 8 92036380 | Mobile +61 417 906 851 | Fax +61 8 92036380
*** Makefile.org 2001/09/05 07:36:41 1.1
--- Makefile.org 2001/09/05 09:44:39
***************
*** 14,19 ****
--- 14,21 ----
OPTIONS=
CONFIGURE_ARGS=
SHLIB_TARGET=
+ SHLIB_PERMS=644
+
# INSTALL_PREFIX is for package builders so that they can configure
# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
***************
*** 183,188 ****
--- 185,192 ----
SHARED_SSL=libssl$(SHLIB_EXT)
SHARED_LIBS=
SHARED_LIBS_LINK_EXTS=
+ SHLIB_OBJLISTS= libcrypto.objlist libssl.objlist
+
GENERAL= Makefile
BASENAME= openssl
***************
*** 262,267 ****
--- 266,300 ----
libs="$$libs -l$$i"; \
done
+ # HPUX + GCC shared library specific targets
+ # This assumes that the native ld is used
+
+
+ # collects all object files for *.a
+ .SUFFIXES : .a .objlist
+
+ .a.objlist:
+ for obj in `ar t $<`; \
+ do \
+ grep /$$obj allobjs.txt; \
+ done >$*.objlist ;
+
+ allobjs.txt:
+ find . -name \*.o -print > $@
+
+ objlists: allobjs.txt $(SHLIB_OBJLISTS)
+
+ $(SHLIB_OBJLISTS): ${$@:.objlist=.a}
+
+ do_hpux-gcc-shared: allobjs.txt $(SHLIB_OBJLISTS)
+ libs='-L. ${SHLIBDEPS}'; \
+ for i in ${SHLIBDIRS}; do \
+ ${CC} ${CFLAG} -shared -Wl,+s -o lib$$i.$(SHLIB_MAJOR) `cat lib$$i.objlist`
+$$libs ${EX_LIBS} -lc || exit 1; \
+ rm -f lib$$i$(SHLIB_EXT); ln -s lib$$i.$(SHLIB_MAJOR) lib$$i$(SHLIB_EXT) ;\
+ libs="$$libs -l$$i"; \
+ done
+ # END HPUX + GCC shared libs targets
+
# This assumes that GNU utilities are *not* used
do_tru64-shared:
libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
***************
*** 460,466 ****
if [ -f "$$i" ]; then \
( echo installing $$i; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
! chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
fi \
done; \
( here="`pwd`"; \
--- 493,499 ----
if [ -f "$$i" ]; then \
( echo installing $$i; \
cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
! chmod $(SHLIB_PERMS)
$(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
fi \
done; \
( here="`pwd`"; \
*** Configure 2001/09/05 07:37:36 1.1
--- Configure 2001/09/05 09:08:10
***************
*** 97,103 ****
# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1.
# So the md5_locl.h file has an undef B_ENDIAN if sun is defined
! #config-string $cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops :
$bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj :
$rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag
my %table=(
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
--- 97,103 ----
# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1.
# So the md5_locl.h file has an undef B_ENDIAN if sun is defined
! #config-string $cc : $cflags : $unistd : $thread_cflag : $lflags : $bn_ops :
$bn_obj : $des_obj : $bf_obj : $md5_obj : $sha1_obj : $cast_obj : $rc4_obj :
$rmd160_obj : $rc5_obj : $dso_scheme : $shared_target : $shared_cflag : $shared_perms
my %table=(
# File 'TABLE' (created by 'make TABLE') contains the data from this list,
***************
*** 223,229 ****
#!#"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",
# More attempts at unified 10.X and 11.X targets for HP C compiler.
--- 223,229 ----
#!#"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:hpux-gcc-shared:-fPIC:.sl::755",
"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",
# More attempts at unified 10.X and 11.X targets for HP C compiler.
***************
*** 245,262 ****
# mailing list.
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2
-z::(unknown):-ldld: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",
# 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 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",
# 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-gcc", "gcc:-DB_ENDIAN -DBN_DIV2W -O3::-D_REENTRANT:-ldld:BN_LLONG DES_PTR
DES_UNROLL DES_RISC1::::::::::dl",
# 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",
# HPUX 11.X from www.globus.org.
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
--- 245,262 ----
# mailing list.
"hpux-brokencc", "cc:-DB_ENDIAN -DBN_DIV2W -Ae +ESlit +O2
-z::(unknown):-ldld:DES_PTR DES_UNROLL DES_RISC1::::::::::dl",
! "hpux-gcc", "gcc:-O3 -DB_ENDIAN -DBN_DIV2W::(unknown):-ldld:BN_LLONG DES_PTR
DES_UNROLL DES_RISC1::::::::::dl:hpux-gcc-shared:-fPIC:.sl::755",
# If hpux-gcc fails, try this one:
! "hpux-brokengcc", "gcc:-O3 -DB_ENDIAN -DBN_DIV2W::(unknown):-ldld:DES_PTR
DES_UNROLL DES_RISC1::::::::::dl:hpux-gcc-shared:-fPIC:.sl::755",
# 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",
# 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-gcc", "gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-ldld:BN_LLONG DES_PTR
DES_UNROLL DES_RISC1::::::::::dl:hpux-gcc-shared:-fPIC:.sl::755",
# If hpux10-gcc fails, try this one:
! "hpux10-brokengcc", "gcc:-O3 -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:-ldld:DES_PTR
DES_UNROLL DES_RISC1::::::::::dl:hpux-gcc-shared:-fPIC:.sl::755",
# HPUX 11.X from www.globus.org.
# Only works on PA-RISC 2.0 cpus, and not optimized. Why?
***************
*** 656,662 ****
print "IsWindows=$IsWindows\n";
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,my $bn_obj,my
$des_obj,my $bf_obj,
! $md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj,my
$dso_scheme,my $shared_target,my $shared_cflag,my $shared_extension,my $ranlib)=
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
$cflags="$flags$cflags" if ($flags ne "");
--- 656,662 ----
print "IsWindows=$IsWindows\n";
(my $cc,my $cflags,my $unistd,my $thread_cflag,my $lflags,my $bn_ops,my $bn_obj,my
$des_obj,my $bf_obj,
! $md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj,my
$dso_scheme,my $shared_target,my $shared_cflag,my $shared_extension,my $ranlib,my
$shared_perms)=
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
$cflags="$flags$cflags" if ($flags ne "");
***************
*** 859,864 ****
--- 859,865 ----
s/^RANLIB=.*/RANLIB= $ranlib/;
s/^PERL=.*/PERL= $perl/;
s/^SHLIB_TARGET=.*/SHLIB_TARGET=$shared_target/;
+ s/^SHLIB_PERMS=.*/SHLIB_PERMS=$shared_perms/;
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]$/);
***************
*** 1149,1155 ****
my $bn_obj,my $des_obj,my $bf_obj,
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,
! my $shared_extension,my $ranlib)=
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
print <<EOF
--- 1150,1156 ----
my $bn_obj,my $des_obj,my $bf_obj,
my $md5_obj,my $sha1_obj,my $cast_obj,my $rc4_obj,my $rmd160_obj,
my $rc5_obj,my $dso_scheme,my $shared_target,my $shared_cflag,
! my $shared_extension,my $ranlib, my $shared_perms)=
split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
print <<EOF
***************
*** 1175,1179 ****
--- 1176,1181 ----
\$shared_cflag = $shared_cflag
\$shared_extension = $shared_extension
\$ranlib = $ranlib
+ \$shared_perms = $shared_perms
EOF
}