From 3347390cfcd24af48090f47a9f0818b89dcd6026 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sun, 19 Aug 2012 23:06:28 +0700 Subject: [PATCH 1/3] CString: Don't repeat ourselves --- src/ZNCString.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/ZNCString.cpp b/src/ZNCString.cpp index 5b4e3862..a8c5affe 100644 --- a/src/ZNCString.cpp +++ b/src/ZNCString.cpp @@ -144,25 +144,13 @@ CString& CString::MakeLower() { CString CString::AsUpper() const { CString sRet = *this; - - for (size_type a = 0; a < length(); a++) { - char& c = sRet[a]; - //TODO use unicode - c = (char)toupper(c); - } - + sRet.MakeUpper(); return sRet; } CString CString::AsLower() const { CString sRet = *this; - - for (size_type a = 0; a < length(); a++) { - char& c = sRet[a]; - //TODO use unicode - c = (char)tolower(c); - } - + sRet.MakeLower(); return sRet; } From f94cb24fedf6b4f6da32ffb29062339ce41024b5 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 20 Aug 2012 00:32:36 +0700 Subject: [PATCH 2/3] Fix SSL on cygwin. --- configure.ac | 20 ++++++++++++++++++++ modules/Makefile.in | 11 +++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index eed590a6..43477453 100644 --- a/configure.ac +++ b/configure.ac @@ -262,6 +262,25 @@ if test "x$SSL" != "xno"; then 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 + ]], [[ + 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 ZNC_AUTO_FAIL([SSL], [OpenSSL not found. Try --disable-openssl.], @@ -505,6 +524,7 @@ AC_SUBST([LDFLAGS]) AC_SUBST([LIBS]) AC_SUBST([LIBZNC]) AC_SUBST([LIBZNCDIR]) +AC_SUBST([ISCYGWIN]) AC_SUBST([MODLINK]) AC_SUBST([NOSSL]) AC_SUBST([TCL_FLAGS]) diff --git a/modules/Makefile.in b/modules/Makefile.in index edcad6a6..dd16019f 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -20,9 +20,16 @@ CXX := @CXX@ MODFLAGS := -I$(srcdir)/../include -I../include @CPPFLAGS@ @MODFLAGS@ MODLINK := @MODLINK@ LDFLAGS := @LDFLAGS@ + # LIBS are not and should not be used in here. # 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 := @PERL_BINARY@ PYTHON_ON:= @PYTHON@ @@ -118,7 +125,7 @@ clean: %.so: %.o Makefile $(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: # Yes, we are lazy, just remove everything in there From 628f3c8ec19951a87b986b4b208903e229351290 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 20 Aug 2012 00:51:36 +0700 Subject: [PATCH 3/3] Partially fix modperl build under cygwin. --- modules/modperl/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/modperl/Makefile.inc b/modules/modperl/Makefile.inc index defd32af..1acf4d9c 100644 --- a/modules/modperl/Makefile.inc +++ b/modules/modperl/Makefile.inc @@ -32,7 +32,7 @@ modperl_all: modperl/ZNC.so modperl/swigperlrun.h modperl/functions.cpp modperl/ZNC.so: modperl/ZNC.o Makefile $(E) Linking ZNC Perl bindings library... - $(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) $(PERL_LD) -o $@ $< + $(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $(PERL_LD) modperl/ZNC.o: modperl/ZNC.cpp Makefile @mkdir -p modperl