]> git.pld-linux.org Git - packages/expect.git/blob - expect-lib64.patch
- lib64(AMD64) fix for expect
[packages/expect.git] / expect-lib64.patch
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
4 @@ -1132,7 +1132,7 @@
5  fi
6  
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
11  
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
16 @@ -0,0 +1,1255 @@
17 +# Process this file with autoconf to produce a configure script.
18 +
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], )
23 +
24 +AC_INIT(expect.h)
25 +
26 +# note when updating version numbers here, also update pkgIndex.in (see
27 +# comments in Makefile)
28 +EXP_MAJOR_VERSION=5
29 +EXP_MINOR_VERSION=39
30 +EXP_MICRO_VERSION=0
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
36 +
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"
40 +
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
48 +# development.
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
53 +  newest=$i
54 +done
55 +if test "$srcdir/configure" = "$newest" ; then
56 +  AC_MSG_RESULT(yes)
57 +else
58 +  AC_MSG_RESULT(no)
59 +fi
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.])
62 +  exit
63 +fi
64 +
65 +dnl AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
66 +AC_CANONICAL_SYSTEM
67 +
68 +AC_CONFIG_HEADER(expect_cf.h)
69 +
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)
77 +
78 +# If `configure' is invoked (in)directly via `make', ensure that it
79 +# encounters no `make' conflicts.
80 +#
81 +dnl unset MFLAGS MAKEFLAGS
82 +MFLAGS=
83 +MAKEFLAGS=
84 +
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
103 +# EXP_LIBS.  Sigh.
104 +
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.
108 +OLD_CFLAGS=$CFLAGS
109 +AC_PROG_CC
110 +CFLAGS=$OLD_CFLAGS
111 +
112 +#------------------------------------------------------------------------
113 +# Hook for when threading is supported in Expect.  The --enable-threads
114 +# flag currently has no effect.
115 +#------------------------------------------------------------------------
116 +
117 +SC_ENABLE_THREADS
118 +
119 +CY_AC_PATH_TCLCONFIG
120 +CY_AC_LOAD_TCLCONFIG
121 +CC=$TCL_CC
122 +EXP_AND_TCL_LIBS=$TCL_LIBS
123 +CY_AC_PATH_TKCONFIG
124 +CY_AC_LOAD_TKCONFIG
125 +EXP_AND_TK_LIBS=$TK_LIBS
126 +
127 +
128 +CY_AC_C_WORKS
129 +
130 +# this'll use a BSD compatible install or our included install-sh
131 +AC_PROG_INSTALL
132 +
133 +# Tcl sets TCL_RANLIB appropriately for shared library if --enable-shared
134 +AC_PROG_RANLIB
135 +UNSHARED_RANLIB=$RANLIB
136 +
137 +# these are the other subdirectories we need to configure
138 +AC_CONFIG_SUBDIRS(testsuite)
139 +
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
147 +
148 +AC_TYPE_PID_T
149 +AC_RETSIGTYPE
150 +dnl AC_TIME_WITH_SYS_TIME
151 +AC_HEADER_TIME
152 +AC_HEADER_SYS_WAIT
153 +
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"
159 +else
160 +  EXP_CFLAGS="-g $TCL_EXTRA_CFLAGS"
161 +  # This is always "g" for unix.
162 +  DBGX=g
163 +fi
164 +case "${host}" in
165 + # Use -g on all systems but Linux where it upsets the dynamic X libraries.
166 +  i[[3456]]86-*-linux*)        EXP_CFLAGS="" ;;
167 +esac
168 +
169 +AC_MSG_CHECKING([if running Mach])
170 +mach=0
171 +case "${host}" in
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 ;;
176 +esac
177 +
178 +if test $mach -eq 1 ; then
179 +  AC_MSG_RESULT(yes)
180 +else
181 +  AC_MSG_RESULT(no)
182 +fi
183 +
184 +AC_MSG_CHECKING([if running MachTen])
185 +# yet another Mach clone
186 +if test -r /MachTen ; then
187 +  AC_MSG_RESULT(yes)
188 +  mach=1
189 +else
190 +  AC_MSG_RESULT(no)
191 +fi
192 +
193 +AC_MSG_CHECKING([if on Pyramid])
194 +if test -r /bin/pyr ; then
195 +  AC_MSG_RESULT(yes)
196 +  pyr=1
197 +else
198 +  AC_MSG_RESULT(no)
199 +  pyr=0
200 +fi
201 +
202 +AC_MSG_CHECKING([if on Apollo])
203 +if test -r /usr/apollo/bin ; then
204 +  AC_MSG_RESULT(yes)
205 +  apollo=1
206 +else
207 +  AC_MSG_RESULT(no)
208 +  apollo=0
209 +fi
210 +
211 +AC_MSG_CHECKING([if on Interactive])
212 +if test "x`(uname -s) 2>/dev/null`" = xIUNIX; then
213 +  AC_MSG_RESULT(yes)
214 +  iunix=1
215 +else
216 +  AC_MSG_RESULT(no)
217 +  iunix=0
218 +fi
219 +
220 +AC_MSG_CHECKING([if stty reads stdout])
221 +
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.
225 +
226 +stty_reads_stdout=""
227 +case "${host}" in
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 ;;
241 +esac
242 +
243 +if test $mach -eq 1 ; then
244 +  stty_reads_stdout=1
245 +fi
246 +if test $apollo -eq 1 ; then
247 +  stty_reads_stdout=1
248 +fi
249 +if test $pyr -eq 1 ; then
250 +  stty_reads_stdout=1
251 +fi
252 +
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
258 +  else
259 +    stty_reads_stdout=0
260 +  fi
261 +fi
262 +
263 +if test ${stty_reads_stdout} -eq 1 ; then
264 +  AC_MSG_RESULT(yes)
265 +  AC_DEFINE(STTY_READS_STDOUT)
266 +else
267 +  AC_MSG_RESULT(no)
268 +fi
269 +
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])
273 +solaris=0
274 +case "${host}" in
275 +  *-*-solaris*)                solaris=1;;
276 +esac
277 +
278 +if test $solaris -eq 1 ; then
279 +  AC_MSG_RESULT(yes)
280 +  AC_DEFINE(SOLARIS)
281 +else
282 +  AC_MSG_RESULT(no)
283 +fi
284 +
285 +
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" )
289 +
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
296 +  EXP_LIBS=$LIBS
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" 
302 +       ])
303 +  LIBS=EXP_LIBS
304 +fi
305 +
306 +#
307 +# Ok, lets find the tcl source trees so we can use the headers
308 +#
309 +CY_AC_PATH_TCLH
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."
315 +    exit 1
316 +fi
317 +
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)
325 +else
326 +  AC_MSG_RESULT(unshared)
327 +fi
328 +
329 +#
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.
335 +#
336 +# Incidentally, the debugger can't depend on Expect's cf file, because
337 +# the debugger is designed to be independent of Expect.
338 +# 
339 +
340 +test -n "$verbose" && echo "configuring Tcl debugger"
341 +tmpdir=./Dbg$$
342 +mkdir ${tmpdir}
343 +
344 +#if test "${enable_shared+set}" = set; then
345 +if test "${enable_shared}" = "yes"; then
346 +  dbg_config_flags='--enable-shared'
347 +else
348 +  dbg_config_flags='--disable-shared'
349 +fi
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)`"
356 +fi
357 +if test "x$with_tcllibdir" != "x" ; then
358 +  dbg_config_flags="$dbg_config_flags --with-tcllibdir=`(cd ${with_tcllibdir}; pwd)`"
359 +fi
360 +if test "x$with_tcllib" != "x" ; then
361 +  dbg_config_flags="$dbg_config_flags --with-tcllib=`(cd ${with_tcllib}; pwd)`"
362 +fi
363 +if test "x$with_tclinclude" != "x" ; then
364 +  dbg_config_flags="$dbg_config_flags --with-tclinclude=`(cd ${with_tclinclude}; pwd)`"
365 +fi
366 +case "$cache_file" in
367 + /*)
368 +    dbg_config_flags="$dbg_config_flags --cache-file=$cache_file"
369 +    ;;
370 + *)
371 +    dbg_config_flags="$dbg_config_flags --cache-file=../$cache_file"
372 +    ;;
373 +esac
374 +
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 .
380 +rm -rf $tmpdir
381 +test -n "$verbose" && echo "configured Tcl debugger"
382 +
383 +# some people would complain if this explanation wasn't provided...
384 +
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."
388 +
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")
396 +fi
397 +# save results and retry for Tcl
398 +EXP_LIBS=$LIBS
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")
405 +fi
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")
414 +fi
415 +# save Tk results and reset for Expect
416 +EXP_AND_TK_LIBS=$LIBS
417 +LIBS=$EXP_LIBS
418 +
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")
426 +fi
427 +# save results and retry for Tcl
428 +EXP_LIBS=$LIBS
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")
435 +fi
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")
444 +fi
445 +# save Tk results and reset for Expect
446 +EXP_AND_TK_LIBS=$LIBS
447 +LIBS=$EXP_LIBS
448 +
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")
455 +fi
456 +# save results and retry for Tcl
457 +EXP_LIBS=$LIBS
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")
464 +fi
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")
473 +fi
474 +# save Tk results and reset for Expect
475 +EXP_AND_TK_LIBS=$LIBS
476 +LIBS=$EXP_LIBS
477 +
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)
484 +fi
485 +# save results and retry for Tcl
486 +EXP_LIBS=$LIBS
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)
493 +fi
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)
502 +fi
503 +# save Tk results and reset for Expect
504 +EXP_AND_TK_LIBS=$LIBS
505 +LIBS=$EXP_LIBS
506 +
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"
519 +  ])
520 +fi
521 +# save results and retry for Tcl
522 +EXP_LIBS=$LIBS
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"
531 +  ])
532 +fi
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"
543 +  ])
544 +fi
545 +# save Tk results and reset for Expect
546 +EXP_AND_TK_LIBS=$LIBS
547 +LIBS=$EXP_LIBS
548 +
549 +######################################################################
550 +# End of library/func checking
551 +######################################################################
552 +
553 +# Hand patches to library/func checking.
554 +
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!
561 + AC_MSG_RESULT(yes)
562 +else
563 + AC_MSG_RESULT(no)
564 +fi
565 +
566 +######################################################################
567 +#
568 +# Look for various header files
569 +#
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))
573 +
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))
577 +
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))
590 +
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)
594 +dnl #fi
595 +
596 +AC_MSG_CHECKING([for sys/bsdtypes.h])
597 +if test "ISC_${ISC}" = "ISC_1"   ;    then
598 +   AC_MSG_RESULT(yes)
599 +   # if on ISC 1, we need <sys/bsdtypes.h> to get FD_SET macros
600 +   AC_HAVE_HEADERS(sys/bsdtypes.h)
601 +else
602 +   AC_MSG_RESULT(no)
603 +fi
604 +
605 +#
606 +# Look for functions that may be missing
607 +#
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))
615 +
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])
620 +AC_TRY_LINK(,[
621 +char *s1, *s2;
622 +memcpy(s1,s2,0);
623 +],
624 +       AC_MSG_RESULT(yes)
625 +       AC_DEFINE(HAVE_MEMCPY)
626 +       ,
627 +       AC_MSG_RESULT(no)
628 +)
629 +
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
633 +# seen this is ISC.
634 +AC_MSG_CHECKING([if WNOHANG requires _POSIX_SOURCE])
635 +AC_TRY_RUN([
636 +#include <sys/wait.h>
637 +main() {
638 +#ifndef WNOHANG
639 +       return 0;
640 +#else
641 +       return 1;
642 +#endif
643 +}],
644 +       AC_MSG_RESULT(yes)
645 +       AC_DEFINE(WNOHANG_REQUIRES_POSIX_SOURCE)
646 +,
647 +       AC_MSG_RESULT(no)
648 +,
649 +       AC_MSG_ERROR([Expect can't be cross compiled])
650 +)
651 +
652 +AC_MSG_CHECKING([if any value exists for WNOHANG])
653 +rm -rf wnohang
654 +AC_TRY_RUN([
655 +#include <stdio.h>
656 +#include <sys/wait.h>
657 +main() {
658 +#ifdef WNOHANG
659 +       FILE *fp = fopen("wnohang","w");
660 +       fprintf(fp,"%d",WNOHANG);
661 +       fclose(fp);
662 +       return 0;
663 +#else
664 +       return 1;
665 +#endif
666 +}],
667 +       AC_MSG_RESULT(yes)
668 +       AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
669 +       rm -f wnohang
670 +,
671 +       AC_MSG_RESULT(no)
672 +       AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
673 +,
674 +       AC_MSG_ERROR([Expect can't be cross compiled])
675 +)
676 +
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
682 +#      the trick.
683 +#--------------------------------------------------------------------
684 +
685 +AC_MSG_CHECKING([union wait])
686 +AC_TRY_LINK([#include <sys/types.h> 
687 +#include <sys/wait.h>], [
688 +union wait x;
689 +WIFEXITED(x);          /* Generates compiler error if WIFEXITED
690 +                        * uses an int. */
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)
695 +fi
696 +
697 +
698 +
699 +#
700 +# check how signals work
701 +#
702 +
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
710 +  AC_MSG_RESULT(int)
711 +  AC_DEFINE(SELECT_MASK_TYPE, int)
712 +else
713 +  AC_MSG_RESULT(none)
714 +fi
715 +
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)
720 +
721 +# FIXME: check if alarm exists
722 +AC_MSG_CHECKING([if signals need to be re-armed])
723 +AC_TRY_RUN([
724 +#include <signal.h>
725 +#define RETSIGTYPE $retsigtype
726 +
727 +int signal_rearms = 0;
728 +
729 +RETSIGTYPE
730 +child_sigint_handler(n)
731 +int n;
732 +{
733 +}
734 +
735 +RETSIGTYPE
736 +parent_sigint_handler(n)
737 +int n;
738 +{
739 +signal_rearms++;
740 +}
741 +
742 +main()
743 +{
744 +       signal(SIGINT,parent_sigint_handler);
745 +
746 +       if (0 == fork()) {
747 +               signal(SIGINT,child_sigint_handler);
748 +               kill(getpid(),SIGINT);
749 +               kill(getpid(),SIGINT);
750 +               kill(getppid(),SIGINT);
751 +       } else {
752 +               int status;
753 +
754 +               wait(&status);
755 +               unlink("core");
756 +               exit(signal_rearms);
757 +       }
758 +}],
759 +       AC_MSG_RESULT(yes)
760 +       AC_DEFINE(REARM_SIG)
761 +,
762 +       AC_MSG_RESULT(no)
763 +, AC_MSG_WARN([Expect can't be cross compiled])
764 +)
765 +
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
770 +"
771 +#
772 +
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])
778 +convex=0
779 +case "${host}" in
780 +  c[[12]]-*-*)         convex=1;;
781 +esac
782 +
783 +if test $convex -eq 1 ; then
784 +  AC_MSG_RESULT(yes)
785 +  AC_DEFINE(CONVEX)
786 +else
787 +  AC_MSG_RESULT(no)
788 +fi
789 +
790 +EXP_LDFLAGS="$LDFLAGS"
791 +
792 +AC_MSG_CHECKING([if on NeXT])
793 +if test -r /NextApps ; then
794 +  AC_MSG_RESULT(yes)
795 +  # "-m" flag suppresses complaints about multiple strtod
796 +  EXP_LDFLAGS="$EXP_LDFLAGS -m"
797 +else
798 +  AC_MSG_RESULT(no)
799 +fi
800 +
801 +
802 +AC_MSG_CHECKING([if on HP])
803 +if test "x`(uname) 2>/dev/null`" = xHP-UX; then
804 +  AC_MSG_RESULT(yes)
805 +  hp=1
806 +else
807 +  AC_MSG_RESULT(no)
808 +  hp=0
809 +fi
810 +
811 +AC_MSG_CHECKING([sane default stty arguments])
812 +DEFAULT_STTY_ARGS="sane"
813 +
814 +if test $mach -eq 1 ; then
815 +       DEFAULT_STTY_ARGS="cooked"
816 +fi
817 +
818 +if test $hp -eq 1 ; then
819 +       DEFAULT_STTY_ARGS="sane kill \15"
820 +fi
821 +
822 +AC_MSG_RESULT($DEFAULT_STTY_ARG)
823 +
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.
827 +#
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
832 +    AC_MSG_RESULT(yes)
833 +    AC_DEFINE(HAVE_PTYM)
834 +else
835 +    AC_MSG_RESULT(no)
836 +fi
837 +
838 +AC_MSG_CHECKING([for HP style pty trapping])
839 +AC_HEADER_EGREP([struct.*request_info], sys/ptyio.h,
840 +       AC_MSG_RESULT(yes)
841 +       AC_DEFINE(HAVE_PTYTRAP)
842 +,
843 +       AC_MSG_RESULT(no)
844 +)
845 +
846 +AC_MSG_CHECKING([for AIX new-style pty allocation])
847 +if test -r /dev/ptc -a -r /dev/pts ; then
848 +    AC_MSG_RESULT(yes)
849 +    AC_DEFINE(HAVE_PTC_PTS)
850 +else
851 +    AC_MSG_RESULT(no)
852 +fi
853 +
854 +AC_MSG_CHECKING([for SGI old-style pty allocation])
855 +if test -r /dev/ptc -a ! -r /dev/pts ; then
856 +    AC_MSG_RESULT(yes)
857 +    AC_DEFINE(HAVE_PTC)
858 +else
859 +    AC_MSG_RESULT(no)
860 +fi
861 +
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.
866 +#
867 +AC_MSG_CHECKING([for SCO style pty allocation])
868 +sco_ptys=""
869 +case "${host}" in
870 +  *-sco3.2v[[45]]*)    sco_clist_ptys=1 svr4_ptys_broken=1;;
871 +esac
872 +
873 +if test x"${sco_clist_ptys}" != x"" ; then
874 +  AC_MSG_RESULT(yes)
875 +  AC_DEFINE(HAVE_SCO_CLIST_PTYS)
876 +else
877 +  AC_MSG_RESULT(no)
878 +fi
879 +
880 +AC_MSG_CHECKING([for SVR4 style pty allocation])
881 +if test -r /dev/ptmx -a "x$svr4_ptys_broken" = x ; then
882 +  AC_MSG_RESULT(yes)
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")
890 +else
891 +  AC_MSG_RESULT(no)
892 +fi
893 +
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)
899 +    AC_MSG_RESULT(yes)
900 +else
901 +    AC_MSG_RESULT(no)
902 +fi
903 +
904 +tcgetattr=0
905 +tcsetattr=0
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)
910 +    AC_DEFINE(POSIX)
911 +fi
912 +
913 +# first check for the pure bsd
914 +AC_MSG_CHECKING([for struct sgttyb])
915 +AC_TRY_RUN([
916 +#include <sgtty.h>
917 +main()
918 +{
919 +  struct sgttyb tmp;
920 +  exit(0);
921 +}],
922 +        AC_MSG_RESULT(yes)
923 +        AC_DEFINE(HAVE_SGTTYB)
924 +        PTY_TYPE=sgttyb
925 +,
926 +        AC_MSG_RESULT(no)
927 +,
928 +       AC_MSG_ERROR([Expect can't be cross compiled])
929 +)
930 +
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
934 +
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>
941 +  main()
942 +  {
943 +    struct termio tmp;
944 +    exit(0);
945 +  }],
946 +        AC_DEFINE(HAVE_TERMIO)
947 +        PTY_TYPE=termios
948 +        AC_MSG_RESULT(yes)
949 +,
950 +        AC_MSG_RESULT(no)
951 +,
952 +       AC_MSG_ERROR([Expect can't be cross compiled])
953 +)
954 +
955 +  # now check for the new style ttys (not yet posix)
956 +  AC_MSG_CHECKING([for struct termios])
957 +  AC_TRY_RUN([
958 +  /* including termios.h on Solaris 5.6 fails unless inttypes.h included */
959 +#  ifdef HAVE_INTTYPES_H
960 +#  include <inttypes.h>
961 +#  endif
962 +#  include <termios.h>
963 +  main()
964 +  {
965 +    struct termios tmp;
966 +    exit(0);
967 +  }],
968 +        AC_DEFINE(HAVE_TERMIOS)
969 +        PTY_TYPE=termios
970 +        AC_MSG_RESULT(yes)
971 +  ,
972 +        AC_MSG_RESULT(no)
973 +  ,
974 +       AC_MSG_ERROR([Expect can't be cross compiled])
975 +  )
976 +fi
977 +
978 +AC_MSG_CHECKING([if TCGETS or TCGETA in termios.h])
979 +AC_TRY_RUN([
980 +/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
981 +#ifdef HAVE_INTTYPES_H
982 +#include <inttypes.h>
983 +#endif
984 +#include <termios.h>
985 +main() {
986 +#if defined(TCGETS) || defined(TCGETA)
987 +       return 0;
988 +#else
989 +       return 1;
990 +#endif
991 +}],
992 +       AC_DEFINE(HAVE_TCGETS_OR_TCGETA_IN_TERMIOS_H)
993 +       AC_MSG_RESULT(yes)
994 +,
995 +       AC_MSG_RESULT(no)
996 +,
997 +       AC_MSG_ERROR([Expect can't be cross compiled])
998 +)
999 +
1000 +AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
1001 +AC_TRY_RUN([
1002 +/* including termios.h on Solaris 5.6 fails unless inttypes.h included */
1003 +#ifdef HAVE_INTTYPES_H
1004 +#include <inttypes.h>
1005 +#endif
1006 +#include <termios.h>
1007 +main() {
1008 +#ifdef TIOCGWINSZ
1009 +       return 0;
1010 +#else
1011 +       return 1;
1012 +#endif
1013 +}],
1014 +       AC_DEFINE(HAVE_TIOCGWINSZ_IN_TERMIOS_H)
1015 +       AC_MSG_RESULT(yes)
1016 +,
1017 +       AC_MSG_RESULT(no)
1018 +,
1019 +       AC_MSG_ERROR([Expect can't be cross compiled])
1020 +)
1021 +
1022 +# finally check for Cray style ttys
1023 +AC_MSG_CHECKING([for Cray-style ptys])
1024 +SETUID=":"
1025 +AC_TRY_RUN([
1026 +main(){
1027 +#ifdef CRAY
1028 +       return 0;
1029 +#else
1030 +       return 1;
1031 +#endif
1032 +}
1033 +],
1034 +       PTY_TYPE=unicos
1035 +       SETUID="chmod u+s"
1036 +       AC_MSG_RESULT(yes)
1037 +,
1038 +       AC_MSG_RESULT(no)
1039 +,
1040 +       AC_MSG_ERROR([Expect can't be cross compiled])
1041 +)
1042 +
1043 +#
1044 +# Check for select and/or poll. If both exist, we prefer select.
1045 +# if neither exists, define SIMPLE_EVENT.
1046 +#
1047 +select=0
1048 +poll=0
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
1054 +  EVENT_TYPE=select
1055 +  EVENT_ABLE=event
1056 +  AC_MSG_RESULT(via select)
1057 +elif test $poll -eq 1 ; then
1058 +  EVENT_TYPE=poll
1059 +  EVENT_ABLE=event
1060 +  AC_MSG_RESULT(via poll)
1061 +else
1062 +  EVENT_TYPE=simple
1063 +  EVENT_ABLE=noevent
1064 +  AC_MSG_RESULT(none)
1065 +  AC_DEFINE(SIMPLE_EVENT)
1066 +fi
1067 +
1068 +AC_HAVE_FUNCS(_getpty)
1069 +AC_HAVE_FUNCS(getpty)
1070 +
1071 +# following test sets SETPGRP_VOID if setpgrp takes 0 args, else takes 2
1072 +AC_FUNC_SETPGRP
1073 +
1074 +#
1075 +# check for timezones
1076 +#
1077 +AC_MSG_CHECKING([for SV-style timezone])
1078 +AC_TRY_RUN([
1079 +extern char *tzname[2];
1080 +extern int daylight;
1081 +main()
1082 +{
1083 +  int *x = &daylight;
1084 +  char **y = tzname;
1085 +
1086 +  exit(0);
1087 +}],
1088 +       AC_DEFINE(HAVE_SV_TIMEZONE)
1089 +       AC_MSG_RESULT(yes),
1090 +       AC_MSG_RESULT(no)
1091 +,
1092 +       AC_MSG_ERROR([Expect can't be cross compiled])
1093 +)
1094 +
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
1098 +   no_tk=true
1099 +else
1100 +   CY_AC_PATH_TKH
1101 +fi
1102 +if test x"$no_tk" != x"true" ; then
1103 +# libexpectk no longer exists
1104 +#  X_PROGS="expectk \$(LIBEXPECTK)"
1105 +  X_PROGS=expectk
1106 +# should really generate following symbol, but I'm hitting configure's limit on substs.
1107 +  X_PROGS_INSTALLED=expectk_installed
1108 +else
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."
1116 +fi
1117 +
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])
1123 +
1124 +AC_ARG_ENABLE(gcc,
1125 +       [  --enable-gcc        allow use of gcc if available],
1126 +       [enable_gcc=$enableval], [enable_gcc=no])
1127 +
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.
1133 +
1134 +if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
1135 +    EXP_LIB_VERSION=$EXP_VERSION
1136 +else
1137 +    EXP_LIB_VERSION=$EXP_VERSION_NODOTS
1138 +fi
1139 +if test $iunix -eq 1 ; then
1140 +    EXP_LIB_VERSION=$EXP_VERSION_NODOTS
1141 +fi
1142 +
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
1148 +fi
1149 +
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
1153 +
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?)
1158 +
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)
1166 +else
1167 +  EXP_SHLIB_CFLAGS=
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)
1172 +fi
1173 +
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.  
1178 +#
1179 +if test "x$TCL_SHLIB_LD_LIBS" = "x" ; then
1180 +       EXP_SHLIB_LD_LIBS="$LIBS"
1181 +else
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"
1185 +fi
1186 +
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 +#--------------------------------------------------------------------
1199 +
1200 +LIB_RUNTIME_DIR='${LIB_RUNTIME_DIR}'
1201 +
1202 +# If Tcl and Expect are installed in different places, adjust the library
1203 +# search path to reflect this.
1204 +
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"
1208 +  fi
1209 +else
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)
1214 +  fi
1215 +fi
1216 +
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'`
1219 +fi
1220 +
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.
1224 +
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}
1228 +else
1229 +  eval "EXP_CC_SEARCH_FLAGS=\"$TK_CC_SEARCH_FLAGS\""
1230 +  EXP_LD_SEARCH_FLAGS=${TK_LD_SEARCH_FLAGS}
1231 +fi
1232 +
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"
1237 +
1238 +#
1239 +# Set up makefile substitutions
1240 +#
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)
1246 +AC_SUBST(CC)
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)
1262 +AC_SUBST(X_PROGS)
1263 +AC_SUBST(PTY_TYPE)
1264 +AC_SUBST(EVENT_TYPE)
1265 +AC_SUBST(EVENT_ABLE)
1266 +AC_SUBST(SETUID)
1267 +AC_SUBST(UNSHARED_RANLIB)
1268 +AC_SUBST(DEFAULT_STTY_ARGS)
1269 +AC_OUTPUT([Makefile \
1270 +       pkgIndex],
1271 +       chmod +x ${srcdir}/install-sh ${srcdir}/mkinstalldirs)
This page took 0.592901 seconds and 3 git commands to generate.