[Nut-upsdev] Re: SSL flags (was Re: [nut-commits] svn commit r593 -
branches/deb_fixes_for_trunk)
Peter Selinger
selinger at mathstat.dal.ca
Mon Nov 20 08:11:57 CET 2006
Charles Lepple wrote:
>
> Peter,
>
> Any objections to adding this to the trunk? When I run 'ldd upsc'
> without this patch, it lists the OpenSSL libraries, and the default
> ./configure setting is to not use OpenSSL.
>
> - Charles
>
> > Log:
> > If we are not using SSL_CFLAGS or SSL_LDFLAGS, do not add the OpenSSL libraries
> > to all of the binaries.
> >
> >
> > Modified: branches/deb_fixes_for_trunk/configure.in
> > ==============================================================================
> > --- branches/deb_fixes_for_trunk/configure.in (original)
> > +++ branches/deb_fixes_for_trunk/configure.in Sun Nov 19 23:28:22 2006
> > @@ -190,6 +190,8 @@
> > ;;
> > *)
> > AC_MSG_RESULT(no)
> > + SSL_CFLAGS=""
> > + SSL_LDFLAGS=""
> > ;;
> > esac],
If you do it here, you should also do it after the other
AC_MSG_RESULT(no) (the default case).
But it is silly to test for the SSL library if the result is going to
be erased. Therefore, I prefer the following patch:
Index: configure.in
===================================================================
--- configure.in (revision 585)
+++ configure.in (working copy)
@@ -136,66 +136,78 @@
TYPE_UINT16_T
TYPE_UINT8_T
-dnl ----------------------------------------------------------------------
-dnl check for SSL compiler flags
-
-AC_MSG_CHECKING(for SSL library availability)
-
-CFLAGS_ORIG="${CFLAGS}"
-LDFLAGS_ORIG="${LDFLAGS}"
-
-SSL_CFLAGS=""
-SSL_LDFLAGS="-lssl -lcrypto"
-
-CFLAGS="${SSL_CFLAGS}"
-LDFLAGS="${SSL_LDFLAGS}"
-AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_library_init()], ssl_ok=yes, ssl_ok=no)
-
-if test "${ssl_ok}" != "yes"; then
- SSL_CFLAGS="-I/usr/local/ssl/include"
- SSL_LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto"
-
- CFLAGS="${SSL_CFLAGS}"
- LDFLAGS="${SSL_LDFLAGS}"
- AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_library_init], ssl_ok=yes, ssl_ok=no)
-fi
-
-if test "${ssl_ok}" != "yes"; then
- SSL_CFLAGS="-I/usr/local/ssl/include -I/usr/kerberos/include"
- SSL_LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto"
-
- CFLAGS="${SSL_CFLAGS}"
- LDFLAGS="${SSL_LDFLAGS}"
- AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_library_init], ssl_ok=yes, ssl_ok=no)
-fi
-
-CFLAGS="${CFLAGS_ORIG}"
-LDFLAGS="${LDFLAGS_ORIG}"
-
-AC_MSG_RESULT([${ssl_ok}])
-
AC_MSG_CHECKING(whether to enable SSL development code)
AC_ARG_WITH(ssl,
AC_HELP_STRING([--with-ssl], [enable SSL development code (default: no)]),
[ case "$withval" in
yes)
AC_MSG_RESULT(yes)
-
- if test "${ssl_ok}" != "yes"; then
- AC_MSG_ERROR(["SSL support requested, but OpenSSL not found"])
- fi
-
+ nut_with_ssl="yes"
AC_DEFINE(HAVE_SSL, 1,
[Define to enable SSL development code])
;;
*)
AC_MSG_RESULT(no)
+ nut_with_ssl="no"
;;
esac],
AC_MSG_RESULT(no)
+ nut_with_ssl="no"
)
+dnl ----------------------------------------------------------------------
+dnl check for SSL compiler flags
+
+if test "${nut_with_ssl}" = "yes"; then
+
+ AC_MSG_CHECKING(for SSL library availability)
+
+ CFLAGS_ORIG="${CFLAGS}"
+ LDFLAGS_ORIG="${LDFLAGS}"
+
+ SSL_CFLAGS=""
+ SSL_LDFLAGS="-lssl -lcrypto"
+
+ CFLAGS="${SSL_CFLAGS}"
+ LDFLAGS="${SSL_LDFLAGS}"
+ AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_library_init()],
+ ssl_ok=yes,
+ ssl_ok=no)
+
+ if test "${ssl_ok}" != "yes"; then
+ SSL_CFLAGS="-I/usr/local/ssl/include"
+ SSL_LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto"
+
+ CFLAGS="${SSL_CFLAGS}"
+ LDFLAGS="${SSL_LDFLAGS}"
+ AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_library_init],
+ ssl_ok=yes,
+ ssl_ok=no)
+ fi
+
+ if test "${ssl_ok}" != "yes"; then
+ SSL_CFLAGS="-I/usr/local/ssl/include -I/usr/kerberos/include"
+ SSL_LDFLAGS="-L/usr/local/ssl/lib -lssl -lcrypto"
+
+ CFLAGS="${SSL_CFLAGS}"
+ LDFLAGS="${SSL_LDFLAGS}"
+ AC_TRY_LINK([#include <openssl/ssl.h>], [SSL_library_init],
+ ssl_ok=yes,
+ ssl_ok=no)
+ fi
+
+ CFLAGS="${CFLAGS_ORIG}"
+ LDFLAGS="${LDFLAGS_ORIG}"
+
+ AC_MSG_RESULT([${ssl_ok}])
+
+ if test "${ssl_ok}" != "yes"; then
+ AC_MSG_ERROR(["SSL support requested, but OpenSSL not found"])
+ fi
+fi
+
+dnl ----------------------------------------------------------------------
dnl See if gdlib-config is out there and usable
AC_MSG_CHECKING(for gd version via gdlib-config)
More information about the Nut-upsdev
mailing list