dnl Process this file with autoconf 2.0 or later to make a configure script.
AC_REVISION($Revision$)
AC_PREREQ(2.0)
AC_INIT(Include/object.h)
AC_CONFIG_HEADER(pyconfig.h)

# Set VERSION so we only need to edit in one place (i.e., here)
AC_SUBST(VERSION)
VERSION=2.2

# Arguments passed to configure.
AC_SUBST(CONFIG_ARGS)
CONFIG_ARGS="$ac_configure_args"


AC_ARG_ENABLE(framework,
[  --enable-framework[=INSTALLDIR] Build (MacOSX|Darwin) framework],[
	case $enableval in
	yes) 
		enableval=/Library/Frameworks
	esac
	case $enableval in
	no)
		PYTHONFRAMEWORK=
		PYTHONFRAMEWORKDIR=no-framework
		PYTHONFRAMEWORKPREFIX=
		PYTHONFRAMEWORKINSTALLDIR=
		enable_framework=
		;;
	*)
		PYTHONFRAMEWORK=Python
		PYTHONFRAMEWORKDIR=Python.framework
		PYTHONFRAMEWORKPREFIX=$enableval
		PYTHONFRAMEWORKINSTALLDIR=$PYTHONFRAMEWORKPREFIX/$PYTHONFRAMEWORKDIR
		prefix=$PYTHONFRAMEWORKINSTALLDIR/Versions/$VERSION
	esac
	],[
	PYTHONFRAMEWORK=
	PYTHONFRAMEWORKDIR=no-framework
	PYTHONFRAMEWORKPREFIX=
	PYTHONFRAMEWORKINSTALLDIR=
	enable_framework=
])
AC_SUBST(PYTHONFRAMEWORK)
AC_SUBST(PYTHONFRAMEWORKDIR)
AC_SUBST(PYTHONFRAMEWORKPREFIX)
AC_SUBST(PYTHONFRAMEWORKINSTALLDIR)

##AC_ARG_WITH(dyld,
##[  --with-dyld                     Use (OpenStep|Rhapsody) dynamic linker],,)
##
# Set name for machine-dependent library files
AC_SUBST(MACHDEP)
AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
	ac_sys_system=`uname -s`
	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64"; then
		ac_sys_release=`uname -v`
	else
		ac_sys_release=`uname -r`
	fi
	ac_md_system=`echo $ac_sys_system |
			   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
	ac_md_release=`echo $ac_sys_release |
			   tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
	MACHDEP="$ac_md_system$ac_md_release"

	case $MACHDEP in
	cygwin*) MACHDEP="cygwin";;
	'')	MACHDEP="unknown";;
	esac
fi

#
# SGI compilers allow the specification of the both the ABI and the
# ISA on the command line.  Depending on the values of these switches,
# different and often incompatable code will be generated.
#
# The SGI_ABI variable can be used to modify the CC and LDFLAGS and
# thus supply support for various ABI/ISA combinations.  The MACHDEP
# variable is also adjusted.
#
AC_SUBST(SGI_ABI)
if test ! -z "$SGI_ABI"
then
        CC="cc $SGI_ABI"
        LDFLAGS="$SGI_ABI $LDFLAGS"
        MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'`
fi
AC_MSG_RESULT($MACHDEP)

# checks for alternative programs
AC_MSG_CHECKING(for --without-gcc)
AC_ARG_WITH(gcc, [  --without-gcc                   never use gcc], [
	case $withval in
	no)	CC=cc
		without_gcc=yes;;
	yes)	CC=gcc
		without_gcc=no;;
	*)	CC=$withval
		without_gcc=$withval;;
	esac], [
	case $ac_sys_system in
	AIX*)   CC=cc_r
		without_gcc=;;
	BeOS*)
		case $BE_HOST_CPU in
		ppc)
			CC=mwcc
			without_gcc=yes
			OPT="-O -D'DL_EXPORT(RTYPE)=__declspec(dllexport) RTYPE' -D'DL_IMPORT(RTYPE)=__declspec(dllexport) RTYPE' -export pragma"
			CCSHARED="-UDL_IMPORT -D'DL_IMPORT(RTYPE)=__declspec(dllimport) RTYPE'"
			LDFLAGS="$LDFLAGS -nodup"
			;;
		x86)
			CC=gcc
			without_gcc=no
			OPT=-O
			;;
		*)
			AC_ERROR(Unknown BeOS platform \"$BE_HOST_CPU\")
			;;
		esac
		AR="\$(srcdir)/Modules/ar_beos"
		RANLIB=:
		;;
    Monterey*)
        RANLIB=:
        without_gcc=;;
	*)	without_gcc=no;;
	esac])
AC_MSG_RESULT($without_gcc)

AC_SUBST(CXX)
AC_SUBST(MAINOBJ)
MAINOBJ=python.o
AC_MSG_CHECKING(for --with-cxx=<compiler>)
AC_ARG_WITH(cxx, [  --with-cxx=<compiler>           enable C++ support],[
	check_cxx=no
	case $withval in
	no)	CXX=
		with_cxx=no;;
	*)	CXX=$withval
		MAINOBJ=ccpython.o
		with_cxx=$withval;;
	esac], [
	with_cxx=no
	check_cxx=yes
])
AC_MSG_RESULT($with_cxx)

dnl The following fragment works similar to AC_PROG_CXX.
dnl It does not fail if CXX is not found, and it is not executed if 
dnl --without-cxx was given.
dnl Finally, it does not test whether CXX is g++.

dnl Autoconf 2.5x does not have AC_PROG_CXX_WORKS anymore
ifdef([AC_PROG_CXX_WORKS],[],
      [AC_DEFUN([AC_PROG_CXX_WORKS],
      [AC_LANG_PUSH(C++)dnl
       _AC_COMPILER_EXEEXT
       AC_LANG_POP()
      ]
)])

if test "$check_cxx" = "yes" 
then
	AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
	if test "$CXX" = "notfound"
	then
		CXX=
	else
		AC_PROG_CXX_WORKS
	fi
fi

# If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then
  AC_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi

AC_PROG_CC

# checks for UNIX variants that set C preprocessor variables
AC_AIX
AC_MINIX

AC_EXEEXT
AC_MSG_CHECKING(for --with-suffix)
AC_ARG_WITH(suffix, [  --with-suffix=.exe              set executable suffix],[
	case $withval in
	no)	EXEEXT=;;
	yes)	EXEEXT=.exe;;
	*)	EXEEXT=$withval;;
	esac])
AC_MSG_RESULT($EXEEXT)
# Test whether we're running on a non-case-sensitive system, in which
# case we give a warning if no ext is given
if test -d "python" -a -z "$EXEEXT"
then
    AC_MSG_WARN(This filesystem is not case-sensitive so you should probably use --with-suffix)
fi

case $MACHDEP in
bsdos*)
    case $CC in
    gcc) CC="$CC -D_HAVE_BSDI";;
    esac;;
esac

case $ac_sys_system in
hp*|HP*)
    case $CC in
    cc|*/cc) CC="$CC -Ae";;
    esac;;
Monterey*)
    case $CC in
    cc) CC="$CC -Wl,-Bexport";;
    esac;;
SunOS*)
    # Some functions have a prototype only with that define, e.g. confstr
    AC_DEFINE(__EXTENSIONS__)
    ;;
esac


AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY"
then
	LIBRARY='libpython$(VERSION).a'
fi
AC_MSG_RESULT($LIBRARY)

# LDLIBRARY is the name of the library to link against (as opposed to the
# name of the library into which to insert object files). BLDLIBRARY is also
# the library to link against, usually. On Mac OS X frameworks, BLDLIBRARY
# is blank as the main program is not linked directly against LDLIBRARY.
# LDLIBRARYDIR is the path to LDLIBRARY, which is made in a subdirectory. On
# systems without shared libraries, LDLIBRARY is the same as LIBRARY
# (defined in the Makefiles). On Cygwin LDLIBRARY is the import library,
# DLLLIBRARY is the shared (i.e., DLL) library.
# 
AC_SUBST(LDLIBRARY)
AC_SUBST(DLLLIBRARY)
AC_SUBST(BLDLIBRARY)
AC_SUBST(LDLIBRARYDIR)
LDLIBRARY="$LIBRARY"
BLDLIBRARY='$(LDLIBRARY)'
DLLLIBRARY=''
LDLIBRARYDIR=''

