1dnl 2dnl Process this file with autoconf to produce a configure script. 3dnl 4AC_REVISION($Id: configure.in 286 2010-07-07 11:08:08Z nijtmans $) 5 6#-------------------------------------------------------------------- 7# Configure script for package 'tkimgjpeg', as distributed at November 20, 2001. 8# TEA compliant. 9#-------------------------------------------------------------------- 10 11AC_INIT([tkimgjpeg],[1.4]) 12 13TEA_INIT([3.9]) 14 15AC_CONFIG_AUX_DIR(../tclconfig) 16 17PHIMGTYPE="jpeg" 18CPACKAGE="Tkimgjpeg" 19PACKAGE_TCLNAME="img::jpeg" 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 52TEA_PATH_CONFIG(jpegtcl) 53TEA_LOAD_CONFIG(jpegtcl) 54AC_SUBST(jpegtcl_VERSION) 55 56IMG_SRCPATH(tkimg) 57IMG_SRCPATH(jpegtcl) 58 59#----------------------------------------------------------------------- 60# Specify the C source files to compile in TEA_ADD_SOURCES, 61# public headers that need to be installed in TEA_ADD_HEADERS, 62# stub library C source files to compile in TEA_ADD_STUB_SOURCES, 63# and runtime Tcl library files in TEA_ADD_TCL_SOURCES. 64# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS 65# and PKG_TCL_SOURCES. 66#----------------------------------------------------------------------- 67 68TEA_ADD_SOURCES([jpeg.c]) 69TEA_ADD_HEADERS([]) 70TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${tkimg_SRC_PATH}`\"]) 71TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${jpegtcl_SRC_PATH}`\"]) 72TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${jpegtcl_BUILD_PATH}/libjpeg`\"]) 73TEA_ADD_INCLUDES([-I.]) 74TEA_ADD_LIBS([]) 75TEA_ADD_CFLAGS([-DTKIMG_VERSION=\\\"\${tkimg_VERSION}\\\"]) 76TEA_ADD_CFLAGS([-DJPEGTCL_VERSION=\\\"\${jpegtcl_VERSION}\\\"]) 77TEA_ADD_STUB_SOURCES([]) 78TEA_ADD_TCL_SOURCES([]) 79 80PUP="`echo ${PACKAGE_NAME}| tr 'a-z' 'A-Z'`" 81 82sed < "`${CYGPATH} ${srcdir}/../init.c`" > "init.c" \ 83 -e "s/@CPACKAGE@/${CPACKAGE}/" \ 84 -e "s/%PACKAGE%/${PACKAGE_NAME}/" \ 85 -e "s/%PACKAGE_UP%/${PUP}/" \ 86 -e "s/%PHIMGTYPE%/${PHIMGTYPE}/" 87 88# init.c is an included source file, not a source by itself 89# FUTURE: Do this through AC_OUTPUT!! 90 91#-------------------------------------------------------------------- 92# __CHANGE__ 93# Choose which headers you need. Extension authors should try very 94# hard to only rely on the Tcl public header files. Internal headers 95# contain private data structures and are subject to change without 96# notice. 97# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG 98#-------------------------------------------------------------------- 99 100TEA_PUBLIC_TCL_HEADERS 101TEA_PUBLIC_TK_HEADERS 102 103#-------------------------------------------------------------------- 104# A few miscellaneous platform-specific items: 105# 106# Windows creates a few extra files that need to be cleaned up. 107# We can add more files to clean if our extension creates any extra 108# files in the future. 109# 110# Define any extra compiler flags in the PACKAGE_CFLAGS variable. 111# These will be appended to the current set of compiler flags for 112# your system. 113#-------------------------------------------------------------------- 114 115if test "${TEA_PLATFORM}" = "windows" ; then 116 CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch init.c" 117else 118 CLEANFILES="init.c" 119fi 120AC_SUBST(CLEANFILES) 121 122#-------------------------------------------------------------------- 123# Check whether --enable-threads or --disable-threads was given. 124# So far only Tcl responds to this one. 125#-------------------------------------------------------------------- 126 127TEA_ENABLE_THREADS 128 129#-------------------------------------------------------------------- 130# The statement below defines a collection of symbols related to 131# building as a shared library instead of a static library. 132#-------------------------------------------------------------------- 133 134TEA_ENABLE_SHARED 135 136#-------------------------------------------------------------------- 137# This macro figures out what flags to use with the compiler/linker 138# when building shared/static debug/optimized objects. This information 139# can be taken from the tclConfig.sh file, but this figures it all out. 140#-------------------------------------------------------------------- 141 142TEA_CONFIG_CFLAGS 143 144#-------------------------------------------------------------------- 145# Set the default compiler switches based on the --enable-symbols option. 146#-------------------------------------------------------------------- 147 148TEA_ENABLE_SYMBOLS 149 150#-------------------------------------------------------------------- 151# For Unix/Tk builds, make sure that the X libraries/headers are found. 152# This must be called after TEA_CONFIG_CFLAGS as it adjusts LIBS. 153#-------------------------------------------------------------------- 154 155TEA_PATH_X 156 157#-------------------------------------------------------------------- 158# Everyone should be linking against the Tcl stub library. If you 159# can't for some reason, remove this definition. If you aren't using 160# stubs, you also need to modify the SHLIB_LD_LIBS setting below to 161# link against the non-stubbed Tcl library. 162#-------------------------------------------------------------------- 163 164AC_DEFINE(USE_TCL_STUBS) 165AC_DEFINE(USE_TK_STUBS) 166 167#-------------------------------------------------------------------- 168# This macro generates a line to use when building a library. It 169# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, 170# and TEA_LOAD_TCLCONFIG macros above. 171#-------------------------------------------------------------------- 172 173TEA_MAKE_LIB 174 175#-------------------------------------------------------------------- 176# __CHANGE__ 177# Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. 178#-------------------------------------------------------------------- 179 180if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then 181 TEA_ADD_LIBS([\"`${CYGPATH} ${tkimg_STUB_LIB_PATH}`\"]) 182 TEA_ADD_LIBS([\"`${CYGPATH} ${jpegtcl_STUB_LIB_PATH}`\"]) 183else 184 TEA_ADD_LIBS([${tkimg_STUB_LIB_SPEC}]) 185 TEA_ADD_LIBS([${jpegtcl_STUB_LIB_SPEC}]) 186fi 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 198TEA_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