1dnl
2dnl Process this file with autoconf to produce a configure script.
3dnl
4AC_REVISION($Id: configure.in,v 1.17 2006/01/24 18:03:57 andreas_kupries Exp $)
5
6AC_INIT([Memchan],[2.2.1])
7
8TEA_INIT([3.9])
9
10AC_CONFIG_AUX_DIR(tclconfig)
11
12#--------------------------------------------------------------------
13# Configure script for package 'Memchan', as distributed at March 18, 2005.
14# TEA compliant.
15#--------------------------------------------------------------------
16
17#--------------------------------------------------------------------
18# Load the tclConfig.sh file
19#--------------------------------------------------------------------
20
21TEA_PATH_TCLCONFIG
22TEA_LOAD_TCLCONFIG
23
24#-----------------------------------------------------------------------
25# Handle the --prefix=... option by defaulting to what Tcl gave.
26# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
27#-----------------------------------------------------------------------
28
29TEA_PREFIX
30
31#-----------------------------------------------------------------------
32# Standard compiler checks.
33# This sets up CC by using the CC env var, or looks for gcc otherwise.
34# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
35# the basic setup necessary to compile executables.
36#-----------------------------------------------------------------------
37
38TEA_SETUP_COMPILER
39
40#-----------------------------------------------------------------------
41# Specify the C source files to compile in TEA_ADD_SOURCES,
42# public headers that need to be installed in TEA_ADD_HEADERS,
43# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
44# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
45# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
46# and PKG_TCL_SOURCES.
47#-----------------------------------------------------------------------
48
49TEA_ADD_SOURCES([memchan.c init.c counter.c])
50TEA_ADD_SOURCES([fifo.c fifo2.c null.c zero.c random.c])
51TEA_ADD_SOURCES([isaac/randport.c])
52TEA_ADD_SOURCES([buf.c bufFix.c bufExt.c bufRange.c bufQueue.c])
53TEA_ADD_SOURCES([bufStubInit.c memchanStubInit.c ])
54TEA_ADD_HEADERS([generic/memchan.h generic/memchanDecls.h])
55TEA_ADD_HEADERS([generic/buf.h generic/bufDecls.h generic/bufIntDecls.h])
56TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}/isaac`\"])
57TEA_ADD_LIBS([])
58TEA_ADD_CFLAGS([])
59TEA_ADD_STUB_SOURCES([bufStubLib.c memchanStubLib.c])
60TEA_ADD_SOURCES([bufStubLib.c memchanStubLib.c])
61TEA_ADD_TCL_SOURCES([])
62
63#--------------------------------------------------------------------
64# A few miscellaneous platform-specific items:
65#
66# We have to define a special symbol for Windows (BUILD_Memchan in this
67# case) so that we create the export library with the dll.
68#
69# Windows creates a few extra files that need to be cleaned up.
70# We can add more files to clean if our extension creates any extra
71# files in the future.
72#
73# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
74# These will be appended to the current set of compiler flags for
75# your system.
76#--------------------------------------------------------------------
77
78if test "${TEA_PLATFORM}" = "windows" ; then
79    AC_DEFINE(BUILD_Memchan)
80    CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch"
81else
82    CLEANFILES="pkgIndex.tcl"
83fi
84AC_SUBST(CLEANFILES)
85
86#--------------------------------------------------------------------
87# __CHANGE__
88# Choose which headers you need.  Extension authors should try very
89# hard to only rely on the Tcl public header files.  Internal headers
90# contain private data structures and are subject to change without
91# notice.
92# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
93#--------------------------------------------------------------------
94
95TEA_PUBLIC_TCL_HEADERS
96#TEA_PRIVATE_TCL_HEADERS
97
98#--------------------------------------------------------------------
99# Check whether --enable-threads or --disable-threads was given.
100# So far only Tcl responds to this one.
101#--------------------------------------------------------------------
102
103TEA_ENABLE_THREADS
104
105#--------------------------------------------------------------------
106# The statement below defines a collection of symbols related to
107# building as a shared library instead of a static library.
108#--------------------------------------------------------------------
109
110TEA_ENABLE_SHARED
111
112#--------------------------------------------------------------------
113# This macro figures out what flags to use with the compiler/linker
114# when building shared/static debug/optimized objects.  This information
115# can be taken from the tclConfig.sh file, but this figures it all out.
116#--------------------------------------------------------------------
117
118TEA_CONFIG_CFLAGS
119
120# Needed for the chantest library.
121AC_SUBST(SHLIB_SUFFIX)
122
123#--------------------------------------------------------------------
124# Set the default compiler switches based on the --enable-symbols option.
125#--------------------------------------------------------------------
126
127TEA_ENABLE_SYMBOLS
128
129#--------------------------------------------------------------------
130# Everyone should be linking against the Tcl stub library.  If you
131# can't for some reason, remove this definition.  If you aren't using
132# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
133# link against the non-stubbed Tcl library.
134#--------------------------------------------------------------------
135
136AC_DEFINE(USE_TCL_STUBS)
137
138#--------------------------------------------------------------------
139# If ltoa is present, use it to convert integer values into strings.
140# If not, sprintf is used, which is slower and requires more code.
141#--------------------------------------------------------------------
142
143AC_CHECK_FUNCS(ltoa)
144
145#--------------------------------------------------------------------
146# This macro generates a line to use when building a library.  It
147# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
148# and TEA_LOAD_TCLCONFIG macros above.
149#--------------------------------------------------------------------
150
151TEA_MAKE_LIB
152
153#--------------------------------------------------------------------
154# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
155# file during the install process.  Don't run the TCLSH_PROG through
156# ${CYGPATH} because it's being used directly by make.
157# Require that we use a tclsh shell version 8.2 or later since earlier
158# versions have bugs in the pkg_mkIndex routine.
159# Add WISH as well if this is a Tk extension.
160#--------------------------------------------------------------------
161
162TEA_PROG_TCLSH
163
164#--------------------------------------------------------------------
165# Finally, substitute all of the various values into the Makefile.
166# You may alternatively have a special pkgIndex.tcl.in or other files
167# which require substituting th AC variables in.  Include these here.
168#--------------------------------------------------------------------
169
170AC_OUTPUT([Makefile])
171
172#--------------------------------------------------------------------
173