# LINKCC is the command that links the python executable -- default is $(CC).
# If CXX is set, and if it is needed to link a main function that was
# compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable:
# python might then depend on the C++ runtime
# This is altered for AIX in order to build the export list before 
# linking.
AC_SUBST(LINKCC)
AC_MSG_CHECKING(LINKCC)
if test -z "$LINKCC"
then
        if test -z "$CXX"; then
              LINKCC="\$(PURIFY) \$(CC)"
        else
              echo 'int main(){return 0;}' > conftest.$ac_ext
              $CXX -c conftest.$ac_ext 2>&5
              if $CC -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
                 && test -s conftest$ac_exeext && ./conftest$ac_exeext
              then
                 LINKCC="\$(PURIFY) \$(CC)"
              else
                 LINKCC="\$(PURIFY) \$(CXX)"
              fi
              rm -fr conftest*
        fi
	case $ac_sys_system in
	AIX*)
	   LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp \"\" \$(LIBRARY); $(LINKCC)";;
	dgux*)
	   LINKCC="LD_RUN_PATH=$libdir $(LINKCC)";;
	Monterey64*)
	   LINKCC="$(LINKCC) -L/usr/lib/ia64l64";;
	esac
fi
AC_MSG_RESULT($LINKCC)

AC_MSG_CHECKING(LDLIBRARY)

# DG/UX requires some fancy ld contortions to produce a .so from an .a
case $MACHDEP in
dguxR4)
      LDLIBRARY='libpython$(VERSION).so'
      OPT="$OPT -pic"
      ;;
beos*)
      LDLIBRARY='libpython$(VERSION).so'
      ;;
cygwin*)
      LDLIBRARY='libpython$(VERSION).dll.a'
      DLLLIBRARY='libpython$(VERSION).dll'
      ;;
esac

# MacOSX framework builds need more magic. LDLIBRARY is the dynamic
# library that we build, but we do not want to link against it (we
# will find it with a -framework option). For this reason there is an
# extra variable BLDLIBRARY against which Python and the extension
# modules are linked, BLDLIBRARY. This is normally the same as
# LDLIBRARY, but empty for MacOSX framework builds.
if test "$enable_framework"
then
  LDLIBRARY='$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
  LDLIBRARYDIR='$(PYTHONFRAMEWORKDIR)'
  BLDLIBRARY=''
else
  BLDLIBRARY='$(LDLIBRARY)'
fi  

AC_MSG_RESULT($LDLIBRARY)

AC_PROG_RANLIB
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)

case $MACHDEP in
bsdos*|hp*|HP*)
	# install -d does not work on BSDI or HP-UX
	if test -z "$INSTALL"
	then
		INSTALL="${srcdir}/install-sh -c"
	fi
esac
AC_PROG_INSTALL

# Not every filesystem supports hard links
AC_SUBST(LN)
if test -z "$LN" ; then
	case $ac_sys_system in
		BeOS*) LN="ln -s";;
		CYGWIN*) LN="ln -s";;
		*) LN=ln;;
	esac
fi

# Check for --with-pydebug
AC_MSG_CHECKING(for --with-pydebug)
AC_ARG_WITH(pydebug, 
[  --with-pydebug                  build with Py_DEBUG defined], [
if test "$withval" != no
then AC_DEFINE(Py_DEBUG) AC_MSG_RESULT(yes); Py_DEBUG='true'
else AC_MSG_RESULT(no); Py_DEBUG='false'
fi],
[AC_MSG_RESULT(no)])

# Optimizer/debugger flags
AC_SUBST(OPT)
if test -z "$OPT"
then
	case $GCC in
	yes)
		case $ac_cv_prog_cc_g in
	yes)
	    if test "$Py_DEBUG" = 'true' ; then
		# Optimization messes up debuggers, so turn it off for
		# debug builds.
		OPT="-g -Wall -Wstrict-prototypes"
	    else
		OPT="-g -O3 -Wall -Wstrict-prototypes"
	    fi;;
	*)
	    OPT="-O3 -Wall -Wstrict-prototypes";;
	esac
	;;
    *)
	case $ac_sys_system in
	OpenUNIX*|UnixWare*)
	    OPT="-O -K pentium,host,inline,loop_unroll,alloca ";;
	*)
	    OPT="-O";;
	esac
    esac
    case $ac_sys_system in
    Darwin*)
    	OPT="$OPT -no-cpp-precomp";;
    esac
fi

# The current (beta) Monterey compiler dies with optimizations
case $ac_sys_system in
Monterey*) OPT="";;
esac

if test "$ac_arch_flags"
then
	OPT="$OPT $ac_arch_flags"
fi

AC_MSG_CHECKING(whether $CC accepts -OPT:Olimit=0)
AC_CACHE_VAL(ac_cv_opt_olimit_ok,
[ac_save_cc="$CC"
CC="$CC -OPT:Olimit=0"
AC_TRY_RUN([int main() { return 0; }],
  ac_cv_opt_olimit_ok=yes,
  ac_cv_opt_olimit_ok=no,
  ac_cv_opt_olimit_ok=no)
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_opt_olimit_ok)
if test $ac_cv_opt_olimit_ok = yes; then
    case $ac_sys_system in
      Darwin*) OPT="$OPT" ;;
      *) OPT="$OPT -OPT:Olimit=0";;
    esac
else
  AC_MSG_CHECKING(whether $CC accepts -Olimit 1500)
  AC_CACHE_VAL(ac_cv_olimit_ok,
  [ac_save_cc="$CC"
  CC="$CC -Olimit 1500"
  AC_TRY_RUN([int main() { return 0; }],
    ac_cv_olimit_ok=yes,
    ac_cv_olimit_ok=no,
    ac_cv_olimit_ok=no)
  CC="$ac_save_cc"])
  AC_MSG_RESULT($ac_cv_olimit_ok)
  if test $ac_cv_olimit_ok = yes; then
    OPT="$OPT -Olimit 1500"
  fi
fi

# On some compilers, pthreads are available without further options
# (e.g. MacOS X). On some of these systems, the compiler will not
# complain if unaccepted options are passed (e.g. gcc on Mac OS X).
# So we have to see first whether pthreads are available without
# options before we can check whether -Kpthread improves anything.
AC_MSG_CHECKING(whether pthreads are available without options)
AC_CACHE_VAL(ac_cv_pthread_is_default,
[AC_TRY_RUN([
#include <pthread.h>

void* routine(void* p){return NULL;}

int main(){
  pthread_t p;
  if(pthread_create(&p,NULL,routine,NULL)!=0)
    return 1;
  return 0;
}
],
  ac_cv_pthread_is_default=yes,
  ac_cv_pthread_is_default=no,
  ac_cv_pthread_is_default=no)
])
AC_MSG_RESULT($ac_cv_pthread_is_default)


if test $ac_cv_pthread_is_default = yes 
then
  ac_cv_kpthread=no
else
# -Kpthread, if available, provides the right #defines
# and linker options to make pthread_create available
# Some compilers won't report that they do not support -Kpthread,
# so we need to run a program to see whether it really made the
# function available.
AC_MSG_CHECKING(whether $CC accepts -Kpthread)
AC_CACHE_VAL(ac_cv_kpthread,
[ac_save_cc="$CC"
CC="$CC -Kpthread"
AC_TRY_RUN([
#include <pthread.h>

void* routine(void* p){return NULL;}

int main(){
  pthread_t p;
  if(pthread_create(&p,NULL,routine,NULL)!=0)
    return 1;
  return 0;
}
],
  ac_cv_kpthread=yes,
  ac_cv_kpthread=no,
  ac_cv_kpthread=no)
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_kpthread)
fi

dnl # check for ANSI or K&R ("traditional") preprocessor
dnl AC_MSG_CHECKING(for C preprocessor type)
dnl AC_TRY_COMPILE([
dnl #define spam(name, doc) {#name, &name, #name "() -- " doc}
dnl int foo;
dnl struct {char *name; int *addr; char *doc;} desc = spam(foo, "something");
dnl ], [;], cpp_type=ansi, AC_DEFINE(HAVE_OLD_CPP) cpp_type=traditional)
dnl AC_MSG_RESULT($cpp_type)

# checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS(dlfcn.h fcntl.h grp.h limits.h langinfo.h locale.h \
ncurses.h poll.h pthread.h \
signal.h stdarg.h stddef.h stdlib.h thread.h unistd.h utime.h termios.h \
sys/audioio.h sys/file.h sys/lock.h sys/modem.h db_185.h db.h \
sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \
sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \
ndbm.h db1/ndbm.h gdbm/ndbm.h sys/resource.h netpacket/packet.h)
AC_HEADER_DIRENT

# checks for typedefs
was_it_defined=no
AC_MSG_CHECKING(for clock_t in time.h)
AC_EGREP_HEADER(clock_t, time.h, was_it_defined=yes, AC_DEFINE(clock_t, long))
AC_MSG_RESULT($was_it_defined)

