@@ -17,19 +17,19 @@ # so you can encode the package version directly into the source files. # This will also define a special symbol for Windows (BUILD_ # so that we create the export library with the dll. #----------------------------------------------------------------------- -AC_INIT(tls,1.8.0) +AC_INIT([tls],[1.8.0]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- -TEA_INIT() +TEA_INIT AC_CONFIG_AUX_DIR(tclconfig) #-------------------------------------------------------------------- # Load the tclConfig.sh file @@ -70,16 +70,16 @@ # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([tls.c tlsBIO.c tlsIO.c tlsX509.c]) -TEA_ADD_HEADERS([tls.h]) -TEA_ADD_INCLUDES([-I$(SSL_INCLUDE_DIR)]) +TEA_ADD_HEADERS([generic/tls.h]) +TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) -TEA_ADD_TCL_SOURCES([tls.tcl]) +TEA_ADD_TCL_SOURCES([library/tls.tcl]) #-------------------------------------------------------------------- # # You can add more files to clean if your extension creates any extra # files by extending CLEANFILES. @@ -166,40 +166,66 @@ # libraries. If it is not set, then we will use RSA BSAFE SSL-C # libraries instead of the default OpenSSL libaries. #-------------------------------------------------------------------- OPENSSL="1" +AC_SUBST(OPENSSL,"1") TCLTLS_SSL_OPENSSL +# Temp work-around +SSL_DIR="/usr" +SSL_LIB_DIR=${SSL_DIR}/lib64 +SSL_INCLUDE_DIR=${SSL_DIR}/include/openssl + +AC_SUBST(SSL_DIR) +AC_SUBST(SSL_LIB_DIR) +AC_SUBST(SSL_INCLUDE_DIR) + +SSL_INCLUDE_DIR_NATIVE=\"`${CYGPATH} ${SSL_INCLUDE_DIR}`\" +SSL_LIB_DIR_NATIVE=\"`${CYGPATH} ${SSL_LIB_DIR}`\" +AC_SUBST(SSL_INCLUDE_DIR_NATIVE) +AC_SUBST(SSL_LIB_DIR_NATIVE) + #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Also, windows libraries and unix libraries have different names. # For the OpenSSL version, I chose to use the same library names that # OpenSSL uses as its default names. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "$GCC" = "yes"; then + TEA_ADD_INCLUDES([-I${SSL_INCLUDE_DIR_NATIVE}]) TEA_ADD_LIBS([-L${SSL_LIB_DIR_NATIVE}]) else + TEA_ADD_INCLUDES([-include:${SSL_INCLUDE_DIR_NATIVE}]) TEA_ADD_LIBS([-libpath:${SSL_LIB_DIR_NATIVE}]) fi if test -n "${OPENSSL}"; then TEA_ADD_LIBS([libcrypto.lib libssl.lib]) else TEA_ADD_LIBS([sslc32.lib]) + fi else # Subst runtime dir here, use -R and -L where necessary. [Bug 1742859] LIB_RUNTIME_DIR=${SSL_LIB_DIR} eval "LD_SEARCH_FLAGS=\"${LD_SEARCH_FLAGS}\"" if test -n "${OPENSSL}"; then + TEA_ADD_INCLUDES([-I${SSL_INCLUDE_DIR}]) TEA_ADD_LIBS([${LD_SEARCH_FLAGS} -L${SSL_LIB_DIR} -lssl -lcrypto ${GCCPATH} ${GCCLIB}]) else + TEA_ADD_INCLUDES([-I${SSL_INCLUDE_DIR}]) TEA_ADD_LIBS([${LD_SEARCH_FLAGS} -L${SSL_LIB_DIR} -lsslc]) fi fi + +if test "${SHARED_BUILD}" = "1" ; then + AC_SUBST(TCLEXT_BUILD,"shared") +else + AC_SUBST(TCLEXT_BUILD,"static") +fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, @@ -299,14 +325,14 @@ # Specify files to substitute AC variables in. You may alternatively # have a special pkgIndex.tcl.in or other files which require # substituting the AC variables in. Include these here. #-------------------------------------------------------------------- -#AC_CONFIG_FILES([Makefile pkgIndex.tcl]) +AC_CONFIG_FILES([Makefile pkgIndex.tcl]) #AC_CONFIG_FILES([tlsConfig.sh]) #-------------------------------------------------------------------- # Finally, substitute all of the various values into the files # specified with AC_CONFIG_FILES. #-------------------------------------------------------------------- -AC_OUTPUT([Makefile pkgIndex.tcl]) +AC_OUTPUT