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([itk], [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# Load the tkConfig.sh file
44#--------------------------------------------------------------------
45
46TEA_PATH_TKCONFIG
47TEA_LOAD_TKCONFIG
48
49TEA_PATH_CONFIG(itcl)
50TEA_LOAD_CONFIG(itcl)
51
52ITCL_INCLUDES="-I\"`${CYGPATH} ${itcl_SRC_DIR}/generic`\""
53
54#--------------------------------------------------------------------
55# Handle the --prefix=... option by defaulting to what Tcl gave.
56# Must be called after TEA_LOAD_TCLCONFIG and before $prefix is used.
57#--------------------------------------------------------------------
58
59TEA_PREFIX
60
61#------------------------------------------------------------------------
62# Standard compiler checks.
63# This sets up CC by using the CC env var, or looks for gcc otherwise.
64# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
65# the basic setup necessary to compile executables.
66#------------------------------------------------------------------------
67
68TEA_SETUP_COMPILER
69
70#-----------------------------------------------------------------------
71# __CHANGE__
72# Specify the C source files to compile in TEA_ADD_SOURCES,
73# public headers that need to be installed in TEA_ADD_HEADERS,
74# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
75# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
76# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
77# and PKG_TCL_SOURCES.
78#-----------------------------------------------------------------------
79
80TEA_ADD_SOURCES([itk_cmds.c
81		itk_option.c
82		itk_archetype.c
83		itk_util.c
84		itkStubInit.c])
85TEA_ADD_HEADERS([generic/itk.h generic/itkDecls.h])
86TEA_ADD_INCLUDES([${ITCL_INCLUDES} -I\"`${CYGPATH} ${srcdir}/generic`\"])
87TEA_ADD_LIBS([])
88TEA_ADD_CFLAGS([])
89#TEA_ADD_STUB_SOURCES([itkStubLib.c])
90TEA_ADD_TCL_SOURCES([library/Archetype.itk
91		library/Toplevel.itk
92		library/Widget.itk
93		library/itk.tcl
94		library/tclIndex])
95
96#--------------------------------------------------------------------
97# __CHANGE__
98# A few miscellaneous platform-specific items:
99#
100# Windows creates a few extra files that need to be cleaned up.
101# You can add more files to clean if your extension creates any extra
102# files by extending CLEANFILES.
103#--------------------------------------------------------------------
104
105if test "${TEA_PLATFORM}" = "windows" ; then
106    TEA_ADD_SOURCES([dllEntryPoint.c])
107fi
108#CLEANFILES="$CLEANFILES *.ext"
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#TEA_PUBLIC_TK_HEADERS
125TEA_PRIVATE_TK_HEADERS
126
127#--------------------------------------------------------------------
128# For Unix/Tk builds, make sure that the X libraries/headers are found.
129#--------------------------------------------------------------------
130
131TEA_PATH_X
132
133#--------------------------------------------------------------------
134# We need to enable the threading macros found in tcl.h and tclInt.h.
135# The use of the threading features is determined by the core the
136# extension is loaded into, but we need to compile with these macros
137# turned on.
138#--------------------------------------------------------------------
139
140AC_DEFINE(TCL_THREADS)
141#--------------------------------------------------------------------
142# Check whether --enable-threads or --disable-threads was given.
143# This auto-enables if Tcl was compiled threaded.
144#--------------------------------------------------------------------
145
146#TEA_ENABLE_THREADS
147
148#--------------------------------------------------------------------
149# The statement below defines a collection of symbols related to
150# building as a shared library instead of a static library.
151#--------------------------------------------------------------------
152
153TEA_ENABLE_SHARED
154
155#--------------------------------------------------------------------
156# This macro figures out what flags to use with the compiler/linker
157# when building shared/static debug/optimized objects.  This information
158# can be taken from the tclConfig.sh file, but this figures it all out.
159#--------------------------------------------------------------------
160
161TEA_CONFIG_CFLAGS
162
163#--------------------------------------------------------------------
164# Set the default compiler switches based on the --enable-symbols 
165# option.
166#--------------------------------------------------------------------
167
168TEA_ENABLE_SYMBOLS
169
170#--------------------------------------------------------------------
171# Everyone should be linking against the Tcl stub library.  If you
172# can't for some reason, remove this definition.  If you aren't using
173# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
174# link against the non-stubbed Tcl library.
175#--------------------------------------------------------------------
176
177if test "${SHARED_BUILD}" = "1" ; then
178    AC_DEFINE(USE_TCL_STUBS)
179    AC_DEFINE(USE_TK_STUBS)
180    AC_DEFINE(USE_ITCL_STUBS)
181fi
182
183#--------------------------------------------------------------------
184# This macro generates a line to use when building a library.  It
185# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
186# and TEA_LOAD_TCLCONFIG macros above.
187#--------------------------------------------------------------------
188
189TEA_MAKE_LIB
190
191#--------------------------------------------------------------------
192# __CHANGE__
193# Change the name from exampeA_LIB_FILE to match your package name.
194# Use the stub_LIB_FILE substitution if your package creates a stub
195# library.
196#--------------------------------------------------------------------
197
198AC_SUBST(itkstub_LIB_FILE)
199AC_SUBST(itk_LIB_FILE)
200
201#--------------------------------------------------------------------
202# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
203# file during the install process.  Don't run the TCLSH_PROG through
204# ${CYGPATH} because it's being used directly by make.
205# Require that we use a tclsh shell version 8.2 or later since earlier
206# versions have bugs in the pkg_mkIndex routine.
207#--------------------------------------------------------------------
208
209TEA_PROG_TCLSH
210TEA_PROG_WISH
211
212#--------------------------------------------------------------------
213# Finally, substitute all of the various values into the Makefile.
214#--------------------------------------------------------------------
215
216AC_OUTPUT([Makefile pkgIndex.tcl itkConfig.sh])
217