# Two defines needed to enable largefile support on various platforms
# These may affect some typedefs
AC_DEFINE(_LARGEFILE_SOURCE)
AC_DEFINE(_FILE_OFFSET_BITS, 64)

# Add some code to confdefs.h so that the test for off_t works on SCO
cat >> confdefs.h <<\EOF
#if defined(SCO_DS)
#undef _OFF_T
#endif
EOF

# Type availability checks
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T
AC_TYPE_UID_T

# Sizes of various common basic types
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(void *, 4)
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(float, 4)
AC_CHECK_SIZEOF(double, 8)
AC_CHECK_SIZEOF(fpos_t, 4)

AC_MSG_CHECKING(for long long support)
have_long_long=no
AC_TRY_COMPILE([], [long long x; x = (long long)0;], AC_DEFINE(HAVE_LONG_LONG) have_long_long=yes)
AC_MSG_RESULT($have_long_long)
if test "$have_long_long" = yes ; then
AC_CHECK_SIZEOF(long long, 8)
fi

AC_MSG_CHECKING(for uintptr_t support)
have_uintptr_t=no
AC_TRY_COMPILE([], [uintptr_t x; x = (uintptr_t)0;], AC_DEFINE(HAVE_UINTPTR_T) have_uintptr_t=yes)
AC_MSG_RESULT($have_uintptr_t)
if test "$have_uintptr_t" = yes ; then
AC_CHECK_SIZEOF(uintptr_t, 4)
fi

# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
AC_MSG_CHECKING(size of off_t)
AC_CACHE_VAL(ac_cv_sizeof_off_t,
[AC_TRY_RUN([#include <stdio.h>
#include <sys/types.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(off_t));
  exit(0);
}],
ac_cv_sizeof_off_t=`cat conftestval`,
ac_cv_sizeof_off_t=0,
ac_cv_sizeof_off_t=4)
])
AC_MSG_RESULT($ac_cv_sizeof_off_t)
AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t)

AC_MSG_CHECKING(whether to enable large file support)
if test "$have_long_long" = yes -a \
	"$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
	"$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
  AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
  AC_MSG_RESULT(yes)
else
  AC_MSG_RESULT(no)
fi

# AC_CHECK_SIZEOF() doesn't include <time.h>.
AC_MSG_CHECKING(size of time_t)
AC_CACHE_VAL(ac_cv_sizeof_time_t,
[AC_TRY_RUN([#include <stdio.h>
#include <time.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(time_t));
  exit(0);
}],
ac_cv_sizeof_time_t=`cat conftestval`,
ac_cv_sizeof_time_t=0,
ac_cv_sizeof_time_t=4)
])
AC_MSG_RESULT($ac_cv_sizeof_time_t)
AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t)


# if have pthread_t then define SIZEOF_PTHREAD_T
ac_save_cc="$CC"
if test "$ac_cv_kpthread" = "yes"
then CC="$CC -Kpthread"
fi
AC_MSG_CHECKING(for pthread_t)
have_pthread_t=no
AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
AC_MSG_RESULT($have_pthread_t)
if test "$have_pthread_t" = yes ; then
  # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
  AC_MSG_CHECKING(size of pthread_t)
  AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
  [AC_TRY_RUN([#include <stdio.h>
  #include <pthread.h>
  main()
  {
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    fprintf(f, "%d\n", sizeof(pthread_t));
    exit(0);
  }],
  ac_cv_sizeof_pthread_t=`cat conftestval`,
  ac_cv_sizeof_pthread_t=0,
  ac_cv_sizeof_pthread_t=4)
  ])
  AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
  AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t)
fi
CC="$ac_save_cc"

AC_MSG_CHECKING(for --enable-toolbox-glue)
AC_ARG_ENABLE(toolbox-glue,
[  --enable-toolbox-glue            disable/enable MacOSX glue code for extensions])

if test -z "$enable_toolbox_glue"
then 
	case $ac_sys_system/$ac_sys_release in
	Darwin/*)
		enable_toolbox_glue="yes";;
	*)
		enable_toolbox_glue="no";;
	esac
fi
case "$enable_toolbox_glue" in
yes)
	extra_frameworks="-framework CoreServices -framework Foundation"
	extra_machdep_objs="Python/mactoolboxglue.o"
	extra_undefs="-u __dummy -u _PyMac_Error"
	AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE)
	;;
*)
	extra_frameworks=""
	extra_machdep_objs=""
	extra_undefs=""
	;;
esac
AC_MSG_RESULT($enable_toolbox_glue)

AC_SUBST(LIBTOOL_CRUFT)
case $ac_sys_system/$ac_sys_release in
  Darwin/1.4*)
    ns_undef_sym='_environ'
    LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -flat_namespace -U $ns_undef_sym"
      LIBTOOL_CRUFT="$LIBTOOL_CRUFT $extra_frameworks"
    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Python'
    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
  Darwin/*)
    ns_undef_sym='_environ'
    LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -U $ns_undef_sym"
   	LIBTOOL_CRUFT="$LIBTOOL_CRUFT $extra_frameworks"
    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Python'
    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
esac

AC_MSG_CHECKING(for --enable-framework)
if test "$enable_framework"
then
	OPT="$OPT -fno-common -dynamic"
	# -U __environ is needed since bundles don't have access
	# to crt0 when built but will always be linked against it
	# -F. is needed to allow linking to the framework while 
	# in the build location.
	
	case $ac_sys_system/$ac_sys_release in
	    Darwin/1.4*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-flat_namespace,-U,$ns_undef_sym";;
	    Darwin/*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-U,$ns_undef_sym";;
	esac
	AC_DEFINE(WITH_NEXT_FRAMEWORK)
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING(for dyld)
case $ac_sys_system/$ac_sys_release in
  Darwin/*)
  	AC_DEFINE(WITH_DYLD)
  	AC_MSG_RESULT(always on for Darwin)
  	;;
  *)
	AC_MSG_RESULT(no)
	;;
esac

# Set info about shared libraries.
AC_SUBST(SO)
AC_SUBST(LDSHARED)
AC_SUBST(BLDSHARED)
AC_SUBST(CCSHARED)
AC_SUBST(LINKFORSHARED)
# SO is the extension of shared libraries `(including the dot!)
# -- usually .so, .sl on HP-UX, .dll on Cygwin
AC_MSG_CHECKING(SO)
if test -z "$SO"
then
	case $ac_sys_system in
	hp*|HP*)   SO=.sl;;
	CYGWIN*)   SO=.dll;;
	*)	   SO=.so;;
	esac
fi
AC_MSG_RESULT($SO)
# LDSHARED is the ld *command* used to create shared library
# -- "ld" on SunOS 4.x.x, "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5
# (Shared libraries in this instance are shared modules to be loaded into
# Python, as opposed to building Python itself as a shared library.)
AC_MSG_CHECKING(LDSHARED)
if test -z "$LDSHARED"
then
	case $ac_sys_system/$ac_sys_release in
	AIX*)
		BLDSHARED="\$(srcdir)/Modules/ld_so_aix \$(CC) -bI:Modules/python.exp"
		LDSHARED="\$(BINLIBDEST)/config/ld_so_aix \$(CC) -bI:\$(BINLIBDEST)/config/python.exp"
		;;
	BeOS*)
		BLDSHARED="\$(srcdir)/Modules/ld_so_beos $LDLIBRARY"
		LDSHARED="\$(BINLIBDEST)/config/ld_so_beos \$(LIBDIR)/$LDLIBRARY"
		;;
	IRIX/5*) LDSHARED="ld -shared";;
	IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";;
	SunOS/4*) LDSHARED="ld";;
	SunOS/5*) 
		if test "$GCC" = "yes"
		then LDSHARED='$(CC) -shared'
		else LDSHARED="$(CC) -G";
		fi ;;
	hp*|HP*) LDSHARED="ld -b";;
	OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
	DYNIX/ptx*) LDSHARED="ld -G";;
	Darwin/1.4*)
		LDSHARED='$(CC) $(LDFLAGS) -bundle'
		if test "$enable_framework" ; then
			# Link against the framework. All externals should be defined.
			LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)'
		else
			# No framework. Ignore undefined symbols, assuming they come from Python
			LDSHARED="$LDSHARED -flat_namespace -undefined suppress"
		fi ;;
	Darwin/*)
		LDSHARED='$(CC) $(LDFLAGS) -bundle'
		if test "$enable_framework" ; then
			# Link against the framework. All externals should be defined.
			LDSHARED="$LDSHARED "'-framework $(PYTHONFRAMEWORK)'
		else
			# No framework. Ignore undefined symbols, assuming they come from Python
			LDSHARED="$LDSHARED -undefined suppress"
		fi ;;
	Linux*) LDSHARED="gcc -shared";;
	dgux*) LDSHARED="ld -G";;
	BSD/OS*/4*) LDSHARED="gcc -shared";;
	OpenBSD*|NetBSD*|FreeBSD*)
		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
		then
			LDSHARED="cc -shared ${LDFLAGS}"
		else
			LDSHARED="ld -Bshareable ${LDFLAGS}"
		fi;;
	OpenUNIX*|UnixWare*)
		if test "$GCC" = "yes"
		then LDSHARED="$(CC) -shared"
		else LDSHARED="$(CC) -G"
		fi;;
	SCO_SV*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";;
	Monterey*) LDSHARED="cc -G -dy -Bdynamic -Bexport -L/usr/lib/ia64l64";;
	CYGWIN*) LDSHARED="gcc -shared -Wl,--enable-auto-image-base";;
	*)	LDSHARED="ld";;
	esac
