5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_INIT(interpret.c)
|
af5647 | 1996-12-03 | Fredrik Hübinette (Hubbe) | | AC_CONFIG_HEADER(machine.h)
|
51bd9e | 1996-10-09 | Fredrik Hübinette (Hubbe) | |
|
bef58a | 2017-07-04 | Henrik Grubbström (Grubba) | | AC_SUBST(CONFIG_HEADERS)
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | rm -f config.warnings 2>/dev/null
|
54691f | 2013-11-02 | Henrik Grubbström (Grubba) | | if_autoconf(2,50,, [
|
4969eb | 2002-12-19 | Marcus Comstedt | | PIKE_MSG_WARN([configure script has been generated with autoconf 2.13 or earlier.])
|
b74548 | 2003-09-09 | Martin Nilsson | | ])
|
aa47bd | 2002-06-25 | Henrik Grubbström (Grubba) | |
|
ea2406 | 1997-04-01 | Henrik Grubbström (Grubba) | | # We want an absolute path to the source-dir.
case "$srcdir" in
/*)
;;
*)
oldsrcdir="$srcdir"
srcdir="`cd \"$srcdir\";pwd`"
|
0a8698 | 2003-11-07 | Martin Stjernholm | | AC_MSG_WARN([Converted $oldsrcdir to $srcdir,
If this does not work, please use an absolute path to the configure script.])
|
ea2406 | 1997-04-01 | Henrik Grubbström (Grubba) | | ;;
esac
|
043b20 | 2003-06-27 | Henrik Grubbström (Grubba) | | # Check that we can write to the source directory.
if touch "$srcdir/configure~"; then
# Check that the system time is reasonably correct.
|
166faa | 2003-12-03 | Martin Nilsson | | if test `cd "$srcdir" && ls -1t configure configure~ | head -n 1` = "configure"; then
|
a10a98 | 2004-03-09 | Henrik Grubbström (Grubba) | | echo "Current system time is `date`."
|
043b20 | 2003-06-27 | Henrik Grubbström (Grubba) | | AC_MSG_ERROR([
$srcdir/configure has modification time in the future.
Check and set your system time.
])
fi
else
|
a10a98 | 2004-03-09 | Henrik Grubbström (Grubba) | | ls -ld "$srcdir"
|
043b20 | 2003-06-27 | Henrik Grubbström (Grubba) | | AC_MSG_ERROR([
Failed to write in source directory.
Fix your permissions.
])
fi
|
bc800a | 2015-04-08 | Henrik Grubbström (Grubba) | | if_autoconf(2,50,[
if test "x$cache_file" = "x/dev/null"; then
if uname | grep -i windows >/dev/null; then
PIKE_MSG_WARN([Windows detected.])
PIKE_MSG_WARN([Enabling the configure cache for performance reasons.])
cache_file=./config.cache
if test -r "$cache_file"; then
echo "loading cache $cache_file"
. $cache_file
else
echo "creating cache $cache_file"
> $cache_file
fi
fi
fi
])
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | | AC_PROG_MAKE_SET
|
42496b | 2002-12-14 | Henrik Grubbström (Grubba) | |
|
b46d67 | 2005-11-22 | Henrik Grubbström (Grubba) | | rm -f "conftest_VPATH.in" 2>/dev/null
|
f156cc | 2002-12-14 | Henrik Grubbström (Grubba) | | touch "$srcdir/conftest_VPATH.in"
|
bad86f | 2002-12-14 | Henrik Grubbström (Grubba) | | if test -f conftest_VPATH.in; then :; else
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | | # Not building in source tree.
AC_MSG_CHECKING([whether ${MAKE-make} supports VPATH])
AC_CACHE_VAL(pike_cv_make_supports_VPATH, [
cat > conftestmake <<EOF
|
31dc81 | 2017-08-09 | Martin Nilsson | | VPATH=$srcdir
|
22e80f | 2002-12-14 | Henrik Grubbström (Grubba) | | .SUFFIXES: .in .out
.in.out:
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | | cat "\$<" >"\$@"
EOF
pike_cv_make_supports_VPATH=no
|
9edb20 | 2004-03-10 | Henrik Grubbström (Grubba) | | if ${MAKE-make} -f conftestmake conftest_VPATH.out >/dev/null 2>&AC_FD_CC; then
|
f156cc | 2002-12-14 | Henrik Grubbström (Grubba) | | if test -f conftest_VPATH.out; then
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | | pike_cv_make_supports_VPATH=yes
else :; fi
else :; fi
|
f156cc | 2002-12-14 | Henrik Grubbström (Grubba) | | rm -f conftestmake conftest_VPATH.out
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | | ])
AC_MSG_RESULT($pike_cv_make_supports_VPATH)
if test "x$pike_cv_make_supports_VPATH" = "xno"; then
|
fbbc94 | 2002-12-15 | Henrik Grubbström (Grubba) | | AC_ERROR([
Building in a separate directory is not supported without VPATH.
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | |
|
fbbc94 | 2002-12-15 | Henrik Grubbström (Grubba) | | Build in the source directory, or try another make (eg gnumake).
])
exit 1
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | | else :; fi
fi
|
b46d67 | 2005-11-22 | Henrik Grubbström (Grubba) | | rm -f "$srcdir/conftest_VPATH.in" 2>/dev/null
|
27152b | 2002-12-14 | Henrik Grubbström (Grubba) | |
|
eefb04 | 2004-12-29 | Marcus Agehall | | AC_ARG_ENABLE(pikelib, MY_DESCR([--enable-pikelib],
[build pike as a library]),
[enable_pikelib=yes], [enable_pikelib=no])
if test "x$enable_pikelib" != "xno"; then
PIKE_MSG_WARN([BUILDING PIKE AS A LIBRARY -- HIGHLY EXPERIMENTAL!])
AC_DEFINE(LIBPIKE)
fi
|
3084f2 | 2002-12-07 | Mirar (Pontus Hagland) | | AC_ARG_ENABLE(make_conf, MY_DESCR([--disable-make.conf],
[do not use settings from /etc/make.conf]),
[], [enable_make_conf=yes])
|
28a760 | 2004-02-29 | Henrik Grubbström (Grubba) | | initial_cflags="${CFLAGS}"
initial_cppflags="${CPPFLAGS}"
initial_ldflags="${LDFLAGS}"
|
48ae53 | 1996-10-09 | Fredrik Hübinette (Hubbe) | | if test "x${CFLAGS-}" = x ; then
|
51bd9e | 1996-10-09 | Fredrik Hübinette (Hubbe) | | cflags_is_set=no
|
48ae53 | 1996-10-09 | Fredrik Hübinette (Hubbe) | | else
cflags_is_set=yes
|
51bd9e | 1996-10-09 | Fredrik Hübinette (Hubbe) | | fi
|
c67b69 | 1996-11-16 | Fredrik Hübinette (Hubbe) | | if test "x${CPPFLAGS-}" = x ; then
cppflags_is_set=no
else
cppflags_is_set=yes
fi
if test "x${LDFLAGS-}" = x ; then
ldflags_is_set=no
else
ldflags_is_set=yes
fi
|
8a88f1 | 2004-03-09 | Henrik Grubbström (Grubba) | | # if test "x$enable_make_conf" = x"yes" -a -f /etc/make.conf; then
# set >conftest.tmp
# echo Using settings from /etc/make.conf...
# . /etc/make.conf
# set | diff -u conftest.tmp - | grep '^+C'
# PIKE_MSG_WARN([Using settings from /etc/make.conf.])
# fi
|
bd841c | 2002-12-10 | Henrik Grubbström (Grubba) | |
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(cflags, MY_DESCR([--with-cflags=cflags],
[specify extra c compiler flags]),
[ CFLAGS="$with_cflags $CFLAGS" ])
AC_ARG_WITH(cppflags, MY_DESCR([--with-cppflags=cppflags],
[specify extra c preprocessor flags]),
[ CPPFLAGS="$with_cppflags $CPPFLAGS" ])
AC_ARG_WITH(ldflags, MY_DESCR([--with-ldflags=ldflags],
[specify extra linker flags]),
[ LDFLAGS="$with_ldflags $LDFLAGS" ])
|
f2e5eb | 2001-04-25 | Henrik Grubbström (Grubba) | |
|
ace313 | 2004-03-09 | Xavier Beaudouin | | # Force use of thread libs LIBS
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(thread-library,
MY_DESCR([--with-thread-library=lib],
[Use a specific thread library]),
[
case "x$withval" in
x-*)
with_thread_library="$withval"
;;
*)
with_thread_library="-l$withval"
;;
esac
], [ with_thread_library=no ])
|
ace313 | 2004-03-09 | Xavier Beaudouin | |
|
7b3941 | 1997-02-06 | Fredrik Hübinette (Hubbe) | | for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([You are using a site file to initialize configure, please
|
7b3941 | 1997-02-06 | Fredrik Hübinette (Hubbe) | | note that this can lead to problems if anything in
$ac_site_file is not correct. If Pike does not compile, or
does not run, please try this to compile Pike again:
|
b46d67 | 2005-11-22 | Henrik Grubbström (Grubba) | | rm -f ./config.cache ; CONFIG_SITE=x ./configure ; make])
|
7b3941 | 1997-02-06 | Fredrik Hübinette (Hubbe) | | fi
done
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_ENABLE(binary, MY_DESCR([--disable-binary],
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | [do not configure for binary build, only do tests for precompilation stuff]),
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | [], [enable_binary=yes])
|
417454 | 2001-01-26 | Martin Stjernholm | |
if test "x$enable_binary" = "xno"; then
|
0a8698 | 2003-11-07 | Martin Stjernholm | | PIKE_MSG_WARN([Short-circuiting configure tests for binary building. Only some
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | targets in the Makefile can be used, typically those that only
|
0a8698 | 2003-11-07 | Martin Stjernholm | | operates on the source directory, e.g. depend.])
|
5c9db4 | 2002-01-27 | Martin Stjernholm | | AC_DEFINE(DISABLE_BINARY)
|
417454 | 2001-01-26 | Martin Stjernholm | | else
|
1acce8 | 2001-01-27 | Martin Stjernholm | | if test ! -z "$pike_cv_prog_CC_save" -a ! -z "$CC" -a "$CC" != "$pike_cv_prog_CC_save"
then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([CC is different than last time Pike was compiled,
|
0a8698 | 2003-11-07 | Martin Stjernholm | | It is probably best to delete ./config.cache before proceeding.])
|
1acce8 | 2001-01-27 | Martin Stjernholm | | fi
|
7b3941 | 1997-02-06 | Fredrik Hübinette (Hubbe) | |
|
1acce8 | 2001-01-27 | Martin Stjernholm | | pike_cv_prog_CC_save="$CC"
|
7b3941 | 1997-02-06 | Fredrik Hübinette (Hubbe) | |
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | fi
# Do the below even when --disable-binary is used, since we need a
# real $CPP, and AC_PROG_CPP wants AC_PROG_CC to be called earlier.
# $CC will be overridden with a dummy later on.
# MY_AC_PROG_CC
# The above has problems if the smartlink binary is removed. /grubba
|
3ae7c0 | 2006-06-16 | Henrik Grubbström (Grubba) | |
AC_LANG_C
# Workaround for COMPILER_EXEEXT bailing out with icc and too new gcc.
# "Command-line error: invalid GNU version number: 403".
# The following seem to be the max gcc-versions:
#
# icc gcc-version
# 8.1 340
# 9.0 400?
# 9.1 410?
if test "x$CC" = "x"; then :; else
AC_MSG_CHECKING([whether we need an icc workaround])
AC_CACHE_VAL(pike_cv_need_icc_gcc_version, [
cat >conftest.c <<EOF
int main() { return 0; }
EOF
ORIG_CFLAGS="$CFLAGS"
for pike_cv_need_icc_gcc_version in no 420 410 400 340 330 320 310 no; do
if test "x$pike_cv_need_icc_gcc_version" = "xno"; then :; else
CFLAGS="$ORIG_CFLAGS -gcc-version=$pike_cv_need_icc_gcc_version"
fi
if AC_TRY_EVAL(ac_compile); then
break;
fi
done
CFLAGS="$ORIG_CFLAGS"
])
AC_MSG_RESULT($pike_cv_need_icc_gcc_version)
if test "x$pike_cv_need_icc_gcc_version" = "xno"; then :; else
CFLAGS="$CFLAGS -gcc-version=$pike_cv_need_icc_gcc_version"
fi
fi
|
70f495 | 2008-07-21 | Martin Stjernholm | | # AC_PROG_CC won't modify CFLAGS if it's already set from the icc
|
a4e6e4 | 2008-07-21 | Martin Stjernholm | | # workaround test above, so we make sure it's always set and then
# modify CFLAGS ourselves afterwards.
|
b33bcc | 2013-05-11 | Marcus Comstedt | | : ${CFLAGS:=}
|
a4e6e4 | 2008-07-21 | Martin Stjernholm | |
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | AC_PROG_CC
|
1be07f | 2011-02-14 | Henrik Grubbström (Grubba) | | AC_PROG_CXX
|
a4e6e4 | 2008-07-21 | Martin Stjernholm | |
# Only need to think of -g since -O2 or other optimization flags gets
# added through other configure tests.
test "$ac_cv_prog_cc_g" = yes && CFLAGS="-g $CFLAGS"
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | AC_PROG_CPP
|
6db773 | 2012-02-08 | Henrik Grubbström (Grubba) | | AC_PROG_CXXCPP
|
750104 | 2007-10-03 | Henrik Grubbström (Grubba) | | AC_PROG_EGREP
|
2ed72c | 2000-09-17 | Henrik Grubbström (Grubba) | |
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([whether we are using Intel C])
|
00f5cf | 2004-12-16 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_prog_icc, [
|
d386a2 | 2004-12-16 | Henrik Grubbström (Grubba) | | AC_EGREP_CPP([oui], [
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | #if defined(__ECC) || defined(__ICC) || defined(__INTEL_COMPILER)
|
b0536b | 2004-12-16 | Dan Nelson | | oui;
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | #endif
|
55f2a9 | 2004-12-16 | Henrik Grubbström (Grubba) | | ], pike_cv_prog_icc=yes, pike_cv_prog_icc=no)
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | ])
AC_MSG_RESULT($pike_cv_prog_icc)
if test "$pike_cv_prog_icc" = "yes"; then
ICC=yes
fi
|
2ed72c | 2000-09-17 | Henrik Grubbström (Grubba) | | #############################################################################
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | if test "x$enable_binary" != "xno"; then
|
1acce8 | 2001-01-27 | Martin Stjernholm | | AC_ISC_POSIX
AC_AIX
AC_MINIX
fi
|
13670c | 2015-05-25 | Martin Nilsson | |
|
2ed72c | 2000-09-17 | Henrik Grubbström (Grubba) | | #############################################################################
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | |
|
0e88fe | 2005-06-08 | Henrik Grubbström (Grubba) | | # ABI selection.
|
226a72 | 2006-01-05 | Henrik Grubbström (Grubba) | | PIKE_SELECT_ABI
|
004412 | 2005-06-09 | Henrik Grubbström (Grubba) | |
|
0e88fe | 2005-06-08 | Henrik Grubbström (Grubba) | | #############################################################################
|
1ab51d | 2001-06-29 | Henrik Grubbström (Grubba) | | if test "x$GCC" = "x"; then
GCC=no
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | else
|
b933a6 | 2002-10-03 | Henrik Grubbström (Grubba) | | :;
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | fi
|
1ab51d | 2001-06-29 | Henrik Grubbström (Grubba) | |
|
93d8fe | 2017-08-09 | Martin Nilsson | | if test "x$GCC" = "xno"; then
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | |
if test "x$ac_cv_prog_cc_cross" = "xyes"; then
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | # The AIX 5L/cc beta can not generate working binaries without a
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | # data-segment...
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([if we are really using a cross-compiler])
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | |
|
7fcd07 | 2000-09-16 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_datasegment_required, [
ac_cv_prog_cc_cross=no;
AC_TRY_RUN([int foo;main(){return(0);}], [
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | pike_cv_datasegment_required=yes
|
7fcd07 | 2000-09-16 | Henrik Grubbström (Grubba) | | ], [
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | pike_cv_datasegment_required=no
|
7fcd07 | 2000-09-16 | Henrik Grubbström (Grubba) | | ac_cv_prog_cc_cross=yes
], [
pike_cv_datasegment_required=no
ac_cv_prog_cc_cross=yes
])
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | ])
if test "x$pike_cv_datasegment_required" = "xyes"; then
AC_MSG_RESULT([no -- Applying data-segment kludge])
ac_cv_prog_cc_cross=no
cat >conftest.c <<EOF
static int foo;
EOF
pike_cv_datasegemnt_file=no
if AC_TRY_EVAL(ac_compile); then
if test -f "conftest.$ac_objext"; then
rm -f "data-segment.$ac_objext"
if mv "conftest.$ac_objext" "data-segment.$ac_objext"; then
if test -f "`pwd`/data-segment.$ac_objext"; then
pike_cv_datasegemnt_file="`pwd`/data-segment.$ac_objext"
else
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(Lost track of data-segment kludge-file.)
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | fi
else
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(Failed to rename data-segment kludge-file.)
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | fi
else
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(Can not find data-segment kludgefile.)
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | fi
else
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(Failed to compile data-segment kludge.)
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | fi
if test "x$pike_cv_datasegment_file" = "xno"; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(Some tests may yield false results.)
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | else
LIBS="$pike_cv_datasegment_file $LIBS"
export LIBS
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(Data-segment kludge applied.)
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | | fi
else
AC_MSG_RESULT(yes)
fi
fi
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | else :; fi
|
482797 | 2000-09-16 | Henrik Grubbström (Grubba) | |
|
18be80 | 2000-03-02 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
1acce8 | 2001-01-27 | Martin Stjernholm | | if test "x$enable_binary" != "xno"; then
|
18be80 | 2000-03-02 | Fredrik Hübinette (Hubbe) | | #
# The purpose of this test is to check that there is no filesystem
# caching preventing pike from compiling correctly.
#
|
d4f9e9 | 2000-05-19 | Martin Stjernholm | | AC_MSG_CHECKING([filesystem synchronization])
|
18be80 | 2000-03-02 | Fredrik Hübinette (Hubbe) | |
AC_CACHE_VAL(pike_cv_filesystem_syncronization,
[
pike_cv_filesystem_syncronization=working
AC_EGREP_CPP(true, [ true ], , pike_cv_filesystem_syncronization=broken)
AC_EGREP_CPP(false, [ false ], , pike_cv_filesystem_syncronization=broken)
|
21ee4b | 2003-12-16 | Marek Habersack | | AC_EGREP_CPP(oui, [ oui ], , pike_cv_filesystem_syncronization=broken)
|
18be80 | 2000-03-02 | Fredrik Hübinette (Hubbe) | | AC_EGREP_CPP(no, [ no ], , pike_cv_filesystem_syncronization=broken)
AC_EGREP_CPP(near, [ far ], pike_cv_filesystem_syncronization=broken, )
AC_EGREP_CPP(up, [ up ], , pike_cv_filesystem_syncronization=broken)
AC_EGREP_CPP(down, [ down], , pike_cv_filesystem_syncronization=broken)
])
AC_MSG_RESULT($pike_cv_filesystem_syncronization)
if test "x$pike_cv_filesystem_syncronization" = xbroken ; then
AC_MSG_ERROR([Filesystem caching is too aggressive. If you are using
Samba, make sure to have the following line in your smb.conf:
oplocks = False
])
exit 1
fi
|
1acce8 | 2001-01-27 | Martin Stjernholm | | fi
|
417454 | 2001-01-26 | Martin Stjernholm | | #############################################################################
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | LIBDIR=`(cd $srcdir/../lib ; pwd)`
BINDIR=`(cd $srcdir/../bin ; pwd)`
|
3c9dc1 | 2002-08-01 | Martin Nilsson | | MANDIR=`(cd $srcdir/../man ; pwd)`
|
8c392e | 2003-01-02 | Henrik Grubbström (Grubba) | | DOCDIR=`(cd $srcdir/../refdoc ; pwd)`
|
3c9dc1 | 2002-08-01 | Martin Nilsson | | BASEDIR=`(cd $srcdir/.. ; pwd)`
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | BUILDDIR=`pwd`
AC_SUBST(LIBDIR)
AC_SUBST(BINDIR)
|
3c9dc1 | 2002-08-01 | Martin Nilsson | | AC_SUBST(MANDIR)
|
8c392e | 2003-01-02 | Henrik Grubbström (Grubba) | | AC_SUBST(DOCDIR)
|
3c9dc1 | 2002-08-01 | Martin Nilsson | | AC_SUBST(BASEDIR)
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | AC_SUBST(BUILDDIR)
#############################################################################
|
417454 | 2001-01-26 | Martin Stjernholm | | #
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | # Some cross-compilation support and --disable-binary stuff
|
417454 | 2001-01-26 | Martin Stjernholm | | #
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | if test "x$enable_binary" = "xno"; then
CROSS=yes
else
CROSS="$ac_cv_prog_cc_cross"
fi
|
417454 | 2001-01-26 | Martin Stjernholm | | AC_SUBST(CROSS)
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | if test "x$enable_binary" = "xno"; then
CC="$BINDIR/nobinary_dummy cc"
RUNPIKE="USE_PIKE"
|
546ce1 | 2006-08-02 | Martin Stjernholm | | RUNTPIKE="USE_PIKE"
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif test "x$cross_compiling" = "xyes"; then
RUNPIKE="DEFAULT_RUNPIKE"
RUNTPIKE="USE_PIKE"
|
417454 | 2001-01-26 | Martin Stjernholm | | else
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | RUNPIKE="DEFAULT_RUNPIKE"
RUNTPIKE="USE_TPIKE"
|
417454 | 2001-01-26 | Martin Stjernholm | | fi
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | AC_SUBST(RUNPIKE)
|
546ce1 | 2006-08-02 | Martin Stjernholm | | AC_SUBST(RUNTPIKE)
|
417454 | 2001-01-26 | Martin Stjernholm | |
#############################################################################
if test "x$enable_binary" != "xno"; then
# The following tests are only relevant if we intend to build binaries.
|
690098 | 1999-05-07 | Fredrik Hübinette (Hubbe) | | #############################################################################
AC_CHECK_HEADERS(fnord/fnord/fnord.h)
|
54be21 | 1999-05-12 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([if CHECK_HEADERS works])
|
690098 | 1999-05-07 | Fredrik Hübinette (Hubbe) | | if test "x$ac_cv_header_fnord_fnord_fnord_h" = xyes ; then
|
54be21 | 1999-05-12 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(no)
|
690098 | 1999-05-07 | Fredrik Hübinette (Hubbe) | | exit 1
fi
|
54be21 | 1999-05-12 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(yes)
|
613bc5 | 2000-08-28 | Henrik Grubbström (Grubba) | |
#############################################################################
|
8cf37d | 1997-01-27 | Per Hedbor | |
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(if we can allocate large auto variables)
AC_CACHE_VAL(pike_cv_C_supports_large_auto, [
AC_TRY_LINK([
#include <stdio.h>
int eat_stack(int foo)
{
char large_array[131072] = "";
int i, sum = 0;
for (i = 0; i < foo; i++) {
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | /* Make sure the compiler does not optimize away the array. */
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | large_array[i] = sum;
sum += foo;
}
for (i = 0; i < foo; i++) {
sum += large_array[i] - large_array[foo-1-i];
}
return sum;
}
], [
return !eat_stack(4711);
], [
pike_cv_C_supports_large_auto=yes
], [
pike_cv_C_supports_large_auto=no
])
])
if test "$pike_cv_C_supports_large_auto" = "yes"; then
AC_MSG_RESULT([yes - good])
else
AC_MSG_RESULT([no])
AC_MSG_CHECKING([if we can make a workaround by defining _chkstk to call __chkstk])
AC_CACHE_VAL([pike_cv_kludge__chkstk],
[
AC_TRY_LINK([
#include <stdio.h>
int eat_stack(int foo)
{
char large_array[131072] = "";
int i, sum = 0;
|
13670c | 2015-05-25 | Martin Nilsson | |
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | for (i = 0; i < foo; i++) {
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | /* Make sure the compiler does not optimize away the array. */
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | large_array[i] = sum;
sum += foo;
}
for (i = 0; i < foo; i++) {
sum += large_array[i] - large_array[foo-1-i];
}
return sum;
}
|
13670c | 2015-05-25 | Martin Nilsson | |
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | extern size_t __chkstk();
size_t _chkstk() { return __chkstk(); }
|
13670c | 2015-05-25 | Martin Nilsson | |
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | ], [
return !eat_stack(4711);
], [
pike_cv_kludge__chkstk=yes
], [
pike_cv_kludge__chkstk=no
])
])
if test "$pike_cv_kludge__chkstk" = "yes"; then
AC_MSG_RESULT([yes - applying workaround])
AC_DEFINE(HAVE_BROKEN_CHKSTK)
else
AC_MSG_RESULT([no])
AC_ERROR([Your C compiler does not link code that uses large auto variables.
Please check config.log, and fix the problem.])
exit 1
|
13670c | 2015-05-25 | Martin Nilsson | | fi
|
842161 | 2001-06-29 | Fredrik Hübinette (Hubbe) | | fi
#############################################################################
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | ## Build smartlink
|
bb47fb | 2004-05-08 | Marcus Agehall | | AC_ARG_ENABLE(smartlink_binary, MY_DESCR([--disable-smartlink-binary],
|
033abd | 2008-08-15 | Henrik Grubbström (Grubba) | | [do not build and use the smartlink binary]),
[if test "x$enableval" = "xno"; then
force_smartlink_script_only=yes
fi])
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | |
if test -x /usr/bin/uname 2>/dev/null; then
UNAME=`/usr/bin/uname -sr`
elif test -x /bin/uname 2>/dev/null; then
UNAME=`/bin/uname -sr`
else
UNAME=unknown
fi
|
a662c2 | 2015-03-24 | Henrik Grubbström (Grubba) | | # We need some special hacks when running slowaris and winblows.
PIKE_AC_CHECK_OS()
|
613bc5 | 2000-08-28 | Henrik Grubbström (Grubba) | |
|
ec24a4 | 2006-07-02 | Martin Stjernholm | | if test "x$pike_cv_sys_os" = xWindows_NT; then
PIKE_FUNCS_NEED_DECLS(yes)
fi
|
72cdcd | 2016-02-09 | Henrik Grubbström (Grubba) | | # NB: We need to have gmp.h in the search path for the entirety of Pike,
# since gmp.h is included by bignum.h, which in turn is included
# by much of Pike.
PIKE_PKG_CONFIG(libgmp)
AC_CHECK_HEADERS(gmp.h unistd.h sys/stat.h sys/types.h sys/errno.h)
|
8d17be | 2006-07-02 | Martin Stjernholm | |
|
613bc5 | 2000-08-28 | Henrik Grubbström (Grubba) | | if test "$GCC" = "yes"; then :; else
#
# Special hack for HP-UX stupid cc
#
if test "$pike_cv_sys_os" = "HP-UX"; then
AC_TRY_COMPILE([int foo(int bar);],[],[],
[
OLD_CC="${CC-cc}"
OLD_CFLAGS="$CFLAGS"
case "/$CC" in
*/smartlink\ cc)
if test -x /usr/bin/cc; then
|
ac9aca | 2007-05-04 | Martin Stjernholm | | CC="`echo $CC|sed -e 's/ cc/ \/usr\/bin\/cc/'`"
|
613bc5 | 2000-08-28 | Henrik Grubbström (Grubba) | | else
: ;
fi
;;
esac
CFLAGS="-Ae +Olibcalls $CFLAGS"
AC_TRY_COMPILE([int foo(int bar);],[],[],[
CC="$OLD_CC"
CFLAGS="$OLD_CFLAGS"
])
pike_cv_prog_CC="${CC}"
])
fi
fi
if test "$pike_cv_sys_os" = "Solaris" ; then
AC_DEFINE(SOLARIS)
else
:
fi
|
25e474 | 2002-10-13 | Xavier Beaudouin | | # Workaround for compiling Pike on some OS that have some clues
|
827dda | 2002-10-04 | Xavier Beaudouin | | case "$pike_cv_sys_os" in
CYGWIN*)
|
87eacc | 2005-02-04 | Henrik Grubbström (Grubba) | | # Cygwin has both Windows includes and Unix ones.
|
93a521 | 2007-12-15 | Henrik Grubbström (Grubba) | | # Hiding them makes it a somewhat Unix compliant OS.
|
827dda | 2002-10-04 | Xavier Beaudouin | | echo 'Cygwin host detected. Enabling workarounds...'
|
ba0a65 | 2002-10-09 | Xavier Beaudouin | | # winsock.h, winbase.h, winsock2.h, windows.h, wingdi.h, windef.h
|
827dda | 2002-10-04 | Xavier Beaudouin | | # are part of VC api but given as headers in cygwin. We
|
87eacc | 2005-02-04 | Henrik Grubbström (Grubba) | | # should not detect them when using cygwin
|
827dda | 2002-10-04 | Xavier Beaudouin | | ac_cv_header_wingdi_h="no"
|
ba0a65 | 2002-10-09 | Xavier Beaudouin | | ac_cv_header_windef_h="no"
|
827dda | 2002-10-04 | Xavier Beaudouin | | ac_cv_header_winsock_h="no"
ac_cv_header_winsock2_h="no"
ac_cv_header_winbase_h="no"
ac_cv_header_windows_h="no"
|
09322e | 2003-03-09 | Xavier Beaudouin | | with_machine_code="no"
|
827dda | 2002-10-04 | Xavier Beaudouin | | ;;
|
e37d79 | 2004-05-10 | Marcus Agehall | | Windows_NT)
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | if test "$pike_cv_is_mingw" = "yes"; then
#with_machine_code="no"
|
e37d79 | 2004-05-10 | Marcus Agehall | | ac_cv_func_fpclass="no"
fi
;;
|
25e474 | 2002-10-13 | Xavier Beaudouin | | FreeBSD*)
|
87eacc | 2005-02-04 | Henrik Grubbström (Grubba) | | # FreeBSD has different naming convention for gtk-config and sdl-config
|
64356c | 2003-12-19 | Dan Nelson | | if test "x${GTK_CONFIG}" = "x"; then
|
2b3004 | 2003-12-17 | Marcus Comstedt | | GTK_CONFIG=`which ${ac_tool_prefix}gtk12-config`
|
aa5ac7 | 2002-10-13 | Xavier Beaudouin | | export GTK_CONFIG
|
25e474 | 2002-10-13 | Xavier Beaudouin | | fi
|
64356c | 2003-12-19 | Dan Nelson | | if test "x${SDL_CONFIG}" = "x"; then
|
2b3004 | 2003-12-17 | Marcus Comstedt | | SDL_CONFIG=`which ${ac_tool_prefix}sdl11-config`
|
aa5ac7 | 2002-10-13 | Xavier Beaudouin | | export SDL_CONFIG
|
25e474 | 2002-10-13 | Xavier Beaudouin | | fi
;;
|
827dda | 2002-10-04 | Xavier Beaudouin | | esac
|
514bbc | 2009-09-19 | Henrik Grubbström (Grubba) | | # Skip if user does not wish to use smartlink binary.
|
bb47fb | 2004-05-08 | Marcus Agehall | | if test "x$force_smartlink_script_only" = "x"; then
|
b9ed67 | 2016-03-30 | Henrik Grubbström (Grubba) | | # Strip smartlink and arguments from $CC
|
193a84 | 2016-03-30 | Henrik Grubbström (Grubba) | | REALCC="`echo $CC|sed -e 's/.*smartlink *//'`";
RAWCC="`echo $REALCC|sed -e 's/ .*//g'`"
|
ac423c | 2003-01-16 | David Hedbor | |
|
904127 | 1999-03-06 | Henrik Grubbström (Grubba) | | # FIXME: Add proper tests
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([for ld.so run path method])
AC_CACHE_VAL(pike_cv_ld_so_run_path_method, [
case "$UNAME" in
OSF1\ V4.*|OSF1\ V5.*|OSF1\ V6.*)
pike_cv_run_path_method=rpath
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | ;;
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | HPUX\ 11.*)
pike_cv_run_path_method=plus_b
|
108dde | 2000-10-31 | Henrik Grubbström (Grubba) | | ;;
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | SunOS\ 5.*)
|
93d8fe | 2017-08-09 | Martin Nilsson | | pike_cv_run_path_method=r
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | ;;
|
d4d23e | 2005-11-30 | Marek Habersack | | Linux\ 2.* | GNU/kFreeBSD* )
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | if test "$ICC" = "yes"; then
|
3cfc07 | 2004-04-16 | Henrik Grubbström (Grubba) | | # icc or ecc.
|
d4fc87 | 2003-01-16 | David Hedbor | | pike_cv_run_path_method=qoption
else
pike_cv_run_path_method=wl
fi
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | ;;
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | UnixWare\ 7.*|OpenUNIX\ 8.*)
if test "$ac_cv_prog_gcc" = "yes"; then
pike_cv_run_path_method=xlinker_yp_
else
pike_cv_run_path_method=yp_
fi
|
ed7aeb | 2000-06-16 | Henrik Grubbström (Grubba) | | ;;
|
ed245f | 2017-08-04 | William Welliver | | Darwin\ *)
pike_cv_run_path_method=darwin_rpath
;;
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | *)
pike_cv_run_path_method=ld_library_path
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | ;;
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | esac
])
|
fdb387 | 2002-08-21 | Henrik Grubbström (Grubba) | | case "$pike_cv_run_path_method" in
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | rpath)
AC_DEFINE(USE_RPATH)
AC_MSG_RESULT([use -rpath])
;;
plus_b)
AC_DEFINE(USE_PLUS_b)
AC_MSG_RESULT([use +b])
;;
yp_)
AC_DEFINE(USE_YP_)
AC_MSG_RESULT([use -Yp,])
;;
xlinker_yp_)
AC_DEFINE(USE_XLINKER_YP_)
AC_MSG_RESULT([use -Xlinker -Yp, -Xlinker])
;;
wl_r)
AC_DEFINE(USE_Wl_R)
AC_MSG_RESULT([use -Wl,-R])
;;
r)
AC_DEFINE(USE_R)
AC_MSG_RESULT([use -R])
;;
wl)
AC_DEFINE(USE_Wl)
AC_MSG_RESULT([use -Wl,-rpath])
|
ed245f | 2017-08-04 | William Welliver | | ;;
darwin_rpath)
AC_DEFINE(USE_Wl_rpath_darwin)
AC_MSG_RESULT([use -Wl,-rpath (Darwin-style)])
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | ;;
|
d4fc87 | 2003-01-16 | David Hedbor | | qoption)
AC_DEFINE(USE_Qoption)
AC_MSG_RESULT([use -Qoption,ld,-rpath])
;;
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | | ld_library_path|*)
AC_DEFINE(USE_LD_LIBRARY_PATH)
AC_MSG_RESULT([use LD_LIBRARY_PATH/LD_RUN_PATH])
;;
|
2565f4 | 1997-02-26 | Fredrik Hübinette (Hubbe) | | esac
|
5c9e1d | 2008-08-19 | Jonas Wallden | | # Smartlink needs to know if OS X uses flat or two-level namespace
if test "$pike_cv_sys_os" = "Darwin" ; then
AC_MSG_CHECKING([for Darwin linker namespace])
case "`uname -r`" in
[1-6].*)
AC_MSG_RESULT([flat (10.2 or older)])
pike_cv_osx_twolevel_namespace=no
;;
*)
AC_DEFINE(USE_OSX_TWOLEVEL_NAMESPACE)
AC_MSG_RESULT([two-level (10.3 or newer)])
pike_cv_osx_twolevel_namespace=yes
;;
esac
fi
|
71561a | 2002-08-21 | Henrik Grubbström (Grubba) | |
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | # Fix a smartlink
SMARTLINK="$BUILDDIR/smartlink"
|
904127 | 1999-03-06 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if $SMARTLINK exists is up to date and works)
|
9edb20 | 2004-03-10 | Henrik Grubbström (Grubba) | | if ls -1tr "$SMARTLINK${ac_exeext}" "$srcdir/smartlink.$ac_ext" 2>/dev/null | head -n 1 | grep "smartlink.$ac_ext" >/dev/null 2>&AC_FD_CC && "$SMARTLINK" -v >/dev/null 2>&AC_FD_CC; then
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
|
7e4d4e | 2000-12-13 | Fredrik Hübinette (Hubbe) | | SMARTBUILDCC="${REALCC-cc}"
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | |
|
9f8523 | 2000-11-26 | Henrik Grubbström (Grubba) | | if echo foo "$CC" | egrep 'rntc.|rnt.cl' >/dev/null; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([rntcc/rntcl/rnticl/rntecl detected.])
|
7e4d4e | 2000-12-13 | Fredrik Hübinette (Hubbe) | | AC_PATH_PROGS(SMARTBUILDCC,gcc cc egcs,gcc, $PATH:$EXTRA_PATH)
echo Using $SMARTBUILDCC to compile smartlink.
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif test "x$ac_cv_prog_cc_cross" = "xyes"; then
PIKE_MSG_WARN([Crosscompiler detected.])
AC_PATH_PROGS(SMARTBUILDCC, gcc cc egcs, gcc, /usr/bin:/bin/:/usr/ccs/bin:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin:/opt/csw/bin:$PATH:$EXTRA_PATH)
echo Using $SMARTBUILDCC to compile smartlink.
|
7e4d4e | 2000-12-13 | Fredrik Hübinette (Hubbe) | | fi
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | |
|
7e4d4e | 2000-12-13 | Fredrik Hübinette (Hubbe) | | rm -f "$SMARTLINK"
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | |
|
7e4d4e | 2000-12-13 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(whether smartlink compiles)
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | |
|
9edb20 | 2004-03-10 | Henrik Grubbström (Grubba) | | link_cmd='${SMARTBUILDCC-cc} -o smartlink${ac_exeext} $CFLAGS -I. $CPPFLAGS $LDFLAGS $srcdir/smartlink.$ac_ext $LIBS 2>&AC_FD_CC'
if { (eval echo Compiling smartlink: \"$link_cmd\") 1>&AC_FD_CC; (eval $link_cmd) 2>&AC_FD_CC; } && "$BUILDDIR/smartlink" -v >/dev/null 2>&AC_FD_CC; then
|
7e4d4e | 2000-12-13 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no - use the sh script)
SMARTLINK="$BINDIR/smartlink"
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | | fi
fi
|
bb47fb | 2004-05-08 | Marcus Agehall | | else # force_smartlink_script_only
AC_MSG_CHECKING(for smartlink build script)
SMARTLINK="$BINDIR/smartlink"
REALCC="$CC"
AC_MSG_RESULT($SMARTLINK)
fi # force_smartlink_script_only
|
d1e3fe | 1999-03-06 | Henrik Grubbström (Grubba) | |
CC="$SMARTLINK $REALCC"
pike_cv_prog_CC="$CC"
|
d5efba | 1998-01-23 | Henrik Grubbström (Grubba) | |
|
b9ed67 | 2016-03-30 | Henrik Grubbström (Grubba) | | # Strip smartlink and arguments from $CXX
|
193a84 | 2016-03-30 | Henrik Grubbström (Grubba) | | REALCXX="`echo $CXX|sed -e 's/.*smartlink *//'`"
RAWCXX="`echo $REALCXX|sed -e 's/ .*//g'`"
|
bf4cdf | 2011-02-14 | Henrik Grubbström (Grubba) | | CXX="$SMARTLINK $REALCXX"
pike_cv_prog_CXX="$CXX"
|
424d9c | 1999-05-02 | Fredrik Hübinette (Hubbe) | | AC_SUBST(SMARTLINK)
AC_SUBST(REALCC)
|
bf4cdf | 2011-02-14 | Henrik Grubbström (Grubba) | | AC_SUBST(REALCXX)
|
528622 | 2011-03-25 | Henrik Grubbström (Grubba) | | export CC CXX REALCC REALCXX SMARTLINK
|
d5efba | 1998-01-23 | Henrik Grubbström (Grubba) | |
|
d166d6 | 2000-08-06 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([for a fallback compiler])
|
b9ed67 | 2016-03-30 | Henrik Grubbström (Grubba) | | # Strip smartlink and arguments from $FALLBACK_CC
|
193a84 | 2016-03-30 | Henrik Grubbström (Grubba) | | FALLBACK_CC="`echo $FALLBACK_CC|sed -e 's/.*smartlink *//'`"
|
d166d6 | 2000-08-06 | Henrik Grubbström (Grubba) | | if test "x$FALLBACK_CC" = "x"; then
AC_MSG_RESULT(no)
else
FALLBACK_CC="$SMARTLINK $FALLBACK_CC"
AC_MSG_RESULT($FALLBACK_CC)
fi
AC_SUBST(FALLBACK_CC)
export FALLBACK_CC
|
2565f4 | 1997-02-26 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
1acce8 | 2001-01-27 | Martin Stjernholm | | fi #if test "x$enable_binary" != "xno"
#############################################################################
|
2565f4 | 1997-02-26 | Fredrik Hübinette (Hubbe) | |
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | # Something seems to mess with the stack ulimit on some architectures...
|
5e2d84 | 2008-01-14 | Henrik Grubbström (Grubba) | | #
# Cause found. GNU make 3.81 apparently raises the stack ulimit to max
# without restoring it for the subprocesses. (Bug 18396 and 22010 at
# http://savannah.gnu.org/projects/make)
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | AC_DEFUN(PIKE_AC_DEBUG, [
echo "DEBUG: ----------------------------------" 1>&AC_FD_CC
echo "Current limits: " 1>&AC_FD_CC
ulimit -a 1>&AC_FD_CC
echo "DEBUG: ++++++++++++++++++++++++++++++++++" 1>&AC_FD_CC
])
|
0ce67d | 2012-02-15 | Bill Welliver | | # Convenience function for querying Frameworks
AC_DEFUN([AC_CHECK_FRAMEWORK],
[m4_ifval([$3], , [AH_CHECK_FRAMEWORK([$1])])dnl
AS_LITERAL_IF([$1],
[AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1_$2])],
[AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1''_$2])])dnl
AC_CACHE_CHECK([for $2 in $1 framework], ac_Framework,
[ac_check_framework_save_LIBS=$LIBS
LIBS="-framework $1 $5 $LIBS"
AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
[AS_VAR_SET(ac_Framework, yes)],
[AS_VAR_SET(ac_Framework, no)])
LIBS=$ac_check_framework_save_LIBS])
AS_IF([test AS_VAR_GET(ac_Framework) = yes],
[m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FRAMEWORK_$1))
LIBS="-framework $1 $LIBS"
])],
[$4])dnl
AS_VAR_POPDEF([ac_Framework])dnl
])# AC_CHECK_FRAMEWORK
# AH_CHECK_FRAMEWORK(FRAMEWORK)
# ---------------------
m4_define([AH_CHECK_FRAMEWORK],
[AH_TEMPLATE(AS_TR_CPP(HAVE_FRAMEWORK_$1),
[Define to 1 if you have the `]$1[' framework (-framework ]$1[).])])
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | PIKE_AC_DEBUG
|
5e2d84 | 2008-01-14 | Henrik Grubbström (Grubba) | | if :; then :; else
# Disabled for now.
# It looks this makes it even worse...
# It seems to cause bash to loop on a SIGSEGV in the signal handler
# on Gentoo Linux/IA64.
|
3f36d0 | 2008-01-11 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([if the stack ulimit is excessive])
if ulimit -s 1>&AC_FD_CC 2>&AC_FD_CC; then
orig_ulimit="`ulimit -s 2>&AC_FD_CC`"
if test "$orig_ulimit" -gt "65536"; then
|
433fe4 | 2008-01-12 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT([yes, $orig_ulimit - reducing to 8192.])
if ulimit -s 8192 1>&AC_FD_CC 2>&AC_FD_CC; then :; else
AC_MSG_WARN([Failed to reduce stack ulimit to 8192.])
|
3f36d0 | 2008-01-11 | Henrik Grubbström (Grubba) | | fi
PIKE_AC_DEBUG
else
AC_MSG_RESULT([no, $orig_ulimit])
fi
else
AC_MSG_RESULT([unknown, ulimit -s failed.])
fi
|
5e2d84 | 2008-01-14 | Henrik Grubbström (Grubba) | | fi
|
3f36d0 | 2008-01-11 | Henrik Grubbström (Grubba) | |
|
bde77e | 2011-05-01 | Per Hedbor | | AC_SYS_COMPILER_FLAG([-fvisibility=hidden],[fvisibility_hidden],CFLAGS)
|
7e37bb | 2002-08-20 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(+O3,plus_O3,OPTIMIZE, [
|
971481 | 2008-07-12 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-O3,O3,OPTIMIZE, [
AC_SYS_COMPILER_FLAG(-O2,O2,OPTIMIZE, [
AC_SYS_COMPILER_FLAG(-O,O,OPTIMIZE)
])
|
7e37bb | 2002-08-20 | Henrik Grubbström (Grubba) | | ])
])
|
de575a | 1999-05-29 | Henrik Grubbström (Grubba) | |
|
613bc5 | 2000-08-28 | Henrik Grubbström (Grubba) | | if test "$GCC" = "yes"; then
|
08f0e7 | 2011-05-16 | Per Hedbor | |
|
dc8308 | 2000-09-15 | Henrik Grubbström (Grubba) | | if test "$cflags_is_set" = "no"; then
|
ed1fae | 2002-08-14 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-pipe, pipe, OPTIMIZE)
|
30d7e3 | 2003-12-04 | Per Hedbor | |
|
6cc848 | 2005-06-09 | Henrik Grubbström (Grubba) | | # The following segment is obsolete, since executable memory is
# now allocated with mmap instead of with malloc().
# /grubba 2005-06-09
#
# #### For exec-shield in newer linux kernels.
# #### Linux's mprotect(2) is broken, so we unfortunately
# #### need to enable executabe stack.
# #### This test crashes under mingw32 so let's disable for win32 for now.
# if test "$pike_cv_sys_os" != "Windows_NT"; then
# AC_SYS_COMPILER_FLAG([[-Wa,--execstack]],executableheap,CFLAGS)
# fi
|
613bc5 | 2000-08-28 | Henrik Grubbström (Grubba) | | fi
|
5c8e89 | 1995-10-29 | Fredrik Hübinette (Hubbe) | | fi
|
2901d3 | 1998-08-05 | Fredrik Hübinette (Hubbe) | | LD='$(CC) $(CFLAGS)'
|
37428e | 2001-10-05 | Fredrik Hübinette (Hubbe) | | LC_REQ="-lc"
|
080971 | 1998-02-27 | Marcus Comstedt | |
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | case "$pike_cv_sys_os" in
|
f4215b | 2002-08-30 | H. William Welliver III | | Darwin*)
;;
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | SCO*)
|
77b282 | 1997-10-04 | Henrik Grubbström (Grubba) | | case "$CFLAGS" in
|
13670c | 2015-05-25 | Martin Nilsson | | *-belf*)
|
2a7fc8 | 1999-11-29 | Boyd Lynn Gerber | | AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[
case "$LDFLAGS" in
*-belf*) ;;
*)
echo "Adding -belf option to ldflags."
LDFLAGS="$LDFLAGS -belf"
;;
esac
])
;;
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | *)
|
2a7fc8 | 1999-11-29 | Boyd Lynn Gerber | | AC_SYS_COMPILER_FLAG(-belf,belf,CFLAGS)
|
77b282 | 1997-10-04 | Henrik Grubbström (Grubba) | | ;;
esac
case "$LDFLAGS" in
*-belf*) ;;
*)
|
dda906 | 1999-08-15 | Boyd Lynn Gerber | | AC_SYS_COMPILER_FLAG(-belf,belf,LDFLAGS)
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | ;;
esac
;;
|
2b4903 | 1998-03-05 | Henrik Grubbström (Grubba) | | SunOS*)
# gcc on SunOS 4 forgets to define this:
echo "SunOS. Adding -D__USE_FIXED_PROTOTYPES__"
CFLAGS="$CFLAGS -D__USE_FIXED_PROTOTYPES__"
;;
|
080971 | 1998-02-27 | Marcus Comstedt | | BSD/OS*)
|
1807bd | 2000-11-28 | Fredrik Hübinette (Hubbe) | | case "`uname -r`" in
|
e9e9d8 | 2001-09-22 | Henrik Grubbström (Grubba) | | [4-9].*) ;;
|
1807bd | 2000-11-28 | Fredrik Hübinette (Hubbe) | | *) LD="$BINDIR/smartlink shlicc";;
esac
|
080971 | 1998-02-27 | Marcus Comstedt | | ;;
|
bcb538 | 2001-08-23 | Boyd Lynn Gerber | | UnixWare*|OpenUNIX*)
|
2a7fc8 | 1999-11-29 | Boyd Lynn Gerber | | case "$CFLAGS" in
*-Kalloca*) ;;
*)
if test "$GCC" != "yes"; then
# We are using built-in inline function
CFLAGS="$CFLAGS -Kalloca"
CXX="$CXX -DNO_CPLUSPLUS_ALLOCA"
|
37428e | 2001-10-05 | Fredrik Hübinette (Hubbe) | | LC_REQ=""
|
2a7fc8 | 1999-11-29 | Boyd Lynn Gerber | | fi
;;
esac
|
9ab446 | 1998-11-06 | Honza Petrous | | ;;
|
d4fc87 | 2003-01-16 | David Hedbor | | Linux*)
|
3cfc07 | 2004-04-16 | Henrik Grubbström (Grubba) | | if $REALCC -V 2>&1 | head -1 | grep "Intel(R) C" >/dev/null; then
# icc or ecc.
|
d4fc87 | 2003-01-16 | David Hedbor | | LC_REQ=""
fi
;;
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | esac
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | |
|
080971 | 1998-02-27 | Marcus Comstedt | | AC_SUBST(LD)
|
37428e | 2001-10-05 | Fredrik Hübinette (Hubbe) | | AC_SUBST(LC_REQ)
|
080971 | 1998-02-27 | Marcus Comstedt | |
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | |
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(root, MY_DESCR([--with-root=path],
[specify a cross-compilation root-directory]),[
|
cf3990 | 2001-01-19 | Henrik Grubbström (Grubba) | | case "$with_root" in
/)
with_root=""
;;
/*)
;;
no)
with_root=""
;;
*)
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([Root path $with_root is not absolute. Ignored.])
|
cf3990 | 2001-01-19 | Henrik Grubbström (Grubba) | | with_root=""
;;
esac
],[with_root=""])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(relocatable_dumped_modules,
MY_DESCR([--with-relocatable-dumped-modules],
[make dumped modules relocatable]),
[with_relocatable_dumped_modules=yes])
AC_ARG_WITH(dynamic_modules, MY_DESCR([--without-dynamic-modules],
[link modules statically]))
MY_AC_ARG_WITH(static_linking, MY_DESCR([--with-static-linking],
[link statically, if possible]),
[with_static_linking=yes])
|
90802b | 2006-08-03 | Martin Stjernholm | | AC_ARG_WITH(crt, MY_DESCR([--with-crt=dynamic|static],
[force linking with dynamic or static CRT in Visual Studio]))
|
099eeb | 2006-08-03 | Martin Stjernholm | |
# --with-debug-crt is a nop on most systems since a debug C runtime
# lib normally is used simply by setting LD_LIBRARY_PATH, but in MSVC
# the choice affects both the compiler and the linker.
#
# Note that all libs need to be linked to the same CRT in VC8 if they
# are linked to the DLL variant (i.e. using -MD), otherwise the MS
# loader won't load them. This restriction is reinforced by the
# manifest stuff that's used in VC8, and it doesn't apply when running
# directly in the build dir. See
# http://msdn2.microsoft.com/en-us/library/ms235299.aspx
#
# Also note that the debug CRT DLL in VC8 isn't redistributable.
AC_ARG_WITH(debug-crt, MY_DESCR([--with-debug-crt],
[compile and link with debug CRT in Visual Studio]),
[], [with_debug_crt=no])
|
fc4d96 | 2001-12-07 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(site-prefixes,
MY_DESCR([--with-site-prefixes],
|
e06a3c | 2006-01-06 | Peter Bortas | | [:-separated list of prefixes to search for include, lib and bin dirs.]))
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(include-path,
MY_DESCR([--with-include-path],
[a list of paths to search for include files.]))
AC_ARG_WITH(lib-path,
MY_DESCR([--with-lib-path],
[a list of paths to search for libraries.]))
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_ARG_WITH(long-double-precision, MY_DESCR([--with-long-double-precision],
[use long double precision floats]))
AC_ARG_WITH(double-precision, MY_DESCR([--with-double-precision],
[use double precision floats]))
AC_ARG_WITH(long-long-int, MY_DESCR([--with-long-long-int],
|
88b19d | 2003-02-27 | Mirar (Pontus Hagland) | | [use long long native type int]))
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_ARG_WITH(long-int, MY_DESCR([--with-long-int],
|
88b19d | 2003-02-27 | Mirar (Pontus Hagland) | | [use long native type int]))
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_ARG_WITH(int-int, MY_DESCR([--with-int-int],
[use int native type int]))
|
ac6000 | 2003-11-15 | Martin Stjernholm | | dnl AC_ARG_WITH(short-int, MY_DESCR([--with-short-int],
dnl [use short native type int (EXPERIMENTAL)]))
dnl AC_ARG_WITH(unsigned-long-int, MY_DESCR([--with-unsigned-long-int],
dnl [use short native type int (EXPERIMENTAL)]))
dnl AC_ARG_WITH(unsigned-long-long-int, MY_DESCR([--with-unsigned-long-longint],
dnl [use short native type int (EXPERIMENTAL)]))
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | |
|
8f797a | 2006-08-05 | Martin Stjernholm | | AC_ARG_ENABLE(dlmalloc, MY_DESCR([--enable-dlmalloc],
[use Doug Leas malloc implementation instead of system malloc]),
[], [test "$pike_cv_sys_os" = Windows_NT && enable_dlmalloc=yes])
# dlmalloc is enabled by default on windows since the OS heap manager
# Sucketh. (Well, it's possible to enable a "low-fragmentation heap"
# but it only works for blocks up to 16kb.)
if test "x$enable_dlmalloc" = xyes; then
EXTRA_OBJS="$EXTRA_OBJS malloc.o"
AC_DEFINE(USE_DL_MALLOC)
|
b22d7c | 2006-08-07 | Martin Stjernholm | | else
enable_dlmalloc=no
|
8f797a | 2006-08-05 | Martin Stjernholm | | fi
|
343c59 | 2004-03-16 | Martin Stjernholm | | MY_AC_ARG_WITH(cleanup-on-exit,
MY_DESCR([--with-cleanup-on-exit],
[Do full cleanup at exit to detect leaks better.]),
[AC_DEFINE(DO_PIKE_CLEANUP)])
MY_AC_ARG_WITH(dmalloc, MY_DESCR([--with-dmalloc],[Enable memory leak checks.]),
|
299a4e | 2002-03-14 | Martin Stjernholm | | [AC_DEFINE(DEBUG_MALLOC,10)])
MY_AC_ARG_WITH(dmalloc-malloc, MY_DESCR([--with-dmalloc-malloc],
|
343c59 | 2004-03-16 | Martin Stjernholm | | [Enable overloading of malloc(3)]),
|
299a4e | 2002-03-14 | Martin Stjernholm | | [ AC_DEFINE(ENCAPSULATE_MALLOC,1) ])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(dmalloc-malloc-leaks,
|
299a4e | 2002-03-14 | Martin Stjernholm | | MY_DESCR([--with-dmalloc-malloc-leaks],
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | [Report memory allocated by malloc(3) as leaks.]),
[ AC_DEFINE(REPORT_ENCAPSULATED_MALLOC,1) ])
MY_AC_ARG_WITH(dmalloc-trace, MY_DESCR([--with-dmalloc-trace],
[enable tracepoints]),
[with_dmalloc_trace="yes" AC_DEFINE(DMALLOC_TRACE,10)])
|
5bfd38 | 2008-09-03 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(dmalloc-c-stack-trace, MY_DESCR([--with-dmalloc-c-stack-trace],
|
578340 | 2008-09-04 | Martin Stjernholm | | [record C stack traces for block allocations]),
|
5bfd38 | 2008-09-03 | Henrik Grubbström (Grubba) | | [AC_DEFINE(DMALLOC_C_STACK_TRACE)])
|
000aab | 2004-10-22 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(dmalloc-track-free, MY_DESCR([--with-dmalloc-track-free],
[track freed memory too]),
[ with_dmalloc_track_free="yes"
AC_DEFINE(DMALLOC_TRACK_FREE,10)])
|
299a4e | 2002-03-14 | Martin Stjernholm | | AC_ARG_WITH(debug, MY_DESCR([--with-debug],[same as --with-cdebug --with-rtldebug]),
[],[with_debug=])
AC_ARG_WITH(debug, MY_DESCR([--without-debug],[same as --without-cdebug --without-rtldebug]),
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | [],[with_debug=])
AC_ARG_WITH(rtldebug, MY_DESCR([--with-rtldebug],[enable run time self tests]),
[],[with_rtldebug=])
AC_ARG_WITH(cdebug, MY_DESCR([--without-cdebug],[disable -g]),[],[
|
aa38a8 | 1999-11-29 | Henrik Grubbström (Grubba) | | case "$pike_cv_sys_os:$GCC" in
Solaris:no)
# Solaris/cc has problems with combining optimizations and debuginfo.
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([Defaulting to --without-cdebug since the OS is Solaris,
|
0d53c5 | 2002-08-19 | Henrik Grubbström (Grubba) | | and gcc is not being used.])
with_cdebug=no
;;
HP-UX:no|HPUX:no)
# HP-UX/cc has problems with combining optimizations and debuginfo.
#
# cc: internal panic 7815: Malloc: underflow detected in free(). (7815)
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([Defaulting to --without-cdebug since the OS is HP-UX,
|
81e643 | 2000-01-03 | Martin Stjernholm | | and gcc is not being used.])
|
aa38a8 | 1999-11-29 | Henrik Grubbström (Grubba) | | with_cdebug=no
;;
*)
with_cdebug=
;;
esac
])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(copt, MY_DESCR([--without-copt], [disable -O2]), [], [with_copt=])
AC_ARG_WITH(threads, MY_DESCR([--without-threads], [disable threads support]),
[],[
|
2f0411 | 2000-02-03 | Fredrik Hübinette (Hubbe) | | case "x$pike_cv_sys_os" in
xFreeBSD*)
|
0b620a | 2001-01-21 | Henrik Grubbström (Grubba) | | if test "`uname -r|sed -e 's/\([[0-9]]*\).*/\1/'`" -lt 4; then
|
0a8698 | 2003-11-07 | Martin Stjernholm | | PIKE_MSG_WARN([FreeBSD <= 3.x detected, disabling threads.
Use --with-threads to force threads support.])
|
e1afda | 2003-02-03 | Henrik Grubbström (Grubba) | | with_threads=no
fi
;;
xOpenBSD*)
if test "`uname -r|sed -e 's/\([[0-9]]*\).*/\1/'`" -lt 4 \
-a "x`uname -m`" = "xalpha"; then
|
0a8698 | 2003-11-07 | Martin Stjernholm | | PIKE_MSG_WARN([OpenBSD/alpha <= 3.x detected, disabling threads.
Use --with-threads to force threads support.])
|
2f0411 | 2000-02-03 | Fredrik Hübinette (Hubbe) | | with_threads=no
fi
;;
esac
|
cd5748 | 2000-02-03 | Henrik Grubbström (Grubba) | | if test "x${with_threads-}" = x; then
|
2f0411 | 2000-02-03 | Fredrik Hübinette (Hubbe) | | with_threads=yes
fi
])
|
38c2d6 | 2002-11-24 | Martin Stjernholm | |
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | PIKE_AC_DEBUG
|
38c2d6 | 2002-11-24 | Martin Stjernholm | | AC_ARG_WITH(malloc_overhead,
MY_DESCR([--with-malloc-overhead=n],
[tune the malloc block overhead (default is 2 * sizeof(void *))]),
[AC_DEFINE(PIKE_MALLOC_OVERHEAD,($withval))],
[AC_DEFINE(PIKE_MALLOC_OVERHEAD,(2 * sizeof(void *)))])
AC_ARG_WITH(malloc_page_size,
MY_DESCR([--with-malloc-page-size=n],
[tune to the memory page size (default is 4 kb)]),
[AC_DEFINE(PIKE_MALLOC_PAGE_SIZE,($withval))],
[AC_DEFINE(PIKE_MALLOC_PAGE_SIZE,(4 * 1024))])
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | |
PIKE_AC_DEBUG
|
5da06f | 2003-06-26 | Tomas Nilsson | | AC_ARG_WITH(thread_c_stack,
MY_DESCR([--with-thread-c-stack=n],
|
37a46a | 2014-03-14 | Henrik Grubbström (Grubba) | | [tune the thread c-stack (default is 1024 * 1024)]),
|
5da06f | 2003-06-26 | Tomas Nilsson | | [AC_DEFINE_UNQUOTED(PIKE_THREAD_C_STACK_SIZE,($withval))],
|
37a46a | 2014-03-14 | Henrik Grubbström (Grubba) | | [AC_DEFINE(PIKE_THREAD_C_STACK_SIZE,(1024 * 1024))])
|
38c2d6 | 2002-11-24 | Martin Stjernholm | |
|
8ad6e7 | 2004-03-09 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(devpoll, MY_DESCR([--without-devpoll],
[disable support for /dev/poll]),
[],[with_devpoll=yes])
|
38c2d6 | 2002-11-24 | Martin Stjernholm | | AC_ARG_WITH(gdbm, MY_DESCR([--without-gdbm],[no GNU database manager support]))
AC_ARG_WITH(gmp, MY_DESCR([--without-gmp],[no support for Gmp bignums]))
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(zlib, MY_DESCR([--without-zlib],[disable gz compression support]),
[],[with_zlib=yes])
AC_ARG_WITH(mysql, MY_DESCR([--without-mysql],
[disable support for the Mysql database]),
[],[with_mysql=yes])
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(valgrind, MY_DESCR([--with-valgrind=path],
|
cfb75c | 2011-07-22 | Henrik Grubbström (Grubba) | | [Support for running with valgrind. Implies --with-cleanup-on-exit.])
MY_DESCR([],[Specify --without-cleanup-on-exit if you do not want this.]),
[
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | if test "x$with_valgrind" = "xyes"; then
AC_PATH_PROG(with_valgrind, valgrind, no)
if test "x$with_valgrind" = "xno"; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN(valgrind not found, disabled.)
|
ac6958 | 2002-11-19 | Henrik Grubbström (Grubba) | | else :; fi
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | else :; fi
], [with_valgrind=no])
|
cf8434 | 2011-05-19 | Jonas Walldén | | AC_ARG_WITH(dtrace, MY_DESCR([--with-dtrace],[embed DTrace probes]))
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(checker, MY_DESCR([--with-checker],
[add extra memory checking overhead (Purify)]))
|
e7b160 | 2004-01-09 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(gcov, MY_DESCR([--with-gcov],
[compile with support for gcov (gcc-only)]))
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(profiling, MY_DESCR([--with-profiling],
[add code used to profile pike code]),
[AC_DEFINE(PROFILING)])
|
a8a813 | 2002-09-13 | Martin Stjernholm | | MY_AC_ARG_WITH(internal-profiling, MY_DESCR([--with-internal-profiling],
[add profiling code for various internal things]),
[AC_DEFINE(INTERNAL_PROFILING)])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(pg, MY_DESCR([--with-pg],[use the gcc -pg option]),
[PROFIL=-pg])
AC_ARG_WITH(poll, MY_DESCR([--with-poll], [use poll instead of select]), [], [
|
78a69c | 1998-09-29 | Henrik Grubbström (Grubba) | | # Neither --with-poll nor --without-poll was specified
case "$pike_cv_sys_os" in
|
4fb738 | 2017-08-09 | Martin Nilsson | | Solaris|HP-UX|OSF1|Linux|UnixWare|OpenUNIX|AIX)
|
30d7e3 | 2003-12-04 | Per Hedbor | | # PIKE_MSG_WARN([Defaulting to --with-poll since the OS is $pike_cv_sys_os.])
# Nothing to warn about, really...
|
13670c | 2015-05-25 | Martin Nilsson | | # NOTE: Darwin (OSX/iOS) have poll, but it's layered on kqueue, so there's no
|
33fcaa | 2013-11-09 | Bill Welliver | | # real benefit to supporting it separately there.
|
d7bcfd | 1998-09-29 | Henrik Grubbström (Grubba) | | with_poll=yes
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | | ;;
esac
])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(max-fd,
MY_DESCR([--with-max-fd=X],
[set how many filedescriptors can be used at once]),
[pike_cv_max_open_fd=$withval])
MY_AC_ARG_WITH(oob, MY_DESCR([--without-oob],
|
15a3d2 | 2003-10-23 | Henrik Grubbström (Grubba) | | [disable out-of-band data handling (INVALID)]),
[],[
AC_MSG_ERROR([Support for out of band data is mandatory in Pike 7.5 and later.])
])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | MY_AC_ARG_WITH(compiler-trace, MY_DESCR([--with-compiler-trace],
[enable tracing of the compiler]),
[AC_DEFINE(YYDEBUG)])
|
e2b7b9 | 2002-04-27 | Martin Stjernholm | | dnl Shared nodes has been disabled in an ugly way. To enable it you
dnl need to remove the line that sets the OPT_NOT_SHARED flag at the
dnl top of freeze_node in src/las.c. /mast
dnl AC_ARG_WITH(shared-nodes,
dnl MY_DESCR([--without-shared-nodes],
dnl [disable the SHARED_NODES mode of the optimizer]),
dnl [],[with_shared_nodes=yes])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(computed-goto,
MY_DESCR([--with-computed-goto],
[enable use of gcc-style computed goto (EXPERIMENTAL).]),
[], [with_computed_goto=no])
|
247027 | 2014-05-22 | Per Hedbor | |
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(machine-code,
|
e2b7b9 | 2002-04-27 | Martin Stjernholm | | MY_DESCR([--without-machine-code],
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | [do not try to use of machine code on supported architectures.]),
|
bbb950 | 2002-09-07 | Henrik Grubbström (Grubba) | | [], [
|
8fdd25 | 2004-08-23 | Henrik Grubbström (Grubba) | | case "x$pike_cv_sys_os" in
xOpenBSD*)
PIKE_MSG_WARN([OpenBSD detected, disabling machine code.
|
c10e14 | 2004-08-23 | Xavier Beaudouin | | Use --with-machine-code to force usage of machine code support.])
|
8fdd25 | 2004-08-23 | Henrik Grubbström (Grubba) | | with_machine_code="no"
;;
|
227f83 | 2004-10-24 | Xavier Beaudouin | | xFreeBSD*)
PIKE_MSG_WARN([FreeBSD detected, disabling machine code.
Use --with-machine-code to force usage of machine code support.])
with_machine_code="no"
;;
|
c10e14 | 2004-08-23 | Xavier Beaudouin | | esac
|
8fdd25 | 2004-08-23 | Henrik Grubbström (Grubba) | | if test "x${with_machine_code-}" = x; then
with_machine_code="yes"
|
c10e14 | 2004-08-23 | Xavier Beaudouin | | fi
|
bbb950 | 2002-09-07 | Henrik Grubbström (Grubba) | | ])
|
7199a7 | 2004-10-21 | Henrik Grubbström (Grubba) | | AC_ARG_WITH(small-eval-instruction,
MY_DESCR([--with-small-eval-instruction],
[attempt to reduce the size of eval_instruction (EXPERIMENTAL).]), [
AC_DEFINE(PIKE_SMALL_EVAL_INSTRUCTION)
with_machine_code="no"
with_computed_goto="no"
])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | |
MY_AC_ARG_WITH(keypair-loop,
|
750104 | 2007-10-03 | Henrik Grubbström (Grubba) | | MY_DESCR([--with-keypair-loop],
|
8472d2 | 2007-10-03 | Henrik Grubbström (Grubba) | | [enable use of keypair mapping loop method.]),
[AC_DEFINE(PIKE_MAPPING_KEYPAIR_LOOP)],[],
|
750104 | 2007-10-03 | Henrik Grubbström (Grubba) | | [])
|
a1c502 | 2001-10-06 | Henrik Grubbström (Grubba) | |
|
391350 | 2002-06-25 | Henrik Grubbström (Grubba) | | if test "x$with_pike_type" = "xno"; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([Disabling of USE_PIKE_TYPE is no longer supported.])
|
769d1c | 2001-03-27 | Henrik Grubbström (Grubba) | | fi
|
6cb70d | 2001-02-21 | Henrik Grubbström (Grubba) | |
|
a89870 | 2013-06-17 | Martin Nilsson | | if test "x$with_gmp" = xno; then
AC_MSG_ERROR([The GMP library is required to compile Pike.])
|
0a8698 | 2003-11-07 | Martin Stjernholm | | fi
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | |
|
e7b160 | 2004-01-09 | Henrik Grubbström (Grubba) | | dnl Pike currently breaks miserably if SHARED_NODES is not defined.
|
15b722 | 2003-11-07 | Martin Stjernholm | | dnl Shared nodes are still disabled bluntly. (See note above.)
dnl if test "x$with_shared_nodes" != xno; then
dnl echo 'Enabling the SHARED_NODES mode of the optimizer.'
|
de2896 | 1999-11-13 | Henrik Grubbström (Grubba) | | AC_DEFINE(SHARED_NODES)
|
15b722 | 2003-11-07 | Martin Stjernholm | | dnl else :; fi
|
de2896 | 1999-11-13 | Henrik Grubbström (Grubba) | |
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | | if test "x$with_poll" = "xyes"; then
AC_DEFINE(HAVE_AND_USE_POLL)
else :; fi
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | if test "x$with_valgrind" = "xno"; then
VALGRIND=""
|
e040cf | 2002-11-23 | Martin Stjernholm | | VALGRINDARGS=""
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | else
|
e42fa8 | 2002-11-23 | Martin Stjernholm | | VALGRIND="$with_valgrind"
|
e040cf | 2002-11-23 | Martin Stjernholm | | # Make valgrind a bit silent by default.
|
ec2d75 | 2004-03-21 | Martin Nilsson | | VALGRINDARGS="-q --tool=memcheck"
|
37e9f1 | 2002-11-19 | Henrik Grubbström (Grubba) | | AC_DEFINE(USE_VALGRIND)
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | |
|
0beebd | 2007-05-20 | Henrik Grubbström (Grubba) | | if test "x$with_cleanup_on_exit" = "x"; then
AC_DEFINE(DO_PIKE_CLEANUP)
fi
|
9fb79c | 2004-09-27 | Martin Stjernholm | |
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | if test "x$with_copt" != "xno"; then
PIKE_MSG_WARN([--without-copt is advisable when using valgrind!])
fi
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | fi
|
e040cf | 2002-11-23 | Martin Stjernholm | | export VALGRIND VALGRINDARGS
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | AC_SUBST(VALGRIND)
|
e040cf | 2002-11-23 | Martin Stjernholm | | AC_SUBST(VALGRINDARGS)
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | |
|
cf8434 | 2011-05-19 | Jonas Walldén | | # DTrace probes
if test "x$with_dtrace" = "xyes"; then
AC_PATH_PROG(dtrace_prog, dtrace, no)
if test "x$ac_cv_path_dtrace_prog" != "xno"; then
AC_DEFINE(USE_DTRACE)
DTRACE_REQUIREMENTS="dtrace_probes.h"
fi
fi
|
4839dd | 2001-09-02 | Marcus Comstedt | | if test "x$with_relocatable_dumped_modules" = xyes; then
PIKE_MODULE_RELOC=1
else
PIKE_MODULE_RELOC=""
fi
AC_SUBST(PIKE_MODULE_RELOC)
|
4b8d50 | 2000-12-19 | Henrik Grubbström (Grubba) | |
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | | #
# Allow --with(out)-debug to toggle both cdebug and rtldebug, but
# let --with(out)-{c,rtl}debug take precedence.
#
if test "x$with_cdebug" = x ; then
with_cdebug="$with_debug"
fi
if test "x$with_rtldebug" = x ; then
with_rtldebug="$with_debug"
fi
|
4b8d50 | 2000-12-19 | Henrik Grubbström (Grubba) | | #
# --with-dmalloc requires --with-rtldebug
#
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test "x$with_dmalloc" = "x"; then
:;
elif test "x$with_rtldebug" = "xyes"; then :; else
PIKE_MSG_WARN([Debug malloc requires rtldebug. Enabling rtldebug.])
with_rtldebug=yes
|
4b8d50 | 2000-12-19 | Henrik Grubbström (Grubba) | | fi
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | | #
# Defaults for cdebug and rtldebug here:
#
if test "x$with_cdebug" = x ; then
with_cdebug=yes
fi
if test "x$with_rtldebug" = x ; then
|
88b268 | 2000-12-17 | Henrik Grubbström (Grubba) | | with_rtldebug=no
# with_rtldebug=yes
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | | fi
if test "x$with_rtldebug" = xyes ; then
|
71f3a2 | 1998-11-22 | Fredrik Hübinette (Hubbe) | | AC_DEFINE(PIKE_DEBUG)
|
f6c337 | 1998-09-29 | Henrik Grubbström (Grubba) | | fi
#############################################################################
|
48ae53 | 1996-10-09 | Fredrik Hübinette (Hubbe) | |
|
3e3543 | 2006-09-29 | Henrik Grubbström (Grubba) | | OSFLAGS=""
|
8cf37d | 1997-01-27 | Per Hedbor | | WARN=""
|
8a5cd3 | 2001-06-07 | Fredrik Hübinette (Hubbe) | | OPTIMIZE="${OPTFLAGS-}"
|
8cf37d | 1997-01-27 | Per Hedbor | |
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | AC_ARG_ENABLE(pedantic, MY_DESCR([--enable-pedantic],
|
bd841c | 2002-12-10 | Henrik Grubbström (Grubba) | | [enable -pedantic compilation]))
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | |
|
ca8d59 | 2014-11-09 | Henrik Grubbström (Grubba) | | AC_ARG_ENABLE(werror, MY_DESCR([--enable-werror],
[enable -Werror compilation]))
|
bd841c | 2002-12-10 | Henrik Grubbström (Grubba) | | if test "$cflags_is_set" = "no"; then
|
2901d3 | 1998-08-05 | Fredrik Hübinette (Hubbe) | | if test "x$with_cdebug" = "xno" ; then
CFLAGS=`echo " $CFLAGS " | sed -e 's@ -g @ @g'`
else
:
|
f41e0d | 1999-10-19 | Henrik Grubbström (Grubba) | | fi
|
2901d3 | 1998-08-05 | Fredrik Hübinette (Hubbe) | |
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | if test "x$enable_pedantic" = "xyes"; then
AC_SYS_COMPILER_FLAG(-pedantic,pedantic,WARN)
fi
|
2901d3 | 1998-08-05 | Fredrik Hübinette (Hubbe) | |
|
ca8d59 | 2014-11-09 | Henrik Grubbström (Grubba) | | if test "x$enable_werror" = "xyes"; then
AC_SYS_COMPILER_FLAG(-Werror,error,WARN)
fi
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | if test "x${GCC-}" = xyes ; then
|
2e96cd | 2000-08-12 | Per Hedbor | | # Do not use -Wall, since that produces a lot of warnings that are not
|
3d6e5c | 2000-08-17 | Henrik Grubbström (Grubba) | | # really interresting (such as the warning for if( ... ) ... if(
|
2e96cd | 2000-08-12 | Per Hedbor | | # ... ) .... else
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | AC_SYS_COMPILER_FLAG(-W,W,WARN)
AC_SYS_COMPILER_FLAG(-Wall,Wall,WARN)
AC_SYS_COMPILER_FLAG(-Wno-unused,Wno_unused,WARN)
AC_SYS_COMPILER_FLAG(-Wcomment,Wcomment,WARN)
AC_SYS_COMPILER_FLAG(-Wformat,Wformat,WARN)
|
4ae0da | 2008-12-12 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-Wformat-security,Wformat_security,WARN)
|
524dc3 | 2016-12-11 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-Wimplicit-function-declaration,Wimplicit_function_declaration,CFLAGS)
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | AC_SYS_COMPILER_FLAG(-Wmultichar,Wmultichar,WARN)
|
14d5e6 | 2014-03-15 | Martin Nilsson | | AC_SYS_COMPILER_FLAG(-Wunused-function,Wunused_function,WARN)
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | AC_SYS_COMPILER_FLAG(-Wswitch,Wswitch,WARN)
|
30d7e3 | 2003-12-04 | Per Hedbor | |
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | if test "x$with_copt" != xno; then
# gcc complains that it doesn't support this when compiling
# without optimizations.
AC_SYS_COMPILER_FLAG(-Wuninitialized,Wuninitialized,WARN)
fi
AC_SYS_COMPILER_FLAG(-Wpointer-arith,Wpointer_arith,WARN)
AC_SYS_COMPILER_FLAG(-Wchar-subscripts,Wchar_subscripts,WARN)
AC_SYS_COMPILER_FLAG(-Wno-long-long,Wno_long_long,WARN)
|
9c5a5e | 1997-12-20 | Henrik Grubbström (Grubba) | |
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | if test "x${with_static_linking-}" = "xyes" ; then
AC_SYS_COMPILER_FLAG(-static,link_static,CFLAGS)
else
:
fi
|
a6dd14 | 2017-07-14 | Henrik Grubbström (Grubba) | | # NB: Both $CPP and $CC need to be configured to support
# the same version of the C standard. Otherwise there
# will be build failures on eg Solaris.
|
3a2b52 | 2017-07-19 | Bill Welliver | | AC_SYS_OS_COMPILER_FLAG(Solaris, -std=c99, std_c99, CPP)
AC_SYS_OS_COMPILER_FLAG(Solaris, -std=c99, std_c99, CC)
AC_SYS_COMPILER_FLAG(-std=c99, std_c99, CFLAGS)
|
e7b160 | 2004-01-09 | Henrik Grubbström (Grubba) | | if test "x$with_gcov" = "xyes"; then
# Support for gcov
AC_SYS_COMPILER_FLAG(-fprofile-arcs, fprofile_arcs, CFLAGS)
AC_SYS_COMPILER_FLAG(-ftest-coverage, ftest_coverage, CFLAGS)
else :; fi
|
6d2c67 | 2005-06-23 | Henrik Grubbström (Grubba) | | if test "x$with_cdebug" = "xyes" ; then
|
63b607 | 2014-02-27 | Per Hedbor | | AC_SYS_COMPILER_FLAG(-ggdb,ggdb,CFLAGS)
AC_SYS_COMPILER_FLAG(-fvar-tracking-assignments,vartracking,CFLAGS)
|
6d2c67 | 2005-06-23 | Henrik Grubbström (Grubba) | | fi
|
4b6339 | 2002-12-10 | Mirar (Pontus Hagland) | | ##
## -fomit-frame-pointer does not work with egcs 1.1.1
## /Hubbe 1998-12-20
##
#if test "x$with_cdebug" = "xno" ; then
# AC_SYS_COMPILER_FLAG(-fomit-frame-pointer,fomit_frame_pointer,OPTIMIZE)
#else
# :
|
13670c | 2015-05-25 | Martin Nilsson | | #fi
|
9c5a5e | 1997-12-20 | Henrik Grubbström (Grubba) | |
|
63b607 | 2014-02-27 | Per Hedbor | | AC_SYS_COMPILER_FLAG(-funswitch-loops,unswitch_loops,CFLAGS)
|
8cf37d | 1997-01-27 | Per Hedbor | | ### Optimize for different SUN machines. If there is no working 'uname'
### no extra optimization will be done, but nothing should break either.
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | case "`uname -m 2>/dev/null`" in
sun4c)
|
769d1c | 2001-03-27 | Henrik Grubbström (Grubba) | | # The -msparclite option seems to generate assembler that /bin/as doesn't
|
e65d8d | 1998-07-17 | Henrik Grubbström (Grubba) | | # understand. /grubba 1998-07-17
|
13670c | 2015-05-25 | Martin Nilsson | | # AC_SYS_COMPILER_FLAG(-msparclite,sparclite,CFLAGS)
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ;;
sun4m)
|
7e83af | 2001-03-23 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-mv8,microsparc,CFLAGS)
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ;;
sun4d)
|
7e83af | 2001-03-23 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,CFLAGS)
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ;;
sun4u)
|
7e83af | 2001-03-23 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-mcpu=ultrasparc,mcpu_ultrasparc,CFLAGS,[
AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,CFLAGS)
|
e2172a | 2003-10-03 | Henrik Grubbström (Grubba) | | ],[],[
# Some versions of gcc define __sparcv9 but aren't LP64.
# Definition of __sparcv9 causes <sys/isa_defs.h> to define _LP64,
# which is not a good thing for ILP32 systems...
# Some versions of gcc define __sparc_v9__, which causes the
# fix-included <limits.h> to think the same...
AC_TRY_CPP([#include <limits.h>
#include <sys/types.h>
#if defined(_LP64) || (LONG_MAX != 2147483647L)
#error "We might have a problem."
#endif
],[],[
# We might have a problem...
# Check that we indeed have a LP64 system.
AC_MSG_RESULT([yes, but LP64])
AC_CHECK_SIZEOF(long, 4)
# Note: the result for the following message is provided
# by SYS_COMPILER_FLAG
AC_MSG_CHECKING([are we really an LP64 system])
if test "x$ac_cv_sizeof_long" = "x8"; then
:; #OK, we have an LP64 system!
else
pike_cv_option_mcpu_ultrasparc=no
fi
])
|
d769bf | 2001-03-23 | Henrik Grubbström (Grubba) | | ])
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ;;
|
8326ab | 2013-05-11 | Marcus Comstedt | | sun4v)
AC_SYS_COMPILER_FLAG(-mcpu=niagara,mcpu_niagara,CFLAGS,[
AC_SYS_COMPILER_FLAG(-msupersparc,supersparc,CFLAGS)
],[],[
# Some versions of gcc define __sparcv9 but aren't LP64.
# Definition of __sparcv9 causes <sys/isa_defs.h> to define _LP64,
# which is not a good thing for ILP32 systems...
# Some versions of gcc define __sparc_v9__, which causes the
# fix-included <limits.h> to think the same...
AC_TRY_CPP([#include <limits.h>
#include <sys/types.h>
#if defined(_LP64) || (LONG_MAX != 2147483647L)
#error "We might have a problem."
#endif
],[],[
# We might have a problem...
# Check that we indeed have a LP64 system.
AC_MSG_RESULT([yes, but LP64])
AC_CHECK_SIZEOF(long, 4)
# Note: the result for the following message is provided
# by SYS_COMPILER_FLAG
AC_MSG_CHECKING([are we really an LP64 system])
if test "x$ac_cv_sizeof_long" = "x8"; then
:; #OK, we have an LP64 system!
else
pike_cv_option_mcpu_niagara=no
fi
])
])
;;
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | i586)
|
72bb7c | 2006-07-23 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-mtune=pentium,mtune_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS)
])
|
ecb760 | 2002-08-20 | Henrik Grubbström (Grubba) | | ])
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ;;
i686)
|
72bb7c | 2006-07-23 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS)
])
|
ecb760 | 2002-08-20 | Henrik Grubbström (Grubba) | | ])
|
72bb7c | 2006-07-23 | Martin Stjernholm | | ])
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ])
|
43594f | 2001-09-18 | Fredrik Hübinette (Hubbe) | | # AC_SYS_COMPILER_FLAG(-march=i686,march_i686,CFLAGS)
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | ;;
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | x86_64)
AC_SYS_COMPILER_FLAG(-m64,m64,CFLAGS,[
|
72bb7c | 2006-07-23 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS)
])
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | ])
|
72bb7c | 2006-07-23 | Martin Stjernholm | | ])
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | ])
])
;;
|
2e96cd | 2000-08-12 | Per Hedbor | | i86pc)
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | # Solaris x86
|
13670c | 2015-05-25 | Martin Nilsson | | case "`optisa \`isalist 2>/dev/null\` 2>/dev/null || isalist 2>/dev/null`" in
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | *amd64*)
AC_SYS_COMPILER_FLAG(-m64,m64,CFLAGS,[
|
72bb7c | 2006-07-23 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS)
])
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | ])
|
72bb7c | 2006-07-23 | Martin Stjernholm | | ])
|
46dc32 | 2005-03-17 | Henrik Grubbström (Grubba) | | ])
])
# AC_SYS_COMPILER_FLAG(-march=i686,march_i686,CFLAGS)
;;
|
2e96cd | 2000-08-12 | Per Hedbor | | *pentium_pro*)
|
72bb7c | 2006-07-23 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-mtune=i686,mtune_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=i686,mcpu_i686,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentiumpro,pentiumpro,CFLAGS,[
|
ecb760 | 2002-08-20 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS)
])
])
|
72bb7c | 2006-07-23 | Martin Stjernholm | | ])
|
61fb90 | 2001-03-19 | Mirar (Pontus Hagland) | | ])
|
43594f | 2001-09-18 | Fredrik Hübinette (Hubbe) | | # AC_SYS_COMPILER_FLAG(-march=i686,march_i686,CFLAGS)
|
2e96cd | 2000-08-12 | Per Hedbor | | ;;
*pentium*)
|
72bb7c | 2006-07-23 | Martin Stjernholm | | AC_SYS_COMPILER_FLAG(-mtune=pentium,mtune_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mcpu=pentium,mcpu_pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-mpentium,pentium,CFLAGS,[
AC_SYS_COMPILER_FLAG(-m486,486,CFLAGS)
])
|
ecb760 | 2002-08-20 | Henrik Grubbström (Grubba) | | ])
|
72bb7c | 2006-07-23 | Martin Stjernholm | | ])
|
2e96cd | 2000-08-12 | Per Hedbor | | ;;
esac
|
ec4ee4 | 2008-07-09 | Henrik Grubbström (Grubba) | | ;;
|
ce0967 | 2008-07-13 | Marcus Comstedt | | ppc64)
case "`uname -p 2>/dev/null`" in
Cell\ Broadband\ Engine*)
AC_SYS_COMPILER_FLAG(-mcpu=cell,mcpu_cell,CFLAGS)
;;
esac
;;
|
50adc3 | 1998-04-17 | Fredrik Hübinette (Hubbe) | | esac
|
b7c2ef | 1999-08-08 | Henrik Grubbström (Grubba) | |
# AIX
DO_IF_OS(AIX,
[
# Tell the linker to generate a large toc if needed
|
9d9fa2 | 2016-02-12 | Martin Nilsson | | AC_SYS_COMPILER_FLAG(-bbigtoc,bbigtoc,LDFLAGS)
AC_SYS_COMPILER_FLAG([-Wl,-bbigtoc],Wlbbigtoc,LDFLAGS)
|
05cd67 | 2000-09-28 | Henrik Grubbström (Grubba) | | ])
|
ce3dcd | 2001-11-02 | Jonas Wallden | | DO_IF_OS(Darwin,
[
# aka MacOS X.
# Foundation framework needed by JavaVM.framework. The OS X 10.1 linker
# no longer includes indirect dependencies so we need to add them here.
AC_SYS_COMPILER_FLAG(-framework Foundation, framework_Foundation, LDFLAGS)
|
9f95ce | 2003-09-22 | Jonas Wallden | | AC_SYS_COMPILER_FLAG(-framework System, framework_System, LDFLAGS)
|
ce3dcd | 2001-11-02 | Jonas Wallden | |
|
d97bbf | 2005-08-27 | Jonas Wallden | | # Needed for MakeDataExecutable which comes from CarbonLib
AC_SYS_COMPILER_FLAG(-framework CoreServices, framework_CoreServices, LDFLAGS)
|
13670c | 2015-05-25 | Martin Nilsson | |
|
ce3dcd | 2001-11-02 | Jonas Wallden | | # -flat_namespace only needed for linking with libMallocDebug
# AC_SYS_COMPILER_FLAG(-flat_namespace, flat_namespace, LDFLAGS)
|
13670c | 2015-05-25 | Martin Nilsson | |
|
0b0ce5 | 2015-07-23 | Jonas Walldén | | # Take care of warning when linking with GMP libraries (not on 64-bit)
if test "x$with_abi" != "x64"; then
AC_SYS_COMPILER_FLAG(-read_only_relocs warning, ro_relocs_warn, LDFLAGS)
fi
|
dbbb57 | 2008-07-09 | Jonas Wallden | |
|
3fcbb9 | 2006-04-10 | Jonas Wallden | | # Tune based on processor family
case "`machine`" in
i486)
# Darwin x86 runs on Intel Core Solo/Duo (based on Pentium M) and newer
|
0b0ce5 | 2015-07-23 | Jonas Walldén | | if test "x$with_abi" != "x64"; then
AC_SYS_COMPILER_FLAG(-march=pentium-m, arch_pentium_m, OPTIMIZE)
AC_SYS_COMPILER_FLAG(-msse3, opt_sse3, OPTIMIZE)
AC_SYS_COMPILER_FLAG(-mfpmath=sse, opt_mfpmath_sse, OPTIMIZE)
fi
|
3fcbb9 | 2006-04-10 | Jonas Wallden | |
|
85a85e | 2006-10-06 | Stefan Wallström | | # no-pic required for machine code to work
AC_SYS_COMPILER_FLAG(-mdynamic-no-pic, dynamicnopic, OSFLAGS)
|
53d62f | 2009-12-09 | Jonas Wallden | |
# Silence warnings about not working on systems older than the base
# version of the current machine. We'll convert e.g. 10.5.8 to 1050.
AC_SYS_COMPILER_FLAG(-DMAC_OS_X_VERSION_MIN_REQUIRED=`sw_vers -productVersion | tr -d . | cut -c -3`0, osxminversion, CFLAGS)
|
3fcbb9 | 2006-04-10 | Jonas Wallden | | ;;
|
dbbb57 | 2008-07-09 | Jonas Wallden | | ppc970|ppc7450|ppc7400)
# Improve performance on G4 and G5. Note that if the build machine
# is a G4 or newer the resulting pike won't run on a G3.
AC_SYS_COMPILER_FLAG(-mcpu=7400, cpu7400, OPTIMIZE)
AC_SYS_COMPILER_FLAG(-mtune=7400, tune7400, OPTIMIZE)
;;
|
3fcbb9 | 2006-04-10 | Jonas Wallden | | *)
# G3 is the baseline on PPC since Mac OS X doesn't support anything
|
dbbb57 | 2008-07-09 | Jonas Wallden | | # older.
|
3fcbb9 | 2006-04-10 | Jonas Wallden | | AC_SYS_COMPILER_FLAG(-mcpu=750, cpu750, OPTIMIZE)
AC_SYS_COMPILER_FLAG(-mtune=750, tune750, OPTIMIZE)
;;
esac
|
ce3dcd | 2001-11-02 | Jonas Wallden | | ])
|
827d13 | 2004-06-21 | Henrik Grubbström (Grubba) | | DO_IF_OS(Linux,
[
|
6cc848 | 2005-06-09 | Henrik Grubbström (Grubba) | | :
# The following segment is obsolete, since executable memory is
# now allocated with mmap instead of with malloc().
# /grubba 2005-06-09
#
# if test "x$with_machine_code" = "xno"; then :; else
# # WORKAROUND: mprotect(PROT_EXEC) doesn't work on Linux/x86.
# # Try to set the stackexec flag on the binary.
# # First try -z execstack (ld).
# AC_SYS_COMPILER_FLAG([-z execstack], z_execstack, LDFLAGS, [
# # No, try passing it directly to the linker.
# AC_SYS_COMPILER_FLAG([-Wl,-z,execstack], Wl_z_execstack, LDFLAGS, [
# # No, try --execstack (gas).
# AC_SYS_COMPILER_FLAG([--execstack], execstack, CFLAGS, [
# # No, try passing it directly to the assembler.
# AC_SYS_COMPILER_FLAG([-Wa,--execstack], Wa_execstack, CFLAGS, [
# # No.
# # FIXME: Add support for use of chstk(1).
# PIKE_MSG_WARN([Could not find any way to enable executable stack.])
# ])
# ])
# ])
# ])
# fi
|
827d13 | 2004-06-21 | Henrik Grubbström (Grubba) | | ])
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | else
|
8cf37d | 1997-01-27 | Per Hedbor | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # Assume system compiler "cc".
|
8334e3 | 1999-01-29 | Fredrik Hübinette (Hubbe) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test "x${with_static_linking-}" = "xyes" ; then
DO_IF_OS(AIX,
[
AC_SYS_COMPILER_FLAG([-Wl,-bstatic],wl_link_static,CFLAGS)
LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -bstatic"
])
|
8334e3 | 1999-01-29 | Fredrik Hübinette (Hubbe) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | DO_IF_OS(OSF1,
[
AC_SYS_COMPILER_FLAG(-non_shared,non_shared,CFLAGS)
LD_FALLBACK_FLAGS="${LD_FALLBACK_FLAGS} -non_shared"
])
|
8334e3 | 1999-01-29 | Fredrik Hübinette (Hubbe) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # how do you link statically on HP-UX ?
else
:
fi
|
8334e3 | 1999-01-29 | Fredrik Hübinette (Hubbe) | |
|
8cf37d | 1997-01-27 | Per Hedbor | | ### Non-gcc thingies. This should probably be enhanced...
|
fde5a6 | 1997-09-05 | Henrik Grubbström (Grubba) | |
|
d4fc87 | 2003-01-16 | David Hedbor | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test "x$with_cdebug" = "xyes" ; then
# FIXME:
# Maybe should remove the -g flag if this succeeds.
AC_SYS_COMPILER_FLAG(-g3,g3,CFLAGS)
AC_SYS_COMPILER_FLAG(-trapuv,trapuv,WARN)
fi
|
6d2c67 | 2005-06-23 | Henrik Grubbström (Grubba) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # Solaris
DO_IF_OS(Solaris,
[
AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE,,[
if test "x$with_abi" = "x64"; then
# -fast implies -xarch=native, which implies 32-bit ABI.
AC_SYS_COMPILER_FLAG(-xtarget=generic64, xtarget_generic64, OPTIMIZE)
AC_SYS_COMPILER_FLAG(-xarch=generic64, xarch_generic64, OPTIMIZE)
fi
# -fast implies -fns, which turns off gradual underflow.
AC_SYS_COMPILER_FLAG(-fns=no, fns_no, OPTIMIZE)
])
AC_SYS_COMPILER_FLAG(-xdepend,xdepend,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-xs,xs,CFLAGS)
# Causes __STDC__ to be 1 which causes several headerfiles to behave
# differently.
# AC_SYS_OS_COMPILER_FLAG(-Xc,Xc,WARN)
|
8ce252 | 2005-06-17 | Henrik Grubbström (Grubba) | | ])
|
d93ff5 | 1997-11-02 | Henrik Grubbström (Grubba) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # AIX
DO_IF_OS(AIX,
[
# This one is needed to get the compiler to fail on errors,
# which is needed for several configure-tests.
AC_SYS_COMPILER_FLAG(-qhalt=e,qhalt_e,CFLAGS)
AC_SYS_COMPILER_FLAG(-qro,qro,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-qfold,qfold,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-qwarn64,qwarn64,WARN)
AC_SYS_COMPILER_FLAG(-qflag=w:w,qflag_w_w,WARN)
AC_DEFUN(AC_SYS_COMPILER_FLAG_QINFO, [
AC_SYS_COMPILER_FLAG(-qinfo=$1,qinfo_$1,WARN)
])
AC_SYS_COMPILER_FLAG_QINFO(cmp)
AC_SYS_COMPILER_FLAG_QINFO(cnd)
AC_SYS_COMPILER_FLAG_QINFO(cns)
AC_SYS_COMPILER_FLAG_QINFO(cnv)
AC_SYS_COMPILER_FLAG_QINFO(dcl)
AC_SYS_COMPILER_FLAG_QINFO(eff)
AC_SYS_COMPILER_FLAG_QINFO(enu)
AC_SYS_COMPILER_FLAG_QINFO(ext)
AC_SYS_COMPILER_FLAG_QINFO(gen)
AC_SYS_COMPILER_FLAG_QINFO(gnr)
AC_SYS_COMPILER_FLAG_QINFO(got)
AC_SYS_COMPILER_FLAG_QINFO(ini)
AC_SYS_COMPILER_FLAG_QINFO(inl)
AC_SYS_COMPILER_FLAG_QINFO(lan)
AC_SYS_COMPILER_FLAG_QINFO(obs)
AC_SYS_COMPILER_FLAG_QINFO(ord)
AC_SYS_COMPILER_FLAG_QINFO(par)
AC_SYS_COMPILER_FLAG_QINFO(por)
# ppc disabled since it complains about the system header files.
# AC_SYS_COMPILER_FLAG_QINFO(ppc)
# ppt disabled since tracing the preprocessor isn't interresting.
# AC_SYS_COMPILER_FLAG_QINFO(ppt)
AC_SYS_COMPILER_FLAG_QINFO(pro)
AC_SYS_COMPILER_FLAG_QINFO(rea)
AC_SYS_COMPILER_FLAG_QINFO(ret)
# trd disabled, since it adds extra errors (in particular 1506-419).
# AC_SYS_COMPILER_FLAG_QINFO(trd)
AC_SYS_COMPILER_FLAG_QINFO(tru)
AC_SYS_COMPILER_FLAG_QINFO(uni)
AC_SYS_COMPILER_FLAG_QINFO(use)
|
13670c | 2015-05-25 | Martin Nilsson | | # AC_SYS_COMPILER_FLAG(-qalias=addr,qalias_addr,OPTIMIZE)
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # AC_SYS_COMPILER_FLAG(-qlibansi,qlibansi,OPTIMIZE)
# Suppress warnings and informational messages we aren't interested in.
AC_DEFUN(AC_SYS_COMPILER_FLAG_QSUPPRESS, [
AC_SYS_COMPILER_FLAG(-qsuppress=$1,
translit([qsuppress_$1],[-:],[__]),
ifelse([$2],,WARN,[$2]))
])
# 1506-010 (W) Macro XX invoked with a null argument for parameter Z.
AC_SYS_COMPILER_FLAG_QSUPPRESS(1506-010)
# 1506-219 (W) #line value 40140 too large.
AC_SYS_COMPILER_FLAG_QSUPPRESS(1506-219, CPPFLAGS)
|
13670c | 2015-05-25 | Martin Nilsson | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # Tell the linker to generate a large toc if needed
|
9d9fa2 | 2016-02-12 | Martin Nilsson | | AC_SYS_COMPILER_FLAG(-bbigtoc,bbigtoc,LDFLAGS)
|
211a01 | 2005-04-07 | Henrik Grubbström (Grubba) | | ])
|
de386f | 1998-08-06 | Henrik Grubbström (Grubba) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # HP-UX
DO_IF_OS(HP-UX,
[
AC_SYS_COMPILER_FLAG(-D__STDC_EXT__,stdc_ext,CFLAGS)
AC_SYS_COMPILER_FLAG([-Wp,-H50000],cpp_buffer_size,CFLAGS)
AC_SYS_COMPILER_FLAG(+ESlit,plus_ESlit,OPTIMIZE)
AC_SYS_COMPILER_FLAG(+Odataprefetch,plus_Odataprefetch,OPTIMIZE)
AC_SYS_COMPILER_FLAG(+Ofailsafe,plus_Ofailsafe,OPTIMIZE)
# Ignore the following warnings if you enable +w1
# 414 Optimization reduced to +O2 for compatibility with Debug.
# 530 Casting from loose to strict alignment
# 558 Empty declaration.
# AC_SYS_COMPILER_FLAG(+w1,plus_w1,WARN)
])
|
fde5a6 | 1997-09-05 | Henrik Grubbström (Grubba) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # OSF/1
DO_IF_OS(OSF1,
[
AC_SYS_COMPILER_FLAG(-fast,fast,OPTIMIZE)
# The need for -ieee is not detected properly by the FPE tests below.
# AC_SYS_COMPILER_FLAG(-ieee,ieee,CFLAGS)
AC_SYS_COMPILER_FLAG(-readonly_strings,readonly_strings,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-assume trusted_short_alignment,
assume_trusted_short_alignment,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-assume aligned_objects,
assume_aligned_objects,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-no_misalign,no_misalign,OPTIMIZE)
|
13670c | 2015-05-25 | Martin Nilsson | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-host,host,OPTIMIZE)
|
13670c | 2015-05-25 | Martin Nilsson | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # Flags that cause errors or change compiler behaviour
# must go in CFLAGS, they can not go in WARN
# /Hubbe
AC_SYS_COMPILER_FLAG(-std1,std1,CFLAGS)
AC_SYS_COMPILER_FLAG(-warnprotos,warnprotos,WARN)
])
|
a89700 | 1997-04-10 | Fredrik Hübinette (Hubbe) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | # Windows NT
DO_IF_OS(Windows_NT,
[
case "x$CC" in
*rntcl*)
if test x$with_debug_crt = xyes; then
dynamic_crt_flag=-MDd
static_crt_flag=-MTd
else
dynamic_crt_flag=-MD
static_crt_flag=-MT
fi
|
fcb79d | 2013-05-23 | Henrik Grubbström (Grubba) | | # We want the full 32-bit address space (not the default 31-bit).
AC_SYS_COMPILER_FLAG(-LARGEADDRESSAWARE,LARGEADDRESSAWARE,LDFLAGS)
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ;;
esac
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test x$with_dynamic_modules != xno; then
pike_cv_sys_dynamic_loading=yes
|
46bd60 | 2006-08-05 | Martin Stjernholm | | fi
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ])
|
a747c4 | 2000-05-01 | Henrik Grubbström (Grubba) | |
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | dnl
dnl This does not work with Digital UNIX cc/ld (cc thinks it is ok, ld does not)
|
13670c | 2015-05-25 | Martin Nilsson | | dnl
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | dnl AC_SYS_COMPILER_FLAG(-native,native,OPTIMIZE)
dnl
dnl ### Ok. This is for apcc...
case "$CC" in
*apcc)
AC_SYS_COMPILER_FLAG(-XO=5,apcc_opt,OPTIMIZE)
AC_SYS_COMPILER_FLAG(-Xcallmod=2,apcc_opt_2,OPTIMIZE)
;;
esac
|
8cf37d | 1997-01-27 | Per Hedbor | |
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | # Old cc for solaris.
# AC_SYS_CPU_COMPILER_FLAG(sun4m,-Xpipe=micro,microsparc,OPTIMIZE)
# AC_SYS_CPU_COMPILER_FLAG(sun4d,-Xpipe=super,supersparc,OPTIMIZE)
# AC_SYS_CPU_COMPILER_FLAG(sun4u,-Xpipe=super,ultrasparc,OPTIMIZE)
|
8cf37d | 1997-01-27 | Per Hedbor | |
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | case "${CFLAGS-} $OPTIMIZE" in
*-O*) ;;
*+O*) ;;
*-fast*) ;;
*)
case "$pike_cv_sys_os:$GCC" in
UnixWare*:no|OpenUNIX*:no)
;;
*)
;;
esac
;;
esac
fi
if test "$ICC" = "yes"; then
# icc or ecc.
# Modern versions of icc and ecc claim to be gcc, so we need to have
# this outside the main if-else segment.
DO_IF_OS(Linux,
[
# Linux with Intel C++
# Disable excessive warnings from Linux's header files:
# warning #1292: attribute "__nothrow__" ignored
AC_SYS_COMPILER_FLAG(-wd1292,wd1292,WARN)
# And from Pike:
# remark #177: function "MKPCHARP" was declared but never referenced
AC_SYS_COMPILER_FLAG(-wd177,wd177,WARN)
# remark #279: controlling expression is constant
AC_SYS_COMPILER_FLAG(-wd279,wd279,WARN)
|
b50a59 | 2004-12-16 | Henrik Grubbström (Grubba) | | # remark #869: parameter was never referenced
AC_SYS_COMPILER_FLAG(-wd869,wd869,WARN)
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | |
AC_SYS_COMPILER_FLAG(-Ob2,Ob2,OPTIMIZE)
|
9d6188 | 2006-03-25 | Henrik Grubbström (Grubba) | | AC_SYS_COMPILER_FLAG(-ip,ip,OPTIMIZE)
# Iterprocedural optimization accross object files.
# This slows down the compiler quite a bit with Pike's
# large number of object files.
# AC_SYS_COMPILER_FLAG(-ipo,ipo,OPTIMIZE)
# AC_SYS_COMPILER_FLAG(-ipo,ipo,EXTRALDFLAGS)
# AC_SYS_COMPILER_FLAG(-ipo_obj,ipo_obj,OPTIMIZE)
|
e08b48 | 2006-04-07 | Henrik Grubbström (Grubba) | | # -parallel seems to generate broken code with icc 8.0/ia64.
# AC_SYS_COMPILER_FLAG(-parallel, parallel,OPTIMIZE)
# AC_SYS_COMPILER_FLAG(-parallel, parallel,LDFLAGS)
|
921164 | 2004-12-16 | Henrik Grubbström (Grubba) | | # arch dependent optimizations while maintaining
# i386 compatibility
AC_SYS_COMPILER_FLAG(-axKW,axKW,OPTIMIZE)
])
fi
|
c74478 | 2001-06-29 | Henrik Grubbström (Grubba) | | else
# CFLAGS has already been set by the user.
# Avoid adding anything that isn't essential.
DO_IF_OS(AIX,
[
# This one is needed to get the compiler to fail on errors,
# which is needed for several configure-tests.
AC_SYS_COMPILER_FLAG(-qhalt=e,qhalt_e,CFLAGS)
])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | fi
|
10fadb | 2017-06-11 | Henrik Grubbström (Grubba) | | # Define various *_SOURCE macros to enable later POSIX versions, etc.
# NB: As these affect the visibility/availability of symbols these
# must be defined before other probes.
PIKE_USE_SYSTEM_EXTENSIONS
|
3fb877 | 2011-05-16 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([crc32 intrinsics])
AC_CACHE_VAL(pike_cv_sys_have_crc_intrinsics,[
AC_TRY_LINK([
__attribute__((target("sse4"))) int c(int a) {
return __builtin_ia32_crc32si(0,a);
}],[
return c(0);
],
[pike_cv_sys_have_crc_intrinsics=yes],
[pike_cv_sys_have_crc_intrinsics=no])
])
AC_MSG_RESULT($pike_cv_sys_have_crc_intrinsics)
if test "x$pike_cv_sys_have_crc_intrinsics" = "xyes" ; then
AC_DEFINE(HAVE_CRC32_INTRINSICS,[], [True if crc32 intrinsics are available])
fi
|
d47659 | 2013-06-12 | Arne Goedeke | | # test for several buildins
define(TEST_BUILTIN, [
AC_MSG_CHECKING(for $1)
|
0c7580 | 2015-04-13 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(translit([pike_cv_builtin_$1], [A-Z], [a-z]), [
|
a91d7c | 2013-08-14 | Marcus Comstedt | | AC_TRY_LINK([
|
d47659 | 2013-06-12 | Arne Goedeke | | $3
|
a91d7c | 2013-08-14 | Marcus Comstedt | | ],[
|
d47659 | 2013-06-12 | Arne Goedeke | | unsigned long lint;
|
44b4c0 | 2013-11-02 | Per Hedbor | | volatile int foo = 0;
foo = (int)$1($2);
return 0;
],
|
0c7580 | 2015-04-13 | Henrik Grubbström (Grubba) | | translit([pike_cv_builtin_$1], [A-Z], [a-z])="yes",
translit([pike_cv_builtin_$1], [A-Z], [a-z])="no")
])
|
3ebc8a | 2015-08-01 | Martin Nilsson | | AC_MSG_RESULT($translit([pike_cv_builtin_$1], [A-Z], [a-z]))
if test "$translit([pike_cv_builtin_$1], [A-Z], [a-z])" = "yes"; then
|
0c7580 | 2015-04-13 | Henrik Grubbström (Grubba) | | AC_DEFINE(translit([HAS_$1], [a-z], [A-Z]), 1, [Whether $1 is available])
fi
|
d47659 | 2013-06-12 | Arne Goedeke | | ])
|
c26a3f | 2014-02-25 | Per Hedbor | |
define(TEST_BUILTIN_VOID, [
AC_MSG_CHECKING(for $1)
|
0c7580 | 2015-04-13 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(translit([pike_cv_builtin_$1], [A-Z], [a-z]), [
|
c26a3f | 2014-02-25 | Per Hedbor | | AC_TRY_LINK([
$3
],[
unsigned long lint;
$1($2);
return 0;
],
|
0c7580 | 2015-04-13 | Henrik Grubbström (Grubba) | | translit([pike_cv_builtin_$1], [A-Z], [a-z])="yes",
translit([pike_cv_builtin_$1], [A-Z], [a-z])="no")
])
|
3ebc8a | 2015-08-01 | Martin Nilsson | | AC_MSG_RESULT($translit([pike_cv_builtin_$1], [A-Z], [a-z]))
if test "$translit([pike_cv_builtin_$1], [A-Z], [a-z])" = "yes"; then
|
0c7580 | 2015-04-13 | Henrik Grubbström (Grubba) | | AC_DEFINE(translit([HAS_$1], [a-z], [A-Z]), 1, [Whether $1 is available])
fi
|
c26a3f | 2014-02-25 | Per Hedbor | | ])
# RDRND hardware random support
AC_SYS_COMPILER_FLAG(-mrdrnd, opt_rdrnd, OPTIMIZE)
|
ac2e26 | 2016-03-19 | Martin Nilsson | | TEST_BUILTIN(__builtin_ia32_rdrand64_step,[&foo])
|
c26a3f | 2014-02-25 | Per Hedbor | |
TEST_BUILTIN_VOID(__builtin_unreachable,[])
|
e0dfd0 | 2016-11-08 | Arne Goedeke | | TEST_BUILTIN_VOID(__builtin_assume,[])
|
7666f8 | 2014-06-19 | Per Hedbor | | TEST_BUILTIN(__builtin_memset, [&foo,0,0])
|
b22fe2 | 2017-04-18 | Henrik Grubbström (Grubba) | | TEST_BUILTIN(__builtin_constant_p, 23)
|
d47659 | 2013-06-12 | Arne Goedeke | | TEST_BUILTIN(__builtin_clz, 23)
TEST_BUILTIN(__builtin_clzl, 23)
TEST_BUILTIN(__builtin_clzll, 23)
TEST_BUILTIN(__builtin_ctz, 23)
TEST_BUILTIN(__builtin_ctzl, 23)
TEST_BUILTIN(__builtin_ctzll, 23)
TEST_BUILTIN(__builtin_bswap32, 23)
TEST_BUILTIN(__builtin_bswap64, 23)
|
44b4c0 | 2013-11-02 | Per Hedbor | | TEST_BUILTIN(__builtin_expect, [foo,0])
|
d47659 | 2013-06-12 | Arne Goedeke | | # ICC builtins
TEST_BUILTIN(_bswap, 23)
TEST_BUILTIN(_bswap64, 23)
TEST_BUILTIN(_bit_scan_reverse, 23)
TEST_BUILTIN(_bit_scan_forward, 23)
# Visual Studio builtins
TEST_BUILTIN(_BitScanForward, [&lint, 23], [
#include <intrin.h>
])
TEST_BUILTIN(_BitScanForward64, [&lint, 23], [
#include <intrin.h>
])
TEST_BUILTIN(_BitScanReverse, [&lint, 23], [
#include <intrin.h>
])
TEST_BUILTIN(_BitScanReverse64, [&lint, 23], [
#include <intrin.h>
])
TEST_BUILTIN(_byteswap_ulong, 23, [
#include <stdlib.h>
])
TEST_BUILTIN(_byteswap_uint64, 23, [
#include <stdlib.h>
])
# IBM C builtins
TEST_BUILTIN(__cntlz4, 23)
TEST_BUILTIN(__cntlz8, 23)
TEST_BUILTIN(__cnttz4, 23)
TEST_BUILTIN(__cnttz8, 23)
|
bcb538 | 2001-08-23 | Boyd Lynn Gerber | | #############################################################################
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | # Script to translate from POSIX paths to native paths.
echo "Creating posix_to_native.sh..."
if test "x$PIKE_PATH_TRANSLATE" = "x"; then
if test "x$pike_cv_is_mingw" = "xyes"; then
# MinGW system.
cat <<\EOF
#!/bin/sh
|
e8789b | 2013-06-12 | Martin Nilsson | | # Automatically generated.
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | # MinGW-version. Do NOT edit.
posix_name="`cat`"
posix_prefix="/"
native_prefix="/"
case "$posix_name" in
/*) ;;
*) posix_name="`pwd`/$posix_name" ;;
esac
case "$posix_name" in
EOF
|
299f92 | 2005-01-10 | Henrik Grubbström (Grubba) | | # Split and recombine the lines.
# Sort the lines according to longest path first.
# Convert backslashes to forward slashes.
# Escape spaces, tabs and dollars.
# Note, dollars must be escaped both for sed, sh and sed.
# Split, and generate the case entries.
# Remove any duplicate sequences of slashes.
mount | \
sed -e 's/\(.*\) on \(.*\) type user.*/\2 _split_ \1/p' -ed | \
sort -r | \
|
b70407 | 2005-01-06 | Henrik Grubbström (Grubba) | | sed -e 's/\\/\//g' | \
|
72e9c1 | 2005-01-10 | Henrik Grubbström (Grubba) | | sed -e 's/\([[ ]]\)/\\\1/g' -e 's/\$/\\\\\\\$/g' | \
|
299f92 | 2005-01-10 | Henrik Grubbström (Grubba) | | sed -e 's/\(.*\)\\ _split_\\ \(.*\)/ \1|\1\/*)\
posix_prefix=\1\
native_prefix=\2\/\
|
378a13 | 2005-01-07 | Henrik Grubbström (Grubba) | | \;\;/p' -ed | \
sed -e 's/\/\//\//g'
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | cat <<\EOF
esac
|
95bdda | 2005-01-07 | Henrik Grubbström (Grubba) | | echo "$posix_name" | \
sed -e "s,^$posix_prefix,$native_prefix," | \
sed -e 's/\/\//\//g'
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | EOF
else
# Native POSIX system.
cat <<\EOF
#!/bin/sh
|
e8789b | 2013-06-12 | Martin Nilsson | | # Automatically generated.
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | # POSIX-version. Do NOT edit.
cat
EOF
fi
else
# rntcl-style
cat <<\EOF
#!/bin/sh
|
e8789b | 2013-06-12 | Martin Nilsson | | # Automatically generated.
|
9fee57 | 2005-01-06 | Henrik Grubbström (Grubba) | | # RNTCL-version. Do NOT edit.
sed -e "$PIKE_PATH_TRANSLATE"
EOF
fi >posix_to_native.sh
chmod a+x posix_to_native.sh
#############################################################################
|
2565f4 | 1997-02-26 | Fredrik Hübinette (Hubbe) | | if test ! -d modules/. ; then
|
cb728c | 1997-01-12 | Henrik Grubbström (Grubba) | | mkdir modules
fi
|
c0911b | 1997-10-03 | Henrik Grubbström (Grubba) | |
#############################################################################
## Search for some popular places where libraries may be hidden.
#############################################################################
|
abb3c9 | 2006-07-23 | Martin Nilsson | | if test "x$pike_cv_sys_os$pike_cv_is_mingw" != xWindows_NT ; then
|
a12f27 | 1998-01-10 | Fredrik Hübinette (Hubbe) | |
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | echo Searching for library and include directories...
#Don't add include dirs if they give us warnings...
OLD_ac_c_preproc_warn_flag="$ac_c_preproc_warn_flag"
ac_c_preproc_warn_flag=yes
|
455006 | 2005-06-18 | Henrik Grubbström (Grubba) | | AC_TRY_CPP([#include <stdio.h>], , [
AC_MSG_WARN([Turning on preprocessor warnings causes cpp test to fail.])
ac_c_preproc_warn_flag="$OLD_ac_c_preproc_warn_flag"
])
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | |
|
1d9406 | 2006-01-09 | Henrik Grubbström (Grubba) | | PIKE_INIT_REAL_DIRS
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | |
|
e12c22 | 2006-08-10 | Henrik Grubbström (Grubba) | | if test "x$with_lib_path" = "x"; then
|
147e53 | 2009-10-19 | Marcus Comstedt | | : # Actual code for this case appears later...
|
e12c22 | 2006-08-10 | Henrik Grubbström (Grubba) | | else
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | for dd in `echo $with_lib_path | sed -e 's/:/ /g'`; do
|
30f279 | 2002-11-22 | Henrik Grubbström (Grubba) | | if test "$dd" = "/lib"; then continue; fi
if test "$dd" = "/usr/lib"; then continue; fi
|
226a72 | 2006-01-05 | Henrik Grubbström (Grubba) | | for suff in $pike_cv_abi_suffixes; do
|
c4b41d | 2002-04-06 | Henrik Grubbström (Grubba) | | d="$dd$suff"
|
1d9406 | 2006-01-09 | Henrik Grubbström (Grubba) | | PIKE_CHECK_ABI_LIB_DIR($d)
|
c4b41d | 2002-04-06 | Henrik Grubbström (Grubba) | | done
|
c0911b | 1997-10-03 | Henrik Grubbström (Grubba) | | done
fi
|
c67b69 | 1996-11-16 | Fredrik Hübinette (Hubbe) | |
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | if test "x$with_include_path" = "x"; then :; else
for d in `echo $with_include_path | sed -e 's/:/ /g'`; do
if test "$d" = "/lib/include"; then continue; fi
if test "$d" = "/usr/lib/include"; then continue; fi
AC_MSG_CHECKING($d)
if test -d "$d/." ; then
real_dir=`cd "$d/." && /bin/pwd 2>/dev/null`
if test "x$real_dir" = "x"; then
real_dir="UNKNOWN"
else
case " $real_incs " in
*\ $real_dir\ *)
AC_MSG_RESULT(already checked)
continue
;;
esac
real_incs="$real_incs $real_dir"
fi
case " $CPPFLAGS " in
*\ -I$d\ * | *\ -I$real_dir\ *)
AC_MSG_RESULT(already added)
;;
*)
OLD_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I$d"
AC_TRY_CPP([#include <stdio.h>], [
AC_MSG_RESULT(added)
], [
AC_MSG_RESULT(fails)
CPPFLAGS="${OLD_CPPFLAGS}"
])
;;
esac
else
AC_MSG_RESULT(no)
fi
done
fi
|
8ec31a | 2005-11-07 | Henrik Grubbström (Grubba) | | primary_path=""
fallback_path=""
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | if test $ldflags_is_set = yes -a $cppflags_is_set = yes ; then :; else
for dd in \
`echo "${with_site_prefixes}"|sed -e 's/:/ /g'` \
`echo $exec_prefix | sed "s@^NONE@$prefix@g" | sed "s@^NONE@$with_root$ac_default_prefix@g"` \
|
3c6083 | 2010-02-16 | Henrik Grubbström (Grubba) | | $with_root/usr \
|
53ccb7 | 2015-06-15 | Martin Karlgren | | $with_root/usr/local $with_root/sw/local $with_root/sw $with_root/opt/local \
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | $with_root/usr/gnu $with_root/opt/gnu $with_root/sw/gnu \
$with_root/usr/freeware $with_root/usr/pkg \
`echo $with_root/opt/gnome* | sort -r` \
|
c86f93 | 2009-10-19 | Marcus Comstedt | | `echo $with_root/usr/X* | sort -r` \
$with_root/usr/sfw $with_root/opt/sfw $with_root/opt/csw \
$with_root/usr/ccs
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | do
if test "$dd" = "/"; then continue; fi
|
3c6083 | 2010-02-16 | Henrik Grubbström (Grubba) | | #if test "$dd" = "/usr"; then continue; fi
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING($dd)
if test -d "$dd/."; then :; else
AC_MSG_RESULT(no)
continue
fi
real_dir=`cd "$dd/." && /bin/pwd 2>/dev/null`
if test "x$real_dir" = "x"; then
AC_MSG_RESULT(ok but pwd failed)
else case " $real_dirs " in
*\ $real_dir\ *)
AC_MSG_RESULT(already checked)
continue
;;
esac
AC_MSG_RESULT(ok)
real_dirs="$real_dirs $real_dir"
fi
libs_found=""
if test $ldflags_is_set = yes ; then :; else
|
e3100f | 2006-01-13 | Henrik Grubbström (Grubba) | | for suff in $pike_cv_abi_suffixes; do
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | d="$dd/lib$suff"
|
1d9406 | 2006-01-09 | Henrik Grubbström (Grubba) | | PIKE_CHECK_ABI_LIB_DIR($d, [libs_found="yes"], [
if test "x$libs_found" = "x"; then
libs_found="no"
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | fi
|
1d9406 | 2006-01-09 | Henrik Grubbström (Grubba) | | ], [libs_found="yes"])
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | done
fi
|
8ec31a | 2005-11-07 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING($dd/bin)
if test -d "$dd/bin/."; then
if test "x$libs_found" = "xno"; then
AC_MSG_RESULT(yes - use as fallback)
if test "x$fallback_path" = "x"; then
fallback_path="$dd/bin"
else
fallback_path="$fallback_path:$dd/bin"
fi
else
AC_MSG_RESULT(yes)
if test "x$primary_path" = "x"; then
primary_path="$dd/bin"
else
primary_path="$primary_path:$dd/bin"
fi
fi
else
AC_MSG_RESULT(no)
fi
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | if test $cppflags_is_set = no -a "x$C_INCLUDE_PATH" = "x"; then
d="$dd/include"
AC_MSG_CHECKING($d)
if test "x$libs_found" = "xno"; then
# Don't add includes that correspond to libraries for the wrong ABI.
AC_MSG_RESULT(skipped - bad libraries)
continue
fi
if test -d "$d/." ; then
real_dir=`cd "$d/." && /bin/pwd 2>/dev/null`
if test "x$real_dir" = "x"; then
real_dir="UNKNOWN"
else
case " $real_incs " in
*\ $real_dir\ *)
AC_MSG_RESULT(already checked)
continue
;;
esac
real_incs="$real_incs $real_dir"
fi
case " $CPPFLAGS " in
*\ -I$d\ * | *\ -I$real_dir\ *)
AC_MSG_RESULT(already added)
;;
*)
OLD_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I$d"
AC_TRY_CPP([#include <stdio.h>], [
AC_MSG_RESULT(added)
], [
AC_MSG_RESULT(fails)
CPPFLAGS="${OLD_CPPFLAGS}"
])
;;
esac
else
AC_MSG_RESULT(no)
fi
fi
done
fi
|
8ec31a | 2005-11-07 | Henrik Grubbström (Grubba) | | if test "x$primary_path" = "x"; then
EXTRA_PATH="$fallback_path"
elif test "x$fallback_path" = "x"; then
EXTRA_PATH="$primary_path"
else
EXTRA_PATH="$primary_path:$fallback_path"
fi
export EXTRA_PATH
|
8f53bd | 2005-06-15 | Henrik Grubbström (Grubba) | | #Restore preprocessor warning sensitivity
ac_c_preproc_warn_flag="$OLD_ac_c_preproc_warn_flag"
|
147e53 | 2009-10-19 | Marcus Comstedt | | if test "x$with_lib_path" = "x"; then
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test "x$with_dynamic_modules" = "xno"; then
:;
elif test "x$GCC" = "xno"; then :; else
# Extract the default library paths from gcc,
# so that we can pass them along to ld later on.
for dd in `$CC -print-search-dirs 2>/dev/null | sed -e '/^libraries:/s/^[[^=]]*=//p' -ed | sed -e 's/\/:/ /g' -e 's/:/ /g' -e 's/\/$//'` /lib; do
if test -d "$dd"; then :; else continue; fi
# Normalize the paths.
dd=`cd "$dd" && pwd`
if test "$dd" = "/lib"; then continue; fi
if test "$dd" = "/usr/lib"; then continue; fi
for suff in $pike_cv_abi_suffixes; do
d="$dd$suff"
PIKE_CHECK_ABI_DIR($d, [
AC_MSG_CHECKING([if we need to add -L$real_dir to LDFLAGS])
case " $LDFLAGS " in
*\ -L$d\ *)
AC_MSG_RESULT([no - already added])
;;
*\ -L$real_dir\ *)
AC_MSG_RESULT([no - already added])
;;
*)
LDFLAGS="$LDFLAGS -L$real_dir"
AC_MSG_RESULT([yes - added])
;;
esac
AC_MSG_CHECKING([if we need to add -R$real_dir to LDFLAGS])
case " $LDFLAGS " in
*\ -R$d\ *)
AC_MSG_RESULT([no - already added])
;;
*\ -R$real_dir\ *)
AC_MSG_RESULT([no - already added])
;;
*)
if test "x$abi_dir_dynamic" = "xyes"; then
LDFLAGS="$LDFLAGS -R$real_dir"
|
147e53 | 2009-10-19 | Marcus Comstedt | | AC_MSG_RESULT([yes - added])
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | else
AC_MSG_RESULT([no - does not contain dynamic objects])
fi
;;
esac
])
|
147e53 | 2009-10-19 | Marcus Comstedt | | done
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | done
|
147e53 | 2009-10-19 | Marcus Comstedt | | fi
fi
|
a12f27 | 1998-01-10 | Fredrik Hübinette (Hubbe) | | else
|
abb3c9 | 2006-07-23 | Martin Nilsson | | # We are running NT without MinGW
|
ed616b | 2003-02-08 | Martin Stjernholm | | :
|
a12f27 | 1998-01-10 | Fredrik Hübinette (Hubbe) | | fi
|
ed616b | 2003-02-08 | Martin Stjernholm | | # During the configure tests we need some extra includes that
# shouldn't be there in the final version.
CONF_CPPFLAGS_EXTRA="-I$srcdir -I`pwd`"
|
13670c | 2015-05-25 | Martin Nilsson | | CPPFLAGS="${CPPFLAGS} ${CONF_CPPFLAGS_EXTRA}"
|
ed616b | 2003-02-08 | Martin Stjernholm | |
|
bcf272 | 2009-09-24 | Henrik Grubbström (Grubba) | | # We want to know if we ought to append any abi indicator to the libdir.
|
2ea193 | 2009-09-26 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if an abi indicator would be appropriate for libdir)
|
bcf272 | 2009-09-24 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_lib_abi, [
pike_cv_lib_abi=""
for dd in "$with_root/lib" "$with_root/usr/lib" "$prefix/lib"; do
for d in $pike_cv_abi_suffixes; do
if test "x$d" = "x/."; then :;
elif test -d "$dd$d/."; then
pike_cv_lib_abi="$d"
break
fi
done
done
])
AC_MSG_RESULT($pike_cv_lib_abi)
|
2ea193 | 2009-09-26 | Henrik Grubbström (Grubba) | |
AC_MSG_CHECKING(what libdir should be set to)
if test "x$pike_cv_lib_abi" = "x"; then :;
elif test -d `eval echo "$libdir$pike_cv_lib_abi/."` -o \
"x$libdir" = 'x${exec_prefix}/lib'; then
libdir="$libdir$pike_cv_lib_abi"
fi
AC_MSG_RESULT($libdir)
|
bcf272 | 2009-09-24 | Henrik Grubbström (Grubba) | |
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
bf622c | 1997-09-19 | Henrik Grubbström (Grubba) | | ## At this point we have at last initialized the compiler!
#############################################################################
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | | if test ! -f confdefs.h ; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([Warning, lost confdefs.h, testing will be flawed!!
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | | You might need to use bash instead of /bin/sh to get correct results.
To do this, please type the following at an sh prompt:
\$ rm ./config.cache
\$ CONFIG_SHELL=/path/to/bash
\$ export CONFIG_SHELL
|
0a8698 | 2003-11-07 | Martin Stjernholm | | \$ $CONFIG_SHELL ./configure])
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | | fi
#############################################################################
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | AC_MSG_CHECKING(ansi prototype capability)
AC_CACHE_VAL(pike_cv_sys_ansi_prototypes,
[
AC_TRY_COMPILE([int foo(int bar);],[],
[pike_cv_sys_ansi_prototypes=yes],
[pike_cv_sys_ansi_prototypes=no])
])
|
1acce8 | 2001-01-27 | Martin Stjernholm | |
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | if test "$pike_cv_sys_ansi_prototypes" = "yes"; then
AC_MSG_RESULT(yes)
else
|
518cc0 | 2002-09-10 | Marcus Comstedt | | AC_MSG_RESULT([no, giving up...])
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | exit 1
|
1acce8 | 2001-01-27 | Martin Stjernholm | | fi
|
992568 | 1996-10-11 | Fredrik Hübinette (Hubbe) | |
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
c7f271 | 2007-06-09 | Martin Stjernholm | | AC_MSG_CHECKING(how to concatenate two symbols)
AC_CACHE_VAL(pike_cv_cpp_symbol_concat, [
AC_TRY_COMPILE([
int AABB=0;
#define CONCAT(X,Y) X##Y
], [
return CONCAT(AA,BB);
], pike_cv_cpp_symbol_concat=ANSI, [
AC_TRY_COMPILE([
int AABB=0;
#define CONCAT(X,Y) X/**/Y
], [
return CONCAT(AA,BB);
], pike_cv_cpp_symbol_concat=KR, [
pike_cv_cpp_symbol_concat=Unknown
])
])
])
AC_MSG_RESULT($pike_cv_cpp_symbol_concat)
case "$pike_cv_cpp_symbol_concat" in
"ANSI")
AC_DEFINE(HAVE_ANSI_CONCAT)
;;
"KR")
AC_DEFINE(HAVE_KR_CONCAT)
;;
esac
#############################################################################
|
7ac9c1 | 1998-12-03 | Henrik Grubbström (Grubba) | | # The AC_PROG_INSTALL test is broken if $INSTALL is specified by hand.
# The FreeBSD ports system does this...
# Workaround:
if test "x$INSTALL" = "x"; then :; else
# $INSTALL overrides ac_cv_path_install anyway...
ac_cv_path_install="$INSTALL"
fi
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_PROG_INSTALL
AC_PROG_CPP
AC_PROG_RANLIB
|
02c964 | 2000-12-18 | Fredrik Hübinette (Hubbe) | | if test "x${AR-}" = x ; then
AC_PATH_PROG(AR, ar, ar, $PATH:$EXTRA_PATH)
export AR
fi
|
6fa228 | 1997-11-04 | Henrik Grubbström (Grubba) | | AC_SUBST(AR)
|
97c8ba | 2004-10-20 | Henrik Grubbström (Grubba) | | if test "x${RNTANY-}" = x ; then
|
d56ff3 | 2006-08-04 | Martin Stjernholm | | AC_PATH_PROG(RNTANY, rntany, , $PATH:$EXTRA_PATH)
|
97c8ba | 2004-10-20 | Henrik Grubbström (Grubba) | | export RNTANY
fi
AC_SUBST(RNTANY)
# Wix compiler
if test "x${CANDLE-}" = x ; then
|
d56ff3 | 2006-08-04 | Martin Stjernholm | | PIKE_NT_PROG(CANDLE, candle, , $PATH:$EXTRA_PATH)
|
97c8ba | 2004-10-20 | Henrik Grubbström (Grubba) | | export CANDLE
fi
AC_SUBST(CANDLE)
# Wix linker
if test "x${LIGHT-}" = x ; then
|
d56ff3 | 2006-08-04 | Martin Stjernholm | | PIKE_NT_PROG(LIGHT, light, , $PATH:$EXTRA_PATH)
|
97c8ba | 2004-10-20 | Henrik Grubbström (Grubba) | | export LIGHT
fi
AC_SUBST(LIGHT)
|
2f9141 | 2004-11-01 | Henrik Grubbström (Grubba) | | # Wix tool
|
459282 | 2011-04-09 | Martin Stjernholm | | # This one doesn't exist any more in WiX 3.x.
#if test "x${TALLOW-}" = x ; then
# PIKE_NT_PROG(TALLOW, tallow, , $PATH:$EXTRA_PATH)
# export TALLOW
#fi
#AC_SUBST(TALLOW)
|
2f9141 | 2004-11-01 | Henrik Grubbström (Grubba) | |
|
d17515 | 2006-08-02 | Martin Stjernholm | | # VC8 manifest tool
if test "x${MTEXE-}" = x ; then
|
d56ff3 | 2006-08-04 | Martin Stjernholm | | PIKE_NT_PROG(MTEXE, mt.exe, , $PATH:$EXTRA_PATH)
|
d17515 | 2006-08-02 | Martin Stjernholm | | export MTEXE
fi
|
d56ff3 | 2006-08-04 | Martin Stjernholm | | # Resource compiler
if test "x${RCEXE-}" = x ; then
PIKE_NT_PROG(RCEXE, rc.exe, , $PATH:$EXTRA_PATH)
export RCEXE
fi
AC_SUBST(RCEXE)
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
9fe0a0 | 1997-08-16 | Henrik Grubbström (Grubba) | | # installbsd seems to be broken on some versions of AIX
#
# /grubba 1997-08-16
case "$ac_cv_path_install" in
*installbsd*)
AC_MSG_CHECKING(if $ac_cv_path_install works)
AC_CACHE_VAL(pike_cv_install_works,
[
if $ac_cv_path_install "$srcdir/configure.in" ./conftest >/dev/null 2>&1
then
if cmp "$srcdir/configure.in" ./conftest >/dev/null 2>&1; then
pike_cv_install_works=yes;
else
pike_cv_install_works=no;
fi
else
pike_cv_install_works=no;
fi
if test -f ./conftest; then
rm -f ./conftest
fi
])
AC_MSG_RESULT($pike_cv_install_works)
if test "$pike_cv_install_works" = "no"; then
echo "Warning: Falling back to $ac_install_sh"
INSTALL="$ac_install_sh"
fi
;;
esac
#############################################################################
|
bfd5a5 | 2001-02-17 | Henrik Grubbström (Grubba) | |
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(for yacc clone that handles %pure_parser)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_prog_working_yacc,
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | [
|
fec03b | 2017-07-08 | Henrik Grubbström (Grubba) | | for YACC in pyacc "byacc -s" "bison -y" yacc "None"; do
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | set dummy $YACC; ac_word=$2
has_it=no
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
has_it="yes"
break
|
8f4288 | 1996-03-01 | Fredrik Hübinette (Hubbe) | | fi
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | done
IFS="$ac_save_ifs"
|
13670c | 2015-05-25 | Martin Nilsson | |
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | if test "$has_it" = "yes"; then
cat >conftest.y<<\EOF
%pure_parser
%{
void parse();
void yyerror(char *);
%}
%%
all: foo bar
foo: 'f' 'o' 'o' { parse(); } ;
bar: 'b' 'a' 'r' ;
%%
int context;
|
8f4288 | 1996-03-01 | Fredrik Hübinette (Hubbe) | |
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | int yylex(YYSTYPE *yylval)
{
switch(context++)
{
case 0: return 'f';
case 1: return 'o';
case 2: return 'o';
case 3: return 'b';
case 4: return 'a';
case 5: return 'r';
default: return 0;
}
}
int depth=0;
void parse()
{
int tmp;
if(depth++>5) return;
tmp=context;
context=0;
yyparse();
context=tmp;
}
int errors=0;
void yyerror(char *fel) { errors++; }
int main()
{
parse();
exit(errors);
}
EOF
|
9edb20 | 2004-03-10 | Henrik Grubbström (Grubba) | | if $YACC -d conftest.y 1>&AC_FD_CC 2>&AC_FD_CC; then
|
1acce8 | 2001-01-27 | Martin Stjernholm | | if test "x$enable_binary" = "xno"; then
|
5e6816 | 2005-11-01 | Henrik Grubbström (Grubba) | | rm -f y.tab.*
|
1acce8 | 2001-01-27 | Martin Stjernholm | | break
else
AC_TRY_RUN([
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | #include "y.tab.c"
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | ],pure_parser_works=yes,pure_parser_works=no,pure_parser_works=no)
|
5e6816 | 2005-11-01 | Henrik Grubbström (Grubba) | | rm -f y.tab.*
|
1acce8 | 2001-01-27 | Martin Stjernholm | | if test "$pure_parser_works" = "yes"; then
break
fi
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | fi
|
5e6816 | 2005-11-01 | Henrik Grubbström (Grubba) | | else
rm -f y.tab.*
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | fi
|
8f4288 | 1996-03-01 | Fredrik Hübinette (Hubbe) | | fi
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | done
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | pike_cv_prog_working_yacc="$YACC"
|
26e7e7 | 1996-04-23 | Fredrik Hübinette (Hubbe) | | ])
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | YACC="$pike_cv_prog_working_yacc"
|
4943ca | 1997-04-21 | Fredrik Hübinette (Hubbe) | |
if test "x$YACC" = "xNone" ; then
|
1acce8 | 2001-01-27 | Martin Stjernholm | | AC_MSG_RESULT([Get bison if you want to do "make export"])
|
4943ca | 1997-04-21 | Fredrik Hübinette (Hubbe) | | YACC="bison -y"
else
AC_MSG_RESULT($YACC)
fi
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
417454 | 2001-01-26 | Martin Stjernholm | | #############################################################################
|
42de02 | 2005-10-13 | Martin Stjernholm | | AC_MSG_CHECKING(how bison uses short)
AC_CACHE_VAL(pike_cv_short_use,
[
pike_cv_short_use=unknown
for short_use in CT_SHORT CT_SHORT_INT; do
cat >conftest.y <<EOF
%{
#define $short_use
#ifdef CT_SHORT
#define short int
#else
#define short
#endif
void parse();
void yyerror(char *);
%}
%%
foo: 'f' x y ;
x: 'o' ;
y: 'o' ;
%%
int context = 0;
int yylex(YYSTYPE *yylval)
{
switch(context++)
{
case 0: return 'f';
case 1: return 'o';
case 2: return 'o';
default: return 0;
}
}
int errors=0;
void yyerror(char *fel) { errors++; }
EOF
if $YACC -d conftest.y 1>&AC_FD_CC 2>&AC_FD_CC; then
AC_TRY_COMPILE([
#include "y.tab.c"
],[
yyparse();
exit(errors);
],ok=yes,ok=no)
if test "$ok" = "yes"; then
pike_cv_short_use=$short_use
break
fi
fi
done
])
case "$pike_cv_short_use" in
CT_SHORT)
AC_MSG_RESULT(short)
AC_DEFINE(BISON_SHORT_EXPANSION,int)
;;
CT_SHORT_INT)
AC_MSG_RESULT(short int)
AC_DEFINE(BISON_SHORT_EXPANSION,[])
;;
*)
AC_MSG_RESULT(unknown)
;;
esac
#############################################################################
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for the type of __yy_memcpy)
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv___yy_memcpy_count_type, [
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | pike_cv___yy_memcpy_from_const=
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | pike_cv___yy_memcpy_count_type=unknown
|
486523 | 2001-01-20 | Henrik Grubbström (Grubba) | | for count_type in "unsigned int" "size_t" "unsigned long" "int"; do
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | for from_const in "const" ""; do
cat >conftest.y <<EOF
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | %pure_parser
%{
#include <stdio.h>
#ifndef __GNUC__
#ifndef __cplusplus
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | static void __yy_memcpy(char *to, $from_const char *from, $count_type count);
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | #endif /* !__cplusplus */
#endif /* !__GNUC__ */
|
486523 | 2001-01-20 | Henrik Grubbström (Grubba) | |
void yyerror(char *);
int yylex(void *);
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | %}
%%
all: foo bar
|
a8adfd | 2001-01-20 | Henrik Grubbström (Grubba) | | foo: 'f' 'o' 'o' { fprintf(stderr, "foo\\n"); } ;
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | bar: 'b' 'a' 'r' ;
%%
|
486523 | 2001-01-20 | Henrik Grubbström (Grubba) | | int yylex(void *yylval) { return 'f'; }
|
a8adfd | 2001-01-20 | Henrik Grubbström (Grubba) | | void yyerror(char *err) { fprintf(stderr, "ERR: %s\\n", err); }
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | EOF
|
9edb20 | 2004-03-10 | Henrik Grubbström (Grubba) | | echo conftest.y: 1>&AC_FD_CC
cat conftest.y 1>&AC_FD_CC
if $YACC -d conftest.y 1>&AC_FD_CC 2>&AC_FD_CC; then
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | AC_TRY_LINK([
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | #include "y.tab.c"
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | ], [
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | yyparse();
exit(0);
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | ], [
pike_cv___yy_memcpy_count_type=$count_type
pike_cv___yy_memcpy_from_const="$from_const"
break
])
fi
done
if test "x$pike_cv___yy_memcpy_count_type" = "xunknown"; then :; else
break
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | fi
done
])
if test "x$pike_cv___yy_memcpy_count_type" = "xunknown"; then
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT($pike_cv___yy_memcpy_count_type)
|
0a8698 | 2003-11-07 | Martin Stjernholm | | AC_MSG_WARN([Defaulting to unsigned int.])
|
6ded52 | 2001-07-13 | Henrik Grubbström (Grubba) | | YY_COUNT_TYPE="unsigned int"
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | YY_FROM_CONST=""
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | else
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(void __yy_memcpy(char *, $pike_cv___yy_memcpy_from_const char *, $pike_cv___yy_memcpy_count_type))
|
6ded52 | 2001-07-13 | Henrik Grubbström (Grubba) | | YY_COUNT_TYPE="$pike_cv___yy_memcpy_count_type"
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | YY_FROM_CONST="$pike_cv___yy_memcpy_from_const"
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | | fi
|
6ded52 | 2001-07-13 | Henrik Grubbström (Grubba) | | AC_SUBST(YY_COUNT_TYPE)
|
d52353 | 2002-09-24 | Henrik Grubbström (Grubba) | | AC_SUBST(YY_FROM_CONST)
|
f5d704 | 2001-01-20 | Henrik Grubbström (Grubba) | |
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
bf622c | 1997-09-19 | Henrik Grubbström (Grubba) | | ## At this point we have found all binaries we are going to use.
#############################################################################
AC_C_CONST
|
3bb83a | 1997-09-22 | Henrik Grubbström (Grubba) | | # The above doesn't find IBM C's buggy const.
if test "$ac_cv_c_const" = "yes"; then
AC_MSG_CHECKING(if const really does work)
|
897653 | 1997-12-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_c_really_const,[
AC_TRY_COMPILE([
|
3bb83a | 1997-09-22 | Henrik Grubbström (Grubba) | | const int foo(int bar) { return bar; }
|
897653 | 1997-12-22 | Fredrik Hübinette (Hubbe) | | ], [
return bar(0);
], [
pike_cv_c_really_const=yes
], [
pike_cv_c_really_const=no
])
|
3bb83a | 1997-09-22 | Henrik Grubbström (Grubba) | | ])
|
897653 | 1997-12-22 | Fredrik Hübinette (Hubbe) | |
AC_MSG_RESULT($pike_cv_c_really_const)
if test "x$pike_cv_c_really_const" = xno ; then
AC_DEFINE(const, [])
else
:
fi
|
3bb83a | 1997-09-22 | Henrik Grubbström (Grubba) | | fi
|
4ff800 | 2004-03-12 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([if restrict keyword is available (C99)])
AC_CACHE_VAL(pike_cv_keyword_restrict, [
AC_TRY_COMPILE([
extern int foo(void *bar[restrict], void *restrict baz);
], [], [ pike_cv_keyword_restrict="yes" ], [ pike_cv_keyword_restrict="no" ])
])
AC_MSG_RESULT($pike_cv_keyword_restrict)
if test "x$pike_cv_keyword_restrict" = "xno"; then
AC_DEFINE(restrict, [ /* Not supported */ ])
fi
|
b9b05f | 2003-02-20 | Henrik Grubbström (Grubba) | | AC_C_CHAR_UNSIGNED
|
82c04f | 1999-04-25 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if we can cast void * to a function pointer)
AC_CACHE_VAL(pike_cv_function_cast, [
AC_TRY_COMPILE([
void *foo = 0;
],[
void (*bar)(void) = (void (*)(void)) foo;
],[ pike_cv_function_cast="yes" ], [ pike_cv_function_cast="no" ])
])
if test "$pike_cv_function_cast" = "yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_DEFINE(NO_CAST_TO_FUN)
fi
|
bf622c | 1997-09-19 | Henrik Grubbström (Grubba) | | #############################################################################
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | PIKE_AC_DEBUG
|
ec24a4 | 2006-07-02 | Martin Stjernholm | | # Note: For function detection to work correctly with
# PIKE_FUNCS_NEED_DECLS (i.e. windows), it's necessary that
# AC_CHECK_HEADERS tests all potential header files for a function
# before AC_CHECK_FUNCS is used.
|
693018 | 1996-02-25 | Fredrik Hübinette (Hubbe) | | AC_HEADER_TIME
AC_HEADER_STDC
|
8c9f33 | 2006-08-04 | Martin Stjernholm | | # Note: winsock2.h has to be included before winsock.h to avoid
# conflict. Thus check for winsock2.h before anything else in case
# winsock.h is included indirectly.
|
5a01aa | 2017-08-10 | Martin Nilsson | | AC_CHECK_HEADERS(winsock2.h sys/rusage.h sys/time.h \
|
9fbe4e | 2015-08-31 | Martin Nilsson | | memory.h strings.h \
|
883350 | 2015-10-17 | Martin Nilsson | | fcntl.h sys/filio.h sys/sockio.h crypt.h \
|
e14911 | 2015-10-17 | Martin Nilsson | | sys/select.h net/socket.h sys/param.h io.h \
|
78abb7 | 2015-10-17 | Martin Nilsson | | sys/mman.h sys/user.h pthread.h \
|
9fbe4e | 2015-08-31 | Martin Nilsson | | sys/id.h mach-o/dyld.h sys/ptrace.h \
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | thread.h dlfcn.h dld.h dl.h sys/times.h sched.h \
|
9fbe4e | 2015-08-31 | Martin Nilsson | | sys/procfs.h sys/socket.h sys/uio.h fcntl.h \
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | malloc.h netinet/in.h sys/wait.h windows.h grp.h pwd.h \
|
fdaf5a | 2015-10-17 | Martin Nilsson | | passwd.h group.h winsock.h sys/file.h poll.h \
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | sys/poll.h socket.h ieeefp.h fp_class.h floatingpoint.h \
|
f34112 | 2015-10-17 | Martin Nilsson | | sys/priocntl.h sys/sched.h winbase.h \
|
bf6d89 | 2015-10-18 | Martin Nilsson | | sys/termio.h sys/termios.h \
|
895ced | 2003-10-25 | Martin Nilsson | | ws2tcpip.h valgrind/memcheck.h memcheck.h valgrind.h \
|
32ccf9 | 2003-11-25 | Jonas Wallden | | sys/prctl.h sys/ioctl.h mach/task_info.h mach/task.h \
|
d97bbf | 2005-08-27 | Jonas Wallden | | mach/mach_init.h syscall.h sys/syscall.h devices/timer.h \
|
8dc5b4 | 2008-11-07 | Martin Stjernholm | | direct.h CoreServices/CoreServices.h execinfo.h \
|
fbb9aa | 2017-07-11 | Bill Welliver | | mach/mach.h mach/thread_act.h mach/clock.h \
machine/bswap.h sys/endian.h,,,[
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | #if (defined(__WINNT__) || defined(__WIN32__)) && !defined(__NT__)
#define __NT__
#endif
#ifndef _LARGEFILE_SOURCE
# define _FILE_OFFSET_BITS 64
# define _LARGEFILE_SOURCE
#endif
#ifndef __STDC_EXT__
# define __STDC_EXT__
#endif /* !__STDC_EXT__ */
#ifndef _PROTOTYPES
# define _PROTOTYPES
#endif /* !_PROTOTYPES */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif /* !_GNU_SOURCE */
#ifdef __NT__
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef WIN32
#define WIN32 100 /* WinNT 1.0 */
#endif
|
efd180 | 2009-05-28 | Henrik Grubbström (Grubba) | | #if !defined(_WIN32_WINDOWS) || (_WIN32_WINDOWS < 0x500)
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | #undef _WIN32_WINDOWS
|
efd180 | 2009-05-28 | Henrik Grubbström (Grubba) | | #define _WIN32_WINDOWS 0x0500
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | #endif
|
efd180 | 2009-05-28 | Henrik Grubbström (Grubba) | | #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x500)
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | #undef _WIN32_WINNT
|
efd180 | 2009-05-28 | Henrik Grubbström (Grubba) | | #define _WIN32_WINNT 0x0500
|
b3f7ab | 2009-05-27 | Henrik Grubbström (Grubba) | | #endif
|
efd180 | 2009-05-28 | Henrik Grubbström (Grubba) | | #if !defined(NTDDI_VERSION) || (NTDDI_VERSION < 0x05000000)
|
b3f7ab | 2009-05-27 | Henrik Grubbström (Grubba) | | #undef NTDDI_VERSION
|
efd180 | 2009-05-28 | Henrik Grubbström (Grubba) | | #define NTDDI_VERSION 0x05000000
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | #endif
#endif /* __NT__ */
#ifdef __amigaos__
#define __USE_NETINET_IN_H
#endif
#ifndef __BUILTIN_VA_ARG_INCR
#define __BUILTIN_VA_ARG_INCR 1
#endif /* !__BUILTIN_VA_ARG_INCR */
#ifdef HAVE_WINDOWS_H
#include <windows.h>
#undef HAVE_WINDOWS_H
#endif
|
3152b4 | 2004-11-20 | Mattias Wingstedt | | /* Necessary to find sys/socket.h on MacOS X 10.3 */
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
|
fc7d61 | 2005-11-16 | Henrik Grubbström (Grubba) | | #endif
/* Necessary to find ws2tcpip.h on WIN32. */
#ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
|
3152b4 | 2004-11-20 | Mattias Wingstedt | | #endif
|
d0d796 | 2005-12-02 | Henrik Grubbström (Grubba) | | /* Necessary to find sys/user.h on OpenBSD */
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
|
500f8e | 2004-11-17 | Henrik Grubbström (Grubba) | | ])
|
8ad6e7 | 2004-03-09 | Henrik Grubbström (Grubba) | |
|
50f626 | 2015-11-27 | Henrik Grubbström (Grubba) | | # Setjmp.
#
# POSIX defines sigsetjmp().
# BSD defines both _setjmp() and setjmp(), where setjmp()
# saves the signal mask.
# SVID explicitly defines setjmp() not to save the signal mask.
AC_CHECK_FUNCS(sigsetjmp _setjmp siglongjmp _longjmp)
|
8ad6e7 | 2004-03-09 | Henrik Grubbström (Grubba) | | # Make it possible to disable use of /dev/poll.
if test "x$with_devpoll" = "xno"; then :; else
|
893937 | 2004-04-03 | Henrik Grubbström (Grubba) | | AC_CHECK_HEADERS(sys/devpoll.h sys/event.h sys/epoll.h)
|
6f6f35 | 2004-04-04 | Henrik Grubbström (Grubba) | | AC_CHECK_FUNCS(kqueue)
|
0ce67d | 2012-02-15 | Bill Welliver | | AC_CHECK_FRAMEWORK(CoreServices, CFRunLoopRunInMode)
AC_CHECK_FUNCS(CFRunLoopRunInMode)
|
893937 | 2004-04-03 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for poll device)
AC_CACHE_VAL(pike_cv_device_devpoll, [
pike_cv_poll_device="no"
for device in /dev/poll /dev/epoll; do
if test -w "$device"; then
pike_cv_poll_device="$device"
break
fi
done
])
AC_MSG_RESULT($pike_cv_poll_device)
if test "x$pike_cv_poll_device" = "xno"; then :; else
AC_DEFINE_UNQUOTED(PIKE_POLL_DEVICE, "$pike_cv_poll_device")
|
4b420b | 2004-03-10 | Henrik Grubbström (Grubba) | | fi
|
12a189 | 2006-12-15 | Henrik Grubbström (Grubba) | |
|
5b8b2f | 2007-05-19 | Henrik Grubbström (Grubba) | | if test "x$ac_cv_header_sys_epoll_h" = "xyes"; then
|
12a189 | 2006-12-15 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if epoll is available)
AC_CACHE_VAL(pike_cv_epoll_works, [
if test "x$pike_cv_poll_device" = "xno"; then
AC_TRY_RUN([
#include <errno.h>
#include <sys/epoll.h>
#ifdef __stub_epoll_create
/* We have a libc without the wrappers for epoll support.
*/
#ifdef HAVE_SYSCALL_H
#include <syscall.h>
#elif defined(HAVE_SYS_SYSCALL_H)
#include <sys/syscall.h>
#endif /* HAVE_SYSCALL_H || HAVE_SYS_SYSCALL_H */
#ifndef __NR_epoll_create
/* Our libc does not even know the syscall numbers for the epoll syscalls.
*/
#ifdef __i386__
#define __NR_epoll_create 254
#elif defined(__x86_64__)
#define __NR_epoll_create 214
#else /* cpu types */
#error Syscall numbers for epoll_create et al not known on this architecture.
#endif /* cpu types */
#endif /* !defined(__NR_epoll_create) */
#if defined(_syscall1) && defined(_syscall4)
|
13670c | 2015-05-25 | Martin Nilsson | | _syscall1(int, epoll_create, int, size);
|
12a189 | 2006-12-15 | Henrik Grubbström (Grubba) | | #undef __stub_epoll_create
#else /* !_syscall1 || !_syscall4 */
#error Missing macros for generation of syscall wrappers.
#endif /* _syscall1 && _syscall4 */
#endif /* __stub_epoll_{create, ctl, wait} */
int main(int argc, char **argv)
{
int fd;
do {
|
5b8b2f | 2007-05-19 | Henrik Grubbström (Grubba) | | fd = epoll_create(32);
|
12a189 | 2006-12-15 | Henrik Grubbström (Grubba) | | } while ((fd < 0) && (errno == EINTR));
return fd < 0;
}
], [
pike_cv_epoll_works=yes
], [
pike_cv_epoll_works=no
], [
pike_cv_epoll_works=unknown
])
else
pike_cv_epoll_works=yes
fi
])
AC_MSG_RESULT($pike_cv_epoll_works)
if test "x$pike_cv_epoll_works" = "xyes"; then
|
c38af3 | 2006-12-15 | Henrik Grubbström (Grubba) | | AC_DEFINE(WITH_EPOLL)
|
12a189 | 2006-12-15 | Henrik Grubbström (Grubba) | | fi
fi
|
8ad6e7 | 2004-03-09 | Henrik Grubbström (Grubba) | | fi
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
7cccc5 | 2000-12-27 | Mirar (Pontus Hagland) | | # some Linux systems have a broken resource.h that compiles anyway /Mirar
|
c5cbce | 2000-12-27 | Mirar (Pontus Hagland) | | AC_MSG_CHECKING([for sys/resource.h])
|
4492cc | 2000-12-28 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_sys_resource_h, [
AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
|
b5fac7 | 2000-12-28 | Henrik Grubbström (Grubba) | | #include <time.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SYS_TIME_H */
|
4492cc | 2000-12-28 | Henrik Grubbström (Grubba) | |
#include <sys/resource.h>
],[],
[pike_cv_sys_resource_h=yes], [pike_cv_sys_resource_h=no])
])
|
c5cbce | 2000-12-27 | Mirar (Pontus Hagland) | | if test "x$pike_cv_sys_resource_h" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SYS_RESOURCE_H)
else
AC_MSG_RESULT(no)
fi
|
7cccc5 | 2000-12-27 | Mirar (Pontus Hagland) | |
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | AC_CHECK_SIZEOF(char *,4)
|
d0d62b | 2000-08-18 | Henrik Grubbström (Grubba) | | AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(float, 4)
AC_CHECK_SIZEOF(double, 8)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_CHECK_SIZEOF(long double, 0)
|
d0d62b | 2000-08-18 | Henrik Grubbström (Grubba) | | AC_CHECK_SIZEOF(long, 4)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_CHECK_SIZEOF(long long, 0)
AC_CHECK_SIZEOF(__int64, 0)
|
318a41 | 2004-12-14 | Martin Stjernholm | | AC_CHECK_SIZEOF(time_t, 4)
|
0d80be | 2012-12-31 | Arne Goedeke | | AC_CHECK_SIZEOF(__int128)
AC_CHECK_SIZEOF(__int128_t)
|
ed4c9b | 2013-01-01 | Jonas Walldén | | AC_CHECK_SIZEOF(unsigned __int128)
AC_CHECK_SIZEOF(unsigned __int128_t)
AC_CHECK_SIZEOF(__uint128_t)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
6f7df8 | 2000-06-29 | Henrik Grubbström (Grubba) | | AC_MY_CHECK_TYPE(size_t,unsigned long)
AC_MY_CHECK_TYPE(ptrdiff_t,long)
|
1e577b | 1999-07-15 | Fredrik Hübinette (Hubbe) | | AC_MY_CHECK_TYPE(off_t,long)
AC_MY_CHECK_TYPE(pid_t,int)
AC_MY_CHECK_TYPE(uid_t,int)
AC_MY_CHECK_TYPE(gid_t,int)
AC_MY_CHECK_TYPE(time_t,INT32)
AC_MY_CHECK_TYPE(pri_t, short)
|
da9b45 | 2003-03-28 | Martin Stjernholm | | AC_CHECK_SIZEOF(off_t, 4)
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for sizeof anything)
if test "$ac_cv_sizeof_long_double" != 0 -a \
"x$with_long_double_precision" = xyes ; then
sizeof_float_type="$ac_cv_sizeof_long_double"
elif test "x$with_double_precision" = xyes ; then
sizeof_float_type="$ac_cv_sizeof_double"
else
sizeof_float_type="$ac_cv_sizeof_float"
fi
if test "$ac_cv_sizeof_long_long" != 0 -a \
"x$with_long_long_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof_long_long"
elif test "$ac_cv_sizeof___int64" != 0 -a \
"x$with_long_long_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof___int64"
elif test "x$with_long_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof_long"
elif test "x$with_short_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof_short"
elif test "x$with_unsigned_long_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof_long"
elif test "$ac_cv_sizeof_long_long" != 0 -a \
"x$with_unsigned_long_long_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof_long_long"
elif test "$ac_cv_sizeof___int64" != 0 -a \
"x$with_unsigned_long_long_int" = xyes ; then
sizeof_int_type="$ac_cv_sizeof___int64"
else
sizeof_int_type="$ac_cv_sizeof_int"
fi
sizeof_anything="$ac_cv_sizeof_char_p"
if test "$sizeof_float_type" -gt "$sizeof_anything"; then
sizeof_anything="$sizeof_float_type"
fi
if test "$sizeof_int_type" -gt "$sizeof_anything"; then
sizeof_anything="$sizeof_int_type"
fi
AC_MSG_RESULT($sizeof_anything)
AC_MSG_CHECKING(for FLOAT_TYPE)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | if test "x$with_long_double_precision" = x -a \
"x$with_double_precision" = x ; then
# Choose the longest available float that fits in a pointer.
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | if test "$ac_cv_sizeof_long_double" != 0 -a \
"$ac_cv_sizeof_long_double" -le "$sizeof_anything" ; then
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | with_long_double_precision=yes
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | elif test "$ac_cv_sizeof_double" -le "$sizeof_anything" ; then
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | with_double_precision=yes
fi
fi
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | if test "$ac_cv_sizeof_long_double" != 0 -a \
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | "x$with_long_double_precision" = xyes ; then
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(long double)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_DEFINE(WITH_LONG_DOUBLE_PRECISION_SVALUE)
AC_DEFINE(FLOAT_TYPE, long double)
AC_DEFINE(SIZEOF_FLOAT_TYPE, SIZEOF_LONG_DOUBLE)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | float_type="long double"
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | sizeof_float_type="$ac_cv_sizeof_long_double"
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | elif test "x$with_double_precision" = xyes ; then
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(double)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_DEFINE(WITH_DOUBLE_PRECISION_SVALUE)
AC_DEFINE(FLOAT_TYPE, double)
AC_DEFINE(SIZEOF_FLOAT_TYPE, SIZEOF_DOUBLE)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | float_type="double"
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | sizeof_float_type="$ac_cv_sizeof_double"
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | else
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(float)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_DEFINE(FLOAT_TYPE, float)
AC_DEFINE(SIZEOF_FLOAT_TYPE, SIZEOF_FLOAT)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | float_type="float"
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | sizeof_float_type="$ac_cv_sizeof_float"
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | fi
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for INT_TYPE)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | if test "x$with_long_long_int" = x -a \
"x$with_long_int" = x -a \
"x$with_int_int" = x -a \
"x$with_short_int" = x ; then
# Choose the longest available integer that fits in a pointer.
# if test $ac_cv_sizeof_long_long != 0 -a \
# $ac_cv_sizeof_long_long -le $ac_cv_sizeof_char_p ; then
# # This isn't a good idea on architectures where
|
0a3c55 | 2016-05-09 | Martin Nilsson | | # # sizeof(long int) < sizeof(INT64).
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | # # This is due to the gmp mpz api's using long int instead of
# # mp_limb_{signed_}t.
# #with_long_long_int=yes
# :
# fi
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | if test "$ac_cv_sizeof_long" -le "$sizeof_anything" ; then
with_long_int=yes
else
with_int_int=yes
fi
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | :
fi
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | if test "$ac_cv_sizeof_long_long" != 0 -a \
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | "x$with_long_long_int" = xyes ; then
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(long long)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_DEFINE(WITH_LONG_LONG_INT)
AC_DEFINE(INT_TYPE, long long)
AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_LONG_LONG)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | int_type="long long"
sizeof_int_type="$ac_cv_sizeof_long_long"
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | elif test "$ac_cv_sizeof___int64" != 0 -a \
"x$with_long_long_int" = xyes ; then
AC_MSG_RESULT(__int64)
AC_DEFINE(WITH_LONG_LONG_INT)
AC_DEFINE(INT_TYPE, __int64)
AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF___INT64)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | int_type="__int64"
sizeof_int_type="$ac_cv_sizeof___int64"
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | elif test "x$with_long_int" = xyes ; then
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(long)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_DEFINE(WITH_LONG_INT)
AC_DEFINE(INT_TYPE, long)
AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_LONG)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | int_type="long"
sizeof_int_type="$ac_cv_sizeof_long"
|
ac6000 | 2003-11-15 | Martin Stjernholm | | dnl elif test "x$with_short_int" = xyes ; then
dnl AC_MSG_RESULT(short)
dnl AC_DEFINE(WITH_SHORT_INT)
dnl AC_DEFINE(INT_TYPE, short)
dnl AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_SHORT)
dnl elif test "x$with_unsigned_long_int" = xyes ; then
dnl AC_MSG_RESULT(unsigned long)
dnl AC_DEFINE(WITH_UNSIGNED_LONG_INT)
dnl AC_DEFINE(INT_TYPE, unsigned long)
dnl AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_LONG)
dnl elif test "$ac_cv_sizeof_long_long" != 0 -a \
dnl "x$with_unsigned_long_long_int" = xyes ; then
dnl AC_MSG_RESULT(unsigned long long)
dnl AC_DEFINE(WITH_UNSIGNED_LONG_LONG_INT)
dnl AC_DEFINE(INT_TYPE, unsigned long long)
dnl AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_LONG_LONG)
dnl elif test "$ac_cv_sizeof___int64" != 0 -a \
dnl "x$with_unsigned_long_long_int" = xyes ; then
dnl AC_MSG_RESULT(unsigned __int64)
dnl AC_DEFINE(WITH_UNSIGNED_LONG_LONG_INT)
dnl AC_DEFINE(INT_TYPE, unsigned __int64)
dnl AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF___INT64)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | else
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(int)
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | AC_DEFINE(WITH_INT_INT)
AC_DEFINE(INT_TYPE, int)
AC_DEFINE(SIZEOF_INT_TYPE, SIZEOF_INT)
|
2f8ae6 | 2004-01-12 | Mirar (Pontus Hagland) | | int_type="int"
sizeof_int_type="$ac_cv_sizeof_int"
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | fi
|
693018 | 1996-02-25 | Fredrik Hübinette (Hubbe) | | AC_TYPE_SIGNAL
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | dnl AC_CHECK_LIB(PW, alloca)
|
b04d5f | 1996-07-08 | Fredrik Hübinette (Hubbe) | |
|
6accea | 2003-01-04 | Xavier Beaudouin | | dnl Checking if poll() call is in libpoll (in general in Darwin or BSD/OS)
AC_CHECK_LIB(poll, poll)
|
5c8e89 | 1995-10-29 | Fredrik Hübinette (Hubbe) | | AC_CHECK_LIB(m, floor)
|
dc5da7 | 1997-11-03 | Henrik Grubbström (Grubba) | |
AC_CHECK_LIB(socket, socket)
|
a12f27 | 1998-01-10 | Fredrik Hübinette (Hubbe) | |
|
08af09 | 2000-04-12 | Marcus Comstedt | | if test x"$pike_cv_sys_os" = xWindows_NT ; then
|
d87ab4 | 2000-08-17 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if we should use the 64 bit API)
AC_CACHE_VAL(pike_cv_sys_win64, [
|
21ee4b | 2003-12-16 | Marek Habersack | | AC_EGREP_CPP(oui, [
|
d87ab4 | 2000-08-17 | Henrik Grubbström (Grubba) | | #if defined(_WIN64) || defined(__WIN64__)
|
21ee4b | 2003-12-16 | Marek Habersack | | oui
|
d87ab4 | 2000-08-17 | Henrik Grubbström (Grubba) | | #else
no
#endif
], [ pike_cv_sys_win64=yes ], [ pike_cv_sys_win64=no ])
])
if test "x$pike_cv_sys_win64" = "xyes"; then
AC_MSG_RESULT(yes)
|
e71885 | 2000-08-18 | Henrik Grubbström (Grubba) | | # Apparently the libraries are stilled named *32...
# LIBS="-lkernel64 -lws2_64 -ladvapi64 $LIBS"
|
bcb538 | 2001-08-23 | Boyd Lynn Gerber | | LIBS="-lshell32 -lkernel32 -lws2_32 -ladvapi32 $LIBS"
|
d87ab4 | 2000-08-17 | Henrik Grubbström (Grubba) | | else
AC_MSG_RESULT(no)
|
bcb538 | 2001-08-23 | Boyd Lynn Gerber | | LIBS="-lshell32 -lkernel32 -lws2_32 -ladvapi32 $LIBS"
|
d87ab4 | 2000-08-17 | Henrik Grubbström (Grubba) | | fi
|
a12f27 | 1998-01-10 | Fredrik Hübinette (Hubbe) | | fi
|
dc5da7 | 1997-11-03 | Henrik Grubbström (Grubba) | | AC_CHECK_LIB(nsl, gethostbyname)
|
dac637 | 1999-10-17 | Mirar (Pontus Hagland) | | AC_CHECK_LIB(rt, nanosleep)
|
dc5da7 | 1997-11-03 | Henrik Grubbström (Grubba) | |
|
ca74dd | 1996-10-08 | Fredrik Hübinette (Hubbe) | | AC_CHECK_LIB(dl, dlopen)
|
423839 | 1998-07-09 | Francesco Chemolli | | AC_CHECK_LIB(dld, shl_load)
|
59bc1b | 1997-01-22 | Bernhard Fastenrath | | AC_CHECK_LIB(dld, dld_link)
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | |
|
d98e0d | 1997-01-15 | Fredrik Hübinette (Hubbe) | |
if test "${pike_cv_sys_os}" = "Linux"; then
|
7b3941 | 1997-02-06 | Fredrik Hübinette (Hubbe) | | if test "${ac_cv_lib_m_floor}" = "no"; then
|
0a8698 | 2003-11-07 | Martin Stjernholm | | AC_MSG_WARN(I will compensate for this by adding -lc -lm.)
|
d98e0d | 1997-01-15 | Fredrik Hübinette (Hubbe) | | LIBS="${LIBS} -lc -lm"
fi
|
f8663d | 1997-09-16 | Henrik Grubbström (Grubba) | |
if test "$ac_cv_header_sched_h" = "yes"; then
AC_MSG_CHECKING(if sched.h has a typo)
AC_CACHE_VAL(pike_cv_broken_sched_h, [
AC_TRY_COMPILE([
#include <sched.h>
],[ ],[ pike_cv_broken_shed_h=no ], [
OLDCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_P=__P"
AC_TRY_COMPILE([
#include <sched.h>
],[ ],[ pike_cv_broken_sched_h=yes ],[
pike_cv_broken_sched_h="very broken"
])
CPPFLAGS="$OLDCPPFLAGS"
])
])
AC_MSG_RESULT($pike_cv_broken_sched_h)
if test "$pike_cv_broken_sched_h" = "yes"; then
|
0a8698 | 2003-11-07 | Martin Stjernholm | | PIKE_MSG_WARN(Applying workaround for sched.h typo.)
|
f8663d | 1997-09-16 | Henrik Grubbström (Grubba) | | CPPFLAGS="$CPPFLAGS -D_P=__P"
fi
fi
|
d10ed5 | 1995-11-15 | Fredrik Hübinette (Hubbe) | | fi
|
5c8e89 | 1995-10-29 | Fredrik Hübinette (Hubbe) | |
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | PIKE_AC_DEBUG
|
e45ef2 | 2001-02-14 | Mirar (Pontus Hagland) | | using_threads="no (forced)"
|
eec137 | 1996-11-02 | Fredrik Hübinette (Hubbe) | | if test x$with_threads = xyes ; then
|
e45ef2 | 2001-02-14 | Mirar (Pontus Hagland) | | using_threads="no (no known threads found)"
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | OLDLIBS="$LIBS"
|
284e06 | 1998-11-09 | Fredrik Hübinette (Hubbe) | | OLDCFLAGS="$CFLAGS"
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | |
|
b1f4eb | 1998-01-13 | Fredrik Hübinette (Hubbe) | | if test "x$pike_cv_sys_os" = "xWindows_NT" ; then
# NT has threads...
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(_UNIX_THREADS)
AC_DEFINE(NT_THREADS)
|
67bbf0 | 1999-08-10 | Henrik Grubbström (Grubba) | | AC_DEFINE(PIKE_THREADS)
|
e45ef2 | 2001-02-14 | Mirar (Pontus Hagland) | | using_threads="yes (nt)"
|
b1f4eb | 1998-01-13 | Fredrik Hübinette (Hubbe) | |
|
40fb6d | 2003-01-05 | Henrik Grubbström (Grubba) | | pike_cv_thread_t_type=integer
|
b1f4eb | 1998-01-13 | Fredrik Hübinette (Hubbe) | | else
|
9ab446 | 1998-11-06 | Honza Petrous | | # Test for POSIX threads
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | if test "x$with_thread_library" != "xno"; then
AC_MSG_CHECKING([for thread library])
AC_MSG_RESULT([$with_thread_library (--with-thread-library)])
LIBS="${OLDLIBS} $with_thread_library"
else
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | case "x$pike_cv_sys_os" in
|
372426 | 1999-08-25 | Henrik Grubbström (Grubba) | | xOSF1*)
|
d4ac01 | 2000-03-29 | Fredrik Hübinette (Hubbe) | | # LIBS="${OLDLIBS} -lpthread -lmach -lexc -lc"
LIBS="${OLDLIBS} -lpthread -lmach -lexc"
|
9ab446 | 1998-11-06 | Honza Petrous | | ;;
|
13670c | 2015-05-25 | Martin Nilsson | |
|
9ab446 | 1998-11-06 | Honza Petrous | | xBSD/OS*)
LIBS="${OLDLIBS}"
;;
|
bcb538 | 2001-08-23 | Boyd Lynn Gerber | | xUnixWare*|xOpenUNIX*)
|
902224 | 1998-08-27 | Honza Petrous | | if test "$GCC" = yes ; then
|
0d5111 | 2000-04-10 | Boyd Lynn Gerber | | CFLAGS="${CFLAGS} -pthread"
|
902224 | 1998-08-27 | Honza Petrous | | else
|
9ab446 | 1998-11-06 | Honza Petrous | | CFLAGS="${CFLAGS} -Kthread"
|
902224 | 1998-08-27 | Honza Petrous | | fi
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | ;;
|
080971 | 1998-02-27 | Marcus Comstedt | |
|
46d630 | 2002-05-27 | Henrik Grubbström (Grubba) | | xOpenBSD*)
CFLAGS="${CFLAGS} -pthread"
LDFLAGS="${LDFLAGS} -pthread"
;;
|
13670c | 2015-05-25 | Martin Nilsson | | xFreeBSD*)
|
9ab446 | 1998-11-06 | Honza Petrous | | # Threads on FreeBSD earlier than 1998-06-07 are broken.
LIBS="${OLDLIBS}"
AC_MSG_CHECKING(if this version of FreeBSD may have working threads)
AC_CACHE_VAL(pike_cv_freebsd_threads, [
AC_TRY_RUN([
|
54905d | 1998-06-16 | Henrik Grubbström (Grubba) | | #include <osreldate.h>
int main(int argc, char **argv)
{
|
fc84cc | 1998-12-03 | Henrik Grubbström (Grubba) | | /* FreeBSD before 228000 and 300000 - 300005 have broken threads.
|
8e4842 | 1998-06-17 | Henrik Grubbström (Grubba) | | */
|
fc84cc | 1998-12-03 | Henrik Grubbström (Grubba) | | if (__FreeBSD_version < 228000)
|
54905d | 1998-06-16 | Henrik Grubbström (Grubba) | | return(1);
if (__FreeBSD_version < 300000)
return(0);
|
fc84cc | 1998-12-03 | Henrik Grubbström (Grubba) | | if (__FreeBSD_version < 300006)
|
54905d | 1998-06-16 | Henrik Grubbström (Grubba) | | return(1);
return(0);
}
|
9ab446 | 1998-11-06 | Honza Petrous | | ], pike_cv_freebsd_threads=yes, pike_cv_freebsd_threads=no,
pike_cv_freebsd_threads=yes)
])
if test "x$pike_cv_freebsd_threads" = "xno"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
|
f369dd | 2000-03-26 | Fredrik Hübinette (Hubbe) | |
|
46f0f0 | 2007-12-13 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if this version of FreeBSD might require use of pthread-config)
AC_CACHE_VAL(pike_cv_freebsd_pthread_config, [
AC_TRY_RUN([
#include <osreldate.h>
int main(int argc, char **argv)
{
/* pthread-config is a remnant of the GNU pth library, and should not
* be used on more recent versions of FreeBSD. */
if (__FreeBSD_version < 500000)
return(0);
return(1);
}
], pike_cv_freebsd_pthread_config=yes, pike_cv_freebsd_pthread_config=no,
pike_cv_freebsd_pthread_config=yes)
])
if test "x$pike_cv_freebsd_pthread_config" = "xyes"; then
AC_MSG_RESULT(yes)
AC_PATH_PROG(PTHREAD_CONFIG,${ac_tool_prefix}pthread-config,no)
else
AC_MSG_RESULT(no)
PTHREAD_CONFIG=no
fi
|
95013b | 2000-03-27 | Dan Nelson | | if test "x$PTHREAD_CONFIG" = xno ; then
|
46f0f0 | 2007-12-13 | Henrik Grubbström (Grubba) | | # -pthread should work with all versions of FreeBSD,
# but some custom compilers (ie tcc) may not support it.
AC_SYS_COMPILER_FLAG(-pthread, pthread, CFLAGS, [
# FIXME: Might want to look at OS version:
# 500000 <= version < 500016: -pthread
# 500016 <= version < 502102: -lc_r
# 502102 <= version : -lpthread
#
LIBS="$LIBS -lc_r"
LDFLAGS="${LDFLAGS-} -lc_r"
], [
LDFLAGS="${LDFLAGS-} -pthread"
])
|
f369dd | 2000-03-26 | Fredrik Hübinette (Hubbe) | | else
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | CFLAGS="$CFLAGS `${PTHREAD_CONFIG} --cflags`"
LIBS="${OLDLIBS} `${PTHREAD_CONFIG} --libs`"
LDFLAGS="$CFLAGS `${PTHREAD_CONFIG} --ldflags`"
|
f369dd | 2000-03-26 | Fredrik Hübinette (Hubbe) | | fi
|
9ab446 | 1998-11-06 | Honza Petrous | | fi
;;
|
c371d4 | 1998-06-07 | Simon Coggins | |
|
9ab446 | 1998-11-06 | Honza Petrous | | xAIX*)
|
dc64a5 | 2017-08-08 | Martin Nilsson | | LIBS="${OLDLIBS} -lpthread"
|
9ab446 | 1998-11-06 | Honza Petrous | | ;;
|
b1335c | 1998-07-03 | Francesco Chemolli | |
|
73ea7f | 2000-07-09 | Henrik Grubbström (Grubba) | | xSolaris*)
# Some versions of Solaris 2.5.1 require linking with -lthread too.
LIBS="${OLDLIBS} -lpthread -lthread"
;;
|
66a374 | 2000-10-02 | Jonas Wallden | | xDarwin*)
LIBS="${OLDLIBS}"
|
e7561b | 2012-04-04 | Bill Welliver | |
|
4e69ce | 2012-12-29 | Jonas Walldén | | # pthread_init() is not part of public headers though the symbol will be detected
# in a link test so we force it off.
ac_cv_func_pthread_init="no";
|
e7561b | 2012-04-04 | Bill Welliver | |
|
4e69ce | 2012-12-29 | Jonas Walldén | | #
# it would probably be better to create a compilation test should this
# behavior change in the future, however for now, we accept this as "good enough"
#
AC_MSG_CHECKING([whether Darwin dislikes threads and mach includes])
case "`uname -r`" in
[1-9].*)
AC_MSG_RESULT([no (10.5 or older)])
;;
*)
AC_DEFINE([USE_DARWIN_THREADS_WITHOUT_MACH], [1], [Define if pthreads and mach headers conflict])
AC_MSG_RESULT([yes (10.6 or newer)])
pike_cv_osx_threads_dislike_mach=yes
;;
esac
|
66a374 | 2000-10-02 | Jonas Wallden | | ;;
|
9ab446 | 1998-11-06 | Honza Petrous | | *)
LIBS="${OLDLIBS} -lpthread"
;;
esac
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | fi
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | |
|
8f9f3d | 2007-12-26 | Henrik Grubbström (Grubba) | | PIKE_AC_DEBUG
|
6a04ad | 2009-01-26 | Henrik Grubbström (Grubba) | | AC_CHECK_FUNCS(pthread_init pthread_mutexattr_init pthread_kill \
|
5eb1ac | 2009-04-20 | Jonas Wallden | | pthread_cond_reltimedwait_np pthread_mach_thread_np)
|
8b1407 | 1997-10-03 | Henrik Grubbström (Grubba) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_CHECKING(posix threads)
|
b27ea3 | 1997-10-25 | Henrik Grubbström (Grubba) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_CACHE_VAL(pike_cv_posix_threads, [
AC_TRY_RUN([
|
aeafe1 | 1997-01-26 | Per Hedbor | | #define _REENTRANT
#define _THREAD_SAFE
|
f14742 | 1997-03-12 | Fredrik Hübinette (Hubbe) | | #define _MIT_POSIX_THREADS 1
|
aeafe1 | 1997-01-26 | Per Hedbor | |
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | #include <pthread.h>
|
eea7c2 | 1997-09-11 | Henrik Grubbström (Grubba) | | void *foo(void *bar) { pthread_exit(0); return 0; }
|
158e9f | 1997-03-10 | Henrik Grubbström (Grubba) | | pthread_mutexattr_t attr;
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | pthread_mutex_t tmp;
pthread_t gazonk;
int main()
{
void *sune;
|
8b1407 | 1997-10-03 | Henrik Grubbström (Grubba) | | #ifdef HAVE_PTHREAD_INIT
pthread_init();
#endif /* HAVE_PTHREAD_INIT */
|
080971 | 1998-02-27 | Marcus Comstedt | | #ifdef HAVE_PTHREAD_MUTEXATTR_INIT
|
158e9f | 1997-03-10 | Henrik Grubbström (Grubba) | | pthread_mutexattr_init(&attr);
|
080971 | 1998-02-27 | Marcus Comstedt | | #else
memset(&attr, 0, sizeof(attr));
|
f601ac | 1998-03-06 | Francesco Chemolli | | #endif /* HAVE_PTHREAD_MUTEXATTR_INIT */
|
158e9f | 1997-03-10 | Henrik Grubbström (Grubba) | | pthread_mutex_init(&tmp, &attr);
pthread_mutex_lock(&tmp);
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | pthread_create(&gazonk,0,foo,0);
pthread_join(gazonk,&sune);
exit(0);
}
|
6b15b7 | 2001-01-19 | Henrik Grubbström (Grubba) | | ], [ pike_cv_posix_threads=yes ], [ pike_cv_posix_threads=no ], [
AC_TRY_LINK([
#define _REENTRANT
#define _THREAD_SAFE
#define _MIT_POSIX_THREADS 1
#include <pthread.h>
void *foo(void *bar) { pthread_exit(0); return 0; }
pthread_mutexattr_t attr;
pthread_mutex_t tmp;
pthread_t gazonk;
], [
{
void *sune;
#ifdef HAVE_PTHREAD_INIT
pthread_init();
#endif /* HAVE_PTHREAD_INIT */
#ifdef HAVE_PTHREAD_MUTEXATTR_INIT
pthread_mutexattr_init(&attr);
#else
memset(&attr, 0, sizeof(attr));
#endif /* HAVE_PTHREAD_MUTEXATTR_INIT */
pthread_mutex_init(&tmp, &attr);
pthread_mutex_lock(&tmp);
pthread_create(&gazonk,0,foo,0);
pthread_join(gazonk,&sune);
exit(0);
}
], [ pike_cv_posix_threads=yes ], [ pike_cv_posix_threads=no ])
])
|
9ab446 | 1998-11-06 | Honza Petrous | | ])
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | if test $pike_cv_posix_threads = yes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(_MIT_POSIX_THREADS,1)
|
67bbf0 | 1999-08-10 | Henrik Grubbström (Grubba) | | AC_DEFINE(PIKE_THREADS)
|
e45ef2 | 2001-02-14 | Mirar (Pontus Hagland) | | using_threads="yes (posix)"
|
9ab446 | 1998-11-06 | Honza Petrous | |
|
71ac9e | 1999-08-29 | Fredrik Hübinette (Hubbe) | | ##########################################################################
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_CHECKING(for pthread_attr_setstacksize)
AC_CACHE_VAL(pike_cv_have_pthread_attr_setstacksize,[
AC_TRY_LINK([#include <pthread.h>
void foo(pthread_attr_t*x) { pthread_attr_setstacksize(x, 1024*1024); }
],[],[
pike_cv_have_pthread_attr_setstacksize=yes
],[
pike_cv_have_pthread_attr_setstacksize=no
|
8d4ce8 | 1997-04-10 | Fredrik Hübinette (Hubbe) | | ])
|
9ab446 | 1998-11-06 | Honza Petrous | | ])
AC_MSG_RESULT($pike_cv_have_pthread_attr_setstacksize)
if test x$pike_cv_have_pthread_attr_setstacksize = xyes ; then
AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE)
else
:
fi
|
8d4ce8 | 1997-04-10 | Fredrik Hübinette (Hubbe) | |
|
71ac9e | 1999-08-29 | Fredrik Hübinette (Hubbe) | | ##########################################################################
AC_MSG_CHECKING(for pthread_atfork)
AC_CACHE_VAL(pike_cv_have_pthread_atfork,[
AC_TRY_LINK([#include <pthread.h>
void foo(void) { pthread_atfork(0,0,0); }
],[],[
pike_cv_have_pthread_atfork=yes
],[
pike_cv_have_pthread_atfork=no
])
])
|
d20187 | 1999-08-30 | Fredrik Hübinette (Hubbe) | | if test x$pike_cv_have_pthread_atfork = xyes ; then
|
71ac9e | 1999-08-29 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PTHREAD_ATFORK)
else
AC_MSG_RESULT([no - FreeBSD?])
fi
##########################################################################
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_CHECKING(for pthread_yield)
AC_CACHE_VAL(pike_cv_have_pthread_yield,[
AC_TRY_LINK([#include <pthread.h>
void foo(void) { pthread_yield(); }
],[],[
pike_cv_have_pthread_yield=yes
],[
pike_cv_have_pthread_yield=no
|
8d4ce8 | 1997-04-10 | Fredrik Hübinette (Hubbe) | | ])
|
9ab446 | 1998-11-06 | Honza Petrous | | ])
AC_MSG_RESULT($pike_cv_have_pthread_yield)
if test x$pike_cv_have_pthread_yield = xyes ; then
AC_DEFINE(HAVE_PTHREAD_YIELD)
else
:
fi
|
8d4ce8 | 1997-04-10 | Fredrik Hübinette (Hubbe) | |
|
32ccf9 | 2003-11-25 | Jonas Wallden | | ##########################################################################
AC_MSG_CHECKING(for pthread_yield_np)
AC_CACHE_VAL(pike_cv_have_pthread_yield_np,[
AC_TRY_LINK([#include <pthread.h>
void foo(void) { pthread_yield_np(); }
],[],[
pike_cv_have_pthread_yield_np=yes
],[
pike_cv_have_pthread_yield_np=no
])
])
AC_MSG_RESULT($pike_cv_have_pthread_yield_np)
if test x$pike_cv_have_pthread_yield_np = xyes ; then
AC_DEFINE(HAVE_PTHREAD_YIELD_NP)
else
:
fi
|
71ac9e | 1999-08-29 | Fredrik Hübinette (Hubbe) | | ##########################################################################
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_CHECKING(for pthread_cond_init)
AC_CACHE_VAL(pike_cv_have_pthread_cond_init,[
AC_TRY_LINK([#include <pthread.h>
void foo(pthread_cond_t*x, pthread_condattr_t*y) { pthread_cond_init(x,y); }
],[],[
pike_cv_have_pthread_cond_init=yes
],[
pike_cv_have_pthread_cond_init=no
|
8d4ce8 | 1997-04-10 | Fredrik Hübinette (Hubbe) | | ])
|
9ab446 | 1998-11-06 | Honza Petrous | | ])
AC_MSG_RESULT($pike_cv_have_pthread_cond_init)
if test x$pike_cv_have_pthread_cond_init = xyes ; then
AC_DEFINE(HAVE_PTHREAD_COND_INIT)
else
:
fi
|
0a40e9 | 1997-04-10 | Fredrik Hübinette (Hubbe) | |
|
71ac9e | 1999-08-29 | Fredrik Hübinette (Hubbe) | | ##########################################################################
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_CHECKING(if pthread_condattr_default is defined)
AC_CACHE_VAL(pike_cv_have_pthread_condattr_default,[
AC_TRY_LINK([#include <pthread.h>
void foo(pthread_cond_t *bar) { pthread_cond_init(bar, pthread_condattr_default); }
],[],[
pike_cv_have_pthread_condattr_default=yes
],[
pike_cv_have_pthread_condattr_default=no
|
5377b9 | 1997-02-01 | Henrik Grubbström (Grubba) | | ])
|
9ab446 | 1998-11-06 | Honza Petrous | | ])
|
5377b9 | 1997-02-01 | Henrik Grubbström (Grubba) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_RESULT($pike_cv_have_pthread_condattr_default)
|
5377b9 | 1997-02-01 | Henrik Grubbström (Grubba) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | if test x$pike_cv_have_pthread_condattr_default = xyes ; then
AC_DEFINE(HAVE_PTHREAD_CONDATTR_DEFAULT)
else
:
fi
|
afbcda | 1998-08-31 | Henrik Grubbström (Grubba) | |
|
752e10 | 1999-04-30 | Fredrik Hübinette (Hubbe) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | #
# FreeBSD doesn't like the &, while AIX requires it...
#
AC_MSG_CHECKING(if pthread_condattr_default is needs an & (AIX))
AC_CACHE_VAL(pike_cv_have_pthread_condattr_default_aix,[
AC_TRY_LINK([#include <pthread.h>
void foo(pthread_cond_t *bar) { pthread_cond_init(bar, &pthread_condattr_default); }
],[],[
pike_cv_have_pthread_condattr_default_aix=yes
],[
pike_cv_have_pthread_condattr_default_aix=no
|
afbcda | 1998-08-31 | Henrik Grubbström (Grubba) | | ])
|
9ab446 | 1998-11-06 | Honza Petrous | | ])
|
afbcda | 1998-08-31 | Henrik Grubbström (Grubba) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_MSG_RESULT($pike_cv_have_pthread_condattr_default_aix)
|
afbcda | 1998-08-31 | Henrik Grubbström (Grubba) | |
|
9ab446 | 1998-11-06 | Honza Petrous | | if test x$pike_cv_have_pthread_condattr_default_aix = xyes ; then
AC_DEFINE(HAVE_PTHREAD_CONDATTR_DEFAULT_AIX)
else
:
fi
|
afbcda | 1998-08-31 | Henrik Grubbström (Grubba) | |
|
71ac9e | 1999-08-29 | Fredrik Hübinette (Hubbe) | | ##########################################################################
|
752e10 | 1999-04-30 | Fredrik Hübinette (Hubbe) | |
AC_MSG_CHECKING(for __pthread_initial_thread_bos)
AC_CACHE_VAL(pike_cv_have_pthread_initial_thread_bos,[
AC_TRY_LINK([#include <pthread.h>
|
13670c | 2015-05-25 | Martin Nilsson | | char *foo(void) { extern char *__pthread_initial_thread_bos;
|
752e10 | 1999-04-30 | Fredrik Hübinette (Hubbe) | | return __pthread_initial_thread_bos; }
],[],[
pike_cv_have_pthread_initial_thread_bos=yes
],[
pike_cv_have_pthread_initial_thread_bos=no
])
])
AC_MSG_RESULT($pike_cv_have_pthread_initial_thread_bos)
if test x$pike_cv_have_pthread_initial_thread_bos = xyes ; then
AC_DEFINE(HAVE_PTHREAD_INITIAL_THREAD_BOS)
else
:
fi
|
d0cb8d | 2000-05-20 | Henrik Grubbström (Grubba) | | ##########################################################################
# On Linux the threads don't inherit euid & egid from the main thread.
# FIXME: Add a real test here!
|
d4d23e | 2005-11-30 | Marek Habersack | | case "$pike_cv_sys_os" in
|
7b86ae | 2014-03-13 | Per Hedbor | | Linux*)
# Since 2.6 it is not actually very likely to be broken,
# since LinuxThreads is not used unless you patch the
# kernel source and build your own kernel.
AC_MSG_CHECKING([If threads are broken ...]);
AC_TRY_RUN([
#define _REENTRANT
#define _THREAD_SAFE
#define _MIT_POSIX_THREADS 1
#include <pthread.h>
void *foo(void *bar) { return (void *)getpid(); }
pthread_mutexattr_t attr;
pthread_mutex_t tmp;
pthread_t gazonk;
int main()
{
void *sune;
#ifdef HAVE_PTHREAD_INIT
pthread_init();
#endif /* HAVE_PTHREAD_INIT */
pthread_create(&gazonk,0,foo,0);
pthread_join(gazonk,&sune);
exit(((int)sune) != getpid());
}],[
AC_MSG_RESULT(no)
],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BROKEN_LINUX_THREAD_EUID)],
[AC_MSG_RESULT(assuming no)])
;;
*kFreeBSD*)
|
d4d23e | 2005-11-30 | Marek Habersack | | ;;
esac
|
752e10 | 1999-04-30 | Fredrik Hübinette (Hubbe) | |
|
40fb6d | 2003-01-05 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([behaviour of the pthread_t type])
AC_CACHE_VAL(pike_cv_thread_t_type, [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
#include <pthread.h>
extern pthread_t bar;
], [
void *foo = (void *)(ptrdiff_t)bar;
return 0;
], [ pike_cv_thread_t_type=integer ], [ pike_cv_thread_t_type=pointer ])
])
AC_MSG_RESULT($pike_cv_thread_t_type)
|
9ab446 | 1998-11-06 | Honza Petrous | | else
AC_MSG_RESULT(no)
LIBS="$OLDLIBS"
|
284e06 | 1998-11-09 | Fredrik Hübinette (Hubbe) | | CFLAGS="$OLDCFLAGS"
|
9ab446 | 1998-11-06 | Honza Petrous | |
|
93a521 | 2007-12-15 | Henrik Grubbström (Grubba) | | echo "POSIX threads not working." >&AC_FD_CC
ulimit -a >&AC_FD_CC 2>&AC_FD_CC
echo >&AC_FD_CC
|
9ab446 | 1998-11-06 | Honza Petrous | | # No POSIX threads.
# Try UNIX threads instead
AC_MSG_CHECKING(unix threads)
case "x$pike_cv_sys_os" in
|
bcb538 | 2001-08-23 | Boyd Lynn Gerber | | xUnixWare*|xOpenUNIX*)
|
9ab446 | 1998-11-06 | Honza Petrous | | if test "$GCC" = yes ; then
|
0d5111 | 2000-04-10 | Boyd Lynn Gerber | | CFLAGS="${CFLAGS} -pthread"
|
9ab446 | 1998-11-06 | Honza Petrous | | else
CFLAGS="${CFLAGS} -Kthread"
fi
CFLAGS="${CFLAGS} -D_UNIXWARE_THREADS_"
;;
*)
LIBS="${LIBS} -lthread"
;;
esac
|
13670c | 2015-05-25 | Martin Nilsson | |
|
9ab446 | 1998-11-06 | Honza Petrous | | AC_CACHE_VAL(pike_cv_unix_threads, [
AC_TRY_RUN([
#define _REENTRANT
#define _THREAD_SAFE
#define _MIT_POSIX_THREADS 1
#include <thread.h>
#ifdef _UNIXWARE_THREADS_
#include <synch.h>
#endif
void *foo(void *bar) { thr_exit(0); return 0; }
mutex_t tmp;
thread_t gazonk;
int main()
{
void *sune;
mutex_lock(& tmp);
thr_create(0,0,foo,0,0,&gazonk);
thr_join(gazonk,0,&sune);
exit(0);
}
],pike_cv_unix_threads=yes,pike_cv_unix_threads=no,pike_cv_unix_threads=no)
])
if test x$pike_cv_unix_threads = xyes ; then
AC_MSG_RESULT(yes)
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
AC_DEFINE(_UNIX_THREADS)
|
67bbf0 | 1999-08-10 | Henrik Grubbström (Grubba) | | AC_DEFINE(PIKE_THREADS)
|
e45ef2 | 2001-02-14 | Mirar (Pontus Hagland) | | using_threads="yes (unix)"
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | else
AC_MSG_RESULT(no)
LIBS="$OLDLIBS"
|
284e06 | 1998-11-09 | Fredrik Hübinette (Hubbe) | | CFLAGS="$OLDCFLAGS"
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | |
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | # Now we've sunk really low -- test for proprietary threads
# SGI old-style shared group processes
|
43032e | 1997-10-09 | Henrik Grubbström (Grubba) | | # AC_CHECK_FUNCS(sproc oserror)
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
43032e | 1997-10-09 | Henrik Grubbström (Grubba) | | # AC_MSG_CHECKING(Fallback to sproc)
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
43032e | 1997-10-09 | Henrik Grubbström (Grubba) | | # if test x$ac_cv_func_sproc$ac_cv_func_oserror = xyesyes; then
# AC_MSG_RESULT(yes)
# AC_DEFINE(_REENTRANT)
# AC_DEFINE(_THREAD_SAFE)
# AC_DEFINE(_SGI_SPROC_THREADS)
# AC_DEFINE(_SGI_MP_SOURCE)
|
e45ef2 | 2001-02-14 | Mirar (Pontus Hagland) | | # using_threads="yes (sgi)"
|
43032e | 1997-10-09 | Henrik Grubbström (Grubba) | | # else
# AC_MSG_RESULT(no)
# :
# fi
|
9ab446 | 1998-11-06 | Honza Petrous | | fi # UNIX threads
|
40fb6d | 2003-01-05 | Henrik Grubbström (Grubba) | |
pike_cv_thread_t_type=integer
|
9ab446 | 1998-11-06 | Honza Petrous | | fi # POSIX threads
|
b1f4eb | 1998-01-13 | Fredrik Hübinette (Hubbe) | | fi # NT
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | else
# Without threads
|
40fb6d | 2003-01-05 | Henrik Grubbström (Grubba) | | pike_cv_thread_t_type=integer
|
50b039 | 1997-01-27 | Henrik Grubbström (Grubba) | | :
|
eec137 | 1996-11-02 | Fredrik Hübinette (Hubbe) | | fi
|
40fb6d | 2003-01-05 | Henrik Grubbström (Grubba) | | if test "x$pike_cv_thread_t_type" = "xpointer"; then
AC_DEFINE(PIKE_THREAD_T_IS_POINTER)
fi
|
91f3b0 | 2004-09-26 | Marcus Comstedt | | if test "x$pike_cv_sys_os" = "xWindows_NT" -o "x$pike_cv_sys_os" = "xAmigaOS"; then :; else
|
98b1e0 | 2007-04-25 | Martin Stjernholm | | AC_MSG_CHECKING(initial stack limit)
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_initial_stack_size,[
|
068558 | 2007-06-09 | Martin Stjernholm | | old_core_limit=`ulimit -c`
ulimit -Sc 0
|
57c0cf | 2008-04-26 | Henrik Grubbström (Grubba) | | rm -f confdefs.out.2 >/dev/null 2>&1 || :
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | AC_TRY_RUN([
#include <stdio.h>
static int depth=0;
FILE *f;
void save_depth(void);
void use_stack(void *page)
{
void *X[8190];
X[0]=page;
save_depth();
use_stack(&X);
}
void save_depth(void)
{
depth+=sizeof(void *)*8192;
fprintf(f,"%d\n",depth);
fflush(f);
if(depth>0x80000000) exit(0);
}
int main(int argc)
{
f=fopen("confdefs.out.2", "w");
/* weird filename to circumvent configure weirdness */
save_depth();
use_stack(0);
}
], [pike_cv_initial_stack_size=''], [
|
57c0cf | 2008-04-26 | Henrik Grubbström (Grubba) | | pike_cv_initial_stack_size=32768
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | while read x; do
|
57c0cf | 2008-04-26 | Henrik Grubbström (Grubba) | | # Some paranoia in case fprintf outputs junk at and of stack...
|
65c57d | 2008-04-26 | Henrik Grubbström (Grubba) | | if test "$pike_cv_initial_stack_size" -lt "$x"; then
|
57c0cf | 2008-04-26 | Henrik Grubbström (Grubba) | | pike_cv_initial_stack_size="$x";
fi
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | done <confdefs.out.2
|
067aa0 | 2013-11-13 | Henrik Grubbström (Grubba) | | if test "$pike_cv_initial_stack_size" = "32768"; then
# Some sort of unsupported failure.
pike_cv_initial_stack_size=''
fi
|
e92098 | 2004-09-26 | Marcus Comstedt | | ], [pike_cv_initial_stack_size=''])
|
068558 | 2007-06-09 | Martin Stjernholm | | ulimit -c $old_core_limit
unset old_core_limit
|
b46d67 | 2005-11-22 | Henrik Grubbström (Grubba) | | rm -f confdefs.out.2 >/dev/null 2>/dev/null || :
|
6c7455 | 2004-03-15 | Henrik Grubbström (Grubba) | | ])
if test x$pike_cv_initial_stack_size = x ; then
AC_MSG_RESULT(unlimited)
else
AC_MSG_RESULT($pike_cv_initial_stack_size)
AC_DEFINE_UNQUOTED(Pike_INITIAL_STACK_SIZE,$pike_cv_initial_stack_size)
fi
fi
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
01185d | 2003-04-01 | Martin Stjernholm | | PIKE_CHECK_CONSTANTS(mutex error check flag,
PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP, [
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#elif defined (HAVE_THREAD_H)
#include <thread.h>
#endif
], PIKE_MUTEX_ERRORCHECK)
########################################################################
PIKE_CHECK_CONSTANTS(recursive mutex flag,
PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP, [
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#elif defined (HAVE_THREAD_H)
#include <thread.h>
#endif
], PIKE_MUTEX_RECURSIVE)
########################################################################
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | AC_FUNC_MMAP
|
693018 | 1996-02-25 | Fredrik Hübinette (Hubbe) | |
|
5444d3 | 2005-05-31 | Henrik Grubbström (Grubba) | | if test "x$ac_cv_func_mmap_fixed_mapped" = "xyes"; then
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | # Mac OS X has an mmap that fails with ENODEV if we try
# to use it for mexec_alloc et al.
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | #
# NB: mmap with MAP_ANON does however work.
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([if mmap can be used to allocate PROT_EXEC])
AC_CACHE_VAL(pike_cv_mmap_PROT_EXEC, [
AC_TRY_RUN([
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include <errno.h>
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#endif /* !MAP_ANONYMOUS && MAP_ANON */
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | int main(int argc, char **argv)
{
void *ptr;
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | int dev_zero = -1;
#ifndef MAP_ANONYMOUS
/* Neither MAP_ANONYMOUS nor MAP_ANON.
* Map some /dev/zero.
*/
dev_zero = open("/dev/zero", O_RDONLY);
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | if (dev_zero < 0) {
fprintf(stderr, "open(\"/dev/zero\", O_RDONLY) failed. errno: %d\n",
errno);
return 1;
}
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | #define MAP_ANONYMOUS 0
#endif /* !MAP_ANONYMOUS */
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | if ((ptr = mmap(NULL, 8192, PROT_EXEC|PROT_READ|PROT_WRITE,
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | MAP_PRIVATE|MAP_ANONYMOUS,
dev_zero, 0)) == MAP_FAILED) {
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | fprintf(stderr, "mmap(NULL, 8192, PROT_EXEC|PROT_READ|PROT_WRITE,\n"
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | "MAP_PRIVATE|MAP_ANONYMOUS, %d, 0) failed. errno: %d\n",
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | dev_zero,
errno);
return 2;
}
return 0;
}
], [
pike_cv_mmap_PROT_EXEC="yes"
], [
pike_cv_mmap_PROT_EXEC="no"
], [
AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include <errno.h>
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | |
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#endif /* !MAP_ANONYMOUS && MAP_ANON */
#if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
#define MAP_ANONYMOUS MAP_ANON
#endif /* !MAP_ANONYMOUS && MAP_ANON */
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | ], [
void *ptr;
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | int dev_zero = -1;
#ifndef MAP_ANONYMOUS
/* Neither MAP_ANONYMOUS nor MAP_ANON.
* Map some /dev/zero.
*/
dev_zero = open("/dev/zero", O_RDONLY);
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | if (dev_zero < 0) return 1;
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | #define MAP_ANONYMOUS 0
#endif /* !MAP_ANONYMOUS */
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | if ((ptr = mmap(NULL, 8192, PROT_EXEC|PROT_READ|PROT_WRITE,
|
672ebb | 2005-05-30 | Henrik Grubbström (Grubba) | | MAP_PRIVATE|MAP_ANONYMOUS,
dev_zero, 0)) == MAP_FAILED) {
|
569a8b | 2005-05-30 | Henrik Grubbström (Grubba) | | return 2;
}
return 0;
], [
pike_cv_mmap_PROT_EXEC="yes"
], [
pike_cv_mmap_PROT_EXEC="no"
])
])
])
AC_MSG_RESULT($pike_cv_mmap_PROT_EXEC)
if test "x$pike_cv_mmap_PROT_EXEC" = "xyes"; then
AC_DEFINE(MEXEC_USES_MMAP)
fi
fi
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | AC_CHECK_FUNCS( \
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | _crypt \
|
063fe3 | 1998-03-10 | Per Hedbor | | poll \
|
236e8e | 2014-09-24 | Henrik Grubbström (Grubba) | | accept4 \
|
ce017d | 2006-04-24 | Henrik Grubbström (Grubba) | | closefrom \
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | crypt \
|
ce017d | 2006-04-24 | Henrik Grubbström (Grubba) | | fdwalk \
|
9548a8 | 1997-05-07 | Per Hedbor | | gethrtime \
gethrvtime \
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | getrlimit \
getrusage \
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | gettimeofday \
|
aec4a7 | 2009-05-28 | Henrik Grubbström (Grubba) | | inet_ntop \
|
5a8cdd | 2006-06-20 | Martin Stjernholm | | gmtime_r \
|
1bf419 | 2006-07-02 | Martin Stjernholm | | gmtime_s \
|
12327f | 2013-05-22 | Per Hedbor | | strptime \
|
16e049 | 2012-03-08 | Henrik Grubbström (Grubba) | | mallinfo \
|
89d10f | 2012-08-17 | Henrik Grubbström (Grubba) | | mallopt \
|
b14354 | 2003-02-28 | Henrik Grubbström (Grubba) | | ptrace \
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | setrlimit \
|
3605b8 | 1998-09-18 | Peter J. Holzer | | setresuid \
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | sigaction \
sigvec \
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | strcasecmp \
times \
|
2ea211 | 2002-09-07 | Henrik Grubbström (Grubba) | | tzset \
|
1718fa | 2009-05-28 | Henrik Grubbström (Grubba) | | _snprintf \
|
693018 | 1996-02-25 | Fredrik Hübinette (Hubbe) | | wait3 \
|
65887d | 1995-11-15 | Fredrik Hübinette (Hubbe) | | wait4 \
waitpid \
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | munmap \
|
423839 | 1998-07-09 | Francesco Chemolli | | shl_load \
|
59bc1b | 1997-01-22 | Bernhard Fastenrath | | dld_link \
dld_get_func \
|
3e84d6 | 1997-04-16 | Fredrik Hübinette (Hubbe) | | pipe \
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | strdup \
|
dba43e | 2014-12-08 | Martin Nilsson | | _strdup \
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | kill \
alarm \
|
85f59e | 1998-01-08 | Fredrik Hübinette (Hubbe) | | fork1 \
|
d386e6 | 1998-03-20 | Fredrik Hübinette (Hubbe) | | flock \
|
e6f98c | 1998-05-22 | David Hedbor | | lockf \
|
0d52dd | 1998-01-16 | Fredrik Hübinette (Hubbe) | | setuid getuid seteuid geteuid \
|
28dccb | 2014-09-02 | Martin Nilsson | | setgid getgid getegid \
|
f087c4 | 1998-02-04 | Fredrik Hübinette (Hubbe) | | getpwent getpwnam getpwuid \
getgrent getgrnam \
|
28dccb | 2014-09-02 | Martin Nilsson | | setsid \
|
d386e6 | 1998-03-20 | Fredrik Hübinette (Hubbe) | | initgroups setgroups \
|
9c5020 | 1998-03-26 | Fredrik Hübinette (Hubbe) | | socketpair \
|
fbb9aa | 2017-07-11 | Bill Welliver | | bswap16 \
__bswap16 \
|
551582 | 2017-07-11 | Stephen R. van den Berg | | bswap32 \
|
fbb9aa | 2017-07-11 | Bill Welliver | | __bswap32 \
bswap64 \
__bswap64 \
|
5ff14f | 1998-05-25 | Marcus Comstedt | | fpclass \
fp_class_d \
isinf \
|
92e454 | 2016-01-14 | Martin Nilsson | | _isnan \
|
5ff14f | 1998-05-25 | Marcus Comstedt | | iszero \
|
4bd4a5 | 2016-01-10 | Martin Nilsson | | _finite \
|
5ff14f | 1998-05-25 | Marcus Comstedt | | signbit \
|
1b28b8 | 2001-05-28 | Marcus Comstedt | | nan \
|
70c9c1 | 1998-05-05 | Fredrik Hübinette (Hubbe) | | nice \
|
ea959d | 1999-02-01 | Per Hedbor | | __priocntl \
sched_setscheduler \
setpriority \
|
dac637 | 1999-10-17 | Mirar (Pontus Hagland) | | nanosleep \
|
8d9231 | 2009-03-13 | Martin Stjernholm | | sched_yield \
|
a85ac5 | 2001-08-23 | Per Hedbor | | thr_yield \
|
f663a0 | 2003-03-05 | Martin Stjernholm | | prctl \
|
1b6170 | 2005-11-18 | Henrik Grubbström (Grubba) | | SetFilePointerEx \
|
6d2c67 | 2005-06-23 | Henrik Grubbström (Grubba) | | sync_instruction_memory \
|
d97bbf | 2005-08-27 | Jonas Wallden | | MakeDataExecutable \
|
5a8cdd | 2006-06-20 | Martin Stjernholm | | _get_timezone \
_get_daylight \
|
83b287 | 2006-07-02 | Martin Stjernholm | | localtime_s \
|
13ee8f | 2006-08-09 | Martin Stjernholm | | sysconf \
getpagesize \
GetSystemInfo \
|
247f73 | 2007-06-10 | Martin Stjernholm | | clock_getcpuclockid \
|
e2d33e | 2008-06-24 | Martin Stjernholm | | backtrace \
|
8196fb | 2008-07-31 | Martin Stjernholm | | SetErrorMode \
|
8dc5b4 | 2008-11-07 | Martin Stjernholm | | thread_info \
host_get_clock_service \
|
d00b86 | 2013-08-14 | Marcus Comstedt | | posix_memalign \
|
6a1ed0 | 2014-09-03 | Martin Nilsson | | _dosmaperr \
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | )
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
87076a | 2003-02-24 | Henrik Grubbström (Grubba) | | # SunOS 4 realloc() returns NULL when reallocing NULL.
AC_MSG_CHECKING([if realloc(NULL, SZ) works])
AC_CACHE_VAL(pike_cv_realloc_null_works, [
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
void *foo = realloc(NULL, 16);
return !foo;
}
], [ pike_cv_realloc_null_works=yes
], [ pike_cv_realloc_null_works=no
], [ pike_cv_realloc_null_works=no
|
02b555 | 2003-02-24 | Henrik Grubbström (Grubba) | | ])
|
87076a | 2003-02-24 | Henrik Grubbström (Grubba) | | ])
if test "x$pike_cv_realloc_null_works" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_WORKING_REALLOC_NULL)
else
AC_MSG_RESULT(no)
fi
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for the type of the last argument to accept)
|
11ceb0 | 1998-08-07 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_accept_size_t, [
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | for t in socklen_t size_t int; do
AC_TRY_COMPILE([
#ifndef _LARGEFILE_SOURCE
# define _FILE_OFFSET_BITS 64
# define _LARGEFILE_SOURCE
# define _LARGEFILE64_SOURCE 1
#endif
/* HPUX needs these too... */
#ifndef __STDC_EXT__
# define __STDC_EXT__
#endif /* !__STDC_EXT__ */
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
/* NT */
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | #ifdef HAVE_WINSOCK2_H
#include <WinSock2.h>
#ifdef HAVE_WS2TCPIP_H
/* Needed for IPv6 support. */
#include <WS2tcpip.h>
#endif
#elif defined(HAVE_WINSOCK_H)
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | #include <winsock.h>
#endif
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | /* Here is the actual test: */
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | int accept(int, struct sockaddr *, $t *);
], [
/* EMPTY */
], [
pike_cv_accept_size_t=$t
break
], [
AC_TRY_COMPILE([
|
11ceb0 | 1998-08-07 | Henrik Grubbström (Grubba) | | #ifndef _LARGEFILE_SOURCE
# define _FILE_OFFSET_BITS 64
# define _LARGEFILE_SOURCE
# define _LARGEFILE64_SOURCE 1
#endif
/* HPUX needs these too... */
#ifndef __STDC_EXT__
# define __STDC_EXT__
#endif /* !__STDC_EXT__ */
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
|
3e82a7 | 1998-09-01 | Fredrik Hübinette (Hubbe) | | /* NT */
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | #ifdef HAVE_WINSOCK2_H
#include <WinSock2.h>
#ifdef HAVE_WS2TCPIP_H
/* Needed for IPv6 support. */
#include <WS2tcpip.h>
#endif
#elif defined(HAVE_WINSOCK_H)
|
3e82a7 | 1998-09-01 | Fredrik Hübinette (Hubbe) | | #include <winsock.h>
#endif
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | /* Here is the actual test: */
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | SOCKET accept(SOCKET, struct sockaddr *, $t *);
], [
/* EMPTY */
], [
pike_cv_accept_size_t=$t
break
], [])
])
done
if test "x$pike_cv_accept_size_t" = "x"; then
# Check if it could be a Psocklen_t
# Psocklen_t is a stupid typedef of socklen_t *.
|
69bae8 | 2000-08-20 | Henrik Grubbström (Grubba) | | AC_TRY_COMPILE([
#ifndef _LARGEFILE_SOURCE
# define _FILE_OFFSET_BITS 64
# define _LARGEFILE_SOURCE
# define _LARGEFILE64_SOURCE 1
#endif
/* HPUX needs these too... */
#ifndef __STDC_EXT__
# define __STDC_EXT__
#endif /* !__STDC_EXT__ */
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
/* NT */
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | #ifdef HAVE_WINSOCK2_H
#include <WinSock2.h>
#ifdef HAVE_WS2TCPIP_H
/* Needed for IPv6 support. */
#include <WS2tcpip.h>
#endif
#elif defined(HAVE_WINSOCK_H)
|
69bae8 | 2000-08-20 | Henrik Grubbström (Grubba) | | #include <winsock.h>
#endif
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | /* Here is the actual test: */
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | int accept(int, struct sockaddr *, Psocklen_t);
|
69bae8 | 2000-08-20 | Henrik Grubbström (Grubba) | | ], [
/* EMPTY */
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | ], [
pike_cv_accept_size_t=socklen_t
], [
# FIXME: Should probably have a warning here.
# FIXME: Should we check if socklen_t exists, and use that?
pike_cv_accept_size_t=int
])
fi
|
11ceb0 | 1998-08-07 | Henrik Grubbström (Grubba) | | ])
|
6cefa1 | 2000-09-27 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT($pike_cv_accept_size_t *)
|
11ceb0 | 1998-08-07 | Henrik Grubbström (Grubba) | | AC_DEFINE_UNQUOTED(ACCEPT_SIZE_T, $pike_cv_accept_size_t)
|
08af09 | 2000-04-12 | Marcus Comstedt | | if test x"$pike_cv_sys_os" = xWindows_NT ; then
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | AC_DEFINE(HAVE_LOADLIBRARY)
AC_DEFINE(HAVE_FREELIBRARY)
AC_DEFINE(HAVE_GETPROCADDRESS)
AC_DEFINE(DL_EXPORT, _dlspec(export))
else
AC_DEFINE(DL_EXPORT, [])
fi
|
e78abd | 1996-11-21 | Fredrik Hübinette (Hubbe) | | if test $ac_cv_func_crypt$ac_cv_func__crypt = nono ; then
|
905bb1 | 1998-01-31 | Fredrik Hübinette (Hubbe) | | AC_CHECK_LIB(crypt,crypt,[LIBS="${LIBS} -lcrypt" ; AC_DEFINE(HAVE_CRYPT)],
[
if test -f "$srcdir/crypt.c"; then
AC_MSG_RESULT(Using crypt.c for BSD style crypt())
EXTRA_OBJS="${EXTRA_OBJS} crypt.o"
AC_DEFINE(HAVE_CRYPT)
|
a68066 | 2000-08-20 | Henrik Grubbström (Grubba) | | AC_DEFINE(USE_CRYPT_C)
|
905bb1 | 1998-01-31 | Fredrik Hübinette (Hubbe) | | else
:
fi
])
|
e78abd | 1996-11-21 | Fredrik Hübinette (Hubbe) | | fi
|
5539c5 | 1998-06-08 | Henrik Grubbström (Grubba) | | #############################################################################
|
2cb289 | 2015-07-23 | Jonas Walldén | | # isfinite() is a macro on at least OS X and Linux which doesn't play well
# with AC_CHECK_FUNCS().
MY_CHECK_FUNCTION(isfinite,
[
#include <math.h>
], [
int t = isfinite(0.0);
exit(0);
])
#############################################################################
|
5539c5 | 1998-06-08 | Henrik Grubbström (Grubba) | |
# FreeBSD 3.0 has broken F_SETFD when running with threads.
AC_MSG_CHECKING(whether F_SETFD exists and works)
AC_CACHE_VAL(pike_cv_broken_f_setfd, [
AC_TRY_RUN([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#include <sys/stat.h>
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif /* HAVE_FCNTL_H */
#include <stdio.h>
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif /* FD_CLOEXEC */
int main(int argc, char **argv)
{
int fd = 0;
if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) {
exit(1);
}
if (fcntl(fd, F_GETFD) != FD_CLOEXEC) {
exit(1);
}
exit(0);
}
], pike_cv_broken_f_setfd=no, pike_cv_broken_f_setfd=yes,
|
56d1c0 | 2000-06-29 | Henrik Grubbström (Grubba) | | pike_cv_broken_f_setfd=yes)
|
5539c5 | 1998-06-08 | Henrik Grubbström (Grubba) | | ])
if test "x$pike_cv_broken_f_setfd" = "xyes"; then
AC_MSG_RESULT(no)
AC_DEFINE(HAVE_BROKEN_F_SETFD)
else
AC_MSG_RESULT(yes)
fi
#############################################################################
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | AC_STRUCT_TM
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(extern int timezone)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_has_external_timezone,[
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | AC_TRY_LINK([
#include <time.h>
],[
int _tz;
_tz=timezone;
|
a05f92 | 1998-05-05 | Fredrik Hübinette (Hubbe) | | timezone=_tz;
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | ],pike_cv_has_external_timezone=yes,pike_cv_has_external_timezone=no)
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | ])
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | if test "$pike_cv_has_external_timezone" = "yes"; then
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | AC_DEFINE(HAVE_EXTERNAL_TIMEZONE)
fi
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT($pike_cv_has_external_timezone)
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | |
#############################################################################
|
e0b956 | 1996-07-02 | Fredrik Hübinette (Hubbe) | | # No test for this yet...
AC_DEFINE(HAVE_STRUCT_TIMEVAL)
|
dcad55 | 1996-08-03 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | |
|
486dbe | 2003-04-23 | Marcus Comstedt | | AC_MSG_CHECKING(struct sockaddr_in6)
AC_CACHE_VAL(pike_cv_has_struct_sockaddr_in6,[
AC_TRY_LINK([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif /* HAVE_SYS_SOCKET_H */
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | #ifdef HAVE_WINSOCK2_H
#include <WinSock2.h>
#ifdef HAVE_WS2TCPIP_H
#include <WS2tcpip.h>
#endif
#elif defined(HAVE_WINSOCK_H)
#include <winsock.h>
#endif
|
486dbe | 2003-04-23 | Marcus Comstedt | | ],[
struct sockaddr_in6 foo;
],pike_cv_has_struct_sockaddr_in6=yes,pike_cv_has_struct_sockaddr_in6=no)
])
if test "$pike_cv_has_struct_sockaddr_in6" = "yes"; then
AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
fi
AC_MSG_RESULT($pike_cv_has_struct_sockaddr_in6)
#############################################################################
|
c67670 | 2006-08-09 | Martin Stjernholm | | if test $ac_cv_header_malloc_h = yes; then
AC_MSG_CHECKING(struct mallinfo in malloc.h)
AC_CACHE_VAL(pike_cv_struct_mallinfo, [
AC_TRY_LINK([
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
], [
struct mallinfo foo;
], pike_cv_struct_mallinfo=yes, pike_cv_struct_mallinfo=no)
])
if test $pike_cv_struct_mallinfo = yes; then
AC_DEFINE(HAVE_STRUCT_MALLINFO, 1,
[Defined if malloc.h contains a struct mallinfo.])
fi
AC_MSG_RESULT($pike_cv_struct_mallinfo)
fi
#############################################################################
|
9aae7e | 2001-06-20 | Per Hedbor | | # if test "x$ac_cv_func_gethrtime" != "xyes"; then
# AC_MSG_CHECKING(if we can make gethrtime by the RDTSC instruction)
# AC_CACHE_VAL(pike_cv_own_gethrtime_rdtsc, [
# AC_TRY_RUN([
# #include <unistd.h>
# #include <stdio.h>
# #include <sys/time.h>
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # static long long hrtime_rtsc_zero;
# static long long hrtime_rtsc_last;
# static long long hrtime_max;
# static struct timeval hrtime_timeval_zero;
# static long double hrtime_conv=0.0;
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # #define GETTIMEOFDAY(PTR) gettimeofday(PTR,NULL)
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # #define RTSC(x) \
# __asm__ __volatile__ ( "rdtsc" \
# :"=a" (((unsigned long*)&x)[0]), \
# "=d" (((unsigned long*)&x)[1]))
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # void own_gethrtime_init()
# {
# GETTIMEOFDAY(&hrtime_timeval_zero);
# RTSC(hrtime_rtsc_zero);
# hrtime_rtsc_last=hrtime_rtsc_zero;
# hrtime_max=0;
# }
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # int own_gethrtime_update(struct timeval *ptr)
# {
# long long td,t,now;
# GETTIMEOFDAY(ptr);
# RTSC(now);
# td=((long long)ptr->tv_sec-hrtime_timeval_zero.tv_sec)*1000000000+
# ((long long)ptr->tv_usec-hrtime_timeval_zero.tv_usec)*1000;
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # hrtime_rtsc_last=now;
# t=now-hrtime_rtsc_zero;
# if (t) hrtime_conv=((long double)td)/t;
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # return 1;
# }
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # /* this is very sensitive to the compiler; keep all crap */
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # long long gethrtime()
# {
# long long now;
# struct timeval tv;
|
13670c | 2015-05-25 | Martin Nilsson | | #
# if (hrtime_conv==0.0)
|
9aae7e | 2001-06-20 | Per Hedbor | | # {
# if (!own_gethrtime_update(&tv)) /* not calibrated yet */
# {
# return
# hrtime_max=
# ((long long)tv.tv_sec-hrtime_timeval_zero.tv_sec)*1000000000+
# ((long long)tv.tv_usec-hrtime_timeval_zero.tv_usec)*1000;
# }
# }
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # RTSC(now);
|
13670c | 2015-05-25 | Martin Nilsson | | #
# if (now-hrtime_rtsc_last > 2000000000)
|
9aae7e | 2001-06-20 | Per Hedbor | | # {
# own_gethrtime_update(&tv);
# return gethrtime();
# }
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # now = (long long) ( (long double)(now-hrtime_rtsc_zero) * hrtime_conv );
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # if (now<hrtime_max) now=hrtime_max;
# return hrtime_max=now;
# }
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # #include <stdio.h>
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # int main()
# {
# struct timeval tv1,tv2;
# long long td,t1,t2;
# own_gethrtime_init();
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # usleep(10);
# own_gethrtime_update(&tv2);
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # t1=gethrtime();
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # gettimeofday(&tv1,NULL);
# for (;;) /* busy loop */
# {
# GETTIMEOFDAY(&tv2);
# td=((long long)tv2.tv_sec-tv1.tv_sec)*1000000000+
# ((long long)tv2.tv_usec-tv1.tv_usec)*1000;
# if (td>1000000) break;
# }
# t2=gethrtime();
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # /* printf("t2-t1=%lld\n",t2-t1); */
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # if (t2==hrtime_rtsc_zero ||
# t2-t1>1100000 ||
# t2-t1<900000) return 1;
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
9aae7e | 2001-06-20 | Per Hedbor | | # return 0;
# }], pike_cv_own_gethrtime_rdtsc=yes,
# pike_cv_own_gethrtime_rdtsc=no, pike_cv_own_gethrtime_rdtsc=no)
# ])
# if test "x$pike_cv_own_gethrtime_rdtsc" = "xyes"; then
# AC_MSG_RESULT(yes)
# AC_DEFINE(OWN_GETHRTIME)
# AC_DEFINE(OWN_GETHRTIME_RDTSC)
# AC_DEFINE(HAVE_GETHRTIME)
|
13670c | 2015-05-25 | Martin Nilsson | | # else
|
9aae7e | 2001-06-20 | Per Hedbor | | # AC_MSG_RESULT([no])
# fi
# fi
|
13670c | 2015-05-25 | Martin Nilsson | | #
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(if struct tm has tm_gmtoff)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_struct_tm_has_gmtoff,[
|
658f1a | 1997-01-26 | Fredrik Hübinette (Hubbe) | | AC_TRY_COMPILE([
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | #ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
|
a28592 | 1998-09-27 | Henrik Grubbström (Grubba) | | #include <time.h>
#endif
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | ],[
int _tz;
struct tm foo;
|
647f5d | 2001-12-03 | Xavier Beaudouin | | _tz=foo.tm_gmtoff;
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | ],pike_cv_struct_tm_has_gmtoff=yes,pike_cv_struct_tm_has_gmtoff=no)
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | ])
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | if test "$pike_cv_struct_tm_has_gmtoff" = "yes"; then
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | AC_DEFINE(STRUCT_TM_HAS_GMTOFF)
fi
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT($pike_cv_struct_tm_has_gmtoff)
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | |
|
4b2ccc | 2002-03-21 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if struct tm has __tm_gmtoff)
AC_CACHE_VAL(pike_cv_struct_tm_has___tm_gmtoff,[
AC_TRY_COMPILE([
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
],[
int _tz;
struct tm foo;
_tz=foo.__tm_gmtoff;
],pike_cv_struct_tm_has___tm_gmtoff=yes,pike_cv_struct_tm_has___tm_gmtoff=no)
])
if test "$pike_cv_struct_tm_has___tm_gmtoff" = "yes"; then
AC_DEFINE(STRUCT_TM_HAS___TM_GMTOFF)
fi
AC_MSG_RESULT($pike_cv_struct_tm_has___tm_gmtoff)
|
6cbfe4 | 2009-03-17 | Henrik Grubbström (Grubba) | | #############################################################################
# iovec
AC_MSG_CHECKING(if struct iovec is defined)
AC_CACHE_VAL(pike_cv_struct_iovec, [
AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#include <unistd.h>
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif /* HAVE_SYS_UIO_H */
],[
struct iovec iov;
iov.iov_base = (void *)0;
iov.iov_len = 0;
], [ pike_cv_struct_iovec=yes ], [ pike_cv_struct_iovec=no ])
])
if test "$pike_cv_struct_iovec" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRUCT_IOVEC)
else
AC_MSG_RESULT(no)
fi
#############################################################################
# msghdr et al.
AC_MSG_CHECKING(if struct msghdr is defined)
AC_CACHE_VAL(pike_cv_struct_msghdr, [
AC_TRY_COMPILE([
/* Needed for <sys/socket.h> on FreeBSD 4.9. */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],[
struct msghdr msg;
msg.msg_iov = (void *)0;
msg.msg_iovlen = 0;
], [ pike_cv_struct_msghdr=yes ], [ pike_cv_struct_msghdr=no ])
])
if test "$pike_cv_struct_msghdr" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRUCT_MSGHDR)
AC_MSG_CHECKING(if struct msghdr has the member msg_control (XPG 4.2))
AC_CACHE_VAL(pike_cv_struct_msghdr_msg_control, [
AC_TRY_COMPILE([
/* Needed for <sys/socket.h> on FreeBSD 4.9. */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],[
struct msghdr msg;
|
13670c | 2015-05-25 | Martin Nilsson | |
|
6cbfe4 | 2009-03-17 | Henrik Grubbström (Grubba) | | msg.msg_control = (void *)0;
msg.msg_controllen = 0;
], [ pike_cv_struct_msghdr_msg_control=yes ], [
pike_cv_struct_msghdr_msg_control=no ])
])
if test "$pike_cv_struct_msghdr_msg_control" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRUCT_MSGHDR_MSG_CONTROL)
else
AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(if struct msghdr has the member msg_accrights (old BSD))
AC_CACHE_VAL(pike_cv_struct_msghdr_msg_accrights, [
AC_TRY_COMPILE([
/* Needed for <sys/socket.h> on FreeBSD 4.9. */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
],[
struct msghdr msg;
|
13670c | 2015-05-25 | Martin Nilsson | |
|
6cbfe4 | 2009-03-17 | Henrik Grubbström (Grubba) | | msg.msg_accrights = (void *)0;
msg.msg_accrightslen = 0;
], [ pike_cv_struct_msghdr_msg_accrights=yes ], [
pike_cv_struct_msghdr_msg_accrights=no ])
])
if test "$pike_cv_struct_msghdr_msg_accrights" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS)
else
AC_MSG_RESULT(no)
fi
else
AC_MSG_RESULT(no)
fi
|
04343e | 2007-06-17 | Martin Stjernholm | | #############################################################################
|
c69eb5 | 1996-09-29 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(for USHRT_MAX definition)
AC_CACHE_VAL(pike_cv_ushrt_max_is_defined,[
|
21ee4b | 2003-12-16 | Marek Habersack | | AC_EGREP_CPP(oui,[
|
c69eb5 | 1996-09-29 | Fredrik Hübinette (Hubbe) | | #include <limits.h>
#ifdef USHRT_MAX
|
21ee4b | 2003-12-16 | Marek Habersack | | oui
|
c69eb5 | 1996-09-29 | Fredrik Hübinette (Hubbe) | | #endif
],pike_cv_ushrt_max_is_defined=yes,pike_cv_ushrt_max_is_defined=no)
])
if test "$pike_cv_ushrt_max_is_defined" = "no" ; then
AC_DEFINE(USHRT_MAX,65535)
fi
AC_MSG_RESULT($pike_cv_ushrt_max_is_defined)
|
067bc1 | 1996-06-21 | Fredrik Hübinette (Hubbe) | |
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | define(MY_CHECK_HEADERS,
[
AC_MSG_CHECKING(for $1 declaration)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_decl_$1,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | [
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | OLD_CPPFLAGS="$CPPFLAGS"
|
63a0f7 | 2003-01-27 | Martin Stjernholm | | pike_cv_decl_$1=nonexistent
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | for a in $2
do
|
63a0f7 | 2003-01-27 | Martin Stjernholm | | AC_EGREP_HEADER($1,$a,[ pike_cv_decl_$1=existent; break ])
|
13670c | 2015-05-25 | Martin Nilsson | |
|
b933a6 | 2002-10-03 | Henrik Grubbström (Grubba) | | # Kludge for MacOS X. Retry with the traditional cpp...
CPPFLAGS="$CPPFLAGS -traditional-cpp"
|
63a0f7 | 2003-01-27 | Martin Stjernholm | | AC_EGREP_HEADER($1,$a,[ pike_cv_decl_$1=existent; break ])
|
b933a6 | 2002-10-03 | Henrik Grubbström (Grubba) | | CPPFLAGS="$OLD_CPPFLAGS"
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | done
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | CPPFLAGS="$OLD_CPPFLAGS"
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | ])
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT($pike_cv_decl_$1)
|
63a0f7 | 2003-01-27 | Martin Stjernholm | | if test "$pike_cv_decl_$1" = nonexistent -o "$pike_cv_decl_$1" = nonexistant; then
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_DEFINE(translit($1,[a-z],[A-Z])[]_DECL_MISSING)
fi
])
MY_CHECK_HEADERS(strchr,string.h unistd.h stdlib.h)
MY_CHECK_HEADERS(malloc,memory.h unistd.h stdlib.h)
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | MY_CHECK_HEADERS(getpeername,sys/socket.h sys/socketvar.h sys/socketio.h winsock.h winsock2.h ws2tcpip.h)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | MY_CHECK_HEADERS(popen,stdio.h unistd.h)
MY_CHECK_HEADERS(getenv,unistd.h stdlib.h)
|
12368a | 2003-04-30 | Henrik Grubbström (Grubba) | | MY_CHECK_HEADERS(gethostname,unistd.h netdb.h winsock.h winsock2.h ws2tcpip.h)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
AC_ALLOCA
|
9b372f | 1998-09-05 | Henrik Grubbström (Grubba) | | AC_CHECK_FUNCS(ualarm setitimer)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
9b372f | 1998-09-05 | Henrik Grubbström (Grubba) | | if test "x$ac_cv_func_ualarm" = "xyes"; then
AC_MSG_CHECKING(no of arguments to ualarm)
AC_CACHE_VAL(pike_cv_ualarm_takes_two_args,
[
AC_TRY_COMPILE([
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
],[
|
e16ff5 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | ualarm(0,0);
|
9b372f | 1998-09-05 | Henrik Grubbström (Grubba) | | ],pike_cv_ualarm_takes_two_args=yes,pike_cv_ualarm_takes_two_args=no)
])
if test "$pike_cv_ualarm_takes_two_args" = yes; then
AC_MSG_RESULT(2)
AC_DEFINE(UALARM_TAKES_TWO_ARGS)
else
AC_MSG_RESULT(1)
fi
fi
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
4499d5 | 2003-03-06 | Henrik Grubbström (Grubba) | | if test "x$ac_cv_func_ptrace" = "xyes"; then
AC_MSG_CHECKING(no of arguments to ptrace)
AC_CACHE_VAL(pike_cv_ptrace_takes_four_args,
[
AC_TRY_COMPILE([
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#ifdef HAVE_SYS_PTRACE_H
#include <sys/ptrace.h>
#endif /* HAVE_SYS_PTRACE_H */
],[
|
d574b8 | 2003-03-27 | Henrik Grubbström (Grubba) | | ptrace(0,0,0,0);
|
4499d5 | 2003-03-06 | Henrik Grubbström (Grubba) | | ],pike_cv_ptrace_takes_four_args=yes,pike_cv_ptrace_takes_four_args=no)
])
if test "$pike_cv_ptrace_takes_four_args" = yes; then
AC_MSG_RESULT(4)
AC_DEFINE(PTRACE_TAKES_FOUR_ARGS)
else
AC_MSG_RESULT(5)
fi
|
d574b8 | 2003-03-27 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([type of argument 3 (addr) to ptrace])
AC_CACHE_VAL(pike_cv_ptrace_addr_type, [
AC_TRY_COMPILE([
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* HAVE_SYS_TYPES_H */
#ifdef HAVE_SYS_PTRACE_H
#include <sys/ptrace.h>
#endif /* HAVE_SYS_PTRACE_H */
],[
#ifdef PTRACE_TAKES_FOUR_ARGS
ptrace(0,0,(void *)0,0);
#else
ptrace(0,0,(void *)0,0,0);
#endif
],pike_cv_ptrace_addr_type=pointer,pike_cv_ptrace_addr_type=integer)
])
if test "$pike_cv_ptrace_addr_type" = pointer; then
AC_MSG_RESULT(pointer)
AC_DEFINE(PTRACE_ADDR_TYPE_IS_POINTER)
else
AC_MSG_RESULT([integer (SVID)])
fi
|
4499d5 | 2003-03-06 | Henrik Grubbström (Grubba) | | fi
|
d7be5b | 1997-01-28 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
2ee669 | 1999-01-07 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(stack direction)
AC_CACHE_VAL(pike_cv_hardware_stack_direction,
[
|
6b15b7 | 2001-01-19 | Henrik Grubbström (Grubba) | | AC_TRY_RUN([
|
46d5c5 | 2000-02-03 | Henrik Grubbström (Grubba) | | #include <stdio.h>
|
637eb2 | 2005-06-01 | Henrik Grubbström (Grubba) | | static int find_stack_direction(void *foo, int cnt)
|
2ee669 | 1999-01-07 | Fredrik Hübinette (Hubbe) | | {
|
637eb2 | 2005-06-01 | Henrik Grubbström (Grubba) | | if (cnt) return 1*find_stack_direction(foo, cnt>>1);
|
2ee669 | 1999-01-07 | Fredrik Hübinette (Hubbe) | | if (((void *)&foo) > foo) {
return 1;
} else {
return -1;
}
}
|
637eb2 | 2005-06-01 | Henrik Grubbström (Grubba) | | int main() { void *bar; exit( find_stack_direction(&bar, 0x10) > 0); }
|
6b15b7 | 2001-01-19 | Henrik Grubbström (Grubba) | | ], [ pike_cv_hardware_stack_direction=down
], [ pike_cv_hardware_stack_direction=up
], [
|
0a8698 | 2003-11-07 | Martin Stjernholm | | AC_MSG_WARN([Defaulting to down.])
|
6b15b7 | 2001-01-19 | Henrik Grubbström (Grubba) | | pike_cv_hardware_stack_direction=down
])
|
2ee669 | 1999-01-07 | Fredrik Hübinette (Hubbe) | | ])
AC_MSG_RESULT($pike_cv_hardware_stack_direction)
if grep STACK_DIRECTION confdefs.h >/dev/null 2>&1; then
:
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif test "x$pike_cv_hardware_stack_direction" = "xup" ; then
AC_DEFINE(STACK_DIRECTION, 1)
|
2ee669 | 1999-01-07 | Fredrik Hübinette (Hubbe) | | else
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_DEFINE(STACK_DIRECTION, -1)
|
2ee669 | 1999-01-07 | Fredrik Hübinette (Hubbe) | | fi
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(byteorder)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_hardware_byteorder,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | [
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | if test "x$enable_binary" = "xno"; then
pike_cv_hardware_byteorder=0
else
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_TRY_RUN([
#include <stdio.h>
int main()
{
|
5c8e89 | 1995-10-29 | Fredrik Hübinette (Hubbe) | | #if SIZEOF_INT == 4
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #define T int
#else
#define T long
#endif
FILE *f;
T a;
int e;
for(e=0;e<sizeof(T);e++)
((char *)&a)[e]=(e+1) % 10;
f=fopen("conftest.out.2","w");
for(e=0;e<sizeof(T);e++)
{
fprintf(f,"%d",(int)(a & 255));
a>>=8;
}
fprintf(f,"\n");
fclose(f);
|
13670c | 2015-05-25 | Martin Nilsson | |
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | return 0;
}],
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | pike_cv_hardware_byteorder=`cat conftest.out.2`
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | ,
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | pike_cv_hardware_byteorder=0
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | ,
pike_cv_hardware_byteorder=0
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | )
fi
])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT($pike_cv_hardware_byteorder)
|
71f3a2 | 1998-11-22 | Fredrik Hübinette (Hubbe) | | AC_DEFINE_UNQUOTED(PIKE_BYTEORDER,$pike_cv_hardware_byteorder)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
6a3647 | 2000-12-19 | Marcus Comstedt | | ########################################################################
|
b46752 | 2017-06-25 | Martin Nilsson | | AC_MSG_CHECKING(null is special)
AC_CACHE_VAL(pike_cv_null_is_special,
[
AC_TRY_RUN([
#include <stdio.h>
union test {
void * ptr;
int val;
};
int main()
{
union test t;
t.ptr = NULL;
|
f8f2bb | 2017-06-25 | Martin Nilsson | | if( t.val == 0 ) return 1;
return 0;
|
b46752 | 2017-06-25 | Martin Nilsson | | }], pike_cv_null_is_special=yes, pike_cv_null_is_special=no, pike_cv_null_is_special=no)
])
AC_MSG_RESULT($pike_cv_null_is_special)
if test "x$pike_cv_null_is_special" = xyes ; then
AC_DEFINE(PIKE_NULL_IS_SPECIAL)
fi
########################################################################
|
b2d7f3 | 2003-10-30 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(pointer alignment)
|
6a3647 | 2000-12-19 | Marcus Comstedt | | AC_CACHE_VAL(pike_cv_hardware_alignment,
[
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test "x$enable_binary" = "xno"; then
pike_cv_hardware_alignment=4
else
AC_TRY_RUN([
|
6a3647 | 2000-12-19 | Marcus Comstedt | | #include <stdio.h>
|
b2d7f3 | 2003-10-30 | Henrik Grubbström (Grubba) | | struct x { char a; void *b; };
|
6a3647 | 2000-12-19 | Marcus Comstedt | |
|
b2d7f3 | 2003-10-30 | Henrik Grubbström (Grubba) | | struct y { void *a; char b; };
|
6a3647 | 2000-12-19 | Marcus Comstedt | |
int main(int argc, char *argv[])
{
|
b2d7f3 | 2003-10-30 | Henrik Grubbström (Grubba) | | FILE *f;
int align = (int)&(((struct x *)0)->b);
if (align > sizeof(struct y)-sizeof(void *))
align = sizeof(struct y) - sizeof(void *);
|
6a3647 | 2000-12-19 | Marcus Comstedt | | if(!(f=fopen("conftest.out.2","w")))
return 1;
|
b2d7f3 | 2003-10-30 | Henrik Grubbström (Grubba) | |
fprintf(f, "%d\n", align);
|
6a3647 | 2000-12-19 | Marcus Comstedt | | fclose(f);
return 0;
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | }
],
pike_cv_hardware_alignment=`cat conftest.out.2`,
pike_cv_hardware_alignment=4,
pike_cv_hardware_alignment=4
)
fi
|
c6f4a8 | 2002-01-27 | Martin Stjernholm | | ])
|
6a3647 | 2000-12-19 | Marcus Comstedt | |
AC_MSG_RESULT($pike_cv_hardware_alignment)
|
b2d7f3 | 2003-10-30 | Henrik Grubbström (Grubba) | | AC_DEFINE_UNQUOTED(PIKE_POINTER_ALIGNMENT,$pike_cv_hardware_alignment)
|
6a3647 | 2000-12-19 | Marcus Comstedt | |
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #############################################################################
## Check if we should default to --with-machine-code
#############################################################################
if test "$with_machine_code" = "no"; then :; else
AC_MSG_CHECKING(machine code architecture)
AC_CACHE_VAL(pike_cv_machine_code_arch, [
pike_cv_machine_code_arch=unknown
AC_TRY_COMPILE([
|
fcca61 | 2016-02-11 | Martin Nilsson | | #ifdef __GNUC__
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #if !defined(__i386__) && !defined(__i386)
#error Not ia32 architecture
|
cfef2d | 2003-07-28 | Martin Stjernholm | | #endif
#elif defined(_MSC_VER)
#if !defined(_M_IX86)
#error Not ia32 architecture
#endif
#else
#error Unsupported compiler
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #endif
|
cdc01a | 2005-06-09 | Henrik Grubbström (Grubba) | | ], [], [
pike_cv_machine_code_arch=ia32
], [])
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | AC_TRY_COMPILE([
|
fcca61 | 2016-02-11 | Martin Nilsson | | #ifdef __GNUC__
|
52cf3b | 2011-05-11 | Henrik Grubbström (Grubba) | | #if !defined(__x86_64__) && !defined(__x86_64) && !defined(__amd64) && !defined(__amd64__)
#error Not amd64 architecture
#endif
#elif defined(_MSC_VER)
#if !defined(_M_X64)
#error Not amd64 architecture
#endif
#error Unsupported ABI.
#else
#error Unsupported compiler
#endif
], [], [
pike_cv_machine_code_arch=amd64
], [])
AC_TRY_COMPILE([
|
fcca61 | 2016-02-11 | Martin Nilsson | | #ifdef __GNUC__
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #if !defined(sparc) && !defined(__sparc__) && !defined(__sparc)
#error Not sparc architecture
|
cfef2d | 2003-07-28 | Martin Stjernholm | | #endif
#else
#error Unsupported compiler
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #endif
|
cdc01a | 2005-06-09 | Henrik Grubbström (Grubba) | | ], [], [
pike_cv_machine_code_arch=sparc
], [])
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | AC_TRY_COMPILE([
|
fcca61 | 2016-02-11 | Martin Nilsson | | #ifdef __GNUC__
|
320583 | 2002-04-08 | Marcus Comstedt | | #if !defined(__ppc__) && !defined(__powerpc__) && !defined(_POWER)
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #error Not ppc32 architecture
|
cfef2d | 2003-07-28 | Martin Stjernholm | | #endif
#else
#error Unsupported compiler
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | #endif
|
cdc01a | 2005-06-09 | Henrik Grubbström (Grubba) | | ], [], [
pike_cv_machine_code_arch=ppc32
], [])
|
a00f6f | 2007-04-01 | Marcus Comstedt | | AC_TRY_COMPILE([
|
fcca61 | 2016-02-11 | Martin Nilsson | | #ifdef __GNUC__
|
a00f6f | 2007-04-01 | Marcus Comstedt | | #if !defined(__PPC64__) && !defined(__powerpc64__)
#error Not ppc64 architecture
#endif
#else
#error Unsupported compiler
#endif
], [], [
pike_cv_machine_code_arch=ppc64
], [])
|
c2da76 | 2014-12-06 | Tobias S. Josefowitz | | AC_TRY_COMPILE([
#if defined(__GNUC__)
|
be0d01 | 2016-09-06 | Arne Goedeke | | #if !defined(__arm__)
|
c2da76 | 2014-12-06 | Tobias S. Josefowitz | | #error Not arm32 architecture
#endif
#else
#error Unsupported compiler
#endif
], [], [
pike_cv_machine_code_arch=arm32
], [])
|
3ea5d1 | 2016-08-15 | Marcus Comstedt | | AC_TRY_COMPILE([
#if defined(__GNUC__)
#if !defined(__aarch64__)
#error Not arm64 architecture
#endif
#else
#error Unsupported compiler
#endif
], [], [
pike_cv_machine_code_arch=arm64
], [])
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | ])
AC_MSG_RESULT($pike_cv_machine_code_arch)
if test "x$pike_cv_machine_code_arch" = xunknown ; then
with_machine_code="no"
else
with_machine_code="yes"
AC_DEFINE(PIKE_USE_MACHINE_CODE)
fi
fi
|
7a6404 | 2001-08-15 | Marcus Comstedt | | ########################################################################
if test yes = "$with_machine_code"; then
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(register name convention)
AC_CACHE_VAL(pike_cv_cpu_reg_prefix,
[
for pike_cv_cpu_reg_prefix in "default" "" "r" "%%" "%%r" "unknown"; do
AC_TRY_COMPILE([
|
7a6404 | 2001-08-15 | Marcus Comstedt | | #define REGPREFIX "$pike_cv_cpu_reg_prefix"
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ], [
|
320583 | 2002-04-08 | Marcus Comstedt | | #if defined(__ppc__) || defined(__powerpc__) || defined(_POWER)
|
7a6404 | 2001-08-15 | Marcus Comstedt | | __asm__ __volatile__(" li "REGPREFIX"11,1");
#else
|
a92414 | 2002-11-18 | Henrik Grubbström (Grubba) | | ; /* Do not need to find out */
|
7a6404 | 2001-08-15 | Marcus Comstedt | | #endif
],[break])
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | done
])
case "$pike_cv_cpu_reg_prefix" in
default|unknown) AC_MSG_RESULT($pike_cv_cpu_reg_prefix);;
*) AC_MSG_RESULT(${pike_cv_cpu_reg_prefix}0)
AC_DEFINE_UNQUOTED(PIKE_CPU_REG_PREFIX,"$pike_cv_cpu_reg_prefix");;
esac
|
7a6404 | 2001-08-15 | Marcus Comstedt | | else :; fi
|
2cf527 | 2010-10-17 | Artur Skawina | | ########################################################################
AC_MSG_CHECKING([for the RDTSC instruction (x86)])
AC_CACHE_VAL(pike_cv_have_rdtsc, [
AC_TRY_RUN([
static long long rdtsc()
{
unsigned long l, h;
|
6d4179 | 2010-10-30 | Martin Stjernholm | | #if defined (_M_IX86) || defined (_M_X64)
__asm {
rdtsc
mov l, eax
mov h, edx
}
#else
|
2cf527 | 2010-10-17 | Artur Skawina | | __asm__ __volatile__ ("rdtsc" :"=a" (l), "=d" (h));
|
6d4179 | 2010-10-30 | Martin Stjernholm | | #endif
|
2cf527 | 2010-10-17 | Artur Skawina | | return (((long long)h)<<32)|l;
}
int main()
{
if (rdtsc()!=rdtsc())
return 0;
return 1;
}
],[pike_cv_have_rdtsc=yes],[pike_cv_have_rdtsc=no],[pike_cv_have_rdtsc="possibly not"])])
AC_MSG_RESULT($pike_cv_have_rdtsc)
if test "$pike_cv_have_rdtsc" = yes; then
AC_DEFINE(HAVE_RDTSC)
fi
|
05030b | 1998-11-18 | Marcus Comstedt | | ########################################################################
MY_CHECK_FUNCTION(fork,
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ], [
|
05030b | 1998-11-18 | Marcus Comstedt | | exit(fork()==-1);
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ])
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | |
|
4bcc44 | 1998-07-22 | Fredrik Hübinette (Hubbe) | | ########################################################################
MY_CHECK_FUNCTION(fpsetmask,
[
#include <math.h>
#ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ], [
|
4bcc44 | 1998-07-22 | Fredrik Hübinette (Hubbe) | | fpsetmask(0);
exit(0);
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ])
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
b36a45 | 2000-03-28 | Henrik Grubbström (Grubba) | | MY_CHECK_FUNCTION(fpsetround,
[
#include <math.h>
#ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#ifndef FP_RN
#define FP_RN 0
#endif /* FP_RN */
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ], [
|
b36a45 | 2000-03-28 | Henrik Grubbström (Grubba) | | fpsetround(FP_RN);
exit(0);
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ])
|
b36a45 | 2000-03-28 | Henrik Grubbström (Grubba) | | ########################################################################
|
e1184f | 2001-01-24 | Marcus Comstedt | | MY_CHECK_FUNCTION(isless,
[
#include <math.h>
#ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
], [
int t = isless(0.0, 0.0);
exit(0);
])
########################################################################
|
5d4cf6 | 2004-01-12 | Marcus Comstedt | | MY_CHECK_FUNCTION(isunordered,
[
#include <math.h>
#ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
], [
int t = isunordered(0.0, 0.0);
exit(0);
])
|
159a2b | 2014-09-03 | Martin Nilsson | |
|
5d4cf6 | 2004-01-12 | Marcus Comstedt | | ########################################################################
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | MY_CHECK_FUNCTION(dlopen,
[
#include <dlfcn.h>
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ], [
|
de1608 | 1997-06-03 | Fredrik Hübinette (Hubbe) | | dlopen(0, 0);
exit(0);
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ])
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | |
|
69667d | 2017-04-21 | Henrik Grubbström (Grubba) | | ########################################################################
MY_CHECK_FUNCTION(rint,
[
#include <math.h>
#ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif /* HAVE_IEEEFP_H */
], [
#ifdef HAVE_FPSETROUND
/* Round to nearest */
#ifndef FP_RN
#define FP_RN 0
#endif /* FP_RN */
fpsetround(FP_RN);
#endif /* HAVE_FPSETROUND */
if(rint(0.1) != 0.0 ||
rint(0.6) != 1.0) exit(1);
exit(0);
])
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | #############################################################################
MY_CHECK_FUNCTION(GetSystemTimeAsFileTime,
[
|
25e474 | 2002-10-13 | Xavier Beaudouin | | #ifdef HAVE_WINDOWS_H
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | #include <windows.h>
|
25e474 | 2002-10-13 | Xavier Beaudouin | | #endif
#ifdef HAVE_WINBASE_H
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | #include <winbase.h>
|
25e474 | 2002-10-13 | Xavier Beaudouin | | #endif
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ], [
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | FILETIME f;
GetSystemTimeAsFileTime(&f);
exit(0);
])
#############################################################################
MY_CHECK_FUNCTION(gethostname,
[
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
|
f1a4ce | 2003-04-30 | Henrik Grubbström (Grubba) | | #ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#elif defined(HAVE_WINSOCK_H)
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | #include <winsock.h>
#endif
|
1a3f88 | 2000-08-21 | Henrik Grubbström (Grubba) | | ], [
|
964949 | 1998-02-27 | Fredrik Hübinette (Hubbe) | | char buffer[10000];
char *x=gethostname(buffer,sizeof(buffer));
exit(0);
])
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
85f59e | 1998-01-08 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(if we can declare environ)
AC_CACHE_VAL(pike_cv_declare_environ,[
AC_TRY_COMPILE([
#include <stdlib.h>
],[
extern char **environ;
exit(0);
],pike_cv_declare_environ=yes,pike_cv_declare_environ=no,pike_cv_declare_environ=yes)
])
AC_MSG_RESULT($pike_cv_declare_environ)
if test "x$pike_cv_declare_environ" = xyes ; then
AC_DEFINE(DECLARE_ENVIRON)
fi
#############################################################################
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | |
|
9dd220 | 1998-05-17 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([for union wait (old BSD convention)])
AC_CACHE_VAL(pike_cv_union_wait, [ AC_TRY_COMPILE([
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
|
d6980f | 1998-05-17 | Henrik Grubbström (Grubba) | | #endif /* HAVE_SYS_WAIT_H */
|
9dd220 | 1998-05-17 | Henrik Grubbström (Grubba) | | ], [
union wait status;
exit(0);
], pike_cv_union_wait=yes, pike_cv_union_wait=no)
])
AC_MSG_RESULT($pike_cv_union_wait)
if test "x$pike_cv_union_wait" = "xyes" ; then
|
f37617 | 1998-05-22 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING([whether union wait is really needed])
AC_CACHE_VAL(pike_cv_union_wait_needed, [ AC_TRY_COMPILE([
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif /* HAVE_SYS_WAIT_H */
], [
int status;
return WIFEXITED(status) || 0;
], pike_cv_union_wait_needed=no, pike_cv_union_wait_needed=yes)
])
|
efad7a | 1998-10-28 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT($pike_cv_union_wait_needed)
|
f37617 | 1998-05-22 | Henrik Grubbström (Grubba) | | if test "x$pike_cv_union_wait_needed" = "xyes" ; then
AC_DEFINE(HAVE_UNION_WAIT)
else :; fi
else :; fi
|
9dd220 | 1998-05-17 | Henrik Grubbström (Grubba) | |
#############################################################################
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(how to extract an unsigned char)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_method_extract_uchar,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | [
AC_TRY_RUN([
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | int main()
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | {
char i,*p;
i=-10;
p=&i;
if(*(unsigned char *)(p)!= 0x100 - 10) exit(1);
exit(0);
}
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | ],pike_cv_method_extract_uchar=by_cast,
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | pike_cv_method_extract_uchar=not_by_cast,
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | pike_cv_method_extract_uchar=not_by_cast)])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | if test "$pike_cv_method_extract_uchar" = by_cast; then
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(by cast)
AC_DEFINE(EXTRACT_UCHAR_BY_CAST)
else
AC_MSG_RESULT(not by cast)
fi
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(how to extract a signed char)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_method_extract_char,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | [
AC_TRY_RUN([
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | int main()
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | {
char i,*p;
i=-10;
p=&i;
if(*(signed char *)(p)!= -10) exit(1);
exit(0);
}
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | ],pike_cv_method_extract_char=by_cast,
|
75920f | 1997-12-28 | Fredrik Hübinette (Hubbe) | | pike_cv_method_extract_char=not_by_cast,
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | pike_cv_method_extract_char=not_by_cast)])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | if test "$pike_cv_method_extract_char" = by_cast; then
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(by cast)
AC_DEFINE(EXTRACT_CHAR_BY_CAST)
else
AC_MSG_RESULT(not by cast)
fi
|
d30082 | 1998-02-27 | Marcus Comstedt | |
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(if float conversion can cause SIGFPE)
AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe,
[
AC_TRY_RUN([
#include <math.h>
|
3b7ea3 | 1998-07-22 | Fredrik Hübinette (Hubbe) | | #ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
|
c371d4 | 1998-06-07 | Simon Coggins | | float foo_float = 0.0;
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | int main(int argc, char **argv)
{
|
c371d4 | 1998-06-07 | Simon Coggins | | float x=2.0, y=-128.0;
|
3b7ea3 | 1998-07-22 | Fredrik Hübinette (Hubbe) | | #ifdef HAVE_FPSETMASK
fpsetmask(0);
#endif
|
c371d4 | 1998-06-07 | Simon Coggins | | x = pow(2.0, -128.0);
foo_float = x;
if (x == 2.0) exit(1);
x = pow(2.0, 1024.0);
foo_float = x;
if(x == 2.0) exit(1);
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | exit(0);
}
|
e33f4c | 1998-06-28 | Henrik Grubbström (Grubba) | | ],pike_cv_sys_idiot_sigfpe=no,pike_cv_sys_idiot_sigfpe=yes,
pike_cv_sys_idiot_sigfpe=yes)
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | ])
if test $pike_cv_sys_idiot_sigfpe = yes ; then
AC_MSG_RESULT(yes)
|
c371d4 | 1998-06-07 | Simon Coggins | | IEEE_FLAG=no
if test "x${GCC-}" = xyes ; then
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | AC_SYS_COMPILER_FLAG(-mieee, mieee, CFLAGS,[],IEEE_FLAG=yes)
|
c371d4 | 1998-06-07 | Simon Coggins | | else
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | AC_SYS_COMPILER_FLAG(-ieee, ieee, CFLAGS,[],IEEE_FLAG=yes)
|
c371d4 | 1998-06-07 | Simon Coggins | | fi
TEST_IGNORE_SIGFPE=yes
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | |
|
c371d4 | 1998-06-07 | Simon Coggins | | if test $IEEE_FLAG = yes; then
AC_MSG_CHECKING(if float conversion is still broken)
AC_CACHE_VAL(pike_cv_sys_idiot_sigfpe_with_ieee,
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | [
|
8aa31a | 1998-06-07 | Henrik Grubbström (Grubba) | | OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $OPTIMIZE"
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | AC_TRY_RUN([
#include <math.h>
|
c371d4 | 1998-06-07 | Simon Coggins | |
|
3b7ea3 | 1998-07-22 | Fredrik Hübinette (Hubbe) | | #ifdef HAVE_FLOATINGPOINT_H
#include <floatingpoint.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
|
c371d4 | 1998-06-07 | Simon Coggins | | float foo_float = 0.0;
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | int main(int argc, char **argv)
{
|
c371d4 | 1998-06-07 | Simon Coggins | | float x=2.0, y=-128.0;
|
3b7ea3 | 1998-07-22 | Fredrik Hübinette (Hubbe) | | #ifdef HAVE_FPSETMASK
fpsetmask(0);
#endif
|
c371d4 | 1998-06-07 | Simon Coggins | | x = pow(2.0, -128.0);
foo_float = x;
if (x == 2.0) exit(1);
x = pow(2.0, 1024.0);
foo_float = x;
if(x == 2.0) exit(1);
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | exit(0);
}
|
e33f4c | 1998-06-28 | Henrik Grubbström (Grubba) | | ],pike_cv_sys_idiot_sigfpe_with_ieee=no,pike_cv_sys_idiot_sigfpe_with_ieee=yes,
pike_cv_sys_idiot_sigfpe_with_ieee=yes)
|
8aa31a | 1998-06-07 | Henrik Grubbström (Grubba) | | CFLAGS="$OLD_CFLAGS"
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | ])
|
13670c | 2015-05-25 | Martin Nilsson | |
|
c371d4 | 1998-06-07 | Simon Coggins | | if test $pike_cv_sys_idiot_sigfpe_with_ieee = yes ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
TEST_IGNORE_SIGFPE=no
fi
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | fi # IEEE_FLAG
if test $TEST_IGNORE_SIGFPE = yes; then
AC_MSG_CHECKING(if ignoring SIGFPE helps)
AC_CACHE_VAL(pike_cv_sys_ignore_sigfpe,
[
|
8aa31a | 1998-06-07 | Henrik Grubbström (Grubba) | | OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $OPTIMIZE"
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | AC_TRY_RUN([
|
8aa31a | 1998-06-07 | Henrik Grubbström (Grubba) | | #include <signal.h>
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | #include <math.h>
int counter=0;
RETSIGTYPE func(void)
{
if(counter++>10) exit(7);
signal(SIGFPE,func);
}
|
c371d4 | 1998-06-07 | Simon Coggins | | float foo_float = 0.0;
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | int main(int argc, char **argv)
{
|
c371d4 | 1998-06-07 | Simon Coggins | | float x=2.0, y=-128.0;
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | signal(SIGFPE,func);
|
c371d4 | 1998-06-07 | Simon Coggins | | x = pow(2.0, -128.0);
foo_float = x;
if (x == 2.0) exit(1);
x = pow(2.0, 1024.0);
foo_float = x;
if(x == 2.0) exit(1);
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | exit(0);
}
|
e33f4c | 1998-06-28 | Henrik Grubbström (Grubba) | | ],pike_cv_sys_ignore_sigfpe=yes,pike_cv_sys_ignore_sigfpe=no,
pike_cv_sys_ignore_sigfpe=yes)
|
8aa31a | 1998-06-07 | Henrik Grubbström (Grubba) | | CFLAGS="$OLD_CFLAGS"
|
71b44e | 1998-06-05 | Fredrik Hübinette (Hubbe) | | ])
if test "$pike_cv_sys_ignore_sigfpe" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(IGNORE_SIGFPE)
else
AC_MSG_RESULT(no)
fi
fi # TEST_IGNORE_SIGFPE
else
AC_MSG_RESULT(no)
fi # pike_cv_sys_idiot_sigfpe
#############################################################################
|
5ff14f | 1998-05-25 | Marcus Comstedt | | define(float_check, [[
#include <math.h>
#define TY $1
#define TEST_$1
#define TEST_$2
#define EXPECTED_SIZE_float 4
#define EXPECTED_SIZE_double 8
void check(TY n, char *pf, char *pd)
{
int i;
char *p, *p2 = (char*)&n;
#ifdef TEST_float
p = pf;
#else
p = pd;
#endif
for(i=0; i<sizeof(TY); i++)
#ifdef TEST_BIG
if(p[i] != p2[i])
exit(1);
#else
if(p[i] != p2[sizeof(TY)-i-1])
exit(1);
#endif
}
int main()
{
if(sizeof(TY)!=EXPECTED_SIZE_$1)
exit(1);
check((TY)0.0, "\000\000\000\000", "\000\000\000\000\000\000\000\000");
check((TY)1.0, "\077\200\000\000", "\077\360\000\000\000\000\000\000");
check((TY)-1.0, "\277\200\000\000", "\277\360\000\000\000\000\000\000");
check((TY)2.0, "\100\000\000\000", "\100\000\000\000\000\000\000\000");
check((TY)1.5, "\077\300\000\000", "\077\370\000\000\000\000\000\000");
check((TY)0.032999999821186065673828125, "\075\007\053\002", "\077\240\345\140\100\000\000\000");
exit(0);
}
]])
AC_MSG_CHECKING(for type of float)
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_float_type, [
AC_TRY_RUN(float_check(float,BIG), pike_cv_float_type=ieee_big, [
AC_TRY_RUN(float_check(float,LITTLE), pike_cv_float_type=ieee_little,
pike_cv_float_type=not_ieee, pike_cv_float_type=not_ieee)
], [
|
1f958f | 2000-08-21 | Henrik Grubbström (Grubba) | | echo $ac_n "crosscompiling... $ac_c" 1>&6
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | # Use some magical constants...
cat > conftest.$ac_ext <<EOF
dnl This sometimes fails to find confdefs.h, for some reason.
dnl [#]line __oline__ "[$]0"
[#]line __oline__ "configure"
#include "confdefs.h"
#include <stdio.h>
float float_info[[]] = {
0.0,
14914788644012054221422592.0, 16305677175569252352.0,
0.0
};
EOF
if AC_TRY_EVAL(ac_compile); then
if test -f "conftest.$ac_objext"; then
if strings "conftest.$ac_objext" | grep "iEeE_bIg" >/dev/null; then
pike_cv_float_type=ieee_big
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif strings "conftest.$ac_objext" | grep "EeEigIb_" >/dev/null; then
pike_cv_float_type=ieee_little
else
pike_cv_float_type=not_ieee
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | fi
else
|
0a8698 | 2003-11-07 | Martin Stjernholm | | AC_MSG_WARN([Object file not found - using default.])
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | pike_cv_float_type=not_ieee
fi
else
pike_cv_float_type=not_ieee
fi
|
fdb698 | 2000-08-20 | Henrik Grubbström (Grubba) | | rm -rf conftest*
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | ])
])
|
5ff14f | 1998-05-25 | Marcus Comstedt | | if test "$pike_cv_float_type" = ieee_big; then
AC_MSG_RESULT(IEEE big endian)
AC_DEFINE(FLOAT_IS_IEEE_BIG)
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif test "$pike_cv_float_type" = ieee_little; then
AC_MSG_RESULT(IEEE little endian)
AC_DEFINE(FLOAT_IS_IEEE_LITTLE)
|
5ff14f | 1998-05-25 | Marcus Comstedt | | else
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(not IEEE)
|
5ff14f | 1998-05-25 | Marcus Comstedt | | fi
AC_MSG_CHECKING(for type of double)
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | AC_CACHE_VAL(pike_cv_double_type, [
AC_TRY_RUN(float_check(double,BIG), pike_cv_double_type=ieee_big, [
AC_TRY_RUN(float_check(double,LITTLE), pike_cv_double_type=ieee_little,
pike_cv_double_type=not_ieee, pike_cv_double_type=not_ieee)
], [
|
1f958f | 2000-08-21 | Henrik Grubbström (Grubba) | | echo $ac_n "crosscompiling... $ac_c" 1>&6
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | # Use some magical constants...
cat > conftest.$ac_ext <<EOF
dnl This sometimes fails to find confdefs.h, for some reason.
dnl [#]line __oline__ "[$]0"
[#]line __oline__ "configure"
#include "confdefs.h"
#include <stdio.h>
double double_info[[]] = {
0.0,
12794738495187527498222028847205909954314554441725728393516969126669975252147490126864122090122288822751876426313291683594796075946303753742007913302630260537160845833197547903208108732031187791380480.0,
0.0
};
EOF
if AC_TRY_EVAL(ac_compile); then
if test -f "conftest.$ac_objext"; then
if strings "conftest.$ac_objext" | grep "iEeE_bIg" >/dev/null; then
pike_cv_double_type=ieee_big
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif strings "conftest.$ac_objext" | grep "gIb_EeEi" >/dev/null; then
pike_cv_double_type=ieee_little
else
pike_cv_double_type=not_ieee
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | fi
else
|
0a8698 | 2003-11-07 | Martin Stjernholm | | AC_MSG_WARN([Object file not found - using default.])
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | pike_cv_float_type=not_ieee
fi
else
pike_cv_float_type=not_ieee
fi
|
fdb698 | 2000-08-20 | Henrik Grubbström (Grubba) | | rm -rf conftest*
|
32cf26 | 2000-08-20 | Henrik Grubbström (Grubba) | | ])
])
|
5ff14f | 1998-05-25 | Marcus Comstedt | | if test "$pike_cv_double_type" = ieee_big; then
AC_MSG_RESULT(IEEE big endian)
AC_DEFINE(DOUBLE_IS_IEEE_BIG)
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | elif test "$pike_cv_double_type" = ieee_little; then
AC_MSG_RESULT(IEEE little endian)
AC_DEFINE(DOUBLE_IS_IEEE_LITTLE)
|
5ff14f | 1998-05-25 | Marcus Comstedt | | else
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT(not IEEE)
|
5ff14f | 1998-05-25 | Marcus Comstedt | | fi
#############################################################################
|
d30082 | 1998-02-27 | Marcus Comstedt | | AC_MSG_CHECKING(for volatile)
AC_CACHE_VAL(pike_cv_volatile,
[
AC_TRY_COMPILE([],[ volatile int foo=1;], pike_cv_volatile=yes,pike_cv_volatile=no)
])
if test "$pike_cv_volatile" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(VOLATILE,volatile)
else
AC_MSG_RESULT(no)
AC_DEFINE(VOLATILE,)
fi
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | |
|
61d3cf | 1998-02-27 | Marcus Comstedt | | AC_MSG_CHECKING(for sig_atomic_t)
AC_CACHE_VAL(ac_cv_type_sig_atomic_t,
[
AC_EGREP_CPP(sig_atomic_t, [
#include <signal.h>
|
9c9bf2 | 2000-08-04 | Henrik Grubbström (Grubba) | | #ifdef HAVE_CRT_SIGNAL_H
#include <crt/signal.h>
#endif
|
61d3cf | 1998-02-27 | Marcus Comstedt | | #include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ], ac_cv_type_sig_atomic_t=yes, ac_cv_type_sig_atomic_t=no)
])
|
61d3cf | 1998-02-27 | Marcus Comstedt | | AC_MSG_RESULT($ac_cv_type_sig_atomic_t)
if test x"$ac_cv_type_sig_atomic_t" = xno; then
AC_DEFINE(sig_atomic_t, int)
else
:
fi
|
c8a4ce | 1995-11-20 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(if signal handlers reset automatically)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_sys_signal_oneshot,
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | [
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_TRY_RUN([
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | #include <signal.h>
|
61d3cf | 1998-02-27 | Marcus Comstedt | | #include <sys/types.h>
#include <stdlib.h>
#include <stddef.h>
|
3a86f2 | 2005-12-06 | Adam Montague | | #ifdef HAVE_POLL_H
#include <poll.h>
#endif
|
450e9d | 2001-05-08 | Henrik Grubbström (Grubba) | | VOLATILE sig_atomic_t sigrun[2]= { 0, 0 };
|
607710 | 1999-05-15 | Henrik Grubbström (Grubba) | | RETSIGTYPE func(int sig)
{
write(2, "func called\n", sizeof("func called\n") - sizeof(""));
|
450e9d | 2001-05-08 | Henrik Grubbström (Grubba) | | sigrun[0] = -1;
|
607710 | 1999-05-15 | Henrik Grubbström (Grubba) | | }
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | |
int main()
{
#define sig SIGSEGV
#ifdef HAVE_SIGACTION
{
|
fb140c | 2002-04-07 | Marcus Comstedt | | static struct sigaction action;
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | action.sa_handler= func;
sigfillset(&action.sa_mask);
#ifdef SA_INTERRUPT
action.sa_flags=SA_INTERRUPT;
#endif
sigaction(sig,&action,0);
}
#else
#ifdef HAVE_SIGVEC
{
|
fb140c | 2002-04-07 | Marcus Comstedt | | static struct sigvec action;
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | action.sv_handler= func;
action.sv_mask=-1;
#ifdef SV_INTERRUPT
action.sv_flags=SV_INTERRUPT;
#endif
sigvec(sig,&action,0);
}
#else
signal(sig, func);
#endif
#endif
kill(getpid(), sig);
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | | #ifdef HAVE_POLL
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | struct pollfd sentinel;
while(!strlen((char *)sigrun)) poll(&sentinel,0,100);
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | | #else
|
450e9d | 2001-05-08 | Henrik Grubbström (Grubba) | | while(!strlen((char *)sigrun)) sleep(1);
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | | #endif
|
450e9d | 2001-05-08 | Henrik Grubbström (Grubba) | | sigrun[0]=0;
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | kill(getpid(), sig);
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | | #ifdef HAVE_POLL
|
3ce091 | 2003-10-10 | Henrik Grubbström (Grubba) | | while(!strlen((char *)sigrun)) poll(&sentinel,0,100);
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | | #else
|
450e9d | 2001-05-08 | Henrik Grubbström (Grubba) | | while(!strlen((char *)sigrun)) sleep(1);
|
a3c9a7 | 2000-10-13 | Fredrik Hübinette (Hubbe) | | #endif
|
450e9d | 2001-05-08 | Henrik Grubbström (Grubba) | | sigrun[0]=0;
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | exit(0);
}
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ],pike_cv_sys_signal_oneshot=no,pike_cv_sys_signal_oneshot=yes,pike_cv_sys_signal_oneshot=yes)
])
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | |
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | if test "$pike_cv_sys_signal_oneshot" = yes; then
|
93b808 | 1995-11-02 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(yes)
AC_DEFINE(SIGNAL_ONESHOT)
else
AC_MSG_RESULT(no)
fi
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(full availability of struct rusage members)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_func_getrusage_full,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | [
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_TRY_LINK([
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #include <sys/time.h>
#ifdef HAVE_SYS_RUSAGE_H
#include <sys/rusage.h>
#endif
#include <sys/resource.h>
#ifndef RUSAGE_SELF
#define RUSAGE_SELF 0
#endif
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ],[
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct rusage rus;
long *v = (long *)main;
getrusage(RUSAGE_SELF, &rus);
*v++ = rus.ru_maxrss;
*v++ = rus.ru_ixrss;
*v++ = rus.ru_idrss;
*v++ = rus.ru_isrss;
*v++ = rus.ru_minflt;
*v++ = rus.ru_majflt;
*v++ = rus.ru_nswap;
*v++ = rus.ru_inblock;
*v++ = rus.ru_oublock;
*v++ = rus.ru_msgsnd;
*v++ = rus.ru_msgrcv;
*v++ = rus.ru_nsignals;
*v++ = rus.ru_nvcsw;
*v++ = rus.ru_nivcsw;
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ],
pike_cv_func_getrusage_full=yes
,
pike_cv_func_getrusage_full=no
)
])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | if test "$pike_cv_func_getrusage_full" = yes; then
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(all there)
else
AC_MSG_RESULT(getrusage is restricted)
AC_DEFINE(GETRUSAGE_RESTRICTED)
fi
|
07513e | 1996-10-04 | Fredrik Hübinette (Hubbe) | | ########################################################################
|
221347 | 1997-09-16 | Henrik Grubbström (Grubba) | | if test "$ac_cv_header_sys_procfs_h" = "yes"; then
AC_MSG_CHECKING(getrusage() through procfs)
AC_CACHE_VAL(pike_cv_getrusage_procfs, [
AC_TRY_COMPILE([
|
c5f17c | 1998-06-04 | Henrik Grubbström (Grubba) | | #ifndef _LARGEFILE_SOURCE
# define _FILE_OFFSET_BITS 64
# define _LARGEFILE_SOURCE
# define _LARGEFILE64_SOURCE 1
#endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #include <sys/procfs.h>
#include <sys/fcntl.h>
int proc_fd;
|
d20354 | 1998-06-10 | Fredrik Hübinette (Hubbe) | | long tmp;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | char proc_name[20];
|
c5f17c | 1998-06-04 | Henrik Grubbström (Grubba) | | prusage_t pru;
|
221347 | 1997-09-16 | Henrik Grubbström (Grubba) | | ],[
sprintf(proc_name, "/proc/%05d", getpid());
proc_fd = open(proc_name, O_RDONLY);
ioctl(proc_fd, PIOCUSAGE, &pru);
|
d20354 | 1998-06-10 | Fredrik Hübinette (Hubbe) | | tmp=pru.pr_utime.tv_sec;
|
221347 | 1997-09-16 | Henrik Grubbström (Grubba) | | ],
pike_cv_getrusage_procfs=yes
,
pike_cv_getrusage_procfs=no
)
])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
eb42e8 | 1997-09-16 | Henrik Grubbström (Grubba) | | if test "$pike_cv_getrusage_procfs" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(GETRUSAGE_THROUGH_PROCFS)
else
AC_MSG_RESULT(no)
fi
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | fi
|
c411dc | 1997-04-21 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
bdb509 | 1996-09-25 | Fredrik Hübinette (Hubbe) | |
|
76aa1f | 2000-03-25 | Fredrik Hübinette (Hubbe) | | if test "$ac_cv_getrusage_procfs" = "yes"; then
AC_MSG_CHECKING(prstatus_t contains pr_brksize and pr_stksize)
AC_CACHE_VAL(pike_cv_getrusage_procfs_prs, [
AC_TRY_COMPILE([
#ifndef _LARGEFILE_SOURCE
# define _FILE_OFFSET_BITS 64
# define _LARGEFILE_SOURCE
# define _LARGEFILE64_SOURCE 1
#endif
#include <sys/procfs.h>
#include <sys/fcntl.h>
int proc_fd;
long tmp;
char proc_name[20];
prstatus_t prs;
],[
sprintf(proc_name, "/proc/%05d", getpid());
proc_fd = open(proc_name, O_RDONLY);
ioctl(proc_fd, PIOCSTATUS, &prs);
tmp=prs.pr_brksize + prs.pr_stksize;
],
pike_cv_getrusage_procfs_prs=yes
,
pike_cv_getrusage_procfs_prs=no
)
])
if test "$pike_cv_getrusage_procfs_prs" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(GETRUSAGE_THROUGH_PROCFS_PRS)
else
AC_MSG_RESULT(no)
fi
fi
|
94cf72 | 1998-07-11 | Henrik Grubbström (Grubba) | | #############################################################################
#
# __func__ is new in ISO C 9x
#
# It should expand to the name of the current function, and is
# useful for debug.
AC_MSG_CHECKING(if __func__ exists and works)
AC_CACHE_VAL(pike_cv_have_working___func__,
[
AC_TRY_RUN([
#include <string.h>
int main()
{
exit(strcmp("main", __func__));
}
], pike_cv_have_working___func__=yes, pike_cv_have_working___func__=no,
pike_cv_have_working___func__=no)
])
AC_MSG_RESULT($pike_cv_have_working___func__)
if test "$pike_cv_have_working___func__" = yes; then
AC_DEFINE(HAVE_WORKING___FUNC__)
else :; fi
|
7f4195 | 1998-07-11 | Henrik Grubbström (Grubba) | | # gcc has __FUNCTION__ instead.
AC_MSG_CHECKING(if __FUNCTION__ exists and works)
AC_CACHE_VAL(pike_cv_have_working___FUNCTION__,
[
AC_TRY_RUN([
#include <string.h>
int main()
{
exit(strcmp("main", __FUNCTION__));
}
], pike_cv_have_working___FUNCTION__=yes,
pike_cv_have_working___FUNCTION__=no,
pike_cv_have_working___FUNCTION__=no)
])
AC_MSG_RESULT($pike_cv_have_working___FUNCTION__)
if test "$pike_cv_have_working___FUNCTION__" = yes; then
AC_DEFINE(HAVE_WORKING___FUNCTION__)
else :; fi
|
371176 | 1998-05-18 | Henrik Grubbström (Grubba) | | #############################################################################
|
7e2ee2 | 2001-07-08 | Henrik Grubbström (Grubba) | |
if test "x$with_computed_goto" = "xyes"; then
AC_MSG_CHECKING(for gcc-style computed goto)
AC_CACHE_VAL(pike_cv_gcc_computed_goto, [
AC_TRY_COMPILE([], [
void *skip = &&label;
goto *skip;
return 1;
label:
return 0;
], [ pike_cv_gcc_computed_goto=yes ], [ pike_cv_gcc_computed_goto=no ])
|
0341d0 | 2001-07-08 | Henrik Grubbström (Grubba) | | ])
|
cf9945 | 2001-07-08 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT($pike_cv_gcc_computed_goto)
|
7e2ee2 | 2001-07-08 | Henrik Grubbström (Grubba) | | if test "x$pike_cv_gcc_computed_goto" = "xyes"; then
|
b7890d | 2002-12-11 | Mirar (Pontus Hagland) | | PIKE_MSG_WARN([Enabling computed goto (EXPERIMENTAL).])
|
7e2ee2 | 2001-07-08 | Henrik Grubbström (Grubba) | | AC_DEFINE(HAVE_COMPUTED_GOTO)
else :; fi
else :; fi
#############################################################################
|
ef6d66 | 2002-04-07 | Martin Stjernholm | |
if test "$with_machine_code" = "yes" ; then
|
9762e0 | 2002-04-17 | Martin Stjernholm | | AC_DEFINE_UNQUOTED(PIKE_BYTECODE_METHOD, [[PIKE_BYTECODE_`echo $pike_cv_machine_code_arch | tr '[a-z]' '[A-Z]'`]])
|
91d3b1 | 2002-04-07 | Martin Stjernholm | | byte_code_format=$pike_cv_machine_code_arch
|
2c2e84 | 2006-02-26 | Martin Stjernholm | | elif test "x$with_computed_goto" = "xyes" -a "x$pike_cv_gcc_computed_goto" = "xyes"; then
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | AC_DEFINE(PIKE_BYTECODE_METHOD, PIKE_BYTECODE_GOTO)
|
91d3b1 | 2002-04-07 | Martin Stjernholm | | byte_code_format="computed goto"
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | else
AC_DEFINE(PIKE_BYTECODE_METHOD, PIKE_BYTECODE_DEFAULT)
|
91d3b1 | 2002-04-07 | Martin Stjernholm | | byte_code_format="virtual machine"
|
ef6d66 | 2002-04-07 | Martin Stjernholm | | fi
#############################################################################
|
371176 | 1998-05-18 | Henrik Grubbström (Grubba) | |
|
f96866 | 2000-08-21 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for lc __declspec)
AC_CACHE_VAL(pike_cv_lc___declspec,
[
AC_TRY_RUN([
#include <stdarg.h>
__declspec(noreturn) void fatal(char *foo,...);
__declspec(noreturn) void fatal(char *foo,...)
{
va_list args;
va_start(foo,args);
printf(foo,args);
va_end(args);
exit(2);
}
int main() { exit(0); }
], pike_cv_lc___declspec=yes, pike_cv_lc___declspec=no, [
echo $ac_n "crosscompiling... $ac_c" 1>&6
AC_TRY_LINK([
#include <stdarg.h>
__declspec(noreturn) void fatal(char *foo,...);
__declspec(noreturn) void fatal(char *foo,...)
{
va_list args;
va_start(foo,args);
printf(foo,args);
va_end(args);
exit(2);
}
], [
exit(0);
], pike_cv_lc___declspec=yes, pike_cv_lc___declspec=no)
])
])
AC_MSG_RESULT($pike_cv_lc___declspec)
if test "$pike_cv_lc___declspec" = yes; then
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_DEFINE(HAVE_DECLSPEC)
|
5c25cb | 2015-04-28 | Jonas Walldén | | fi
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | |
|
5c25cb | 2015-04-28 | Jonas Walldén | | AC_MSG_CHECKING(for gcc function attributes)
AC_CACHE_VAL(pike_cv_gcc_attributes,
[
AC_TRY_RUN([
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | #include <stdarg.h>
|
b9d355 | 2014-12-02 | Arne Goedeke | | #include <stdio.h>
#include <stdlib.h>
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | void fatal(char *foo,...) __attribute__ ((noreturn,format (printf,1,2)));
int sqr(int x) __attribute__ ((const));
int sqr(int x) { return x*x; }
void fatal(char *foo,...)
{
va_list args;
|
b9d355 | 2014-12-02 | Arne Goedeke | | va_start(args, foo);
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | printf(foo,args);
va_end(args);
exit(2);
}
int main() { exit(0); }
|
5c25cb | 2015-04-28 | Jonas Walldén | | ], pike_cv_gcc_attributes=yes, pike_cv_gcc_attributes=no, [
echo $ac_n "crosscompiling... $ac_c" 1>&6
AC_TRY_LINK([
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | #include <stdarg.h>
|
b9d355 | 2014-12-02 | Arne Goedeke | | #include <stdio.h>
#include <stdlib.h>
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | void fatal(char *foo,...) __attribute__ ((noreturn,format (printf,1,2)));
int sqr(int x) __attribute__ ((const));
int sqr(int x) { return x*x; }
void fatal(char *foo,...)
{
va_list args;
|
b9d355 | 2014-12-02 | Arne Goedeke | | va_start(args, foo);
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | printf(foo,args);
va_end(args);
exit(2);
}
|
5c25cb | 2015-04-28 | Jonas Walldén | | ], [
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | exit(0);
|
5c25cb | 2015-04-28 | Jonas Walldén | | ], pike_cv_gcc_attributes=yes, pike_cv_gcc_attributes=no)
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | | ])
|
5c25cb | 2015-04-28 | Jonas Walldén | | ])
|
9b6287 | 2002-10-03 | Henrik Grubbström (Grubba) | |
|
5c25cb | 2015-04-28 | Jonas Walldén | | AC_MSG_RESULT($pike_cv_gcc_attributes)
if test "$pike_cv_gcc_attributes" = yes; then
AC_DEFINE(HAVE_FUNCTION_ATTRIBUTES)
|
f96866 | 2000-08-21 | Henrik Grubbström (Grubba) | | fi
|
46a4ce | 2004-11-09 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(if va_list is a state pointer)
AC_CACHE_VAL(pike_cv_va_list_is_state_ptr, [
AC_TRY_RUN([
#include <stdarg.h>
void bar(va_list args)
{
va_arg(args, int);
}
int foo(int a, ...)
{
va_list args;
va_start(args, a);
bar(args);
a = va_arg(args, int);
va_end(args);
return a;
}
int main()
{
return foo(2, 1, 0);
}
], pike_cv_va_list_is_state_ptr=yes,
pike_cv_va_list_is_state_ptr=no,
# FIXME:
pike_cv_va_list_is_state_ptr=unknown
)
])
if test "$pike_cv_va_list_is_state_ptr" = "yes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(VA_LIST_IS_STATE_PTR)
elif test "$pike_cv_va_list_is_state_ptr" = "unknown"; then
# FIXME: "no" works on most stuff except gcc/x86_64.
AC_MSG_RESULT(unknown -- assume no)
else
AC_MSG_RESULT(no)
fi
|
f6249c | 2008-03-29 | Martin Stjernholm | | # Can't use AC_CHECK_FUNC for this since it usually is a macro.
AC_MSG_CHECKING(for va_copy)
AC_CACHE_VAL(pike_cv_has_va_copy, [
AC_TRY_LINK([
#include <stdarg.h>
#ifndef va_copy
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | void *f = (void *) va_copy;
|
f6249c | 2008-03-29 | Martin Stjernholm | | #endif
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ], [
|
f6249c | 2008-03-29 | Martin Stjernholm | | #ifdef va_copy
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | /* If there is a macro with this name we assume it takes the place of the function. */
return 0;
|
f6249c | 2008-03-29 | Martin Stjernholm | | #else
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | return f != va_copy;
|
f6249c | 2008-03-29 | Martin Stjernholm | | #endif
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | ], pike_cv_has_va_copy=yes, pike_cv_has_va_copy=no)
|
f6249c | 2008-03-29 | Martin Stjernholm | | ])
if test "$pike_cv_has_va_copy" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_VA_COPY)
else
AC_MSG_RESULT(no)
fi
|
7a5e47 | 1999-11-22 | Fredrik Hübinette (Hubbe) | | #############################################################################
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(how to set things nonblocking)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | AC_CACHE_VAL(pike_cv_sys_nonblock,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | [
|
59bc1b | 1997-01-22 | Bernhard Fastenrath | | # Kludge needed for AmigaOS
|
092a0e | 1997-03-05 | Henrik Grubbström (Grubba) | | if test "$pike_cv_sys_os" = "AmigaOS" ; then
|
59bc1b | 1997-01-22 | Bernhard Fastenrath | | pike_cv_sys_nonblock=USE_FCNTL_O_NONBLOCK
else
|
ed7aeb | 2000-06-16 | Henrik Grubbström (Grubba) | | OCPPFLAGS="$CPPFLAGS"
|
1ac5c0 | 2002-09-02 | Henrik Grubbström (Grubba) | | pike_cv_sys_bad_signal_handling=""
|
a09e4f | 2001-01-21 | Henrik Grubbström (Grubba) | | pike_cv_sys_nonblock=UNKNOWN
|
80f626 | 2002-08-13 | Henrik Grubbström (Grubba) | | # USE_FCNTL_O_NONBLOCK seems to be the most common, so let's start
# with it.
for method in USE_FCNTL_O_NONBLOCK USE_FCNTL_FNDELAY USE_FCNTL_O_NDELAY \
|
a09e4f | 2001-01-21 | Henrik Grubbström (Grubba) | | USE_IOCTL_FIONBIO USE_IOCTLSOCKET_FIONBIO; do
# Make sure we can run configure in a separate directory,
# and set the method to try.
|
ed616b | 2003-02-08 | Martin Stjernholm | | CPPFLAGS="$OCPPFLAGS -D$method"
|
a09e4f | 2001-01-21 | Henrik Grubbström (Grubba) | | AC_TRY_RUN([
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #define TESTING
|
d4f9e9 | 2000-05-19 | Martin Stjernholm | | #include "fd_control.c"
|
a09e4f | 2001-01-21 | Henrik Grubbström (Grubba) | | ], [
pike_cv_sys_nonblock=$method
break;
], [], [
AC_TRY_LINK([
|
bdfb86 | 1997-12-22 | Fredrik Hübinette (Hubbe) | | #define TESTING
|
d4f9e9 | 2000-05-19 | Martin Stjernholm | | #include "fd_control.c"
|
a09e4f | 2001-01-21 | Henrik Grubbström (Grubba) | | #define main dummy_main
], [], [
pike_cv_sys_nonblock=$method
break;
])
])
done
|
1ac5c0 | 2002-09-02 | Henrik Grubbström (Grubba) | | if test "$pike_cv_sys_nonblock" = "UNKNOWN"; then
# Some OS's don't like signals in combination with threads.
# Try compiling half the test...
# USE_FCNTL_O_NONBLOCK seems to be the most common, so let's start
# with it.
for method in USE_FCNTL_O_NONBLOCK USE_FCNTL_FNDELAY USE_FCNTL_O_NDELAY \
USE_IOCTL_FIONBIO USE_IOCTLSOCKET_FIONBIO; do
# Make sure we can run configure in a separate directory,
# and set the method to try.
|
ed616b | 2003-02-08 | Martin Stjernholm | | CPPFLAGS="$OCPPFLAGS -D$method -DSHORT_TEST"
|
1ac5c0 | 2002-09-02 | Henrik Grubbström (Grubba) | | AC_TRY_RUN([
#define TESTING
#include "fd_control.c"
], [
pike_cv_sys_bad_signal_handling=" (signal handling failed)"
pike_cv_sys_nonblock=$method
break;
], [], [
|
be5d89 | 2002-09-03 | Henrik Grubbström (Grubba) | | :; # Not meaningful.
|
1ac5c0 | 2002-09-02 | Henrik Grubbström (Grubba) | | ])
done
else :; fi
|
ed7aeb | 2000-06-16 | Henrik Grubbström (Grubba) | | # Restore CPPFLAGS
CPPFLAGS="$OCPPFLAGS"
|
59bc1b | 1997-01-22 | Bernhard Fastenrath | | fi
])
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
a09e4f | 2001-01-21 | Henrik Grubbström (Grubba) | | if test "${pike_cv_sys_nonblock}" = "UNKNOWN"; then
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | AC_MSG_RESULT(none found)
|
6c8437 | 2002-09-03 | Henrik Grubbström (Grubba) | | if test "${pike_cv_sys_os}" = "Windows_NT"; then :; else
config_fail="No way to set nonblocking I/O"
fi
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | else
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | AC_MSG_RESULT($pike_cv_sys_nonblock$pike_cv_sys_bad_signal_handling)
AC_DEFINE_UNQUOTED($pike_cv_sys_nonblock)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | fi
rm -f core
|
bcf946 | 1998-01-27 | Fredrik Hübinette (Hubbe) | | ##########################################################################
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | AC_MSG_CHECKING(how well OOB handling works)
AC_CACHE_VAL(pike_cv_system_oob_working,[
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | if test "x$enable_binary" = "xno"; then
pike_cv_system_oob_working=WORKING
else
AC_TRY_RUN([
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | #include <stdio.h>
|
929f1f | 2009-11-28 | Martin Stjernholm | | #include <string.h>
#include <stdlib.h>
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | #include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/stat.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif
#include <fcntl.h>
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#define SP_DEBUG(X) fprintf X
#ifndef POLLRDNORM
#define POLLRDNORM POLLIN
#endif
#ifndef POLLRDBAND
#define POLLRDBAND POLLPRI
#endif
#ifndef POLLWRBAND
#define POLLWRBAND POLLOUT
#endif
int set_nonblocking(int fd,int which)
{
int ret;
|
13670c | 2015-05-25 | Martin Nilsson | | do
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | {
#if defined(USE_IOCTL_FIONBIO) || defined(__NT__)
ret=ioctl(fd, FIONBIO, &which);
#else
#ifdef USE_FCNTL_O_NDELAY
ret=fcntl(fd, F_SETFL, which?O_NDELAY:0);
#else
#ifdef USE_FCNTL_O_NONBLOCK
ret=fcntl(fd, F_SETFL, which?O_NONBLOCK:0);
#else
#ifdef USE_FCNTL_FNDELAY
ret=fcntl(fd, F_SETFL, which?FNDELAY:0);
#else
#error Do not know how to set your filedescriptors nonblocking.
#endif
#endif
#endif
#endif
} while(ret <0 && errno==EINTR);
return ret;
}
|
751093 | 2012-06-30 | Henrik Grubbström (Grubba) | | FILE *output;
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | static int socketpair_fd = -1;
int my_socketpair(int family, int type, int protocol, int sv[2])
{
static struct sockaddr_in my_addr;
struct sockaddr_in addr,addr2;
int retries=0;
ACCEPT_SIZE_T len;
|
5453c0 | 2014-09-03 | Martin Nilsson | | memset(&addr,0,sizeof(struct sockaddr_in));
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | |
if(socketpair_fd==-1)
{
if((socketpair_fd=socket(AF_INET, SOCK_STREAM, 0)) < 0) {
SP_DEBUG((stderr, "my_socketpair:socket() failed, errno:%d\n",
errno));
return -1;
}
|
5453c0 | 2014-09-03 | Martin Nilsson | | memset(&my_addr,0,sizeof(struct sockaddr_in));
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | my_addr.sin_family=AF_INET;
my_addr.sin_addr.s_addr=htonl(INADDR_ANY);
my_addr.sin_port=htons(0);
if(bind(socketpair_fd, (struct sockaddr *)&my_addr, sizeof(addr)) < 0)
{
SP_DEBUG((stderr, "my_socketpair:bind() failed, errno:%d\n",
errno));
close(socketpair_fd);
socketpair_fd=-1;
return -1;
}
len = sizeof(my_addr);
if(getsockname(socketpair_fd,(struct sockaddr *)&my_addr,&len) < 0)
{
SP_DEBUG((stderr, "my_socketpair:getsockname() failed, errno:%d\n",
errno));
close(socketpair_fd);
socketpair_fd=-1;
return -1;
}
if(listen(socketpair_fd, 5) < 0)
{
SP_DEBUG((stderr, "my_socketpair:listen() failed, errno:%d\n",
errno));
close(socketpair_fd);
socketpair_fd=-1;
return -1;
}
set_nonblocking(socketpair_fd, 1);
my_addr.sin_addr.s_addr=inet_addr("127.0.0.1");
}
if((sv[1]=socket(AF_INET, SOCK_STREAM, 0)) <0) {
SP_DEBUG((stderr, "my_socketpair:socket() failed, errno:%d (2)\n",
errno));
return -1;
}
retry_connect:
retries++;
if(connect(sv[1], (struct sockaddr *)&my_addr, sizeof(addr)) < 0)
{
SP_DEBUG((stderr, "my_socketpair:connect() failed, errno:%d (%d)\n",
errno, EWOULDBLOCK));
if(errno != EWOULDBLOCK)
{
int tmp2;
|
751093 | 2012-06-30 | Henrik Grubbström (Grubba) | | #ifdef ETIMEDOUT
if (errno == ETIMEDOUT) {
SP_DEBUG((stderr,
"my_socketpair: ETIMEDOUT!\n"
"Do you have a firewall in the way?\n"));
/* ETIMEDOUT hints that quite a bit of time has passed,
* so no need for further retries. */
fprintf(output, "TIMEOUT\n");
exit(0);
}
#endif
#ifdef ECONNREFUSED
if (errno == ECONNREFUSED) {
SP_DEBUG((stderr,
"my_socketpair: ECONNREFUSED!\n"
"Do you have a firewall in the way?\n"));
}
#endif
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | for(tmp2=0;tmp2<20;tmp2++)
{
int tmp;
ACCEPT_SIZE_T len2;
len2=sizeof(addr);
tmp=accept(socketpair_fd,(struct sockaddr *)&addr,&len2);
if(tmp!=-1) {
SP_DEBUG((stderr, "my_socketpair:accept() failed, errno:%d\n",
errno));
close(tmp);
}
else
break;
}
if(retries > 20) return -1;
goto retry_connect;
}
}
do
{
ACCEPT_SIZE_T len3;
len3=sizeof(addr);
retry_accept:
sv[0]=accept(socketpair_fd,(struct sockaddr *)&addr,&len3);
if(sv[0] < 0) {
SP_DEBUG((stderr, "my_socketpair:accept() failed, errno:%d (2)\n",
errno));
if(errno==EINTR) goto retry_accept;
close(sv[1]);
return -1;
}
set_nonblocking(sv[0],0);
len=sizeof(addr);
if(getpeername(sv[0], (struct sockaddr *)&addr,&len)) {
SP_DEBUG((stderr, "my_socketpair:getpeername() failed, errno:%d\n",
errno));
return -1;
}
len=sizeof(addr);
if(getsockname(sv[1],(struct sockaddr *)&addr2,&len) < 0) {
SP_DEBUG((stderr, "my_socketpair:getsockname() failed, errno:%d\n",
errno));
return -1;
}
}while(len < (int)sizeof(addr) ||
addr2.sin_addr.s_addr != addr.sin_addr.s_addr ||
addr2.sin_port != addr.sin_port);
SP_DEBUG((stderr, "my_socketpair: succeeded\n",
errno));
return 0;
}
int socketpair_ultra(int family, int type, int protocol, int sv[2])
{
int retries=0;
while(1)
{
int ret=my_socketpair(family, type, protocol, sv);
if(ret>=0) return ret;
switch(errno)
{
case EAGAIN: break;
case EADDRINUSE:
if(retries++ > 10) return ret;
break;
default:
return ret;
}
}
}
struct pollfd pollset[2];
int fds[2];
static int sent=0;
int xcalls=0;
int ping(int fd)
{
int r;
sent++;
if(sent > 10000)
{
fprintf(output,xcalls ? "SEMIWORKING" : "WORKING");
exit(0);
}
do {
r=send(fds[fd],"x",1,MSG_OOB);
}while(r < 0 && errno==EINTR);
if(r!=1)
{
|
751093 | 2012-06-30 | Henrik Grubbström (Grubba) | | SP_DEBUG((stderr,
"ping(%d): send(%d, \"x\", 1, MSG_OOB) failed with errno %d\n",
fd, fds[fd], errno));
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | fprintf(output,"XBYTES\n");
exit(0);
}
pollset[fd].events &=~ POLLWRBAND;
pollset[!fd].events |= POLLRDBAND;
}
int pong(int fd)
{
char foo[2];
int r;
do {
r=recv(fds[fd], &foo, 2, MSG_OOB);
}while(r < 0 && errno==EINTR);
if(r!=1)
{
fprintf(output,"XBYTES\n");
exit(0);
}
pollset[fd].events &=~ POLLRDBAND;
pollset[fd].events |= POLLWRBAND;
}
void pang(int fd)
{
char foo[2];
int r;
xcalls++;
do {
r=recv(fds[fd], &foo, 2, 0);
}while(r < 0 && errno==EINTR);
if(r<0 && errno==EAGAIN) return;
fprintf(output,"INLINED\n");
exit(0);
}
int main(int argc, char **argv)
{
int e;
output=fopen("conftest.out.2","w");
socketpair_ultra(AF_UNIX, SOCK_STREAM, 0, fds);
#define INIT(X) do {\
set_nonblocking(fds[X],1); \
pollset[X].fd=fds[X]; \
pollset[X].events=POLLIN; \
}while(0);
INIT(0);
INIT(1);
ping(0);
while(1)
{
|
e8841d | 2014-10-01 | Per Hedbor | | if(!poll(pollset, 2, 500))
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | {
fprintf(output,sent>1 ? "WORKS_A_LITTLE\n" : "TIMEOUT\n");
exit(0);
}
for(e=0;e<2;e++)
{
|
a363e6 | 2013-03-18 | Chris Angelico | | if(pollset[e].revents & POLLERR) exit(1);
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | if(pollset[e].revents & POLLRDBAND) pong(e);
if(pollset[e].revents & POLLWRBAND) ping(e);
if(pollset[e].revents & POLLIN) pang(e);
}
}
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | }
],
pike_cv_system_oob_working="`cat conftest.out.2`",
pike_cv_system_oob_working=UNKNOWN,
pike_cv_system_oob_working=UNKNOWN)
|
13670c | 2015-05-25 | Martin Nilsson | |
|
0c4c48 | 2010-01-18 | Henrik Grubbström (Grubba) | | rm -f conftest.out.2 >/dev/null 2>/dev/null || :
fi
|
29c183 | 2001-02-02 | Fredrik Hübinette (Hubbe) | | ])
AC_MSG_RESULT($pike_cv_system_oob_working)
case "x$pike_cv_system_oob_working" in
xWORKING) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,3) ;;
xSEMIWORKING) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,2) ;;
xINLINED) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,1) ;;
xWORKS_A_LITTLE) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,1) ;;
xXBYTES) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,0) ;;
xTIMEOUT) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,0) ;;
*) AC_DEFINE_UNQUOTED(PIKE_OOB_WORKS,-1) ;; #unknown
esac
|
18099a | 2001-03-04 | Mirar (Pontus Hagland) | |
#######################################################################
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | MY_AC_CHECK_PRINTF_INT_TYPE(size_t,
|
e80e62 | 2003-02-20 | Martin Stjernholm | | "z" "" "l" "ll" "L", "",
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | PRINTSIZET,
[%${res}u, %${res}x])
MY_AC_CHECK_PRINTF_INT_TYPE(ptrdiff_t,
|
e80e62 | 2003-02-20 | Martin Stjernholm | | "t" "" "l" "ll" "L", "",
|
3c6eaa | 2002-04-12 | Martin Stjernholm | | PRINTPTRDIFFT,
[%${res}d, %${res}x])
|
e170f1 | 2006-07-05 | Martin Stjernholm | | MY_AC_CHECK_PRINTF_INT_TYPE(off_t,
"" "t" "j" "l" "ll" "L", "",
PRINTOFFT,
[%${res}d, %${res}x])
|
fcb4c1 | 2003-02-14 | Martin Stjernholm | | MY_AC_CHECK_PRINTF_INT_TYPE(INT64,
|
5ce002 | 2003-04-01 | Martin Stjernholm | | "" "l" "ll" "I64" "L", "l",
|
fcb4c1 | 2003-02-14 | Martin Stjernholm | | PRINTINT64,
[%${res}d, %${res}x])
|
18099a | 2001-03-04 | Mirar (Pontus Hagland) | |
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #############################################################################
|
86ebe1 | 2016-11-12 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for C99-style designator struct initialization)
AC_CACHE_VAL(pike_cv_c99_struct_init, [
AC_TRY_COMPILE([
struct foo {
int a;
float b;
} f = { .b = 0.5, .a = 1 };
], [], [ pike_cv_c99_struct_init=yes
], [ pike_cv_c99_struct_init=no ])
])
if test "x$pike_cv_c99_struct_init" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_C99_STRUCT_INIT, [], [C99-style struct initialization supported.])
else
AC_MSG_RESULT(no)
fi
#############################################################################
|
72a9d2 | 2017-04-11 | Henrik Grubbström (Grubba) | | AC_MSG_CHECKING(for C99-style struct literal expressions)
AC_CACHE_VAL(pike_cv_c99_struct_literal_expr, [
AC_TRY_COMPILE([
struct foo {
int a;
float b;
};
], [
struct foo f = ((struct foo){ 1, 0.5 });
], [ pike_cv_c99_struct_literal_expr=yes
], [ pike_cv_c99_struct_literal_expr=no ])
])
if test "x$pike_cv_c99_struct_literal_expr" = "xyes"; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_C99_STRUCT_LITERAL_EXPR, [],
[C99-style struct literal expressions supported.])
else
AC_MSG_RESULT(no)
fi
#############################################################################
|
04343e | 2007-06-17 | Martin Stjernholm | | AC_MSG_CHECKING(if port.c works in CONFIGURE_TEST mode)
AC_CACHE_VAL(pike_cv_configure_test_port_c, [
AC_TRY_RUN([
#include <stdio.h>
#define CONFIGURE_TEST
/* The following headers can cause problems in this mode, and they easily
get indirectly included unless we do this. */
#define STRALLOC_H
#define SVALUE_H
#define ARRAY_H
#include "port.c"
int main()
{
return 0;
}
], pike_cv_configure_test_port_c=yes,
pike_cv_configure_test_port_c=no,
pike_cv_configure_test_port_c=unknown)
])
AC_MSG_RESULT($pike_cv_configure_test_port_c)
if test "x$pike_cv_configure_test_port_c" = xno; then
AC_MSG_ERROR([
port.c does not work in CONFIGURE_TEST mode. This is an internal
problem in Pike. configure aborted since further configure tests will
be unreliable.
])
exit 1
fi
#############################################################################
AC_MSG_CHECKING(if gettimeofday takes two arguments)
AC_CACHE_VAL(pike_cv_func_gettimeofday_has_two_args,
[
AC_TRY_RUN([
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifndef HAVE_STRUCT_TIMEVAL
struct timeval
{
long tv_sec;
long tv_usec;
};
#endif
int main() {
struct timeval tv;
gettimeofday(&tv,(void *)0);
exit(0);
}
], [ pike_cv_func_gettimeofday_has_two_args=yes
], [ pike_cv_func_gettimeofday_has_two_args=no
], [
AC_TRY_LINK([
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifndef HAVE_STRUCT_TIMEVAL
struct timeval
{
long tv_sec;
long tv_usec;
};
#endif
], [
{
struct timeval tv;
gettimeofday(&tv,(void *)0);
exit(0);
}
], [ pike_cv_func_gettimeofday_has_two_args=yes ], [pike_cv_func_gettimeofday_has_two_args=no])
])
])
if test $pike_cv_func_gettimeofday_has_two_args = yes; then
AC_DEFINE(GETTIMEOFDAY_TAKES_TWO_ARGS)
fi
AC_MSG_RESULT($pike_cv_func_gettimeofday_has_two_args)
if test "x$ac_cv_func_gethrvtime" = xyes; then
AC_MSG_CHECKING(if gethrvtime really works)
AC_CACHE_VAL(pike_cv_func_gethrvtime_works, [
AC_TRY_RUN([
#include <stdio.h>
#define CONFIGURE_TEST
/* The following headers can cause problems in this mode, and they easily
get indirectly included unless we do this. */
#define STRALLOC_H
#define SVALUE_H
#define ARRAY_H
#include "port.c"
int main()
{
time_t start = TIME (0), now;
hrtime_t vt = gethrvtime(), next_vt;
if (start == (time_t) -1) return 1; /* Normal time doesn't work. */
do { /* Take some cpu time. */
now = TIME (0);
next_vt = gethrvtime();
if (next_vt < vt) return 2; /* Shouldn't go backward. */
vt = next_vt;
} while (now != (time_t) -1 && now <= start + 1);
if (now == (time_t) -1) return 3; /* Normal time does not work. */
if (vt <= 0) return 4; /* Should have accounted for some cpu time. */
return 0;
}
], pike_cv_func_gethrvtime_works=yes,
pike_cv_func_gethrvtime_works=no,
pike_cv_func_gethrvtime_works=no)
])
AC_MSG_RESULT($pike_cv_func_gethrvtime_works)
if test "x$pike_cv_func_gethrvtime_works" = xyes; then
AC_DEFINE(HAVE_WORKING_GETHRVTIME)
fi
fi
|
2fbeae | 2001-07-01 | Martin Stjernholm | | #######################################################################
|
c7f271 | 2007-06-09 | Martin Stjernholm | | AC_MSG_CHECKING(if rusage.c works in CONFIGURE_TEST mode)
AC_CACHE_VAL(pike_cv_configure_test_rusage_c, [
AC_TRY_RUN([
|
a3eadb | 2017-05-23 | Henrik Grubbström (Grubba) | | #define POSIX_SOURCE 1
#define _POSIX_C_SOURCE 200112L
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #include <stdio.h>
|
0f4c6f | 2007-06-11 | Martin Stjernholm | |
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #define CONFIGURE_TEST
|
0f4c6f | 2007-06-11 | Martin Stjernholm | | /* The following headers can cause problems in this mode, and they easily
get indirectly included unless we do this. */
|
11e268 | 2007-06-10 | Martin Stjernholm | | #define STRALLOC_H
|
0f4c6f | 2007-06-11 | Martin Stjernholm | | #define SVALUE_H
#define ARRAY_H
|
bff5a8 | 2007-06-11 | Martin Stjernholm | | #include "port.c" /* Tested earlier, but might be required. */
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #include "rusage.c"
|
0f4c6f | 2007-06-11 | Martin Stjernholm | |
|
c7f271 | 2007-06-09 | Martin Stjernholm | | int main()
{
init_rusage();
return 0;
}
], pike_cv_configure_test_rusage_c=yes,
pike_cv_configure_test_rusage_c=no,
pike_cv_configure_test_rusage_c=unknown)
])
AC_MSG_RESULT($pike_cv_configure_test_rusage_c)
if test "x$pike_cv_configure_test_rusage_c" = xno; then
AC_MSG_ERROR([
rusage.c does not work in CONFIGURE_TEST mode. This is an internal
problem in Pike. configure aborted since further configure tests will
be unreliable.
])
exit 1
fi
AC_MSG_CHECKING(if threads.c works in CONFIGURE_TEST mode)
AC_CACHE_VAL(pike_cv_configure_test_threads_c, [
AC_TRY_RUN([
|
a3eadb | 2017-05-23 | Henrik Grubbström (Grubba) | | #define POSIX_SOURCE 1
#define _POSIX_C_SOURCE 200112L
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #include <stdio.h>
|
0f4c6f | 2007-06-11 | Martin Stjernholm | |
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #define CONFIGURE_TEST
|
0f4c6f | 2007-06-11 | Martin Stjernholm | | /* The following headers can cause problems in this mode, and they easily
get indirectly included unless we do this. */
|
11e268 | 2007-06-10 | Martin Stjernholm | | #define STRALLOC_H
|
0f4c6f | 2007-06-11 | Martin Stjernholm | | #define SVALUE_H
#define ARRAY_H
|
bff5a8 | 2007-06-11 | Martin Stjernholm | | #include "port.c" /* Tested earlier, but might be required. */
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #include "threads.c"
|
0f4c6f | 2007-06-11 | Martin Stjernholm | |
|
c7f271 | 2007-06-09 | Martin Stjernholm | | int main()
{
return 0;
}
], pike_cv_configure_test_threads_c=yes,
pike_cv_configure_test_threads_c=no,
pike_cv_configure_test_threads_c=unknown)
])
AC_MSG_RESULT($pike_cv_configure_test_threads_c)
if test "x$pike_cv_configure_test_threads_c" = xno; then
AC_MSG_ERROR([
threads.c does not work in CONFIGURE_TEST mode. This is an internal
problem in Pike. configure aborted since further configure tests will
be unreliable.
])
exit 1
fi
#######################################################################
|
247f73 | 2007-06-10 | Martin Stjernholm | | AC_MSG_CHECKING(if fallback cpu time is thread local)
|
83b184 | 2003-02-08 | Martin Stjernholm | | AC_CACHE_VAL(pike_cv_thread_local_cpu_time, [
|
025dd3 | 2003-02-11 | Martin Stjernholm | | rm -f confdefs.out.2 2>/dev/null
|
83b184 | 2003-02-08 | Martin Stjernholm | | AC_TRY_RUN([
|
a3eadb | 2017-05-23 | Henrik Grubbström (Grubba) | | #define POSIX_SOURCE 1
#define _POSIX_C_SOURCE 200112L
|
83b184 | 2003-02-08 | Martin Stjernholm | | #include <stdio.h>
#ifdef PIKE_THREADS
#define CONFIGURE_TEST
|
0f4c6f | 2007-06-11 | Martin Stjernholm | | #define CONFIGURE_TEST_FALLBACK_GCT
/* The following headers can cause problems in this mode, and they easily
get indirectly included unless we do this. */
|
11e268 | 2007-06-10 | Martin Stjernholm | | #define STRALLOC_H
|
0f4c6f | 2007-06-11 | Martin Stjernholm | | #define SVALUE_H
#define ARRAY_H
|
83b184 | 2003-02-08 | Martin Stjernholm | |
|
2913ba | 2003-02-11 | Martin Stjernholm | | #include "port.c"
|
83b184 | 2003-02-08 | Martin Stjernholm | | #include "rusage.c"
#include "threads.c"
PIKE_MUTEX_T m;
COND_T c;
cpu_time_t work_time, wait_time;
TH_RETURN_TYPE work_thread (void *dummy)
{
|
0cf33b | 2003-08-04 | Martin Stjernholm | | struct timeval rt_start, rt;
|
83b184 | 2003-02-08 | Martin Stjernholm | | cpu_time_t start;
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("work_thread waiting.\n", stderr);
|
83b184 | 2003-02-08 | Martin Stjernholm | | mt_lock (&m);
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("work_thread start.\n", stderr);
|
0cf33b | 2003-08-04 | Martin Stjernholm | | GETTIMEOFDAY (&rt_start);
|
83b184 | 2003-02-08 | Martin Stjernholm | | start = get_cpu_time();
|
9d2b70 | 2003-02-09 | Martin Stjernholm | | do {
cpu_time_t t = get_cpu_time();
|
0cf33b | 2003-08-04 | Martin Stjernholm | | GETTIMEOFDAY (&rt);
|
9d2b70 | 2003-02-09 | Martin Stjernholm | | if (t == (cpu_time_t) -1) {
work_time = t;
break;
}
work_time = t - start;
|
0cf33b | 2003-08-04 | Martin Stjernholm | | } while (work_time < (CPU_TIME_TICKS / 10) && rt.tv_sec <= rt_start.tv_sec + 1);
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("work_thread releasing main.\n", stderr);
|
83b184 | 2003-02-08 | Martin Stjernholm | | co_signal (&c);
mt_unlock (&m);
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("work_thread done.\n", stderr);
|
5ce002 | 2003-04-01 | Martin Stjernholm | | return 0;
|
83b184 | 2003-02-08 | Martin Stjernholm | | }
int main()
{
cpu_time_t start;
THREAD_T worker;
|
025dd3 | 2003-02-11 | Martin Stjernholm | | FILE *res = fopen ("confdefs.out.2", "w"); /* weird name to circumvent configure cleanups */
|
83b184 | 2003-02-08 | Martin Stjernholm | | if (!res) return 2;
|
c7f271 | 2007-06-09 | Martin Stjernholm | | init_rusage();
|
83b184 | 2003-02-08 | Martin Stjernholm | | really_low_th_init();
mt_init (&m);
co_init (&c);
mt_lock (&m);
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("Creating work_thread.\n", stderr);
|
83b184 | 2003-02-08 | Martin Stjernholm | | if (th_create (&worker, work_thread, NULL)) {
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("unknown (failed to create thread)", res);
|
83b184 | 2003-02-08 | Martin Stjernholm | | fclose (res);
|
c5e173 | 2003-02-08 | Martin Stjernholm | | return 3;
|
83b184 | 2003-02-08 | Martin Stjernholm | | }
|
9d2b70 | 2003-02-09 | Martin Stjernholm | |
|
83b184 | 2003-02-08 | Martin Stjernholm | | start = get_cpu_time();
co_wait (&c, &m);
wait_time = get_cpu_time() - start;
|
9d2b70 | 2003-02-09 | Martin Stjernholm | | if (start == (cpu_time_t) -1 || work_time == (cpu_time_t) -1) {
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("unknown (get_cpu_time does not work)", res);
|
83b184 | 2003-02-08 | Martin Stjernholm | | fclose (res);
|
c5e173 | 2003-02-08 | Martin Stjernholm | | return 4;
|
83b184 | 2003-02-08 | Martin Stjernholm | | }
|
2913ba | 2003-02-11 | Martin Stjernholm | | if (work_time < (CPU_TIME_TICKS / 10)) {
|
7199a7 | 2004-10-21 | Henrik Grubbström (Grubba) | | fprintf (res, "unknown (get_cpu_time does not work - loop took only %ld ms)",
|
811b8f | 2003-02-12 | Martin Stjernholm | | (long) (work_time / (CPU_TIME_TICKS / 1000)));
|
2913ba | 2003-02-11 | Martin Stjernholm | | fclose (res);
return 5;
}
|
83b184 | 2003-02-08 | Martin Stjernholm | |
if (work_time > wait_time)
|
d0b461 | 2003-08-06 | Henrik Grubbström (Grubba) | | return 0; /* It is thread local. */
|
83b184 | 2003-02-08 | Martin Stjernholm | | else {
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("no", res);
|
83b184 | 2003-02-08 | Martin Stjernholm | | fclose (res);
|
d0b461 | 2003-08-06 | Henrik Grubbström (Grubba) | | return 1; /* It is not thread local. */
|
83b184 | 2003-02-08 | Martin Stjernholm | | }
}
#else
int main()
{
|
025dd3 | 2003-02-11 | Martin Stjernholm | | FILE *res = fopen ("confdefs.out.2", "w"); /* weird name to circumvent configure cleanups */
|
2913ba | 2003-02-11 | Martin Stjernholm | | if (!res) return 6;
|
dc64a5 | 2017-08-08 | Martin Nilsson | | fputs("no", res);
|
83b184 | 2003-02-08 | Martin Stjernholm | | fclose (res);
return 1;
}
#endif
], [
pike_cv_thread_local_cpu_time=yes
], [
|
c7f271 | 2007-06-09 | Martin Stjernholm | | if test -f confdefs.out.2 && test "x`cat confdefs.out.2`" != x; then
|
025dd3 | 2003-02-11 | Martin Stjernholm | | pike_cv_thread_local_cpu_time=`cat confdefs.out.2`
|
83b184 | 2003-02-08 | Martin Stjernholm | | else
|
5f6088 | 2007-06-10 | Martin Stjernholm | | AC_MSG_ERROR([
|
c7f271 | 2007-06-09 | Martin Stjernholm | |
Test failed to compile or execute.
Problems in port.c, rusage.c or threads.c with CONFIGURE_TEST is defined?
])
|
701c4d | 2003-04-02 | Martin Stjernholm | | # Don't set pike_cv_thread_local_cpu_time here so that the
# failure doesn't get cached.
|
c7f271 | 2007-06-09 | Martin Stjernholm | | result="unknown (compilation or execution failed)"
|
5f6088 | 2007-06-10 | Martin Stjernholm | | exit 1
|
83b184 | 2003-02-08 | Martin Stjernholm | | fi
], [
pike_cv_thread_local_cpu_time="unknown (cross compilation)"
])
|
025dd3 | 2003-02-11 | Martin Stjernholm | | rm -f confdefs.out.2 2>/dev/null
|
83b184 | 2003-02-08 | Martin Stjernholm | | ])
|
701c4d | 2003-04-02 | Martin Stjernholm | | test x"$pike_cv_thread_local_cpu_time" != x && result="$pike_cv_thread_local_cpu_time"
AC_MSG_RESULT($result)
|
83b184 | 2003-02-08 | Martin Stjernholm | | if test "$pike_cv_thread_local_cpu_time" = yes; then
|
247f73 | 2007-06-10 | Martin Stjernholm | | AC_DEFINE(FB_CPU_TIME_IS_THREAD_LOCAL, PIKE_YES)
|
83b184 | 2003-02-08 | Martin Stjernholm | | elif test "$pike_cv_thread_local_cpu_time" = no; then
|
247f73 | 2007-06-10 | Martin Stjernholm | | AC_DEFINE(FB_CPU_TIME_IS_THREAD_LOCAL, PIKE_NO)
|
83b184 | 2003-02-08 | Martin Stjernholm | | else
|
247f73 | 2007-06-10 | Martin Stjernholm | | AC_DEFINE(FB_CPU_TIME_IS_THREAD_LOCAL, PIKE_UNKNOWN)
|
83b184 | 2003-02-08 | Martin Stjernholm | | fi
#######################################################################
|
5cdc99 | 2008-07-08 | Henrik Grubbström (Grubba) | | AC_CHECK_FUNCS([setenv unsetenv])
|
065432 | 2008-06-10 | <