Skip to content

Commit

Permalink
Fix SSL on cygwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGandalf committed Aug 19, 2012
1 parent 3347390 commit f94cb24
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
20 changes: 20 additions & 0 deletions configure.ac
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -262,6 +262,25 @@ if test "x$SSL" != "xno"; then
AC_CHECK_LIB( ssl, SSL_shutdown,, SSL=no ) AC_CHECK_LIB( ssl, SSL_shutdown,, SSL=no )
]) ])


if test "x$SSL" != "xno"; then
AC_MSG_CHECKING([whether openssl is usable])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
#include <openssl/ssl.h>
]], [[
SSL_CTX* ctx = SSL_CTX_new(TLSv1_method());
SSL* ssl = SSL_new(ctx);
DH* dh = DH_new();
]])
], [
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
SSL=no
])

fi

if test "x$SSL" = "xno" ; then if test "x$SSL" = "xno" ; then
ZNC_AUTO_FAIL([SSL], ZNC_AUTO_FAIL([SSL],
[OpenSSL not found. Try --disable-openssl.], [OpenSSL not found. Try --disable-openssl.],
Expand Down Expand Up @@ -505,6 +524,7 @@ AC_SUBST([LDFLAGS])
AC_SUBST([LIBS]) AC_SUBST([LIBS])
AC_SUBST([LIBZNC]) AC_SUBST([LIBZNC])
AC_SUBST([LIBZNCDIR]) AC_SUBST([LIBZNCDIR])
AC_SUBST([ISCYGWIN])
AC_SUBST([MODLINK]) AC_SUBST([MODLINK])
AC_SUBST([NOSSL]) AC_SUBST([NOSSL])
AC_SUBST([TCL_FLAGS]) AC_SUBST([TCL_FLAGS])
Expand Down
11 changes: 9 additions & 2 deletions modules/Makefile.in
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ CXX := @CXX@
MODFLAGS := -I$(srcdir)/../include -I../include @CPPFLAGS@ @MODFLAGS@ MODFLAGS := -I$(srcdir)/../include -I../include @CPPFLAGS@ @MODFLAGS@
MODLINK := @MODLINK@ MODLINK := @MODLINK@
LDFLAGS := @LDFLAGS@ LDFLAGS := @LDFLAGS@

# LIBS are not and should not be used in here. # LIBS are not and should not be used in here.
# The znc binary links already against those. # The znc binary links already against those.
# LIBS := @LIBS@ # ...but not on cygwin!
LIBS :=
ifeq "@ISCYGWIN@" "1"
LIBS += @LIBS@
LDFLAGS += ${LIBS}
endif

PERL_ON := @PERL@ PERL_ON := @PERL@
PERL := @PERL_BINARY@ PERL := @PERL_BINARY@
PYTHON_ON:= @PYTHON@ PYTHON_ON:= @PYTHON@
Expand Down Expand Up @@ -118,7 +125,7 @@ clean:


%.so: %.o Makefile %.so: %.o Makefile
$(E) Linking module $(notdir $(basename $@))... $(E) Linking module $(notdir $(basename $@))...
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(notdir $(basename $@))LDFLAGS) $(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(notdir $(basename $@))LDFLAGS) $(LIBS)


uninstall: uninstall:
# Yes, we are lazy, just remove everything in there # Yes, we are lazy, just remove everything in there
Expand Down

0 comments on commit f94cb24

Please sign in to comment.