fi
AC_MSG_RESULT($LDSHARED)
BLDSHARED=${BLDSHARED-$LDSHARED}
# CCSHARED are the C *flags* used to create objects to go into a shared
# library (module) -- this is only needed for a few systems
AC_MSG_CHECKING(CCSHARED)
if test -z "$CCSHARED"
then
	case $ac_sys_system/$ac_sys_release in
	SunOS*) if test "$GCC" = yes;
	        then CCSHARED="-fPIC";
	        fi;;
	hp*|HP*) if test "$GCC" = yes;
		 then CCSHARED="-fPIC";
		 else CCSHARED="+z";
		 fi;;
	Linux*) CCSHARED="-fPIC";;
	BSD/OS*/4*) CCSHARED="-fpic";;
	FreeBSD*|NetBSD*|OpenBSD*) CCSHARED="-fPIC";;
	OpenUNIX*|UnixWare*)
		if test "$GCC" = "yes"
		then CCSHARED="-fPIC"
		else CCSHARED="-KPIC"
		fi;;
	SCO_SV*) CCSHARED="-KPIC -dy -Bdynamic";;
	Monterey*) CCSHARED="-G";;
	IRIX*/6*)  case $CC in
		   *gcc*) CCSHARED="-shared";;
		   *) CCSHARED="";;
		   esac;;
	CYGWIN*) CCSHARED="-DUSE_DL_IMPORT";;
	esac
fi
AC_MSG_RESULT($CCSHARED)
# LINKFORSHARED are the flags passed to the $(CC) command that links
# the python executable -- this is only needed for a few systems
AC_MSG_CHECKING(LINKFORSHARED)
if test -z "$LINKFORSHARED"
then
	case $ac_sys_system/$ac_sys_release in
	AIX*)	LINKFORSHARED='-Wl,-bE:Modules/python.exp -lld';;
	hp*|HP*)
	    LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
	BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
	Linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
	# -u libsys_s pulls in all symbols in libsys
	Darwin/*) 
		# -u __dummy makes the linker aware of the objc runtime
		# in System.framework; otherwise, __objcInit (referenced in
		# crt1.o) gets erroneously defined as common, which breaks dynamic
		# loading of any modules which reference it in System.framework.
		# -u _PyMac_Error is needed to pull in the mac toolbox glue, which is
		# not used by the core itself but which needs to be in the core so
		# that dynamically loaded extension modules have access to it.
		LINKFORSHARED="$extra_undefs -framework System"
		if test "$enable_framework"
		then
			LINKFORSHARED="$LINKFORSHARED -framework Python"
		fi
		LINKFORSHARED="$LINKFORSHARED $extra_frameworks";;
	OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
	SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
	ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
	FreeBSD*|NetBSD*|OpenBSD*) 
		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
		then
			LINKFORSHARED="-Wl,--export-dynamic"
		fi;;
	SunOS/5*) case $CC in
		  *gcc*)
		    if $CC -Xlinker -V 2>&1 | grep BFD >/dev/null
		    then
			LINKFORSHARED="-Xlinker --export-dynamic"
		    fi;;
		  esac;;
	esac
fi
AC_MSG_RESULT($LINKFORSHARED)

AC_SUBST(CFLAGSFORSHARED)
AC_MSG_CHECKING(CFLAGSFORSHARED)
if test ! "$LIBRARY" = "$LDLIBRARY"
then
	case $ac_sys_system in
	CYGWIN*)
		# Cygwin needs CCSHARED when building extension DLLs
		# but not when building the interpreter DLL.
		CFLAGSFORSHARED='';;
	*)
		CFLAGSFORSHARED='$(CCSHARED)'
	esac
fi
AC_MSG_RESULT($CFLAGSFORSHARED)

# checks for libraries
AC_CHECK_LIB(dl, dlopen)	# Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load)	# Dynamic linking for HP-UX

# checks for system dependent C++ extensions support
case "$ac_sys_system" in
	AIX*)	AC_MSG_CHECKING(for genuine AIX C++ extensions support)
		AC_TRY_LINK([#include "/usr/lpp/xlC/include/load.h"],
			    [loadAndInit("", 0, "")],
			    [AC_DEFINE(AIX_GENUINE_CPLUSPLUS)
			     AC_MSG_RESULT(yes)],
			    [AC_MSG_RESULT(no)]);;
	*) ;;
esac

# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
# However on SGI IRIX, these exist but are broken.
# BeOS' sockets are stashed in libnet.
case "$ac_sys_system" in
IRIX*) ;;
*)
AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4
AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets
;;
esac
case "$ac_sys_system" in
BeOS*)
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
;;
esac

AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
[  --with-libs='lib1 ...'          link against additional libs], [
AC_MSG_RESULT($withval)
LIBS="$withval $LIBS"
], AC_MSG_RESULT(no))

# Determine if signalmodule should be used.
AC_SUBST(USE_SIGNAL_MODULE)
AC_SUBST(SIGNAL_OBJS)
AC_MSG_CHECKING(for --with-signal-module)
AC_ARG_WITH(signal-module,
[  --with-signal-module            disable/enable signal module])

if test -z "$with_signal_module"
then with_signal_module="yes"
fi
AC_MSG_RESULT($with_signal_module)

if test "${with_signal_module}" = "yes"; then
	USE_SIGNAL_MODULE=""
	SIGNAL_OBJS=""
else
	USE_SIGNAL_MODULE="#"
	SIGNAL_OBJS="Parser/intrcheck.o Python/sigcheck.o"
fi

# This is used to generate Setup.config
AC_SUBST(USE_THREAD_MODULE)
USE_THREAD_MODULE=""

AC_MSG_CHECKING(for --with-dec-threads)
AC_SUBST(LDLAST)
AC_ARG_WITH(dec-threads,
[  --with-dec-threads              use DEC Alpha/OSF1 thread-safe libraries], [
AC_MSG_RESULT($withval)
LDLAST=-threads
if test "${with_thread+set}" != set; then
   with_thread="$withval";
fi],
AC_MSG_RESULT(no))

AC_MSG_CHECKING(for --with-threads)
AC_ARG_WITH(threads,
[  --with(out)-threads[=DIRECTORY] disable/enable thread support])

# --with-thread is deprecated, but check for it anyway
AC_ARG_WITH(thread,
[  --with(out)-thread[=DIRECTORY]  deprecated; use --with(out)-threads],[
with_threads=$with_thread])

if test -z "$with_threads"
then with_threads="yes"
fi
AC_MSG_RESULT($with_threads)

if test "$with_threads" = "no"
then
    USE_THREAD_MODULE="#"
elif test "$ac_cv_pthread_is_default" = yes
then
    AC_DEFINE(WITH_THREAD)
    # Defining _REENTRANT on system with POSIX threads should not hurt.
    AC_DEFINE(_REENTRANT)
    posix_threads=yes
    LIBOBJS="$LIBOBJS thread.o"    
elif test "$ac_cv_kpthread" = "yes"
then
    CC="$CC -Kpthread"
    AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBOBJS="$LIBOBJS thread.o"
else
    if test ! -z "$with_threads" -a -d "$with_threads"
    then LDFLAGS="$LDFLAGS -L$with_threads"
    fi
    if test ! -z "$withval" -a -d "$withval"
    then LDFLAGS="$LDFLAGS -L$withval"
    fi

    # According to the POSIX spec, a pthreads implementation must
    # define _POSIX_THREADS in unistd.h. Some apparently don't (which ones?)
    AC_MSG_CHECKING(for _POSIX_THREADS in unistd.h)
    AC_EGREP_CPP(yes,
    [#include <unistd.h>
     #ifdef _POSIX_THREADS
     yes
     #endif
    ], unistd_defines_pthreads=yes, unistd_defines_pthreads=no)
    AC_MSG_RESULT($unistd_defines_pthreads)

    AC_DEFINE(_REENTRANT)
    AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(C_THREADS)
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_MSG_CHECKING(for --with-pth)
    AC_ARG_WITH(pth,
    [  --with-pth                      use GNU pth threading libraries], [
    AC_MSG_RESULT($withval)
    AC_DEFINE(WITH_THREAD)
    AC_DEFINE(HAVE_PTH)
    LIBS="-lpth $LIBS"
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_MSG_RESULT(no)

    # Just looking for pthread_create in libpthread is not enough:
    # on HP/UX, pthread.h renames pthread_create to a different symbol name.
    # So we really have to include pthread.h, and then link.
    _libs=$LIBS
    LIBS="$LIBS -lpthread"
    AC_MSG_CHECKING([for pthread_create in -lpthread])
    AC_TRY_LINK([#include <pthread.h>

void * start_routine (void *arg) { exit (0); }], [
pthread_create (NULL, NULL, start_routine, NULL)], [
    AC_MSG_RESULT(yes)
    AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBOBJS="$LIBOBJS thread.o"],[
    LIBS=$_libs
    AC_CHECK_FUNC(pthread_detach, [AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_CHECK_HEADER(kernel/OS.h, [AC_DEFINE(WITH_THREAD)
    AC_DEFINE(BEOS_THREADS)
    LIBOBJS="$LIBOBJS thread.o"],[
    AC_CHECK_LIB(pthreads, pthread_create, [AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBS="$LIBS -lpthreads"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(c_r, pthread_create, [AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBS="$LIBS -lc_r"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBS="$LIBS -lthread"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBS="$LIBS -lpthread"
    LIBOBJS="$LIBOBJS thread.o"], [
    AC_CHECK_LIB(cma, pthread_create, [AC_DEFINE(WITH_THREAD)
    posix_threads=yes
    LIBS="$LIBS -lcma"
    LIBOBJS="$LIBOBJS thread.o"],[
    USE_THREAD_MODULE="#"])
    ])])])])])])])])])

    if test "$posix_threads" = "yes"; then
      if test "$unistd_defines_pthreads" = "no"; then
         AC_DEFINE(_POSIX_THREADS)
      fi

      AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
      AC_CACHE_VAL(ac_cv_pthread_system_supported,
      [AC_TRY_RUN([#include <pthread.h>
      void *foo(void *parm) {
        return NULL;
      }
      main() {
        pthread_attr_t attr;
        if (pthread_attr_init(&attr)) exit(-1);
        if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1);
        if (pthread_create(NULL, &attr, foo, NULL)) exit(-1);
        exit(0);
      }],
      ac_cv_pthread_system_supported=yes,
      ac_cv_pthread_system_supported=no,
      ac_cv_pthread_system_supported=no)
      ])
      AC_MSG_RESULT($ac_cv_pthread_system_supported)
      if test "$ac_cv_pthread_system_supported" = "yes"; then
        AC_DEFINE(PTHREAD_SYSTEM_SCHED_SUPPORTED)
      fi
      AC_CHECK_FUNCS(pthread_sigmask)
    fi

    AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
    LIBS="$LIBS -lmpc"
    LIBOBJS="$LIBOBJS thread.o"
    USE_THREAD_MODULE=""])
    AC_CHECK_LIB(thread, thr_create, [AC_DEFINE(WITH_THREAD)
    LIBS="$LIBS -lthread"
    LIBOBJS="$LIBOBJS thread.o"
    USE_THREAD_MODULE=""])

    if test "$USE_THREAD_MODULE" != "#"
    then
        # If the above checks didn't disable threads, (at least) OSF1
        # needs this '-threads' argument during linking.
        case $ac_sys_system in
        OSF1) LDLAST=-threads;;
        esac
    fi
fi

# Check for enable-ipv6
AC_MSG_CHECKING([if --enable-ipv6 is specified])
AC_ARG_ENABLE(ipv6,
[  --enable-ipv6                   Enable ipv6 (with ipv4) support
  --disable-ipv6                  Disable ipv6 support],
[ case "$enableval" in
  no)
       AC_MSG_RESULT(no)
       ipv6=no
       ;;
  *)   AC_MSG_RESULT(yes)
       AC_DEFINE(ENABLE_IPV6)
       ipv6=yes
       ;;
  esac ],

[
dnl the check does not work on cross compilation case...
  AC_TRY_RUN([ /* AF_INET6 available check */
