source: trunk/gui/configure.in @ 829

Last change on this file since 829 was 751, checked in by dkearney, 14 years ago

moved encode code to src2/core so it can be used in librappture2 for nanovis
updated nanovis configure script
updated src and src2/core makefiles with encode code move

File size: 9.7 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([RapptureGUI], [1.0])
23
24PACKAGE=RapptureGUI
25
26MAJOR_VERSION=1
27MINOR_VERSION=0
28VERSION=${MAJOR_VERSION}.${MINOR_VERSION}
29
30#--------------------------------------------------------------------
31# Call TEA_INIT as the first TEA_ macro to set up initial vars.
32# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
33# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
34#--------------------------------------------------------------------
35
36TEA_INIT([3.5])
37
38AC_CONFIG_AUX_DIR(tclconfig)
39
40#--------------------------------------------------------------------
41# Extra build options
42#--------------------------------------------------------------------
43AC_ARG_WITH(blt, [  --with-blt=DIR          Find bltInt.h in DIR],
44  blt_source_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
86TEA_ADD_SOURCES([RpInit.c RpRlimit.c RpRusage.c RpSignal.c RpDaemon.c])
87TEA_ADD_HEADERS([])
88TEA_ADD_INCLUDES([])
89TEA_ADD_CFLAGS([])
90TEA_ADD_STUB_SOURCES([])
91
92#--------------------------------------------------------------------
93# __CHANGE__
94# A few miscellaneous platform-specific items:
95#
96# Define a special symbol for Windows (BUILD_Rappture in this case) so
97# that we create the export library with the dll.
98#
99# Windows creates a few extra files that need to be cleaned up.
100# You can add more files to clean if your extension creates any extra
101# files.
102#
103# TEA_ADD_* any platform specific compiler/build info here.
104#--------------------------------------------------------------------
105
106if test "${TEA_PLATFORM}" = "windows" ; then
107    AC_DEFINE(BUILD_Rappture, 1, [Build windows export dll])
108    CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch *.manifest"
109    TEA_ADD_SOURCES([RpWinResource.c])
110    TEA_ADD_LIBS([-LIBPATH:${TCL_EXEC_PREFIX}/lib])
111    TEA_ADD_LIBS([BLTlite24.LIB])
112    TEA_ADD_LIBS([psapi.lib])
113    TEA_ADD_CFLAGS([-D_CRT_SECURE_NO_DEPRECATE -wd4996])
114else
115    CLEANFILES=""
116    TEA_ADD_LIBS([-L${TCL_EXEC_PREFIX}/lib])
117    TEA_ADD_LIBS([-lBLTlite24])
118fi
119AC_SUBST(CLEANFILES)
120
121#--------------------------------------------------------------------
122# __CHANGE__
123# Choose which headers you need.  Extension authors should try very
124# hard to only rely on the Tcl public header files.  Internal headers
125# contain private data structures and are subject to change without
126# notice.
127# This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
128#--------------------------------------------------------------------
129
130TEA_PUBLIC_TCL_HEADERS
131#TEA_PRIVATE_TCL_HEADERS
132
133TEA_PUBLIC_TK_HEADERS
134#TEA_PRIVATE_TK_HEADERS
135#TEA_PATH_X
136
137#--------------------------------------------------------------------
138# Check whether --enable-threads or --disable-threads was given.
139# This auto-enables if Tcl was compiled threaded.
140#--------------------------------------------------------------------
141
142TEA_ENABLE_THREADS
143
144#--------------------------------------------------------------------
145# The statement below defines a collection of symbols related to
146# building as a shared library instead of a static library.
147#--------------------------------------------------------------------
148
149TEA_ENABLE_SHARED
150
151#--------------------------------------------------------------------
152# This macro figures out what flags to use with the compiler/linker
153# when building shared/static debug/optimized objects.  This information
154# can be taken from the tclConfig.sh file, but this figures it all out.
155#--------------------------------------------------------------------
156
157TEA_CONFIG_CFLAGS
158
159#--------------------------------------------------------------------
160# Set the default compiler switches based on the --enable-symbols option.
161#--------------------------------------------------------------------
162
163TEA_ENABLE_SYMBOLS
164
165#--------------------------------------------------------------------
166# Everyone should be linking against the Tcl stub library.  If you
167# can't for some reason, remove this definition.  If you aren't using
168# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
169# link against the non-stubbed Tcl library.  Add Tk too if necessary.
170#--------------------------------------------------------------------
171
172AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
173#AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
174
175#--------------------------------------------------------------------
176# This macro generates a line to use when building a library.  It
177# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
178# and TEA_LOAD_TCLCONFIG macros above.
179#--------------------------------------------------------------------
180
181TEA_MAKE_LIB
182
183#--------------------------------------------------------------------
184# Determine the name of the tclsh and/or wish executables in the
185# Tcl and Tk build directories or the location they were installed
186# into. These paths are used to support running test cases only,
187# the Makefile should not be making use of these paths to generate
188# a pkgIndex.tcl file or anything else at extension build time.
189#--------------------------------------------------------------------
190
191TEA_PROG_TCLSH
192#TEA_PROG_WISH
193
194
195#--------------------------------------------------------------------
196# Look for bltInt.h on the normal include path.  If not found, look
197# for it in the --with-blt directory.
198#--------------------------------------------------------------------
199AC_MSG_CHECKING([for bltInt.h])
200BLT_SRC_DIR=""
201if test "x$blt_source_dir" != "x" ; then
202  #
203  # Verify that a tclConfig.sh file exists in the directory specified
204  # by --with-blt.
205  #
206  if test -r "$blt_source_dir/bltInt.h" ; then
207    BLT_SRC_DIR="$blt_source_dir"
208  elif test -r "$blt_source_dir/src/bltInt.h" ; then
209    BLT_SRC_DIR="$blt_source_dir/src"
210  fi
211else
212  #
213  # Otherwise, search for the bltInt.h include file...
214  # 1. Search previously named locations.
215  #
216  for dir in \
217   $prefix \
218   $exec_prefix
219  do
220    if test -r "$dir/bltInt.h" ; then
221      BLT_SRC_DIR="$dir"
222      break
223    elif test -r "$dir/include/bltInt.h" ; then
224      BLT_SRC_DIR="$dir/include"
225      break
226    fi
227  done
228  #
229  #  2. Search source directories.
230  #
231  if test "x$BLT_SRC_DIR" = "x" ; then
232    for dir in \
233     `ls -dr ../blt[[2-3]].[[0-9]]* 2>/dev/null` \
234     ../blt \
235     `ls -dr ../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
236     ../../blt \
237     `ls -dr ../../../blt[[2-3]].[[0-9]]* 2>/dev/null` \
238     ../../../blt \
239     `ls -dr c:/opt/blt[[2-3]].[[0-9]]* 2>/dev/null` \
240     c\:/opt/blt
241    do
242      if test -r "$dir/src/bltInt.h" ; then
243        BLT_SRC_DIR="$dir/src"
244        break
245      fi
246    done
247  fi
248fi
249AC_MSG_RESULT([${BLT_SRC_DIR}])
250
251if test "x$BLT_SRC_DIR" = "x" ; then
252  echo "can't find BLT include file \"bltInt.h\""
253  echo "use --with-blt=DIR to specify the location of the BLT sources"
254  exit 1
255fi
256
257AC_SUBST(BLT_SRC_DIR)
258
259PATCHLEVEL=`${TCLSH_PROG} tclconfig/patchlevel.tcl`
260EXACT_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}-${PATCHLEVEL}
261NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION}
262
263AC_SUBST(PACKAGE)
264AC_SUBST(VERSION)
265AC_SUBST(PATCHLEVEL)
266AC_SUBST(EXACT_VERSION)
267AC_SUBST(NODOT_VERSION)
268
269
270#--------------------------------------------------------------------
271# Finally, substitute all of the various values into the Makefile.
272# You may alternatively have a special pkgIndex.tcl.in or other files
273# which require substituting th AC variables in.  Include these here.
274#--------------------------------------------------------------------
275
276AC_OUTPUT([Makefile pkgIndex.tcl init.tcl])
Note: See TracBrowser for help on using the repository browser.