Bug #16332 Compiling on HPUX - configure is looking for libssl.so instead of .sl
Submitted: 10 Jan 2006 10:56 Modified: 31 Mar 2006 20:57
Reporter: François Laupretre Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.0.19-BK, 5.0.18 OS:HP/UX (HPUX)
Assigned to: Kent Boortz CPU Architecture:Any

[10 Jan 2006 10:56] François Laupretre
Description:
Building from source on HP-UX 11.11 with option '--with-openssl=<DIR>'.

In my configuration, the OpenSSL/lib directory does not contain a 'libssl.a' file, as I want to keep only shared libraries (libssl.sl on HP-UX).

When configure runs, it checks for the existence of one of those files in $openssl/libs : libssl.a, libssl.so, or libssl.dylib. And, as I don't have any, it tells me that it 'cannot find an installation of OpenSSL'. Actually, it should detect 'libssl.sl' (as it is done for zlib) or, better, 'libssl${shrext_cmds}'

How to repeat:
configure --with-openssl=<dir>

Suggested fix:
$ diff config/ac-macros/openssl.m4.old config/ac-macros/openssl.m4.new
17c17
<       if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib ; then
---
>       if test -f $d/libssl.a || test -f $d/libssl${shrext_cmds} || test -f $d/libssl.dylib ; then
29c29
<       if test -f $libs/libssl.a || test -f $libs/libssl.so || test -f $libs/libssl.dylib ; then
---
>       if test -f $libs/libssl.a || test -f $libs/libssl${shrext_cmds} || test -f $libs/libssl.dylib ; then
[11 Jan 2006 11:06] Valeriy Kravchuk
Thank you for a bug report. Even in the latest 5.0.19-BK config/ac-macros/openssl.m4 check as follows:

      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
      if test -f $d/libssl.a || test -f $d/libssl.so || test -f $d/libssl.dylib
; then
        OPENSSL_LIB=$d
      fi
      done

This should be changed to something similar to the check in zlib.m4:

        if test \( -f "$mysql_zlib_dir/lib/libz.a"  -o -f "$mysql_zlib_dir/lib/libz.so" -o \
                   -f "$mysql_zlib_dir/lib/libz.sl" -o -f "$mysql_zlib_dir/lib/libz.dylib" \) \
                -a -f "$mysql_zlib_dir/include/zlib.h"; then
          ZLIB_INCLUDES="-I$mysql_zlib_dir/include"
          ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz"
          MYSQL_CHECK_ZLIB_DIR
        fi

that is, check for .sl explicitely. Not sure about your suggested fix - it looks too bash-specific.
[11 Jan 2006 18:32] François Laupretre
My suggestion is not bash-specific (I don't even use bash on HP-UX). I suggested using $shrext_cmds because this variable is provided by autoconf/libtool exactly for this purpose : it contains the shared library extension used by the current system (.so, .sl, .dll,...). This is exactly what we want here.

Regards

Francois
[11 Jan 2006 18:38] François Laupretre
Sorry for adding multiple comments but maybe you think my suggestion is too bash-specific because of the '{}' chars around shrext_cmds. They can be removed and I would remove them if I wrote it, but, in autoconf, most variables are written as '${variable}' and I thought it was more coherent.

Actually, to make it short, I think that we should test for 'libssl$shrext_cmds'.
[29 Mar 2006 21:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4297
[30 Mar 2006 23:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4348