Debian Codegraph @

pTk/mTk/tixUnix/tk8.0/configure.in

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