1 |
578 |
markom |
dnl This file is an input file used by the GNU "autoconf" program to
|
2 |
|
|
dnl generate the file "configure", which is run during Tk installation
|
3 |
|
|
dnl to configure the system for the local environment.
|
4 |
|
|
|
5 |
|
|
AC_INIT(../generic/itk.h)
|
6 |
|
|
# RCS: $Id: configure.in,v 1.1.1.1 2002-01-16 10:24:48 markom Exp $
|
7 |
|
|
|
8 |
|
|
ITCL_VERSION=3.0
|
9 |
|
|
ITCL_MAJOR_VERSION=3
|
10 |
|
|
ITCL_MINOR_VERSION=0
|
11 |
|
|
ITCL_RELEASE_LEVEL=0
|
12 |
|
|
VERSION=${ITCL_VERSION}
|
13 |
|
|
|
14 |
|
|
AC_CONFIG_AUX_DIR(../../config)
|
15 |
|
|
AC_PREREQ(2.0)
|
16 |
|
|
|
17 |
|
|
# -----------------------------------------------------------------------
|
18 |
|
|
# Set up a new default --prefix. If a previous installation of
|
19 |
|
|
# [incr Tcl] can be found searching $PATH use that directory.
|
20 |
|
|
# -----------------------------------------------------------------------
|
21 |
|
|
|
22 |
|
|
AC_PREFIX_DEFAULT(/usr/local)
|
23 |
|
|
AC_PREFIX_PROGRAM(tclsh)
|
24 |
|
|
|
25 |
|
|
if test "${prefix}" = "NONE"; then
|
26 |
|
|
prefix=/usr/local
|
27 |
|
|
fi
|
28 |
|
|
if test "${exec_prefix}" = "NONE"; then
|
29 |
|
|
exec_prefix=$prefix
|
30 |
|
|
fi
|
31 |
|
|
|
32 |
|
|
AC_PROG_INSTALL
|
33 |
|
|
AC_PROG_RANLIB
|
34 |
|
|
|
35 |
|
|
# -----------------------------------------------------------------------
|
36 |
|
|
BUILD_DIR=`pwd`
|
37 |
|
|
ITK_SRC_DIR=`cd $srcdir/..; pwd`
|
38 |
|
|
cd ${BUILD_DIR}
|
39 |
|
|
|
40 |
|
|
dnl CYGNUS LOCAL: allow gcc without a special flag
|
41 |
|
|
dnl AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
|
42 |
|
|
dnl [itk_ok=$enableval], [itk_ok=no])
|
43 |
|
|
dnl if test "$itk_ok" = "yes"; then
|
44 |
|
|
AC_PROG_CC
|
45 |
|
|
dnl else
|
46 |
|
|
dnl CC=${CC-cc}
|
47 |
|
|
dnl AC_SUBST(CC)
|
48 |
|
|
dnl fi
|
49 |
|
|
# END CYGNUS LOCAL
|
50 |
|
|
|
51 |
|
|
#--------------------------------------------------------------------
|
52 |
|
|
# See if there was a command-line option for where Tcl is; if
|
53 |
|
|
# not, search for Tcl.
|
54 |
|
|
# not, assume that its top-level directory is a sibling of ours.
|
55 |
|
|
# CYGNUS LOCAL - Actually Tcl & Tk are just called "tcl" & "tk" without the 8.0
|
56 |
|
|
#--------------------------------------------------------------------
|
57 |
|
|
|
58 |
|
|
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.0 binaries from DIR],
|
59 |
|
|
itcl_search=$withval, itcl_search=`cd ../../..; ls -d \`pwd\`/tcl*/unix`)
|
60 |
|
|
|
61 |
|
|
TCL_LIB_DIR=""
|
62 |
|
|
for dir in $itcl_search $exec_prefix/lib ; do
|
63 |
|
|
if test -r $dir/tclConfig.sh; then
|
64 |
|
|
TCL_LIB_DIR=$dir
|
65 |
|
|
break
|
66 |
|
|
fi
|
67 |
|
|
done
|
68 |
|
|
|
69 |
|
|
if test -z "$TCL_LIB_DIR"; then
|
70 |
|
|
AC_MSG_ERROR(Can't find Tcl libraries. Use --with-tcl to specify the directory containing tclConfig.sh on your system.)
|
71 |
|
|
fi
|
72 |
|
|
|
73 |
|
|
#--------------------------------------------------------------------
|
74 |
|
|
# Read in configuration information generated by Tcl for shared
|
75 |
|
|
# libraries, and arrange for it to be substituted into our
|
76 |
|
|
# Makefile.
|
77 |
|
|
#--------------------------------------------------------------------
|
78 |
|
|
|
79 |
|
|
file=$TCL_LIB_DIR/tclConfig.sh
|
80 |
|
|
. $file
|
81 |
|
|
CFLAGS=$TCL_CFLAGS
|
82 |
|
|
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
|
83 |
|
|
SHLIB_LD=$TCL_SHLIB_LD
|
84 |
|
|
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
|
85 |
|
|
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
|
86 |
|
|
DL_LIBS=$TCL_DL_LIBS
|
87 |
|
|
LD_FLAGS=$TCL_LD_FLAGS
|
88 |
|
|
LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
|
89 |
|
|
|
90 |
|
|
#--------------------------------------------------------------------
|
91 |
|
|
# Make sure that we can find the Tcl sources, so we can include
|
92 |
|
|
# the "tclInt.h" file.
|
93 |
|
|
#--------------------------------------------------------------------
|
94 |
|
|
|
95 |
|
|
if test ! -d "$TCL_SRC_DIR"; then
|
96 |
|
|
AC_MSG_ERROR(Can't find Tcl source directory "$TCL_SRC_DIR". Itcl can't be built without this directory.)
|
97 |
|
|
fi
|
98 |
|
|
|
99 |
|
|
#--------------------------------------------------------------------
|
100 |
|
|
# See if there was a command-line option for where Tk is; if
|
101 |
|
|
# not, search for Tk.
|
102 |
|
|
# CYGNUS LOCAL - Actually Tcl & Tk are just called "tcl" & "tk" without the 8.0
|
103 |
|
|
#--------------------------------------------------------------------
|
104 |
|
|
|
105 |
|
|
AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.0 binaries from DIR],
|
106 |
|
|
itcl_search=$withval, itcl_search=`cd ../../..; ls -d \`pwd\`/tk*/unix`)
|
107 |
|
|
|
108 |
|
|
TK_LIB_DIR=""
|
109 |
|
|
for dir in $itcl_search $exec_prefix/lib ; do
|
110 |
|
|
if test -r $dir/tkConfig.sh; then
|
111 |
|
|
TK_LIB_DIR=$dir
|
112 |
|
|
break
|
113 |
|
|
fi
|
114 |
|
|
done
|
115 |
|
|
|
116 |
|
|
if test -z "$TK_LIB_DIR"; then
|
117 |
|
|
AC_MSG_ERROR(Can't find Tk libraries. Use --with-tk to specify the directory containing tkConfig.sh on your system.)
|
118 |
|
|
fi
|
119 |
|
|
|
120 |
|
|
file=$TK_LIB_DIR/tkConfig.sh
|
121 |
|
|
. $file
|
122 |
|
|
|
123 |
|
|
#--------------------------------------------------------------------
|
124 |
|
|
# See if there was a command-line option for where [incr Tcl] is.
|
125 |
|
|
# If not, assume that its top-level directory is a sibling of ours.
|
126 |
|
|
#--------------------------------------------------------------------
|
127 |
|
|
|
128 |
|
|
AC_ARG_WITH(itcl, [ --with-itcl=DIR use Itcl 3.0 binaries from DIR],
|
129 |
|
|
ITCL_LIB_DIR=$withval, ITCL_LIB_DIR=`cd ../../itcl; pwd`)
|
130 |
|
|
|
131 |
|
|
if test ! -r "$ITCL_LIB_DIR/itclConfig.sh"; then
|
132 |
|
|
AC_MSG_ERROR(Can't find Itcl libraries. Have you built Itcl yet? Use --with-itcl to specify the directory containing itclConfig.sh on your system.)
|
133 |
|
|
fi
|
134 |
|
|
|
135 |
|
|
file=$ITCL_LIB_DIR/itclConfig.sh
|
136 |
|
|
. $file
|
137 |
|
|
|
138 |
|
|
#--------------------------------------------------------------------
|
139 |
|
|
# If this is gcc, add some extra compile flags.
|
140 |
|
|
#--------------------------------------------------------------------
|
141 |
|
|
|
142 |
|
|
AC_MSG_CHECKING([whether C compiler is gcc])
|
143 |
|
|
AC_CACHE_VAL(itcl_cv_prog_gcc, [
|
144 |
|
|
AC_EGREP_CPP(_cc_is_gcc_, [
|
145 |
|
|
#ifdef __GNUC__
|
146 |
|
|
_cc_is_gcc_
|
147 |
|
|
#endif
|
148 |
|
|
], [itcl_cv_prog_gcc=yes], [itcl_cv_prog_gcc=no])])
|
149 |
|
|
AC_MSG_RESULT([$itcl_cv_prog_gcc])
|
150 |
|
|
|
151 |
|
|
# CYGNUS LOCAL - set CFLAGS to -g -O2 for gcc.
|
152 |
|
|
if test -z "$CFLAGS" ; then
|
153 |
|
|
if test "$itcl_cv_prog_gcc" = "yes" ; then
|
154 |
|
|
CFLAGS="-g -O2"
|
155 |
|
|
else
|
156 |
|
|
CFLAGS="-O"
|
157 |
|
|
fi
|
158 |
|
|
fi
|
159 |
|
|
|
160 |
|
|
if test "$itcl_cv_prog_gcc" = "yes" ; then
|
161 |
|
|
# leave -Wimplicit-int out, the X libs generate so many of these warnings
|
162 |
|
|
# that they obscure everything else.
|
163 |
|
|
# CYGNUS LOCAL - add -fwritable-strings to CFLAGS for gcc. Needed
|
164 |
|
|
# with Tcl8.1
|
165 |
|
|
CFLAGS="$CFLAGS -fwritable-strings -Wshadow -Wtraditional -Wall -Wno-implicit-int"
|
166 |
|
|
fi
|
167 |
|
|
|
168 |
|
|
AC_MSG_CHECKING([default compiler flags])
|
169 |
|
|
AC_ARG_WITH(cflags, [ --with-cflags=FLAGS set compiler flags to FLAGS],
|
170 |
|
|
[CFLAGS="$with_cflags"])
|
171 |
|
|
|
172 |
|
|
AC_MSG_RESULT([$CFLAGS])
|
173 |
|
|
|
174 |
|
|
if test "$TCL_CC" != "$CC" ; then
|
175 |
|
|
echo ""
|
176 |
|
|
echo "WARNING: Compiler is $CC but Tcl was compiled with $TCL_CC"
|
177 |
|
|
echo ""
|
178 |
|
|
fi
|
179 |
|
|
|
180 |
|
|
#--------------------------------------------------------------------
|
181 |
|
|
# The statements below define a collection of symbols related to
|
182 |
|
|
# building libitk as a shared library instead of a static library.
|
183 |
|
|
#--------------------------------------------------------------------
|
184 |
|
|
|
185 |
|
|
AC_ARG_ENABLE(shared,
|
186 |
|
|
[ --enable-shared build libitk as a shared library],
|
187 |
|
|
[ok=$enableval], [ok=no])
|
188 |
|
|
if test "$ok" = "yes"; then
|
189 |
|
|
if test ${TCL_SHARED_BUILD} = 0; then
|
190 |
|
|
AC_MSG_ERROR(Tcl was not built with --enable-shared, so you can't use shared libraries.)
|
191 |
|
|
fi
|
192 |
|
|
SHLIB_CFLAGS="${SHLIB_CFLAGS}"
|
193 |
|
|
eval "ITK_LIB_FILE=libitk${VERSION}${SHLIB_SUFFIX}"
|
194 |
|
|
ITK_PKG_FILE="[[file join [file dirname \$dir] ${ITK_LIB_FILE}]]"
|
195 |
|
|
# CYGNUS LOCAL - don't pass LD_SEARCH_FLAGS to libraries
|
196 |
|
|
MAKE_LIB="\$(SHLIB_LD) -o ${ITK_LIB_FILE} \$(OBJS) "
|
197 |
|
|
# END CYGNUS LOCAL
|
198 |
|
|
RANLIB=":"
|
199 |
|
|
else
|
200 |
|
|
SHLIB_CFLAGS=""
|
201 |
|
|
# CYGNUS LOCAL - Strip dots from library name for SunOS4, etc...
|
202 |
|
|
if test ${TCL_LIB_VERSIONS_OK} = "nodots"; then
|
203 |
|
|
ITK_LIB_FILE="libitk`echo ${VERSION} | tr -d .`.a"
|
204 |
|
|
else
|
205 |
|
|
eval "ITK_LIB_FILE=libitk${VERSION}.a"
|
206 |
|
|
fi
|
207 |
|
|
ITK_PKG_FILE=""
|
208 |
|
|
MAKE_LIB="ar cr ${ITK_LIB_FILE} \${OBJS}"
|
209 |
|
|
fi
|
210 |
|
|
|
211 |
|
|
# Note: in the following variable, it's important to use the absolute
|
212 |
|
|
# path name of the Tcl directory rather than "..": this is because
|
213 |
|
|
# AIX remembers this path and will attempt to use it at run-time to look
|
214 |
|
|
# up the Tcl library.
|
215 |
|
|
|
216 |
|
|
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
|
217 |
|
|
ITK_BUILD_LIB_SPEC="-L`pwd` -litk${VERSION}"
|
218 |
|
|
ITK_LIB_SPEC="-L${exec_prefix}/lib -litk${VERSION}"
|
219 |
|
|
else
|
220 |
|
|
ITK_BUILD_LIB_SPEC="-L`pwd` -litk`echo ${VERSION} | tr -d .`"
|
221 |
|
|
ITK_LIB_SPEC="-L${exec_prefix}/lib -litk`echo ${VERSION} | tr -d .`"
|
222 |
|
|
fi
|
223 |
|
|
|
224 |
|
|
ITK_LIB_FULL_PATH="`pwd`/${ITK_LIB_FILE}"
|
225 |
|
|
|
226 |
|
|
AC_SUBST(CFLAGS)
|
227 |
|
|
AC_SUBST(DL_LIBS)
|
228 |
|
|
AC_SUBST(LD_FLAGS)
|
229 |
|
|
AC_SUBST(MAKE_LIB)
|
230 |
|
|
AC_SUBST(SHLIB_CFLAGS)
|
231 |
|
|
AC_SUBST(SHLIB_LD)
|
232 |
|
|
AC_SUBST(SHLIB_LD_LIBS)
|
233 |
|
|
AC_SUBST(SHLIB_SUFFIX)
|
234 |
|
|
AC_SUBST(LD_SEARCH_FLAGS)
|
235 |
|
|
|
236 |
|
|
AC_SUBST(TCL_VERSION)
|
237 |
|
|
AC_SUBST(TCL_SRC_DIR)
|
238 |
|
|
AC_SUBST(TCL_LIB_SPEC)
|
239 |
|
|
AC_SUBST(TCL_BUILD_LIB_SPEC)
|
240 |
|
|
AC_SUBST(TCL_LIB_FLAG)
|
241 |
|
|
AC_SUBST(TCL_DBGX)
|
242 |
|
|
AC_SUBST(TCL_DEFS)
|
243 |
|
|
AC_SUBST(TCL_LIBS)
|
244 |
|
|
AC_SUBST(TCL_SHLIB_LD_LIBS)
|
245 |
|
|
AC_SUBST(TCL_SHLIB_SUFFIX)
|
246 |
|
|
AC_SUBST(TCL_COMPAT_OBJS)
|
247 |
|
|
AC_SUBST(TCL_CFLAGS)
|
248 |
|
|
AC_SUBST(TCL_LIB_FULL_PATH)
|
249 |
|
|
|
250 |
|
|
AC_SUBST(TK_VERSION)
|
251 |
|
|
AC_SUBST(TK_BUILD_LIB_SPEC)
|
252 |
|
|
AC_SUBST(TK_LIB_DIR)
|
253 |
|
|
AC_SUBST(TK_LIB_SPEC)
|
254 |
|
|
AC_SUBST(TK_LIB_FLAG)
|
255 |
|
|
AC_SUBST(TK_XINCLUDES)
|
256 |
|
|
AC_SUBST(TK_XLIBSW)
|
257 |
|
|
AC_SUBST(TK_SRC_DIR)
|
258 |
|
|
AC_SUBST(TK_LIB_FULL_PATH)
|
259 |
|
|
|
260 |
|
|
AC_SUBST(ITCL_VERSION)
|
261 |
|
|
AC_SUBST(ITCL_MAJOR_VERSION)
|
262 |
|
|
AC_SUBST(ITCL_MINOR_VERSION)
|
263 |
|
|
AC_SUBST(ITCL_RELEASE_LEVEL)
|
264 |
|
|
AC_SUBST(ITCL_BUILD_LIB_SPEC)
|
265 |
|
|
AC_SUBST(ITCL_LIB_FULL_PATH)
|
266 |
|
|
AC_SUBST(ITCL_LIB_DIR)
|
267 |
|
|
AC_SUBST(ITCL_LIB_SPEC)
|
268 |
|
|
AC_SUBST(ITCL_PKG_FILE)
|
269 |
|
|
AC_SUBST(ITCL_SRC_DIR)
|
270 |
|
|
|
271 |
|
|
AC_SUBST(ITK_BUILD_LIB_SPEC)
|
272 |
|
|
AC_SUBST(ITK_LIB_FILE)
|
273 |
|
|
AC_SUBST(ITK_LIB_SPEC)
|
274 |
|
|
AC_SUBST(ITK_PKG_FILE)
|
275 |
|
|
AC_SUBST(ITK_SRC_DIR)
|
276 |
|
|
AC_SUBST(ITK_LIB_FULL_PATH)
|
277 |
|
|
|
278 |
|
|
AC_OUTPUT(Makefile pkgIndex.tcl ../itkConfig.sh)
|