#include <sys/types.h>
#include <sys/socket.h>
main()
{
 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
   exit(1);
 else
   exit(0);
}
],
  AC_MSG_RESULT(yes)
  ipv6=yes,
  AC_MSG_RESULT(no)
  ipv6=no,
  AC_MSG_RESULT(no)
  ipv6=no
)

if test "$ipv6" = "yes"; then
	AC_MSG_CHECKING(if RFC2553 API is available)
	AC_TRY_COMPILE([#include <sys/types.h>
#include <netinet/in.h>],
	[struct sockaddr_in6 x;
x.sin6_scope_id;],
		AC_MSG_RESULT(yes)
		ipv6=yes,
		AC_MSG_RESULT(no, IPv6 disabled)
		ipv6=no)
fi

if test "$ipv6" = "yes"; then
	AC_DEFINE(ENABLE_IPV6)
fi
])

ipv6type=unknown
ipv6lib=none
ipv6trylibc=no

if test "$ipv6" = "yes"; then
	AC_MSG_CHECKING([ipv6 stack type])
	for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta;
	do
		case $i in
		inria)
			dnl http://www.kame.net/
			AC_EGREP_CPP(yes, [
#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION
yes
#endif],
				[ipv6type=$i;
				OPT="-DINET6 $OPT"])
			;;
		kame)
			dnl http://www.kame.net/
			AC_EGREP_CPP(yes, [
#include <netinet/in.h>
#ifdef __KAME__
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6
				ipv6libdir=/usr/local/v6/lib
				ipv6trylibc=yes
				OPT="-DINET6 $OPT"])
			;;
		linux-glibc)
			dnl http://www.v6.linux.or.jp/
			AC_EGREP_CPP(yes, [
#include <features.h>
#if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2))
yes
#endif],
				[ipv6type=$i;
				ipv6trylibc=yes
				OPT="-DINET6 $OPT"])
			;;
		linux-inet6)
			dnl http://www.v6.linux.or.jp/
			if test -d /usr/inet6; then
				ipv6type=$i
				ipv6lib=inet6
				ipv6libdir=/usr/inet6/lib
				OPT="-DINET6 -I/usr/inet6/include $OPT"
			fi
			;;
		solaris)
			if test -f /etc/netconfig; then
                          if /usr/xpg4/bin/grep -q tcp6 /etc/netconfig; then
				ipv6type=$i
				ipv6trylibc=yes
				OPT="-DINET6 $OPT"
                          fi
                        fi
			;;
		toshiba)
			AC_EGREP_CPP(yes, [
#include <sys/param.h>
#ifdef _TOSHIBA_INET6
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				ipv6libdir=/usr/local/v6/lib;
				OPT="-DINET6 $OPT"])
			;;
		v6d)
			AC_EGREP_CPP(yes, [
#include </usr/local/v6/include/sys/v6config.h>
#ifdef __V6D__
yes
#endif],
				[ipv6type=$i;
				ipv6lib=v6;
				ipv6libdir=/usr/local/v6/lib;
				OPT="-I/usr/local/v6/include $OPT"])
			;;
		zeta)
			AC_EGREP_CPP(yes, [
#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				ipv6libdir=/usr/local/v6/lib;
				OPT="-DINET6 $OPT"])
			;;
		esac
		if test "$ipv6type" != "unknown"; then
			break
		fi
	done
	AC_MSG_RESULT($ipv6type)
fi

if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
	if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
		LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
		echo "using lib$ipv6lib"
	else
		if test $ipv6trylibc = "yes"; then
			echo "using libc"
		else
			echo 'Fatal: no $ipv6lib library found.  cannot continue.'
			echo "You need to fetch lib$ipv6lib.a from appropriate"
			echo 'ipv6 kit and compile beforehand.'
			exit 1
		fi
	fi
fi

# Check for GC support
AC_MSG_CHECKING(for --with-cycle-gc)
AC_ARG_WITH(cycle-gc,
[  --with(out)-cycle-gc            disable/enable garbage collection])

if test -z "$with_cycle_gc"
then with_cycle_gc="yes"
fi
if test "$with_cycle_gc" != "no"
then
    AC_DEFINE(WITH_CYCLE_GC)
fi
AC_MSG_RESULT($with_cycle_gc)

# Check for Python-specific malloc support
AC_MSG_CHECKING(for --with-pymalloc)
AC_ARG_WITH(pymalloc,
[  --with(out)-pymalloc            disable/enable specialized mallocs], [
if test "$withval" != no
then AC_DEFINE(WITH_PYMALLOC) AC_MSG_RESULT(yes)
else AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])

