Re: [AC 21.5] TLS support

Jerry James <[email protected]> Thu, 9 Oct 2014 15:00:57 -0600
Newsgroups gmane.emacs.xemacs.patches
Message-ID <CAHCOHQmqiNXmy-JrLymVHeqtLzkCv4Z_Sk6FsdnV8J8jW49=jg@mail.gmail.com>
On Wed, Oct 8, 2014 at 9:11 PM, Vin Shelton <[email protected]> wrote:
> Hi, Jerry!

Hi, Vin.

> I think you need a guard around your ssl.h include:
>
> gcc -c -Os -m64 -fno-exceptions  -Demacs -I.
> -I/opt/src/xemacs-21.5-2014-10-08/src -DHAVE_CONFIG_H -I/opt/include
> /opt/src/xemacs-21.5-2014-10-08/src/alloc.c
> In file included from /opt/src/xemacs-21.5-2014-10-08/src/lstream.h:27:0,
>                  from /opt/src/xemacs-21.5-2014-10-08/src/alloc.c:56:
> /opt/src/xemacs-21.5-2014-10-08/src/tls.h:59:26: fatal error:
> openssl/ssl.h: No such file or directory
>  # include <openssl/ssl.h>
>                           ^
> compilation terminated.
> make[1]: *** [alloc.o] Error 1
> make[1]: Leaving directory `/raid-3tb/opt/build/xemacs-21.5-2014-10-08/src'
> make: *** [src] Error 2
>
> I do not have the libssl-dev package installed.

Line 59 of tls.h is inside a "#ifdef HAVE_OPENSSL" block (line 58),
which is inside a "#ifdef WITH_TLS" block (line 32).  That means that
you reached line 5376 of configure.ac with "$with_tls" = "openssl".
Either you specified --with-tls=openssl at the command line, in which
case you had to get by lines 5345-7 of configure.ac:

elif test "$with_tls" = "openssl"; then
  AC_CHECK_LIB(ssl, SSL_library_init, [with_tls=openssl],
    [XE_DIE("Required openssl support cannot be provided.")])

or else "$with_tls" = "yes" for autodetection, in which case you had
to get by lines 5335-8 of configure.ac:

if test "$with_tls" = "yes"; then
  AC_CHECK_LIB(gnutls, gnutls_global_init, [with_tls=gnutls],
    AC_CHECK_LIB(nss3, NSS_InitContext, [with_tls=nss],
      AC_CHECK_LIB(ssl, SSL_library_init, [with_tls=openssl], [with_tls=no])))

... and in particular, that last line had to fire.  So in either case,
configure decided that libssl exists and contains SSL_library_init.  I
see.  The library portion is present and usable, even though you
haven't installed the header files, so I need to beef up the
configure.ac tests to also look for header files.  In fact, i should
look for those first, before bothering with a library check.  I'll
push a fix shortly.
-- 
Jerry James
http://www.jamezone.org/