1dnl
2dnl Process this file with autoconf to produce a configure script.
3dnl
4AC_REVISION($Id: configure.in 267 2010-06-04 09:58:55Z nijtmans $)
5
6#--------------------------------------------------------------------
7# Configure script for package 'tkimgdted', as distributed at November 20, 2001.
8# TEA compliant.
9#--------------------------------------------------------------------
10
11AC_INIT([tkimgdted],[1.4])
12
13TEA_INIT([3.9])
14
15AC_CONFIG_AUX_DIR(../tclconfig)
16
17PHIMGTYPE="dted"
18CPACKAGE="Tkimgdted"
19PACKAGE_TCLNAME="img::dted"
20AC_SUBST(PACKAGE_TCLNAME)
21
22#--------------------------------------------------------------------
23# Load the tclConfig.sh file
24# Load the tkConfig.sh file
25#--------------------------------------------------------------------
26
27TEA_PATH_TCLCONFIG
28TEA_LOAD_TCLCONFIG
29
30TEA_PATH_TKCONFIG
31TEA_LOAD_TKCONFIG
32
33#-----------------------------------------------------------------------
34# Handle the --prefix=... option by defaulting to what Tcl gave.
35# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
36#-----------------------------------------------------------------------
37
38TEA_PREFIX
39
40#-----------------------------------------------------------------------
41# Standard compiler checks.
42# This sets up CC by using the CC env var, or looks for gcc otherwise.
43# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
44# the basic setup necessary to compile executables.
45#-----------------------------------------------------------------------
46
47TEA_SETUP_COMPILER
48
49TEA_PATH_CONFIG(tkimg)
50TEA_LOAD_CONFIG(tkimg)
51
52IMG_SRCPATH(tkimg)
53
54#-----------------------------------------------------------------------
55# Specify the C source files to compile in TEA_ADD_SOURCES,
56# public headers that need to be installed in TEA_ADD_HEADERS,
57# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
58# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
59# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
60# and PKG_TCL_SOURCES.
61#-----------------------------------------------------------------------
62
63TEA_ADD_SOURCES([dted.c])
64TEA_ADD_HEADERS([])
65TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${tkimg_SRC_PATH}`\"])
66TEA_ADD_INCLUDES([-I.])
67
68if test "${TEA_PLATFORM}" = "windows" ; then
69    TEA_ADD_LIBS([])
70else
71    TEA_ADD_LIBS([${MATH_LIBS}])
72fi
73
74TEA_ADD_CFLAGS([])
75TEA_ADD_CFLAGS([-DTKIMG_VERSION=\\\"\${tkimg_VERSION}\\\"])
76TEA_ADD_STUB_SOURCES([])
77TEA_ADD_TCL_SOURCES([])
78
79PUP="`echo ${PACKAGE_NAME}| tr 'a-z' 'A-Z'`"
80
81sed < "`${CYGPATH} ${srcdir}/../init.c`" > "init.c"	\
82	-e	"s/@CPACKAGE@/${CPACKAGE}/"		\
83	-e	"s/%PACKAGE%/${PACKAGE_NAME}/"		\
84	-e	"s/%PACKAGE_UP%/${PUP}/"		\
85	-e	"s/%PHIMGTYPE%/${PHIMGTYPE}/"
86
87# init.c is an included source file, not a source by itself
88# FUTURE: Do this through AC_OUTPUT!!
89
90#--------------------------------------------------------------------
91# __CHANGE__
92# Choose which headers you need.  Extension authors should try very
93# hard to only rely on the Tcl public header files.  Internal headers
94# contain private data structures and are subject to change without
95# notice.
96# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
97#--------------------------------------------------------------------
98
99TEA_PUBLIC_TCL_HEADERS
100TEA_PUBLIC_TK_HEADERS
101
102#--------------------------------------------------------------------
103# A few miscellaneous platform-specific items:
104#
105# Windows creates a few extra files that need to be cleaned up.
106# We can add more files to clean if our extension creates any extra
107# files in the future.
108#
109# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
110# These will be appended to the current set of compiler flags for
111# your system.
112#--------------------------------------------------------------------
113
114if test "${TEA_PLATFORM}" = "windows" ; then
115    CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch init.c"
116else
117    CLEANFILES="init.c"
118fi
119AC_SUBST(CLEANFILES)
120
121#--------------------------------------------------------------------
122# Check whether --enable-threads or --disable-threads was given.
123# So far only Tcl responds to this one.
124#--------------------------------------------------------------------
125
126TEA_ENABLE_THREADS
127
128#--------------------------------------------------------------------
129# The statement below defines a collection of symbols related to
130# building as a shared library instead of a static library.
131#--------------------------------------------------------------------
132
133TEA_ENABLE_SHARED
134
135#--------------------------------------------------------------------
136# This macro figures out what flags to use with the compiler/linker
137# when building shared/static debug/optimized objects.  This information
138# can be taken from the tclConfig.sh file, but this figures it all out.
139#--------------------------------------------------------------------
140
141TEA_CONFIG_CFLAGS
142
143#--------------------------------------------------------------------
144# Set the default compiler switches based on the --enable-symbols option.
145#--------------------------------------------------------------------
146
147TEA_ENABLE_SYMBOLS
148
149#--------------------------------------------------------------------
150# For Unix/Tk builds, make sure that the X libraries/headers are found.
151# This must be called after TEA_CONFIG_CFLAGS as it adjusts LIBS.
152#--------------------------------------------------------------------
153
154TEA_PATH_X
155
156#--------------------------------------------------------------------
157# Everyone should be linking against the Tcl stub library.  If you
158# can't for some reason, remove this definition.  If you aren't using
159# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
160# link against the non-stubbed Tcl library.
161#--------------------------------------------------------------------
162
163AC_DEFINE(USE_TCL_STUBS)
164AC_DEFINE(USE_TK_STUBS)
165
166#--------------------------------------------------------------------
167# This macro generates a line to use when building a library.  It
168# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
169# and TEA_LOAD_TCLCONFIG macros above.
170#--------------------------------------------------------------------
171
172TEA_MAKE_LIB
173
174#--------------------------------------------------------------------
175# __CHANGE__
176# Add platform libs to LIBS or SHLIB_LD_LIBS as necessary.
177#--------------------------------------------------------------------
178
179if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then
180    TEA_ADD_LIBS([\"`${CYGPATH} ${tkimg_STUB_LIB_PATH}`\"])
181else
182    TEA_ADD_LIBS([${tkimg_STUB_LIB_SPEC}])
183fi
184
185#--------------------------------------------------------------------
186# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
187# file during the install process.  Don't run the TCLSH_PROG through
188# ${CYGPATH} because it's being used directly by make.
189# Require that we use a tclsh shell version 8.2 or later since earlier
190# versions have bugs in the pkg_mkIndex routine.
191# Add WISH as well if this is a Tk extension.
192#--------------------------------------------------------------------
193
194TEA_PROG_TCLSH
195TEA_PROG_WISH
196
197#--------------------------------------------------------------------
198# Finally, substitute all of the various values into the Makefile.
199# You may alternatively have a special pkgIndex.tcl.in or other files
200# which require substituting th AC variables in.  Include these here.
201#--------------------------------------------------------------------
202
203AC_OUTPUT([Makefile])
204
205#--------------------------------------------------------------------
206