diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/Makefile.in | 58 | ||||
-rwxr-xr-x | win/configure | 199 | ||||
-rw-r--r-- | win/configure.in | 7 | ||||
-rw-r--r-- | win/tcl.m4 | 138 | ||||
-rw-r--r-- | win/tclWinPort.h | 5 | ||||
-rw-r--r-- | win/tclWinSock.c | 6 |
6 files changed, 404 insertions, 9 deletions
diff --git a/win/Makefile.in b/win/Makefile.in index 2d27a41..2f05c4d 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -151,7 +151,7 @@ ZLIB_DLL_FILE = zlib1.dll SHARED_LIBRARIES = $(TCL_DLL_FILE) @ZLIB_DLL_FILE@ STATIC_LIBRARIES = $(TCL_LIB_FILE) -TCLSH = tclsh$(VER)${EXESUFFIX} +TCLSH = tclsh${EXESUFFIX} CAT32 = cat32$(EXEEXT) MAN2TCL = man2tcl$(EXEEXT) @@ -171,7 +171,7 @@ VPATH = $(GENERIC_DIR):$(TOMMATH_DIR):$(WIN_DIR):$(COMPAT_DIR):$(ZLIB_DIR) AR = @AR@ RANLIB = @RANLIB@ -CC = @CC@ +CC = $(if $(Q), @echo CC $(notdir $<) ; @CC@, @CC@) RC = @RC@ RES = @RES@ AC_FLAGS = @EXTRA_CFLAGS@ @DEFS@ @@ -188,7 +188,7 @@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_SUFFIX = @SHLIB_SUFFIX@ -LIBS = @LIBS@ $(shell $(CYGPATH) '@ZLIB_LIBS@') +LIBS = @LIBS@ @PCRE_LIBS@ @ZLIB_LIBS@ RMDIR = rm -rf MKDIR = mkdir -p @@ -199,7 +199,7 @@ COPY = cp CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${TCL_SHLIB_CFLAGS} \ -I"${ZLIB_DIR_NATIVE}" -I"${GENERIC_DIR_NATIVE}" -DTCL_TOMMATH \ -DMP_PREC=4 -I"${TOMMATH_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ -${AC_FLAGS} ${COMPILE_DEBUG_FLAGS} ${NO_DEPRECATED_FLAGS} +@PCRE_INCLUDE@ ${AC_FLAGS} ${COMPILE_DEBUG_FLAGS} ${NO_DEPRECATED_FLAGS} CC_OBJNAME = @CC_OBJNAME@ CC_EXENAME = @CC_EXENAME@ @@ -304,6 +304,13 @@ GENERIC_OBJS = \ tclVar.$(OBJEXT) \ tclZlib.$(OBJEXT) +L_OBJS = Lscanner-pregen.$(OBJEXT) \ + Lgrammar-pregen.$(OBJEXT) \ + Lcompile.$(OBJEXT) \ + Last.$(OBJEXT) \ + Ltypecheck.$(OBJEXT) \ + Lgetopt.$(OBJEXT) + TOMMATH_OBJS = \ bncore.${OBJEXT} \ bn_reverse.${OBJEXT} \ @@ -371,6 +378,18 @@ TOMMATH_OBJS = \ bn_s_mp_sub.${OBJEXT} +L_HDRS = \ + $(GENERIC_DIR)/Lcompile.h \ + $(GENERIC_DIR)/Lgrammar.h \ + $(GENERIC_DIR)/Last.h + +L_SRCS = \ + $(GENERIC_DIR)/Lscanner.l \ + $(GENERIC_DIR)/Lgrammar.y \ + $(GENERIC_DIR)/Lcompile.c \ + $(GENERIC_DIR)/Last.c \ + $(GENERIC_DIR)/Lgetopt.c + WIN_OBJS = \ tclWin32Dll.$(OBJEXT) \ tclWinChan.$(OBJEXT) \ @@ -411,7 +430,7 @@ ZLIB_OBJS = \ uncompr.$(OBJEXT) \ zutil.$(OBJEXT) -TCL_OBJS = ${GENERIC_OBJS} $(TOMMATH_OBJS) ${WIN_OBJS} @ZLIB_OBJS@ +TCL_OBJS = ${GENERIC_OBJS} $(TOMMATH_OBJS) ${WIN_OBJS} @ZLIB_OBJS@ $(L_OBJS) TCL_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n] @@ -531,6 +550,27 @@ tclTomMathStubLib.${OBJEXT}: tclTomMathStubLib.c tclOOStubLib.${OBJEXT}: tclOOStubLib.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) +Lscanner.c: $(GENERIC_DIR)/Lscanner.l $(L_HDRS) $(GENERIC_DIR)/Lgrammar.c + flex -PL_ -o$@ $(GENERIC_DIR)/Lscanner.l + +Lscanner-pregen.$(OBJEXT): $(GENERIC_DIR)/Lscanner-pregen.c $(L_HDRS) + $(CC) -c $(CC_SWITCHES) -DBUILD_tcl @DEPARG@ $(GENERIC_DIR)/Lscanner-pregen.c + +Lgrammar.c: $(GENERIC_DIR)/Lgrammar.y $(L_HDRS) + @BISON@ -pL_ -d -o$@ $(GENERIC_DIR)/Lgrammar.y + +Lgrammar-pregen.$(OBJEXT): $(GENERIC_DIR)/Lgrammar-pregen.c Lcompile.$(OBJEXT) $(L_HDRS) + $(CC) -c $(CC_SWITCHES) -DBUILD_tcl @DEPARG@ $(GENERIC_DIR)/Lgrammar-pregen.c + +Lcompile.$(OBJEXT): $(GENERIC_DIR)/Lcompile.c $(L_HDRS) + $(CC) -c $(CC_SWITCHES) -DBUILD_tcl @DEPARG@ $(GENERIC_DIR)/Lcompile.c + +Lgetopt.$(OBJEXT): $(GENERIC_DIR)/Lgetopt.c $(L_HDRS) + $(CC) -c $(CC_SWITCHES) -DBUILD_tcl @DEPARG@ $(GENERIC_DIR)/Lgetopt.c + +Last.$(OBJEXT): $(GENERIC_DIR)/Last.c $(L_HDRS) + $(CC) -c $(CC_SWITCHES) -DBUILD_tcl @DEPARG@ $(GENERIC_DIR)/Last.c + # Implicit rule for all object files that will end up in the Tcl library %.${OBJEXT}: %.c @@ -546,7 +586,7 @@ tclOOStubLib.${OBJEXT}: tclOOStubLib.c # the .c file. gendate: - bison --output-file=$(GENERIC_DIR)/tclDate.c \ + @BISON@ --output-file=$(GENERIC_DIR)/tclDate.c \ --name-prefix=TclDate \ --no-lines \ $(GENERIC_DIR)/tclGetDate.y @@ -642,7 +682,7 @@ install-libraries: libraries install-tzdata install-msgs $(COPY) "$$i" "$(INCLUDE_INSTALL_DIR)"; \ done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; - @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex; \ + @for i in $(ROOT_DIR)/library/*.tcl $(ROOT_DIR)/library/tclIndex ; \ do \ $(COPY) "$$i" "$(SCRIPT_INSTALL_DIR)"; \ done; @@ -715,6 +755,9 @@ test-tcl: binaries $(TCLSH) $(CAT32) $(TEST_DLL_FILE) package ifneeded dde 1.4.0 [list load [file normalize ${DDE_DLL_FILE}] dde]; \ package ifneeded registry 1.3.1 [list load [file normalize ${REG_DLL_FILE}] registry]" | ./$(CAT32) +l-test l-tests test-l test-L: + TCLTEST_SHELL_OPTIONS='-encoding utf-8' $(MAKE) test TESTFLAGS+="-file l-*.test" + # Useful target to launch a built tclsh with the proper path,... runtest: binaries $(TCLSH) $(TEST_DLL_FILE) @TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ @@ -866,6 +909,7 @@ html-tcl: $(TCLSH) html-tk: $(TCLSH) $(MAKE) shell SCRIPT="$(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) --srcdir=$(ROOT_DIR)/.. $(BUILD_HTML_FLAGS) --tk" +FORCE: # # The list of all the targets that do not correspond to real files. This stops diff --git a/win/configure b/win/configure index 2336111..7d075cc 100755 --- a/win/configure +++ b/win/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include <unistd.h> #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING ZLIB_DLL_FILE ZLIB_LIBS ZLIB_OBJS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_WIN_VERSION MACHINE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL PKG_CFG_ARGS TCL_EXE TCL_LIB_FILE TCL_LIB_FLAG TCL_STATIC_LIB_FILE TCL_STATIC_LIB_FLAG TCL_IMPORT_LIB_FILE TCL_IMPORT_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_DLL_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_DBGX CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TCL_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB MAKE_STUB_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TCL_BUILD_LIB_SPEC TCL_LD_SEARCH_FLAGS TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_PACKAGE_PATH TCL_DDE_VERSION TCL_DDE_MAJOR_VERSION TCL_DDE_MINOR_VERSION TCL_REG_VERSION TCL_REG_MAJOR_VERSION TCL_REG_MINOR_VERSION RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP BISON AR ac_ct_AR RANLIB ac_ct_RANLIB RC ac_ct_RC SET_MAKE TCL_THREADS CYGPATH CELIB_DIR DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING ZLIB_DLL_FILE ZLIB_LIBS ZLIB_OBJS PCRE_INCLUDE PCRE_LIBS CFLAGS_DEFAULT LDFLAGS_DEFAULT VC_MANIFEST_EMBED_DLL VC_MANIFEST_EMBED_EXE TCL_WIN_VERSION MACHINE TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_PATCH_LEVEL PKG_CFG_ARGS TCL_EXE TCL_LIB_FILE TCL_LIB_FLAG TCL_STATIC_LIB_FILE TCL_STATIC_LIB_FLAG TCL_IMPORT_LIB_FILE TCL_IMPORT_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_STUB_LIB_PATH TCL_INCLUDE_SPEC TCL_BUILD_STUB_LIB_SPEC TCL_BUILD_STUB_LIB_PATH TCL_DLL_FILE TCL_SRC_DIR TCL_BIN_DIR TCL_DBGX CFG_TCL_SHARED_LIB_SUFFIX CFG_TCL_UNSHARED_LIB_SUFFIX CFG_TCL_EXPORT_FILE_SUFFIX EXTRA_CFLAGS DEPARG CC_OBJNAME CC_EXENAME LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LDFLAGS_CONSOLE LDFLAGS_WINDOW STLIB_LD SHLIB_LD SHLIB_LD_LIBS SHLIB_CFLAGS SHLIB_SUFFIX TCL_SHARED_BUILD LIBS_GUI DLLSUFFIX LIBPREFIX LIBSUFFIX EXESUFFIX LIBRARIES MAKE_LIB MAKE_STUB_LIB POST_MAKE_LIB MAKE_DLL MAKE_EXE TCL_BUILD_LIB_SPEC TCL_LD_SEARCH_FLAGS TCL_NEEDS_EXP_FILE TCL_BUILD_EXP_FILE TCL_EXP_FILE TCL_LIB_VERSIONS_OK TCL_PACKAGE_PATH TCL_DDE_VERSION TCL_DDE_MAJOR_VERSION TCL_DDE_MINOR_VERSION TCL_REG_VERSION TCL_REG_MAJOR_VERSION TCL_REG_MINOR_VERSION RC_OUT RC_TYPE RC_INCLUDE RC_DEFINE RC_DEFINES RES LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -844,6 +844,7 @@ Optional Features: --enable-shared build and link with shared libraries (default: on) --enable-64bit enable 64bit support (where applicable) --enable-wince enable Win/CE support (where applicable) + --enable-pcre whether to enable pcre (default: off) --enable-symbols build with debugging symbols (default: off) --enable-embedded-manifest embed manifest if possible (default: yes) @@ -853,6 +854,7 @@ Optional Packages: --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-encoding encoding for configuration values --with-celib=DIR use Windows/CE support library from DIR + --with-pcre directory containing pcre headers and libraries Some influential environment variables: CC C compiler command @@ -2773,6 +2775,57 @@ _ACEOF fi + for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_BISON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$BISON"; then + ac_cv_prog_BISON="$BISON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_BISON="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +BISON=$ac_cv_prog_BISON +if test -n "$BISON"; then + echo "$as_me:$LINENO: result: $BISON" >&5 +echo "${ECHO_T}$BISON" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$BISON" && break +done +test -n "$BISON" || BISON="no" + + export BISON; + if test $BISON = "no" ; + then + { { echo "$as_me:$LINENO: error: Unable to find bison" >&5 +echo "$as_me: error: Unable to find bison" >&2;} + { (exit 1); exit 1; }; }; + fi + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -4968,6 +5021,147 @@ _ACEOF fi +#------------------------------------------------------------------------------ +# Check if we want to use pcre +#------------------------------------------------------------------------------ + + + +# Check whether --with-pcre or --without-pcre was given. +if test "${with_pcre+set}" = set; then + withval="$with_pcre" + with_pcre=${withval} +fi; + echo "$as_me:$LINENO: checking for PCRE configuration" >&5 +echo $ECHO_N "checking for PCRE configuration... $ECHO_C" >&6 + + if test "${ac_cv_c_pcre+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + PCRE_CONFIG="pcre-config" + # First check to see if --with-pcre was specified. + if test x"${with_pcre}" != x ; then + if test -f "${with_pcre}/include/pcre.h" -a \ + \( -f "${with_pcre}/lib/libpcre.so" -o \ + -f "${with_pcre}/lib/libpcre.a" \); then + ac_cv_c_pcre=`(cd ${with_pcre}; pwd)` + PCRE_INCLUDE="-I${ac_cv_c_pcre}/include" + PCRE_LIBS="-L${ac_cv_c_pcre}/lib -lpcre" + PCRE_CONFIG="${ac_cv_c_pcre}/bin/pcre-config" + else + { { echo "$as_me:$LINENO: error: ${with_pcre} directory doesn't contain pcre header and/or library" >&5 +echo "$as_me: error: ${with_pcre} directory doesn't contain pcre header and/or library" >&2;} + { (exit 1); exit 1; }; } + fi + fi + + if test x"${ac_cv_c_pcre}" = x ; then + # Try pcre-config if it exists + ac_cv_c_pcre=`${PCRE_CONFIG} --prefix 2>/dev/null` + if test "$?" -eq 0; then + PCRE_INCLUDE=`${PCRE_CONFIG} --cflags 2>/dev/null` + PCRE_LIBS=`${PCRE_CONFIG} --libs 2>/dev/null` + fi + fi + + # check in a few common install locations + if test x"${ac_cv_c_pcre}" = x ; then + for i in \ + `ls -d ${exec_prefix} 2>/dev/null` \ + `ls -d ${prefix} 2>/dev/null` \ + `ls -d /usr/local 2>/dev/null` \ + `ls -d /usr/contrib 2>/dev/null` \ + `ls -d /usr 2>/dev/null` \ + ; do + if test -f "${i}/include/pcre.h" -a \ + \( -f "${i}/lib/libpcre.so" -o \ + -f "${i}/lib/libpcre.a" \); then + ac_cv_c_pcre=`(cd $i; pwd)` + PCRE_INCLUDE="-I${ac_cv_c_pcre}/include" + PCRE_LIBS="-L${ac_cv_c_pcre}/lib -lpcre" + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_pcre}" = x ; then + { { echo "$as_me:$LINENO: error: Can't find PCRE configuration" >&5 +echo "$as_me: error: Can't find PCRE configuration" >&2;} + { (exit 1); exit 1; }; } + else + echo "$as_me:$LINENO: result: found PCRE configuration at ${ac_cv_c_pcre}" >&5 +echo "${ECHO_T}found PCRE configuration at ${ac_cv_c_pcre}" >&6 + fi + + + + + + echo "$as_me:$LINENO: checking whether to enable pcre in Tcl" >&5 +echo $ECHO_N "checking whether to enable pcre in Tcl... $ECHO_C" >&6 + # Check whether --enable-pcre or --disable-pcre was given. +if test "${enable_pcre+set}" = set; then + enableval="$enable_pcre" + enable_pcre=$enableval +else + enable_pcre=no +fi; + + if test "${enable_pcre+set}" = set; then + enableval="$enable_pcre" + enable_pcre=$enableval + else + enable_pcre=yes + fi + + if test x"${ac_cv_c_pcre}" = x -a x"${PCRE_INCLUDE}" = x -a x"${PCRE_LIBS}" = x ; then + echo "$as_me:$LINENO: result: pcre configuration not found" >&5 +echo "${ECHO_T}pcre configuration not found" >&6 + else + if test "$enable_pcre" = "default" ; then + echo "$as_me:$LINENO: result: pcre default" >&5 +echo "${ECHO_T}pcre default" >&6 + +cat >>confdefs.h <<\_ACEOF +#define USE_DEFAULT_PCRE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PCRE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define PCRE_STATIC 1 +_ACEOF + + elif test "$enable_pcre" = "yes" ; then + echo "$as_me:$LINENO: result: pcre enabled" >&5 +echo "${ECHO_T}pcre enabled" >&6 + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PCRE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define PCRE_STATIC 1 +_ACEOF + + else + PCRE_INCLUDE= + PCRE_LIBS= + echo "$as_me:$LINENO: result: no pcre" >&5 +echo "${ECHO_T}no pcre" >&6 + fi + fi + + #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called @@ -5934,6 +6128,7 @@ s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t +s,@BISON@,$BISON,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t @@ -5951,6 +6146,8 @@ s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@ZLIB_DLL_FILE@,$ZLIB_DLL_FILE,;t t s,@ZLIB_LIBS@,$ZLIB_LIBS,;t t s,@ZLIB_OBJS@,$ZLIB_OBJS,;t t +s,@PCRE_INCLUDE@,$PCRE_INCLUDE,;t t +s,@PCRE_LIBS@,$PCRE_LIBS,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@VC_MANIFEST_EMBED_DLL@,$VC_MANIFEST_EMBED_DLL,;t t diff --git a/win/configure.in b/win/configure.in index a72b993..e4a1143 100644 --- a/win/configure.in +++ b/win/configure.in @@ -60,6 +60,7 @@ fi AC_PROG_CC AC_C_INLINE AC_HEADER_STDC +AC_PROG_BISON AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib) @@ -260,6 +261,12 @@ if test "$tcl_cv_findex_enums" = "no"; then [Defined when enums are missing from winbase.h]) fi +#------------------------------------------------------------------------------ +# Check if we want to use pcre +#------------------------------------------------------------------------------ + +SC_ENABLE_PCRE + #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols # option. This macro depends on C flags, and should be called @@ -339,6 +339,134 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ ]) #------------------------------------------------------------------------ +# SC_WITH_PCRE -- +# +# Finds the PCRE header and library files for use with Tcl +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --with-pcre=/path/to/pcre +# +# Sets the following vars: +# PCRE_DIR +#------------------------------------------------------------------------ + +AC_DEFUN([SC_WITH_PCRE], [ + AC_ARG_WITH(pcre, + AC_HELP_STRING([--with-pcre], + [directory containing pcre headers and libraries]), + [with_pcre=${withval}]) + AC_MSG_CHECKING([for PCRE configuration]) + + AC_CACHE_VAL(ac_cv_c_pcre,[ + PCRE_CONFIG="pcre-config" + # First check to see if --with-pcre was specified. + if test x"${with_pcre}" != x ; then + if test -f "${with_pcre}/include/pcre.h" -a \ + \( -f "${with_pcre}/lib/libpcre.so" -o \ + -f "${with_pcre}/lib/libpcre.a" \); then + ac_cv_c_pcre=`(cd ${with_pcre}; pwd)` + PCRE_INCLUDE="-I${ac_cv_c_pcre}/include" + PCRE_LIBS="-L${ac_cv_c_pcre}/lib -lpcre" + PCRE_CONFIG="${ac_cv_c_pcre}/bin/pcre-config" + else + AC_MSG_ERROR([${with_pcre} directory doesn't contain pcre header and/or library]) + fi + fi + + if test x"${ac_cv_c_pcre}" = x ; then + # Try pcre-config if it exists + ac_cv_c_pcre=`${PCRE_CONFIG} --prefix 2>/dev/null` + if test "$?" -eq 0; then + PCRE_INCLUDE=`${PCRE_CONFIG} --cflags 2>/dev/null` + PCRE_LIBS=`${PCRE_CONFIG} --libs 2>/dev/null` + fi + fi + + # check in a few common install locations + if test x"${ac_cv_c_pcre}" = x ; then + for i in \ + `ls -d ${exec_prefix} 2>/dev/null` \ + `ls -d ${prefix} 2>/dev/null` \ + `ls -d /usr/local 2>/dev/null` \ + `ls -d /usr/contrib 2>/dev/null` \ + `ls -d /usr 2>/dev/null` \ + ; do + if test -f "${i}/include/pcre.h" -a \ + \( -f "${i}/lib/libpcre.so" -o \ + -f "${i}/lib/libpcre.a" \); then + ac_cv_c_pcre=`(cd $i; pwd)` + PCRE_INCLUDE="-I${ac_cv_c_pcre}/include" + PCRE_LIBS="-L${ac_cv_c_pcre}/lib -lpcre" + break + fi + done + fi + ]) + + if test x"${ac_cv_c_pcre}" = x ; then + AC_MSG_ERROR([Can't find PCRE configuration]) + else + AC_MSG_RESULT([found PCRE configuration at ${ac_cv_c_pcre}]) + fi + AC_SUBST([PCRE_INCLUDE]) + AC_SUBST([PCRE_LIBS]) +]) + +#------------------------------------------------------------------------ +# SC_ENABLE_PCRE -- +# +# Allows the use of PCRE in Tcl as default +# +# Arguments: +# none +# +# Results: +# Adds the following arguments to configure: +# --enable-pcre=yes|no|default +# +#------------------------------------------------------------------------ + +AC_DEFUN([SC_ENABLE_PCRE], [ + AC_REQUIRE([SC_WITH_PCRE]) + AC_MSG_CHECKING([whether to enable pcre in Tcl]) + AC_ARG_ENABLE(pcre, + AC_HELP_STRING([--enable-pcre], + [whether to enable pcre (default: off)]), + [enable_pcre=$enableval], [enable_pcre=no]) + + if test "${enable_pcre+set}" = set; then + enableval="$enable_pcre" + enable_pcre=$enableval + else + enable_pcre=yes + fi + + if test x"${ac_cv_c_pcre}" = x -a x"${PCRE_INCLUDE}" = x -a x"${PCRE_LIBS}" = x ; then + AC_MSG_RESULT([pcre configuration not found]) + else + if test "$enable_pcre" = "default" ; then + AC_MSG_RESULT([pcre default]) + AC_DEFINE(USE_DEFAULT_PCRE, 1, [Use PCRE as default RE?]) + AC_DEFINE(HAVE_PCRE, 1, [Do we enable PCRE interfaces?]) + AC_DEFINE(PCRE_STATIC, 1, [Statically compile PCRE]) + elif test "$enable_pcre" = "yes" ; then + AC_MSG_RESULT([pcre enabled]) + AC_DEFINE(HAVE_PCRE, 1, [Do we enable PCRE interfaces?]) + AC_DEFINE(PCRE_STATIC, 1, [Statically compile PCRE]) + else + PCRE_INCLUDE= + PCRE_LIBS= + AC_MSG_RESULT([no pcre]) + fi + fi +]) + +#------------------------------------------------------------------------ # SC_ENABLE_SHARED -- # # Allows the building of shared libraries @@ -1297,3 +1425,13 @@ print("manifest needed") AC_SUBST(VC_MANIFEST_EMBED_DLL) AC_SUBST(VC_MANIFEST_EMBED_EXE) ]) + +AC_DEFUN([AC_PROG_BISON],[ + AC_CHECK_PROGS(BISON,[bison],no) + export BISON; + if test $BISON = "no" ; + then + AC_MSG_ERROR([Unable to find bison]); + fi + AC_SUBST(BISON) +]) diff --git a/win/tclWinPort.h b/win/tclWinPort.h index ca6b2bf..5f28b31 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -93,6 +93,10 @@ typedef DWORD_PTR * PDWORD_PTR; #include <signal.h> #include <limits.h> +#ifdef __MINGW32__ +#include <stdint.h> +#endif + #ifndef __GNUC__ # define strncasecmp _strnicmp # define strcasecmp _stricmp @@ -531,7 +535,6 @@ typedef DWORD_PTR * PDWORD_PTR; /* This type is not defined in the Windows headers */ #define socklen_t int - /* * The following macros have trivial definitions, allowing generic code to * address platform-specific issues. diff --git a/win/tclWinSock.c b/win/tclWinSock.c index a022ed5..49ebdbb 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -54,6 +54,12 @@ # pragma comment (lib, "ws2_32") #endif +#ifdef __MINGW32__ +/* For compiling under earlier versions of mingw which omitted this. */ +const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }}; +const struct in6_addr in6addr_loopback = {{ IN6ADDR_LOOPBACK_INIT }}; +#endif + /* * Support for control over sockets' KEEPALIVE and NODELAY behavior is * currently disabled. |