Ok, to followup my initial message, I was finally able to get openssl to
compile on our SunOS 4.1.4 architecture.  However, not without some grief :-(

To get it to work (on the most recent snapshot available this morning) I
needed to fix one syntax error, one omitted .h file and one missing library.

I've generated a 'mydiffs.patch' as per the README which I've included below,
after the rest of my message... so be patient :)  But first, a synopsis.

Oh yeah, './Configure dist; make clean' does *not* clean out files created
in 'certs' and 'test' by previous 'makes'.  I had to remove files from
these two directories by hand to get my 'working' directory tree down to a
minimal difference for the 'source' tree.

I am *not* an openssl guru.  If there are better solutions *please* implement
them :-)  I just wanna get it installed on our 5+ flavor OS network :)
G.H.A.
---
Gordon H. Atwood                                  E-mail:  [EMAIL PROTECTED]
Research System Administrator                 Phone:  (780) 492-9930
Department of Computing Science           Fax:  (780) 492-1071
University of Alberta                 WWW:  http://web.cs.ualberta.ca:80/~gordon

===

Problem #1

  sawnlk$ make
  making all in crypto...
  ( echo "#ifndef MK1MF_BUILD"; \
  echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
  echo "  #define CFLAGS \"gcc -O3 -mv8 -Dssize_t=int\""; \
  echo "  #define PLATFORM \"sunos-gcc\""; \
  echo "  #define DATE \"`date`\""; \
  echo "#endif" ) >buildinf.h
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  cryptlib.c
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  mem.c
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  mem_dbg.c
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  cversion.c
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  ex_data.c
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  tmdiff.c
  gcc -I. -I../include -O3 -mv8 -Dssize_t=int  -target sun4 -c  cpt_err.c
  In file included from cpt_err.c:62:
  ../include/openssl/err.h:236: parse error before `size_t'
  *** Error code 1
  make: Fatal error: Command failed for target `cpt_err.o'
  Current working directory /usr/sibbald2/depot/openSSL/openssl-SNAP-20000601/crypto
  *** Error code 1
  make: Fatal error: Command failed for target `all'

---

Solution: 

Inserted '#include <stdlib.h>' into include/openssl/err.h

  #ifndef NO_FP_API
  #include <stdio.h>
  #include <stdlib.h>
  ^^^^^^^^^^^^^^^^^^^
  #endif

===

Problem #2

  sawnlk$ gcc -I.. -I../../include -O3 -mv8 -Dssize_t=int -target sun4 -c 
bio_ok.cbio_ok.c: In function `sig_in':
  bio_ok.c:509: `n' undeclared (first use this function)
  bio_ok.c:509: (Each undeclared identifier is reported only once
  bio_ok.c:509: for each function it appears in.)

---

Solution:

Finally tracked this down to
./include/openssl/e_os.h
  #if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
  #define memmove(s1,s2,b) bcopy((s2),(s1),(n))
  #endif

Changed the define:
  #define memmove(s1,s2,b) bcopy((s2),(s1),(b))
                                            ^
===

Problem #3

Essentially the same problem I reported yesterday, sans the complaint about
'memmove':

  gcc -o openssl -DMONOLITH -I../include -O3 -mv8 -Dssize_t=int openssl.o verify.o 
asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o  ca.o pkcs7.o 
crl2p7.o crl.o  rsa.o dsa.o dsaparam.o  x509.o genrsa.o gendsa.o s_server.o s_client.o 
speed.o  s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o  ciphers.o 
nseq.o pkcs12.o pkcs8.o spkac.o smime.o rand.o -L. -L.. -L../.. -L../../.. -L.. -lssl 
-L.. -lcrypto 
  collect2: ld returned 2 exit status
  ld: Undefined symbol 
   _strtoul 
   _strerror 
  *** Error code 1
  make: Fatal error: Command failed for target `openssl'
  Current working directory /usr/sibbald2/depot/openSSL/openssl-SNAP-20000601/apps
  *** Error code 1
  make: Fatal error: Command failed for target `all'

Solution:

A lot more hassle.  Searched thru a local copy of gcc-xxxx and eventually
found that strtoul and strerror were actually coded.  Then looked around until
I found a library with them.  Eventually found them in /usr/gnu/lib/libiberty.a

I know little about the internals of gcc and how installations vary so I can
only *hope* that this is where they get stuck on all SunOS 4.1.x installs :-)

BTW:  there is a 'memmove' defined there as well if anyone cares.

So... redefine EX_LIBS in the root Makefile:

  PEX_LIBS= -L. -L.. -L../.. -L../../..
  EX_LIBS=-liberty
          ^^^^^^^^
  AR=ar r

===

Hope that is clear.  Now it runs thru the 'make; make test' with no complaints.

Finally, the aforementioned 'mydiffs.patch' file:

===
diff -urN orig/Makefile openssl-SNAP-20000601/mycopy/Makefile
--- orig/Makefile       Fri Jun  2 16:41:45 2000
+++ openssl-SNAP-20000601/mycopy/Makefile       Fri Jun  2 17:09:30 2000
@@ -52,7 +52,7 @@
 CFLAG= -O
 DEPFLAG= 
 PEX_LIBS= -L. -L.. -L../.. -L../../..
-EX_LIBS= 
+EX_LIBS=-liberty
 AR=ar r
 RANLIB= /bin/ranlib
 PERL= /usr/local/bin/perl5
diff -urN orig/Makefile.ssl openssl-SNAP-20000601/mycopy/Makefile.ssl
--- orig/Makefile.ssl   Fri Jun  2 16:41:45 2000
+++ openssl-SNAP-20000601/mycopy/Makefile.ssl   Fri Jun  2 17:09:30 2000
@@ -52,7 +52,7 @@
 CFLAG= -O
 DEPFLAG= 
 PEX_LIBS= -L. -L.. -L../.. -L../../..
-EX_LIBS= 
+EX_LIBS=-liberty
 AR=ar r
 RANLIB= /bin/ranlib
 PERL= /usr/local/bin/perl5
diff -urN orig/crypto/err/err.h openssl-SNAP-20000601/mycopy/crypto/err/err.h
--- orig/crypto/err/err.h       Tue May  2 07:00:39 2000
+++ openssl-SNAP-20000601/mycopy/crypto/err/err.h       Fri Jun  2 08:44:53 2000@@ 
+-61,6 +61,7 @@
 
 #ifndef NO_FP_API
 #include <stdio.h>
+#include <stdlib.h>
 #endif
 
 #ifdef __cplusplus
diff -urN orig/e_os.h openssl-SNAP-20000601/mycopy/e_os.h
--- orig/e_os.h Wed May 31 11:00:06 2000
+++ openssl-SNAP-20000601/mycopy/e_os.h Fri Jun  2 10:32:42 2000
@@ -404,7 +404,7 @@
 #endif
 
 #if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
-#define memmove(s1,s2,b) bcopy((s2),(s1),(n))
+#define memmove(s1,s2,b) bcopy((s2),(s1),(b))
 #endif
 
 /***********************************************/
diff -urN orig/include/openssl/e_os.h 
openssl-SNAP-20000601/mycopy/include/openssl/e_os.h
--- orig/include/openssl/e_os.h Wed May 31 11:00:06 2000
+++ openssl-SNAP-20000601/mycopy/include/openssl/e_os.h Fri Jun  2 10:32:42 2000@@ 
+-404,7 +404,7 @@
 #endif
 
 #if defined(sun) && !defined(__svr4__) && !defined(__SVR4)
-#define memmove(s1,s2,b) bcopy((s2),(s1),(n))
+#define memmove(s1,s2,b) bcopy((s2),(s1),(b))
 #endif
 
 /***********************************************/
diff -urN orig/include/openssl/err.h openssl-SNAP-20000601/mycopy/include/openssl/err.h
--- orig/include/openssl/err.h  Tue May  2 07:00:39 2000
+++ openssl-SNAP-20000601/mycopy/include/openssl/err.h  Fri Jun  2 08:44:53 2000@@ 
+-61,6 +61,7 @@
 
 #ifndef NO_FP_API
 #include <stdio.h>
+#include <stdlib.h>
 #endif
 
 #ifdef __cplusplus
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to