sl@0: #------------------------------------------------------------------------ sl@0: # SC_PATH_TCLCONFIG -- sl@0: # sl@0: # Locate the tclConfig.sh file and perform a sanity check on sl@0: # the Tcl compile flags sl@0: # Currently a no-op for Windows sl@0: # sl@0: # Arguments: sl@0: # PATCH_LEVEL The patch level for Tcl if any. sl@0: # sl@0: # Results: sl@0: # sl@0: # Adds the following arguments to configure: sl@0: # --with-tcl=... sl@0: # sl@0: # Sets the following vars: sl@0: # TCL_BIN_DIR Full path to the tclConfig.sh file sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_PATH_TCLCONFIG], [ sl@0: AC_MSG_CHECKING([the location of tclConfig.sh]) sl@0: sl@0: if test -d ../../tcl8.4$1/win; then sl@0: TCL_BIN_DIR_DEFAULT=../../tcl8.4$1/win sl@0: elif test -d ../../tcl8.4/win; then sl@0: TCL_BIN_DIR_DEFAULT=../../tcl8.4/win sl@0: else sl@0: TCL_BIN_DIR_DEFAULT=../../tcl/win sl@0: fi sl@0: sl@0: AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR], sl@0: TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`) sl@0: if test ! -d $TCL_BIN_DIR; then sl@0: AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) sl@0: fi sl@0: if test ! -f $TCL_BIN_DIR/tclConfig.sh; then sl@0: AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) sl@0: fi sl@0: AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_PATH_TKCONFIG -- sl@0: # sl@0: # Locate the tkConfig.sh file sl@0: # Currently a no-op for Windows sl@0: # sl@0: # Arguments: sl@0: # none sl@0: # sl@0: # Results: sl@0: # sl@0: # Adds the following arguments to configure: sl@0: # --with-tk=... sl@0: # sl@0: # Sets the following vars: sl@0: # TK_BIN_DIR Full path to the tkConfig.sh file sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_PATH_TKCONFIG], [ sl@0: AC_MSG_CHECKING([the location of tkConfig.sh]) sl@0: sl@0: if test -d ../../tk8.4$1/win; then sl@0: TK_BIN_DIR_DEFAULT=../../tk8.4$1/win sl@0: elif test -d ../../tk8.4/win; then sl@0: TK_BIN_DIR_DEFAULT=../../tk8.4/win sl@0: else sl@0: TK_BIN_DIR_DEFAULT=../../tk/win sl@0: fi sl@0: sl@0: AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.4 binaries from DIR], sl@0: TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`) sl@0: if test ! -d $TK_BIN_DIR; then sl@0: AC_MSG_ERROR(Tk directory $TK_BIN_DIR does not exist) sl@0: fi sl@0: if test ! -f $TK_BIN_DIR/tkConfig.sh; then sl@0: AC_MSG_ERROR(There is no tkConfig.sh in $TK_BIN_DIR: perhaps you did not specify the Tk *build* directory (not the toplevel Tk directory) or you forgot to configure Tk?) sl@0: fi sl@0: sl@0: AC_MSG_RESULT([$TK_BIN_DIR/tkConfig.sh]) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_LOAD_TCLCONFIG -- sl@0: # sl@0: # Load the tclConfig.sh file. sl@0: # sl@0: # Arguments: sl@0: # sl@0: # Requires the following vars to be set: sl@0: # TCL_BIN_DIR sl@0: # sl@0: # Results: sl@0: # sl@0: # Subst the following vars: sl@0: # TCL_BIN_DIR sl@0: # TCL_SRC_DIR sl@0: # TCL_LIB_FILE sl@0: # sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_LOAD_TCLCONFIG], [ sl@0: AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) sl@0: sl@0: if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then sl@0: AC_MSG_RESULT([loading]) sl@0: . $TCL_BIN_DIR/tclConfig.sh sl@0: else sl@0: AC_MSG_RESULT([file not found]) sl@0: fi sl@0: sl@0: # sl@0: # If the TCL_BIN_DIR is the build directory (not the install directory), sl@0: # then set the common variable name to the value of the build variables. sl@0: # For example, the variable TCL_LIB_SPEC will be set to the value sl@0: # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC sl@0: # instead of TCL_BUILD_LIB_SPEC since it will work with both an sl@0: # installed and uninstalled version of Tcl. sl@0: # sl@0: sl@0: if test -f $TCL_BIN_DIR/Makefile ; then sl@0: TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} sl@0: TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} sl@0: TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} sl@0: fi sl@0: sl@0: # sl@0: # eval is required to do the TCL_DBGX substitution sl@0: # sl@0: sl@0: eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" sl@0: eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" sl@0: eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" sl@0: sl@0: eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" sl@0: eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" sl@0: eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" sl@0: sl@0: AC_SUBST(TCL_VERSION) sl@0: AC_SUBST(TCL_BIN_DIR) sl@0: AC_SUBST(TCL_SRC_DIR) sl@0: sl@0: AC_SUBST(TCL_LIB_FILE) sl@0: AC_SUBST(TCL_LIB_FLAG) sl@0: AC_SUBST(TCL_LIB_SPEC) sl@0: sl@0: AC_SUBST(TCL_STUB_LIB_FILE) sl@0: AC_SUBST(TCL_STUB_LIB_FLAG) sl@0: AC_SUBST(TCL_STUB_LIB_SPEC) sl@0: sl@0: AC_SUBST(TCL_DEFS) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_LOAD_TKCONFIG -- sl@0: # sl@0: # Load the tkConfig.sh file sl@0: # Currently a no-op for Windows sl@0: # sl@0: # Arguments: sl@0: # sl@0: # Requires the following vars to be set: sl@0: # TK_BIN_DIR sl@0: # sl@0: # Results: sl@0: # sl@0: # Sets the following vars that should be in tkConfig.sh: sl@0: # TK_BIN_DIR sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_LOAD_TKCONFIG], [ sl@0: AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh]) sl@0: sl@0: if test -f "$TK_BIN_DIR/tkConfig.sh" ; then sl@0: AC_MSG_RESULT([loading]) sl@0: . $TK_BIN_DIR/tkConfig.sh sl@0: else sl@0: AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh]) sl@0: fi sl@0: sl@0: sl@0: AC_SUBST(TK_BIN_DIR) sl@0: AC_SUBST(TK_SRC_DIR) sl@0: AC_SUBST(TK_LIB_FILE) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_ENABLE_SHARED -- sl@0: # sl@0: # Allows the building of shared libraries sl@0: # sl@0: # Arguments: sl@0: # none sl@0: # sl@0: # Results: sl@0: # sl@0: # Adds the following arguments to configure: sl@0: # --enable-shared=yes|no sl@0: # sl@0: # Defines the following vars: sl@0: # STATIC_BUILD Used for building import/export libraries sl@0: # on Windows. sl@0: # sl@0: # Sets the following vars: sl@0: # SHARED_BUILD Value of 1 or 0 sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_ENABLE_SHARED], [ sl@0: AC_MSG_CHECKING([how to build libraries]) sl@0: AC_ARG_ENABLE(shared, sl@0: [ --enable-shared build and link with shared libraries [--enable-shared]], sl@0: [tcl_ok=$enableval], [tcl_ok=yes]) sl@0: sl@0: if test "${enable_shared+set}" = set; then sl@0: enableval="$enable_shared" sl@0: tcl_ok=$enableval sl@0: else sl@0: tcl_ok=yes sl@0: fi sl@0: sl@0: if test "$tcl_ok" = "yes" ; then sl@0: AC_MSG_RESULT([shared]) sl@0: SHARED_BUILD=1 sl@0: else sl@0: AC_MSG_RESULT([static]) sl@0: SHARED_BUILD=0 sl@0: AC_DEFINE(STATIC_BUILD) sl@0: fi sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_ENABLE_THREADS -- sl@0: # sl@0: # Specify if thread support should be enabled sl@0: # sl@0: # Arguments: sl@0: # none sl@0: # sl@0: # Results: sl@0: # sl@0: # Adds the following arguments to configure: sl@0: # --enable-threads=yes|no sl@0: # sl@0: # Defines the following vars: sl@0: # TCL_THREADS sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_ENABLE_THREADS], [ sl@0: AC_MSG_CHECKING(for building with threads) sl@0: AC_ARG_ENABLE(threads, [ --enable-threads build with threads], sl@0: [tcl_ok=$enableval], [tcl_ok=no]) sl@0: sl@0: if test "$tcl_ok" = "yes"; then sl@0: AC_MSG_RESULT(yes) sl@0: TCL_THREADS=1 sl@0: AC_DEFINE(TCL_THREADS) sl@0: # USE_THREAD_ALLOC tells us to try the special thread-based sl@0: # allocator that significantly reduces lock contention sl@0: AC_DEFINE(USE_THREAD_ALLOC) sl@0: else sl@0: TCL_THREADS=0 sl@0: AC_MSG_RESULT([no (default)]) sl@0: fi sl@0: AC_SUBST(TCL_THREADS) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_ENABLE_SYMBOLS -- sl@0: # sl@0: # Specify if debugging symbols should be used sl@0: # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging sl@0: # can also be enabled. sl@0: # sl@0: # Arguments: sl@0: # none sl@0: # sl@0: # Requires the following vars to be set in the Makefile: sl@0: # CFLAGS_DEBUG sl@0: # CFLAGS_OPTIMIZE sl@0: # sl@0: # Results: sl@0: # sl@0: # Adds the following arguments to configure: sl@0: # --enable-symbols sl@0: # sl@0: # Defines the following vars: sl@0: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true sl@0: # Sets to $(CFLAGS_OPTIMIZE) if false sl@0: # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true sl@0: # Sets to $(LDFLAGS_OPTIMIZE) if false sl@0: # DBGX Debug library extension sl@0: # sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_ENABLE_SYMBOLS], [ sl@0: AC_MSG_CHECKING([for build with symbols]) sl@0: AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) sl@0: # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. sl@0: if test "$tcl_ok" = "no"; then sl@0: CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)' sl@0: LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)' sl@0: DBGX="" sl@0: AC_MSG_RESULT([no]) sl@0: else sl@0: CFLAGS_DEFAULT='$(CFLAGS_DEBUG)' sl@0: LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)' sl@0: DBGX=g sl@0: if test "$tcl_ok" = "yes"; then sl@0: AC_MSG_RESULT([yes (standard debugging)]) sl@0: fi sl@0: fi sl@0: AC_SUBST(CFLAGS_DEFAULT) sl@0: AC_SUBST(LDFLAGS_DEFAULT) sl@0: sl@0: if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then sl@0: AC_DEFINE(TCL_MEM_DEBUG) sl@0: fi sl@0: sl@0: if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then sl@0: AC_DEFINE(TCL_COMPILE_DEBUG) sl@0: AC_DEFINE(TCL_COMPILE_STATS) sl@0: fi sl@0: sl@0: if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then sl@0: if test "$tcl_ok" = "all"; then sl@0: AC_MSG_RESULT([enabled symbols mem compile debugging]) sl@0: else sl@0: AC_MSG_RESULT([enabled $tcl_ok debugging]) sl@0: fi sl@0: fi sl@0: ]) sl@0: sl@0: #-------------------------------------------------------------------- sl@0: # SC_CONFIG_CFLAGS sl@0: # sl@0: # Try to determine the proper flags to pass to the compiler sl@0: # for building shared libraries and other such nonsense. sl@0: # sl@0: # NOTE: The backslashes in quotes below are substituted twice sl@0: # due to the fact that they are in a macro and then inlined sl@0: # in the final configure script. sl@0: # sl@0: # Arguments: sl@0: # none sl@0: # sl@0: # Results: sl@0: # sl@0: # Can the following vars: sl@0: # EXTRA_CFLAGS sl@0: # CFLAGS_DEBUG sl@0: # CFLAGS_OPTIMIZE sl@0: # CFLAGS_WARNING sl@0: # LDFLAGS_DEBUG sl@0: # LDFLAGS_OPTIMIZE sl@0: # LDFLAGS_CONSOLE sl@0: # LDFLAGS_WINDOW sl@0: # CC_OBJNAME sl@0: # CC_EXENAME sl@0: # CYGPATH sl@0: # STLIB_LD sl@0: # SHLIB_LD sl@0: # SHLIB_LD_LIBS sl@0: # LIBS sl@0: # AR sl@0: # RC sl@0: # RES sl@0: # sl@0: # MAKE_LIB sl@0: # MAKE_EXE sl@0: # MAKE_DLL sl@0: # sl@0: # LIBSUFFIX sl@0: # LIBPREFIX sl@0: # LIBRARIES sl@0: # EXESUFFIX sl@0: # DLLSUFFIX sl@0: # sl@0: #-------------------------------------------------------------------- sl@0: sl@0: AC_DEFUN([SC_CONFIG_CFLAGS], [ sl@0: sl@0: # Step 0: Enable 64 bit support? sl@0: sl@0: AC_MSG_CHECKING([if 64bit support is requested]) sl@0: AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable = amd64|ia64)], [do64bit=$enableval], [do64bit=no]) sl@0: AC_MSG_RESULT($do64bit) sl@0: sl@0: # Set some defaults (may get changed below) sl@0: EXTRA_CFLAGS="" sl@0: sl@0: AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) sl@0: sl@0: SHLIB_SUFFIX=".dll" sl@0: sl@0: # MACHINE is IX86 for LINK, but this is used by the manifest, sl@0: # which requires x86|amd64|ia64. sl@0: MACHINE="X86" sl@0: sl@0: # Check for a bug in gcc's windres that causes the sl@0: # compile to fail when a Windows native path is sl@0: # passed into windres. The mingw toolchain requires sl@0: # Windows native paths while Cygwin should work sl@0: # with both. Avoid the bug by passing a POSIX sl@0: # path when using the Cygwin toolchain. sl@0: sl@0: if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then sl@0: conftest=/tmp/conftest.rc sl@0: echo "STRINGTABLE BEGIN" > $conftest sl@0: echo "101 \"name\"" >> $conftest sl@0: echo "END" >> $conftest sl@0: sl@0: AC_MSG_CHECKING([for Windows native path bug in windres]) sl@0: cyg_conftest=`$CYGPATH $conftest` sl@0: if AC_TRY_COMMAND($RC -o conftest.res.o $cyg_conftest) ; then sl@0: AC_MSG_RESULT([no]) sl@0: else sl@0: AC_MSG_RESULT([yes]) sl@0: CYGPATH=echo sl@0: fi sl@0: conftest= sl@0: cyg_conftest= sl@0: fi sl@0: sl@0: if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then sl@0: DEPARG='"$<"' sl@0: else sl@0: DEPARG='"$(shell $(CYGPATH) $<)"' sl@0: fi sl@0: sl@0: # set various compiler flags depending on whether we are using gcc or cl sl@0: sl@0: AC_MSG_CHECKING([compiler flags]) sl@0: if test "${GCC}" = "yes" ; then sl@0: if test "$do64bit" != "no" ; then sl@0: AC_MSG_WARN("64bit mode not supported with GCC on Windows") sl@0: fi sl@0: SHLIB_LD="" sl@0: SHLIB_LD_LIBS="" sl@0: LIBS="" sl@0: LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32" sl@0: STLIB_LD='${AR} cr' sl@0: RC_OUT=-o sl@0: RC_TYPE= sl@0: RC_INCLUDE=--include sl@0: RC_DEFINE=--define sl@0: RES=res.o sl@0: MAKE_LIB="\${STLIB_LD} \[$]@" sl@0: POST_MAKE_LIB="\${RANLIB} \[$]@" sl@0: MAKE_EXE="\${CC} -o \[$]@" sl@0: LIBPREFIX="lib" sl@0: sl@0: #if test "$ac_cv_cygwin" = "yes"; then sl@0: # extra_cflags="-mno-cygwin" sl@0: # extra_ldflags="-mno-cygwin" sl@0: #else sl@0: # extra_cflags="" sl@0: # extra_ldflags="" sl@0: #fi sl@0: sl@0: if test "$ac_cv_cygwin" = "yes"; then sl@0: touch ac$$.c sl@0: if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then sl@0: case "$extra_cflags" in sl@0: *-mwin32*) ;; sl@0: *) extra_cflags="-mwin32 $extra_cflags" ;; sl@0: esac sl@0: case "$extra_ldflags" in sl@0: *-mwin32*) ;; sl@0: *) extra_ldflags="-mwin32 $extra_ldflags" ;; sl@0: esac sl@0: fi sl@0: rm -f ac$$.o ac$$.c sl@0: else sl@0: extra_cflags='' sl@0: extra_ldflags='' sl@0: fi sl@0: sl@0: if test "${SHARED_BUILD}" = "0" ; then sl@0: # static sl@0: AC_MSG_RESULT([using static flags]) sl@0: runtime= sl@0: MAKE_DLL="echo " sl@0: LIBSUFFIX="s\${DBGX}.a" sl@0: LIBFLAGSUFFIX="s\${DBGX}" sl@0: LIBRARIES="\${STATIC_LIBRARIES}" sl@0: EXESUFFIX="s\${DBGX}.exe" sl@0: else sl@0: # dynamic sl@0: AC_MSG_RESULT([using shared flags]) sl@0: sl@0: # ad-hoc check to see if CC supports -shared. sl@0: if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then sl@0: AC_MSG_ERROR([${CC} does not support the -shared option. sl@0: You will need to upgrade to a newer version of the toolchain.]) sl@0: fi sl@0: sl@0: runtime= sl@0: # Link with gcc since ld does not link to default libs like sl@0: # -luser32 and -lmsvcrt by default. Make sure CFLAGS is sl@0: # included so -mno-cygwin passed the correct libs to the linker. sl@0: SHLIB_LD='${CC} -shared ${CFLAGS}' sl@0: SHLIB_LD_LIBS='${LIBS}' sl@0: # Add SHLIB_LD_LIBS to the Make rule, not here. sl@0: MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \[$]@ ${extra_ldflags} \ sl@0: -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\[$]@)" sl@0: sl@0: LIBSUFFIX="\${DBGX}.a" sl@0: LIBFLAGSUFFIX="\${DBGX}" sl@0: EXESUFFIX="\${DBGX}.exe" sl@0: LIBRARIES="\${SHARED_LIBRARIES}" sl@0: fi sl@0: # DLLSUFFIX is separate because it is the building block for sl@0: # users of tclConfig.sh that may build shared or static. sl@0: DLLSUFFIX="\${DBGX}.dll" sl@0: SHLIB_SUFFIX=.dll sl@0: sl@0: EXTRA_CFLAGS="${extra_cflags}" sl@0: sl@0: CFLAGS_DEBUG=-g sl@0: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" sl@0: CFLAGS_WARNING="-Wall -Wconversion" sl@0: LDFLAGS_DEBUG= sl@0: LDFLAGS_OPTIMIZE= sl@0: sl@0: # Specify the CC output file names based on the target name sl@0: CC_OBJNAME="-o \[$]@" sl@0: CC_EXENAME="-o \[$]@" sl@0: sl@0: # Specify linker flags depending on the type of app being sl@0: # built -- Console vs. Window. sl@0: # sl@0: # ORIGINAL COMMENT: sl@0: # We need to pass -e _WinMain@16 so that ld will use sl@0: # WinMain() instead of main() as the entry point. We can't sl@0: # use autoconf to check for this case since it would need sl@0: # to run an executable and that does not work when sl@0: # cross compiling. Remove this -e workaround once we sl@0: # require a gcc that does not have this bug. sl@0: # sl@0: # MK NOTE: Tk should use a different mechanism. This causes sl@0: # interesting problems, such as wish dying at startup. sl@0: #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}" sl@0: LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}" sl@0: LDFLAGS_WINDOW="-mwindows ${extra_ldflags}" sl@0: else sl@0: if test "${SHARED_BUILD}" = "0" ; then sl@0: # static sl@0: AC_MSG_RESULT([using static flags]) sl@0: runtime=-MT sl@0: MAKE_DLL="echo " sl@0: LIBSUFFIX="s\${DBGX}.lib" sl@0: LIBFLAGSUFFIX="s\${DBGX}" sl@0: LIBRARIES="\${STATIC_LIBRARIES}" sl@0: EXESUFFIX="s\${DBGX}.exe" sl@0: SHLIB_LD_LIBS="" sl@0: else sl@0: # dynamic sl@0: AC_MSG_RESULT([using shared flags]) sl@0: runtime=-MD sl@0: # Add SHLIB_LD_LIBS to the Make rule, not here. sl@0: MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@" sl@0: LIBSUFFIX="\${DBGX}.lib" sl@0: LIBFLAGSUFFIX="\${DBGX}" sl@0: EXESUFFIX="\${DBGX}.exe" sl@0: LIBRARIES="\${SHARED_LIBRARIES}" sl@0: SHLIB_LD_LIBS='${LIBS}' sl@0: fi sl@0: # DLLSUFFIX is separate because it is the building block for sl@0: # users of tclConfig.sh that may build shared or static. sl@0: DLLSUFFIX="\${DBGX}.dll" sl@0: sl@0: # This is a 2-stage check to make sure we have the 64-bit SDK sl@0: # We have to know where the SDK is installed. sl@0: # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs sl@0: if test "$do64bit" != "no" ; then sl@0: if test "x${MSSDK}x" = "xx" ; then sl@0: MSSDK="C:/Progra~1/Microsoft Platform SDK" sl@0: fi sl@0: MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` sl@0: PATH64="" sl@0: case "$do64bit" in sl@0: amd64|x64|yes) sl@0: MACHINE="AMD64" ; # default to AMD64 64-bit build sl@0: PATH64="${MSSDK}/Bin/Win64/x86/AMD64" sl@0: ;; sl@0: ia64) sl@0: MACHINE="IA64" sl@0: PATH64="${MSSDK}/Bin/Win64" sl@0: ;; sl@0: esac sl@0: if test ! -d "${PATH64}" ; then sl@0: AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) sl@0: AC_MSG_WARN([Ensure latest Platform SDK is installed]) sl@0: do64bit="no" sl@0: else sl@0: AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) sl@0: fi sl@0: fi sl@0: sl@0: if test "$do64bit" != "no" ; then sl@0: # The space-based-path will work for the Makefile, but will sl@0: # not work if AC_TRY_COMPILE is called. sl@0: CC="\"${PATH64}/cl.exe\" -I\"${MSSDK}/Include\" \ sl@0: -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" sl@0: RC="\"${MSSDK}/bin/rc.exe\"" sl@0: CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d" sl@0: # Do not use -O2 for Win64 - this has proved buggy in code gen. sl@0: CFLAGS_OPTIMIZE="-nologo -O1 ${runtime}" sl@0: lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" sl@0: LINKBIN="\"${PATH64}/link.exe\"" sl@0: # Avoid 'unresolved external symbol __security_cookie' errors. sl@0: # c.f. http://support.microsoft.com/?id=894573 sl@0: LIBS="user32.lib advapi32.lib bufferoverflowU.lib" sl@0: else sl@0: RC="rc" sl@0: # -Od - no optimization sl@0: # -WX - warnings as errors sl@0: CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d" sl@0: # -O2 - create fast code (/Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy) sl@0: CFLAGS_OPTIMIZE="-nologo -O2 ${runtime}" sl@0: lflags="-nologo" sl@0: LINKBIN="link" sl@0: LIBS="user32.lib advapi32.lib" sl@0: fi sl@0: sl@0: LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib" sl@0: SHLIB_LD="${LINKBIN} -dll -incremental:no ${lflags}" sl@0: # link -lib only works when -lib is the first arg sl@0: STLIB_LD="${LINKBIN} -lib ${lflags}" sl@0: RC_OUT=-fo sl@0: RC_TYPE=-r sl@0: RC_INCLUDE=-i sl@0: RC_DEFINE=-d sl@0: RES=res sl@0: MAKE_LIB="\${STLIB_LD} -out:\[$]@" sl@0: POST_MAKE_LIB= sl@0: MAKE_EXE="\${CC} -Fe\[$]@" sl@0: LIBPREFIX="" sl@0: sl@0: EXTRA_CFLAGS="" sl@0: CFLAGS_WARNING="-W3" sl@0: LDFLAGS_DEBUG="-debug:full" sl@0: LDFLAGS_OPTIMIZE="-release" sl@0: sl@0: # Specify the CC output file names based on the target name sl@0: CC_OBJNAME="-Fo\[$]@" sl@0: CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\"" sl@0: sl@0: # Specify linker flags depending on the type of app being sl@0: # built -- Console vs. Window. sl@0: LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" sl@0: LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" sl@0: fi sl@0: sl@0: # DL_LIBS is empty, but then we match the Unix version sl@0: AC_SUBST(DL_LIBS) sl@0: AC_SUBST(CFLAGS_DEBUG) sl@0: AC_SUBST(CFLAGS_OPTIMIZE) sl@0: AC_SUBST(CFLAGS_WARNING) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_WITH_TCL -- sl@0: # sl@0: # Location of the Tcl build directory. sl@0: # sl@0: # Arguments: sl@0: # none sl@0: # sl@0: # Results: sl@0: # sl@0: # Adds the following arguments to configure: sl@0: # --with-tcl=... sl@0: # sl@0: # Defines the following vars: sl@0: # TCL_BIN_DIR Full path to the tcl build dir. sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_WITH_TCL], [ sl@0: if test -d ../../tcl8.4$1/win; then sl@0: TCL_BIN_DEFAULT=../../tcl8.4$1/win sl@0: else sl@0: TCL_BIN_DEFAULT=../../tcl8.4/win sl@0: fi sl@0: sl@0: AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR], sl@0: TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`) sl@0: if test ! -d $TCL_BIN_DIR; then sl@0: AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist) sl@0: fi sl@0: if test ! -f $TCL_BIN_DIR/Makefile; then sl@0: AC_MSG_ERROR(There is no Makefile in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?) sl@0: else sl@0: echo "building against Tcl binaries in: $TCL_BIN_DIR" sl@0: fi sl@0: AC_SUBST(TCL_BIN_DIR) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_PROG_TCLSH sl@0: # Locate a tclsh shell installed on the system path. This macro sl@0: # will only find a Tcl shell that already exists on the system. sl@0: # It will not find a Tcl shell in the Tcl build directory or sl@0: # a Tcl shell that has been installed from the Tcl build directory. sl@0: # If a Tcl shell can't be located on the PATH, then TCLSH_PROG will sl@0: # be set to "". Extensions should take care not to create Makefile sl@0: # rules that are run by default and depend on TCLSH_PROG. An sl@0: # extension can't assume that an executable Tcl shell exists at sl@0: # build time. sl@0: # sl@0: # Arguments sl@0: # none sl@0: # sl@0: # Results sl@0: # Subst's the following values: sl@0: # TCLSH_PROG sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_PROG_TCLSH], [ sl@0: AC_MSG_CHECKING([for tclsh]) sl@0: sl@0: AC_CACHE_VAL(ac_cv_path_tclsh, [ sl@0: search_path=`echo ${PATH} | sed -e 's/:/ /g'` sl@0: for dir in $search_path ; do sl@0: for j in `ls -r $dir/tclsh[[8-9]]*.exe 2> /dev/null` \ sl@0: `ls -r $dir/tclsh* 2> /dev/null` ; do sl@0: if test x"$ac_cv_path_tclsh" = x ; then sl@0: if test -f "$j" ; then sl@0: ac_cv_path_tclsh=$j sl@0: break sl@0: fi sl@0: fi sl@0: done sl@0: done sl@0: ]) sl@0: sl@0: if test -f "$ac_cv_path_tclsh" ; then sl@0: TCLSH_PROG="$ac_cv_path_tclsh" sl@0: AC_MSG_RESULT($TCLSH_PROG) sl@0: else sl@0: # It is not an error if an installed version of Tcl can't be located. sl@0: TCLSH_PROG="" sl@0: AC_MSG_RESULT([No tclsh found on PATH]) sl@0: fi sl@0: AC_SUBST(TCLSH_PROG) sl@0: ]) sl@0: sl@0: #------------------------------------------------------------------------ sl@0: # SC_BUILD_TCLSH sl@0: # Determine the fully qualified path name of the tclsh executable sl@0: # in the Tcl build directory. This macro will correctly determine sl@0: # the name of the tclsh executable even if tclsh has not yet sl@0: # been built in the build directory. The build tclsh must be used sl@0: # when running tests from an extension build directory. It is not sl@0: # correct to use the TCLSH_PROG in cases like this. sl@0: # sl@0: # Arguments sl@0: # none sl@0: # sl@0: # Results sl@0: # Subst's the following values: sl@0: # BUILD_TCLSH sl@0: #------------------------------------------------------------------------ sl@0: sl@0: AC_DEFUN([SC_BUILD_TCLSH], [ sl@0: AC_MSG_CHECKING([for tclsh in Tcl build directory]) sl@0: BUILD_TCLSH=${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT} sl@0: AC_MSG_RESULT($BUILD_TCLSH) sl@0: AC_SUBST(BUILD_TCLSH) sl@0: ]) sl@0: