1 diff -durN expect-5.39.orig/configure.in expect-5.39/configure.in
2 --- expect-5.39.orig/configure.in 2004-12-28 16:49:51.000000000 +0000
3 +++ expect-5.39/configure.in 2004-12-28 16:53:24.019681264 +0000
7 EXP_BUILD_LIB_SPEC="-L`pwd` -lexpect${EXP_LIB_VERSION}${DBGX}"
8 -EXP_LIB_SPEC="-L\${INSTALL_ROOT}\${exec_prefix}/lib -lexpect${EXP_LIB_VERSION}${DBGX}"
9 +EXP_LIB_SPEC="-L\${INSTALL_ROOT}\${exec_prefix}/lib64 -lexpect${EXP_LIB_VERSION}${DBGX}"
10 EXP_UNSHARED_LIB_FILE=libexpect${EXP_LIB_VERSION}${DBGX}.a
12 # The TCL_SHARED_LIB_SUFFIX macro below relies on the DBGX macro,
13 diff -durN expect-5.39.orig/configure.in~ expect-5.39/configure.in~
14 --- expect-5.39.orig/configure.in~ 1970-01-01 00:00:00.000000000 +0000
15 +++ expect-5.39/configure.in~ 2004-12-28 16:49:51.223031272 +0000
17 +# Process this file with autoconf to produce a configure script.
19 +# while Expect is in alpha/beta, disable caching so as not to confuse
20 +# people trying to fix configure bugs
21 +define([AC_CACHE_LOAD], )
22 +define([AC_CACHE_SAVE], )
26 +# note when updating version numbers here, also update pkgIndex.in (see
27 +# comments in Makefile)
31 +EXP_VERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSION
32 +EXP_VERSION_NODOTS=$EXP_MAJOR_VERSION$EXP_MINOR_VERSION
33 +EXP_VERSION_FULL=$EXP_VERSION.$EXP_MICRO_VERSION
34 +# Tcl's handling of shared_lib_suffix requires this symbol exist
35 +VERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSION
37 +# Too many people send me configure output without identifying the version.
38 +# This forced identification should reduce my pain significantly.
39 +echo "configuring Expect $EXP_MAJOR_VERSION.$EXP_MINOR_VERSION.$EXP_MICRO_VERSION"
41 +# People (when downloading Expect from CVS archive) sometimes run into
42 +# Make thinking configure is old and needs to be rebuilt. If they
43 +# don't have a clue about autoconf, they get confused. This is
44 +# particular irritating because the problem only crops up after
45 +# configure has successfully completed. Help them out by checking it
46 +# right now and giving some advice. Alas, we cannot summarily fix the
47 +# problem because it might conceivably be someone doing real
49 +# Test if configure is older than configure.in and explain if no autoconf
50 +AC_CHECK_PROG(found,autoconf,yes,no,)
51 +AC_MSG_CHECKING([configure up to date])
52 +for i in `ls -tr ${srcdir}/configure ${srcdir}/configure.in ${srcdir}/Makefile.in` ; do
55 +if test "$srcdir/configure" = "$newest" ; then
60 +if test $found = "no" -a "$newest" != "$srcdir/configure" ; then
61 + AC_MSG_WARN([$srcdir/configure appears to be old ($srcdir/configure.in and/or $srcdir/Makefile.in are newer) and the autoconf program to fix this situation was not found. If you've no idea what this means, enter the command \"touch $srcdir/configure\" and restart $srcdir/configure.])
65 +dnl AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
68 +AC_CONFIG_HEADER(expect_cf.h)
70 +# /bin/sh on some systems is too deficient (in particular, Ultrix 4.3
71 +# sh lacks unset and we *need* that), but all these systems come with
72 +# alternatives, so take user's choice or whatever we're using here and
73 +# allow it to be seen by Make.
74 +AC_MSG_CHECKING([shell to use within Make])
75 +EXP_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
76 +AC_MSG_RESULT($CONFIG_SHELL)
78 +# If `configure' is invoked (in)directly via `make', ensure that it
79 +# encounters no `make' conflicts.
81 +dnl unset MFLAGS MAKEFLAGS
85 +# An explanation is in order for the strange things going on with the
86 +# various LIBS. There are three separate definitions for LIBS. The
87 +# reason is that some systems require shared libraries include
88 +# references to their dependent libraries, i.e., any additional
89 +# libraries that must be linked to. And some systems get upset if the
90 +# references are repeated on the link line. So therefore, we create
91 +# one for Expect and Tk (EXP_AND_TK_LIBS), one for Expect and Tcl
92 +# (EXP_AND_TCL_LIBS), and finally, one for building Expect's own
93 +# shared library. Tcl's tclConfig.sh insists that any shared libs
94 +# that it "helps" build must pass the libraries as LIBS (see comment
95 +# near end of this configure file). I would do but since we're close
96 +# to hitting config's max symbols, we take one short cut and pack the
97 +# LIBS into EXP_SHLIB_LD_LIBS (which is basically what Tcl wants to do
98 +# for us). The point, however, is that there's no separate LIBS or
99 +# EXP_LIBS symbol passed out of configure. One additional point for
100 +# confusion is that LIBS is what configure uses to do all library
101 +# tests, so we have to swap definitions of LIBS peridically. When we
102 +# are swapping out the one for Expect's shared library, we save it in
105 +dnl AC_PROG_CC insists on sticking crap -g and -O in CFLAGS
106 +dnl but I want to control it. Can't just throw it out at the
107 +dnl end alas, because the user might have defined CFLAGS.
112 +#------------------------------------------------------------------------
113 +# Hook for when threading is supported in Expect. The --enable-threads
114 +# flag currently has no effect.
115 +#------------------------------------------------------------------------
119 +CY_AC_PATH_TCLCONFIG
120 +CY_AC_LOAD_TCLCONFIG
122 +EXP_AND_TCL_LIBS=$TCL_LIBS
125 +EXP_AND_TK_LIBS=$TK_LIBS
130 +# this'll use a BSD compatible install or our included install-sh
133 +# Tcl sets TCL_RANLIB appropriately for shared library if --enable-shared
135 +UNSHARED_RANLIB=$RANLIB
137 +# these are the other subdirectories we need to configure
138 +AC_CONFIG_SUBDIRS(testsuite)
140 +# This is for LynxOS, which needs a flag to force true POSIX when
141 +# building. The flag varies depending how old the compiler is.
142 +# -X is for the old "cc" and "gcc" (based on 1.42)
143 +# -mposix is for the new gcc (at least 2.5.8)
144 +# This modifies the value of $CC to have the POSIX flag added
145 +# so it'll configure correctly
146 +CY_AC_TCL_LYNX_POSIX
150 +dnl AC_TIME_WITH_SYS_TIME
154 +AC_ARG_ENABLE(symbols,
155 + [ --enable-symbols allow use of symbols if available],
156 + [enable_symbols=$enableval], [enable_symbols=no])
157 +if test "$enable_symbols" = "no"; then
158 + EXP_CFLAGS="$TCL_EXTRA_CFLAGS"
160 + EXP_CFLAGS="-g $TCL_EXTRA_CFLAGS"
161 + # This is always "g" for unix.
165 + # Use -g on all systems but Linux where it upsets the dynamic X libraries.
166 + i[[3456]]86-*-linux*) EXP_CFLAGS="" ;;
169 +AC_MSG_CHECKING([if running Mach])
172 + # Both Next and pure Mach behave identically with respect
173 + # to a few things, so just lump them together as "mach"
174 + *-*-mach*) mach=1 ;;
175 + *-*-next*) mach=1 ; next=1 ;;
178 +if test $mach -eq 1 ; then
184 +AC_MSG_CHECKING([if running MachTen])
185 +# yet another Mach clone
186 +if test -r /MachTen ; then
193 +AC_MSG_CHECKING([if on Pyramid])
194 +if test -r /bin/pyr ; then
202 +AC_MSG_CHECKING([if on Apollo])
203 +if test -r /usr/apollo/bin ; then
211 +AC_MSG_CHECKING([if on Interactive])
212 +if test "x`(uname -s) 2>/dev/null`" = xIUNIX; then
220 +AC_MSG_CHECKING([if stty reads stdout])
222 +# On some systems stty can't be run in the background (svr4) or get it
223 +# wrong because they fail to complain (next, mach), so don't attempt
224 +# the test on some systems.
226 +stty_reads_stdout=""
228 + *-*-solaris*) stty_reads_stdout=0 ;;
229 + *-*-irix*) stty_reads_stdout=0 ;;
230 + *-*-sco3.2v[[45]]*) stty_reads_stdout=1 ;;
231 + i[[3456]]86-*-sysv4.2MP) stty_reads_stdout=0 ;;
232 + i[[3456]]86-*-linux*) stty_reads_stdout=0 ;;
233 + # Not sure about old convex but 5.2 definitely reads from stdout
234 + c[[12]]-*-*) stty_reads_stdout=1 ;;
235 + *-*-aix[[34]]*) stty_reads_stdout=0 ;;
236 + *-*-hpux9*) stty_reads_stdout=0 ;;
237 + *-*-hpux10*) stty_reads_stdout=0 ;;
238 + *-*-osf[[234]]*) stty_reads_stdout=0 ;;
239 + *-*-ultrix4.4) stty_reads_stdout=0 ;;
240 + *-*-dgux*) stty_reads_stdout=0 ;;
243 +if test $mach -eq 1 ; then
244 + stty_reads_stdout=1
246 +if test $apollo -eq 1 ; then
247 + stty_reads_stdout=1
249 +if test $pyr -eq 1 ; then
250 + stty_reads_stdout=1
253 +# if we still don't know, test
254 +if test x"${stty_reads_stdout}" = x"" ; then
255 + /bin/stty > /dev/null 2> /dev/null
256 + if test $? -ne 0 ; then
257 + stty_reads_stdout=1
259 + stty_reads_stdout=0
263 +if test ${stty_reads_stdout} -eq 1 ; then
265 + AC_DEFINE(STTY_READS_STDOUT)
270 +# Solaris 2.4 and later requires __EXTENSIONS__ in order to see all sorts
271 +# of traditional but nonstandard stuff in header files.
272 +AC_MSG_CHECKING([if running Solaris])
275 + *-*-solaris*) solaris=1;;
278 +if test $solaris -eq 1 ; then
286 +# On a few systems, libm.a is the same as libc.a
287 +# Don't bother to test against Tcl and Tk libs, they always include -lm
288 +AC_CHECK_FUNC(sin, , LIBS="${LIBS} -lm" )
290 +# On Interactive UNIX, -Xp must be added to LIBS in order to find strftime.
291 +# This test should really be done by Tcl. So just check Tcl's definition.
292 +# If defective, add to all three LIBS. (It's not actually necessary for
293 +# EXP_LIBS since -Xp will just be ignored the way that EXP_LIBS is used in
294 +# the Makefile, but we include it for consistency.)
295 +if test $iunix -eq 1 ; then
297 + LIBS=$EXP_AND_TCL_LIBS
298 + AC_CHECK_FUNC(strftime, , [
299 + EXP_LIBS="${LIBS} -Xp"
300 + EXP_AND_TCL_LIBS="${LIBS} -Xp"
301 + EXP_AND_TK_LIBS="${LIBS} -Xp"
307 +# Ok, lets find the tcl source trees so we can use the headers
310 +if test x"$no_tcl" = x"true" ; then
311 + echo " ERROR: Can't find Tcl headers or library."
312 + echo " See README for information on how to obtain Tcl."
313 + echo " If Tcl is installed, see INSTALL on how to tell"
314 + echo " configure where Tcl is installed."
318 +# have to know whether we're generating shared libs before configuring debugger
319 +AC_MSG_CHECKING([type of library to build])
320 +AC_ARG_ENABLE(shared,
321 + [ --enable-shared build libexpect as a shared library],
322 + [enable_shared=$enableval], [enable_shared=no])
323 +if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; then
324 + AC_MSG_RESULT(both shared and unshared)
326 + AC_MSG_RESULT(unshared)
330 +# Now that we've found the Tcl sources, configure the debugger
331 +# this is a little tricky because it has its own configure script
332 +# which produces a Makefile and cf file. We only want the cf file,
333 +# so switch to a temporary directory and run the debugger's configure.
334 +# Then save the cf file and delete the rest.
336 +# Incidentally, the debugger can't depend on Expect's cf file, because
337 +# the debugger is designed to be independent of Expect.
340 +test -n "$verbose" && echo "configuring Tcl debugger"
344 +#if test "${enable_shared+set}" = set; then
345 +if test "${enable_shared}" = "yes"; then
346 + dbg_config_flags='--enable-shared'
348 + dbg_config_flags='--disable-shared'
350 +# (cd;pwd) in next several commands converts relative dirs to absolute.
351 +# This is required because the debugger src is at a different level in
352 +# the filesystem than Expect src (where we are presently), thereby
353 +# making the relative pathnames incorrect.
354 +if test "x$with_tclconfig" != "x" ; then
355 + dbg_config_flags="$dbg_config_flags --with-tclconfig=`(cd ${with_tclconfig}; pwd)`"
357 +if test "x$with_tcllibdir" != "x" ; then
358 + dbg_config_flags="$dbg_config_flags --with-tcllibdir=`(cd ${with_tcllibdir}; pwd)`"
360 +if test "x$with_tcllib" != "x" ; then
361 + dbg_config_flags="$dbg_config_flags --with-tcllib=`(cd ${with_tcllib}; pwd)`"
363 +if test "x$with_tclinclude" != "x" ; then
364 + dbg_config_flags="$dbg_config_flags --with-tclinclude=`(cd ${with_tclinclude}; pwd)`"
366 +case "$cache_file" in
368 + dbg_config_flags="$dbg_config_flags --cache-file=$cache_file"
371 + dbg_config_flags="$dbg_config_flags --cache-file=../$cache_file"
375 +cp ${srcdir}/Dbgconfigure ${srcdir}/tcldbg.h ${srcdir}/tcldbgcf.h.in ${srcdir}/install-sh ${tmpdir}
376 +cp $srcdir/DbgMkfl.in ${tmpdir}/Makefile.in
377 +cp $srcdir/DbgpkgInd.in ${tmpdir}/pkgIndex.in
378 +(cd $tmpdir; ${CONFIG_SHELL-/bin/sh} Dbgconfigure --with-tclinclude=$TCLHDIR $dbg_config_flags)
379 +cp ${tmpdir}/tcldbgcf.h .
381 +test -n "$verbose" && echo "configured Tcl debugger"
383 +# some people would complain if this explanation wasn't provided...
385 +echo "Begin tests for function/library dependencies. Tests may be repeated"
386 +echo "up to three times. First test is for building Expect's shared library."
387 +echo "Second set is for building with Tcl. Third is for building with Tk."
389 +######################################################################
390 +# required by Sequent ptx2
391 +unset ac_cv_func_gethostname
392 +AC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)
393 +if test $gethostname -eq 0 ; then
394 + unset ac_cv_lib_inet_gethostname
395 + AC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")
397 +# save results and retry for Tcl
399 +LIBS=$EXP_AND_TCL_LIBS
400 +unset ac_cv_func_gethostname
401 +AC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)
402 +if test $gethostname -eq 0 ; then
403 + unset ac_cv_lib_inet_gethostname
404 + AC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")
406 +# save Tcl results and retry for Tk
407 +EXP_AND_TCL_LIBS=$LIBS
408 +LIBS=$EXP_AND_TK_LIBS
409 +unset ac_cv_func_gethostname
410 +AC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)
411 +if test $gethostname -eq 0 ; then
412 + unset ac_cv_lib_inet_gethostname
413 + AC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")
415 +# save Tk results and reset for Expect
416 +EXP_AND_TK_LIBS=$LIBS
419 +######################################################################
420 +# required by Fischman's ISC 4.0
421 +unset ac_cv_func_socket
422 +AC_CHECK_FUNC(socket, socket=1 , socket=0)
423 +if test $socket -eq 0 ; then
424 + unset ac_cv_lib_inet_socket
425 + AC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")
427 +# save results and retry for Tcl
429 +LIBS=$EXP_AND_TCL_LIBS
430 +unset ac_cv_func_socket
431 +AC_CHECK_FUNC(socket, socket=1 , socket=0)
432 +if test $socket -eq 0 ; then
433 + unset ac_cv_lib_inet_socket
434 + AC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")
436 +# save Tcl results and retry for Tk
437 +EXP_AND_TCL_LIBS=$LIBS
438 +LIBS=$EXP_AND_TK_LIBS
439 +unset ac_cv_func_socket
440 +AC_CHECK_FUNC(socket, socket=1 , socket=0)
441 +if test $socket -eq 0 ; then
442 + unset ac_cv_lib_inet_socket
443 + AC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")
445 +# save Tk results and reset for Expect
446 +EXP_AND_TK_LIBS=$LIBS
449 +######################################################################
450 +unset ac_cv_func_select
451 +AC_CHECK_FUNC(select, select=1 , select=0)
452 +if test $select -eq 0 ; then
453 + unset ac_cv_lib_inet_select
454 + AC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")
456 +# save results and retry for Tcl
458 +LIBS=$EXP_AND_TCL_LIBS
459 +unset ac_cv_func_select
460 +AC_CHECK_FUNC(select, select=1 , select=0)
461 +if test $select -eq 0 ; then
462 + unset ac_cv_lib_inet_select
463 + AC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")
465 +# save Tcl results and retry for Tk
466 +EXP_AND_TCL_LIBS=$LIBS
467 +LIBS=$EXP_AND_TK_LIBS
468 +unset ac_cv_func_select
469 +AC_CHECK_FUNC(select, select=1 , select=0)
470 +if test $select -eq 0 ; then
471 + unset ac_cv_lib_inet_select
472 + AC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")
474 +# save Tk results and reset for Expect
475 +EXP_AND_TK_LIBS=$LIBS
478 +######################################################################
479 +unset ac_cv_func_getpseudotty
480 +AC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)
481 +if test $getpseudotty -eq 0 ; then
482 + unset ac_cv_lib_seq_getpseudotty
483 + AC_CHECK_LIB(seq, getpseudotty)
485 +# save results and retry for Tcl
487 +LIBS=$EXP_AND_TCL_LIBS
488 +unset ac_cv_func_getpseudotty
489 +AC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)
490 +if test $getpseudotty -eq 0 ; then
491 + unset ac_cv_lib_seq_getpseudotty
492 + AC_CHECK_LIB(seq, getpseudotty)
494 +# save Tcl results and retry for Tk
495 +EXP_AND_TCL_LIBS=$LIBS
496 +LIBS=$EXP_AND_TK_LIBS
497 +unset ac_cv_func_getpseudotty
498 +AC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)
499 +if test $getpseudotty -eq 0 ; then
500 + unset ac_cv_lib_seq_getpseudotty
501 + AC_CHECK_LIB(seq, getpseudotty)
503 +# save Tk results and reset for Expect
504 +EXP_AND_TK_LIBS=$LIBS
507 +######################################################################
508 +# Check for FreeBSD/NetBSD openpty()
509 +unset ac_cv_func_openpty
510 +AC_CHECK_FUNC(openpty, openpty=1 , openpty=0)
511 +if test $openpty -eq 0 ; then
512 + unset ac_cv_lib_util_openpty
513 + AC_CHECK_LIB(util, openpty, [
514 + # we only need to define OPENPTY once, but since we are overriding
515 + # the default behavior, we must also handle augment LIBS too.
516 + # This needn't be done in the 2nd and 3rd tests.
517 + AC_DEFINE(HAVE_OPENPTY)
518 + LIBS="$LIBS -lutil"
521 +# save results and retry for Tcl
523 +LIBS=$EXP_AND_TCL_LIBS
524 +unset ac_cv_func_openpty
525 +AC_CHECK_FUNC(openpty, openpty=1 , openpty=0)
526 +if test $openpty -eq 0 ; then
527 + unset ac_cv_lib_util_openpty
528 + AC_CHECK_LIB(util, openpty, [
529 + AC_DEFINE(HAVE_OPENPTY)
530 + LIBS="$LIBS -lutil"
533 +# save Tcl results and retry for Tk
534 +EXP_AND_TCL_LIBS=$LIBS
535 +LIBS=$EXP_AND_TK_LIBS
536 +unset ac_cv_func_openpty
537 +AC_CHECK_FUNC(openpty, openpty=1 , openpty=0)
538 +if test $openpty -eq 0 ; then
539 + unset ac_cv_lib_util_openpty
540 + AC_CHECK_LIB(util, openpty, [
541 + AC_DEFINE(HAVE_OPENPTY)
542 + LIBS="$LIBS -lutil"
545 +# save Tk results and reset for Expect
546 +EXP_AND_TK_LIBS=$LIBS
549 +######################################################################
550 +# End of library/func checking
551 +######################################################################
553 +# Hand patches to library/func checking.
555 +dnl From: Michael Kuhl <mkuhl@legato.com>
556 +dnl To get expect to compile on a Sequent NUMA-Q running DYNIX/ptx v4.4.2.
557 +AC_MSG_CHECKING([if running Sequent running SVR4])
558 +if test "$host_alias" = "i386-sequent-sysv4" ; then
559 + EXP_AND_TCL_LIBS="-lnsl -lsocket -lm"
560 + dnl if there's something similar required for Tk, no one's told me!
566 +######################################################################
568 +# Look for various header files
570 +AC_CHECK_HEADER(sys/sysmacros.h, AC_DEFINE(HAVE_SYSMACROS_H))
571 +AC_CHECK_HEADER(stdlib.h, ,AC_DEFINE(NO_STDLIB_H))
572 +AC_CHECK_HEADER(inttypes.h, AC_DEFINE(HAVE_INTTYPES_H))
574 +# Oddly, some systems have stdarg but don't support prototypes
575 +# Tcl avoids the whole issue by not using stdarg on UNIX at all!
576 +dnl AC_CHECK_HEADER(stdarg.h, AC_DEFINE(HAVE_STDARG_H))
578 +AC_CHECK_HEADER(varargs.h, AC_DEFINE(HAVE_VARARGS_H))
579 +AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))
580 +# If no stropts.h, then the svr4 implementation is broken.
581 +# At least it is on my Debian "potato" system. - Rob Savoye
582 +AC_CHECK_HEADER(sys/stropts.h, AC_DEFINE(HAVE_STROPTS_H), svr4_ptys_broken=1)
583 +AC_CHECK_HEADER(sys/sysconfig.h, AC_DEFINE(HAVE_SYSCONF_H))
584 +AC_CHECK_HEADER(sys/fcntl.h, AC_DEFINE(HAVE_SYS_FCNTL_H))
585 +AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
586 +AC_CHECK_HEADER(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H))
587 +AC_CHECK_HEADER(sys/ptem.h, AC_DEFINE(HAVE_SYS_PTEM_H))
588 +AC_CHECK_HEADER(sys/strredir.h, AC_DEFINE(HAVE_STRREDIR_H))
589 +AC_CHECK_HEADER(sys/strpty.h, AC_DEFINE(HAVE_STRPTY_H))
591 +dnl #echo checking for ucbinclude/sys/ioctl.h (ucb-style ioctl.h under SV)
592 +dnl #if test -f /usr/ucbinclude/sys/ioctl.h ; then
593 +dnl # AC_DEFINE(HAVE_UCB_IOCTL_H)
596 +AC_MSG_CHECKING([for sys/bsdtypes.h])
597 +if test "ISC_${ISC}" = "ISC_1" ; then
599 + # if on ISC 1, we need <sys/bsdtypes.h> to get FD_SET macros
600 + AC_HAVE_HEADERS(sys/bsdtypes.h)
606 +# Look for functions that may be missing
608 +dnl AC_CHECK_FUNC(memcpy, AC_DEFINE(HAVE_MEMCPY))
609 +AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE))
610 +AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF))
611 +AC_CHECK_FUNC(strftime, AC_DEFINE(HAVE_STRFTIME))
612 +AC_CHECK_FUNC(strchr, AC_DEFINE(HAVE_STRCHR))
613 +AC_CHECK_FUNC(timezone, AC_DEFINE(HAVE_TIMEZONE))
614 +AC_CHECK_FUNC(siglongjmp, AC_DEFINE(HAVE_SIGLONGJMP))
616 +# dnl check for memcpy by hand
617 +# because Unixware 2.0 handles it specially and refuses to compile
618 +# autoconf's automatic test that is a call with no arguments
619 +AC_MSG_CHECKING([for memcpy])
625 + AC_DEFINE(HAVE_MEMCPY)
630 +# Some systems only define WNOHANG if _POSIX_SOURCE is defined
631 +# The following merely tests that sys/wait.h can be included
632 +# and if so that WNOHANG is not defined. The only place I've
634 +AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
636 +#include <sys/wait.h>
645 + AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
649 + AC_MSG_ERROR([Expect can't be cross compiled])
652 +AC_MSG_CHECKING([if any value exists for WNOHANG])
656 +#include <sys/wait.h>
659 + FILE *fp = fopen("wnohang","w");
660 + fprintf(fp,"%d",WNOHANG);
668 + AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
672 + AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
674 + AC_MSG_ERROR([Expect can't be cross compiled])
677 +#-----Stolen from Tcl's configure file-------------------------------
678 +# The check below checks whether <sys/wait.h> defines the type
679 +# "union wait" correctly. It's needed because of weirdness in
680 +# HP-UX where "union wait" is defined in both the BSD and SYS-V
681 +# environments. Checking the usability of WIFEXITED seems to do
683 +#--------------------------------------------------------------------
685 +AC_MSG_CHECKING([union wait])
686 +AC_TRY_LINK([#include <sys/types.h>
687 +#include <sys/wait.h>], [
689 +WIFEXITED(x); /* Generates compiler error if WIFEXITED
691 +], tcl_ok=yes, tcl_ok=no)
692 +AC_MSG_RESULT($tcl_ok)
693 +if test $tcl_ok = no; then
694 + AC_DEFINE(NO_UNION_WAIT)
700 +# check how signals work
703 +# Check for the data type of the mask used in select().
704 +# This picks up HP braindamage which defines fd_set and then
705 +# proceeds to ignore it and use int.
706 +# Pattern matching on int could be loosened.
707 +# Can't use ac_header_egrep since that doesn't see prototypes with K&R cpp.
708 +AC_MSG_CHECKING([mask type of select])
709 +if egrep "select\(size_t, int" /usr/include/sys/time.h >/dev/null 2>&1; then
711 + AC_DEFINE(SELECT_MASK_TYPE, int)
713 + AC_MSG_RESULT(none)
716 +dnl # Check for the data type of the function used in signal(). This
717 +dnl # must be before the test for rearming.
718 +dnl # echo checking return type of signal handlers
719 +dnl AC_HEADER_EGREP([(void|sighandler_t).*signal], signal.h, retsigtype=void,AC_DEFINE(RETSIGTYPE, int) retsigtype=int)
721 +# FIXME: check if alarm exists
722 +AC_MSG_CHECKING([if signals need to be re-armed])
725 +#define RETSIGTYPE $retsigtype
727 +int signal_rearms = 0;
730 +child_sigint_handler(n)
736 +parent_sigint_handler(n)
744 + signal(SIGINT,parent_sigint_handler);
747 + signal(SIGINT,child_sigint_handler);
748 + kill(getpid(),SIGINT);
749 + kill(getpid(),SIGINT);
750 + kill(getppid(),SIGINT);
756 + exit(signal_rearms);
760 + AC_DEFINE(REARM_SIG)
763 +, AC_MSG_WARN([Expect can't be cross compiled])
766 +# HPUX7 has trouble with the big cat so split it
767 +# Owen Rees <rtor@ansa.co.uk> 29Mar93
768 +SEDDEFS="${SEDDEFS}CONFEOF
769 +cat >> conftest.sed <<CONFEOF
773 +# There are multiple versions of getpty, alas.
774 +# I don't remember who has the first one, but Convex just added one
775 +# so check for it. Unfortunately, there is no header so the only
776 +# reasonable way to make sure is to look it we are on a Convex.
777 +AC_MSG_CHECKING([if on Convex])
780 + c[[12]]-*-*) convex=1;;
783 +if test $convex -eq 1 ; then
790 +EXP_LDFLAGS="$LDFLAGS"
792 +AC_MSG_CHECKING([if on NeXT])
793 +if test -r /NextApps ; then
795 + # "-m" flag suppresses complaints about multiple strtod
796 + EXP_LDFLAGS="$EXP_LDFLAGS -m"
802 +AC_MSG_CHECKING([if on HP])
803 +if test "x`(uname) 2>/dev/null`" = xHP-UX; then
811 +AC_MSG_CHECKING([sane default stty arguments])
812 +DEFAULT_STTY_ARGS="sane"
814 +if test $mach -eq 1 ; then
815 + DEFAULT_STTY_ARGS="cooked"
818 +if test $hp -eq 1 ; then
819 + DEFAULT_STTY_ARGS="sane kill
\15"
822 +AC_MSG_RESULT($DEFAULT_STTY_ARG)
824 +# Look for various features to determine what kind of pty
825 +# we have. For some weird reason, ac_compile_check would not
826 +# work, but ac_test_program does.
828 +AC_MSG_CHECKING([for HP style pty allocation])
829 +# following test fails on DECstations and other things that don't grok -c
830 +# but that's ok, since they don't have PTYMs anyway
831 +if test -r /dev/ptym/ptyp0 2>/dev/null ; then
833 + AC_DEFINE(HAVE_PTYM)
838 +AC_MSG_CHECKING([for HP style pty trapping])
839 +AC_HEADER_EGREP([struct.*request_info], sys/ptyio.h,
841 + AC_DEFINE(HAVE_PTYTRAP)
846 +AC_MSG_CHECKING([for AIX new-style pty allocation])
847 +if test -r /dev/ptc -a -r /dev/pts ; then
849 + AC_DEFINE(HAVE_PTC_PTS)
854 +AC_MSG_CHECKING([for SGI old-style pty allocation])
855 +if test -r /dev/ptc -a ! -r /dev/pts ; then
857 + AC_DEFINE(HAVE_PTC)
862 +# On SCO OpenServer, two types of ptys are available: SVR4 streams and c-list.
863 +# The library routines to open the SVR4 ptys are broken on certain systems and
864 +# the SCO command to increase the number of ptys only configure c-list ones
865 +# anyway. So we chose these, which have a special numbering scheme.
867 +AC_MSG_CHECKING([for SCO style pty allocation])
870 + *-sco3.2v[[45]]*) sco_clist_ptys=1 svr4_ptys_broken=1;;
873 +if test x"${sco_clist_ptys}" != x"" ; then
875 + AC_DEFINE(HAVE_SCO_CLIST_PTYS)
880 +AC_MSG_CHECKING([for SVR4 style pty allocation])
881 +if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x ; then
883 + AC_DEFINE(HAVE_PTMX)
884 + # aargg. Some systems need libpt.a to use /dev/ptmx
885 + AC_CHECK_LIB(pt, libpts="-lpt", libpts="")
886 + AC_CHECK_FUNC(ptsname, , LIBS="${LIBS} $libpts")
887 + # I've never seen Tcl or Tk include -lpt so don't bother with explicit test
888 + AC_CHECK_FUNC(ptsname, , EXP_AND_TCL_LIBS="${EXP_AND_TCL_LIBS} $libpts")
889 + AC_CHECK_FUNC(ptsname, , EXP_AND_TK_LIBS="${EXP_AND_TK_LIBS} $libpts")
894 +# In OSF/1 case, SVR4 are somewhat different.
895 +# Gregory Depp <depp@osf.org> 17Aug93
896 +AC_MSG_CHECKING([for OSF/1 style pty allocation])
897 +if test -r /dev/ptmx_bsd ; then
898 + AC_DEFINE(HAVE_PTMX_BSD)
906 +AC_CHECK_FUNC(tcgetattr, tcgetattr=1)
907 +AC_CHECK_FUNC(tcsetattr, tcsetattr=1)
908 +if test $tcgetattr -eq 1 -a $tcsetattr -eq 1 ; then
909 + AC_DEFINE(HAVE_TCSETATTR)
913 +# first check for the pure bsd
914 +AC_MSG_CHECKING([for struct sgttyb])
923 + AC_DEFINE(HAVE_SGTTYB)
928 + AC_MSG_ERROR([Expect can't be cross compiled])
931 +# mach systems have include files for unimplemented features
932 +# so avoid doing following test on those systems
933 +if test $mach -eq 0 ; then
935 + # next check for the older style ttys
936 + # note that if we detect termio.h (only), we still set PTY_TYPE=termios
937 + # since that just controls which of pty_XXXX.c file is use and
938 + # pty_termios.c is set up to handle pty_termio.
939 + AC_MSG_CHECKING([for struct termio])
940 + AC_TRY_RUN([#include <termio.h>
946 + AC_DEFINE(HAVE_TERMIO)
952 + AC_MSG_ERROR([Expect can't be cross compiled])
955 + # now check for the new style ttys (not yet posix)
956 + AC_MSG_CHECKING([for struct termios])
958 + /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
959 +# ifdef HAVE_INTTYPES_H
960 +# include <inttypes.h>
962 +# include <termios.h>
965 + struct termios tmp;
968 + AC_DEFINE(HAVE_TERMIOS)
974 + AC_MSG_ERROR([Expect can't be cross compiled])
978 +AC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])
980 +/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
981 +#ifdef HAVE_INTTYPES_H
982 +#include <inttypes.h>
984 +#include <termios.h>
986 +#if defined(TCGETS) || defined(TCGETA)
992 + AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)
997 + AC_MSG_ERROR([Expect can't be cross compiled])
1000 +AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
1002 +/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
1003 +#ifdef HAVE_INTTYPES_H
1004 +#include <inttypes.h>
1006 +#include <termios.h>
1014 + AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
1015 + AC_MSG_RESULT(yes)
1019 + AC_MSG_ERROR([Expect can't be cross compiled])
1022 +# finally check for Cray style ttys
1023 +AC_MSG_CHECKING([for Cray-style ptys])
1035 + SETUID="chmod u+s"
1036 + AC_MSG_RESULT(yes)
1040 + AC_MSG_ERROR([Expect can't be cross compiled])
1044 +# Check for select and/or poll. If both exist, we prefer select.
1045 +# if neither exists, define SIMPLE_EVENT.
1049 +unset ac_cv_func_select
1050 +AC_CHECK_FUNC(select, select=1)
1051 +AC_CHECK_FUNC(poll, poll=1)
1052 +AC_MSG_CHECKING([event handling])
1053 +if test $select -eq 1 ; then
1056 + AC_MSG_RESULT(via select)
1057 +elif test $poll -eq 1 ; then
1060 + AC_MSG_RESULT(via poll)
1063 + EVENT_ABLE=noevent
1064 + AC_MSG_RESULT(none)
1065 + AC_DEFINE(SIMPLE_EVENT)
1068 +AC_HAVE_FUNCS(_getpty)
1069 +AC_HAVE_FUNCS(getpty)
1071 +# following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2
1075 +# check for timezones
1077 +AC_MSG_CHECKING([for SV-style timezone])
1079 +extern char *tzname[2];
1080 +extern int daylight;
1083 + int *x = &daylight;
1084 + char **y = tzname;
1088 + AC_DEFINE(HAVE_SV_TIMEZONE)
1089 + AC_MSG_RESULT(yes),
1092 + AC_MSG_ERROR([Expect can't be cross compiled])
1095 +# only look for Tk stuff if we have X11 and user doesn't say not to
1096 +AC_ARG_WITH(x, [ --with-x whether or not to use X (default yes)], , with_x=yes)
1097 +if test "$with_x" = "no"; then
1102 +if test x"$no_tk" != x"true" ; then
1103 +# libexpectk no longer exists
1104 +# X_PROGS="expectk \$(LIBEXPECTK)"
1106 +# should really generate following symbol, but I'm hitting configure's limit on substs.
1107 + X_PROGS_INSTALLED=expectk_installed
1109 + X_PROGS="# no X support on this system"
1110 + AC_MSG_WARN([No X based programs will be built])
1111 + echo " WARNING: Can't find Tk headers or library. You can still"
1112 + echo " build expect, but not expectk. See Expect's README for"
1113 + echo " information on how to obtain Tk. If Tk is installed, see"
1114 + echo " Expect's INSTALL on how to tell configure where Tk is"
1115 + echo " installed."
1118 +# consume these flags so that user can invoke Expect's configure with
1119 +# the same command as Tcl's configure
1120 +AC_ARG_ENABLE(load,
1121 + [ --disable-load disallow dynamic loading],
1122 + [disable_dl=$enableval], [disable_dl=no])
1125 + [ --enable-gcc allow use of gcc if available],
1126 + [enable_gcc=$enableval], [enable_gcc=no])
1128 +# Following comment stolen from Tcl's configure.in:
1129 +# Note: in the following variable, it's important to use the absolute
1130 +# path name of the Tcl directory rather than "..": this is because
1131 +# AIX remembers this path and will attempt to use it at run-time to look
1132 +# up the Tcl library.
1134 +if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
1135 + EXP_LIB_VERSION=$EXP_VERSION
1137 + EXP_LIB_VERSION=$EXP_VERSION_NODOTS
1139 +if test $iunix -eq 1 ; then
1140 + EXP_LIB_VERSION=$EXP_VERSION_NODOTS
1143 +# also remove dots on systems that don't support filenames > 14
1144 +# (are there systems which support shared libs and restrict filename lengths!?)
1145 +AC_SYS_LONG_FILE_NAMES
1146 +if test $ac_cv_sys_long_file_names = no; then
1147 + EXP_LIB_VERSION=$EXP_VERSION_NODOTS
1150 +EXP_BUILD_LIB_SPEC="-L`pwd` -lexpect${EXP_LIB_VERSION}${DBGX}"
1151 +EXP_LIB_SPEC="-L\${INSTALL_ROOT}\${exec_prefix}/lib -lexpect${EXP_LIB_VERSION}${DBGX}"
1152 +EXP_UNSHARED_LIB_FILE=libexpect${EXP_LIB_VERSION}${DBGX}.a
1154 +# The TCL_SHARED_LIB_SUFFIX macro below relies on the DBGX macro,
1155 +# which is set way far above here. Don't set it to the value of
1156 +# TCL_DBGX, or you'll run into problems if you build Tcl with symbols
1157 +# and expect without (and vice versa?)
1159 +AC_MSG_CHECKING([for type of library to build])
1160 +if test "$enable_shared" = "yes" && test "x${TCL_SHLIB_SUFFIX}" != "x" ; then
1161 + EXP_SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
1162 + eval "EXP_SHARED_LIB_FILE=libexpect${TCL_SHARED_LIB_SUFFIX}"
1163 + EXP_LIB_FILE=$EXP_SHARED_LIB_FILE
1164 + EXP_LIB_FILES="$EXP_SHARED_LIB_FILE $EXP_UNSHARED_LIB_FILE"
1165 + AC_MSG_RESULT(both shared and unshared)
1168 + EXP_SHARED_LIB_FILE="reconfigure_Tcl_for_shared_library"
1169 + EXP_LIB_FILE=$EXP_UNSHARED_LIB_FILE
1170 + EXP_LIB_FILES="$EXP_UNSHARED_LIB_FILE"
1171 + AC_MSG_RESULT(unshared)
1174 +# Sigh - Tcl defines SHLIB_LD_LIBS to be either empty or ${LIBS} and
1175 +# LIBS is intended to be expanded by Make. But since we're too close
1176 +# to hitting config's max symbols, pack everything together here and
1177 +# do test ourselves. Ugh.
1179 +if test "x$TCL_SHLIB_LD_LIBS" = "x" ; then
1180 + EXP_SHLIB_LD_LIBS="$LIBS"
1182 + # seems a little strange to build in Tcl's build-lib, but
1183 + # that's what Tk does.
1184 + EXP_SHLIB_LD_LIBS="$TCL_BUILD_LIB_SPEC $TCL_DL_LIBS $LIBS -lc"
1187 +#--------------------------------------------------------------------
1188 +# This section is based on analogous thing in Tk installation. - DEL
1189 +# Various manipulations on the search path used at runtime to
1190 +# find shared libraries:
1191 +# 2. On systems such as AIX and Ultrix that use "-L" as the
1192 +# search path option, colons cannot be used to separate
1193 +# directories from each other. Change colons to " -L".
1194 +# 3. Create two sets of search flags, one for use in cc lines
1195 +# and the other for when the linker is invoked directly. In
1196 +# the second case, '-Wl,' must be stripped off and commas must
1197 +# be replaced by spaces.
1198 +#--------------------------------------------------------------------
1200 +LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
1202 +# If Tcl and Expect are installed in different places, adjust the library
1203 +# search path to reflect this.
1205 +if test x"$no_tk" = x"true" ; then
1206 + if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then
1207 + LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib"
1210 + if test "$TK_EXEC_PREFIX" != "$exec_prefix"; then
1211 + LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TK_EXEC_PREFIX}/lib"
1212 + # no need to include TCL's search path, because TK does it already
1213 + # (it is actually appended later, via TK_LD_SEARCH_FLAGS trick below)
1217 +if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
1218 + LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
1221 +# The eval below is tricky! It *evaluates* the string in
1222 +# ..._CC_SEARCH_FLAGS, which causes a substitution of the
1223 +# variable LIB_RUNTIME_DIR.
1225 +if test x"$no_tk" = x"true" ; then
1226 + eval "EXP_CC_SEARCH_FLAGS=\"$TCL_CC_SEARCH_FLAGS\""
1227 + EXP_LD_SEARCH_FLAGS=${TCL_LD_SEARCH_FLAGS}
1229 + eval "EXP_CC_SEARCH_FLAGS=\"$TK_CC_SEARCH_FLAGS\""
1230 + EXP_LD_SEARCH_FLAGS=${TK_LD_SEARCH_FLAGS}
1233 +# now broken out into EXP_AND_TCL_LIBS and EXP_AND_TK_LIBS. Had to do this
1234 +# in order to avoid repeating lib specs to which some systems object.
1235 +EXP_AND_TCL_LIBS="$EXP_AND_TCL_LIBS"
1236 +EXP_AND_TK_LIBS="$EXP_AND_TK_LIBS"
1239 +# Set up makefile substitutions
1241 +AC_SUBST(EXP_MAJOR_VERSION)
1242 +AC_SUBST(EXP_MINOR_VERSION)
1243 +AC_SUBST(EXP_MICRO_VERSION)
1244 +AC_SUBST(EXP_VERSION_FULL)
1245 +AC_SUBST(EXP_VERSION)
1247 +AC_SUBST(EXP_CONFIG_SHELL)
1248 +AC_SUBST(EXP_SHARED_LIB_FILE)
1249 +AC_SUBST(EXP_UNSHARED_LIB_FILE)
1250 +AC_SUBST(EXP_SHLIB_CFLAGS)
1251 +AC_SUBST(EXP_LIB_FILE)
1252 +AC_SUBST(EXP_LIB_FILES)
1253 +AC_SUBST(EXP_BUILD_LIB_SPEC)
1254 +AC_SUBST(EXP_LIB_SPEC)
1255 +AC_SUBST(EXP_CFLAGS)
1256 +AC_SUBST(EXP_LDFLAGS)
1257 +AC_SUBST(EXP_LD_SEARCH_FLAGS)
1258 +AC_SUBST(TCL_LD_SEARCH_FLAGS)
1259 +AC_SUBST(EXP_AND_TCL_LIBS)
1260 +AC_SUBST(EXP_AND_TK_LIBS)
1261 +AC_SUBST(EXP_SHLIB_LD_LIBS)
1264 +AC_SUBST(EVENT_TYPE)
1265 +AC_SUBST(EVENT_ABLE)
1267 +AC_SUBST(UNSHARED_RANLIB)
1268 +AC_SUBST(DEFAULT_STTY_ARGS)
1269 +AC_OUTPUT([Makefile \
1271 + chmod +x ${srcdir}/install-sh ${srcdir}/mkinstalldirs)