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 'tkimgraw', as distributed at November 20, 2001. 8# TEA compliant. 9#-------------------------------------------------------------------- 10 11AC_INIT([tkimgraw],[1.4]) 12 13TEA_INIT([3.9]) 14 15AC_CONFIG_AUX_DIR(../tclconfig) 16 17PHIMGTYPE="raw" 18CPACKAGE="Tkimgraw" 19PACKAGE_TCLNAME="img::raw" 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([raw.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#-------------------------------------------------------------------- 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}`\"]) 182else 183 TEA_ADD_LIBS([${tkimg_STUB_LIB_SPEC}]) 184fi 185 186#-------------------------------------------------------------------- 187# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl 188# file during the install process. Don't run the TCLSH_PROG through 189# ${CYGPATH} because it's being used directly by make. 190# Require that we use a tclsh shell version 8.2 or later since earlier 191# versions have bugs in the pkg_mkIndex routine. 192# Add WISH as well if this is a Tk extension. 193#-------------------------------------------------------------------- 194 195TEA_PROG_TCLSH 196TEA_PROG_WISH 197 198#-------------------------------------------------------------------- 199# Finally, substitute all of the various values into the Makefile. 200# You may alternatively have a special pkgIndex.tcl.in or other files 201# which require substituting th AC variables in. Include these here. 202#-------------------------------------------------------------------- 203 204AC_OUTPUT([Makefile]) 205 206#-------------------------------------------------------------------- 207