Bug #21974 Unable to configure w/SSL 5.0.24 - Solaris 10 x86
Submitted: 1 Sep 2006 18:28 Modified: 14 Sep 2006 12:29
Reporter: Ken Jones Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.24 OS:Linux (Linux)
Assigned to: Magnus Blåudd CPU Architecture:Any

[1 Sep 2006 18:28] Ken Jones
Description:
gcc version 3.3.6

Using the following configure command, I can sucessfully configure 5.0.22. When attempting 5.0.24 or 5.0.24a, it breaks at checking for SSL.

CC=gcc
CFLAGS="-O3 -fno-omit-frame-pointer"
CXX=g++
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti"

./configure --prefix=/usr/local/mysql \
--with-unix-socket-path="/usr/local/mysql/var/mysql.sock" \
--with-mysql-ldflags="-R/usr/local/lib -R/usr/local/ssl/lib -R/usr/local/mysql/lib -R/usr/local/mysql/lib/mysql"\
--with-mysql-ldflags=/usr/local/ssl \
--with-mysqld-user=mysql \
--with-openssl=/usr/local/ssl \
--with-openssl-includes=/usr/local/ssl/include \
--with-openssl-libs=/usr/local/ssl/lib \
--with-extra-charsets=complex \
--enable-thread-safe-client \
--enable-local-infile \
--with-example-storage-engine \
--with-archive-storage-engine \
--with-csv-storage-engine \
--with-blackhole-storage-engine \
--with-federated-storage-engine \
--with-big-tables \
--with-innodb \
--with-isam \
--with-ndbcluster \
--without-ndb-sci \
--with-client-ldflags="-R/usr/local/lib -R/usr/local/ssl/lib -R/usr/local/mysql/lib -R/usr/local/mysql/lib/mysql"

The last part of the configure.log:
configure:38740: $? = 0
configure:38743: test -s conftest
configure:38746: $? = 0
configure:38758: result: yes
configure:38770: checking "can netinet files be included"
configure:38793: gcc -c -O3 -DDBUG_OFF    -DHAVE_RWLOCK_T -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/mysql/include -
I/usr/local/mysql/include/mysql conftest.c >&5
configure:38799: $? = 0
configure:38803: test -z
                         || test ! -s conftest.err
configure:38806: $? = 0
configure:38809: test -s conftest.o
configure:38812: $? = 0
configure:38830: result: "yes"
configure:38965: checking for OpenSSL

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i386-pc-solaris2.10
ac_cv_build_alias=i386-pc-solaris2.10
ac_cv_c_bigendian=no
ac_cv_c_compiler_gnu=yes
ac_cv_c_const=yes

And the tail end of the output of configure ...

checking style of gethostname_r routines... other
checking 3 argument to gethostname_r routines... char
checking "args to pthread_getspecific"... POSIX
checking "args to pthread_mutex_init"... POSIX
checking "args to readdir_r"... POSIX
checking "style of sigwait"... POSIX
checking "for pthread_attr_setscope"... yes
checking "can netinet files be included"... "yes"
checking for OpenSSL... Could not find an installation of OpenSSL
[kenj@woodstock mysql-5.0.24a]$ 

How to repeat:
run configure with options listed above.
[4 Sep 2006 20:12] Sveta Smirnova
Thank you for the report.

Could you please provide output of ls -l /usr/local/ssl/include/ssl.h /usr/local/ssl/lib/libssl*
[4 Sep 2006 20:20] Ken Jones
Here are the listings of the ssl/include and ssl/lib directories.

