From 276248924f179411396352ecc80e34adb592a247 Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 26 Apr 2017 17:37:17 -0400 Subject: add tls for https support win32 --- ds9/win/Makefile.in | 11 ++++++- ds9/win/configure | 91 ++-------------------------------------------------- ds9/win/configure.ac | 4 +-- make.include | 6 ++-- win/Makefile.in | 3 +- 5 files changed, 19 insertions(+), 96 deletions(-) diff --git a/ds9/win/Makefile.in b/ds9/win/Makefile.in index 20c7513..0e48519 100755 --- a/ds9/win/Makefile.in +++ b/ds9/win/Makefile.in @@ -21,6 +21,7 @@ TK_STUB_LIB_SPEC= @TK_STUB_LIB_SPEC@ tifftcl_LIB_SPEC= @tifftcl_LIB_SPEC@ pngtcl_LIB_SPEC = @pngtcl_LIB_SPEC@ jpegtcl_LIB_SPEC= @jpegtcl_LIB_SPEC@ +zlibtcl_LIB_SPEC= @zlibtcl_LIB_SPEC@ tkimg_LIB_SPEC = @tkimg_LIB_SPEC@ tkimggif_LIB_SPEC= @tkimggif_LIB_SPEC@ @@ -51,7 +52,7 @@ PKG_CFLAGS = @PKG_CFLAGS@ DEFS = @DEFS@ $(PKG_CFLAGS) CPPFLAGS = @CPPFLAGS@ -LIBS = @PKG_LIBS@ @LIBS@ +LIBS = @PKG_LIBS@ @LIBS@ @SSLLIBS@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) @@ -130,6 +131,8 @@ PREQS = \ $(LIBDIR)/math \ $(APPDIR)/xpans.exe \ $(APPDIR)/install.vbs \ + $(APPDIR)/libeay32.dll \ + $(APPDIR)/ssleay32.dll \ $(APPDIR)/tcc #--------------------------main @@ -195,6 +198,12 @@ $(APPDIR)/tcc: $(prefix)/compilers/tcc-0.9.25-win32-bin.zip chmod +x $@/tcc.exe touch $@ +$(APPDIR)/libeay32.dll: c:/opt/bin/libeay32.dll + cp -p $? $@ + +$(APPDIR)/ssleay32.dll: c:/opt/bin/ssleay32.dll + cp -p $? $@ + #--------------------------clean .PHONY : clean diff --git a/ds9/win/configure b/ds9/win/configure index d48bc78..b529602 100755 --- a/ds9/win/configure +++ b/ds9/win/configure @@ -655,6 +655,7 @@ STUBS_BUILD SHARED_BUILD TK_INCLUDES TCL_INCLUDES +SSLLIBS MATH_LIBS EGREP GREP @@ -10847,95 +10848,7 @@ done #TEA_ADD_STUB_SOURCES([]) #TEA_ADD_TCL_SOURCES([]) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLSv1_1_method in -lssl" >&5 -$as_echo_n "checking for TLSv1_1_method in -lssl... " >&6; } -if ${ac_cv_lib_ssl_TLSv1_1_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lssl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char TLSv1_1_method (); -int -main () -{ -return TLSv1_1_method (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ssl_TLSv1_1_method=yes -else - ac_cv_lib_ssl_TLSv1_1_method=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_TLSv1_1_method" >&5 -$as_echo "$ac_cv_lib_ssl_TLSv1_1_method" >&6; } -if test "x$ac_cv_lib_ssl_TLSv1_1_method" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSSL 1 -_ACEOF - - LIBS="-lssl $LIBS" - -fi +SSLLIBS="-LC:/opt/openssl/lib -lssleay32 -llibeay32" #-------------------------------------------------------------------- diff --git a/ds9/win/configure.ac b/ds9/win/configure.ac index 8f6258e..8c189ff 100644 --- a/ds9/win/configure.ac +++ b/ds9/win/configure.ac @@ -140,8 +140,8 @@ TEA_ADD_LIBS([-lstdc++]) #TEA_ADD_STUB_SOURCES([]) #TEA_ADD_TCL_SOURCES([]) -AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data]) -AC_CHECK_LIB([ssl],[TLSv1_1_method]) +SSLLIBS="-LC:/opt/openssl/lib -lssleay32 -llibeay32" +AC_SUBST(SSLLIBS) #-------------------------------------------------------------------- # __CHANGE__ diff --git a/make.include b/make.include index 5677b54..2471050 100644 --- a/make.include +++ b/make.include @@ -175,6 +175,7 @@ tclzvfs/Makefile : #-------------------------- tls +# no cache (win) tls : tls/Makefile @echo "" @echo "*** $@ ***" @@ -185,11 +186,10 @@ tls/Makefile : @echo "*** $@ ***" cd tls; \ ./configure \ - $(WITHTCL) \ $(TLSFLAGS) \ + $(WITHTCL) \ $(PREFIX) \ - $(STD) \ - $(CACHE) + $(STD) #-------------------------- xpa diff --git a/win/Makefile.in b/win/Makefile.in index e2c9981..b5266ae 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -18,6 +18,7 @@ CONFIGFLAGS = CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar ASTFLAGS = CFLAGS=-DCMINPACK_NO_DLL XPAFLAGS = CFLAGS=-DSTATIC_BUILD TCLXMLFLAGS = --with-xml-static=yes +TLSFLAGS ="CFLAGS=-DNO_IDEA=1 -DNO_RC5=1" --with-ssl-dir=/cygdrive/c/opt TARGET = --build=x86_64-unknown-mingw32 include ./make.include @@ -36,7 +37,7 @@ DS9APP =SAOImage\ DS9\ $(DS9_VERSION) saods9 : dirs tcl tk \ libxml2 libxslt zlib \ - tcliis tclxml tls xpa \ + tcliis tls tclxml tls xpa \ tkblt tktable tkimg \ tkmpeg tkhtml1 tkcon \ tkwin \ -- cgit v0.12