home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-26 | 48.9 KB | 1,902 lines | [TEXT/MPS ] |
-
- #!/bin/sh
- # Guess values for system-dependent variables and create Makefiles.
- # Generated automatically using autoconf.
- # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
-
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2, or (at your option)
- # any later version.
-
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
-
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
- # [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
- # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
- # --with-PACKAGE unless this script has special code to handle it.
-
-
- for arg
- do
- # Handle --exec-prefix with a space before the argument.
- if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
- # Handle --host with a space before the argument.
- elif test x$next_host = xyes; then next_host=
- # Handle --prefix with a space before the argument.
- elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
- # Handle --srcdir with a space before the argument.
- elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
- else
- case $arg in
- # For backward compatibility, also recognize exact --exec_prefix.
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
- exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
- next_exec_prefix=yes ;;
-
- -gas | --gas | --ga | --g) ;;
-
- -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
- -host | --host | --hos | --ho | --h)
- next_host=yes ;;
-
- -nfp | --nfp | --nf) ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
- no_create=1 ;;
-
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- next_prefix=yes ;;
-
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
- srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
- next_srcdir=yes ;;
-
- -with-* | --with-*)
- package=`echo $arg|sed 's/-*with-//'`
- # Delete all the valid chars; see if any are left.
- if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
- echo "configure: $package: invalid package name" >&2; exit 1
- fi
- eval "with_`echo $package|sed s/-/_/g`=1" ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
- verbose=yes ;;
-
- *) ;;
- esac
- fi
- done
-
- trap 'rm -fr conftest* core; exit 1' 1 3 15
-
- # NLS nuisances.
- # These must not be set unconditionally because not all systems understand
- # e.g. LANG=C (notably SCO).
- if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
- if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi
-
- rm -f conftest*
- compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
-
- # A filename unique to this package, relative to the directory that
- # configure is in, which we can look for to find out if srcdir is correct.
- unique_file=src/tclExtend.h
-
- # Find the source files, if location was not specified.
- if test -z "$srcdir"; then
- srcdirdefaulted=yes
- # Try the directory containing this script, then `..'.
- prog=$0
- confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
- test "X$confdir" = "X$prog" && confdir=.
- srcdir=$confdir
- if test ! -r $srcdir/$unique_file; then
- srcdir=..
- fi
- fi
- if test ! -r $srcdir/$unique_file; then
- if test x$srcdirdefaulted = xyes; then
- echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
- else
- echo "configure: Can not find sources in \`${srcdir}'." 1>&2
- fi
- exit 1
- fi
- # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
- # But we can't avoid them for `..', to make subdirectories work.
- case $srcdir in
- .|/*|~*) ;;
- *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
- esac
-
- # Save the original args to write them into config.status later.
- configure_args="$*"
-
- #!/bin/sh
- # From configure.in Revision: 1.6
-
-
-
-
- #------------------------------------------------------------------------------
- # Check for various programs used during the build.
- #------------------------------------------------------------------------------
-
- for p in 'bison -y' byacc
- do
- if test -z "$YACC"; then
- # Extract the first word of `$p', so it can be a program name with args.
- set dummy $p; word=$2
- echo checking for $word
- IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$word; then
- YACC="$p"
- break
- fi
- done
- IFS="$saveifs"
- fi
-
- test -n "$YACC" -a -n "$verbose" && echo " setting YACC to $YACC"
-
- test -n "$YACC" && break
- done
- test -n "$YACC" || YACC="yacc"
-
- if test -z "$CC"; then
- # Extract the first word of `gcc', so it can be a program name with args.
- set dummy gcc; word=$2
- echo checking for $word
- IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$word; then
- CC="gcc"
- break
- fi
- done
- IFS="$saveifs"
- fi
- test -z "$CC" && CC="cc"
- test -n "$CC" -a -n "$verbose" && echo " setting CC to $CC"
-
- # Find out if we are using GNU C, under whatever name.
- cat > conftest.c <<EOF
- #ifdef __GNUC__
- yes
- #endif
- EOF
- ${CC-cc} -E conftest.c > conftest.out 2>&1
- if egrep yes conftest.out >/dev/null 2>&1; then
- GCC=1 # For later tests.
- fi
- rm -f conftest*
-
- echo checking how to run the C preprocessor
- if test -z "$CPP"; then
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and ``${CC-cc}'' will simply confuse
- # make. It must be expanded now.
- CPP="${CC-cc} -E"
- cat > conftest.c <<EOF
- #include <stdio.h>
- Syntax Error
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
- CPP=/lib/cpp
- fi
- rm -f conftest*
- fi
- test ".${verbose}" != "." && echo " setting CPP to $CPP"
-
- if test -z "$RANLIB"; then
- # Extract the first word of `ranlib', so it can be a program name with args.
- set dummy ranlib; word=$2
- echo checking for $word
- IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$word; then
- RANLIB="ranlib"
- break
- fi
- done
- IFS="$saveifs"
- fi
- test -z "$RANLIB" && RANLIB=":"
- test -n "$RANLIB" -a -n "$verbose" && echo " setting RANLIB to $RANLIB"
-
- if test -z "$MCS_CMD"; then
- # Extract the first word of `"mcs"', so it can be a program name with args.
- set dummy "mcs"; word=$2
- echo checking for $word
- IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
- for dir in $PATH; do
- test -z "$dir" && dir=.
- if test -f $dir/$word; then
- MCS_CMD="mcs -d"
- break
- fi
- done
- IFS="$saveifs"
- fi
- test -z "$MCS_CMD" && MCS_CMD="touch"
- test -n "$MCS_CMD" -a -n "$verbose" && echo " setting MCS_CMD to $MCS_CMD"
-
-
- #------------------------------------------------------------------------------
- # Some make programs require includes to be
- # .include "file"
- # others...
- # include file
- #------------------------------------------------------------------------------
-
- echo checking how make handles includes
- rm -fr conftestdir
- if mkdir conftestdir; then
- cd conftestdir
- cat > Makeinclude <<EOF
-
- EOF
- cat > Makefile <<EOF
- include Makeinclude
-
- all:
- EOF
- if make >/dev/null 2>/dev/null; then
- MAKEINCLUDE="include"
- MAKEQUOTE=''
- else
- MAKEINCLUDE=".include"
- MAKEQUOTE='"'
- fi
- cd ..
- rm -fr conftestdir
- fi
-
-
-
-
- #------------------------------------------------------------------------------
- # If a system doesn't have an opendir function (man, that's old!)
- # then we use the version of dirent.h Ouster supplied, which
- # is compatible with the substitute version of opendir that's
- # provided. This version only works with V7-style directories.
- #------------------------------------------------------------------------------
-
- echo checking for opendir
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_opendir) || defined (__stub___opendir)
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char opendir(); opendir();
- #endif
- }
- EOF
- if eval $compile; then
- :
- else
- {
- test -n "$verbose" && \
- echo " defining USE_DIRENT2_H"
- DEFS="$DEFS -DUSE_DIRENT2_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}USE_DIRENT2_H\${SEDdB}USE_DIRENT2_H\${SEDdC}1\${SEDdD}
- \${SEDuA}USE_DIRENT2_H\${SEDuB}USE_DIRENT2_H\${SEDuC}1\${SEDuD}
- \${SEDeA}USE_DIRENT2_H\${SEDeB}USE_DIRENT2_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
-
- #------------------------------------------------------------------------------
- # Do we have the catgets call (X/PG3 message catalogs)?
- # Do we have the getcwd system call?
- # Do we have the select system call?
- # Do we have the setitimer system call?
- # Do we have the setlinebuf call?
- # Do we have the sigaction call?
- # Do we have the getpgid call?
- #------------------------------------------------------------------------------
- for func in catgets getcwd select setitimer setlinebuf
- do
- trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
- echo checking for ${func}
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_${func}) || defined (__stub___${func})
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char ${func}(); ${func}();
- #endif
- }
- EOF
- if eval $compile; then
- {
- test -n "$verbose" && \
- echo " defining ${trfunc}"
- DEFS="$DEFS -D${trfunc}=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
- \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
- \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
- done
-
- for func in sigaction setpgid
- do
- trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
- echo checking for ${func}
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_${func}) || defined (__stub___${func})
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char ${func}(); ${func}();
- #endif
- }
- EOF
- if eval $compile; then
- {
- test -n "$verbose" && \
- echo " defining ${trfunc}"
- DEFS="$DEFS -D${trfunc}=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
- \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
- \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
- done
-
-
-
- #------------------------------------------------------------------------------
- # Check for bzero. We don't use bzero directly, but older SCO
- # systems have a select FD_ZERO macro that calls bzero, which is
- # only in the X library. We redefine bzero as a memset call if
- # there is no bzero. If its not needed, it doesn't hurt
- # anything.
- #------------------------------------------------------------------------------
- for func in bzero
- do
- trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
- echo checking for ${func}
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_${func}) || defined (__stub___${func})
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char ${func}(); ${func}();
- #endif
- }
- EOF
- if eval $compile; then
- {
- test -n "$verbose" && \
- echo " defining ${trfunc}"
- DEFS="$DEFS -D${trfunc}=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
- \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
- \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
- done
-
-
- #------------------------------------------------------------------------------
- # Check for missing functions that we need. They will be
- # compiled in the osSupport directory. Must check for SCO
- # -lintl, which is were strftime is hidden.
- #------------------------------------------------------------------------------
-
- echo checking for SCO UNIX libintl
- cat > conftest.c <<EOF
- #if defined(M_UNIX)
- yes
- #endif
-
- EOF
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "yes" conftest.out >/dev/null 2>&1; then
- SCO_UNIX=1
- fi
- rm -f conftest*
-
- test -n "$SCO_UNIX" && test -f /lib/libintl.a &&
- LIBS="$LIBS -lintl" # For strftime.
-
- echo checking for strftime
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_strftime) || defined (__stub___strftime)
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char strftime(); strftime();
- #endif
- }
- EOF
- if eval $compile; then
- :
- else
- LIBOBJS="$LIBOBJS strftime.o"
- fi
- rm -f conftest*
-
- echo checking for random
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_random) || defined (__stub___random)
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char random(); random();
- #endif
- }
- EOF
- if eval $compile; then
- :
- else
- LIBOBJS="$LIBOBJS random.o"
- fi
- rm -f conftest*
-
-
-
- #------------------------------------------------------------------------------
- # Supply substitutes for missing POSIX header files. Special
- # notes:
- # - Sprite's dirent.h exists but is bogus.
- # - stdlib.h doesn't define strtol, strtoul, or
- # strtod insome versions of SunOS
- # - some versions of string.h don't declare procedures such
- # as strstr
- #------------------------------------------------------------------------------
-
- echo checking for unistd.h
- cat > conftest.c <<EOF
- #include <unistd.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_UNISTD_H"
- DEFS="$DEFS -DHAVE_UNISTD_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for dirent.h
- cat > conftest.c <<EOF
- #include <sys/types.h>
- #include <dirent.h>
- int main() { exit(0); }
- int t() {
- DIR *d;
- struct dirent *entryPtr;
- char *p;
- d = opendir("foobar");
- entryPtr = readdir(d);
- p = entryPtr->d_name;
- closedir(d);
- }
- EOF
- if eval $compile; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_DIRENT_H"
- DEFS="$DEFS -DNO_DIRENT_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_DIRENT_H\${SEDdB}NO_DIRENT_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_DIRENT_H\${SEDuB}NO_DIRENT_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_DIRENT_H\${SEDeB}NO_DIRENT_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- echo '#include <
- {
- test -n "$verbose" && \
- echo " defining NO_DIRENT_H"
- DEFS="$DEFS -DNO_DIRENT_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_DIRENT_H\${SEDdB}NO_DIRENT_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_DIRENT_H\${SEDuB}NO_DIRENT_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_DIRENT_H\${SEDeB}NO_DIRENT_H\${SEDeC}1\${SEDeD}
- "
- }
- >' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "Sprite version.* NOT POSIX" conftest.out >/dev/null 2>&1; then
- :
- fi
- rm -f conftest*
-
- echo checking for float.h
- cat > conftest.c <<EOF
- #include <float.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_FLOAT_H"
- DEFS="$DEFS -DNO_FLOAT_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_FLOAT_H\${SEDdB}NO_FLOAT_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_FLOAT_H\${SEDuB}NO_FLOAT_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_FLOAT_H\${SEDeB}NO_FLOAT_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for values.h
- cat > conftest.c <<EOF
- #include <values.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_VALUES_H"
- DEFS="$DEFS -DNO_VALUES_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_VALUES_H\${SEDdB}NO_VALUES_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_VALUES_H\${SEDuB}NO_VALUES_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_VALUES_H\${SEDeB}NO_VALUES_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for limits.h
- cat > conftest.c <<EOF
- #include <limits.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_LIMITS_H"
- DEFS="$DEFS -DNO_LIMITS_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_LIMITS_H\${SEDdB}NO_LIMITS_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_LIMITS_H\${SEDuB}NO_LIMITS_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_LIMITS_H\${SEDeB}NO_LIMITS_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for stdlib.h
- cat > conftest.c <<EOF
- #include <stdlib.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STDLIB_H"
- DEFS="$DEFS -DNO_STDLIB_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STDLIB_H\${SEDdB}NO_STDLIB_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STDLIB_H\${SEDuB}NO_STDLIB_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STDLIB_H\${SEDeB}NO_STDLIB_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo '#include <stdlib.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "strtol" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STDLIB_H"
- DEFS="$DEFS -DNO_STDLIB_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STDLIB_H\${SEDdB}NO_STDLIB_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STDLIB_H\${SEDuB}NO_STDLIB_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STDLIB_H\${SEDeB}NO_STDLIB_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo '#include <stdlib.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "strtoul" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STDLIB_H"
- DEFS="$DEFS -DNO_STDLIB_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STDLIB_H\${SEDdB}NO_STDLIB_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STDLIB_H\${SEDuB}NO_STDLIB_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STDLIB_H\${SEDeB}NO_STDLIB_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo '#include <stdlib.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "strtod" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STDLIB_H"
- DEFS="$DEFS -DNO_STDLIB_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STDLIB_H\${SEDdB}NO_STDLIB_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STDLIB_H\${SEDuB}NO_STDLIB_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STDLIB_H\${SEDeB}NO_STDLIB_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for string.h
- cat > conftest.c <<EOF
- #include <string.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STRING_H"
- DEFS="$DEFS -DNO_STRING_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STRING_H\${SEDdB}NO_STRING_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STRING_H\${SEDuB}NO_STRING_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STRING_H\${SEDeB}NO_STRING_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo '#include <string.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "strstr" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STRING_H"
- DEFS="$DEFS -DNO_STRING_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STRING_H\${SEDdB}NO_STRING_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STRING_H\${SEDuB}NO_STRING_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STRING_H\${SEDeB}NO_STRING_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo '#include <string.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "strerror" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_STRING_H"
- DEFS="$DEFS -DNO_STRING_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_STRING_H\${SEDdB}NO_STRING_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_STRING_H\${SEDuB}NO_STRING_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_STRING_H\${SEDeB}NO_STRING_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for sys/time.h
- cat > conftest.c <<EOF
- #include <sys/time.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_SYS_TIME_H"
- DEFS="$DEFS -DNO_SYS_TIME_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_SYS_TIME_H\${SEDdB}NO_SYS_TIME_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_SYS_TIME_H\${SEDuB}NO_SYS_TIME_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_SYS_TIME_H\${SEDeB}NO_SYS_TIME_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for sys/wait.h
- cat > conftest.c <<EOF
- #include <sys/wait.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_SYS_WAIT_H"
- DEFS="$DEFS -DNO_SYS_WAIT_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_SYS_WAIT_H\${SEDdB}NO_SYS_WAIT_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_SYS_WAIT_H\${SEDuB}NO_SYS_WAIT_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_SYS_WAIT_H\${SEDeB}NO_SYS_WAIT_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for sys/socket.h
- cat > conftest.c <<EOF
- #include <sys/socket.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_SYS_SOCKET_H"
- DEFS="$DEFS -DNO_SYS_SOCKET_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_SYS_SOCKET_H\${SEDdB}NO_SYS_SOCKET_H\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_SYS_SOCKET_H\${SEDuB}NO_SYS_SOCKET_H\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_SYS_SOCKET_H\${SEDeB}NO_SYS_SOCKET_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- #------------------------------------------------------------------------------
- # Include sys/select.h if it exists and if it supplies things
- # that appear to be useful. This appears to be true only on
- # the RS/6000 under AIX. Some systems like OSF/1 have a
- # sys/select.h that's of no use, and other systems like SCO
- # UNIX have a sys/select.h that's pernicious.
- #------------------------------------------------------------------------------
-
- echo checking for sys/select.h
- echo '#include <sys/select.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "fd_mask" conftest.out >/dev/null 2>&1; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_SYS_SELECT_H"
- DEFS="$DEFS -DHAVE_SYS_SELECT_H=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYS_SELECT_H\${SEDdB}HAVE_SYS_SELECT_H\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_SYS_SELECT_H\${SEDuB}HAVE_SYS_SELECT_H\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_SYS_SELECT_H\${SEDeB}HAVE_SYS_SELECT_H\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- #------------------------------------------------------------------------------
- # Check for missing typedefs.
- #------------------------------------------------------------------------------
-
- echo checking for pid_t in sys/types.h
- echo '#include <sys/types.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "pid_t" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining pid_t to be int"
- DEFS="$DEFS -Dpid_t=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
- \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
- \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for uid_t in sys/types.h
- echo '#include <sys/types.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "uid_t" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining uid_t to be int"
- DEFS="$DEFS -Duid_t=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
- \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
- \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
- "
- }
-
- {
- test -n "$verbose" && \
- echo " defining gid_t to be int"
- DEFS="$DEFS -Dgid_t=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
- \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
- \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for type of array argument to getgroups
- prog='/* Thanks to Mike Rendell for this test. */
- #include <sys/types.h>
- #define NGID 256
- #undef MAX
- #define MAX(x,y) ((x) > (y) ? (x) : (y))
- main()
- {
- gid_t gidset[NGID];
- int i, n;
- union { gid_t gval; long lval; } val;
-
- val.lval = -1;
- for (i = 0; i < NGID; i++)
- gidset[i] = val.gval;
- n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
- gidset);
- /* Exit non-zero if getgroups seems to require an array of ints. This
- happens when gid_t is short but getgroups modifies an array of ints. */
- exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
- }'
- cat > conftest.c <<EOF
- $prog
- EOF
- eval $compile
- if test -s conftest && (./conftest; exit) 2>/dev/null; then
-
- {
- test -n "$verbose" && \
- echo " defining GETGROUPS_T to be gid_t"
- DEFS="$DEFS -DGETGROUPS_T=gid_t"
- SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}gid_t\${SEDdD}
- \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}gid_t\${SEDuD}
- \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}gid_t\${SEDeD}
- "
- }
-
- else
-
- {
- test -n "$verbose" && \
- echo " defining GETGROUPS_T to be int"
- DEFS="$DEFS -DGETGROUPS_T=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}GETGROUPS_T\${SEDdB}GETGROUPS_T\${SEDdC}int\${SEDdD}
- \${SEDuA}GETGROUPS_T\${SEDuB}GETGROUPS_T\${SEDuC}int\${SEDuD}
- \${SEDeA}GETGROUPS_T\${SEDeB}GETGROUPS_T\${SEDeC}int\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for uid_t in sys/types.h
- echo '#include <sys/types.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "uid_t" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining uid_t to be int"
- DEFS="$DEFS -Duid_t=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
- \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
- \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
- "
- }
-
- {
- test -n "$verbose" && \
- echo " defining gid_t to be int"
- DEFS="$DEFS -Dgid_t=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
- \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
- \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for mode_t in sys/types.h
- echo '#include <sys/types.h>' > conftest.c
- eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
- if egrep "mode_t" conftest.out >/dev/null 2>&1; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining mode_t to be int"
- DEFS="$DEFS -Dmode_t=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}mode_t\${SEDdB}mode_t\${SEDdC}int\${SEDdD}
- \${SEDuA}mode_t\${SEDuB}mode_t\${SEDuC}int\${SEDuD}
- \${SEDeA}mode_t\${SEDeB}mode_t\${SEDeC}int\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for time_t
- cat > conftest.c <<EOF
- #include <sys/types.h>
- int main() { exit(0); }
- int t() { }
- EOF
- if eval $compile; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining time_t to be long"
- DEFS="$DEFS -Dtime_t=long"
- SEDDEFS="${SEDDEFS}\${SEDdA}time_t\${SEDdB}time_t\${SEDdC}long\${SEDdD}
- \${SEDuA}time_t\${SEDuB}time_t\${SEDuC}long\${SEDuD}
- \${SEDeA}time_t\${SEDeB}time_t\${SEDeC}long\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- #------------------------------------------------------------------------------
- # Make "const" work no matter what.
- #------------------------------------------------------------------------------
-
- prog='/* Ultrix mips cc rejects this. */
- typedef int charset[2]; const charset x;
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
- const char *g = "string";
- ccp = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25,17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
- }'
- echo checking for working const
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { $prog }
- EOF
- if eval $compile; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining const to be empty"
- DEFS="$DEFS -Dconst="
- SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
- \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
- \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- #------------------------------------------------------------------------------
- # What type do signals return?
- #------------------------------------------------------------------------------
-
- echo checking for return type of signal handlers
- cat > conftest.c <<EOF
- #include <sys/types.h>
- #include <signal.h>
- #ifdef signal
- #undef signal
- #endif
- extern void (*signal ()) ();
- int main() { exit(0); }
- int t() { int i; }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining RETSIGTYPE to be void"
- DEFS="$DEFS -DRETSIGTYPE=void"
- SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
- \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
- \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
- "
- }
-
- else
-
- {
- test -n "$verbose" && \
- echo " defining RETSIGTYPE to be int"
- DEFS="$DEFS -DRETSIGTYPE=int"
- SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
- \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
- \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
-
-
- #------------------------------------------------------------------------------
- # Find out all about time handling differences.
- #------------------------------------------------------------------------------
-
- echo checking for whether time.h and sys/time.h may both be included
- cat > conftest.c <<EOF
- #include <sys/types.h>
- #include <sys/time.h>
- #include <time.h>
- int main() { exit(0); }
- int t() { struct tm *tp; }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining TIME_WITH_SYS_TIME"
- DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
- \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
- \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- echo checking for struct tm in time.h
- cat > conftest.c <<EOF
- #include <sys/types.h>
- #include <time.h>
- int main() { exit(0); }
- int t() { struct tm *tp; }
- EOF
- if eval $compile; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining TM_IN_SYS_TIME"
- DEFS="$DEFS -DTM_IN_SYS_TIME=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
- \${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
- \${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- decl='#include <sys/types.h>
- '
- case "$DEFS" in
- *TM_IN_SYS_TIME*) decl="$decl
- #include <sys/time.h>
- " ;;
- *) decl="$decl
- #include <time.h>
- " ;;
- esac
- echo checking for tm_zone in struct tm
- cat > conftest.c <<EOF
- $decl
- int main() { exit(0); }
- int t() { struct tm tm; tm.tm_zone; }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_TM_ZONE"
- DEFS="$DEFS -DHAVE_TM_ZONE=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_ZONE\${SEDdB}HAVE_TM_ZONE\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_TM_ZONE\${SEDuB}HAVE_TM_ZONE\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_TM_ZONE\${SEDeB}HAVE_TM_ZONE\${SEDeC}1\${SEDeD}
- "
- }
-
- else
- no_tm_zone=1
- fi
- rm -f conftest*
-
- if test -n "$no_tm_zone"; then
- echo checking for tzname
- cat > conftest.c <<EOF
- #include <time.h>
- #ifndef tzname /* For SGI. */
- extern char *tzname[]; /* RS6000 and others want it this way. */
- #endif
- int main() { exit(0); }
- int t() { atoi(*tzname); }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_TZNAME"
- DEFS="$DEFS -DHAVE_TZNAME=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TZNAME\${SEDdB}HAVE_TZNAME\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_TZNAME\${SEDuB}HAVE_TZNAME\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_TZNAME\${SEDeB}HAVE_TZNAME\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- fi
-
-
- echo checking for tm_tzadj in struct tm
- cat > conftest.c <<EOF
- $decl
- int main() { exit(0); }
- int t() { struct tm tm; tm.tm_tzadj; }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_TM_TZADJ"
- DEFS="$DEFS -DHAVE_TM_TZADJ=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_TZADJ\${SEDdB}HAVE_TM_TZADJ\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_TM_TZADJ\${SEDuB}HAVE_TM_TZADJ\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_TM_TZADJ\${SEDeB}HAVE_TM_TZADJ\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- echo checking for tm_gmtoff in struct tm
- cat > conftest.c <<EOF
- $decl
- int main() { exit(0); }
- int t() { struct tm tm; tm.tm_gmtoff; }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_TM_GMTOFF"
- DEFS="$DEFS -DHAVE_TM_GMTOFF=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_GMTOFF\${SEDdB}HAVE_TM_GMTOFF\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_TM_GMTOFF\${SEDuB}HAVE_TM_GMTOFF\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_TM_GMTOFF\${SEDeB}HAVE_TM_GMTOFF\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- for func in gettimeofday
- do
- trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
- echo checking for ${func}
- cat > conftest.c <<EOF
- #include <ctype.h>
- int main() { exit(0); }
- int t() {
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
- #if defined (__stub_${func}) || defined (__stub___${func})
- choke me
- #else
- /* Override any gcc2 internal prototype to avoid an error. */
- extern char ${func}(); ${func}();
- #endif
- }
- EOF
- if eval $compile; then
- {
- test -n "$verbose" && \
- echo " defining ${trfunc}"
- DEFS="$DEFS -D${trfunc}=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
- \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
- \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
- done
-
-
- echo checking for timezone variable
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() {
- extern long timezone;
- timezone += 1;
- exit (0);
- }
- EOF
- if eval $compile; then
-
- {
- test -n "$verbose" && \
- echo " defining HAVE_TIMEZONE_VAR"
- DEFS="$DEFS -DHAVE_TIMEZONE_VAR=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TIMEZONE_VAR\${SEDdB}HAVE_TIMEZONE_VAR\${SEDdC}1\${SEDdD}
- \${SEDuA}HAVE_TIMEZONE_VAR\${SEDuB}HAVE_TIMEZONE_VAR\${SEDuC}1\${SEDuD}
- \${SEDeA}HAVE_TIMEZONE_VAR\${SEDeB}HAVE_TIMEZONE_VAR\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- #------------------------------------------------------------------------------
- # Test to see if "times" returns a status or the amount of
- # elapsed real time.
- #------------------------------------------------------------------------------
-
- echo "checking to see if 'times' returns the elapsed real time"
- cat > conftest.c <<EOF
-
- #include <sys/types.h>
- #include <sys/times.h>
- main() {
- struct tms cpu;
- times (&cpu);
- sleep (2);
- if (times (&cpu) > 0)
- exit (0);
- else
- exit (1);
- }
-
- EOF
- eval $compile
- if test -s conftest && (./conftest; exit) 2>/dev/null; then
-
- {
- test -n "$verbose" && \
- echo " defining TIMES_RETS_REAL_TIME"
- DEFS="$DEFS -DTIMES_RETS_REAL_TIME=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}TIMES_RETS_REAL_TIME\${SEDdB}TIMES_RETS_REAL_TIME\${SEDdC}1\${SEDdD}
- \${SEDuA}TIMES_RETS_REAL_TIME\${SEDuB}TIMES_RETS_REAL_TIME\${SEDuC}1\${SEDuD}
- \${SEDeA}TIMES_RETS_REAL_TIME\${SEDeB}TIMES_RETS_REAL_TIME\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
- #------------------------------------------------------------------------------
- # Determine if "." is used as separator for the manual directory
- # names. i.e. man/man.1 vs man/man1
- #------------------------------------------------------------------------------
-
- echo "checking man directory/section separator (man/man.1 vs man/man1)"
- mandirs="/usr/man/man.1 /usr/man/cat.1 /usr/share/man.1 /usr/share/man.1
- /usr/man/cat.C"
- gotdotdir="NO"
- for d in $mandirs
- do
- if test -d $d
- then
- gotdotdir="YES"
- fi
- done
-
- mandirs="/usr/man/man1 /usr/man/cat1 /usr/share/man1 /usr/share/man1
- /usr/man/man1.Z /usr/man/cat1.Z /usr/share/man1.Z /usr/share/man1.Z"
- gotnodotdir="NO"
- for d in $mandirs
- do
- if test -d $d
- then
- gotnodotdir="YES"
- fi
- done
-
- if test $gotdotdir = YES -a $gotnodotdir = NO
- then
- MAN_DIR_SEPARATOR="."
- elif test $gotdotdir = NO -a $gotnodotdir = YES
- then
- MAN_DIR_SEPARATOR=""
- else
- MAN_DIR_SEPARATOR="."
- echo "WARNING: could not determine man directory/section separator"
- echo " assuming man/man.1 (can override in Config.mk)."
- fi
-
-
- #------------------------------------------------------------------------------
- # The check below checks whether <sys/wait.h> defines the type
- # "union wait" correctly. It's needed because of weirdness in
- # HP-UX where "union wait" is defined in both the BSD and SYS-V
- # environments. Checking the usability of WIFEXITED seems to do
- # the trick.
- #------------------------------------------------------------------------------
-
- echo checking for union wait
- cat > conftest.c <<EOF
- #include <sys/types.h>
- #include <sys/wait.h>
- int main() { exit(0); }
- int t() {
- union wait x;
- WIFEXITED(x); /* Generates compiler error if WIFEXITED
- * uses an int. */
- }
- EOF
- if eval $compile; then
- :
- else
-
- {
- test -n "$verbose" && \
- echo " defining NO_UNION_WAIT"
- DEFS="$DEFS -DNO_UNION_WAIT=1"
- SEDDEFS="${SEDDEFS}\${SEDdA}NO_UNION_WAIT\${SEDdB}NO_UNION_WAIT\${SEDdC}1\${SEDdD}
- \${SEDuA}NO_UNION_WAIT\${SEDuB}NO_UNION_WAIT\${SEDuC}1\${SEDuD}
- \${SEDeA}NO_UNION_WAIT\${SEDeB}NO_UNION_WAIT\${SEDeC}1\${SEDeD}
- "
- }
-
- fi
- rm -f conftest*
-
-
- #------------------------------------------------------------------------------
- # Add socket and nsl libraries, if found.
- # Use C shared library if possible.
- #------------------------------------------------------------------------------
-
- LIBS_save="${LIBS}"
- LIBS="${LIBS} -lsocket"
- have_lib=""
- echo checking for -lsocket
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { main(); }
- EOF
- if eval $compile; then
- have_lib="1"
- fi
- rm -f conftest*
- LIBS="${LIBS_save}"
- if test -n "${have_lib}"; then
- :; LIBS="$LIBS -lsocket"
- else
- :;
- fi
-
- LIBS_save="${LIBS}"
- LIBS="${LIBS} -lnsl"
- have_lib=""
- echo checking for -lnsl
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { main(); }
- EOF
- if eval $compile; then
- have_lib="1"
- fi
- rm -f conftest*
- LIBS="${LIBS_save}"
- if test -n "${have_lib}"; then
- :; LIBS="$LIBS -lnsl"
- else
- :;
- fi
-
- LIBS_save="${LIBS}"
- LIBS="${LIBS} -lc_s"
- have_lib=""
- echo checking for -lc_s
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { main(); }
- EOF
- if eval $compile; then
- have_lib="1"
- fi
- rm -f conftest*
- LIBS="${LIBS_save}"
- if test -n "${have_lib}"; then
- :; LIBS="$LIBS -lc_s"
- else
- :;
- fi
-
-
- #------------------------------------------------------------------------------
- # Locate the X11 header files and the X11 library archive.
- #------------------------------------------------------------------------------
-
- echo checking for X11 header files
- XINCLUDES="# no special path needed"
- cat > conftest.c <<EOF
- #include <X11/Intrinsic.h>
- EOF
- err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
- if test -z "$err"; then
- :
- else
- XINCLUDES="nope"
- fi
- rm -f conftest*
- if test "$XINCLUDES" = nope; then
- dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include"
- for i in $dirs ; do
- if test -r $i/X11/Intrinsic.h; then
- XINCLUDES=" -I$i"
- fi
- done
- fi
- if test "$XINCLUDES" = nope; then
- echo "Warning: couldn't find any X11 include files."
- echo " set XINCLUDES in Config.mk"
- XINCLUDES="# no include files found"
- fi
-
-
- echo "checking for X11 library archive"
- LIBS_save="${LIBS}"
- LIBS="${LIBS} -lX11_s"
- have_lib=""
- echo checking for -lX11_s
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { main(); }
- EOF
- if eval $compile; then
- have_lib="1"
- fi
- rm -f conftest*
- LIBS="${LIBS_save}"
- if test -n "${have_lib}"; then
- :; XLIBSW="-lX11_s"
- else
- :;
- fi
-
- LIBS_save="${LIBS}"
- LIBS="${LIBS} -lX11"
- have_lib=""
- echo checking for -lX11
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { main(); }
- EOF
- if eval $compile; then
- have_lib="1"
- fi
- rm -f conftest*
- LIBS="${LIBS_save}"
- if test -n "${have_lib}"; then
- :; XLIBSW="$XLIBSW -lX11"
- else
- :; XLIBSW=nope
- fi
-
- if test "$XLIBSW" = nope; then
- dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib"
- for i in $dirs ; do
- if test -r $i/libX11_s.a; then
- XLIBSW="-L$i -lX11_s"
- elif test -r $i/libX11.a; then
- XLIBSW="-L$i -lX11"
- fi
- done
- fi
- if test "$XLIBSW" = nope ; then
- LIBS_save="${LIBS}"
- LIBS="${LIBS} -lXwindow"
- have_lib=""
- echo checking for -lXwindow
- cat > conftest.c <<EOF
-
- int main() { exit(0); }
- int t() { main(); }
- EOF
- if eval $compile; then
- have_lib="1"
- fi
- rm -f conftest*
- LIBS="${LIBS_save}"
- if test -n "${have_lib}"; then
- :; XLIBSW=-lXwindow
- else
- :;
- fi
-
- fi
- if test "$XLIBSW" = nope ; then
- echo "Warning: couldn't find the X11 library archive. Using -lX11."
- XLIBSW=-lX11
- fi
-
-
- #------------------------------------------------------------------------------
- # The code below cleans up the DEFS variable to eliminate
- # duplicate entries. This makes the eventual make output
- # look a bit cleaner.
- #------------------------------------------------------------------------------
-
- newDefs=""
- for i in $DEFS; do
- if test -z "$newDefs"; then
- newDefs=$i
- elif echo $newDefs | fgrep -v -e $i >/dev/null 2>&1; then
- newDefs="$newDefs $i"
- fi
- done
- DEFS=$newDefs
-
- #------------------------------------------------------------------------------
- # Define srcbasedir and bldbasedir as absolute paths.
- #------------------------------------------------------------------------------
-
- srcbasedir=`cd $srcdir;pwd`
-
- bldbasedir=`pwd`
-
-
- #------------------------------------------------------------------------------
- # Generate the make files.
- #------------------------------------------------------------------------------
-
- if test -n "$prefix"; then
- test -z "$exec_prefix" && exec_prefix='${prefix}'
- prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
- fi
- if test -n "$exec_prefix"; then
- prsub="$prsub
- s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
- fi
- cat >conftest.def <<EOF
- $DEFS
- EOF
- escape_ampersand_and_backslash='s%[&\\]%\\&%g'
- DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
- rm -f conftest.def
-
- trap 'rm -f config.status; exit 1' 1 3 15
- echo creating config.status
- rm -f config.status
- cat > config.status <<EOF
- #!/bin/sh
- # Generated automatically by configure.
- # Run this file to recreate the current configuration.
- # This directory was configured as follows,
- # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
- #
- # $0 $configure_args
-
- for arg
- do
- case "\$arg" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- exec /bin/sh $0 $configure_args ;;
- *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
- esac
- done
-
- trap 'rm -fr Makefile osSupport/Makefile src/Makefile tclsrc/Makefile tksrc/Makefile tktclsrc/Makefile tools/Makefile src/tclXconfig.h conftest*; exit 1' 1 3 15
- YACC='$YACC'
- CC='$CC'
- CPP='$CPP'
- RANLIB='$RANLIB'
- MCS_CMD='$MCS_CMD'
- MAKEINCLUDE='$MAKEINCLUDE'
- MAKEQUOTE='$MAKEQUOTE'
- LIBOBJS='$LIBOBJS'
- MAN_DIR_SEPARATOR='$MAN_DIR_SEPARATOR'
- XINCLUDES='$XINCLUDES'
- XLIBSW='$XLIBSW'
- srcbasedir='$srcbasedir'
- bldbasedir='$bldbasedir'
- LIBS='$LIBS'
- srcdir='$srcdir'
- prefix='$prefix'
- exec_prefix='$exec_prefix'
- prsub='$prsub'
- EOF
- cat >> config.status <<\EOF
-
- top_srcdir=$srcdir
-
- # Allow make-time overrides of the generated file list.
- test -n "$gen_files" || gen_files="Makefile osSupport/Makefile src/Makefile tclsrc/Makefile tksrc/Makefile tktclsrc/Makefile tools/Makefile"
-
- for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
- srcdir=$top_srcdir
- # Remove last slash and all that follows it. Not all systems have dirname.
- dir=`echo $file|sed 's%/[^/][^/]*$%%'`
- if test "$dir" != "$file"; then
- test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
- test ! -d $dir && mkdir $dir
- fi
- echo creating $file
- rm -f $file
- echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
- sed -e "
- $prsub
- s%@YACC@%$YACC%g
- s%@CC@%$CC%g
- s%@CPP@%$CPP%g
- s%@RANLIB@%$RANLIB%g
- s%@MCS_CMD@%$MCS_CMD%g
- s%@MAKEINCLUDE@%$MAKEINCLUDE%g
- s%@MAKEQUOTE@%$MAKEQUOTE%g
- s%@LIBOBJS@%$LIBOBJS%g
- s%@MAN_DIR_SEPARATOR@%$MAN_DIR_SEPARATOR%g
- s%@XINCLUDES@%$XINCLUDES%g
- s%@XLIBSW@%$XLIBSW%g
- s%@srcbasedir@%$srcbasedir%g
- s%@bldbasedir@%$bldbasedir%g
- s%@LIBS@%$LIBS%g
- s%@srcdir@%$srcdir%g
- s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
- fi; done
- test -n "$gen_config" || gen_config=src/tclXconfig.h
- echo creating $gen_config
- # These sed commands are put into SEDDEFS when defining a macro.
- # They are broken into pieces to make the sed script easier to manage.
- # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
- # is the cpp macro being defined and VALUE is the value it is being given.
- # Each defining turns into a single global substitution command.
- #
- # SEDd sets the value in "#define NAME VALUE" lines.
- SEDdA='s@^\([ ]*\)#\([ ]*define[ ][ ]*\)'
- SEDdB='\([ ][ ]*\)[^ ]*@\1#\2'
- SEDdC='\3'
- SEDdD='@g'
- # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
- SEDuA='s@^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
- SEDuB='\([ ]\)@\1#\2define\3'
- SEDuC=' '
- SEDuD='\4@g'
- # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
- SEDeA='s@^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
- SEDeB='$@\1#\2define\3'
- SEDeC=' '
- SEDeD='@g'
- rm -f conftest.sed
- EOF
- # Turn off quoting long enough to insert the sed commands.
- rm -f conftest.sh
- cat > conftest.sh <<EOF
- $SEDDEFS
- EOF
-
- # Maximum number of lines to put in a single here document.
- maxshlines=9
-
- # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
- # on the size of here documents.
-
- while :
- do
- lines=`grep -c . conftest.sh`
- if test -z "$lines" || test "$lines" -eq 0; then break; fi
- rm -f conftest.s1 conftest.s2
- sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
- sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
- # Write a limited-size here document to append to conftest.sed.
- echo 'cat >> conftest.sed <<CONFEOF' >> config.status
- cat conftest.s1 >> config.status
- echo 'CONFEOF' >> config.status
- rm -f conftest.s1 conftest.sh
- mv conftest.s2 conftest.sh
- done
- rm -f conftest.sh
-
- # Now back to your regularly scheduled config.status.
- cat >> config.status <<\EOF
- # This sed command replaces #undef's with comments. This is necessary, for
- # example, in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it in
- # src/tclXconfig.h.
- cat >> conftest.sed <<\CONFEOF
- s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
- CONFEOF
- rm -f conftest.h
- # Break up the sed commands because old seds have small limits.
- maxsedlines=20
- cp $top_srcdir/$gen_config.in conftest.h1
- while :
- do
- lines=`grep -c . conftest.sed`
- if test -z "$lines" || test "$lines" -eq 0; then break; fi
- rm -f conftest.s1 conftest.s2 conftest.h2
- sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
- sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
- sed -f conftest.s1 < conftest.h1 > conftest.h2
- rm -f conftest.s1 conftest.h1 conftest.sed
- mv conftest.h2 conftest.h1
- mv conftest.s2 conftest.sed
- done
- rm -f conftest.sed conftest.h
- echo "/* $gen_config. Generated automatically by configure. */" > conftest.h
- cat conftest.h1 >> conftest.h
- rm -f conftest.h1
- if cmp -s $gen_config conftest.h 2>/dev/null; then
- # The file exists and we would not be changing it.
- rm -f conftest.h
- else
- rm -f $gen_config
- mv conftest.h $gen_config
- fi
-
-
- exit 0
- EOF
- chmod +x config.status
- test -n "$no_create" || ./config.status
-
-