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 'tkimgxpm', as distributed at November 20, 2001. 8# TEA compliant. 9#-------------------------------------------------------------------- 10 11AC_INIT([tkimgxpm],[1.4]) 12 13TEA_INIT([3.9]) 14 15AC_CONFIG_AUX_DIR(../tclconfig) 16 17PHIMGTYPE="xpm" 18CPACKAGE="Tkimgxpm" 19PACKAGE_TCLNAME="img::xpm" 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([xpm.c]) 64TEA_ADD_HEADERS([]) 65TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${tkimg_SRC_PATH}`\"]) 66TEA_ADD_INCLUDES([-I.]) 67TEA_ADD_LIBS([]) 68TEA_ADD_CFLAGS([]) 69TEA_ADD_CFLAGS([-DTKIMG_VERSION=\\\"\${tkimg_VERSION}\\\"]) 70TEA_ADD_STUB_SOURCES([]) 71TEA_ADD_TCL_SOURCES([]) 72 73PUP="`echo ${PACKAGE_NAME}| tr 'a-z' 'A-Z'`" 74 75sed < "`${CYGPATH} ${srcdir}/../init.c`" > "init.c" \ 76 -e "s/@CPACKAGE@/${CPACKAGE}/" \ 77 -e "s/%PACKAGE%/${PACKAGE_NAME}/" \ 78 -e "s/%PACKAGE_UP%/${PUP}/" \ 79 -e "s/%PHIMGTYPE%/${PHIMGTYPE}/" 80 81# init.c is an included source file, not a source by itself 82# FUTURE: Do this through AC_OUTPUT!! 83 84#-------------------------------------------------------------------- 85# __CHANGE__ 86# Choose which headers you need. Extension authors should try very 87# hard to only rely on the Tcl public header files. Internal headers 88# contain private data structures and are subject to change without 89# notice. 90# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG 91#-------------------------------------------------------------------- 92 93TEA_PUBLIC_TCL_HEADERS 94TEA_PUBLIC_TK_HEADERS 95 96#-------------------------------------------------------------------- 97# A few miscellaneous platform-specific items: 98# 99# Windows creates a few extra files that need to be cleaned up. 100# We can add more files to clean if our extension creates any extra 101# files in the future. 102# 103# Define any extra compiler flags in the PACKAGE_CFLAGS variable. 104# These will be appended to the current set of compiler flags for 105# your system. 106#-------------------------------------------------------------------- 107 108if test "${TEA_PLATFORM}" = "windows" ; then 109 CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch init.c" 110else 111 CLEANFILES="init.c" 112fi 113AC_SUBST(CLEANFILES) 114 115#-------------------------------------------------------------------- 116# Check whether --enable-threads or --disable-threads was given. 117# So far only Tcl responds to this one. 118#-------------------------------------------------------------------- 119 120TEA_ENABLE_THREADS 121 122#-------------------------------------------------------------------- 123# The statement below defines a collection of symbols related to 124# building as a shared library instead of a static library. 125#-------------------------------------------------------------------- 126 127TEA_ENABLE_SHARED 128 129#-------------------------------------------------------------------- 130# This macro figures out what flags to use with the compiler/linker 131# when building shared/static debug/optimized objects. This information 132# can be taken from the tclConfig.sh file, but this figures it all out. 133#-------------------------------------------------------------------- 134 135TEA_CONFIG_CFLAGS 136 137#-------------------------------------------------------------------- 138# Set the default compiler switches based on the --enable-symbols option. 139#-------------------------------------------------------------------- 140 141TEA_ENABLE_SYMBOLS 142 143#-------------------------------------------------------------------- 144# For Unix/Tk builds, make sure that the X libraries/headers are found. 145# This must be called after TEA_CONFIG_CFLAGS as it adjusts LIBS. 146#-------------------------------------------------------------------- 147 148TEA_PATH_X 149 150#-------------------------------------------------------------------- 151# Everyone should be linking against the Tcl stub library. If you 152# can't for some reason, remove this definition. If you aren't using 153# stubs, you also need to modify the SHLIB_LD_LIBS setting below to 154# link against the non-stubbed Tcl library. 155#-------------------------------------------------------------------- 156 157AC_DEFINE(USE_TCL_STUBS) 158AC_DEFINE(USE_TK_STUBS) 159 160#-------------------------------------------------------------------- 161# This macro generates a line to use when building a library. It 162# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, 163# and TEA_LOAD_TCLCONFIG macros above. 164#-------------------------------------------------------------------- 165 166TEA_MAKE_LIB 167 168#-------------------------------------------------------------------- 169# __CHANGE__ 170# Add platform libs to LIBS or SHLIB_LD_LIBS as necessary. 171#-------------------------------------------------------------------- 172 173if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then 174 TEA_ADD_LIBS([\"`${CYGPATH} ${tkimg_STUB_LIB_PATH}`\"]) 175else 176 TEA_ADD_LIBS([${tkimg_STUB_LIB_SPEC}]) 177fi 178 179#-------------------------------------------------------------------- 180# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl 181# file during the install process. Don't run the TCLSH_PROG through 182# ${CYGPATH} because it's being used directly by make. 183# Require that we use a tclsh shell version 8.2 or later since earlier 184# versions have bugs in the pkg_mkIndex routine. 185# Add WISH as well if this is a Tk extension. 186#-------------------------------------------------------------------- 187 188TEA_PROG_TCLSH 189TEA_PROG_WISH 190 191#-------------------------------------------------------------------- 192# Finally, substitute all of the various values into the Makefile. 193# You may alternatively have a special pkgIndex.tcl.in or other files 194# which require substituting th AC variables in. Include these here. 195#-------------------------------------------------------------------- 196 197AC_OUTPUT([Makefile]) 198 199#-------------------------------------------------------------------- 200