summaryrefslogtreecommitdiffstats
path: root/win/configure.in
blob: f4e1e5cfb53091ebfc2e5167c9d1d380f9d0d906 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during Tcl installation
dnl	to configure the system for the local environment.
AC_INIT(../generic/tcl.h)
# RCS: @(#) $Id: configure.in,v 1.4 1999/06/10 21:47:28 wart Exp $

TCL_VERSION=8.1
TCL_MAJOR_VERSION=8
TCL_MINOR_VERSION=1
TCL_PATCH_LEVEL=.2
VERSION=${TCL_VERSION}

# Check whether --enable-gcc or --disable-gcc was given.  Do this before 
# AC_PROG_CC and AC_CYGWIN are called so the compiler can be fully tested
# by built-in autoconf tools.
 
SC_ENABLE_GCC

AC_PROG_MAKE_SET
AC_PROG_CC
AC_CYGWIN
AC_OBJEXT
AC_EXEEXT

# Set the default compiler switches based on the --enable-symbols option 

SC_ENABLE_SYMBOLS

CFLAGS=${CFLAGS_DEFAULT}
LD_FLAGS=${LDFLAGS_DEFAULT}
TCL_DBGX=${DBGX}

# Trick to replace DBGX with TCL_DBGX
DBGX='${TCL_DBGX}'
eval "TCL_LIB_FILE=${TCL_LIB_FILE}"

# Check whether --enable-threads or --disable-threads was given.

SC_ENABLE_THREADS

#--------------------------------------------------------------------
#	The statements below define a collection of symbols related to
#	building libtcl as a shared library instead of a static library.
#--------------------------------------------------------------------

SC_ENABLE_SHARED

EXTRA_CFLAGS=""
# set various compiler flags depending on whether we are using gcc or cl
if test "${GCC}" = "yes" ; then
    CFLAGS_DEBUG=-g
    CFLAGS_OPTIMIZE=-O
    CFLAGS_WARNING="-Wall -Wconversion"
    LDFLAGS_DEBUG=-g
    LDFLAGS_OPTIMIZE=-O
    PATHTYPE=-u

    # Specify the CC output file names based on the target name
    CC_OBJNAME="-o \$@"
    CC_EXENAME="-o \$@"
else
    SHLIB_LD="link -dll -nologo"
    SHLIB_LD_LIBS="user32.lib advapi32.lib"
    LIBS="user32.lib advapi32.lib"
    AR="lib -nologo"
    MAKE_LIB="\${AR} -out:\$@"
    MAKE_EXE="\${CC} -Fe\$@"

    if test "${TCL_SHARED_BUILD}" = "0" ; then
	# static
	echo "building static version"
	runtime=-MT
	MAKE_DLL="echo "
	LIBSUFFIX="s\${TCL_DBGX}.lib"
	LIBRARIES="\${STATIC_LIBRARIES}"
	EXESUFFIX="s\${TCL_DBGX}.exe"
	DLLSUFFIX=""
    else
	# dynamic
	echo "building dynamic version"
	runtime=-MD
	MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} -out:\$@"
	LIBSUFFIX="\${TCL_DBGX}.lib"
	DLLSUFFIX="\${TCL_DBGX}.dll"
	EXESUFFIX="\${TCL_DBGX}.exe"
	LIBRARIES="\${SHARED_LIBRARIES}"
    fi

    EXTRA_CFLAGS="-YX"
    CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
    CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
    CFLAGS_WARNING="-W3"
    LDFLAGS_DEBUG="-debug"
    LDFLAGS_OPTIMIZE="-release"
    PATHTYPE=-w

    # Specify the CC output file names based on the target name
    CC_OBJNAME="-Fo\$@"
    CC_EXENAME="-Fe\$@"
fi

eval "LD_FLAGS=${LD_FLAGS}"

AC_SUBST(PATHTYPE)
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
AC_SUBST(EXTRA_CFLAGS)
AC_SUBST(TCL_DBGX)
AC_SUBST(TCL_LIB_FILE)
AC_SUBST(TCL_MAJOR_VERSION)
AC_SUBST(TCL_MINOR_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_VERSION)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(CC_OBJNAME)
AC_SUBST(CC_EXENAME)
AC_SUBST(AR)
AC_SUBST(DLLSUFFIX)
AC_SUBST(LIBSUFFIX)
AC_SUBST(EXESUFFIX)
AC_SUBST(LIBRARIES)
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_DLL)

AC_OUTPUT(Makefile)