1#!/bin/bash -norc
2#--------------------------------------------------------------------
3# Sample configure.in for Tcl Extensions.  The only places you should
4# need to modify this file are marked by the string __CHANGE__
5#--------------------------------------------------------------------
6
7#-----------------------------------------------------------------------
8# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
9# set as provided.  These will also be added as -D defs in your Makefile
10# so you can encode the package version directly into the source files.
11#-----------------------------------------------------------------------
12
13AC_INIT([itcl], [3.4])
14
15#--------------------------------------------------------------------
16# Call TEA_INIT as the first TEA_ macro to set up initial vars.
17# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
18# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
19#--------------------------------------------------------------------
20
21TEA_INIT([3.9])
22
23AC_PROG_LN_S
24CONFIG_CLEAN_FILES=
25if test ! -d $srcdir/tclconfig ; then
26    if test -d $srcdir/../tclconfig ; then
27	$LN_S $srcdir/../tclconfig tclconfig
28	CONFIG_CLEAN_FILES=tclconfig
29    fi
30fi
31AC_SUBST(CONFIG_CLEAN_FILES)
32
33AC_CONFIG_AUX_DIR(../tclconfig)
34
35#--------------------------------------------------------------------
36# Load the tclConfig.sh file
37#--------------------------------------------------------------------
38
39TEA_PATH_TCLCONFIG
40TEA_LOAD_TCLCONFIG
41
42#-----------------------------------------------------------------------
43# Handle the --prefix=... option by defaulting to what Tcl gave.
44# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
45#-----------------------------------------------------------------------
46
47TEA_PREFIX
48
49#-----------------------------------------------------------------------
50# Standard compiler checks.
51# This sets up CC by using the CC env var, or looks for gcc otherwise.
52# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
53# the basic setup necessary to compile executables.
54#-----------------------------------------------------------------------
55
56TEA_SETUP_COMPILER
57
58#-----------------------------------------------------------------------
59# __CHANGE__
60# Specify the C source files to compile in TEA_ADD_SOURCES,
61# public headers that need to be installed in TEA_ADD_HEADERS,
62# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
63# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
64# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
65# and PKG_TCL_SOURCES.
66#-----------------------------------------------------------------------
67
68TEA_ADD_SOURCES([itclStubInit.c
69		itcl_bicmds.c
70		itcl_class.c
71		itcl_cmds.c
72		itcl_ensemble.c
73		itcl_linkage.c
74		itcl_methods.c
75		itcl_migrate.c
76		itcl_objects.c
77		itcl_parse.c
78		itcl_util.c])
79TEA_ADD_HEADERS([generic/itcl.h
80		generic/itclDecls.h
81		generic/itclInt.h
82		generic/itclIntDecls.h])
83TEA_ADD_INCLUDES([-I\"`${CYGPATH} ${srcdir}/generic`\"])
84TEA_ADD_LIBS([])
85TEA_ADD_CFLAGS([])
86TEA_ADD_STUB_SOURCES([itclStubLib.c])
87TEA_ADD_TCL_SOURCES([library/itcl.tcl])
88
89#--------------------------------------------------------------------
90# __CHANGE__
91# A few miscellaneous platform-specific items:
92#
93# Define a special symbol for Windows (BUILD_itcl in this case) so
94# that we create the export library with the dll.  See sha1.h on how
95# to use this.
96#
97# Windows creates a few extra files that need to be cleaned up.
98# You can add more files to clean if your extension creates any extra
99# files.
100#
101# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
102# These will be appended to the current set of compiler flags for
103# your system.
104#--------------------------------------------------------------------
105
106if test "${TEA_PLATFORM}" = "windows" ; then
107    TEA_ADD_SOURCES([dllEntryPoint.c])
108fi
109
110#--------------------------------------------------------------------
111# __CHANGE__
112# Choose which headers you need.  Extension authors should try very
113# hard to only rely on the Tcl public header files.  Internal headers
114# contain private data structures and are subject to change without
115# notice.
116# This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
117# so that we can extract TCL_SRC_DIR from the config file (in the case
118# of private headers
119#--------------------------------------------------------------------
120
121#TEA_PUBLIC_TCL_HEADERS
122TEA_PRIVATE_TCL_HEADERS
123
124#--------------------------------------------------------------------
125# We need to enable the threading macros found in tcl.h and tclInt.h.
126# The use of the threading features is determined by the core the
127# extension is loaded into, but we need to compile with these macros
128# turned on.
129#--------------------------------------------------------------------
130
131AC_DEFINE(TCL_THREADS)
132
133#--------------------------------------------------------------------
134# Check whether --enable-threads or --disable-threads was given.
135# This auto-enables if Tcl was compiled threaded.
136#--------------------------------------------------------------------
137
138#TEA_ENABLE_THREADS
139
140#--------------------------------------------------------------------
141# The statement below defines a collection of symbols related to
142# building as a shared library instead of a static library.
143#--------------------------------------------------------------------
144
145TEA_ENABLE_SHARED
146
147#--------------------------------------------------------------------
148# This macro figures out what flags to use with the compiler/linker
149# when building shared/static debug/optimized objects.  This information
150# can be taken from the tclConfig.sh file, but this figures it all out.
151#--------------------------------------------------------------------
152
153TEA_CONFIG_CFLAGS
154
155#--------------------------------------------------------------------
156# Set the default compiler switches based on the --enable-symbols 
157# option.
158#--------------------------------------------------------------------
159
160TEA_ENABLE_SYMBOLS
161
162#--------------------------------------------------------------------
163# Everyone should be linking against the Tcl stub library.  If you
164# can't for some reason, remove this definition.  If you aren't using
165# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
166# link against the non-stubbed Tcl library.
167#--------------------------------------------------------------------
168
169if test "${SHARED_BUILD}" = "1" ; then
170    AC_DEFINE(USE_TCL_STUBS)
171fi
172
173#--------------------------------------------------------------------
174# This macro generates a line to use when building a library.  It
175# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
176# and TEA_LOAD_TCLCONFIG macros above.
177#--------------------------------------------------------------------
178
179TEA_MAKE_LIB
180
181#--------------------------------------------------------------------
182# __CHANGE__
183# Change the name from exampeA_LIB_FILE to match your package name.
184# Use the stub_LIB_FILE substitution if your package creates a stub
185# library.
186#--------------------------------------------------------------------
187
188itcl_STUB_LIB_FILE=${PKG_STUB_LIB_FILE}
189itcl_LIB_FILE=${PKG_LIB_FILE}
190AC_SUBST(itcl_STUB_LIB_FILE)
191AC_SUBST(itcl_LIB_FILE)
192
193#--------------------------------------------------------------------
194# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
195# file during the install process.  Don't run the TCLSH_PROG through
196# ${CYGPATH} because it's being used directly by make.
197# Require that we use a tclsh shell version 8.2 or later since earlier
198# versions have bugs in the pkg_mkIndex routine.
199#--------------------------------------------------------------------
200
201TEA_PROG_TCLSH
202
203#--------------------------------------------------------------------
204# These are for itclConfig.sh
205#--------------------------------------------------------------------
206
207TEA_EXPORT_CONFIG([itcl])
208
209# itcl_SRC_DIR must be a fully qualified path
210eval itcl_SRC_DIR="$srcdir"
211itcl_SRC_DIR=`cd "${itcl_SRC_DIR}"; pwd`
212AC_SUBST(itcl_SRC_DIR)
213
214#--------------------------------------------------------------------
215# Finally, substitute all of the various values into the Makefile.
216#--------------------------------------------------------------------
217
218AC_OUTPUT([Makefile pkgIndex.tcl itclConfig.sh])
219