home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tcl2-73c.zip / tcl7.3 / configure < prev    next >
Text File  |  1993-09-24  |  25KB  |  1,016 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  25.  
  26. for arg
  27. do
  28.   # Handle --exec-prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -fr conftest* core; exit 1' 1 3 15
  82.  
  83. # NLS nuisances.
  84. # These must not be set unconditionally because not all systems understand
  85. # e.g. LANG=C (notably SCO).
  86. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  87. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  88.  
  89. rm -f conftest*
  90. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  91.  
  92. # A filename unique to this package, relative to the directory that
  93. # configure is in, which we can look for to find out if srcdir is correct.
  94. unique_file=tcl.h
  95.  
  96. # Find the source files, if location was not specified.
  97. if test -z "$srcdir"; then
  98.   srcdirdefaulted=yes
  99.   # Try the directory containing this script, then `..'.
  100.   prog=$0
  101.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  102.   test "X$confdir" = "X$prog" && confdir=.
  103.   srcdir=$confdir
  104.   if test ! -r $srcdir/$unique_file; then
  105.     srcdir=..
  106.   fi
  107. fi
  108. if test ! -r $srcdir/$unique_file; then
  109.   if test x$srcdirdefaulted = xyes; then
  110.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  111.   else
  112.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  113.   fi
  114.   exit 1
  115. fi
  116. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  117. # But we can't avoid them for `..', to make subdirectories work.
  118. case $srcdir in
  119.   .|/*|~*) ;;
  120.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  121. esac
  122.  
  123. # Save the original args to write them into config.status later.
  124. configure_args="$*"
  125.  
  126. # Make sure to not get the incompatible SysV /etc/install and
  127. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  128. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  129. # or the AFS install, which mishandles nonexistent args, or
  130. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  131. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  132. # anyway.  Sigh.
  133. if test "z${INSTALL}" = "z" ; then
  134.   echo checking for install
  135.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  136.   for dir in $PATH; do
  137.     test -z "$dir" && dir=.
  138.     case $dir in
  139.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  140.     *)
  141.       if test -f $dir/installbsd; then
  142.     INSTALL="$dir/installbsd -c" # OSF1
  143.     INSTALL_PROGRAM='$(INSTALL)'
  144.     INSTALL_DATA='$(INSTALL) -m 644'
  145.     break
  146.       fi
  147.       if test -f $dir/install; then
  148.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  149.       : # AIX
  150.     else
  151.       INSTALL="$dir/install -c"
  152.       INSTALL_PROGRAM='$(INSTALL)'
  153.       INSTALL_DATA='$(INSTALL) -m 644'
  154.       break
  155.     fi
  156.       fi
  157.       ;;
  158.     esac
  159.   done
  160.   IFS="$saveifs"
  161. fi
  162. INSTALL=${INSTALL-cp}
  163. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  164. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  165.  
  166. if test -z "$RANLIB"; then
  167.   # Extract the first word of `ranlib', so it can be a program name with args.
  168.   set dummy ranlib; word=$2
  169.   echo checking for $word
  170.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  171.   for dir in $PATH; do
  172.     test -z "$dir" && dir=.
  173.     if test -f $dir/$word; then
  174.       RANLIB="ranlib"
  175.       break
  176.     fi
  177.   done
  178.   IFS="$saveifs"
  179. fi
  180. test -z "$RANLIB" && RANLIB=":"
  181. test -n "$RANLIB" -a -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  182.  
  183. CC=${CC-cc}
  184.  
  185.  
  186. #--------------------------------------------------------------------
  187. #    Supply substitutes for missing POSIX library procedures, or
  188. #    set flags so Tcl uses alternate procedures.
  189. #--------------------------------------------------------------------
  190.  
  191. for func in getcwd opendir strerror strstr
  192. do
  193. echo checking for ${func}
  194. cat > conftest.c <<EOF
  195. #include <ctype.h>
  196. int main() { exit(0); }
  197. int t() { 
  198. /* The GNU C library defines this for functions which it implements
  199.     to always fail with ENOSYS.  Some functions are actually named
  200.     something starting with __ and the normal name is an alias.  */
  201. #if defined (__stub_${func}) || defined (__stub___${func})
  202. choke me
  203. #else
  204. /* Override any gcc2 internal prototype to avoid an error.  */
  205. extern char ${func}(); ${func}();
  206. #endif
  207.  }
  208. EOF
  209. if eval $compile; then
  210.   :
  211. else
  212.   LIBOBJS="$LIBOBJS ${func}.o"
  213. test -n "$verbose" && echo "    using ${func}.o instead"
  214. fi
  215. rm -f conftest*
  216.  
  217. done
  218.  
  219. for func in strtol tmpnam waitpid
  220. do
  221. echo checking for ${func}
  222. cat > conftest.c <<EOF
  223. #include <ctype.h>
  224. int main() { exit(0); }
  225. int t() { 
  226. /* The GNU C library defines this for functions which it implements
  227.     to always fail with ENOSYS.  Some functions are actually named
  228.     something starting with __ and the normal name is an alias.  */
  229. #if defined (__stub_${func}) || defined (__stub___${func})
  230. choke me
  231. #else
  232. /* Override any gcc2 internal prototype to avoid an error.  */
  233. extern char ${func}(); ${func}();
  234. #endif
  235.  }
  236. EOF
  237. if eval $compile; then
  238.   :
  239. else
  240.   LIBOBJS="$LIBOBJS ${func}.o"
  241. test -n "$verbose" && echo "    using ${func}.o instead"
  242. fi
  243. rm -f conftest*
  244.  
  245. done
  246.  
  247. echo checking for gettimeofday
  248. cat > conftest.c <<EOF
  249. #include <ctype.h>
  250. int main() { exit(0); }
  251. int t() { 
  252. /* The GNU C library defines this for functions which it implements
  253.     to always fail with ENOSYS.  Some functions are actually named
  254.     something starting with __ and the normal name is an alias.  */
  255. #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
  256. choke me
  257. #else
  258. /* Override any gcc2 internal prototype to avoid an error.  */
  259. extern char gettimeofday(); gettimeofday();
  260. #endif
  261.  }
  262. EOF
  263. if eval $compile; then
  264.   :
  265. else
  266.   {
  267. test -n "$verbose" && \
  268. echo "    defining NO_GETTOD"
  269. DEFS="$DEFS -DNO_GETTOD=1"
  270. }
  271.  
  272. fi
  273. rm -f conftest*
  274.  
  275. echo checking for getwd
  276. cat > conftest.c <<EOF
  277. #include <ctype.h>
  278. int main() { exit(0); }
  279. int t() { 
  280. /* The GNU C library defines this for functions which it implements
  281.     to always fail with ENOSYS.  Some functions are actually named
  282.     something starting with __ and the normal name is an alias.  */
  283. #if defined (__stub_getwd) || defined (__stub___getwd)
  284. choke me
  285. #else
  286. /* Override any gcc2 internal prototype to avoid an error.  */
  287. extern char getwd(); getwd();
  288. #endif
  289.  }
  290. EOF
  291. if eval $compile; then
  292.   :
  293. else
  294.   {
  295. test -n "$verbose" && \
  296. echo "    defining NO_GETWD"
  297. DEFS="$DEFS -DNO_GETWD=1"
  298. }
  299.  
  300. fi
  301. rm -f conftest*
  302.  
  303. echo checking for wait3
  304. cat > conftest.c <<EOF
  305. #include <ctype.h>
  306. int main() { exit(0); }
  307. int t() { 
  308. /* The GNU C library defines this for functions which it implements
  309.     to always fail with ENOSYS.  Some functions are actually named
  310.     something starting with __ and the normal name is an alias.  */
  311. #if defined (__stub_wait3) || defined (__stub___wait3)
  312. choke me
  313. #else
  314. /* Override any gcc2 internal prototype to avoid an error.  */
  315. extern char wait3(); wait3();
  316. #endif
  317.  }
  318. EOF
  319. if eval $compile; then
  320.   :
  321. else
  322.   {
  323. test -n "$verbose" && \
  324. echo "    defining NO_WAIT3"
  325. DEFS="$DEFS -DNO_WAIT3=1"
  326. }
  327.  
  328. fi
  329. rm -f conftest*
  330.  
  331.  
  332. #--------------------------------------------------------------------
  333. #    Supply substitutes for missing POSIX header files.  Special
  334. #    notes:
  335. #        - Sprite's dirent.h exists but is bogus.
  336. #        - stdlib.h doesn't define strtol, strtoul, or
  337. #          strtod insome versions of SunOS
  338. #        - some versions of string.h don't declare procedures such
  339. #          as strstr
  340. #--------------------------------------------------------------------
  341.  
  342. echo checking for unistd.h
  343. echo checking how to run the C preprocessor
  344. if test -z "$CPP"; then
  345.   # This must be in double quotes, not single quotes, because CPP may get
  346.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  347.   # make.  It must be expanded now.
  348.   CPP="${CC-cc} -E"
  349.   cat > conftest.c <<EOF
  350. #include <stdio.h>
  351. Syntax Error
  352. EOF
  353. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  354. if test -z "$err"; then
  355.   :
  356. else
  357.   CPP=/lib/cpp
  358. fi
  359. rm -f conftest*
  360. fi
  361. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  362.  
  363. cat > conftest.c <<EOF
  364. #include <unistd.h>
  365. EOF
  366. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  367. if test -z "$err"; then
  368.   
  369. {
  370. test -n "$verbose" && \
  371. echo "    defining HAVE_UNISTD_H"
  372. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  373. }
  374.  
  375. fi
  376. rm -f conftest*
  377.  
  378. echo checking for dirent.h
  379. cat > conftest.c <<EOF
  380. #include <sys/types.h>
  381. #include <dirent.h>
  382. int main() { exit(0); }
  383. int t() { 
  384. DIR *d;
  385. struct dirent *entryPtr;
  386. char *p;
  387. d = opendir("foobar");
  388. entryPtr = readdir(d);
  389. p = entryPtr->d_name;
  390. closedir(d);
  391.  }
  392. EOF
  393. if eval $compile; then
  394.   tcl_ok=1
  395. else
  396.   tcl_ok=0
  397. fi
  398. rm -f conftest*
  399.  
  400. echo '#include <tcl_ok=0>' > conftest.c
  401. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  402. if egrep "Sprite version.* NOT POSIX" conftest.out >/dev/null 2>&1; then
  403.   :
  404. fi
  405. rm -f conftest*
  406.  
  407. if test $tcl_ok = 0; then
  408.     
  409. {
  410. test -n "$verbose" && \
  411. echo "    defining NO_DIRENT_H"
  412. DEFS="$DEFS -DNO_DIRENT_H=1"
  413. }
  414.  
  415. fi
  416. echo checking for errno.h
  417. cat > conftest.c <<EOF
  418. #include <errno.h>
  419. EOF
  420. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  421. if test -z "$err"; then
  422.   :
  423. else
  424.   
  425. {
  426. test -n "$verbose" && \
  427. echo "    defining NO_ERRNO_H"
  428. DEFS="$DEFS -DNO_ERRNO_H=1"
  429. }
  430.  
  431. fi
  432. rm -f conftest*
  433.  
  434. echo checking for float.h
  435. cat > conftest.c <<EOF
  436. #include <float.h>
  437. EOF
  438. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  439. if test -z "$err"; then
  440.   :
  441. else
  442.   
  443. {
  444. test -n "$verbose" && \
  445. echo "    defining NO_FLOAT_H"
  446. DEFS="$DEFS -DNO_FLOAT_H=1"
  447. }
  448.  
  449. fi
  450. rm -f conftest*
  451.  
  452. echo checking for limits.h
  453. cat > conftest.c <<EOF
  454. #include <limits.h>
  455. EOF
  456. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  457. if test -z "$err"; then
  458.   :
  459. else
  460.   
  461. {
  462. test -n "$verbose" && \
  463. echo "    defining NO_LIMITS_H"
  464. DEFS="$DEFS -DNO_LIMITS_H=1"
  465. }
  466.  
  467. fi
  468. rm -f conftest*
  469.  
  470. echo checking for stdlib.h
  471. cat > conftest.c <<EOF
  472. #include <stdlib.h>
  473. EOF
  474. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  475. if test -z "$err"; then
  476.   tcl_ok=1
  477. else
  478.   tcl_ok=0
  479. fi
  480. rm -f conftest*
  481.  
  482. echo '#include <stdlib.h>' > conftest.c
  483. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  484. if egrep "strtol" conftest.out >/dev/null 2>&1; then
  485.   :
  486. else
  487.   tcl_ok=0
  488. fi
  489. rm -f conftest*
  490.  
  491. echo '#include <stdlib.h>' > conftest.c
  492. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  493. if egrep "strtoul" conftest.out >/dev/null 2>&1; then
  494.   :
  495. else
  496.   tcl_ok=0
  497. fi
  498. rm -f conftest*
  499.  
  500. echo '#include <stdlib.h>' > conftest.c
  501. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  502. if egrep "strtod" conftest.out >/dev/null 2>&1; then
  503.   :
  504. else
  505.   tcl_ok=0
  506. fi
  507. rm -f conftest*
  508.  
  509. if test $tcl_ok = 0; then
  510.     
  511. {
  512. test -n "$verbose" && \
  513. echo "    defining NO_STDLIB_H"
  514. DEFS="$DEFS -DNO_STDLIB_H=1"
  515. }
  516.  
  517. fi
  518. echo checking for string.h
  519. cat > conftest.c <<EOF
  520. #include <string.h>
  521. EOF
  522. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  523. if test -z "$err"; then
  524.   tcl_ok=1
  525. else
  526.   tcl_ok=0
  527. fi
  528. rm -f conftest*
  529.  
  530. echo '#include <string.h>' > conftest.c
  531. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  532. if egrep "strstr" conftest.out >/dev/null 2>&1; then
  533.   :
  534. else
  535.   tcl_ok=0
  536. fi
  537. rm -f conftest*
  538.  
  539. echo '#include <string.h>' > conftest.c
  540. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  541. if egrep "strerror" conftest.out >/dev/null 2>&1; then
  542.   :
  543. else
  544.   tcl_ok=0
  545. fi
  546. rm -f conftest*
  547.  
  548. if test $tcl_ok = 0; then
  549.     
  550. {
  551. test -n "$verbose" && \
  552. echo "    defining NO_STRING_H"
  553. DEFS="$DEFS -DNO_STRING_H=1"
  554. }
  555.  
  556. fi
  557. echo checking for sys/time.h
  558. cat > conftest.c <<EOF
  559. #include <sys/time.h>
  560. EOF
  561. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  562. if test -z "$err"; then
  563.   :
  564. else
  565.   
  566. {
  567. test -n "$verbose" && \
  568. echo "    defining NO_SYS_TIME_H"
  569. DEFS="$DEFS -DNO_SYS_TIME_H=1"
  570. }
  571.  
  572. fi
  573. rm -f conftest*
  574.  
  575. echo checking for sys/wait.h
  576. cat > conftest.c <<EOF
  577. #include <sys/wait.h>
  578. EOF
  579. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  580. if test -z "$err"; then
  581.   :
  582. else
  583.   
  584. {
  585. test -n "$verbose" && \
  586. echo "    defining NO_SYS_WAIT_H"
  587. DEFS="$DEFS -DNO_SYS_WAIT_H=1"
  588. }
  589.  
  590. fi
  591. rm -f conftest*
  592.  
  593.  
  594. #--------------------------------------------------------------------
  595. #    On some systems strstr is broken: it returns a pointer even
  596. #    even if the original string is empty.
  597. #--------------------------------------------------------------------
  598.  
  599. cat > conftest.c <<EOF
  600.  
  601. extern int strstr();
  602. int main()
  603. {
  604.     exit(strstr("\0test", "test") ? 1 : 0);
  605. }
  606.  
  607. EOF
  608. eval $compile
  609. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  610.   :
  611. else
  612.   LIBOBJS="$LIBOBJS strstr.o"
  613. fi
  614. rm -f conftest*
  615.  
  616. #--------------------------------------------------------------------
  617. #    Check for strtoul function.  This is tricky because under some
  618. #    versions of AIX strtoul returns an incorrect terminator
  619. #    pointer for the string "0".
  620. #--------------------------------------------------------------------
  621.  
  622. echo checking for strtoul
  623. cat > conftest.c <<EOF
  624. #include <ctype.h>
  625. int main() { exit(0); }
  626. int t() { 
  627. /* The GNU C library defines this for functions which it implements
  628.     to always fail with ENOSYS.  Some functions are actually named
  629.     something starting with __ and the normal name is an alias.  */
  630. #if defined (__stub_strtoul) || defined (__stub___strtoul)
  631. choke me
  632. #else
  633. /* Override any gcc2 internal prototype to avoid an error.  */
  634. extern char strtoul(); strtoul();
  635. #endif
  636.  }
  637. EOF
  638. if eval $compile; then
  639.   tcl_ok=1
  640. else
  641.   tcl_ok=0
  642. fi
  643. rm -f conftest*
  644.  
  645. cat > conftest.c <<EOF
  646.  
  647. extern int strtoul();
  648. int main()
  649. {
  650.     char *string = "0";
  651.     char *term;
  652.     int value;
  653.     value = strtoul(string, &term, 0);
  654.     if ((value != 0) || (term != (string+1))) {
  655.         exit(1);
  656.     }
  657.     exit(0);
  658. }
  659. EOF
  660. eval $compile
  661. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  662.   :
  663. else
  664.   tcl_ok=0
  665. fi
  666. rm -f conftest*
  667. if test $tcl_ok = 0; then
  668.     LIBOBJS="$LIBOBJS strtoul.o"
  669. fi
  670.  
  671. #--------------------------------------------------------------------
  672. #    Check for the strtod function.  This is tricky because under
  673. #    some versions of Linux it mis-parses the string "+".
  674. #--------------------------------------------------------------------
  675.  
  676. echo checking for strtod
  677. cat > conftest.c <<EOF
  678. #include <ctype.h>
  679. int main() { exit(0); }
  680. int t() { 
  681. /* The GNU C library defines this for functions which it implements
  682.     to always fail with ENOSYS.  Some functions are actually named
  683.     something starting with __ and the normal name is an alias.  */
  684. #if defined (__stub_strtod) || defined (__stub___strtod)
  685. choke me
  686. #else
  687. /* Override any gcc2 internal prototype to avoid an error.  */
  688. extern char strtod(); strtod();
  689. #endif
  690.  }
  691. EOF
  692. if eval $compile; then
  693.   tcl_ok=1
  694. else
  695.   tcl_ok=0
  696. fi
  697. rm -f conftest*
  698.  
  699. cat > conftest.c <<EOF
  700.  
  701. extern double strtod();
  702. int main()
  703. {
  704.     char *string = "+";
  705.     char *term;
  706.     double value;
  707.     value = strtod(string, &term);
  708.     if (term != string) {
  709.     exit(1);
  710.     }
  711.     exit(0);
  712. }
  713. EOF
  714. eval $compile
  715. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  716.   :
  717. else
  718.   tcl_ok=0
  719. fi
  720. rm -f conftest*
  721. if test $tcl_ok = 0; then
  722.     LIBOBJS="$LIBOBJS strtod.o"
  723. fi
  724.  
  725. #--------------------------------------------------------------------
  726. #    Check for various typedefs and provide substitutes if
  727. #    they don't exist.
  728. #--------------------------------------------------------------------
  729.  
  730. echo checking for mode_t in sys/types.h
  731. echo '#include <sys/types.h>' > conftest.c
  732. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  733. if egrep "mode_t" conftest.out >/dev/null 2>&1; then
  734.   :
  735. else
  736.   
  737. {
  738. test -n "$verbose" && \
  739. echo "    defining mode_t to be int"
  740. DEFS="$DEFS -Dmode_t=int"
  741. }
  742.  
  743. fi
  744. rm -f conftest*
  745.  
  746. echo checking for pid_t in sys/types.h
  747. echo '#include <sys/types.h>' > conftest.c
  748. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  749. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  750.   :
  751. else
  752.   
  753. {
  754. test -n "$verbose" && \
  755. echo "    defining pid_t to be int"
  756. DEFS="$DEFS -Dpid_t=int"
  757. }
  758.  
  759. fi
  760. rm -f conftest*
  761.  
  762. echo checking for size_t in sys/types.h
  763. echo '#include <sys/types.h>' > conftest.c
  764. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  765. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  766.   :
  767. else
  768.   
  769. {
  770. test -n "$verbose" && \
  771. echo "    defining size_t to be unsigned"
  772. DEFS="$DEFS -Dsize_t=unsigned"
  773. }
  774.  
  775. fi
  776. rm -f conftest*
  777.  
  778. echo checking for uid_t in sys/types.h
  779. echo '#include <sys/types.h>' > conftest.c
  780. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  781. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  782.   :
  783. else
  784.   
  785. {
  786. test -n "$verbose" && \
  787. echo "    defining uid_t to be int"
  788. DEFS="$DEFS -Duid_t=int"
  789. }
  790.  
  791. {
  792. test -n "$verbose" && \
  793. echo "    defining gid_t to be int"
  794. DEFS="$DEFS -Dgid_t=int"
  795. }
  796.  
  797. fi
  798. rm -f conftest*
  799.  
  800.  
  801. #--------------------------------------------------------------------
  802. #    If a system doesn't have an opendir function (man, that's old!)
  803. #    then we have to supply a different version of dirent.h which
  804. #    is compatible with the substitute version of opendir that's
  805. #    provided.  This version only works with V7-style directories.
  806. #--------------------------------------------------------------------
  807.  
  808. echo checking for opendir
  809. cat > conftest.c <<EOF
  810. #include <ctype.h>
  811. int main() { exit(0); }
  812. int t() { 
  813. /* The GNU C library defines this for functions which it implements
  814.     to always fail with ENOSYS.  Some functions are actually named
  815.     something starting with __ and the normal name is an alias.  */
  816. #if defined (__stub_opendir) || defined (__stub___opendir)
  817. choke me
  818. #else
  819. /* Override any gcc2 internal prototype to avoid an error.  */
  820. extern char opendir(); opendir();
  821. #endif
  822.  }
  823. EOF
  824. if eval $compile; then
  825.   :
  826. else
  827.   {
  828. test -n "$verbose" && \
  829. echo "    defining USE_DIRENT2_H"
  830. DEFS="$DEFS -DUSE_DIRENT2_H=1"
  831. }
  832.  
  833. fi
  834. rm -f conftest*
  835.  
  836.  
  837. #--------------------------------------------------------------------
  838. #    Check for the existence of sys_errlist (this is only needed if
  839. #    there's no strerror, but I don't know how to conditionalize the
  840. #    check).
  841. #--------------------------------------------------------------------
  842.  
  843. echo checking for sys_errlist
  844. cat > conftest.c <<EOF
  845.  
  846. int main() { exit(0); }
  847. int t() { 
  848. extern char *sys_errlist[];
  849. extern int sys_nerr;
  850. sys_errlist[sys_nerr-1][0] = 0;
  851.  }
  852. EOF
  853. if eval $compile; then
  854.   :
  855. else
  856.   
  857. {
  858. test -n "$verbose" && \
  859. echo "    defining NO_SYS_ERRLIST"
  860. DEFS="$DEFS -DNO_SYS_ERRLIST=1"
  861. }
  862.  
  863. fi
  864. rm -f conftest*
  865.  
  866.  
  867. #--------------------------------------------------------------------
  868. #    The check below checks whether <sys/wait.h> defines the type
  869. #    "union wait" correctly.  It's needed because of weirdness in
  870. #    HP-UX where "union wait" is defined in both the BSD and SYS-V
  871. #    environments.  Checking the usability of WIFEXITED seems to do
  872. #    the trick.
  873. #--------------------------------------------------------------------
  874.  
  875. echo checking for union wait
  876. cat > conftest.c <<EOF
  877. #include <sys/types.h> 
  878. #include <sys/wait.h>
  879. int main() { exit(0); }
  880. int t() { 
  881. union wait x;
  882. WIFEXITED(x);        /* Generates compiler error if WIFEXITED
  883.              * uses an int. */
  884.  }
  885. EOF
  886. if eval $compile; then
  887.   :
  888. else
  889.   
  890. {
  891. test -n "$verbose" && \
  892. echo "    defining NO_UNION_WAIT"
  893. DEFS="$DEFS -DNO_UNION_WAIT=1"
  894. }
  895.  
  896. fi
  897. rm -f conftest*
  898.  
  899.  
  900. #--------------------------------------------------------------------
  901. #    Check to see whether the system supports the matherr function
  902. #    and its associated type "struct exception".
  903. #--------------------------------------------------------------------
  904.  
  905. echo checking for matherr support
  906. cat > conftest.c <<EOF
  907. #include <math.h>
  908. int main() { exit(0); }
  909. int t() { 
  910. struct exception x;
  911. x.type = DOMAIN;
  912. x.type = SING;
  913.  }
  914. EOF
  915. if eval $compile; then
  916.   LIBOBJS="$LIBOBJS tclMtherr.o"; 
  917. {
  918. test -n "$verbose" && \
  919. echo "    defining NEED_MATHERR"
  920. DEFS="$DEFS -DNEED_MATHERR=1"
  921. }
  922.  
  923. fi
  924. rm -f conftest*
  925.  
  926.  
  927. if test -n "$prefix"; then
  928.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  929.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  930. fi
  931. if test -n "$exec_prefix"; then
  932.   prsub="$prsub
  933. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  934. fi
  935. cat >conftest.def <<EOF
  936. $DEFS
  937. EOF
  938. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  939. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  940. rm -f conftest.def
  941.  
  942. trap 'rm -f config.status; exit 1' 1 3 15
  943. echo creating config.status
  944. rm -f config.status
  945. cat > config.status <<EOF
  946. #!/bin/sh
  947. # Generated automatically by configure.
  948. # Run this file to recreate the current configuration.
  949. # This directory was configured as follows,
  950. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  951. #
  952. # $0 $configure_args
  953.  
  954. for arg
  955. do
  956.   case "\$arg" in
  957.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  958.     exec /bin/sh $0 $configure_args ;;
  959.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  960.   esac
  961. done
  962.  
  963. trap 'rm -f Makefile; exit 1' 1 3 15
  964. INSTALL='$INSTALL'
  965. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  966. INSTALL_DATA='$INSTALL_DATA'
  967. RANLIB='$RANLIB'
  968. CC='$CC'
  969. LIBOBJS='$LIBOBJS'
  970. CPP='$CPP'
  971. LIBS='$LIBS'
  972. srcdir='$srcdir'
  973. DEFS='$DEFS'
  974. prefix='$prefix'
  975. exec_prefix='$exec_prefix'
  976. prsub='$prsub'
  977. EOF
  978. cat >> config.status <<\EOF
  979.  
  980. top_srcdir=$srcdir
  981.  
  982. # Allow make-time overrides of the generated file list.
  983. test -n "$gen_files" || gen_files="Makefile"
  984.  
  985. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  986.   srcdir=$top_srcdir
  987.   # Remove last slash and all that follows it.  Not all systems have dirname.
  988.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  989.   if test "$dir" != "$file"; then
  990.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  991.     test ! -d $dir && mkdir $dir
  992.   fi
  993.   echo creating $file
  994.   rm -f $file
  995.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  996.   sed -e "
  997. $prsub
  998. s%@INSTALL@%$INSTALL%g
  999. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1000. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1001. s%@RANLIB@%$RANLIB%g
  1002. s%@CC@%$CC%g
  1003. s%@LIBOBJS@%$LIBOBJS%g
  1004. s%@CPP@%$CPP%g
  1005. s%@LIBS@%$LIBS%g
  1006. s%@srcdir@%$srcdir%g
  1007. s%@DEFS@%$DEFS%
  1008. " $top_srcdir/${file}.in >> $file
  1009. fi; done
  1010.  
  1011. exit 0
  1012. EOF
  1013. chmod +x config.status
  1014. test -n "$no_create" || ./config.status
  1015.  
  1016.