source: trunk/src/tcl/configure.in @ 537

Last change on this file since 537 was 530, checked in by dkearney, 18 years ago

a few changes to the configure script so we can generate the makefile before installing rappture to the --prefix directory. these changes should be reversed or made correct at some point when i figure out how to build these bindings as packages.

File size: 12.6 KB
Line 
1#!/bin/bash -norc
2dnl     This file is an input file used by the GNU "autoconf" program to
3dnl     generate the file "configure", which is run during Tcl installation
4dnl     to configure the system for the local environment.
5#
6# RCS: @(#) $Id: configure.in,v 1.46 2006/01/23 19:18:55 hobbs Exp $
7
8#-----------------------------------------------------------------------
9# Sample configure.in for Tcl Extensions.  The only places you should
10# need to modify this file are marked by the string __CHANGE__
11#-----------------------------------------------------------------------
12
13#-----------------------------------------------------------------------
14# __CHANGE__
15# Set your package name and version numbers here.
16#
17# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
18# set as provided.  These will also be added as -D defs in your Makefile
19# so you can encode the package version directly into the source files.
20#-----------------------------------------------------------------------
21
22AC_INIT([Rappture], [1.0])
23
24#--------------------------------------------------------------------
25# Call TEA_INIT as the first TEA_ macro to set up initial vars.
26# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
27# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
28#--------------------------------------------------------------------
29
30TEA_INIT([3.5])
31
32AC_CONFIG_AUX_DIR(tclconfig)
33
34#--------------------------------------------------------------------
35# Extra build options
36#--------------------------------------------------------------------
37AC_ARG_WITH(blt, [  --with-blt=DIR          Find bltInt.h in DIR],
38  blt_source_dir=$withval)
39
40# AC_ARG_WITH(rappture, [  --with-rappture=DIR          Find include/rappture.h in DIR],
41#   rappture_dir=$withval)
42
43# AC_ARG_WITH(altpath, [  --with-altpath=DIR          Alternate path to search for required packages],
44#   alt_dir=$withval)
45
46#--------------------------------------------------------------------
47# Load the tclConfig.sh file
48#--------------------------------------------------------------------
49
50TEA_PATH_TCLCONFIG
51TEA_LOAD_TCLCONFIG
52
53#--------------------------------------------------------------------
54# Load the tkConfig.sh file if necessary (Tk extension)
55#--------------------------------------------------------------------
56
57#TEA_PATH_TKCONFIG
58#TEA_LOAD_TKCONFIG
59
60#-----------------------------------------------------------------------
61# Handle the --prefix=... option by defaulting to what Tcl gave.
62# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
63#-----------------------------------------------------------------------
64
65TEA_PREFIX
66
67#-----------------------------------------------------------------------
68# Standard compiler checks.
69# This sets up CC by using the CC env var, or looks for gcc otherwise.
70# This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
71# the basic setup necessary to compile executables.
72#-----------------------------------------------------------------------
73
74TEA_SETUP_COMPILER
75
76#-----------------------------------------------------------------------
77# __CHANGE__
78# Specify the C source files to compile in TEA_ADD_SOURCES,
79# public headers that need to be installed in TEA_ADD_HEADERS,
80# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
81# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
82# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
83# and PKG_TCL_SOURCES.
84#-----------------------------------------------------------------------
85
86#TEA_ADD_SOURCES([Rappture_Init.cc RpLibraryTclInterface.cc RpUnitsTclInterface.cc ])
87TEA_ADD_SOURCES([Rappture_Init.cc RpUnitsTclInterface.cc])
88TEA_ADD_HEADERS([])
89TEA_ADD_INCLUDES([])
90TEA_ADD_CFLAGS([])
91TEA_ADD_STUB_SOURCES([])
92#TEA_ADD_TCL_SOURCES([scripts/exec.tcl scripts/value.tcl init.tcl ../../tcl/scripts/library.tcl ../../tcl/scripts/result.tcl])
93TEA_ADD_TCL_SOURCES([])
94
95#--------------------------------------------------------------------
96# __CHANGE__
97# A few miscellaneous platform-specific items:
98#
99# Define a special symbol for Windows (BUILD_sample in this case) so
100# that we create the export library with the dll.
101#
102# Windows creates a few extra files that need to be cleaned up.
103# You can add more files to clean if your extension creates any extra
104# files.
105#
106# TEA_ADD_* any platform specific compiler/build info here.
107#--------------------------------------------------------------------
108
109if test "${TEA_PLATFORM}" = "windows" ; then
110    AC_DEFINE(BUILD_rappture, 1, [Build windows export dll])
111    CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
112    TEA_ADD_LIBS(/LIBPATH:C:/opt/lib /LIBPATH:C:/Tcl/lib scew_s.lib)
113    TEA_ADD_LIBS(BLT24.lib libexpat.lib ../librappture.lib)
114    #TEA_ADD_SOURCES([win/winFile.c])
115    #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
116else
117    # CLEANFILES="*core *.o *.so *.a"
118    CLEANFILES=""
119    #TEA_ADD_SOURCES([unix/unixFile.c])
120    TEA_ADD_LIBS([-L@RAPPTURE_DIR@/lib])
121    TEA_ADD_LIBS([-lexpat -lscew -lrappture])
122fi
123AC_SUBST(CLEANFILES)
124
125#--------------------------------------------------------------------
126# __CHANGE__
127# Choose which headers you need.  Extension authors should try very
128# hard to only rely on the Tcl public header files.  Internal headers
129# contain private data structures and are subject to change without
130# notice.
131# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
132#--------------------------------------------------------------------
133
134TEA_PUBLIC_TCL_HEADERS
135#TEA_PRIVATE_TCL_HEADERS
136
137#TEA_PUBLIC_TK_HEADERS
138#TEA_PRIVATE_TK_HEADERS
139#TEA_PATH_X
140
141#--------------------------------------------------------------------
142# Check whether --enable-threads or --disable-threads was given.
143# This auto-enables if Tcl was compiled threaded.
144#--------------------------------------------------------------------
145
146TEA_ENABLE_THREADS
147
148#--------------------------------------------------------------------
149# The statement below defines a collection of symbols related to
150# building as a shared library instead of a static library.
151#--------------------------------------------------------------------
152
153TEA_ENABLE_SHARED
154
155#--------------------------------------------------------------------
156# This macro figures out what flags to use with the compiler/linker
157# when building shared/static debug/optimized objects.  This information
158# can be taken from the tclConfig.sh file, but this figures it all out.
159#--------------------------------------------------------------------
160
161TEA_CONFIG_CFLAGS
162
163#--------------------------------------------------------------------
164# Set the default compiler switches based on the --enable-symbols option.
165#--------------------------------------------------------------------
166
167TEA_ENABLE_SYMBOLS
168
169#--------------------------------------------------------------------
170# Everyone should be linking against the Tcl stub library.  If you
171# can't for some reason, remove this definition.  If you aren't using
172# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
173# link against the non-stubbed Tcl library.  Add Tk too if necessary.
174#--------------------------------------------------------------------
175
176AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
177#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
178
179#--------------------------------------------------------------------
180# This macro generates a line to use when building a library.  It
181# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
182# and TEA_LOAD_TCLCONFIG macros above.
183#--------------------------------------------------------------------
184
185TEA_MAKE_LIB
186
187#--------------------------------------------------------------------
188# Determine the name of the tclsh and/or wish executables in the
189# Tcl and Tk build directories or the location they were installed
190# into. These paths are used to support running test cases only,
191# the Makefile should not be making use of these paths to generate
192# a pkgIndex.tcl file or anything else at extension build time.
193#--------------------------------------------------------------------
194
195TEA_PROG_TCLSH
196#TEA_PROG_WISH
197
198
199#--------------------------------------------------------------------
200# Look for bltInt.h on the normal include path.  If not found, look
201# for it in the --with-blt directory.
202#--------------------------------------------------------------------
203AC_MSG_CHECKING([for bltInt.h])
204BLT_SRC_DIR=""
205if test "x$blt_source_dir" != "x" ; then
206  #
207  # Verify that a tclConfig.sh file exists in the directory specified
208  # by --with-blt.
209  #
210  if test -r "$blt_source_dir/bltInt.h" ; then
211    BLT_SRC_DIR="$blt_source_dir"
212  elif test -r "$blt_source_dir/src/bltInt.h" ; then
213    BLT_SRC_DIR="$blt_source_dir/src"
214  fi
215else
216  #
217  # Otherwise, search for the bltInt.h include file...
218  # 1. Search previously named locations.
219  #
220  for dir in \
221   $prefix \
222   $exec_prefix
223  do
224    if test -r "$dir/bltInt.h" ; then
225      BLT_SRC_DIR="$dir"
226      break
227    elif test -r "$dir/include/bltInt.h" ; then
228      BLT_SRC_DIR="$dir/include"
229      break
230    fi
231  done
232  #
233  #  2. Search source directories.
234  #
235  if test "x$BLT_SRC_DIR" = "x" ; then
236    for dir in \
237     `ls -dr ../blt[[2-3]].[[0-9]]* 2>/dev/null` \
238     ../blt \
239     `ls -dr ../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
240     ../../blt \
241     `ls -dr ../../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
242     ../../../blt \
243     `ls -dr c:/opt/blt[[2-3]].[[0-9]]* 2>/dev/null` \
244     c\:/opt/blt
245    do
246      if test -r "$dir/src/bltInt.h" ; then
247        BLT_SRC_DIR="$dir/src"
248        break
249      fi
250    done
251  fi
252fi
253AC_MSG_RESULT([${BLT_SRC_DIR}])
254
255if test "x$BLT_SRC_DIR" = "x" ; then
256  echo "can't find BLT include file \"bltInt.h\""
257  echo "use --with-blt=DIR to specify the location of the BLT sources"
258  exit 1
259fi
260
261AC_SUBST(BLT_SRC_DIR)
262#--------------------------------------------------------------------
263# Look for rappture.h on the normal include path.  If not found, look
264# for it in the --with-rappture directory.
265#--------------------------------------------------------------------
266RAPPTURE_DIR=$prefix
267# AC_MSG_CHECKING([for rappture.h])
268# RAPPTURE_DIR=""
269# if test "x$rappture_dir" != "x" ; then
270#   #
271#   # Verify that a rappture.h file exists in the directory specified
272#   # by --with-rappture.
273#   #
274#   if test -r "$rappture_dir/include/rappture.h" ; then
275#     RAPPTURE_DIR="$rappture_dir"
276#   fi
277# else
278#   #
279#   # Otherwise, search for the rappture.h include file...
280#   # 1. Search previously named locations.
281#   #
282#   for dir in \
283#    $prefix \
284#    $exec_prefix
285#   do
286#     if test -r "$dir/include/rappture.h" ; then
287#       RAPPTURE_DIR="$dir"
288#       break
289#     fi
290#   done
291#   #
292#   #  2. Search source directories.
293#   #
294#   if test "x$RAPPTURE_DIR" = "x" ; then
295#     for dir in \
296#      `ls -dr ../rappture 2>/dev/null` \
297#      `ls -dr ../../rappture 2>/dev/null` \
298#      `ls -dr ../../../rappture 2>/dev/null` \
299#      `ls -dr C\:/opt/rappture 2>/dev/null` \
300#      `ls -dr /opt/rappture 2>/dev/null`
301#     do
302#       if test -r "$dir/include/rappture.h" ; then
303#         RAPPTURE_DIR="$dir"
304#         break
305#       fi
306#     done
307#   fi
308# fi
309# AC_MSG_RESULT([${RAPPTURE_DIR}])
310#
311# if test "x$RAPPTURE_DIR" = "x" ; then
312#   echo "can't find RAPPTURE include file \"rappture.h\""
313#   echo "use --with-rappture=DIR to specify the location of rappture"
314#   exit 1
315# fi
316
317AC_SUBST(RAPPTURE_DIR)
318
319#--------------------------------------------------------------------
320# Look for scew.h on the normal include path.  If not found, look
321# for it in the --with-scew directory.
322#--------------------------------------------------------------------
323# AC_MSG_CHECKING([for alternate paths])
324# ALT_DIR=""
325# if test "x$alt_dir" != "x" ; then
326#   #
327#   # Verify that a include and lib directories exist in the directory specified
328#   # by --with-altpath.
329#   #
330#   if test -d "$alt_dir/include" -a -d "$alt_dir/lib" ; then
331#     ALT_DIR="$rappture_dir"
332#   fi
333# else
334#   if test "x$ALT_DIR" = "x" ; then
335#     for dir in \
336#      C\:/opt /opt
337#     do
338#       if test -r "$dir/include" -a -d "$dir/lib" ; then
339#         ALT_DIR="$dir"
340#         break
341#       fi
342#     done
343#   fi
344# fi
345# if test "x$ALT_DIR" = "x" ; then
346#     AC_MSG_RESULT(none)
347#   else
348#     AC_MSG_RESULT([${ALT_DIR}])
349# fi
350#
351AC_SUBST(ALT_DIR)
352
353PATCHLEVEL=`${TCLSH_PROG} tclconfig/patchlevel.tcl`
354EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL}
355NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
356
357AC_SUBST(PATCHLEVEL)
358AC_SUBST(EXACT_VERSION)
359AC_SUBST(NODOT_VERSION)
360
361#--------------------------------------------------------------------
362# Finally, substitute all of the various values into the Makefile.
363# You may alternatively have a special pkgIndex.tcl.in or other files
364# which require substituting th AC variables in.  Include these here.
365#--------------------------------------------------------------------
366
367AC_OUTPUT([Makefile pkgIndex.tcl init.tcl])
368
369
Note: See TracBrowser for help on using the repository browser.