1#! /bin/bash -norc 2dnl 3dnl Process this file with autoconf to produce a configure script. 4dnl 5AC_REVISION($Id: configure.in,v 1.23 2003/03/09 11:12:41 balls Exp $) 6 7#-------------------------------------------------------------------- 8# Configure script for package 'TclDOM', as distributed at November 20, 2001. 9# TEA compliant. 10#-------------------------------------------------------------------- 11 12#-------------------------------------------------------------------- 13# This very first macro is used to verify that the configure script can 14# find the sources. The argument to AC_INIT is a unique filename for 15# this package. 16#-------------------------------------------------------------------- 17 18AC_INIT([Tcldom], [2.6]) 19 20AC_CONFIG_AUX_DIR(tclconfig) 21CONFIGDIR=${srcdir}/tclconfig 22AC_SUBST(CONFIGDIR) 23 24#-------------------------------------------------------------------- 25# Setting our package name and version numbers. The NODOT_VERSION is 26# required for constructing the library name on systems that don't like 27# dots in library names (Windows). The VERSION variable is used on the 28# other systems. 29#-------------------------------------------------------------------- 30 31PACKAGE=Tcldom 32 33MAJOR_VERSION=2 34MINOR_VERSION=6 35#MAJOR_VERSION=10 36#MINOR_VERSION=0 37PATCHLEVEL= 38 39VERSION=${MAJOR_VERSION}.${MINOR_VERSION}${PATCHLEVEL} 40NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} 41TCLDOM_VERSION=${VERSION} 42 43AC_SUBST(PACKAGE) 44AC_SUBST(VERSION) 45AC_SUBST(TCLDOM_VERSION) 46 47# This package name must be replaced statically for AC_SUBST to work 48AC_SUBST(Tcldom_LIB_FILE) 49# Substitute stub_LIB_FILE if your package creates a stub library too. 50AC_SUBST(Tcldomstub_LIB_FILE) 51 52#-------------------------------------------------------------------- 53# This was placed here so that we can compile with -DVERSION="1.2" to 54# encode the package version directly into the source files. 55#-------------------------------------------------------------------- 56 57eval AC_DEFINE_UNQUOTED(VERSION, "${VERSION}") 58eval AC_DEFINE_UNQUOTED(TCLDOM_VERSION, "${TCLDOM_VERSION}") 59 60#-------------------------------------------------------------------- 61# Call TEA_INIT as the first TEA_ macro to set up initial vars. 62# This will define a ${TEA_PLATFORM} variable == "unix" or "windows". 63#-------------------------------------------------------------------- 64 65TEA_INIT([3.9]) 66 67#-------------------------------------------------------------------- 68# Load the tclConfig.sh file 69#-------------------------------------------------------------------- 70 71TEA_PATH_TCLCONFIG 72TEA_LOAD_TCLCONFIG 73 74#----------------------------------------------------------------------- 75# Handle the --prefix=... option by defaulting to what Tcl gave. 76# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. 77#----------------------------------------------------------------------- 78 79TEA_PREFIX 80 81#----------------------------------------------------------------------- 82# Standard compiler checks. 83# This sets up CC by using the CC env var, or looks for gcc otherwise. 84# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create 85# the basic setup necessary to compile executables. 86#----------------------------------------------------------------------- 87 88TEA_SETUP_COMPILER 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 100#TEA_PRIVATE_TCL_HEADERS 101 102#-------------------------------------------------------------------- 103# A few miscellaneous platform-specific items: 104# 105# We have to define a special symbol for Windows (BUILD_Tcldom in this 106# case) so that we create the export library with the dll. 107# 108# Windows creates a few extra files that need to be cleaned up. 109# We can add more files to clean if our extension creates any extra 110# files in the future. 111# 112# Define any extra compiler flags in the PACKAGE_CFLAGS variable. 113# These will be appended to the current set of compiler flags for 114# your system. 115#-------------------------------------------------------------------- 116 117if test "${TEA_PLATFORM}" = "windows" ; then 118 AC_DEFINE(BUILD_Tcldom) 119 CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" 120 EXTRA_SOURCES='$(WIN_SOURCES)' 121else 122 CLEANFILES="pkgIndex.tcl" 123 EXTRA_SOURCES='$(UNIX_SOURCES)' 124fi 125AC_SUBST(CLEANFILES) 126AC_SUBST(EXTRA_SOURCES) 127 128#-------------------------------------------------------------------- 129# Check whether --enable-threads or --disable-threads was given. 130# So far only Tcl responds to this one. 131#-------------------------------------------------------------------- 132 133TEA_ENABLE_THREADS 134 135#-------------------------------------------------------------------- 136# The statement below defines a collection of symbols related to 137# building as a shared library instead of a static library. 138#-------------------------------------------------------------------- 139 140TEA_ENABLE_SHARED 141 142#-------------------------------------------------------------------- 143# This macro figures out what flags to use with the compiler/linker 144# when building shared/static debug/optimized objects. This information 145# can be taken from the tclConfig.sh file, but this figures it all out. 146#-------------------------------------------------------------------- 147 148TEA_CONFIG_CFLAGS 149 150#-------------------------------------------------------------------- 151# Set the default compiler switches based on the --enable-symbols option. 152#-------------------------------------------------------------------- 153 154TEA_ENABLE_SYMBOLS 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) 164 165#-------------------------------------------------------------------- 166# This macro generates a line to use when building a library. It 167# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, 168# and TEA_LOAD_TCLCONFIG macros above. 169#-------------------------------------------------------------------- 170 171TEA_MAKE_LIB 172 173#-------------------------------------------------------------------- 174# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl 175# file during the install process. Don't run the TCLSH_PROG through 176# ${CYGPATH} because it's being used directly by make. 177# Require that we use a tclsh shell version 8.2 or later since earlier 178# versions have bugs in the pkg_mkIndex routine. 179# Add WISH as well if this is a Tk extension. 180#-------------------------------------------------------------------- 181 182TEA_PROG_TCLSH 183 184#-------------------------------------------------------------------- 185# These are for tcldomConfig.sh 186#-------------------------------------------------------------------- 187 188eval "${PACKAGE}_LIB_FILE=${PKG_LIB_FILE}" 189eval "${PACKAGE}stub_LIB_FILE=${PKG_STUB_LIB_FILE}" 190 191# pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) 192eval pkglibdir="${libdir}/${PACKAGE}${VERSION}" 193if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then 194 eval Tcldom_LIB_FLAG="-lTcldom${VERSION}${DBGX}" 195else 196 eval Tcldom_LIB_FLAG="-lTcldom`echo ${VERSION} | tr -d .`${DBGX}" 197fi 198Tcldom_BUILD_LIB_SPEC="-L`pwd` ${Tcldom_LIB_FLAG}" 199Tcldom_LIB_SPEC="-L${pkglibdir} ${Tcldom_LIB_FLAG}" 200 201if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then 202 eval Tcldom_STUB_LIB_FLAG="-lTcldomstub${VERSION}${DBGX}" 203else 204 eval Tcldom_STUB_LIB_FLAG="-lTcldomstub`echo ${VERSION} | tr -d .`${DBGX}" 205fi 206Tcldom_BUILD_STUB_LIB_SPEC="-L`pwd` ${Tcldom_STUB_LIB_FLAG}" 207Tcldom_STUB_LIB_SPEC="-L${pkglibdir} ${Tcldom_STUB_LIB_FLAG}" 208Tcldom_BUILD_STUB_LIB_PATH="`pwd`/${Tcldomstub_LIB_FILE}" 209Tcldom_STUB_LIB_PATH="${pkglibdir}/${Tcldomstub_LIB_FILE}" 210 211AC_SUBST(Tcldom_BUILD_LIB_SPEC) 212AC_SUBST(Tcldom_LIB_SPEC) 213AC_SUBST(Tcldom_BUILD_STUB_LIB_SPEC) 214AC_SUBST(Tcldom_STUB_LIB_SPEC) 215AC_SUBST(Tcldom_BUILD_STUB_LIB_PATH) 216AC_SUBST(Tcldom_STUB_LIB_PATH) 217 218AC_SUBST(MAJOR_VERSION) 219AC_SUBST(MINOR_VERSION) 220AC_SUBST(PATCHLEVEL) 221 222#-------------------------------------------------------------------- 223# Finally, substitute all of the various values into the Makefile. 224# You may alternatively have a special pkgIndex.tcl.in or other files 225# which require substituting th AC variables in. Include these here. 226#-------------------------------------------------------------------- 227 228AC_OUTPUT([Makefile library/pkgIndex.tcl TcldomConfig.sh]) 229 230#-------------------------------------------------------------------- 231