summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-04-24 20:08:32 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-04-24 20:08:32 (GMT)
commitd1618e253cdb489f7aabdc2c0d6f34dd834e41d3 (patch)
tree46e38459d69b2340f49d573144dfe10c210a6388
parent8609d180a724faa5161bb2a7ed69e18bd71980f4 (diff)
downloadblt-d1618e253cdb489f7aabdc2c0d6f34dd834e41d3.zip
blt-d1618e253cdb489f7aabdc2c0d6f34dd834e41d3.tar.gz
blt-d1618e253cdb489f7aabdc2c0d6f34dd834e41d3.tar.bz2
support https via tls
-rw-r--r--ds9/unix/Makefile.in5
-rwxr-xr-xds9/unix/configure278
-rw-r--r--ds9/unix/configure.ac6
-rw-r--r--ds9/unix/ds9.C7
4 files changed, 295 insertions, 1 deletions
diff --git a/ds9/unix/Makefile.in b/ds9/unix/Makefile.in
index 34468bb..412d33d 100644
--- a/ds9/unix/Makefile.in
+++ b/ds9/unix/Makefile.in
@@ -35,6 +35,7 @@ tcliis_LIB_SPEC = @tcliis_LIB_SPEC@
tclsignal_LIB_SPEC= @tclsignal_LIB_SPEC@
tclxml_LIB_SPEC = @tclxml_LIB_SPEC@
tclzvfs_LIB_SPEC= @tclzvfs_LIB_SPEC@
+tls_LIB_SPEC=@tls_LIB_SPEC@
tkblt_LIB_SPEC = @tkblt_LIB_SPEC@
tkhtml1_LIB_SPEC= @tkhtml1_LIB_SPEC@
@@ -54,7 +55,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)
@@ -90,6 +91,7 @@ SPECS = \
$(tclsignal_LIB_SPEC) \
$(tclxml_LIB_SPEC) \
$(tclzvfs_LIB_SPEC) \
+ $(tls_LIB_SPEC) \
$(tkblt_LIB_SPEC) \
$(tkhtml1_LIB_SPEC) \
$(tkimg_LIB_SPEC) \
@@ -125,6 +127,7 @@ PREQS = \
$(LIBDIR)/doc \
$(LIBDIR)/cmaps \
$(LIBDIR)/template \
+ $(LIBDIR)/tls \
$(LIBDIR)/tkblt \
$(LIBDIR)/tkcon \
$(LIBDIR)/base64 \
diff --git a/ds9/unix/configure b/ds9/unix/configure
index 23f9bd6..3796186 100755
--- a/ds9/unix/configure
+++ b/ds9/unix/configure
@@ -658,6 +658,7 @@ XMKMF
TK_INCLUDES
TCL_INCLUDES
system
+SSLLIBS
MATH_LIBS
EGREP
GREP
@@ -758,6 +759,14 @@ tkblt_LIB_FILE
tkblt_SRC_DIR
tkblt_BIN_DIR
tkblt_VERSION
+tls_STUB_LIB_PATH
+tls_STUB_LIB_SPEC
+tls_STUB_LIB_FILE
+tls_LIB_SPEC
+tls_LIB_FILE
+tls_SRC_DIR
+tls_BIN_DIR
+tls_VERSION
tclzvfs_STUB_LIB_PATH
tclzvfs_STUB_LIB_SPEC
tclzvfs_STUB_LIB_FILE
@@ -928,6 +937,7 @@ with_tcliis
with_tclsignal
with_tclxml
with_tclzvfs
+with_tls
with_tkblt
with_tkhtml1
with_tkimg
@@ -1601,6 +1611,7 @@ Optional Packages:
--with-tclsignal directory containing tclsignal configuration (tclsignalConfig.sh)
--with-tclxml directory containing tclxml configuration (tclxmlConfig.sh)
--with-tclzvfs directory containing tclzvfs configuration (tclzvfsConfig.sh)
+ --with-tls directory containing tls configuration (tlsConfig.sh)
--with-tkblt directory containing tkblt configuration (tkbltConfig.sh)
--with-tkhtml1 directory containing tkhtml1 configuration (tkhtml1Config.sh)
--with-tkimg directory containing tkimg configuration (tkimgConfig.sh)
@@ -6319,6 +6330,270 @@ fi
#
+ # Ok, lets find the tls configuration
+ # First, look for one uninstalled.
+ # the alternative search directory is invoked by --with-tls
+ #
+
+ if test x"${no_tls}" = x ; then
+ # we reset no_tls in case something fails here
+ no_tls=true
+
+# Check whether --with-tls was given.
+if test "${with_tls+set}" = set; then :
+ withval=$with_tls; with_tlsconfig=${withval}
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tls configuration" >&5
+$as_echo_n "checking for tls configuration... " >&6; }
+ if ${ac_cv_c_tlsconfig+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+
+ # First check to see if --with-tls was specified.
+ if test x"${with_tlsconfig}" != x ; then
+ case ${with_tlsconfig} in
+ */tlsConfig.sh )
+ if test -f ${with_tlsconfig}; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-tls argument should refer to directory containing tlsConfig.sh, not to tlsConfig.sh itself" >&5
+$as_echo "$as_me: WARNING: --with-tls argument should refer to directory containing tlsConfig.sh, not to tlsConfig.sh itself" >&2;}
+ with_tlsconfig=`echo ${with_tlsconfig} | sed 's!/tlsConfig\.sh$!!'`
+ fi;;
+ esac
+ if test -f "${with_tlsconfig}/tlsConfig.sh" ; then
+ ac_cv_c_tlsconfig=`(cd ${with_tlsconfig}; pwd)`
+ else
+ as_fn_error $? "${with_tlsconfig} directory doesn't contain tlsConfig.sh" "$LINENO" 5
+ fi
+ fi
+
+ # then check for a private tls installation
+ if test x"${ac_cv_c_tlsconfig}" = x ; then
+ for i in \
+ ../tls \
+ `ls -dr ../tls*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
+ `ls -dr ../tls*[0-9].[0-9][0-9] 2>/dev/null` \
+ `ls -dr ../tls*[0-9].[0-9] 2>/dev/null` \
+ `ls -dr ../tls*[0-9].[0-9]* 2>/dev/null` \
+ ../../tls \
+ `ls -dr ../../tls*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
+ `ls -dr ../../tls*[0-9].[0-9][0-9] 2>/dev/null` \
+ `ls -dr ../../tls*[0-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../tls*[0-9].[0-9]* 2>/dev/null` \
+ ../../../tls \
+ `ls -dr ../../../tls*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
+ `ls -dr ../../../tls*[0-9].[0-9][0-9] 2>/dev/null` \
+ `ls -dr ../../../tls*[0-9].[0-9] 2>/dev/null` \
+ `ls -dr ../../../tls*[0-9].[0-9]* 2>/dev/null` \
+ ${srcdir}/../tls \
+ `ls -dr ${srcdir}/../tls*[0-9].[0-9]*.[0-9]* 2>/dev/null` \
+ `ls -dr ${srcdir}/../tls*[0-9].[0-9][0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tls*[0-9].[0-9] 2>/dev/null` \
+ `ls -dr ${srcdir}/../tls*[0-9].[0-9]* 2>/dev/null` \
+ ; do
+ if test -f "$i/tlsConfig.sh" ; then
+ ac_cv_c_tlsconfig=`(cd $i; pwd)`
+ break
+ fi
+ if test -f "$i/unix/tlsConfig.sh" ; then
+ ac_cv_c_tlsconfig=`(cd $i/unix; pwd)`
+ break
+ fi
+ done
+ fi
+
+ # check in a few common install locations
+ if test x"${ac_cv_c_tlsconfig}" = x ; then
+ for i in `ls -d ${libdir} 2>/dev/null` \
+ `ls -d ${exec_prefix}/lib 2>/dev/null` \
+ `ls -d ${prefix}/lib 2>/dev/null` \
+ `ls -d /usr/local/lib 2>/dev/null` \
+ `ls -d /usr/contrib/lib 2>/dev/null` \
+ `ls -d /usr/lib 2>/dev/null` \
+ `ls -d /usr/lib64 2>/dev/null` \
+ ; do
+ if test -f "$i/tlsConfig.sh" ; then
+ ac_cv_c_tlsconfig=`(cd $i; pwd)`
+ break
+ fi
+ done
+ fi
+
+fi
+
+
+ if test x"${ac_cv_c_tlsconfig}" = x ; then
+ tls_BIN_DIR="# no tls configs found"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find tls configuration definitions" >&5
+$as_echo "$as_me: WARNING: Cannot find tls configuration definitions" >&2;}
+ exit 0
+ else
+ no_tls=
+ tls_BIN_DIR=${ac_cv_c_tlsconfig}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $tls_BIN_DIR/tlsConfig.sh" >&5
+$as_echo "found $tls_BIN_DIR/tlsConfig.sh" >&6; }
+ fi
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for existence of ${tls_BIN_DIR}/tlsConfig.sh" >&5
+$as_echo_n "checking for existence of ${tls_BIN_DIR}/tlsConfig.sh... " >&6; }
+
+ if test -f "${tls_BIN_DIR}/tlsConfig.sh" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: loading" >&5
+$as_echo "loading" >&6; }
+ . "${tls_BIN_DIR}/tlsConfig.sh"
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5
+$as_echo "file not found" >&6; }
+ fi
+
+ #
+ # If the tls_BIN_DIR is the build directory (not the install directory),
+ # then set the common variable name to the value of the build variables.
+ # For example, the variable tls_LIB_SPEC will be set to the value
+ # of tls_BUILD_LIB_SPEC. An extension should make use of tls_LIB_SPEC
+ # instead of tls_BUILD_LIB_SPEC since it will work with both an
+ # installed and uninstalled version of Tcl.
+ #
+
+ if test -f "${tls_BIN_DIR}/Makefile" ; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Found Makefile - using build library specs for tls" >&5
+$as_echo "$as_me: WARNING: Found Makefile - using build library specs for tls" >&2;}
+ tls_LIB_SPEC=${tls_BUILD_LIB_SPEC}
+ tls_STUB_LIB_SPEC=${tls_BUILD_STUB_LIB_SPEC}
+ tls_STUB_LIB_PATH=${tls_BUILD_STUB_LIB_PATH}
+ tls_INCLUDE_SPEC=${tls_BUILD_INCLUDE_SPEC}
+ tls_LIBRARY_PATH=${tls_LIBRARY_PATH}
+ fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Allow the caller to prevent this auto-check by specifying any 2nd arg
+ if test "x" = x; then :
+
+ # Check both upper and lower-case variants
+ # If a dev wanted non-stubs libs, this function could take an option
+ # to not use _STUB in the paths below
+ if test "x${tls_STUB_LIB_SPEC}" = x; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking For TLS_STUB library for LIBS" >&5
+$as_echo_n "checking For TLS_STUB library for LIBS... " >&6; }
+ # This simplifies the use of stub libraries by automatically adding
+ # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS,
+ # but this is called before CONFIG_CFLAGS. More importantly, this adds
+ # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
+ if test "x${TLS_STUB_LIB_SPEC}" != "x" ; then
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
+
+ vars="\"`${CYGPATH} ${TLS_STUB_LIB_PATH}`\""
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ case $i in
+ *.lib)
+ # Convert foo.lib to -lfoo for GCC
+ i=-l`echo "$i" | sed -e 's/\.[^.]*$//' -e 's/\.lib.*//'`
+ ;;
+ esac
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using TLS_STUB_LIB_PATH ${TLS_STUB_LIB_PATH}" >&5
+$as_echo "using TLS_STUB_LIB_PATH ${TLS_STUB_LIB_PATH}" >&6; }
+ else
+
+ vars="${TLS_STUB_LIB_SPEC}"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ case $i in
+ *.lib)
+ # Convert foo.lib to -lfoo for GCC
+ i=-l`echo "$i" | sed -e 's/\.[^.]*$//' -e 's/\.lib.*//'`
+ ;;
+ esac
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using TLS_STUB_LIB_SPEC ${TLS_STUB_LIB_SPEC}" >&5
+$as_echo "using TLS_STUB_LIB_SPEC ${TLS_STUB_LIB_SPEC}" >&6; }
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5
+$as_echo "file not found" >&6; }
+ fi
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking For tls_STUB library for LIBS" >&5
+$as_echo_n "checking For tls_STUB library for LIBS... " >&6; }
+ # This simplifies the use of stub libraries by automatically adding
+ # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS,
+ # but this is called before CONFIG_CFLAGS. More importantly, this adds
+ # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD.
+ if test "x${tls_STUB_LIB_SPEC}" != "x" ; then
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
+
+ vars="\"`${CYGPATH} ${tls_STUB_LIB_PATH}`\""
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ case $i in
+ *.lib)
+ # Convert foo.lib to -lfoo for GCC
+ i=-l`echo "$i" | sed -e 's/\.[^.]*$//' -e 's/\.lib.*//'`
+ ;;
+ esac
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using tls_STUB_LIB_PATH ${tls_STUB_LIB_PATH}" >&5
+$as_echo "using tls_STUB_LIB_PATH ${tls_STUB_LIB_PATH}" >&6; }
+ else
+
+ vars="${tls_STUB_LIB_SPEC}"
+ for i in $vars; do
+ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
+ case $i in
+ *.lib)
+ # Convert foo.lib to -lfoo for GCC
+ i=-l`echo "$i" | sed -e 's/\.[^.]*$//' -e 's/\.lib.*//'`
+ ;;
+ esac
+ fi
+ PKG_LIBS="$PKG_LIBS $i"
+ done
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: using tls_STUB_LIB_SPEC ${tls_STUB_LIB_SPEC}" >&5
+$as_echo "using tls_STUB_LIB_SPEC ${tls_STUB_LIB_SPEC}" >&6; }
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: file not found" >&5
+$as_echo "file not found" >&6; }
+ fi
+
+fi
+
+fi
+
+
+
+ #
# Ok, lets find the tkblt configuration
# First, look for one uninstalled.
# the alternative search directory is invoked by --with-tkblt
@@ -11166,12 +11441,15 @@ case $system in
Darwin*)
$as_echo "#define ZIPFILE 1" >>confdefs.h
+ SSLLIBS="/opt/local/lib/libssl.a /opt/local/lib/libcrypto.a"
;;
*)
+ SSLLIBS="-lssl -lcrypto"
;;
esac
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlInitParser in -lxml2" >&5
$as_echo_n "checking for xmlInitParser in -lxml2... " >&6; }
if ${ac_cv_lib_xml2_xmlInitParser+:} false; then :
diff --git a/ds9/unix/configure.ac b/ds9/unix/configure.ac
index 7738d4e..13b3243 100644
--- a/ds9/unix/configure.ac
+++ b/ds9/unix/configure.ac
@@ -76,6 +76,9 @@ TEA_LOAD_CONFIG(tclxml)
TEA_PATH_CONFIG(tclzvfs)
TEA_LOAD_CONFIG(tclzvfs)
+TEA_PATH_CONFIG(tls)
+TEA_LOAD_CONFIG(tls)
+
TEA_PATH_CONFIG(tkblt)
TEA_LOAD_CONFIG(tkblt)
@@ -147,10 +150,13 @@ TEA_CONFIG_SYSTEM
case $system in
Darwin*)
AC_DEFINE([ZIPFILE])
+ SSLLIBS="/opt/local/lib/libssl.a /opt/local/lib/libcrypto.a"
;;
*)
+ SSLLIBS="-lssl -lcrypto"
;;
esac
+AC_SUBST(SSLLIBS)
AC_SUBST(system)
AC_CHECK_LIB([xml2],[xmlInitParser])
diff --git a/ds9/unix/ds9.C b/ds9/unix/ds9.C
index 90c4573..70e54c6 100644
--- a/ds9/unix/ds9.C
+++ b/ds9/unix/ds9.C
@@ -42,6 +42,7 @@ extern "C" {
int Tclxpa_Init(Tcl_Interp*);
int Tcliis_Init(Tcl_Interp*);
+ int Tls_Init(Tcl_Interp*);
int Tclxml_Init(Tcl_Interp*);
int Tclxml_libxml2_Init(Tcl_Interp*);
@@ -143,6 +144,12 @@ int SAOAppInit(Tcl_Interp *interp)
Tcl_StaticPackage (interp, "tclcheckdns", Tclcheckdns_Init,
(Tcl_PackageInitProc*)NULL);
+ // Tls
+ if (Tls_Init(interp) == TCL_ERROR)
+ return TCL_ERROR;
+ Tcl_StaticPackage (interp, "tls", Tls_Init,
+ (Tcl_PackageInitProc*)NULL);
+
// Tksao
if (Tksao_Init(interp) == TCL_ERROR)
return TCL_ERROR;