2 dnl Process this file with autoconf to produce a configure script.
4 AC_REVISION($Id: configure.in,v 5.82 2013/11/04 19:03:00 andreas_kupries Exp $)
6 AC_INIT([expect],[5.45.4])
10 AC_CONFIG_AUX_DIR(tclconfig)
12 #--------------------------------------------------------------------
13 # Configure script for package 'Expect'.
15 #--------------------------------------------------------------------
17 #--------------------------------------------------------------------
18 # Load the tclConfig.sh file
19 #--------------------------------------------------------------------
24 # expectk has been removed from the distribution as Tcl has supported
25 # dynamic extensions everywhere for a while. We still allow 'expect'
26 # to be built for the die-hard users, but expectk is just wish with
27 # package require Expect
28 if test "${with_tk+set}" = set ; then
29 AC_MSG_WARN([With Tk request ignored - use package require Tk & Expect])
32 #-----------------------------------------------------------------------
33 # Handle the --prefix=... option by defaulting to what Tcl gave.
34 # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
35 #-----------------------------------------------------------------------
39 #-----------------------------------------------------------------------
40 # Standard compiler checks.
41 # This sets up CC by using the CC env var, or looks for gcc otherwise.
42 # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
43 # the basic setup necessary to compile executables.
44 #-----------------------------------------------------------------------
48 #--------------------------------------------------------------------
50 # Choose which headers you need. Extension authors should try very
51 # hard to only rely on the Tcl public header files. Internal headers
52 # contain private data structures and are subject to change without
54 # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
55 #--------------------------------------------------------------------
57 #TEA_PUBLIC_TCL_HEADERS
58 TEA_PRIVATE_TCL_HEADERS
60 #--------------------------------------------------------------------
61 # You can add more files to clean if your extension creates any extra
62 # files by extending CLEANFILES.
63 # Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
64 # and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
66 # A few miscellaneous platform-specific items:
67 # TEA_ADD_* any platform specific compiler/build info here.
68 #--------------------------------------------------------------------
70 TEA_ADD_CLEANFILES([pkgIndex.tcl])
72 #--------------------------------------------------------------------
73 # Check whether --enable-threads or --disable-threads was given.
74 # So far only Tcl responds to this one.
76 # Hook for when threading is supported in Expect. The --enable-threads
77 # flag currently has no effect.
78 #------------------------------------------------------------------------
82 #--------------------------------------------------------------------
83 # The statement below defines a collection of symbols related to
84 # building as a shared library instead of a static library.
85 #--------------------------------------------------------------------
89 #--------------------------------------------------------------------
90 # This macro figures out what flags to use with the compiler/linker
91 # when building shared/static debug/optimized objects. This information
92 # can be taken from the tclConfig.sh file, but this figures it all out.
93 #--------------------------------------------------------------------
97 #--------------------------------------------------------------------
98 # Set the default compiler switches based on the --enable-symbols option.
99 #--------------------------------------------------------------------
103 #--------------------------------------------------------------------
104 # Everyone should be linking against the Tcl stub library. If you
105 # can't for some reason, remove this definition. If you aren't using
106 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
107 # link against the non-stubbed Tcl library.
108 #--------------------------------------------------------------------
110 AC_DEFINE(USE_TCL_STUBS)
111 AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
113 #-------------------------------------------------------------------------
114 # Check for system header files.
115 #-------------------------------------------------------------------------
117 AC_CHECK_HEADER(sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H))
118 AC_CHECK_HEADER(sys/sysmacros.h, AC_DEFINE(HAVE_SYSMACROS_H))
120 # Oddly, some systems have stdarg but don't support prototypes
121 # Tcl avoids the whole issue by not using stdarg on UNIX at all!
123 dnl AC_CHECK_HEADER(stdarg.h, AC_DEFINE(HAVE_STDARG_H))
125 AC_CHECK_HEADER(varargs.h, AC_DEFINE(HAVE_VARARGS_H))
127 # If no stropts.h, then the svr4 implementation is broken.
128 # At least it is on my Debian "potato" system. - Rob Savoye
130 AC_CHECK_HEADER(sys/stropts.h, AC_DEFINE(HAVE_STROPTS_H), svr4_ptys_broken=1)
131 AC_CHECK_HEADER(sys/sysconfig.h, AC_DEFINE(HAVE_SYSCONF_H))
132 AC_CHECK_HEADER(sys/fcntl.h, AC_DEFINE(HAVE_SYS_FCNTL_H))
133 AC_CHECK_HEADER(sys/ptem.h, AC_DEFINE(HAVE_SYS_PTEM_H))
134 AC_CHECK_HEADER(sys/strredir.h, AC_DEFINE(HAVE_STRREDIR_H))
135 AC_CHECK_HEADER(sys/strpty.h, AC_DEFINE(HAVE_STRPTY_H))
137 AC_MSG_CHECKING([for sys/bsdtypes.h])
138 if test "ISC_${ISC}" = "ISC_1" ; then
140 # if on ISC 1, we need <sys/bsdtypes.h> to get FD_SET macros
141 AC_HAVE_HEADERS(sys/bsdtypes.h)
146 #-------------------------------------------------------------------------
147 # What type do signals return?
148 #-------------------------------------------------------------------------
152 #-------------------------------------------------------------------------
153 # Find out all about time handling differences.
154 #-------------------------------------------------------------------------
158 #--------------------------------------------------------------------
159 # The check below checks whether <sys/wait.h> defines the type
160 # "union wait" correctly. It's needed because of weirdness in
161 # HP-UX where "union wait" is defined in both the BSD and SYS-V
162 # environments. Checking the usability of WIFEXITED seems to do
164 #--------------------------------------------------------------------
166 AC_MSG_CHECKING([union wait])
167 AC_CACHE_VAL(tcl_cv_union_wait,
168 AC_TRY_LINK([#include <sys/types.h>
169 #include <sys/wait.h>], [
171 WIFEXITED(x); /* Generates compiler error if WIFEXITED uses an int. */
172 ], tcl_cv_union_wait=yes, tcl_cv_union_wait=no))
173 AC_MSG_RESULT($tcl_cv_union_wait)
174 if test $tcl_cv_union_wait = no; then
175 AC_DEFINE(NO_UNION_WAIT)
178 ######################################################################
179 # required by Sequent ptx2
181 AC_CHECK_FUNC(gethostname, gethostname=1 , gethostname=0)
182 if test $gethostname -eq 0 ; then
183 AC_CHECK_LIB(inet, gethostname, LIBS="$LIBS -linet")
186 ######################################################################
187 # required by Fischman's ISC 4.0
189 AC_CHECK_FUNC(socket, socket=1 , socket=0)
190 if test $socket -eq 0 ; then
191 AC_CHECK_LIB(inet, socket, LIBS="$LIBS -linet")
194 ######################################################################
196 AC_CHECK_FUNC(select, select=1 , select=0)
197 if test $select -eq 0 ; then
198 AC_CHECK_LIB(inet, select, LIBS="$LIBS -linet")
201 ######################################################################
203 AC_CHECK_FUNC(getpseudotty, getpseudotty=1 , getpseudotty=0)
204 if test $getpseudotty -eq 0 ; then
205 AC_CHECK_LIB(seq, getpseudotty)
208 ######################################################################
209 # Check for FreeBSD/NetBSD openpty()
210 unset ac_cv_func_openpty
212 AC_CHECK_FUNC(openpty, AC_DEFINE(HAVE_OPENPTY) openpty=1 , openpty=0)
213 if test $openpty -eq 0 ; then
214 AC_CHECK_LIB(util, openpty, [
215 # we only need to define OPENPTY once, but since we are overriding
216 # the default behavior, we must also handle augment LIBS too.
217 # This needn't be done in the 2nd and 3rd tests.
218 AC_DEFINE(HAVE_OPENPTY)
223 ######################################################################
224 # End of library/func checking
225 ######################################################################
227 # Hand patches to library/func checking.
228 dnl From: Michael Kuhl <mkuhl@legato.com>
229 dnl To get expect to compile on a Sequent NUMA-Q running DYNIX/ptx v4.4.2.
231 AC_MSG_CHECKING([if running Sequent running SVR4])
232 if test "$host_alias" = "i386-sequent-sysv4" ; then
233 LIBS="-lnsl -lsocket -lm"
239 #--------------------------------------------------------------------
240 #--------------------------------------------------------------------
241 #--------------------------------------------------------------------
242 #--------------------------------------------------------------------
243 # From here on comes original expect configure code.
244 # At the end we will have another section of TEA 3.2 code.
248 # - Runs a sub configure (Dbgconfigure) for the expect tcl debugger
250 #--------------------------------------------------------------------
251 #--------------------------------------------------------------------
253 dnl AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
256 # If `configure' is invoked (in)directly via `make', ensure that it
257 # encounters no `make' conflicts.
260 dnl unset MFLAGS MAKEFLAGS
264 # An explanation is in order for the strange things going on with the
265 # various LIBS. There are three separate definitions for LIBS. The
266 # reason is that some systems require shared libraries include
267 # references to their dependent libraries, i.e., any additional
268 # libraries that must be linked to. And some systems get upset if the
269 # references are repeated on the link line. So therefore, we create
270 # one for Expect, one for Expect and Tcl, and one for building Expect's own
271 # shared library. Tcl's tclConfig.sh insists that any shared libs
272 # that it "helps" build must pass the libraries as LIBS (see comment
273 # near end of this configure file). I would do but since we're close
274 # to hitting config's max symbols, we take one short cut and pack the
275 # LIBS into EXP_SHLIB_LD_LIBS (which is basically what Tcl wants to do
276 # for us). The point, however, is that there's no separate LIBS or
277 # EXP_LIBS symbol passed out of configure. One additional point for
278 # confusion is that LIBS is what configure uses to do all library
279 # tests, so we have to swap definitions of LIBS periodically. When we
280 # are swapping out the one for Expect's shared library, we save it in
283 eval "LIBS=\"$TCL_LIBS\""
285 if test "${with_tcl+set}" = set ; then
286 case "${with_tcl}" in
288 AC_MSG_WARN([Specify absolute path to --with-tcl for subdir configuration])
293 # these are the other subdirectories we need to configure
294 AC_CONFIG_SUBDIRS(testsuite)
298 AC_MSG_CHECKING([if running Mach])
301 # Both Next and pure Mach behave identically with respect
302 # to a few things, so just lump them together as "mach"
304 *-*-next*) mach=1 ; next=1 ;;
307 if test $mach -eq 1 ; then
313 AC_MSG_CHECKING([if running MachTen])
314 # yet another Mach clone
315 if test -r /MachTen ; then
322 AC_MSG_CHECKING([if on Pyramid])
323 if test -r /bin/pyr ; then
331 AC_MSG_CHECKING([if on Apollo])
332 if test -r /usr/apollo/bin ; then
340 AC_MSG_CHECKING([if on Interactive])
341 if test "x`(uname -s) 2>/dev/null`" = xIUNIX; then
349 AC_MSG_CHECKING([stty to use])
350 if test -r /usr/local/bin/stty ; then
351 STTY_BIN=/usr/local/bin/stty
355 AC_MSG_RESULT($STTY_BIN)
357 AC_MSG_CHECKING([if stty reads stdout])
359 # On some systems stty can't be run in the background (svr4) or get it
360 # wrong because they fail to complain (next, mach), so don't attempt
361 # the test on some systems.
365 *-*-solaris*) stty_reads_stdout=0 ;;
366 *-*-irix*) stty_reads_stdout=0 ;;
367 *-*-sco3.2v[[45]]*) stty_reads_stdout=1 ;;
368 i[[3456]]86-*-sysv4.2MP) stty_reads_stdout=0 ;;
369 *-*-linux*) stty_reads_stdout=0 ;;
370 # Not sure about old convex but 5.2 definitely reads from stdout
371 c[[12]]-*-*) stty_reads_stdout=1 ;;
372 *-*-aix[[34]]*) stty_reads_stdout=0 ;;
373 *-*-hpux9*) stty_reads_stdout=0 ;;
374 *-*-hpux10*) stty_reads_stdout=0 ;;
375 *-*-osf[[234]]*) stty_reads_stdout=0 ;;
376 *-*-ultrix4.4) stty_reads_stdout=0 ;;
377 *-*-dgux*) stty_reads_stdout=0 ;;
380 if test $mach -eq 1 ; then
383 if test $apollo -eq 1 ; then
386 if test $pyr -eq 1 ; then
390 # if we still don't know, test
391 if test x"${stty_reads_stdout}" = x"" ; then
392 $STTY_BIN > /dev/null 2> /dev/null ; a=$?
393 $STTY_BIN < /dev/tty > /dev/null 2> /dev/null ; b=$?
394 if test $a -ne 0 -a $b -ne 0; then
401 if test ${stty_reads_stdout} -eq 1 ; then
403 AC_DEFINE(STTY_READS_STDOUT)
408 # Solaris 2.4 and later requires __EXTENSIONS__ in order to see all sorts
409 # of traditional but nonstandard stuff in header files.
410 AC_MSG_CHECKING([if running Solaris])
413 *-*-solaris*) solaris=1;;
416 if test $solaris -eq 1 ; then
423 # On Interactive UNIX, -Xp must be added to LIBS in order to find strftime.
424 # This test should really be done by Tcl. So just check Tcl's definition.
425 # If defective, add to all three LIBS. (It's not actually necessary for
426 # EXP_LIBS since -Xp will just be ignored the way that EXP_LIBS is used in
427 # the Makefile, but we include it for consistency.)
429 if test $iunix -eq 1 ; then
430 AC_CHECK_FUNC(strftime, , [
435 ######################################################################
437 # Look for various header files
441 # Look for functions that may be missing
443 dnl AC_CHECK_FUNC(memcpy, AC_DEFINE(HAVE_MEMCPY))
444 AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE))
445 AC_CHECK_FUNC(sysconf, AC_DEFINE(HAVE_SYSCONF))
446 AC_CHECK_FUNC(strftime, AC_DEFINE(HAVE_STRFTIME))
447 AC_CHECK_FUNC(strchr, AC_DEFINE(HAVE_STRCHR))
448 AC_CHECK_FUNC(timezone, AC_DEFINE(HAVE_TIMEZONE))
449 AC_CHECK_FUNC(siglongjmp, AC_DEFINE(HAVE_SIGLONGJMP))
451 # dnl check for memcpy by hand
452 # because Unixware 2.0 handles it specially and refuses to compile
453 # autoconf's automatic test that is a call with no arguments
454 AC_MSG_CHECKING([for memcpy])
460 AC_DEFINE(HAVE_MEMCPY)
465 # Some systems only define WNOHANG if _POSIX_SOURCE is defined
466 # The following merely tests that sys/wait.h can be included
467 # and if so that WNOHANG is not defined. The only place I've
469 AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
471 #include <sys/wait.h>
480 AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
484 AC_MSG_ERROR([Expect can't be cross compiled])
487 AC_MSG_CHECKING([if any value exists for WNOHANG])
491 #include <sys/wait.h>
494 FILE *fp = fopen("wnohang","w");
495 fprintf(fp,"%d",WNOHANG);
503 AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
507 AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
509 AC_MSG_ERROR([Expect can't be cross compiled])
513 # check how signals work
516 # Check for the data type of the mask used in select().
517 # This picks up HP braindamage which defines fd_set and then
518 # proceeds to ignore it and use int.
519 # Pattern matching on int could be loosened.
520 # Can't use ac_header_egrep since that doesn't see prototypes with K&R cpp.
521 AC_MSG_CHECKING([mask type of select])
522 if egrep "select\(size_t, int" /usr/include/sys/time.h >/dev/null 2>&1; then
524 AC_DEFINE(SELECT_MASK_TYPE, int)
527 AC_DEFINE(SELECT_MASK_TYPE, fd_set)
530 dnl # Check for the data type of the function used in signal(). This
531 dnl # must be before the test for rearming.
532 dnl # echo checking return type of signal handlers
533 dnl AC_HEADER_EGREP([(void|sighandler_t).*signal], signal.h, retsigtype=void,AC_DEFINE(RETSIGTYPE, int) retsigtype=int)
535 # FIXME: check if alarm exists
536 AC_MSG_CHECKING([if signals need to be re-armed])
539 #define RETSIGTYPE $retsigtype
541 int signal_rearms = 0;
544 child_sigint_handler(n)
550 parent_sigint_handler(n)
558 signal(SIGINT,parent_sigint_handler);
561 signal(SIGINT,child_sigint_handler);
562 kill(getpid(),SIGINT);
563 kill(getpid(),SIGINT);
564 kill(getppid(),SIGINT);
577 , AC_MSG_WARN([Expect can't be cross compiled])
580 # HPUX7 has trouble with the big cat so split it
581 # Owen Rees <rtor@ansa.co.uk> 29Mar93
582 SEDDEFS="${SEDDEFS}CONFEOF
583 cat >> conftest.sed <<CONFEOF
587 # There are multiple versions of getpty, alas.
588 # I don't remember who has the first one, but Convex just added one
589 # so check for it. Unfortunately, there is no header so the only
590 # reasonable way to make sure is to look it we are on a Convex.
591 AC_MSG_CHECKING([if on Convex])
594 c[[12]]-*-*) convex=1;;
597 if test $convex -eq 1 ; then
605 AC_MSG_CHECKING([if on HP])
606 if test "x`(uname) 2>/dev/null`" = xHP-UX; then
614 AC_MSG_CHECKING([sane default stty arguments])
615 DEFAULT_STTY_ARGS="sane"
617 if test $mach -eq 1 ; then
618 DEFAULT_STTY_ARGS="cooked"
621 if test $hp -eq 1 ; then
622 DEFAULT_STTY_ARGS="sane kill
\15"
625 AC_MSG_RESULT($DEFAULT_STTY_ARG)
627 # Look for various features to determine what kind of pty
628 # we have. For some weird reason, ac_compile_check would not
629 # work, but ac_test_program does.
631 AC_MSG_CHECKING([for HP style pty allocation])
632 # following test fails on DECstations and other things that don't grok -c
633 # but that's ok, since they don't have PTYMs anyway
634 if test -r /dev/ptym/ptyp0 2>/dev/null ; then
641 AC_MSG_CHECKING([for HP style pty trapping])
642 AC_HEADER_EGREP([struct.*request_info], sys/ptyio.h,
644 AC_DEFINE(HAVE_PTYTRAP)
649 AC_MSG_CHECKING([for AIX new-style pty allocation])
650 if test -r /dev/ptc -a -r /dev/pts ; then
652 AC_DEFINE(HAVE_PTC_PTS)
657 AC_MSG_CHECKING([for SGI old-style pty allocation])
658 if test -r /dev/ptc -a ! -r /dev/pts ; then
665 # On SCO OpenServer, two types of ptys are available: SVR4 streams and c-list.
666 # The library routines to open the SVR4 ptys are broken on certain systems and
667 # the SCO command to increase the number of ptys only configure c-list ones
668 # anyway. So we chose these, which have a special numbering scheme.
670 AC_MSG_CHECKING([for SCO style pty allocation])
673 *-sco3.2v[[45]]*) sco_clist_ptys=1 svr4_ptys_broken=1;;
676 if test x"${sco_clist_ptys}" != x"" ; then
678 AC_DEFINE(HAVE_SCO_CLIST_PTYS)
683 AC_MSG_CHECKING([for SVR4 style pty allocation])
684 if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x ; then
687 # aargg. Some systems need libpt.a to use /dev/ptmx
688 AC_CHECK_LIB(pt, libpts="-lpt", libpts="")
689 AC_CHECK_FUNC(ptsname, , LIBS="${LIBS} $libpts")
694 # In OSF/1 case, SVR4 are somewhat different.
695 # Gregory Depp <depp@osf.org> 17Aug93
696 AC_MSG_CHECKING([for OSF/1 style pty allocation])
697 if test -r /dev/ptmx_bsd ; then
698 AC_DEFINE(HAVE_PTMX_BSD)
706 AC_CHECK_FUNC(tcgetattr, tcgetattr=1)
707 AC_CHECK_FUNC(tcsetattr, tcsetattr=1)
708 if test $tcgetattr -eq 1 -a $tcsetattr -eq 1 ; then
709 AC_DEFINE(HAVE_TCSETATTR)
713 # first check for the pure bsd
714 AC_MSG_CHECKING([for struct sgttyb])
723 AC_DEFINE(HAVE_SGTTYB)
728 AC_MSG_ERROR([Expect can't be cross compiled])
731 # mach systems have include files for unimplemented features
732 # so avoid doing following test on those systems
733 if test $mach -eq 0 ; then
735 # next check for the older style ttys
736 # note that if we detect termio.h (only), we still set PTY_TYPE=termios
737 # since that just controls which of pty_XXXX.c file is use and
738 # pty_termios.c is set up to handle pty_termio.
739 AC_MSG_CHECKING([for struct termio])
740 AC_TRY_RUN([#include <termio.h>
746 AC_DEFINE(HAVE_TERMIO)
752 AC_MSG_ERROR([Expect can't be cross compiled])
755 # now check for the new style ttys (not yet posix)
756 AC_MSG_CHECKING([for struct termios])
758 /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
759 # ifdef HAVE_INTTYPES_H
760 # include <inttypes.h>
762 # include <termios.h>
768 AC_DEFINE(HAVE_TERMIOS)
774 AC_MSG_ERROR([Expect can't be cross compiled])
778 AC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])
780 /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
781 #ifdef HAVE_INTTYPES_H
782 #include <inttypes.h>
786 #if defined(TCGETS) || defined(TCGETA)
792 AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)
797 AC_MSG_ERROR([Expect can't be cross compiled])
800 AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
802 /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
803 #ifdef HAVE_INTTYPES_H
804 #include <inttypes.h>
814 AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
819 AC_MSG_ERROR([Expect can't be cross compiled])
822 # finally check for Cray style ttys
823 AC_MSG_CHECKING([for Cray-style ptys])
840 AC_MSG_ERROR([Expect can't be cross compiled])
844 # Check for select and/or poll. If both exist, we prefer select.
845 # if neither exists, define SIMPLE_EVENT.
849 unset ac_cv_func_select
850 AC_CHECK_FUNC(select, select=1)
851 AC_CHECK_FUNC(poll, poll=1)
852 AC_MSG_CHECKING([event handling])
853 if test $select -eq 1 ; then
856 AC_MSG_RESULT(via select)
857 elif test $poll -eq 1 ; then
860 AC_MSG_RESULT(via poll)
865 AC_DEFINE(SIMPLE_EVENT)
868 AC_HAVE_FUNCS(_getpty)
869 AC_HAVE_FUNCS(getpty)
871 # following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2
875 # check for timezones
877 AC_MSG_CHECKING([for SV-style timezone])
879 extern char *tzname[2];
888 AC_DEFINE(HAVE_SV_TIMEZONE)
892 AC_MSG_ERROR([Expect can't be cross compiled])
896 # Following comment stolen from Tcl's configure.in:
897 # Note: in the following variable, it's important to use the absolute
898 # path name of the Tcl directory rather than "..": this is because
899 # AIX remembers this path and will attempt to use it at run-time to look
900 # up the Tcl library.
902 PACKAGE_VERSION_NODOTS="`echo $PACKAGE_VERSION | sed -e 's/\.//g'`"
904 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
905 EXP_LIB_VERSION=$PACKAGE_VERSION
907 EXP_LIB_VERSION=$PACKAGE_VERSION_NODOTS
909 if test $iunix -eq 1 ; then
910 EXP_LIB_VERSION=$PACKAGE_VERSION_NODOTS
913 # also remove dots on systems that don't support filenames > 14
914 # (are there systems which support shared libs and restrict filename lengths!?)
915 AC_SYS_LONG_FILE_NAMES
916 if test $ac_cv_sys_long_file_names = no; then
917 EXP_LIB_VERSION=$PACKAGE_VERSION_NODOTS
920 if test "$FRAMEWORK_BUILD" = "1" ; then
921 EXP_BUILD_LIB_SPEC="-F`pwd` -framework Expect"
922 EXP_LIB_SPEC="-framework Expect"
923 EXP_LIB_FILE="Expect"
924 AC_DEFINE(EXP_FRAMEWORK)
926 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
927 EXP_LIB_FLAG="-lexpect${EXP_LIB_VERSION}"
929 EXP_LIB_FLAG="-lexpect`echo ${EXP_LIB_VERSION} | tr -d .`"
931 EXP_BUILD_LIB_SPEC="-L`pwd` ${EXP_LIB_FLAG}"
932 EXP_LIB_SPEC="-L${libdir} ${EXP_LIB_FLAG}"
935 #--------------------------------------------------------------------
936 # This section is based on analogous thing in Tk installation. - DEL
937 # Various manipulations on the search path used at runtime to
938 # find shared libraries:
939 # 2. On systems such as AIX and Ultrix that use "-L" as the
940 # search path option, colons cannot be used to separate
941 # directories from each other. Change colons to " -L".
942 # 3. Create two sets of search flags, one for use in cc lines
943 # and the other for when the linker is invoked directly. In
944 # the second case, '-Wl,' must be stripped off and commas must
945 # be replaced by spaces.
946 #--------------------------------------------------------------------
948 LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}/${PACKAGE_NAME}${PACKAGE_VERSION}'
950 # If Tcl and Expect are installed in different places, adjust the library
951 # search path to reflect this.
953 if test "$TCL_EXEC_PREFIX" != "$exec_prefix"; then
954 LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib"
957 if test "${TCL_LD_SEARCH_FLAGS}" = '-L${LIB_RUNTIME_DIR}'; then
958 LIB_RUNTIME_DIR=`echo ${LIB_RUNTIME_DIR} |sed -e 's/:/ -L/g'`
961 # The eval below is tricky! It *evaluates* the string in
962 # ..._CC_SEARCH_FLAGS, which causes a substitution of the
963 # variable LIB_RUNTIME_DIR.
965 eval "EXP_CC_SEARCH_FLAGS=\"$TCL_CC_SEARCH_FLAGS\""
967 # now broken out into EXP_AND_TCL_LIBS. Had to do this
968 # in order to avoid repeating lib specs to which some systems object.
970 LIBS="$LIBS $LD_SEARCH_FLAGS"
973 # Set up makefile substitutions
975 AC_SUBST(EXP_BUILD_LIB_SPEC)
976 AC_SUBST(EXP_CC_SEARCH_FLAGS)
978 AC_SUBST(SETPGRP_VOID)
979 AC_SUBST(DEFAULT_STTY_ARGS)
980 # Expect uses these from tclConfig.sh to make the main executable
981 AC_SUBST(TCL_DL_LIBS)
982 AC_SUBST(TCL_CC_SEARCH_FLAGS)
984 #--------------------------------------------------------------------
985 # More TEA code based on data we got from the original expect
987 #--------------------------------------------------------------------
989 #-----------------------------------------------------------------------
990 # Specify the C source files to compile in TEA_ADD_SOURCES,
991 # public headers that need to be installed in TEA_ADD_HEADERS,
992 # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
993 # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
994 # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
995 # and PKG_TCL_SOURCES.
996 #-----------------------------------------------------------------------
999 exp_command.c expect.c exp_inter.c exp_regexp.c exp_tty.c
1000 exp_log.c exp_main_sub.c exp_pty.c exp_trap.c exp_strf.c
1001 exp_console.c exp_glob.c exp_win.c exp_clib.c exp_closetcl.c
1002 exp_memmove.c exp_tty_comm.c exp_chan.c Dbg.c
1005 # Variant sources. Comments in the Makefile indicate that the
1006 # event_type/able stuff can be overidden in the Makefile, and should
1007 # be for particular systems. IMHO this requires a configure option.
1009 # See at the end, where we select the sources based on the collect
1018 TEA_ADD_HEADERS([expect.h expect_tcl.h expect_comm.h tcldbg.h])
1020 TEA_ADD_INCLUDES([-I.])
1021 TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}`\"])
1024 TEA_ADD_CFLAGS([-DTCL_DEBUGGER -DUSE_NON_CONST])
1025 TEA_ADD_CFLAGS([-DSCRIPTDIR=\\\"\${DESTDIR}\${prefix}/lib/\${PKG_DIR}\\\"])
1026 TEA_ADD_CFLAGS([-DEXECSCRIPTDIR=\\\"\${DESTDIR}\${pkglibdir}\\\"])
1027 TEA_ADD_CFLAGS([-DSTTY_BIN=\\\"${STTY_BIN}\\\"])
1028 TEA_ADD_CFLAGS([-DDFLT_STTY=\"\\\"$DEFAULT_STTY_ARGS\\\"\"])
1030 TEA_ADD_STUB_SOURCES([])
1031 TEA_ADD_TCL_SOURCES([])
1033 #--------------------------------------------------------------------
1034 # This macro generates a line to use when building a library. It
1035 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
1036 # and TEA_LOAD_TCLCONFIG macros above.
1037 #--------------------------------------------------------------------
1041 #--------------------------------------------------------------------
1042 # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
1043 # file during the install process. Don't run the TCLSH_PROG through
1044 # ${CYGPATH} because it's being used directly by make.
1045 # Require that we use a tclsh shell version 8.2 or later since earlier
1046 # versions have bugs in the pkg_mkIndex routine.
1047 # Add WISH as well if this is a Tk extension.
1048 #--------------------------------------------------------------------
1052 #--------------------------------------------------------------------
1053 # Finally, substitute all of the various values into the Makefile.
1054 # You may alternatively have a special pkgIndex.tcl.in or other files
1055 # which require substituting th AC variables in. Include these here.
1056 #--------------------------------------------------------------------
1059 AC_OUTPUT([Makefile], chmod +x ${srcdir}/install-sh)