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_PREREQ(2.5)
|
6 |
|
|
|
7 |
|
|
AC_INIT(../generic/itk.h)
|
8 |
|
|
|
9 |
|
|
AC_CONFIG_AUX_DIR(../../../)
|
10 |
|
|
AC_CANONICAL_HOST
|
11 |
|
|
|
12 |
|
|
AC_PROG_RANLIB
|
13 |
|
|
|
14 |
|
|
AC_PROG_CC
|
15 |
|
|
AC_OBJEXT
|
16 |
|
|
AC_CHECK_TOOL(NM, nm, nm)
|
17 |
|
|
AC_SUBST(NM)
|
18 |
|
|
AC_CHECK_TOOL(AS, as, as)
|
19 |
|
|
AC_SUBST(AS)
|
20 |
|
|
AC_CHECK_TOOL(LD, ld, ld)
|
21 |
|
|
AC_SUBST(LD)
|
22 |
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
|
23 |
|
|
AC_SUBST(DLLTOOL)
|
24 |
|
|
AC_CHECK_TOOL(WINDRES, windres, windres)
|
25 |
|
|
AC_SUBST(WINDRES)
|
26 |
|
|
|
27 |
|
|
AC_PROG_INSTALL
|
28 |
|
|
|
29 |
|
|
# needed for the subtle differences between cygwin and mingw32
|
30 |
|
|
case "${host}" in
|
31 |
|
|
*-*-cygwin*)
|
32 |
|
|
DLL_LDLIBS=-lcygwin
|
33 |
|
|
DLL_LDFLAGS='-nostartfiles -Wl,--dll'
|
34 |
|
|
;;
|
35 |
|
|
*-*-mingw32*)
|
36 |
|
|
DLL_LDLIBS=
|
37 |
|
|
DLL_LDFLAGS='-mdll'
|
38 |
|
|
;;
|
39 |
|
|
esac
|
40 |
|
|
AC_SUBST(DLL_LDFLAGS)
|
41 |
|
|
AC_SUBST(DLL_LDLIBS)
|
42 |
|
|
|
43 |
|
|
ITCL_VERSION=3.0
|
44 |
|
|
ITCL_MAJOR_VERSION=3
|
45 |
|
|
ITCL_MINOR_VERSION=0
|
46 |
|
|
VERSION=${ITCL_MAJOR_VERSION}${ITCL_MINOR_VERSION}
|
47 |
|
|
|
48 |
|
|
if test "${prefix}" = "NONE"; then
|
49 |
|
|
prefix=/usr/local
|
50 |
|
|
fi
|
51 |
|
|
if test "${exec_prefix}" = "NONE"; then
|
52 |
|
|
exec_prefix=$prefix
|
53 |
|
|
fi
|
54 |
|
|
|
55 |
|
|
# -----------------------------------------------------------------------
|
56 |
|
|
# Set up a new default --prefix. If a previous installation of
|
57 |
|
|
# [incr Tcl] can be found searching $PATH use that directory.
|
58 |
|
|
# -----------------------------------------------------------------------
|
59 |
|
|
|
60 |
|
|
AC_PREFIX_DEFAULT(/usr/local)
|
61 |
|
|
AC_PREFIX_PROGRAM(itclsh)
|
62 |
|
|
|
63 |
|
|
# -----------------------------------------------------------------------
|
64 |
|
|
BUILD_DIR=`pwd`
|
65 |
|
|
ITK_SRC_DIR=`cd $srcdir/..; pwd`
|
66 |
|
|
|
67 |
|
|
if ! test "$GCC" = yes; then
|
68 |
|
|
tmp="`cygpath --windows $ITK_SRC_DIR`"
|
69 |
|
|
ITK_SRC_DIR="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
|
70 |
|
|
fi
|
71 |
|
|
|
72 |
|
|
cd ${BUILD_DIR}
|
73 |
|
|
|
74 |
|
|
AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
|
75 |
|
|
[itk_ok=$enableval], [itk_ok=no])
|
76 |
|
|
if test "$itk_ok" = "yes"; then
|
77 |
|
|
AC_PROG_CC
|
78 |
|
|
else
|
79 |
|
|
CC=${CC-cc}
|
80 |
|
|
AC_SUBST(CC)
|
81 |
|
|
fi
|
82 |
|
|
AC_HAVE_HEADERS(unistd.h limits.h)
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
#--------------------------------------------------------------------
|
86 |
|
|
# See if there was a command-line option for where Tcl is; if
|
87 |
|
|
# not, assume that its top-level directory is a sibling of ours.
|
88 |
|
|
# CYGNUS LOCAL - Actually Tcl & Tk are siblings of the itcl directory
|
89 |
|
|
# that contains itcl & itk & iwidgets.
|
90 |
|
|
#--------------------------------------------------------------------
|
91 |
|
|
|
92 |
|
|
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.0 binaries from DIR],
|
93 |
|
|
TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd ../../../tcl/win; pwd`)
|
94 |
|
|
|
95 |
|
|
if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then
|
96 |
|
|
TCL_BIN_DIR=`cd ../../../tcl8.1/win;pwd`
|
97 |
|
|
fi
|
98 |
|
|
|
99 |
|
|
if test ! -f $TCL_BIN_DIR/../unix/tclConfig.sh; then
|
100 |
|
|
AC_MSG_ERROR(There's no tclConfig.sh in $TCL_BIN_DIR; perhaps you didn't specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
|
101 |
|
|
fi
|
102 |
|
|
|
103 |
|
|
#--------------------------------------------------------------------
|
104 |
|
|
# Read in configuration information generated by Tcl for shared
|
105 |
|
|
# libraries, and arrange for it to be substituted into our
|
106 |
|
|
# Makefile.
|
107 |
|
|
#--------------------------------------------------------------------
|
108 |
|
|
|
109 |
|
|
file=$TCL_BIN_DIR/../unix/tclConfig.sh
|
110 |
|
|
. $file
|
111 |
|
|
|
112 |
|
|
dnl CFLAGS=$TCL_CFLAGS
|
113 |
|
|
|
114 |
|
|
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
|
115 |
|
|
SHLIB_LD=$TCL_SHLIB_LD
|
116 |
|
|
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
|
117 |
|
|
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
|
118 |
|
|
SHLIB_VERSION=$TCL_SHLIB_VERSION
|
119 |
|
|
DL_LIBS=$TCL_DL_LIBS
|
120 |
|
|
LD_FLAGS=$TCL_LD_FLAGS
|
121 |
|
|
ITK_LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
|
122 |
|
|
|
123 |
|
|
#--------------------------------------------------------------------
|
124 |
|
|
# See if there was a command-line option for where Tk is; if
|
125 |
|
|
# not, assume that its top-level directory is a sibling of ours.
|
126 |
|
|
# CYGNUS LOCAL - actually these are one level higher in the CYGNUS tree.
|
127 |
|
|
#--------------------------------------------------------------------
|
128 |
|
|
|
129 |
|
|
AC_ARG_WITH(tcl, [ --with-tk=DIR use Tk 8.0 binaries from DIR],
|
130 |
|
|
TK_BIN_DIR=$withval, TK_BIN_DIR=`cd ../../../tk/win; pwd`)
|
131 |
|
|
|
132 |
|
|
if test ! -f $TK_BIN_DIR/../unix/tkConfig.sh; then
|
133 |
|
|
TK_BIN_DIR=`cd ../../../tk8.1/win;pwd`
|
134 |
|
|
fi
|
135 |
|
|
|
136 |
|
|
if test ! -f $TK_BIN_DIR/../unix/tkConfig.sh; then
|
137 |
|
|
AC_MSG_ERROR(There's no tkConfig.sh in $TK_BIN_DIR; perhaps you didn't specify the Tk *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
|
138 |
|
|
fi
|
139 |
|
|
|
140 |
|
|
file=$TK_BIN_DIR/../unix/tkConfig.sh
|
141 |
|
|
. $file
|
142 |
|
|
|
143 |
|
|
if ! test "$GCC" = yes; then
|
144 |
|
|
tmp="`cygpath --windows $TK_BIN_DIR`"
|
145 |
|
|
TK_BIN_DIR="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
|
146 |
|
|
fi
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
#--------------------------------------------------------------------
|
150 |
|
|
# See if there was a command-line option for where [incr Tcl] is.
|
151 |
|
|
# If not, assume that its top-level directory is a sibling of ours.
|
152 |
|
|
#--------------------------------------------------------------------
|
153 |
|
|
|
154 |
|
|
AC_ARG_WITH(itcl, [ --with-itcl=DIR use Itcl 3.0 binaries from DIR],
|
155 |
|
|
ITCL_BIN_DIR=$withval, ITCL_BIN_DIR=`cd ../../itcl/win; pwd`)
|
156 |
|
|
if test ! -d $ITCL_BIN_DIR; then
|
157 |
|
|
AC_MSG_ERROR(Itcl directory $ITCL_BIN_DIR doesn't exist)
|
158 |
|
|
fi
|
159 |
|
|
if test ! -f $ITCL_BIN_DIR/Makefile; then
|
160 |
|
|
AC_MSG_ERROR(There's no Makefile in $ITCL_BIN_DIR; perhaps you didn't specify the Itcl *build* directory (not the toplevel Itcl directory) or you forgot to configure Itcl?)
|
161 |
|
|
fi
|
162 |
|
|
|
163 |
|
|
file=$ITCL_BIN_DIR/../itclConfig.sh
|
164 |
|
|
. $file
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
AC_MSG_CHECKING([whether C compiler is gcc])
|
168 |
|
|
AC_CACHE_VAL(itcl_cv_prog_gcc, [
|
169 |
|
|
AC_EGREP_CPP(_cc_is_gcc_, [
|
170 |
|
|
#ifdef __GNUC__
|
171 |
|
|
_cc_is_gcc_
|
172 |
|
|
#endif
|
173 |
|
|
], [itcl_cv_prog_gcc=yes], [itcl_cv_prog_gcc=no])])
|
174 |
|
|
AC_MSG_RESULT([$itcl_cv_prog_gcc])
|
175 |
|
|
|
176 |
|
|
if test -z "$CFLAGS" ; then
|
177 |
|
|
CFLAGS="-O"
|
178 |
|
|
fi
|
179 |
|
|
if test "$itcl_cv_prog_gcc" = "yes" ; then
|
180 |
|
|
CFLAGS="$CFLAGS -Wshadow -Wtraditional -Wall"
|
181 |
|
|
fi
|
182 |
|
|
|
183 |
|
|
AC_MSG_CHECKING([default compiler flags])
|
184 |
|
|
AC_ARG_WITH(cflags, [ --with-cflags=FLAGS set compiler flags to FLAGS],
|
185 |
|
|
[CFLAGS="$with_cflags"])
|
186 |
|
|
|
187 |
|
|
AC_MSG_RESULT([$CFLAGS])
|
188 |
|
|
|
189 |
|
|
#--------------------------------------------------------------------
|
190 |
|
|
# Supply a substitute for stdlib.h if it doesn't define strtol,
|
191 |
|
|
# strtoul, or strtod (which it doesn't in some versions of SunOS).
|
192 |
|
|
#--------------------------------------------------------------------
|
193 |
|
|
|
194 |
|
|
AC_MSG_CHECKING(stdlib.h)
|
195 |
|
|
AC_HEADER_EGREP(strtol, stdlib.h, itk_ok=yes, itk_ok=no)
|
196 |
|
|
AC_HEADER_EGREP(strtoul, stdlib.h, , itk_ok=no)
|
197 |
|
|
AC_HEADER_EGREP(strtod, stdlib.h, , itk_ok=no)
|
198 |
|
|
if test $itk_ok = no; then
|
199 |
|
|
AC_DEFINE(NO_STDLIB_H)
|
200 |
|
|
fi
|
201 |
|
|
AC_MSG_RESULT($itk_ok)
|
202 |
|
|
|
203 |
|
|
#--------------------------------------------------------------------
|
204 |
|
|
# Check for various typedefs and provide substitutes if
|
205 |
|
|
# they don't exist.
|
206 |
|
|
#--------------------------------------------------------------------
|
207 |
|
|
|
208 |
|
|
AC_MODE_T
|
209 |
|
|
AC_PID_T
|
210 |
|
|
AC_SIZE_T
|
211 |
|
|
AC_UID_T
|
212 |
|
|
|
213 |
|
|
# -----------------------------------------------------------------------
|
214 |
|
|
# C compiler and debugging flags
|
215 |
|
|
# -----------------------------------------------------------------------
|
216 |
|
|
AC_MSG_CHECKING([which C compiler])
|
217 |
|
|
if test -z "$CC" ; then
|
218 |
|
|
CC="cc"
|
219 |
|
|
fi
|
220 |
|
|
AC_ARG_WITH(cc, [ --with-cc=CC set C compiler to CC],
|
221 |
|
|
[CC=$with_cc])
|
222 |
|
|
AC_MSG_RESULT([$CC])
|
223 |
|
|
AC_SUBST(CC)
|
224 |
|
|
|
225 |
|
|
AC_PROG_CPP
|
226 |
|
|
|
227 |
|
|
#--------------------------------------------------------------------
|
228 |
|
|
# Supply substitutes for missing POSIX header files.
|
229 |
|
|
# Replacements are handled in "tclInt.h" which we include here.
|
230 |
|
|
#--------------------------------------------------------------------
|
231 |
|
|
|
232 |
|
|
AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H))
|
233 |
|
|
AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0)
|
234 |
|
|
AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0)
|
235 |
|
|
AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0)
|
236 |
|
|
AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0)
|
237 |
|
|
if test $tcl_ok = 0; then
|
238 |
|
|
AC_DEFINE(NO_STDLIB_H)
|
239 |
|
|
fi
|
240 |
|
|
AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0)
|
241 |
|
|
AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0)
|
242 |
|
|
AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0)
|
243 |
|
|
if test $tcl_ok = 0; then
|
244 |
|
|
AC_DEFINE(NO_STRING_H)
|
245 |
|
|
fi
|
246 |
|
|
|
247 |
|
|
#--------------------------------------------------------------------
|
248 |
|
|
# Check for various typedefs and provide substitutes if
|
249 |
|
|
# they don't exist.
|
250 |
|
|
#--------------------------------------------------------------------
|
251 |
|
|
|
252 |
|
|
AC_MODE_T
|
253 |
|
|
AC_PID_T
|
254 |
|
|
AC_SIZE_T
|
255 |
|
|
AC_UID_T
|
256 |
|
|
|
257 |
|
|
#--------------------------------------------------------------------
|
258 |
|
|
# Locate the X11 header files and the X11 library archive. Try
|
259 |
|
|
# the ac_path_x macro first, but if it doesn't find the X stuff
|
260 |
|
|
# (e.g. because there's no xmkmf program) then check through
|
261 |
|
|
# a list of possible directories. Under some conditions the
|
262 |
|
|
# autoconf macro will return an include directory that contains
|
263 |
|
|
# no include files, so double-check its result just to be safe.
|
264 |
|
|
#--------------------------------------------------------------------
|
265 |
|
|
|
266 |
|
|
AC_PATH_X
|
267 |
|
|
not_really_there=""
|
268 |
|
|
if test "$no_x" = ""; then
|
269 |
|
|
if test "$x_includes" = ""; then
|
270 |
|
|
AC_TRY_CPP([#include ], , not_really_there="yes")
|
271 |
|
|
else
|
272 |
|
|
if test ! -r $x_includes/X11/Intrinsic.h; then
|
273 |
|
|
not_really_there="yes"
|
274 |
|
|
fi
|
275 |
|
|
fi
|
276 |
|
|
fi
|
277 |
|
|
if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then
|
278 |
|
|
echo checking for X11 header files
|
279 |
|
|
XINCLUDES="# no special path needed"
|
280 |
|
|
AC_TRY_CPP([#include ], , XINCLUDES="nope")
|
281 |
|
|
if test "$XINCLUDES" = nope; then
|
282 |
|
|
dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/include/X11R6 /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include"
|
283 |
|
|
for i in $dirs ; do
|
284 |
|
|
if test -r $i/X11/Intrinsic.h; then
|
285 |
|
|
XINCLUDES=" -I$i"
|
286 |
|
|
fi
|
287 |
|
|
done
|
288 |
|
|
fi
|
289 |
|
|
else
|
290 |
|
|
if test "$x_includes" != ""; then
|
291 |
|
|
XINCLUDES=-I$x_includes
|
292 |
|
|
else
|
293 |
|
|
XINCLUDES="# no special path needed"
|
294 |
|
|
fi
|
295 |
|
|
fi
|
296 |
|
|
if test "$XINCLUDES" = nope; then
|
297 |
|
|
echo "Warning: couldn't find any X11 include files."
|
298 |
|
|
XINCLUDES="# no include files found"
|
299 |
|
|
fi
|
300 |
|
|
AC_SUBST(XINCLUDES)
|
301 |
|
|
|
302 |
|
|
if test "$no_x" = yes; then
|
303 |
|
|
XLIBSW=nope
|
304 |
|
|
if test "$XLIBSW" = nope; then
|
305 |
|
|
dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/lib/X11R6 /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib"
|
306 |
|
|
for i in $dirs ; do
|
307 |
|
|
if test -r $i/libX11.a; then
|
308 |
|
|
XLIBSW="-L$i -lX11"
|
309 |
|
|
fi
|
310 |
|
|
done
|
311 |
|
|
fi
|
312 |
|
|
else
|
313 |
|
|
if test "$x_libraries" = ""; then
|
314 |
|
|
XLIBSW=-lX11
|
315 |
|
|
else
|
316 |
|
|
XLIBSW="-L$x_libraries -lX11"
|
317 |
|
|
fi
|
318 |
|
|
fi
|
319 |
|
|
if test "$XLIBSW" = nope ; then
|
320 |
|
|
AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow)
|
321 |
|
|
fi
|
322 |
|
|
if test "$XLIBSW" = nope ; then
|
323 |
|
|
AC_MSG_RESULT(couldn't find any! Using -lX11.)
|
324 |
|
|
XLIBSW=-lX11
|
325 |
|
|
fi
|
326 |
|
|
|
327 |
|
|
#--------------------------------------------------------------------
|
328 |
|
|
# If the X library binaries are in a non-standard directory, and
|
329 |
|
|
# if a mechanism such as -R is available on this platform for
|
330 |
|
|
# specifying a runtime search path for shared libraries, add the X
|
331 |
|
|
# library location into that search path.
|
332 |
|
|
#--------------------------------------------------------------------
|
333 |
|
|
|
334 |
|
|
if test "$x_libraries" != "" -a "$ITK_LD_SEARCH_FLAGS" != ""; then
|
335 |
|
|
itk_tmp=`sed -e "s|\\\${LIB_RUNTIME_DIR}|$x_libraries|" << EOF
|
336 |
|
|
$ITK_LD_SEARCH_FLAGS
|
337 |
|
|
EOF`
|
338 |
|
|
ITK_LD_SEARCH_FLAGS="$ITK_LD_SEARCH_FLAGS $itk_tmp"
|
339 |
|
|
fi
|
340 |
|
|
|
341 |
|
|
#--------------------------------------------------------------------
|
342 |
|
|
# Check for the existence of various libraries. The order here
|
343 |
|
|
# is important, so that then end up in the right order in the
|
344 |
|
|
# command line generated by make. The -lsocket and -lnsl libraries
|
345 |
|
|
# require a couple of special tricks:
|
346 |
|
|
# 1. Use "connect" and "accept" to check for -lsocket, and
|
347 |
|
|
# "gethostbyname" to check for -lnsl.
|
348 |
|
|
# 2. Use each function name only once: can't redo a check because
|
349 |
|
|
# autoconf caches the results of the last check and won't redo it.
|
350 |
|
|
# 3. Use -lnsl and -lsocket only if they supply procedures that
|
351 |
|
|
# aren't already present in the normal libraries. This is because
|
352 |
|
|
# IRIX 5.2 has libraries, but they aren't needed and they're
|
353 |
|
|
# bogus: they goof up name resolution if used.
|
354 |
|
|
# 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
|
355 |
|
|
# To get around this problem, check for both libraries together
|
356 |
|
|
# if -lsocket doesn't work by itself.
|
357 |
|
|
#--------------------------------------------------------------------
|
358 |
|
|
|
359 |
|
|
AC_CHECK_LIB(Xbsd, main, [LIBS="$LIBS -lXbsd"])
|
360 |
|
|
|
361 |
|
|
itk_checkBoth=0
|
362 |
|
|
AC_CHECK_FUNC(connect, itk_checkSocket=0, itk_checkSocket=1)
|
363 |
|
|
if test "$itk_checkSocket" = 1; then
|
364 |
|
|
AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", itk_checkBoth=1)
|
365 |
|
|
fi
|
366 |
|
|
if test "$itk_checkBoth" = 1; then
|
367 |
|
|
itk_oldLibs=$LIBS
|
368 |
|
|
LIBS="$LIBS -lsocket -lnsl"
|
369 |
|
|
AC_CHECK_FUNC(accept, itk_checkNsl=0, [LIBS=$itk_oldLibs])
|
370 |
|
|
fi
|
371 |
|
|
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
|
372 |
|
|
|
373 |
|
|
#--------------------------------------------------------------------
|
374 |
|
|
# One more check related to the X libraries. The standard releases
|
375 |
|
|
# of Ultrix don't support the "xauth" mechanism, so send won't work
|
376 |
|
|
# unless TK_NO_SECURITY is defined. However, there are usually copies
|
377 |
|
|
# of the MIT X server available as well, which do support xauth.
|
378 |
|
|
# Check for the MIT stuff and use it if it exists.
|
379 |
|
|
#
|
380 |
|
|
# Note: can't use ac_check_lib macro (at least, not in Autoconf 2.1)
|
381 |
|
|
# because it can't deal with the "-" in the library name.
|
382 |
|
|
#--------------------------------------------------------------------
|
383 |
|
|
|
384 |
|
|
if test -d /usr/include/mit ; then
|
385 |
|
|
AC_MSG_CHECKING([MIT X libraries])
|
386 |
|
|
itk_oldCFlags=$CFLAGS
|
387 |
|
|
CFLAGS="$CFLAGS -I/usr/include/mit"
|
388 |
|
|
itk_oldLibs=$LIBS
|
389 |
|
|
LIBS="$LIBS -lX11-mit"
|
390 |
|
|
AC_TRY_LINK([
|
391 |
|
|
#include
|
392 |
|
|
], [
|
393 |
|
|
XOpenDisplay(0);
|
394 |
|
|
], [
|
395 |
|
|
AC_MSG_RESULT(yes)
|
396 |
|
|
XLIBSW="-lX11-mit"
|
397 |
|
|
XINCLUDES="-I/usr/include/mit"
|
398 |
|
|
], AC_MSG_RESULT(no))
|
399 |
|
|
CFLAGS=$itk_oldCFlags
|
400 |
|
|
LIBS=$itk_oldLibs
|
401 |
|
|
fi
|
402 |
|
|
|
403 |
|
|
#--------------------------------------------------------------------
|
404 |
|
|
# On a few very rare systems, all of the libm.a stuff is
|
405 |
|
|
# already in libc.a. Set compiler flags accordingly.
|
406 |
|
|
# Also, Linux requires the "ieee" library for math to
|
407 |
|
|
# work right (and it must appear before "-lm").
|
408 |
|
|
#--------------------------------------------------------------------
|
409 |
|
|
|
410 |
|
|
MATH_LIBS=""
|
411 |
|
|
AC_CHECK_FUNC(sin, , MATH_LIBS="-lm")
|
412 |
|
|
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
|
413 |
|
|
|
414 |
|
|
#--------------------------------------------------------------------
|
415 |
|
|
# If this system doesn't have a memmove procedure, use memcpy
|
416 |
|
|
# instead.
|
417 |
|
|
#--------------------------------------------------------------------
|
418 |
|
|
|
419 |
|
|
AC_CHECK_FUNC(memmove, , [AC_DEFINE(memmove, memcpy)])
|
420 |
|
|
|
421 |
|
|
#--------------------------------------------------------------------
|
422 |
|
|
# Figure out whether "char" is unsigned. If so, set a
|
423 |
|
|
# #define for __CHAR_UNSIGNED__.
|
424 |
|
|
#--------------------------------------------------------------------
|
425 |
|
|
|
426 |
|
|
#AC_C_CHAR_UNSIGNED
|
427 |
|
|
|
428 |
|
|
#--------------------------------------------------------------------
|
429 |
|
|
# Under Solaris 2.4, strtod returns the wrong value for the
|
430 |
|
|
# terminating character under some conditions. Check for this
|
431 |
|
|
# and if the problem exists use a substitute procedure
|
432 |
|
|
# "fixstrtod" (provided by Tcl) that corrects the error.
|
433 |
|
|
#--------------------------------------------------------------------
|
434 |
|
|
|
435 |
|
|
AC_CHECK_FUNC(strtod, itk_strtod=1, itk_strtod=0)
|
436 |
|
|
if test "$itk_strtod" = 1; then
|
437 |
|
|
AC_MSG_CHECKING([for Solaris 2.4 strtod bug])
|
438 |
|
|
AC_TRY_RUN([
|
439 |
|
|
extern double strtod();
|
440 |
|
|
int main()
|
441 |
|
|
{
|
442 |
|
|
char *string = "NaN";
|
443 |
|
|
char *term;
|
444 |
|
|
strtod(string, &term);
|
445 |
|
|
if ((term != string) && (term[-1] == 0)) {
|
446 |
|
|
exit(1);
|
447 |
|
|
}
|
448 |
|
|
exit(0);
|
449 |
|
|
}], itk_ok=1, itk_ok=0, itk_ok=0)
|
450 |
|
|
if test "$itk_ok" = 1; then
|
451 |
|
|
AC_MSG_RESULT(ok)
|
452 |
|
|
else
|
453 |
|
|
AC_MSG_RESULT(buggy)
|
454 |
|
|
AC_DEFINE(strtod, fixstrtod)
|
455 |
|
|
fi
|
456 |
|
|
fi
|
457 |
|
|
|
458 |
|
|
#--------------------------------------------------------------------
|
459 |
|
|
# If we are building with cygwin, we need one set of library names,
|
460 |
|
|
# otherwise, we need the Source-Navigator set.
|
461 |
|
|
#--------------------------------------------------------------------
|
462 |
|
|
|
463 |
|
|
|
464 |
|
|
|
465 |
|
|
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
|
466 |
|
|
CYGITKLIBSPEC=itk${VERSION}
|
467 |
|
|
else
|
468 |
|
|
CYGITKLIBSPEC="itk`echo ${VERSION} | tr -d .`"
|
469 |
|
|
fi
|
470 |
|
|
CYGITKLIB=lib${CYGITKLIBSPEC}.a
|
471 |
|
|
CYGITKDLL=cygitk${VERSION}.dll
|
472 |
|
|
CYGITKWISH=cygitkwish${VERSION}.exe
|
473 |
|
|
CYGITKDEF=itkcyg.def
|
474 |
|
|
CYGITKTEST=cygitktest.exe
|
475 |
|
|
CYGIMPORTLIB=cygitk${VERSION}.lib
|
476 |
|
|
CYGITKRES=cygitk.o
|
477 |
|
|
CYGITKWISHRES=cygitkwish.o
|
478 |
|
|
|
479 |
|
|
SNITKLIBSPEC=itk30.lib
|
480 |
|
|
SNITKLIB=${SNITKLIBSPEC}
|
481 |
|
|
SNITKDLL=snitk30.dll
|
482 |
|
|
SNITKWISH=snitkwish30.exe
|
483 |
|
|
SNITKDEF=itksn.def
|
484 |
|
|
SNITKTEST=snitktest.exe
|
485 |
|
|
SNIMPORTLIB=snitk30.lib
|
486 |
|
|
SNITKRES=snitk.obj
|
487 |
|
|
SNITKWISHRES=snitksh.obj
|
488 |
|
|
|
489 |
|
|
if test "$GCC" = yes; then
|
490 |
|
|
ITKLIBSPEC=${CYGITKLIBSPEC}
|
491 |
|
|
ITKLIB=${CYGITKLIB}
|
492 |
|
|
ITKDLL=${CYGITKDLL}
|
493 |
|
|
ITKWISH=${CYGITKWISH}
|
494 |
|
|
ITKDEF=${CYGITKDEF}
|
495 |
|
|
ITKTEST=${CYGITKTEST}
|
496 |
|
|
ITKIMPORTLIB=${CYGIMPORTLIB}
|
497 |
|
|
ITKRES=${CYGITKRES}
|
498 |
|
|
ITKWISHRES=${CYGITKWISHRES}
|
499 |
|
|
else
|
500 |
|
|
ITKLIBSPEC=${SNITKLIBSPEC}
|
501 |
|
|
ITKLIB=${SNITKLIB}
|
502 |
|
|
ITKDLL=${SNITKDLL}
|
503 |
|
|
ITKWISH=${SNITKWISH}
|
504 |
|
|
ITKDEF=${SNITKDEF}
|
505 |
|
|
ITKTEST=${SNITKTEST}
|
506 |
|
|
ITKIMPORTLIB=${SNIMPORTLIB}
|
507 |
|
|
ITKRES=${SNITKRES}
|
508 |
|
|
ITKWISHRES=${SNITKWISHRES}
|
509 |
|
|
fi
|
510 |
|
|
|
511 |
|
|
#--------------------------------------------------------------------
|
512 |
|
|
# The statements below define a collection of symbols related to
|
513 |
|
|
# building libitk as a shared library instead of a static library.
|
514 |
|
|
#--------------------------------------------------------------------
|
515 |
|
|
|
516 |
|
|
AC_ARG_ENABLE(shared,
|
517 |
|
|
[ --enable-shared build libitk as a shared library],
|
518 |
|
|
[ok=$enableval], [ok=no])
|
519 |
|
|
if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
|
520 |
|
|
ITK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
|
521 |
|
|
eval "ITK_LIB_FILE=libitk${VERSION}${SHLIB_SUFFIX}"
|
522 |
|
|
ITK_PKG_FILE="[[file join [file dirname \$dir] ${ITK_LIB_FILE}]]"
|
523 |
|
|
MAKE_LIB="\${SHLIB_LD} -o ${ITK_LIB_FILE} ${LIBS} \${OBJS} ${SHLIB_LD_LIBS}"
|
524 |
|
|
RANLIB=":"
|
525 |
|
|
else
|
526 |
|
|
ITK_SHLIB_CFLAGS=""
|
527 |
|
|
eval "ITK_LIB_FILE=libitk${VERSION}.a"
|
528 |
|
|
ITK_PKG_FILE=""
|
529 |
|
|
MAKE_LIB="ar cr ${ITK_LIB_FILE} \${OBJS}"
|
530 |
|
|
fi
|
531 |
|
|
|
532 |
|
|
# Note: in the following variable, it's important to use the absolute
|
533 |
|
|
# path name of the Tcl directory rather than "..": this is because
|
534 |
|
|
# AIX remembers this path and will attempt to use it at run-time to look
|
535 |
|
|
# up the Tcl library.
|
536 |
|
|
|
537 |
|
|
if test "$GCC" = yes; then
|
538 |
|
|
ITK_BUILD_LIB_SPEC="-L`pwd` -l${ITKLIBSPEC}"
|
539 |
|
|
ITK_LIB_SPEC="-L${exec_prefix}/lib/ITK -l{ITKLIBSPEC}"
|
540 |
|
|
ITK_LIB_FULL_PATH="`pwd`/${ITKLIB}"
|
541 |
|
|
else
|
542 |
|
|
tmp="`pwd`/${ITKLIB}"
|
543 |
|
|
tmp2="`cygpath --windows $tmp`"
|
544 |
|
|
ITK_BUILD_LIB_SPEC="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
|
545 |
|
|
ITK_LIB_FULL_PATH=${ITK_BUILD_LIB_SPEC}
|
546 |
|
|
tmp="${exec_prefix}/lib/ITK/${ITKLIB}"
|
547 |
|
|
tmp2="`cygpath --windows $tmp`"
|
548 |
|
|
ITK_LIB_SPEC="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
|
549 |
|
|
fi
|
550 |
|
|
|
551 |
|
|
if test "$GCC" = yes; then
|
552 |
|
|
BASELIBS="-lkernel32 $optlibs -ladvapi32 -luser32"
|
553 |
|
|
WINLIBS="-lgdi32 -lcomdlg32 -lwinspool"
|
554 |
|
|
LIBCDLL=
|
555 |
|
|
else
|
556 |
|
|
BASELIBS="kernel32.lib advapi32.lib user32.lib"
|
557 |
|
|
WINLIBS="gdi32.lib comdlg32.lib winspool.lib"
|
558 |
|
|
LIBCDLL="msvcrt.lib oldnames.lib"
|
559 |
|
|
fi
|
560 |
|
|
|
561 |
|
|
AC_SUBST(CFLAGS)
|
562 |
|
|
AC_SUBST(DL_LIBS)
|
563 |
|
|
AC_SUBST(LD_FLAGS)
|
564 |
|
|
AC_SUBST(MATH_LIBS)
|
565 |
|
|
AC_SUBST(MAKE_LIB)
|
566 |
|
|
AC_SUBST(SHLIB_CFLAGS)
|
567 |
|
|
AC_SUBST(SHLIB_LD)
|
568 |
|
|
AC_SUBST(SHLIB_LD_LIBS)
|
569 |
|
|
AC_SUBST(SHLIB_SUFFIX)
|
570 |
|
|
AC_SUBST(SHLIB_VERSION)
|
571 |
|
|
AC_SUBST(TCL_BIN_DIR)
|
572 |
|
|
AC_SUBST(TCL_BUILD_LIB_SPEC)
|
573 |
|
|
AC_SUBST(TCL_SRC_DIR)
|
574 |
|
|
AC_SUBST(TCL_VERSION)
|
575 |
|
|
AC_SUBST(TCL_LIB_FILE)
|
576 |
|
|
AC_SUBST(TCL_LIB_FULL_PATH)
|
577 |
|
|
AC_SUBST(TK_BIN_DIR)
|
578 |
|
|
AC_SUBST(TK_BUILD_LIB_SPEC)
|
579 |
|
|
AC_SUBST(TK_SRC_DIR)
|
580 |
|
|
AC_SUBST(TK_VERSION)
|
581 |
|
|
AC_SUBST(TK_LIB_FILE)
|
582 |
|
|
AC_SUBST(TK_LIB_FULL_PATH)
|
583 |
|
|
AC_SUBST(ITCL_BIN_DIR)
|
584 |
|
|
AC_SUBST(ITCL_BUILD_LIB_SPEC)
|
585 |
|
|
AC_SUBST(ITCL_MAJOR_VERSION)
|
586 |
|
|
AC_SUBST(ITCL_MINOR_VERSION)
|
587 |
|
|
AC_SUBST(ITCL_SRC_DIR)
|
588 |
|
|
AC_SUBST(ITCL_VERSION)
|
589 |
|
|
AC_SUBST(ITCL_LIB_FILE)
|
590 |
|
|
AC_SUBST(ITCL_LIB_FULL_PATH)
|
591 |
|
|
AC_SUBST(ITK_BUILD_LIB_SPEC)
|
592 |
|
|
AC_SUBST(ITK_LD_SEARCH_FLAGS)
|
593 |
|
|
AC_SUBST(ITK_LIB_FILE)
|
594 |
|
|
AC_SUBST(ITK_LIB_FULL_PATH)
|
595 |
|
|
AC_SUBST(ITK_LIB_SPEC)
|
596 |
|
|
AC_SUBST(ITK_PKG_FILE)
|
597 |
|
|
AC_SUBST(ITK_SHLIB_CFLAGS)
|
598 |
|
|
AC_SUBST(ITK_SRC_DIR)
|
599 |
|
|
AC_SUBST(XINCLUDES)
|
600 |
|
|
AC_SUBST(XLIBSW)
|
601 |
|
|
AC_SUBST(CYGITKLIB)
|
602 |
|
|
AC_SUBST(CYGITKDLL)
|
603 |
|
|
AC_SUBST(CYGITKWISH)
|
604 |
|
|
AC_SUBST(CYGITKDEF)
|
605 |
|
|
AC_SUBST(CYGITKTEST)
|
606 |
|
|
AC_SUBST(CYGIMPORTLIB)
|
607 |
|
|
AC_SUBST(CYGITKRES)
|
608 |
|
|
AC_SUBST(CYGITKWISHRES)
|
609 |
|
|
AC_SUBST(SNITKLIB)
|
610 |
|
|
AC_SUBST(SNITKDLL)
|
611 |
|
|
AC_SUBST(SNITKWISH)
|
612 |
|
|
AC_SUBST(SNITKDEF)
|
613 |
|
|
AC_SUBST(SNITKTEST)
|
614 |
|
|
AC_SUBST(SNIMPORTLIB)
|
615 |
|
|
AC_SUBST(SNITKRES)
|
616 |
|
|
AC_SUBST(SNITKWISHRES)
|
617 |
|
|
AC_SUBST(ITKLIB)
|
618 |
|
|
AC_SUBST(ITKDLL)
|
619 |
|
|
AC_SUBST(ITKWISH)
|
620 |
|
|
AC_SUBST(ITKDEF)
|
621 |
|
|
AC_SUBST(ITKTEST)
|
622 |
|
|
AC_SUBST(ITKIMPORTLIB)
|
623 |
|
|
AC_SUBST(ITKRES)
|
624 |
|
|
AC_SUBST(ITKWISHRES)
|
625 |
|
|
AC_SUBST(BASELIBS)
|
626 |
|
|
AC_SUBST(WINLIBS)
|
627 |
|
|
AC_SUBST(LIBCDLL)
|
628 |
|
|
|
629 |
|
|
AC_OUTPUT(Makefile ../unix/pkgIndex.tcl ../itkConfig.sh)
|
630 |
|
|
|