[kenj@woodstock ~]$ ls -l /usr/local/ssl/lib/*
-rw-r--r--    1 root     root      3203576 Aug 28 18:20 /usr/local/ssl/lib/libcrypto.a
lrwxrwxrwx    1 root     root           18 Aug 28 18:20 /usr/local/ssl/lib/libcrypto.so -> libcrypto.so.0.9.8
-r-xr-xr-x    1 root     root      2318652 Aug 28 18:20 /usr/local/ssl/lib/libcrypto.so.0.9.8
-rw-r--r--    1 root     root       473406 Aug 28 18:20 /usr/local/ssl/lib/libssl.a
lrwxrwxrwx    1 root     root           15 Aug 28 18:20 /usr/local/ssl/lib/libssl.so -> libssl.so.0.9.8
-r-xr-xr-x    1 root     root       367372 Aug 28 18:20 /usr/local/ssl/lib/libssl.so.0.9.8

/usr/local/ssl/lib/engines:
total 164
-r-xr-xr-x    1 root     root        19124 Aug 28 18:20 lib4758cca.so
-r-xr-xr-x    1 root     root        18040 Aug 28 18:20 libaep.so
-r-xr-xr-x    1 root     root        15532 Aug 28 18:20 libatalla.so
-r-xr-xr-x    1 root     root        25132 Aug 28 18:20 libchil.so
-r-xr-xr-x    1 root     root        22512 Aug 28 18:20 libcswift.so
-r-xr-xr-x    1 root     root         4868 Aug 28 18:20 libgmp.so
-r-xr-xr-x    1 root     root        13384 Aug 28 18:20 libnuron.so
-r-xr-xr-x    1 root     root        25560 Aug 28 18:20 libsureware.so
-r-xr-xr-x    1 root     root        20292 Aug 28 18:20 libubsec.so

/usr/local/ssl/lib/pkgconfig:
total 3
-rw-r--r--    1 root     root          265 Aug 28 18:20 libcrypto.pc
-rw-r--r--    1 root     root          280 Aug 28 18:20 libssl.pc
-rw-r--r--    1 root     root          290 Aug 28 18:20 openssl.pc
[kenj@woodstock ~]$ ls -l /usr/local/ssl/include/*
total 1204
-rw-r--r--    1 root     root         4872 Aug 28 18:20 aes.h
-rw-r--r--    1 root     root        46085 Aug 28 18:20 asn1.h
-rw-r--r--    1 root     root        18956 Aug 28 18:20 asn1_mac.h
-rw-r--r--    1 root     root        27839 Aug 28 18:20 asn1t.h
-rw-r--r--    1 root     root        30608 Aug 28 18:20 bio.h
-rw-r--r--    1 root     root         5073 Aug 28 18:20 blowfish.h
-rw-r--r--    1 root     root        32223 Aug 28 18:20 bn.h
-rw-r--r--    1 root     root         4565 Aug 28 18:20 buffer.h
-rw-r--r--    1 root     root         4349 Aug 28 18:20 cast.h
-rw-r--r--    1 root     root         1601 Aug 28 18:20 comp.h
-rw-r--r--    1 root     root         9443 Aug 28 18:20 conf.h
-rw-r--r--    1 root     root         4080 Aug 28 18:20 conf_api.h
-rw-r--r--    1 root     root        22121 Aug 28 18:20 crypto.h
-rw-r--r--    1 root     root        10724 Aug 28 18:20 des.h
-rw-r--r--    1 root     root        18226 Aug 28 18:20 des_old.h
-rw-r--r--    1 root     root         8246 Aug 28 18:20 dh.h
-rw-r--r--    1 root     root        10311 Aug 28 18:20 dsa.h
-rw-r--r--    1 root     root        16253 Aug 28 18:20 dso.h
-rw-r--r--    1 root     root         6183 Aug 28 18:20 dtls1.h
-rw-r--r--    1 root     root         9430 Aug 28 18:20 e_os2.h
-rw-r--r--    1 root     root          540 Aug 28 18:20 ebcdic.h
-rw-r--r--    1 root     root        21142 Aug 28 18:20 ec.h
-rw-r--r--    1 root     root         4609 Aug 28 18:20 ecdh.h
-rw-r--r--    1 root     root        10533 Aug 28 18:20 ecdsa.h
-rw-r--r--    1 root     root        37806 Aug 28 18:20 engine.h
-rw-r--r--    1 root     root        12493 Aug 28 18:20 err.h
-rw-r--r--    1 root     root        33944 Aug 28 18:20 evp.h
-rw-r--r--    1 root     root         4368 Aug 28 18:20 hmac.h
-rw-r--r--    1 root     root         4358 Aug 28 18:20 idea.h
-rw-r--r--    1 root     root         7642 Aug 28 18:20 krb5_asn.h
-rw-r--r--    1 root     root         5927 Aug 28 18:20 kssl.h
-rw-r--r--    1 root     root         7429 Aug 28 18:20 lhash.h
-rw-r--r--    1 root     root         3877 Aug 28 18:20 md2.h
-rw-r--r--    1 root     root         4641 Aug 28 18:20 md4.h
-rw-r--r--    1 root     root         4641 Aug 28 18:20 md5.h
-rw-r--r--    1 root     root       109237 Aug 28 18:20 obj_mac.h
-rw-r--r--    1 root     root        33396 Aug 28 18:20 objects.h
-rw-r--r--    1 root     root        23863 Aug 28 18:20 ocsp.h
-rw-r--r--    1 root     root         5805 Aug 28 18:20 opensslconf.h
-rw-r--r--    1 root     root         3751 Aug 28 18:20 opensslv.h
-rw-r--r--    1 root     root         6446 Aug 28 18:20 ossl_typ.h
-rw-r--r--    1 root     root        28371 Aug 28 18:20 pem.h
-rw-r--r--    1 root     root         2863 Aug 28 18:20 pem2.h
-rw-r--r--    1 root     root        12677 Aug 28 18:20 pkcs12.h
-rw-r--r--    1 root     root        16333 Aug 28 18:20 pkcs7.h
-rw-r--r--    1 root     root         6142 Aug 28 18:20 pq_compat.h
-rw-r--r--    1 root     root         3519 Aug 28 18:20 pqueue.h
-rw-r--r--    1 root     root         5251 Aug 28 18:20 rand.h
-rw-r--r--    1 root     root         4294 Aug 28 18:20 rc2.h
-rw-r--r--    1 root     root         3707 Aug 28 18:20 rc4.h
-rw-r--r--    1 root     root         4264 Aug 28 18:20 ripemd.h
-rw-r--r--    1 root     root        16994 Aug 28 18:20 rsa.h
-rw-r--r--    1 root     root       122381 Aug 28 18:20 safestack.h
-rw-r--r--    1 root     root         7309 Aug 28 18:20 sha.h
-rw-r--r--    1 root     root        79572 Aug 28 18:20 ssl.h
-rw-r--r--    1 root     root        10716 Aug 28 18:20 ssl2.h
-rw-r--r--    1 root     root         3744 Aug 28 18:20 ssl23.h
-rw-r--r--    1 root     root        22012 Aug 28 18:20 ssl3.h
-rw-r--r--    1 root     root         4418 Aug 28 18:20 stack.h
-rw-r--r--    1 root     root        26481 Aug 28 18:20 store.h
-rw-r--r--    1 root     root        19456 Aug 28 18:20 symhacks.h
-rw-r--r--    1 root     root        14347 Aug 28 18:20 tls1.h
-rw-r--r--    1 root     root         4117 Aug 28 18:20 tmdiff.h
-rw-r--r--    1 root     root         4300 Aug 28 18:20 txt_db.h
-rw-r--r--    1 root     root        16418 Aug 28 18:20 ui.h
-rw-r--r--    1 root     root         3439 Aug 28 18:20 ui_compat.h
-rw-r--r--    1 root     root        47830 Aug 28 18:20 x509.h
-rw-r--r--    1 root     root        20739 Aug 28 18:20 x509_vfy.h
-rw-r--r--    1 root     root        25446 Aug 28 18:20 x509v3.h
[kenj@woodstock ~]$
[5 Sep 2006 6:52] Sveta Smirnova
Hm... Last BK sources on my Solaris 10 x86 box with correct openssl paths configure fine.

Could you please try to configure using most simpler configure string (for example, ./configure --prefix=/usr/local/mysql --with-openssl=/usr/local/ssl --with-openssl-includes=/usr/local/ssl/include --with-openssl-libs=/usr/local/ssl/lib) and provide us result and whole config.log
[5 Sep 2006 17:34] Ken Jones
I think I found the problem. It's an error in the configure script. The below is from 5.0.24a. This section has changed since 5.0.22. At the end of the SSL testing OPENSSL_LIB is not set.

Line 39021:

      for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \
/usr/freeware/lib32 /usr/local/lib/ ; do
      # Test for libssl using all known library file endings
      if test -f $d/libssl.a || test -f $d/libssl.so || \
         test -f $d/libssl.sl || test -f $d/libssl.dylib ; then
        OPENSSL_LIB=$d
      fi
      done
      ;;
    ---* | *---)
      { { echo "$as_me:$LINENO: error: if either 'includes' or 'libs' is specified, both must be specified" >&5
echo "$as_me: error: if either 'includes' or 'libs' is specified, both must be specified" >&2;}
   { (exit 1); exit 1; }; }
      ;;
    * )
      if test -f $incs/openssl/ssl.h  ; then
        OPENSSL_INCLUDE=-I$incs
      fi
      # Test for libssl using all known library file endings
      if test -f $d/libssl.a || test -f $d/libssl.so || \
         test -f $d/libssl.sl || test -f $d/libssl.dylib ; then
        OPENSSL_LIB=$libs
      fi
      ;;
  esac

===================================================================
[5 Sep 2006 20:00] Sveta Smirnova
But if output of ls -l /usr/local/ssl/lib/* provided by you is correct new expressions should work fine too.

Please, provide information which shell do you use and output of accurate commands:

test -f /usr/local/ssl/lib/libssl.a && echo 1
test -f /usr/local/ssl/lib/libssl.so && echo 1
[5 Sep 2006 23:35] Ken Jones
Ok, here is the problem ...
In the below case statement, there are 3 cases.
1) specified openssl, but not the include or lib dir.
2) specified one, but not both lib/include dir
3) catch all - specified both lib/include dir.

In my case, #3. In 5.0.22, case 3 tested $libs/libssl. Now it's testing $d/libssl, which will always be /usr/local/lib.
Changing $d to $libs the the 3rd case, will correct the problem.

- Ken

Line --- 39008 ---
  incs="$openssl_includes"
  libs="$openssl_libs"
  eval shrexts=\"$shrext_cmds\"
  case "$incs---$libs" in
    ---)
      for d in /usr/ssl/include /usr/local/ssl/include /usr/include \
/usr/include/ssl /opt/ssl/include /opt/openssl/include \
/usr/local/ssl/include /usr/local/include /usr/freeware/include ; do
       if test -f $d/openssl/ssl.h  ; then
         OPENSSL_INCLUDE=-I$d
       fi
      done

      for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \
/usr/freeware/lib32 /usr/local/lib/ ; do
      # Test for libssl using all known library file endings
      if test -f $d/libssl.a || test -f $d/libssl.so || \
         test -f $d/libssl.sl || test -f $d/libssl.dylib ; then
        OPENSSL_LIB=$d
      fi
      done
      ;;
    ---* | *---)
      { { echo "$as_me:$LINENO: error: if either 'includes' or 'libs' is specified, both must be specified" >&5
echo "$as_me: error: if either 'includes' or 'libs' is specified, both must be specified" >&2;}
   { (exit 1); exit 1; }; }
      ;;
    * )
      if test -f $incs/openssl/ssl.h  ; then
        OPENSSL_INCLUDE=-I$incs
      fi
      # Test for libssl using all known library file endings
      if test -f $d/libssl.a || test -f $d/libssl.so || \
         test -f $d/libssl.sl || test -f $d/libssl.dylib ; then
        OPENSSL_LIB=$libs
      fi
      ;;
  esac
[6 Sep 2006 6:31] Sveta Smirnova
Thank you for the report.

Verified as described: misprint in config/ac-macros/openssl.m4
[6 Sep 2006 6:32] Sveta Smirnova
OS changed, because all operation systems are affected
[14 Sep 2006 12:29] Magnus Blåudd
Duplicate of Bug#21327 OpenSSL-checking in configure

Will be available in 5.0.25