# Check for --with-wctype-functions
AC_MSG_CHECKING(for --with-wctype-functions)
AC_ARG_WITH(wctype-functions, 
[  --with-wctype-functions         use wctype.h functions], [
if test "$withval" != no
then AC_DEFINE(WANT_WCTYPE_FUNCTIONS) AC_MSG_RESULT(yes)
else AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])

# -I${DLINCLDIR} is added to the compile rule for importdl.o
AC_SUBST(DLINCLDIR)
DLINCLDIR=.

AC_MSG_CHECKING(for --with-sgi-dl)
AC_ARG_WITH(sgi-dl,
[  --with-sgi-dl=DIRECTORY         IRIX 4 dynamic linking], [
AC_MSG_RESULT($withval)
AC_DEFINE(WITH_SGI_DL)
DYNLOADFILE="dynload_dl.o"
dldir=$withval
if test ! -z "$dldir" -a -d "$dldir"
then LDFLAGS="$LDFLAGS -L$dldir"
else AC_ERROR(proper usage is --with-sgi-dl=DIRECTORY)
fi
DLINCLDIR=${dldir}
LIBS="$LIBS -ldl -lmld"], AC_MSG_RESULT(no))

AC_MSG_CHECKING(for --with-dl-dld)
AC_ARG_WITH(dl-dld, [  --with-dl-dld=DL_DIR,DLD_DIR    GNU dynamic linking], [
AC_MSG_RESULT($withval)
AC_DEFINE(WITH_DL_DLD)
DYNLOADFILE="dynload_dl.o"
dldir=`echo "$withval" | sed 's/,.*//'`
dlddir=`echo "$withval" | sed 's/.*,//'`
if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir"
then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir"
else AC_ERROR(proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY)
fi
DLINCLDIR=${dldir}
LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no))

# the dlopen() function means we might want to use dynload_shlib.o. some
# platforms, such as AIX, have dlopen(), but don't want to use it.
AC_CHECK_FUNCS(dlopen)

# DYNLOADFILE specifies which dynload_*.o file we will use for dynamic
# loading of modules.
AC_SUBST(DYNLOADFILE)
AC_MSG_CHECKING(DYNLOADFILE)
if test -z "$DYNLOADFILE"
then
	case $ac_sys_system/$ac_sys_release in
	AIX*) DYNLOADFILE="dynload_aix.o";;
	BeOS*) DYNLOADFILE="dynload_beos.o";;
	hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
	Darwin/*) DYNLOADFILE="dynload_next.o";;
	*)
	# use dynload_shlib.c and dlopen() if we have it; otherwise stub
	# out any dynamic loading
	if test "$ac_cv_func_dlopen" = yes
	then DYNLOADFILE="dynload_shlib.o"
	else DYNLOADFILE="dynload_stub.o"
	fi
	;;
	esac
fi
AC_MSG_RESULT($DYNLOADFILE)
if test "$DYNLOADFILE" != "dynload_stub.o"
then
	AC_DEFINE(HAVE_DYNAMIC_LOADING)
fi

# MACHDEP_OBJS can be set to platform-specific object files needed by Python

AC_SUBST(MACHDEP_OBJS)
AC_MSG_CHECKING(MACHDEP_OBJS)
if test -z "$MACHDEP_OBJS"
then
	MACHDEP_OBJS=$extra_machdep_objs
else
	MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs"
fi
AC_MSG_RESULT(MACHDEP_OBJS)

# checks for library functions
AC_CHECK_FUNCS(alarm chown chroot clock confstr ctermid ctermid_r execv \
 flock fork fsync fdatasync fpathconf ftime ftruncate \
 gai_strerror getgroups getlogin getpeername getpid getpwent getwd \
 hstrerror inet_pton kill link lstat mkfifo mktime mremap \
 nice pathconf pause plock poll pthread_init \
 putenv readlink \
 select setegid seteuid setgid setgroups \
 setlocale setregid setreuid setsid setpgid setuid setvbuf snprintf \
 sigaction siginterrupt sigrelse strftime strptime symlink sysconf \
 tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
 truncate uname unsetenv waitpid _getpty getpriority)

# check for openpty and forkpty

AC_CHECK_FUNCS(openpty,, AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"]))
AC_CHECK_FUNCS(forkpty,, AC_CHECK_LIB(util,forkpty, [AC_DEFINE(HAVE_FORKPTY)] [LIBS="$LIBS -lutil"]))

# check for long file support functions
AC_CHECK_FUNCS(fseek64 fseeko fstatvfs ftell64 ftello statvfs)

AC_REPLACE_FUNCS(dup2 getcwd strdup strerror memmove)
AC_CHECK_FUNCS(getpgrp, AC_TRY_COMPILE([#include <unistd.h>], [getpgrp(0);], AC_DEFINE(GETPGRP_HAVE_ARG)))
AC_CHECK_FUNCS(setpgrp, AC_TRY_COMPILE([#include <unistd.h>], [setpgrp(0,0);], AC_DEFINE(SETPGRP_HAVE_ARG)))
AC_CHECK_FUNCS(gettimeofday, AC_TRY_COMPILE([#include <sys/time.h>], [gettimeofday((struct timeval*)0,(struct timezone*)0);], ,AC_DEFINE(GETTIMEOFDAY_NO_TZ)))


# On OSF/1 V5.1, getaddrinfo is available, but a define
# for [no]getaddrinfo in netdb.h. 
AC_MSG_CHECKING(for getaddrinfo)
AC_TRY_LINK([
#include <sys/socket.h>
#include <netdb.h>
],[
getaddrinfo(NULL, NULL, NULL, NULL);
], [
AC_MSG_RESULT(yes)
AC_MSG_CHECKING(getaddrinfo bug)
AC_TRY_RUN([
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>

main()
{
  int passive, gaierr, inet4 = 0, inet6 = 0;
  struct addrinfo hints, *ai, *aitop;
  char straddr[INET6_ADDRSTRLEN], strport[16];

  for (passive = 0; passive <= 1; passive++) {
    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_UNSPEC;
    hints.ai_flags = passive ? AI_PASSIVE : 0;
    hints.ai_socktype = SOCK_STREAM;
    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
      (void)gai_strerror(gaierr);
      goto bad;
    }
    for (ai = aitop; ai; ai = ai->ai_next) {
      if (ai->ai_addr == NULL ||
          ai->ai_addrlen == 0 ||
          getnameinfo(ai->ai_addr, ai->ai_addrlen,
                      straddr, sizeof(straddr), strport, sizeof(strport),
                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
        goto bad;
      }
      switch (ai->ai_family) {
      case AF_INET:
        if (strcmp(strport, "54321") != 0) {
          goto bad;
        }
        if (passive) {
          if (strcmp(straddr, "0.0.0.0") != 0) {
            goto bad;
          }
        } else {
          if (strcmp(straddr, "127.0.0.1") != 0) {
            goto bad;
          }
        }
        inet4++;
        break;
      case AF_INET6:
        if (strcmp(strport, "54321") != 0) {
          goto bad;
        }
        if (passive) {
          if (strcmp(straddr, "::") != 0) {
            goto bad;
          }
        } else {
          if (strcmp(straddr, "::1") != 0) {
            goto bad;
          }
        }
        inet6++;
        break;
      case AF_UNSPEC:
        goto bad;
        break;
      default:
        /* another family support? */
        break;
      }
    }
  }

  if (!(inet4 == 0 || inet4 == 2))
    goto bad;
  if (!(inet6 == 0 || inet6 == 2))
    goto bad;

  if (aitop)
    freeaddrinfo(aitop);
  exit(0);

 bad:
  if (aitop)
    freeaddrinfo(aitop);
  exit(1);
}
],
AC_MSG_RESULT(good)
buggygetaddrinfo=no,
AC_MSG_RESULT(buggy)
buggygetaddrinfo=yes,
AC_MSG_RESULT(buggy)
buggygetaddrinfo=yes)], [
AC_MSG_RESULT(no)
buggygetaddrinfo=yes
])

if test "$buggygetaddrinfo" = "yes"; then
	if test "$ipv6" = "yes"; then
		echo 'Fatal: You must get working getaddrinfo() function.'
		echo '       or you can specify "--disable-ipv6"'.
		exit 1
	fi
else
	AC_DEFINE(HAVE_GETADDRINFO)
fi
AC_CHECK_FUNCS(getnameinfo)

# checks for structures
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
AC_STRUCT_ST_RDEV
AC_STRUCT_ST_BLKSIZE
AC_STRUCT_ST_BLOCKS

