Debian Codegraph @

pTk/mTk/tixUnix/itcl3.1/configure.in

raw
1 dnl $Id: configure.in,v 1.1 2000/11/03 00:27:15 idiscovery Exp $
2 dnl This file is an input file used by the GNU "autoconf" program to
3 dnl generate the file "configure", which is run to configure the
4 dnl Makefile in this directory.
5
6 AC_INIT(../../generic/tixInit.c)
7
8 #--------------------------------------------------------------------
9 # Remove the ./config.cache file and rerun configure if
10 # the cache file belong to a different architecture
11 #----------------------------------------------------------------------
12 AC_CHECK_PROG(UNAME, uname -a, [uname -a], "")
13 if test "$UNAME" = ""; then
14 AC_CHECK_PROG(UNAME, uname, [uname], "")
15 fi
16
17 if test "$UNAME" != ""; then
18 uname=`$UNAME`
19 AC_MSG_CHECKING([cached value of \$uname])
20 AC_CACHE_VAL(ac_cv_prog_uname, [nocached=1 ac_cv_prog_uname=`$UNAME`])
21 if test "$nocached" = "1"; then
22 AC_MSG_RESULT(no)
23 else
24 AC_MSG_RESULT(yes)
25 fi
26
27 if test "$uname" != "$ac_cv_prog_uname"; then
28 echo "Running on a different machine/architecture. Can't use cached values"
29 echo "Removing config.cache and running configure again ..."
30 rm -f config.cache
31 CMDLINE="$0 $*"
32 exec $CMDLINE
33 fi
34 fi
35
36 #----------------------------------------------------------------------
37 # We don't want to use any relative path because we need to generate
38 # Makefile's in subdirectories
39 #----------------------------------------------------------------------
40 if test "$INSTALL" = "./install.sh"; then
41 INSTALL=`pwd`/install.sh
42 fi
43
44 # Itcl version number.
45 ITCL_VERSION=3.1
46 ITCL_MAJOR_VERSION=3
47 ITCL_MINOR_VERSION=2
48
49 #--------------------------------------------------------------------
50 # Version information about this TIX release.
51 #--------------------------------------------------------------------
52
53 TIX_VERSION=8.1
54 TIX_MAJOR_VERSION=8
55 TIX_MINOR_VERSION=1
56
57 #--------------------------------------------------------------------
58 # See if user wants to use gcc to compile Tix. This option must
59 # be used before any checking that uses the C compiler.
60 #--------------------------------------------------------------------
61
62 AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
63 [tix_ok=$enableval], [tix_ok=no])
64 if test "$tix_ok" = "yes"; then
65 AC_PROG_CC
66 else
67 CC=${CC-cc}
68 AC_SUBST(CC)
69 fi
70
71 AC_PROG_INSTALL
72 AC_PROG_RANLIB
73 AC_HAVE_HEADERS(unistd.h limits.h)
74 AC_PROG_MAKE_SET
75
76 #--------------------------------------------------------------------
77 # unsigned char is not supported by some non-ANSI compilers.
78 #--------------------------------------------------------------------
79
80 AC_MSG_CHECKING([unsigned char])
81 AC_TRY_COMPILE([#include <stdio.h>],[
82 unsigned char c = 'c';
83 ], tcl_ok=supported, tcl_ok=notsupported)
84
85 AC_MSG_RESULT($tcl_ok)
86 if test $tcl_ok = supported; then
87 AC_DEFINE(UCHAR_SUPPORTED)
88 fi
89
90 #--------------------------------------------------------------------
91 # Check whether there is an strcasecmp function on this system.
92 # This is a bit tricky because under SCO it's in -lsocket and
93 # under Sequent Dynix it's in -linet.
94 #--------------------------------------------------------------------
95
96 AC_CHECK_FUNC(strcasecmp, tcl_ok=1, tcl_ok=0)
97 if test "$tcl_ok" = 0; then
98 AC_CHECK_LIB(socket, strcasecmp, tcl_ok=1, tcl_ok=0)
99 fi
100 if test "$tcl_ok" = 0; then
101 AC_CHECK_LIB(inet, strcasecmp, tcl_ok=1, tcl_ok=0)
102 fi
103 if test "$tcl_ok" = 0; then
104 AC_DEFINE(NO_STRCASECMP)
105 fi
106
107 #--------------------------------------------------------------------
108 # See if there was a command-line option for where ITcl is; if
109 # not, assume that its top-level directory is a sibling of ours.
110 #--------------------------------------------------------------------
111
112 AC_ARG_WITH(itcl, [ --with-itcl=DIR use ITcl 3.1 source from DIR],
113 val=$withval, val="")
114
115 AC_MSG_CHECKING([ITcl source directory])
116
117 if test "$val" != ""; then
118 ITCL_SRC_DIR=$val
119 if test ! -d $ITCL_SRC_DIR; then
120 AC_MSG_ERROR(Directory $ITCL_SRC_DIR doesn't exist)
121 AC_MSG_ERROR(Please install the source code of ITcl 3.1)
122 exit 1
123 fi
124 else
125 dirs="../../../itcl3.1"
126 ITCL_SRC_DIR="no-no"
127 for i in $dirs; do
128 if test -d $i; then
129 ITCL_SRC_DIR=`cd $i; pwd`
130 fi
131 done
132
133 if test ! -d $ITCL_SRC_DIR; then
134 AC_MSG_ERROR(Cannot locate ITcl source directory in $dirs)
135 AC_MSG_ERROR(Please install the source code of ITcl 3.1)
136 exit 1
137 fi
138 fi
139 AC_MSG_RESULT($ITCL_SRC_DIR)
140
141 ITCL_ROOT_DIR=$ITCL_SRC_DIR
142
143 # Check for Tcl and Tk.
144 CYG_AC_PATH_TCLCONFIG
145 CYG_AC_LOAD_TCLCONFIG
146 CYG_AC_PATH_TKCONFIG
147 CYG_AC_LOAD_TKCONFIG
148 CYG_AC_PATH_TCLH
149 # FIXME: consider only doing this if --with-x given.
150 CYG_AC_PATH_TKH
151
152 BIN_VERSION=${TIX_VERSION}.${TCL_VERSION}
153 VERSION=${BIN_VERSION}
154
155 #--------------------------------------------------------------------
156 # Find out the top level source directory of the Tix package.
157 #--------------------------------------------------------------------
158 TIX_SRC_DIR=`cd ${srcdir}/../..; pwd`
159
160 #--------------------------------------------------------------------
161 # See if we should compile SAM
162 #--------------------------------------------------------------------
163
164 AC_ARG_ENABLE(sam,
165 [ --enable-sam build stand-alone modules],
166 [ok=$enableval], [ok=no])
167
168 if test "$ok" = "yes"; then
169 TIX_BUILD_SAM="yes"
170 TIX_SAM_TARGETS='$(SAM_TARGETS)'
171 else
172 TIX_BUILD_SAM="no"
173 fi
174
175 TIX_SAM_INSTALL=_install_sam_lib_
176
177 AC_DEFINE(ITCL_2)
178 AC_DEFINE(ITCL_3)
179 IS_ITCL=1
180 TIX_EXE_FILE=tixwish
181 TCL_SAMEXE_FILE=satclsh
182 TK_SAMEXE_FILE=sawish
183 TIX_SAMEXE_FILE=satixwish
184
185 #--------------------------------------------------------------------
186 # Read in configuration information generated by Tcl for shared
187 # libraries, and arrange for it to be substituted into our
188 # Makefile.
189 #--------------------------------------------------------------------
190
191 CC=$TCL_CC
192 SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
193 SHLIB_LD=$TCL_SHLIB_LD
194 SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
195 SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
196 SHLIB_VERSION=$TCL_SHLIB_VERSION
197
198 DL_LIBS=$TCL_DL_LIBS
199 LD_FLAGS=$TCL_LD_FLAGS
200 TIX_LD_SEARCH_FLAGS=$TK_LD_SEARCH_FLAGS
201
202 #--------------------------------------------------------------------
203 # Read in configuration information generated by Tk and arrange
204 # for it to be substituted into our Makefile.
205 #--------------------------------------------------------------------
206
207 TIX_DEFS="$TK_DEFS $TCL_DEFS"
208
209 # Note: in the following variable, it's important to use the absolute
210 # path name of the Tcl directory rather than "..": this is because
211 # AIX remembers this path and will attempt to use it at run-time to look
212 # up the Tcl library.
213
214 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
215 TIX_BUILD_LIB_SPEC="-L`pwd` -ltix${VERSION}"
216 TIX_BUILD_SAM_SPEC="-L`pwd` -ltixsam${VERSION}"
217 TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam${TCL_VERSION}"
218 TK_BUILD_SAM_SPEC="-L`pwd` -ltksam${TK_VERSION}"
219 TIX_LIB_SPEC="-L${exec_prefix}/lib -ltix${VERSION}"
220 else
221 TIX_BUILD_LIB_SPEC="-L`pwd` -ltix`echo ${VERSION} | tr -d .`"
222 TIX_BUILD_SAM_SPEC="-L`pwd` -ltixsam`echo ${VERSION} | tr -d .`"
223 TCL_BUILD_SAM_SPEC="-L`pwd` -ltclsam`echo ${TCL_VERSION} | tr -d .`"
224 TK_BUILD_SAM_SPEC="-L`pwd` -ltksam`echo ${TK_VERSION} | tr -d .`"
225 TIX_LIB_SPEC="-L${exec_prefix}/lib -ltix`echo ${VERSION} | tr -d .`"
226 fi
227
228 #--------------------------------------------------------------------
229 # See if we should compile shared library.
230 #--------------------------------------------------------------------
231
232 AC_ARG_ENABLE(shared,
233 [ --enable-shared build libtix as a shared library],
234 [ok=$enableval], [ok=no])
235
236 if test "$ok" = "yes" -a "${SHLIB_SUFFIX}" != ""; then
237 TIX_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
238 TIX_RANLIB=":"
239
240 # The main Tix library
241 #
242 eval "TIX_LIB_FILE=libtix${TCL_SHARED_LIB_SUFFIX}"
243 TIX_MAKE_LIB="\${SHLIB_LD} -o ${TIX_LIB_FILE} \${OBJS} ${SHLIB_LD_LIBS}"
244
245 # The Tcl SAM library
246 #
247 VERSION=${TCL_VERSION}
248 eval "TCL_SAM_FILE=libtclsam${TCL_SHARED_LIB_SUFFIX}"
249 TCL_MAKE_SAM="\${SHLIB_LD} -o ${TCL_SAM_FILE} \${TCL_SAM_OBJS} ${SHLIB_LD_LIBS}"
250
251 # The Tk SAM library
252 #
253 VERSION=${TCL_VERSION}
254 eval "TK_SAM_FILE=libtksam${TCL_SHARED_LIB_SUFFIX}"
255 TK_MAKE_SAM="\${SHLIB_LD} -o ${TK_SAM_FILE} \${TK_SAM_OBJS} ${SHLIB_LD_LIBS}"
256
257 # The Tix SAM library
258 #
259 VERSION=${BIN_VERSION}
260 eval "TIX_SAM_FILE=libtixsam${TCL_SHARED_LIB_SUFFIX}"
261 TIX_MAKE_SAM="\${SHLIB_LD} -o ${TIX_SAM_FILE} \${TIX_SAM_OBJS} ${SHLIB_LD_LIBS}"
262
263 else
264 TIX_SHLIB_CFLAGS=""
265 TIX_RANLIB='$(RANLIB)'
266
267 # The main Tix library
268 #
269 eval "TIX_LIB_FILE=libtix${TCL_UNSHARED_LIB_SUFFIX}"
270 TIX_MAKE_LIB="ar cr ${TIX_LIB_FILE} \${OBJS}"
271
272 # The Tcl SAM library
273
274 VERSION=${TCL_VERSION}
275 eval "TCL_SAM_FILE=libtclsam${TCL_UNSHARED_LIB_SUFFIX}"
276 TCL_MAKE_SAM="ar cr ${TCL_SAM_FILE} \${TCL_SAM_OBJS}"
277
278 # The Tk SAM library
279 #
280 VERSION=${TCL_VERSION}
281 eval "TK_SAM_FILE=libtksam${TCL_UNSHARED_LIB_SUFFIX}"
282 TK_MAKE_SAM="ar cr ${TK_SAM_FILE} \${TK_SAM_OBJS}"
283
284 # The Tix SAM library
285 #
286 VERSION=${BIN_VERSION}
287 eval "TIX_SAM_FILE=libtixsam${TCL_UNSHARED_LIB_SUFFIX}"
288 TIX_MAKE_SAM="ar cr ${TIX_SAM_FILE} \${TIX_SAM_OBJS}"
289 fi
290
291 ITCL_LIB_FILE=libitcl${ITCL_VERSION}.a
292 ITCL_BUILD_LIB_SPEC='-L$(ITCL_ROOT_DIR)/itcl -litcl${ITCL_VERSION}'
293 #--------------------------------------------------------------------
294 # Read in configuration information generated by ITcl
295 # and arrange for it to be substituted into our Makefile.
296 # This seems to be missing in itcl 3.1, so provide defaults
297 #--------------------------------------------------------------------
298 file=$ITCL_ROOT_DIR/itcl/unix/itclConfig.sh
299 if test -f $file ; then
300 . $file
301 else
302 echo "$file not found - using default library values..."
303 fi
304
305 ITK_LIB_FILE=libitk${ITCL_VERSION}.a
306 ITK_BUILD_LIB_SPEC='-L$(ITCL_ROOT_DIR)/itk -litk${ITCL_VERSION}'
307 #--------------------------------------------------------------------
308 # Read in configuration information generated by ITk
309 # and arrange for it to be substituted into our Makefile.
310 #--------------------------------------------------------------------
311 file=$ITCL_ROOT_DIR/itk/unix/itkConfig.sh
312 if test -f $file ; then
313 . $file
314 else
315 echo "$file not found - using default library values..."
316 fi
317
318 #--------------------------------------------------------------------
319 # Check for the existence of the -lsocket and -lnsl libraries.
320 # The order here is important, so that they end up in the right
321 # order in the command line generated by make. Here are some
322 # special considerations:
323 # 1. Use "connect" and "accept" to check for -lsocket, and
324 # "gethostbyname" to check for -lnsl.
325 # 2. Use each function name only once: can't redo a check because
326 # autoconf caches the results of the last check and won't redo it.
327 # 3. Use -lnsl and -lsocket only if they supply procedures that
328 # aren't already present in the normal libraries. This is because
329 # IRIX 5.2 has libraries, but they aren't needed and they're
330 # bogus: they goof up name resolution if used.
331 # 4. On some SVR4 systems, can't use -lsocket without -lnsl too.
332 # To get around this problem, check for both libraries together
333 # if -lsocket doesn't work by itself.
334 #--------------------------------------------------------------------
335
336 checked=0
337 for i in $TK_LIBS; do
338 if test "$i" = "-lsocket"; then
339 checked=1
340 fi
341 done
342
343 if test "$checked" = "0"; then
344 tcl_checkBoth=0
345 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1)
346 if test "$tcl_checkSocket" = 1; then
347 AC_CHECK_LIB(socket, main, TK_LIBS="$TK_LIBS -lsocket",
348 tcl_checkBoth=1)
349 fi
350 if test "$tcl_checkBoth" = 1; then
351 tk_oldLibs=$TK_LIBS
352 TK_LIBS="$TK_LIBS -lsocket -lnsl"
353 AC_CHECK_FUNC(accept, tcl_checkNsl=0, [TK_LIBS=$tk_oldLibs])
354 fi
355 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main,
356 [TK_LIBS="$TK_LIBS -lnsl"]))
357 fi
358
359 #----------------------------------------------------------------------
360 # Substitution strings exported by TIX
361 #----------------------------------------------------------------------
362 AC_SUBST(SHELL)
363 AC_SUBST(CC)
364 AC_SUBST(RANLIB)
365 AC_SUBST(TIX_RANLIB)
366 AC_SUBST(SHLIB_CFLAGS)
367 AC_SUBST(SHLIB_LD)
368 AC_SUBST(SHLIB_LD_LIBS)
369 AC_SUBST(SHLIB_SUFFIX)
370 AC_SUBST(SHLIB_VERSION)
371 AC_SUBST(DL_LIBS)
372 AC_SUBST(LD_FLAGS)
373 AC_SUBST(TCL_BUILD_LIB_SPEC)
374 AC_SUBST(TCL_LIBS)
375 AC_SUBST(TCL_VERSION)
376 AC_SUBST(TCL_SRC_DIR)
377 AC_SUBST(TCL_BIN_DIR)
378 AC_SUBST(ITCL_BUILD_LIB_SPEC)
379 AC_SUBST(TK_BUILD_LIB_SPEC)
380 AC_SUBST(TK_LIBS)
381 AC_SUBST(TK_VERSION)
382 AC_SUBST(TK_SRC_DIR)
383 AC_SUBST(TK_BIN_DIR)
384 AC_SUBST(TK_XINCLUDES)
385 AC_SUBST(ITK_BUILD_LIB_SPEC)
386 AC_SUBST(TIX_LD_SEARCH_FLAGS)
387 AC_SUBST(TIX_MAJOR_VERSION)
388 AC_SUBST(TIX_MINOR_VERSION)
389 AC_SUBST(TIX_VERSION)
390 AC_SUBST(TIX_SRC_DIR)
391 AC_SUBST(TIX_SHLIB_CFLAGS)
392 AC_SUBST(TIX_MAKE_LIB)
393 AC_SUBST(TIX_LIB_FILE)
394 AC_SUBST(TIX_BUILD_LIB_SPEC)
395 AC_SUBST(TIX_LIB_SPEC)
396 AC_SUBST(TIX_EXE_FILE)
397 AC_SUBST(TIX_SAM_TARGETS)
398 AC_SUBST(TIX_SAM_INSTALL)
399 AC_SUBST(TCL_SAM_FILE)
400 AC_SUBST(TCL_MAKE_SAM)
401 AC_SUBST(TK_SAM_FILE)
402 AC_SUBST(TK_MAKE_SAM)
403 AC_SUBST(TIX_SAM_FILE)
404 AC_SUBST(TIX_MAKE_SAM)
405 AC_SUBST(TIX_DEFS)
406 AC_SUBST(ITCL_BUILD_LIB_SPEC)
407 AC_SUBST(ITK_BUILD_LIB_SPEC)
408 AC_SUBST(ITCL_VERSION)
409 AC_SUBST(TCL_SAMEXE_FILE)
410 AC_SUBST(TK_SAMEXE_FILE)
411 AC_SUBST(TIX_SAMEXE_FILE)
412 AC_SUBST(TCL_BUILD_SAM_SPEC)
413 AC_SUBST(TK_BUILD_SAM_SPEC)
414 AC_SUBST(TIX_BUILD_SAM_SPEC)
415 AC_SUBST(TCL_PACKAGE_PATH)
416
417 # The "binary version" of Tix (see docs/Pkg.txt)
418 TIX_VERSION_PKG=${BIN_VERSION}
419 AC_SUBST(TIX_VERSION_PKG)
420
421 TIXSAM_PKG_FILE="[[file join [file dirname \$dir] ${TIX_SAM_FILE}]]"
422 # Add this anyway as we are building the SAM library, and it wont hurt
423 # if test "$TIX_BUILD_SAM" = "yes"; then
424 TIX_SAM_PACKAGE_IFNEEDED="package ifneeded Tixsam ${TIX_VERSION_PKG} [[list load \"${TIXSAM_PKG_FILE}\" Tixsam]]"
425 # fi
426
427 # The package file, usually a shared library
428 TIX_PKG_FILE="[[file join [file dirname \$dir] ${TIX_LIB_FILE}]]"
429 AC_SUBST(TIX_PKG_FILE)
430 AC_SUBST(TIX_SAM_PACKAGE_IFNEEDED)
431
432 AC_SUBST(ITCL_ROOT_DIR)
433
434 AC_OUTPUT(Makefile pkgIndex.tcl ../../tixConfig.sh)
435