Debian Codegraph @

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

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