1dnl
2dnl Process this file with autoconf to produce a configure script.
3dnl
4
5#--------------------------------------------------------------------
6# Configure script for package 'jpegtcl', as distributed at November 20, 2001.
7# TEA compliant.
8#--------------------------------------------------------------------
9
10AC_INIT([jpegtcl],[9.4.0])
11
12TEA_INIT([3.9])
13
14AC_CONFIG_AUX_DIR(../tclconfig)
15
16#--------------------------------------------------------------------
17# Load the tclConfig.sh file
18# Load the tkConfig.sh file
19#--------------------------------------------------------------------
20
21TEA_PATH_TCLCONFIG
22TEA_LOAD_TCLCONFIG
23
24TEA_PATH_TKCONFIG
25TEA_LOAD_TKCONFIG
26
27#-----------------------------------------------------------------------
28# Handle the --prefix=... option by defaulting to what Tcl gave.
29# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
30#-----------------------------------------------------------------------
31
32TEA_PREFIX
33
34#-----------------------------------------------------------------------
35# Standard compiler checks.
36# This sets up CC by using the CC env var, or looks for gcc otherwise.
37# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
38# the basic setup necessary to compile executables.
39#-----------------------------------------------------------------------
40
41JPEG_CFLAGS="$CFLAGS"
42TEA_SETUP_COMPILER
43JPEG_CC=$CC
44
45#-----------------------------------------------------------------------
46# Specify the C source files to compile in TEA_ADD_SOURCES,
47# public headers that need to be installed in TEA_ADD_HEADERS,
48# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
49# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
50# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
51# and PKG_TCL_SOURCES.
52#-----------------------------------------------------------------------
53
54TEA_ADD_SOURCES([jpegtcl.c jpegtclStubInit.c])
55
56TEA_ADD_SOURCES([
57	../compat/libjpeg/jcapimin.c	../compat/libjpeg/jcapistd.c	../compat/libjpeg/jccoefct.c
58	../compat/libjpeg/jccolor.c	../compat/libjpeg/jcdctmgr.c	../compat/libjpeg/jchuff.c
59	../compat/libjpeg/jcinit.c	../compat/libjpeg/jcmainct.c	../compat/libjpeg/jcmarker.c
60	../compat/libjpeg/jcmaster.c	../compat/libjpeg/jcomapi.c	../compat/libjpeg/jcparam.c
61	../compat/libjpeg/jcarith.c	../compat/libjpeg/jcprepct.c	../compat/libjpeg/jcsample.c
62	../compat/libjpeg/jctrans.c	../compat/libjpeg/jdapimin.c	../compat/libjpeg/jdapistd.c
63	../compat/libjpeg/jdatadst.c	../compat/libjpeg/jdatasrc.c	../compat/libjpeg/jdcoefct.c
64	../compat/libjpeg/jdcolor.c	../compat/libjpeg/jddctmgr.c	../compat/libjpeg/jdhuff.c
65	../compat/libjpeg/jdinput.c	../compat/libjpeg/jdmainct.c	../compat/libjpeg/jdmarker.c
66	../compat/libjpeg/jdmaster.c	../compat/libjpeg/jdmerge.c	../compat/libjpeg/jdarith.c
67	../compat/libjpeg/jdpostct.c	../compat/libjpeg/jdsample.c	../compat/libjpeg/jdtrans.c
68	../compat/libjpeg/jerror.c	../compat/libjpeg/jfdctflt.c	../compat/libjpeg/jfdctfst.c
69	../compat/libjpeg/jfdctint.c	../compat/libjpeg/jidctflt.c	../compat/libjpeg/jidctfst.c
70	../compat/libjpeg/jidctint.c	../compat/libjpeg/jaricom.c	../compat/libjpeg/jquant1.c
71	../compat/libjpeg/jquant2.c	../compat/libjpeg/jutils.c	../compat/libjpeg/jmemmgr.c
72	../compat/libjpeg/jmemansi.c
73])
74
75TEA_ADD_HEADERS([jpegtcl.h jpegtclDecls.h])
76
77TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}`\"])
78TEA_ADD_INCLUDES([-I\"./libjpeg\"])
79TEA_ADD_LIBS([])
80TEA_ADD_CFLAGS([])
81TEA_ADD_STUB_SOURCES([jpegtclStubLib.c])
82TEA_ADD_SOURCES([jpegtclStubLib.c])
83TEA_ADD_TCL_SOURCES([])
84
85#--------------------------------------------------------------------
86# __CHANGE__
87# Choose which headers you need.  Extension authors should try very
88# hard to only rely on the Tcl public header files.  Internal headers
89# contain private data structures and are subject to change without
90# notice.
91# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
92#--------------------------------------------------------------------
93
94TEA_PUBLIC_TCL_HEADERS
95TEA_PUBLIC_TK_HEADERS
96
97#--------------------------------------------------------------------
98# A few miscellaneous platform-specific items:
99#
100# Windows creates a few extra files that need to be cleaned up.
101# We can add more files to clean if our extension creates any extra
102# files in the future.
103#
104# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
105# These will be appended to the current set of compiler flags for
106# your system.
107#--------------------------------------------------------------------
108
109if test "${TEA_PLATFORM}" = "windows" ; then
110    CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
111else
112    CLEANFILES=""
113fi
114AC_SUBST(CLEANFILES)
115
116#--------------------------------------------------------------------
117# Check whether --enable-threads or --disable-threads was given.
118# So far only Tcl responds to this one.
119#--------------------------------------------------------------------
120
121TEA_ENABLE_THREADS
122
123#--------------------------------------------------------------------
124# The statement below defines a collection of symbols related to
125# building as a shared library instead of a static library.
126#--------------------------------------------------------------------
127
128TEA_ENABLE_SHARED
129
130#--------------------------------------------------------------------
131# This macro figures out what flags to use with the compiler/linker
132# when building shared/static debug/optimized objects.  This information
133# can be taken from the tclConfig.sh file, but this figures it all out.
134#--------------------------------------------------------------------
135
136TEA_CONFIG_CFLAGS
137
138#--------------------------------------------------------------------
139# Set the default compiler switches based on the --enable-symbols option.
140#--------------------------------------------------------------------
141
142TEA_ENABLE_SYMBOLS
143
144#--------------------------------------------------------------------
145# For Unix/Tk builds, make sure that the X libraries/headers are found.
146# This must be called after TEA_CONFIG_CFLAGS as it adjusts LIBS.
147#--------------------------------------------------------------------
148
149# See [Bug #82910]
150#TEA_PATH_X
151
152#--------------------------------------------------------------------
153# Everyone should be linking against the Tcl stub library.  If you
154# can't for some reason, remove this definition.  If you aren't using
155# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
156# link against the non-stubbed Tcl library.
157#--------------------------------------------------------------------
158
159AC_DEFINE(USE_TCL_STUBS)
160
161#--------------------------------------------------------------------
162# This macro generates a line to use when building a library.  It
163# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
164# and TEA_LOAD_TCLCONFIG macros above.
165#--------------------------------------------------------------------
166
167TEA_MAKE_LIB
168
169#--------------------------------------------------------------------
170# __CHANGE__
171# Add platform libs to LIBS or SHLIB_LD_LIBS as necessary.
172#--------------------------------------------------------------------
173
174SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \${TCL_LIBS}"
175
176#--------------------------------------------------------------------
177# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
178# file during the install process.  Don't run the TCLSH_PROG through
179# ${CYGPATH} because it's being used directly by make.
180# Require that we use a tclsh shell version 8.2 or later since earlier
181# versions have bugs in the pkg_mkIndex routine.
182# Add WISH as well if this is a Tk extension.
183#--------------------------------------------------------------------
184
185TEA_PROG_TCLSH
186TEA_EXPORT_CONFIG(jpegtcl)
187
188#--------------------------------------------------------------------
189# We call the configure for the jpeg code on our own, without using
190# AC_CONFIG_SUBDIR ... Using that requires a symlink, thus making setup
191# difficult, and the transfer information ot it is busted, due to how
192# TEA handles CFLAGS.
193#--------------------------------------------------------------------
194
195case "$srcdir" in
196.) # No --srcdir option.  We are building in place.
197  jpegdir=../$srcdir/../compat/libjpeg ;;
198/*) # Absolute path.
199  jpegdir=$srcdir/../compat/libjpeg ;;
200*) # Relative path.
201  jpegdir=../$ac_dots$srcdir/../compat/libjpeg ;;
202esac
203
204mkdir -p libjpeg
205sleep 2        ; # Wait two seconds for the directory to actually appear (Windows).
206cd    libjpeg
207env CC="$JPEG_CC" CFLAGS="$JPEG_CFLAGS" $jpegdir/configure --enable-maxmem=500
208cd ..
209
210#--------------------------------------------------------------------
211# Finally, substitute all of the various values into the Makefile.
212# You may alternatively have a special pkgIndex.tcl.in or other files
213# which require substituting th AC variables in.  Include these here.
214#--------------------------------------------------------------------
215
216AC_OUTPUT([Makefile jpegtclConfig.sh])
217
218#--------------------------------------------------------------------
219