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

Last change on this file since 225 was 225, checked in by dkearney, 19 years ago

added alternative Rappture:result function to tcl bindings
added Rappture::Units::convert function.
adjusted makefile for more files to compile
adjusted configure file to once again check for bltInt.h
adjusted children function to allow for blank path

File size: 11.8 KB
Line 
1#--------------------------------------------------------------------
2# Sample configure.in for Tcl Extensions.  The only places you should
3# need to modify this file are marked by the string __CHANGE__
4#--------------------------------------------------------------------
5
6#--------------------------------------------------------------------
7# __CHANGE__
8# This very first macro is used to verify that the configure script can
9# find the sources.  The argument to AC_INIT should be a unique filename
10# for this package, and can be a relative path, such as:
11#
12# AC_INIT(../generic/tcl.h)
13#--------------------------------------------------------------------
14
15AC_INIT(src/RpLibraryTclInterface.cc)
16AC_CONFIG_AUX_DIR(cf)
17
18#--------------------------------------------------------------------
19# __CHANGE__
20# Set your package name and version numbers here.  The NODOT_VERSION is
21# required for constructing the library name on systems that don't like
22# dots in library names (Windows).  The VERSION variable is used on the
23# other systems.
24#--------------------------------------------------------------------
25
26PACKAGE=Rappture
27
28MAJOR_VERSION=1
29MINOR_VERSION=1
30VERSION=${MAJOR_VERSION}.${MINOR_VERSION}
31
32#--------------------------------------------------------------------
33# Extra build options
34#--------------------------------------------------------------------
35#AC_ARG_WITH(blt, [  --with-blt=DIR          Find bltInt.h in DIR],
36#  blt_source_dir=$withval)
37
38#--------------------------------------------------------------------
39# We put this here so that you can compile with -DVERSION="1.2" to
40# encode the package version directly into the source files.
41#--------------------------------------------------------------------
42
43eval AC_DEFINE_UNQUOTED(VERSION, "${VERSION}")
44
45#--------------------------------------------------------------------
46# Check whether --enable-gcc or --disable-gcc was given.  Do this
47# before AC_CYGWIN is called so the compiler can
48# be fully tested by built-in autoconf tools.
49# This macro also calls AC_PROG_CC to set the compiler if --enable-gcc
50# was not used.
51#--------------------------------------------------------------------
52
53#SC_ENABLE_GCC
54AC_PROG_CXX
55AC_PROG_INSTALL
56
57#--------------------------------------------------------------------
58# Checks to see if the make program sets the $MAKE variable.
59#--------------------------------------------------------------------
60
61AC_PROG_MAKE_SET
62
63#--------------------------------------------------------------------
64# Find ranlib
65#--------------------------------------------------------------------
66
67AC_PROG_RANLIB
68
69#--------------------------------------------------------------------
70# This macro performs additional compiler tests.
71#--------------------------------------------------------------------
72
73AC_CYGWIN
74
75#--------------------------------------------------------------------
76# Determines the correct binary file extension (.o, .obj, .exe etc.)
77#--------------------------------------------------------------------
78
79AC_OBJEXT
80AC_EXEEXT
81
82#--------------------------------------------------------------------
83# "cygpath" is used on windows to generate native path names for include
84# files.
85# These variables should only be used with the compiler and linker since
86# they generate native path names.
87#
88# Unix tclConfig.sh points SRC_DIR at the top-level directory of
89# the Tcl sources, while the Windows tclConfig.sh points SRC_DIR at
90# the win subdirectory.  Hence the different usages of SRC_DIR below.
91#
92# This must be done before calling SC_PUBLIC_TCL_HEADERS
93#--------------------------------------------------------------------
94
95case "`uname -s`" in
96    *win32* | *WIN32* | *CYGWIN_NT*)
97        CYGPATH="cygpath -w"
98    ;;
99    *)
100        CYGPATH=echo
101    ;;
102esac
103
104AC_SUBST(CYGPATH)
105
106#--------------------------------------------------------------------
107# __CHANGE__
108# Choose which headers you need.  Extension authors should try very
109# hard to only rely on the Tcl public header files.  Internal headers
110# contain private data structures and are subject to change without
111# notice.
112# This MUST be called before SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG
113#--------------------------------------------------------------------
114
115SC_PUBLIC_TCL_HEADERS
116#SC_PRIVATE_TCL_HEADERS
117
118#--------------------------------------------------------------------
119# Load the tclConfig.sh file
120#--------------------------------------------------------------------
121
122SC_PATH_TCLCONFIG
123SC_LOAD_TCLCONFIG
124
125#--------------------------------------------------------------------
126# Look for bltInt.h on the normal include path.  If not found, look
127# for it in the --with-blt directory.
128#--------------------------------------------------------------------
129AC_MSG_CHECKING([for bltInt.h])
130BLT_SRC_DIR=""
131if test "x$blt_source_dir" != "x" ; then
132  #
133  # Verify that a tclConfig.sh file exists in the directory specified
134  # by --with-blt.
135  #
136  if test -r "$blt_source_dir/bltInt.h" ; then
137    BLT_SRC_DIR="$blt_source_dir"
138  elif test -r "$blt_source_dir/src/bltInt.h" ; then
139    BLT_SRC_DIR="$blt_source_dir/src"
140  fi
141else
142  #
143  # Otherwise, search for the bltInt.h include file...
144  # 1. Search previously named locations.
145  #
146  for dir in \
147   $prefix \
148   $exec_prefix
149  do
150    if test -r "$dir/bltInt.h" ; then
151      BLT_SRC_DIR="$dir"
152      break
153    elif test -r "$dir/include/bltInt.h" ; then
154      BLT_SRC_DIR="$dir/lib"
155      break
156    fi
157  done
158  #
159  #  2. Search source directories.
160  #
161  if test "x$BLT_SRC_DIR" = "x" ; then
162    for dir in \
163     `ls -dr ../blt[[2-3]].[[0-9]]* 2>/dev/null` \
164     ../blt \
165     `ls -dr ../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
166     ../../blt \
167     `ls -dr ../../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
168     ../../../blt
169    do
170      if test -r "$dir/bltInt.h" ; then
171        tclConfigFile="$dir/bltInt.h"
172        break
173      fi
174    done
175  fi
176fi
177
178AC_MSG_RESULT([${BLT_SRC_DIR}])
179
180if test "x$BLT_SRC_DIR" = "x" ; then
181  echo "can't find BLT include file \"bltInt.h\""
182  echo "use --with-blt=DIR to specify the location of the BLT sources"
183  exit 1
184fi
185
186AC_SUBST(BLT_SRC_DIR)
187
188#--------------------------------------------------------------------
189# __CHANGE__
190# A few miscellaneous platform-specific items:
191#
192# Define a special symbol for Windows (BUILD_exampleA in this case) so
193# that we create the export library with the dll.  See sha1.h on how
194# to use this.
195#
196# Windows creates a few extra files that need to be cleaned up.
197# You can add more files to clean if your extension creates any extra
198# files.
199#
200# Define any extra compiler flags in the PACKAGE_CFLAGS variable.
201# These will be appended to the current set of compiler flags for
202# your system.
203#--------------------------------------------------------------------
204
205case "`uname -s`" in
206    *win32* | *WIN32* | *CYGWIN_NT*)
207        AC_DEFINE(BUILD_Rappture)
208        CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch"
209        AC_SUBST(CLEANFILES)
210    ;;
211    *)
212        CLEANFILES=
213    ;;
214esac
215
216#--------------------------------------------------------------------
217# Check whether --enable-threads or --disable-threads was given.
218# So far only Tcl responds to this one.
219#--------------------------------------------------------------------
220
221SC_ENABLE_THREADS
222
223#--------------------------------------------------------------------
224# The statement below defines a collection of symbols related to
225# building as a shared library instead of a static library.
226#--------------------------------------------------------------------
227
228SC_ENABLE_SHARED
229
230#--------------------------------------------------------------------
231# This macro figures out what flags to use with the compiler/linker
232# when building shared/static debug/optimized objects.  This information
233# is all taken from the tclConfig.sh file.
234#--------------------------------------------------------------------
235
236CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG}
237CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE}
238LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
239LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
240SHLIB_LD=${TCL_SHLIB_LD}
241STLIB_LD=${TCL_STLIB_LD}
242SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
243
244AC_SUBST(CFLAGS_DEBUG)
245AC_SUBST(CFLAGS_OPTIMIZE)
246AC_SUBST(STLIB_LD)
247AC_SUBST(SHLIB_LD)
248AC_SUBST(SHLIB_CFLAGS)
249AC_SUBST(SHLIB_LDFLAGS)
250
251#--------------------------------------------------------------------
252# Set the default compiler switches based on the --enable-symbols
253# option.
254#--------------------------------------------------------------------
255
256SC_ENABLE_SYMBOLS
257
258if test "${SHARED_BUILD}" = "1" ; then
259    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}'
260else
261    CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}'
262fi
263
264#--------------------------------------------------------------------
265# Everyone should be linking against the Tcl stub library.  If you
266# can't for some reason, remove this definition.  If you aren't using
267# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
268# link against the non-stubbed Tcl library.
269#--------------------------------------------------------------------
270
271AC_DEFINE(USE_TCL_STUBS)
272
273#--------------------------------------------------------------------
274# This macro generates a line to use when building a library.  It
275# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS,
276# and SC_LOAD_TCLCONFIG macros above.
277#--------------------------------------------------------------------
278
279SC_MAKE_LIB
280
281#--------------------------------------------------------------------
282# eval these two values to dereference the ${DBGX} variable.
283#--------------------------------------------------------------------
284
285eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}"
286eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}"
287
288#--------------------------------------------------------------------
289# Shared libraries and static libraries have different names.
290#--------------------------------------------------------------------
291
292case "`uname -s`" in
293    *win32* | *WIN32* | *CYGWIN_NT*)
294        if test "${SHARED_BUILD}" = "1" ; then
295            SHLIB_LD_LIBS="\"`cygpath -w ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\" ${TCL_SHLIB_LD_LIBS}"
296            eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}"
297            RANLIB=:
298        else
299            eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}"
300        fi
301        ;;
302    *)
303        if test "${SHARED_BUILD}" = "1" ; then
304            SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC}"
305            eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}"
306            RANLIB=:
307        else
308            eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}"
309        fi
310        ;;
311esac
312
313#--------------------------------------------------------------------
314# __CHANGE__
315# Change the name from exampeA_LIB_FILE to match your package name.
316#--------------------------------------------------------------------
317
318AC_SUBST(Rappture_LIB_FILE)
319AC_SUBST(SHLIB_LD_LIBS)
320
321#--------------------------------------------------------------------
322# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
323# file during the install process.  Don't run the TCLSH_PROG through
324# ${CYGPATH} because it's being used directly by make.
325# Require that we use a tclsh shell version 8.2 or later since earlier
326# versions have bugs in the pkg_mkIndex routine.
327#--------------------------------------------------------------------
328
329AC_PATH_PROGS(TCLSH_PROG, tclsh8.4${EXEEXT} tclsh84${EXEEXT} tclsh${EXEEXT}, :, ${exec_prefix}:${PATH})
330
331if test "x${TCLSH_PROG}" = "x:" ; then
332    AC_MSG_WARN(No tclsh executable found.  You will have to build the pkgIndex.tcl file manually.)
333fi
334AC_SUBST(TCLSH_PROG)
335
336#--------------------------------------------------------------------
337# Finalize patchlevel and version info
338#--------------------------------------------------------------------
339PATCHLEVEL=`${TCLSH_PROG} cf/patchlevel.tcl`
340EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL}
341NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
342
343AC_SUBST(PACKAGE)
344AC_SUBST(VERSION)
345AC_SUBST(PATCHLEVEL)
346AC_SUBST(EXACT_VERSION)
347AC_SUBST(NODOT_VERSION)
348
349
350#--------------------------------------------------------------------
351# Finally, substitute all of the various values into the Makefile.
352#--------------------------------------------------------------------
353
354AC_OUTPUT([Makefile pkgIndex.tcl init.tcl])
Note: See TracBrowser for help on using the repository browser.