Problems compiling cyrus-sasl on solaris boxen
[ link: sasl_solaris | tags: solaris | updated: Fri, 17 Apr 2020 12:12:08 -0400 ]
I was trying to compile cyrus-sasl on solaris 8 using gcc 3.4.6 and having a bitch of a time getting it to configure right. It was not finding the openssl that I had installed locally into a custom directory. Also, I was getting lots of "digestmd5.c:XXX: error:" statements during the failed make.
Here is what was happening during the configure. Note its not finding openssl even though I specified
--with-openssl=/path/to/openssl on my configure statement:
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for EVP_DigestInit in -lcrypto... no
checking for OpenSSL... no
checking DIGEST-MD5... enabled
configure: WARNING: OpenSSL not found -- OTP will be disabled
checking OTP... disabled
configure: WARNING: OpenSSL not found -- SRP will be disabled
checking SRP... disabled
checking KERBEROS_V4... disabled
checking for crypt... yes
Next, during the make, I was seeing these errors:
digestmd5.c:812: error: syntax error before "des_key_schedule"
digestmd5.c:812: warning: no semicolon at end of struct or union
digestmd5.c:813: warning: type defaults to `int' in declaration of `ivec'
digestmd5.c:813: warning: data definition has no type or storage class
digestmd5.c:814: error: syntax error before "keysched2"
digestmd5.c:814: warning: type defaults to `int' in declaration of `keysched2'
digestmd5.c:814: warning: data definition has no type or storage class
digestmd5.c: In function `dec_3des':
digestmd5.c:849: warning: implicit declaration of function `des_ede2_cbc_encrypt'
digestmd5.c:852: error: dereferencing pointer to incomplete type
digestmd5.c:853: error: dereferencing pointer to incomplete type
digestmd5.c:854: error: dereferencing pointer to incomplete type
digestmd5.c:855: error: `DES_DECRYPT' undeclared (first use in this function)
digestmd5.c:855: error: (Each undeclared identifier is reported only once
digestmd5.c:855: error: for each function it appears in.)
digestmd5.c: In function `enc_3des':
digestmd5.c:900: error: dereferencing pointer to incomplete type
digestmd5.c:901: error: dereferencing pointer to incomplete type
digestmd5.c:902: error: dereferencing pointer to incomplete type
digestmd5.c:903: error: `DES_ENCRYPT' undeclared (first use in this function)
digestmd5.c: In function `init_3des':
digestmd5.c:918: error: invalid application of `sizeof' to incomplete type `digestmd5.c'
digestmd5.c:923: warning: implicit declaration of function `des_key_sched'
digestmd5.c:923: error: `des_cblock' undeclared (first use in this function)
digestmd5.c:923: error: syntax error before ')' token
digestmd5.c:927: error: syntax error before ')' token
digestmd5.c:929: error: dereferencing pointer to incomplete type
digestmd5.c:934: error: increment of pointer to unknown structure
digestmd5.c:934: error: arithmetic on pointer to an incomplete type
digestmd5.c:936: error: syntax error before ')' token
digestmd5.c:940: error: syntax error before ')' token
digestmd5.c:943: error: dereferencing pointer to incomplete type
digestmd5.c: In function `dec_des':
digestmd5.c:967: warning: implicit declaration of function `des_cbc_encrypt'
digestmd5.c:970: error: dereferencing pointer to incomplete type
digestmd5.c:971: error: dereferencing pointer to incomplete type
digestmd5.c:972: error: `DES_DECRYPT' undeclared (first use in this function)
digestmd5.c:976: error: dereferencing pointer to incomplete type
digestmd5.c: In function `enc_des':
digestmd5.c:1021: error: dereferencing pointer to incomplete type
digestmd5.c:1022: error: dereferencing pointer to incomplete type
digestmd5.c:1023: error: `DES_ENCRYPT' undeclared (first use in this function)
digestmd5.c:1027: error: dereferencing pointer to incomplete type
digestmd5.c: In function `init_des':
digestmd5.c:1042: error: invalid application of `sizeof' to incomplete type `digestmd5.c'
digestmd5.c:1047: error: `des_cblock' undeclared (first use in this function)
digestmd5.c:1047: error: syntax error before ')' token
digestmd5.c:1049: error: dereferencing pointer to incomplete type
digestmd5.c:1054: error: increment of pointer to unknown structure
digestmd5.c:1054: error: arithmetic on pointer to an incomplete type
digestmd5.c:1056: error: syntax error before ')' token
digestmd5.c:1058: error: dereferencing pointer to incomplete type
*** Error code 1
make: Fatal error: Command failed for target `digestmd5.lo'
Current working directory /var/local/user/jason/cyrus-sasl-2.1.22/plugins
*** Error code 1
After lots of searching, I finally found this post that led me to the answer. What ended up working was issuing the following commands before the configure statement.
export LDFLAGS="-lsocket -L/local/progs/lib -R/local/progs/lib"
export CFLAGS="-lsocket -I/local/progs/include:/local/progs/include/openssl:/local/progs/usr/local/include"
after that, the configure runs fine:
checking for RSAPublicEncrypt in -lrsaref... no
checking openssl/evp.h usability... yes
checking openssl/evp.h presence... yes
checking for openssl/evp.h... yes
checking for EVP_DigestInit in -lcrypto... yes
checking for OpenSSL... yes
checking for des_cbc_encrypt in -lcrypto... no
checking for DES_cbc_encrypt in -lcrypto... yes
checking openssl/des.h usability... yes
checking openssl/des.h presence... yes
checking for openssl/des.h... yes
checking DIGEST-MD5... enabled
checking OTP... enabled
checking for opiechallenge in -lopie... no
checking for OPIE... no
checking SRP... disabled
checking KERBEROS_V4... disabled
checking for crypt... yes
and the make runs fine.
-db
Like this article? Buy me a beer!