diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ace.m4 | 6 | ||||
-rw-r--r-- | m4/aio.m4 (renamed from m4/features.m4) | 5 | ||||
-rw-r--r-- | m4/config_h.m4 | 10 | ||||
-rw-r--r-- | m4/tls.m4 | 146 |
4 files changed, 161 insertions, 6 deletions
diff --git a/m4/ace.m4 b/m4/ace.m4 index 57768d31b90..db36bdb24c7 100644 --- a/m4/ace.m4 +++ b/m4/ace.m4 @@ -317,7 +317,7 @@ dnl line, then "no_x" is set to "yes." AM_CONDITIONAL([BUILD_QOS], [test X$ace_user_with_qos = Xyes]) AC_ARG_WITH([ssl], - AC_HELP_STRING([--with-ssl],[compile the ACE_SSL library [[no]]]), + AC_HELP_STRING([--with-ssl],[compile the ACE_SSL library [[yes]]]), [ case "${withval}" in yes) @@ -332,9 +332,9 @@ dnl line, then "no_x" is set to "yes." esac ], [ - ace_user_with_ssl=no + ace_user_with_ssl=yes ]) - AM_CONDITIONAL([BUILD_SSL], [test X$ace_user_with_ssl = Xyes]) +# AM_CONDITIONAL([BUILD_SSL], [test X$ace_user_with_ssl = Xyes]) #AC_ARG_WITH([tao], # AC_HELP_STRING([--with-tao],[build TAO (the ACE ORB) [[yes]]]), diff --git a/m4/features.m4 b/m4/aio.m4 index 98aaf93989c..63574e66ff3 100644 --- a/m4/features.m4 +++ b/m4/aio.m4 @@ -1,10 +1,11 @@ dnl ------------------------------------------------------------------------- dnl $Id$ dnl -dnl features.m4 +dnl aio.m4 dnl dnl ACE M4 include file which contains ACE specific M4 macros -dnl that determine availablility of certain OS features for ACE. +dnl that determine availablility of POSIX asynchronous IO +dnl support. dnl dnl ------------------------------------------------------------------------- diff --git a/m4/config_h.m4 b/m4/config_h.m4 index 38c01d23247..25ef1121b83 100644 --- a/m4/config_h.m4 +++ b/m4/config_h.m4 @@ -36,13 +36,21 @@ AH_TOP([ ]) dnl Text to be placed at the bottom of the `ace/config.h' header. +dnl +dnl @note Do not remove the "] [" between the words "Local Variables". +dnl The generated Emacs "Local Variables" block will not contain +dnl those characters. They are merely interpreted by M4 as two +dnl concatenated text blocks. This is necessary to prevent +dnl Emacs from inadvertently applying the "Local Variables" +dnl block to be placed in the generated "config.h" header to +dnl this Autoconf/M4 file. AH_BOTTOM([ #endif /* ACE_CONFIG_H */ -// Local Variables: +// Local] [Variables: // mode:C++ // End: ]) diff --git a/m4/tls.m4 b/m4/tls.m4 new file mode 100644 index 00000000000..212fb7f0f14 --- /dev/null +++ b/m4/tls.m4 @@ -0,0 +1,146 @@ +dnl ------------------------------------------------------------------------- +dnl $Id$ +dnl +dnl tls.m4 +dnl +dnl ACE M4 include file which contains ACE specific M4 macros +dnl that determine availablility of SSL/TLS support. +dnl +dnl ------------------------------------------------------------------------- + +dnl Copyright (C) 2003 Ossama Othman +dnl +dnl All Rights Reserved +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the current ACE distribution terms. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +dnl TLS/SSL library IO check +dnl Use this macro to determine if TLS/SSL support is available on the +dnl current host. +dnl Usage: ACE_CHECK_TLS +AC_DEFUN([ACE_CHECK_TLS], +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PROG_CXXCPP]) + AC_LANG([C++]) + AC_REQUIRE([AC_LANG]) + + dnl Save the current library and preprocessor flagslist. We do not + dnl want to add the SSL/TLS-specific ones to the general library link + dnl and preprocessor flags list since they should only be used when + dnl building the ACE_SSL library and/or binaries that use the ACE_SSL + dnl library. + ace_save_LIBS="$LIBS" + ace_save_CPPFLAGS="$CPPFLAGS" + + dnl --------------------------------------------------------- + + ace_TLS_CPPFLAGS="" + + dnl Check if OpenSSL requires the Kerberos include directory to be + dnl added to the header search path. + + AC_CACHE_CHECK([for Kerberos include flags needed by OpenSSL], + [ac_cv_kerberos_dir], + [ + for ace_kerberos in usr usr/local; do + ace_TLS_CPPFLAGS="-I/${ace_kerberos}/kerberos/include" + + CPPFLAGS="$ace_TLS_CPPFLAGS $ace_save_CPPFLAGS" + + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ +#include <openssl/ssl.h> + ], + [ +// ... THIS CODE DOES NOTHING! IT IS JUST USED FOR COMPILE TESTS ... + +// ... Perform TCP connection ... + +// ... Perform TLS/SSL stuff ... +CRYPTO_set_locking_callback (0); +SSLeay_add_ssl_algorithms (); +SSL_load_error_strings (); +SSL_METHOD * meth = TLSv1_method (); +SSL_CTX * ctx = SSL_CTX_new (meth); +SSL * ssl = SSL_new (ctx); +int fd = 2000; // Dummy file descriptor value. +SSL_set_fd (ssl, fd); +SSL_connect (ssl); +SSL_shutdown (ssl); + +// ... + ]) + ], + [ + ac_cv_kerberos_dir="$ace_TLS_CPPFLAGS" + break + ], + [ + ac_cv_kerberos_dir=no + ]) + + done + ]) + + if test $ac_cv_kerberos_dir != no; then + AC_SUBST([ACE_TLS_CPPFLAGS],[$ace_TLS_CPPFLAGS]) + fi + + dnl --------------------------------------------------------- + + dnl Add the TLS/SSL libraries to the library list. + ace_TLS_LIBS="-lssl -lcrypto" + + LIBS="$ace_TLS_LIBS $LIBS" + + AC_CACHE_CHECK([for OpenSSL libraries], + [ac_cv_openssl_libs], + [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([ +#include <openssl/ssl.h> + ], + [ +// ... THIS PROGRAM DOES NOTHING! IT IS JUST USED FOR LINK TESTS ... + +// ... Perform TCP connection ... + +// ... Perform TLS/SSL stuff ... +CRYPTO_set_locking_callback (0); +SSLeay_add_ssl_algorithms (); +SSL_load_error_strings (); +SSL_METHOD * meth = TLSv1_method (); +SSL_CTX * ctx = SSL_CTX_new (meth); +SSL * ssl = SSL_new (ctx); +int fd = 2000; // Dummy file descriptor value. +SSL_set_fd (ssl, fd); +SSL_connect (ssl); +SSL_shutdown (ssl); + +// ... + ]) + ], + [ + ac_cv_openssl_libs=yes + ], + [ + ac_cv_openssl_libs=no + ]) + ]) + + if test $ac_cv_openssl_libs != no; then + AC_SUBST([ACE_TLS_LIBS],[$ace_TLS_LIBS]) + AM_CONDITIONAL([BUILD_SSL], [test X$ace_user_with_ssl = Xyes]) + fi + + dnl Restore the original library list and preprocessor flags. + LIBS="$ace_save_LIBS" + CPPFLAGS="$ace_save_CPPFLAGS" + +]) |