AC_MSG_CHECKING(for time.h that defines altzone)
AC_CACHE_VAL(ac_cv_header_time_altzone,
[AC_TRY_COMPILE([#include <time.h>], [return altzone;],
  ac_cv_header_time_altzone=yes,
  ac_cv_header_time_altzone=no)])
AC_MSG_RESULT($ac_cv_header_time_altzone)
if test $ac_cv_header_time_altzone = yes; then
  AC_DEFINE(HAVE_ALTZONE)
fi

was_it_defined=no
AC_MSG_CHECKING(whether sys/select.h and sys/time.h may both be included)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/select.h>
#include <sys/time.h>
], [;], [AC_DEFINE(SYS_SELECT_WITH_SYS_TIME) was_it_defined=yes])
AC_MSG_RESULT($was_it_defined)

AC_MSG_CHECKING(for addrinfo)
AC_CACHE_VAL(ac_cv_struct_addrinfo,
AC_TRY_COMPILE([
#		include <netdb.h>],
	[struct addrinfo a],
	ac_cv_struct_addrinfo=yes,
	ac_cv_struct_addrinfo=no))
AC_MSG_RESULT($ac_cv_struct_addrinfo)
if test $ac_cv_struct_addrinfo = yes; then
	AC_DEFINE(HAVE_ADDRINFO)
fi

AC_MSG_CHECKING(for sockaddr_storage)
AC_CACHE_VAL(ac_cv_struct_sockaddr_storage,
AC_TRY_COMPILE([
#		include <sys/types.h>
#		include <sys/socket.h>],
	[struct sockaddr_storage s],
	ac_cv_struct_sockaddr_storage=yes,
	ac_cv_struct_sockaddr_storage=no))
AC_MSG_RESULT($ac_cv_struct_sockaddr_storage)
if test $ac_cv_struct_sockaddr_storage = yes; then
	AC_DEFINE(HAVE_SOCKADDR_STORAGE)
fi

# checks for compiler characteristics

AC_C_CHAR_UNSIGNED
AC_C_CONST

works=no
AC_MSG_CHECKING(for working volatile)
AC_TRY_COMPILE([],[volatile int x; x = 0;], works=yes, AC_DEFINE(volatile, []))
AC_MSG_RESULT($works)

works=no
AC_MSG_CHECKING(for working signed char)
AC_TRY_COMPILE([], [signed char c;], works=yes, AC_DEFINE(signed, []))
AC_MSG_RESULT($works)

have_prototypes=no
AC_MSG_CHECKING(for prototypes)
AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
AC_DEFINE(HAVE_PROTOTYPES) have_prototypes=yes)
AC_MSG_RESULT($have_prototypes)

works=no
AC_MSG_CHECKING(for variable length prototypes and stdarg.h)
AC_TRY_COMPILE([
#include <stdarg.h>
int foo(int x, ...) {
	va_list va;
	va_start(va, x);
	va_arg(va, int);
	va_arg(va, char *);
	va_arg(va, double);
	return 0;
}
], [return foo(10, "", 3.14);],
AC_DEFINE(HAVE_STDARG_PROTOTYPES) works=yes)
AC_MSG_RESULT($works)

if test "$have_prototypes" = yes; then
bad_prototypes=no
AC_MSG_CHECKING(for bad exec* prototypes)
AC_TRY_COMPILE([#include <unistd.h>], [char **t;execve("@",t,t);], ,
	AC_DEFINE(BAD_EXEC_PROTOTYPES) bad_prototypes=yes)
AC_MSG_RESULT($bad_prototypes)
fi

# check if sockaddr has sa_len member
AC_MSG_CHECKING(if sockaddr has sa_len member)
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>],
[struct sockaddr x;
x.sa_len = 0;],
	AC_MSG_RESULT(yes)
	AC_DEFINE(HAVE_SOCKADDR_SA_LEN),
	AC_MSG_RESULT(no))

AC_MSG_CHECKING(for bad static forward)
AC_CACHE_VAL(ac_cv_bad_static_forward,
[AC_TRY_RUN([
struct s { int a; int b; };
static struct s foo;
int foobar() {
 static int random;
 random = (int) &foo;
 return random;
}
static struct s foo = { 1, 2 };
main() {
 exit(!((int)&foo == foobar()));
}],
ac_cv_bad_static_forward=no,
ac_cv_bad_static_forward=yes,
ac_cv_bad_static_forward=no)])
AC_MSG_RESULT($ac_cv_bad_static_forward)
if test "$ac_cv_bad_static_forward" = yes
then
    AC_DEFINE(BAD_STATIC_FORWARD)
fi

va_list_is_array=no
AC_MSG_CHECKING(whether va_list is an array)
AC_TRY_COMPILE([
#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
], [va_list list1, list2; list1 = list2;], , 
AC_DEFINE(VA_LIST_IS_ARRAY) va_list_is_array=yes)
AC_MSG_RESULT($va_list_is_array)

# sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-(
AC_CHECK_FUNC(gethostbyname_r, [
  AC_DEFINE(HAVE_GETHOSTBYNAME_R)
  AC_MSG_CHECKING([gethostbyname_r with 6 args])
  OLD_CFLAGS=$CFLAGS
  CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS"
  AC_TRY_COMPILE([
#   include <netdb.h>
  ], [
    char *name;
    struct hostent *he, *res;
    char buffer[2048];
    int buflen = 2048;
    int h_errnop;

    (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
  ], [
    AC_DEFINE(HAVE_GETHOSTBYNAME_R)
    AC_DEFINE(HAVE_GETHOSTBYNAME_R_6_ARG)
    AC_MSG_RESULT(yes)
  ], [
    AC_MSG_RESULT(no)
    AC_MSG_CHECKING([gethostbyname_r with 5 args])
    AC_TRY_COMPILE([
#     include <netdb.h>
    ], [
      char *name;
      struct hostent *he;
      char buffer[2048];
      int buflen = 2048;
      int h_errnop;

      (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
    ], [
      AC_DEFINE(HAVE_GETHOSTBYNAME_R)
      AC_DEFINE(HAVE_GETHOSTBYNAME_R_5_ARG)
      AC_MSG_RESULT(yes)
    ], [
      AC_MSG_RESULT(no)
      AC_MSG_CHECKING([gethostbyname_r with 3 args])
      AC_TRY_COMPILE([
#       include <netdb.h>
      ], [
        char *name;
        struct hostent *he;
        struct hostent_data data;

        (void) gethostbyname_r(name, he, &data);
      ], [
        AC_DEFINE(HAVE_GETHOSTBYNAME_R)
        AC_DEFINE(HAVE_GETHOSTBYNAME_R_3_ARG)
        AC_MSG_RESULT(yes)
      ], [
        AC_MSG_RESULT(no)
      ])
    ])
  ])
  CFLAGS=$OLD_CFLAGS
], [
  AC_CHECK_FUNCS(gethostbyname)
])
AC_SUBST(HAVE_GETHOSTBYNAME_R_6_ARG)
AC_SUBST(HAVE_GETHOSTBYNAME_R_5_ARG)
AC_SUBST(HAVE_GETHOSTBYNAME_R_3_ARG)
AC_SUBST(HAVE_GETHOSTBYNAME_R)
AC_SUBST(HAVE_GETHOSTBYNAME)

# checks for system services
# (none yet)

# Linux requires this for correct f.p. operations
AC_CHECK_FUNC(__fpu_control,
  [],
  [AC_CHECK_LIB(ieee, __fpu_control)
])

# Check for --with-fpectl
AC_MSG_CHECKING(for --with-fpectl)
AC_ARG_WITH(fpectl,
[  --with-fpectl                   enable SIGFPE catching], [
if test "$withval" != no
then AC_DEFINE(WANT_SIGFPE_HANDLER) AC_MSG_RESULT(yes)
else AC_MSG_RESULT(no)
fi],
[AC_MSG_RESULT(no)])

# check for --with-libm=...
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
BeOS) ;;
*) LIBM=-lm
esac
AC_MSG_CHECKING(for --with-libm=STRING)
AC_ARG_WITH(libm, [  --with-libm=STRING              math library], [
if test "$withval" = no
then LIBM=
     AC_MSG_RESULT(force LIBM empty)
elif test "$withval" != yes
then LIBM=$withval
     AC_MSG_RESULT(set LIBM=\"$withval\")
else AC_ERROR(proper usage is --with-libm=STRING)
fi],
[AC_MSG_RESULT(default LIBM=\"$LIBM\")])

# check for --with-libc=...
AC_SUBST(LIBC)
AC_MSG_CHECKING(for --with-libc=STRING)
AC_ARG_WITH(libc, [  --with-libc=STRING              C library], [
if test "$withval" = no
then LIBC=
     AC_MSG_RESULT(force LIBC empty)
elif test "$withval" != yes
then LIBC=$withval
     AC_MSG_RESULT(set LIBC=\"$withval\")
else AC_ERROR(proper usage is --with-libc=STRING)
fi],
[AC_MSG_RESULT(default LIBC=\"$LIBC\")])

# check for hypot() in math library
LIBS_SAVE=$LIBS
LIBS="$LIBS $LIBM"
AC_REPLACE_FUNCS(hypot)
LIBS=$LIBS_SAVE

# check whether malloc(0) returns NULL or not
AC_MSG_CHECKING(what malloc(0) returns)
AC_CACHE_VAL(ac_cv_malloc_zero,
[AC_TRY_RUN([#include <stdio.h>
#ifdef HAVE_STDLIB
#include <stdlib.h>
#else
char *malloc(), *realloc();
int *free();
#endif
main() {
	char *p;
	p = malloc(0);
	if (p == NULL) exit(1);
	p = realloc(p, 0);
	if (p == NULL) exit(1);
	free(p);
	exit(0);
}],
ac_cv_malloc_zero=nonnull,
ac_cv_malloc_zero=null,
ac_cv_malloc_zero=nonnull)]) # XXX arm cross-compile?
AC_MSG_RESULT($ac_cv_malloc_zero)
if test "$ac_cv_malloc_zero" = null
then
  AC_DEFINE(MALLOC_ZERO_RETURNS_NULL)
fi

# check for wchar.h
AC_CHECK_HEADER(wchar.h,
AC_DEFINE(HAVE_WCHAR_H) wchar_h="yes",
wchar_h="no"
)

# determine wchar_t size
if test "$wchar_h" = yes
then
  AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
fi

AC_MSG_CHECKING(what type to use for unicode)
AC_ARG_ENABLE(unicode, 
[  --enable-unicode[=ucs2,ucs4]    Enable Unicode strings (default is yes)],,enable_unicode=yes)

if test $enable_unicode = yes
then
  # Without any arguments, Py_UNICODE defaults to two-byte mode
  enable_unicode="ucs2"
fi

case "$enable_unicode" in
ucs2) unicode_size="2"
      AC_DEFINE(Py_UNICODE_SIZE,2)
      ;;
ucs4) unicode_size="4"
      AC_DEFINE(Py_UNICODE_SIZE,4)
      ;;
esac

AC_SUBST(UNICODE_OBJS)
if test "$enable_unicode" = "no"
then
  UNICODE_OBJS=""
  AC_MSG_RESULT(not used)
else
  UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o"
  AC_DEFINE(Py_USING_UNICODE)
  if test "$unicode_size" = "$ac_cv_sizeof_wchar_t"
  then
    PY_UNICODE_TYPE="wchar_t"
    AC_DEFINE(HAVE_USABLE_WCHAR_T)
    AC_DEFINE(PY_UNICODE_TYPE,wchar_t)
  elif test "$ac_cv_sizeof_short" = "$unicode_size"
  then
       PY_UNICODE_TYPE="unsigned short"
       AC_DEFINE(PY_UNICODE_TYPE,unsigned short)
  elif test "$ac_cv_sizeof_long" = "$unicode_size"
  then
       PY_UNICODE_TYPE="unsigned long"
       AC_DEFINE(PY_UNICODE_TYPE,unsigned long)
  else
       PY_UNICODE_TYPE="no type found"
  fi
  AC_MSG_RESULT($PY_UNICODE_TYPE)
fi

# check for endianness
AC_C_BIGENDIAN

# Check whether right shifting a negative integer extends the sign bit
# or fills with zeros (like the Cray J90, according to Tim Peters).
AC_MSG_CHECKING(whether right shift extends the sign bit)
AC_CACHE_VAL(ac_cv_rshift_extends_sign, [
AC_TRY_RUN([
int main()
{
	exit(((-1)>>3 == -1) ? 0 : 1);
}
],
ac_cv_rshift_extends_sign=yes,
ac_cv_rshift_extends_sign=no,
ac_cv_rshift_extends_sign=yes)])
AC_MSG_RESULT($ac_cv_rshift_extends_sign)
if test "$ac_cv_rshift_extends_sign" = no
then
  AC_DEFINE(SIGNED_RIGHT_SHIFT_ZERO_FILLS)
fi

# check for getc_unlocked and related locking functions
AC_MSG_CHECKING(for getc_unlocked() and friends)
AC_CACHE_VAL(ac_cv_have_getc_unlocked, [
AC_TRY_LINK([#include <stdio.h>],[
	FILE *f = fopen("/dev/null", "r");
	flockfile(f);
	getc_unlocked(f);
	funlockfile(f);
], ac_cv_have_getc_unlocked=yes, ac_cv_have_getc_unlocked=no)])
AC_MSG_RESULT($ac_cv_have_getc_unlocked)
if test "$ac_cv_have_getc_unlocked" = yes
then
  AC_DEFINE(HAVE_GETC_UNLOCKED)
fi

# check for readline 4.0
AC_CHECK_LIB(readline, rl_pre_input_hook,
	AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK), , -ltermcap)

# check for readline 4.2
AC_CHECK_LIB(readline, rl_completion_matches,
	AC_DEFINE(HAVE_RL_COMPLETION_MATCHES), , -ltermcap)

AC_MSG_CHECKING(for broken nice())
AC_CACHE_VAL(ac_cv_broken_nice, [
AC_TRY_RUN([
int main()
{
	int val1 = nice(1);
	if (val1 != -1 && val1 == nice(2))
		exit(0);
	exit(1);
}
],
ac_cv_broken_nice=yes,
ac_cv_broken_nice=no,
ac_cv_broken_nice=no)])
AC_MSG_RESULT($ac_cv_broken_nice)
if test "$ac_cv_broken_nice" = yes
then
  AC_DEFINE(HAVE_BROKEN_NICE)
fi

# On HP/UX 11.0, mvwdelch is a block with a return statement
AC_MSG_CHECKING(whether mvwdelch is an expression)
AC_CACHE_VAL(ac_cv_mvwdelch_is_expression,
AC_TRY_COMPILE([#include <curses.h>], [
  int rtn;
  rtn = mvwdelch(0,0,0);
], ac_cv_mvwdelch_is_expression=yes,
   ac_cv_mvwdelch_is_expression=no,
   ac_cv_mvwdelch_is_expression=yes))
AC_MSG_RESULT($ac_cv_mvwdelch_is_expression)

if test "$ac_cv_mvwdelch_is_expression" = yes
then
  AC_DEFINE(MVWDELCH_IS_EXPRESSION)
fi

AC_MSG_CHECKING(whether WINDOW has _flags)
AC_CACHE_VAL(ac_cv_window_has_flags,
AC_TRY_COMPILE([#include <curses.h>], [
  WINDOW *w;
  w->_flags = 0;
], ac_cv_window_has_flags=yes,
   ac_cv_window_has_flags=no,
   ac_cv_window_has_flags=no))
AC_MSG_RESULT($ac_cv_window_has_flags)


if test "$ac_cv_window_has_flags" = yes
then
  AC_DEFINE(WINDOW_HAS_FLAGS)
fi

# THIS MUST BE LAST, IT CAN BREAK OTHER TESTS!
# Add sys/socket.h to confdefs.h
cat >> confdefs.h <<\EOF
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
EOF
AC_CHECK_TYPE(socklen_t, int)

# Add Python/ prefix to LIBOBJS
libobjs=$LIBOBJS
LIBOBJS=
for obj in $libobjs; do
    LIBOBJS="$LIBOBJS Python/$obj"
done

#AC_MSG_CHECKING(for Modules/Setup)
#if test ! -f Modules/Setup ; then
#    if test ! -d Modules ; then
#        mkdir Modules
#    fi
#    cp "$srcdir/Modules/Setup.dist" Modules/Setup
#    AC_MSG_RESULT(creating)
#else
#    AC_MSG_RESULT(already exists)
#fi

AC_SUBST(SRCDIRS)
SRCDIRS="Parser Grammar Objects Python Modules"
AC_MSG_CHECKING(for build directories)
for dir in $SRCDIRS; do
    if test ! -d $dir; then
        mkdir $dir
    fi
done
AC_MSG_RESULT(done)

# generate output files
AC_OUTPUT(Makefile.pre Modules/Setup.config)

echo "creating Setup"
if test ! -f Modules/Setup
then
	cp $srcdir/Modules/Setup.dist Modules/Setup
fi

echo "creating Setup.local"
if test ! -f Modules/Setup.local
then
	echo "# Edit this file for local setup changes" >Modules/Setup.local
fi

echo "creating Makefile"
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
			-s Modules Modules/Setup.config \
			Modules/Setup.local Modules/Setup
mv config.c Modules
