1#!/bin/bash -norc
2dnl	This file is an input file used by the GNU "autoconf" program to
3dnl	generate the file "configure", which is run during Tcl installation
4dnl	to configure the system for the local environment.
5#
6# RCS: @(#) $Id: configure.in,v 1.20 2007/10/12 19:53:32 neumann Exp $
7
8#-----------------------------------------------------------------------
9# Sample configure.in for Tcl Extensions.  The only places you should
10# need to modify this file are marked by the string __CHANGE__
11#-----------------------------------------------------------------------
12
13configdir=$(srcdir)/../../../config
14
15#-----------------------------------------------------------------------
16# __CHANGE__
17# Set your package name and version numbers here.
18#
19# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
20# set as provided.  These will also be added as -D defs in your Makefile
21# so you can encode the package version directly into the source files.
22#-----------------------------------------------------------------------
23
24AC_INIT([xotclsdbm], [1.2])
25
26#--------------------------------------------------------------------
27# Call TEA_INIT as the first TEA_ macro to set up initial vars.
28# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
29# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
30#--------------------------------------------------------------------
31
32TEA_INIT([3.9])
33
34AC_CONFIG_AUX_DIR(../../../config)
35
36#--------------------------------------------------------------------
37# specify some extra flags
38#--------------------------------------------------------------------
39
40AC_ARG_WITH(xotcl,
41        [  --with-xotcl=DIR_CONTAINING_XOTCLCONFIG_SH
42            absolute path to xotclConfig.sh, 
43           --without-xotcl disables, but this is pointless],
44        [with_xotcl=$withval], [AC_MSG_ERROR([--with-xotcl is required])])
45
46#--------------------------------------------------------------------
47# Load the tclConfig.sh file
48#--------------------------------------------------------------------
49
50TEA_PATH_TCLCONFIG
51TEA_LOAD_TCLCONFIG
52
53#--------------------------------------------------------------------
54# Load the tkConfig.sh file if necessary (Tk extension)
55#--------------------------------------------------------------------
56
57#TEA_PATH_TKCONFIG
58#TEA_LOAD_TKCONFIG
59
60#-----------------------------------------------------------------------
61# Handle the --prefix=... option by defaulting to what Tcl gave.
62# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
63#-----------------------------------------------------------------------
64
65TEA_PREFIX
66
67#-----------------------------------------------------------------------
68# Standard compiler checks.
69# This sets up CC by using the CC env var, or looks for gcc otherwise.
70# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
71# the basic setup necessary to compile executables.
72#-----------------------------------------------------------------------
73
74TEA_SETUP_COMPILER
75
76#--------------------------------------------------------------------
77# Load the xotclConfig.sh file
78#--------------------------------------------------------------------
79
80AC_MSG_NOTICE([Reading file ${with_xotcl}/xotclConfig.sh])
81source ${with_xotcl}/xotclConfig.sh
82
83#-----------------------------------------------------------------------
84# __CHANGE__
85# Specify the C source files to compile in TEA_ADD_SOURCES,
86# public headers that need to be installed in TEA_ADD_HEADERS,
87# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
88# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
89# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
90# and PKG_TCL_SOURCES.
91#-----------------------------------------------------------------------
92
93TEA_ADD_SOURCES([hash.c pair.c sdbm.c xotclsdbm.c])
94TEA_ADD_HEADERS([])
95TEA_ADD_INCLUDES([-I${with_xotcl}/generic ${XOTCL_BUILD_INCLUDE_SPEC}])
96TEA_ADD_LIBS([$XOTCL_BUILD_STUB_LIB_SPEC $XOTCL_BUILD_LIB_SPEC])
97TEA_ADD_CFLAGS([])
98TEA_ADD_STUB_SOURCES([])
99TEA_ADD_TCL_SOURCES([])
100
101#--------------------------------------------------------------------
102# __CHANGE__
103# A few miscellaneous platform-specific items:
104#
105# Define a special symbol for Windows (BUILD_sample in this case) so
106# that we create the export library with the dll.
107#
108# Windows creates a few extra files that need to be cleaned up.
109# You can add more files to clean if your extension creates any extra
110# files.
111#
112# TEA_ADD_* any platform specific compiler/build info here.
113#--------------------------------------------------------------------
114
115if test "${TEA_PLATFORM}" = "windows" ; then
116    AC_DEFINE(BUILD_sample)
117    CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
118    #TEA_ADD_SOURCES([win/winFile.c])
119    #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
120else
121    CLEANFILES="pkgIndex.tcl"
122    #TEA_ADD_SOURCES([unix/unixFile.c])
123    #TEA_ADD_LIBS([-lsuperfly])
124fi
125AC_SUBST(CLEANFILES)
126
127#--------------------------------------------------------------------
128# __CHANGE__
129# Choose which headers you need.  Extension authors should try very
130# hard to only rely on the Tcl public header files.  Internal headers
131# contain private data structures and are subject to change without
132# notice.
133# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
134#--------------------------------------------------------------------
135
136TEA_PUBLIC_TCL_HEADERS
137#TEA_PRIVATE_TCL_HEADERS
138
139#TEA_PUBLIC_TK_HEADERS
140#TEA_PRIVATE_TK_HEADERS
141#TEA_PATH_X
142
143#--------------------------------------------------------------------
144# Check whether --enable-threads or --disable-threads was given.
145#--------------------------------------------------------------------
146
147TEA_ENABLE_THREADS
148
149#--------------------------------------------------------------------
150# The statement below defines a collection of symbols related to
151# building as a shared library instead of a static library.
152#--------------------------------------------------------------------
153
154TEA_ENABLE_SHARED
155
156#--------------------------------------------------------------------
157# This macro figures out what flags to use with the compiler/linker
158# when building shared/static debug/optimized objects.  This information
159# can be taken from the tclConfig.sh file, but this figures it all out.
160#--------------------------------------------------------------------
161
162TEA_CONFIG_CFLAGS
163
164#--------------------------------------------------------------------
165# Set the default compiler switches based on the --enable-symbols 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.  Add Tk too if necessary.
175#--------------------------------------------------------------------
176
177AC_DEFINE(USE_TCL_STUBS)
178#AC_DEFINE(USE_TK_STUBS)
179
180#--------------------------------------------------------------------
181# This macro generates a line to use when building a library.  It
182# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
183# and TEA_LOAD_TCLCONFIG macros above.
184#--------------------------------------------------------------------
185
186TEA_MAKE_LIB
187
188#--------------------------------------------------------------------
189# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
190# file during the install process.  Don't run the TCLSH_PROG through
191# ${CYGPATH} because it's being used directly by make.
192# Require that we use a tclsh shell version 8.2 or later since earlier
193# versions have bugs in the pkg_mkIndex routine.
194# Add WISH as well if this is a Tk extension.
195#--------------------------------------------------------------------
196
197TEA_PROG_TCLSH
198#TEA_PROG_WISH
199
200#--------------------------------------------------------------------
201# Finally, substitute all of the various values into the Makefile.
202# You may alternatively have a special pkgIndex.tcl.in or other files
203# which require substituting th AC variables in.  Include these here.
204#--------------------------------------------------------------------
205
206AC_OUTPUT([Makefile])
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263